query
stringlengths 7
5.25k
| document
stringlengths 15
1.06M
| metadata
dict | negatives
listlengths 3
101
| negative_scores
listlengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
////////////////////////////////////////////////////////////////////////// PROCESS A QUERY ////////////////////////////////////////////////////////////////////////// | protected function process($query) {
if (!$this->connection) return new pudlPgSqlResult($this);
$result = @pg_query($this->connection, $query);
return new pudlPgSqlResult($this, $result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function query();",
"function query() {}",
"public function executeQuery() {\r\n\t\t$query = $this->query;\r\n\t\t$query->matching($query->logicalAnd($this->queryConstraints));\r\n//$parser = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\Storage\\\\Typo3DbQueryParser'); \r\n//$queryParts = $parser->parseQuery($query); \r\n//\\TYPO3\\CMS\\Core\\Utility\\DebugUtility::debug($queryParts, 'Query Content');\r\n\t\t$queryResult = $query->execute()->toArray();\r\n\t\t$this->setSelectedPageUids($queryResult);\r\n\t\t$this->resetQuery(); \r\n\t\treturn $queryResult;\r\n\t}",
"public function doQuery() {\n // Selects all of ads' title and writer's name\n $queryString = \"SELECT title, name FROM advertisements INNER JOIN users ON users.id = advertisements.userid ORDER BY advertisements.id DESC\";\n\n $getAds = $this->sql->query($queryString);\n\n // Store the result array in the $data variable, which can be available by getData() later\n while($rows = $getAds->fetch_array(MYSQLI_ASSOC)) {\n array_push($this->data, $rows);\n }\n }",
"public function query();",
"public function query();",
"public function query();",
"function query() {\n }",
"public function _query()\n {\n }",
"public function query()\n\t{\n\t\t\n\t}",
"protected function execute_single_query(){\n\t\t$this -> open_connection();\n\t\t$this -> conn -> query($this -> query);\n\t\t$this -> close_connection();\n\t}",
"protected abstract function executeQuery($query);",
"abstract function query( $p_filter_input );",
"protected function get_results_from_query() \n\t\t{\n \t\t\t$this->open_connection();\n \t\t\t$result = $this->conn->query($this->query);\n \t\t\twhile ($this->rows[] = $result->fetch_assoc());\n \t\t\t$result->close();\n \t\t\t$this->close_connection();\n \t\t\tarray_pop($this->rows);\n\t\t}",
"abstract protected function _query($sql);",
"abstract protected function doQuery( $sql );",
"public static function query();",
"protected function execute_single_query() \n\t\t{\n \t\t\t$this->open_connection();\n \t\t\t$this->conn->query($this->query);\n \t\t\t$this->close_connection();\n\t\t}",
"function createQuery() ;",
"function executeQuery($query);",
"protected abstract function executeQuery(Result $result);",
"function DBReadQuery($query){\n $result = DBExecute($query);\n\n if(!mysqli_num_rows($result)){\n return false;\n }\n else{\n while ($res = mysqli_fetch_assoc($result)) {\n # code...\n $info[] = $res;\n }\n return $info;\n }\n // Executa Querys\n }",
"function process_query_index( $query )\n\t{\n\t\treturn $query;\n\t}",
"public function runQuery(){\n \n $query = $this->getQuery();\n $pager = $this->getPager();\n $modify_result = $this->getModifyResult();\n\n // set default number of results so that we don't output NULL as \n // total_results if there are errors\n $pager->setTotalResults( 0 );\n $results = array();\n \n if( !$this->getResponse()->hasErrors() ){\n \t\n \t $count_query = clone $query;\n\t $pager->setTotalResults( $count_query->count() );\n \t $pager->decorateQuery( $query );\n \n\t if( $pager->getPageSize() > 0 ){\n\t $db_results = $query->find();\n\t foreach( $db_results as $model ){\n\t $result_object = array();\n\t $modify_result( $model, $result_object );\n\t $results[] = $result_object;\n\t }\n\t }\n\t \n }\n \n $api_response_body = $this->getResponse()->getResponseBody();\n $api_response_body->setBody($results);\n \n }",
"private function exeQuery($query, $retureType = true){ // method exeQuery body start\n\t\t$dbResult \t\t= $this->query($query);\n\t\t\n\t\tif($dbResult){\n\t\t\tif($retureType){\n\t\t\t\t\n\t\t\t\t$allRecords\t\t\t= array();\n\t\t\t\t\n\t\t\t\t// Fetching array from query result\n\t\t\t\twhile($row = $dbResult->fetch_array(MYSQLI_ASSOC)){\n\t\t\t\t\t$allRecords[] \t= $row;\n\t\t\t\t}\n\t\t\t\treturn $allRecords;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Fetching number of rows from query result\n\t\t\t\t$result \t\t= $dbResult->fetch_array($dbResult);\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo \"Error: query is not working\";exit;\n\t\t}\n\t\t \n\t}",
"function query( $query ){\r\n\t\t\r\n\t\tif( ( $query || $query=$this->query ) && !isset( $this->result[$query] ) ){\r\n\t\t\tif( $this->result[$query] = mysql_query( $query, $this->link ) ){\t\r\n\t\t\t\tmysql::$nquery++;\r\n\t\t\t\treturn $this->result[ $this->query = $query ];\r\n\t\t\t}\r\n\t\t\telse{\r\n \t\ttrigger_error( mysql_error($this->link) . \"<br/><font color=\\\"red\\\">$query</font><br/>\", E_USER_ERROR );\r\n \t\t// if debug mode on query error stop the execution\r\n\t \tif( isset($GLOBALS['debug']) && $GLOBALS['debug'] == true )\r\n\t\t \texit;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn $this->result[ $query ];\r\n\t}",
"public abstract function get_query();",
"protected function get_result_from_query(){\n\t\t$this ->open_connection();\n\t\t$result = $this -> conn -> query($this -> query);\n\t\twhile($this -> rows[] = $result ->fetch_assoc());\n\t\t$result -> close();\n\t\t$this -> close_connection();\n\t\tarray_pop($this -> rows); // Extraé y devuelve el último valor\n\t}",
"function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }",
"abstract public function exec($query='');",
"public function execute($query);",
"private function execute () {\n if($this->_query->execute()) {\n\n // It has been succesful so add the output to $this->results and set it as an object\n $this->_results = $this->_query->fetchAll(PDO::FETCH_OBJ);\n\n // Set the affected row count to $this->_count\n $this->_count = $this->_query->rowCount();\n\n } else {\n\n // The query failed so set $this->_error to true. MORE WORK NEEDED HERE\n $this->_error = true;\n\n }\n }",
"protected function _handle_query()\n\t{\t\n\t\t$this->_http_query = $this->_request;\n\t\t$response_object = $this->payments->gateway_request($this->_api_endpoint, $this->_http_query, 'application/x-www-form-urlencoded');\n\t\treturn $this->_parse_response($response_object);\n\t}",
"public function get_results() {\n\t\t//Begin actual functon\n\t\t$arg_check = $this->query_arg_check();\n\t\t\n\t\t//Check for matching number of arguments in query and arg array\n\t\tif (!$arg_check) {\n\t\t\t$this->except( MYSQLI_ERR_ARG_NUM_MISMATCH , $this->QUERY);\n\t\t} else {\n\t\t\t//Begin running the query\n\t\t\tif ($stmt = $this->connection->prepare($this->QUERY)) {\n\t\t\t\t\n\t\t\t\t$bind_values = array();\n\t\t\t\t$bind_types = '';\n\t\t\t\t$i=0;\n\t\t\n\t\t\t\t//NEW::change made to be able to run queries without having to pass arguments\n\t\t\t\tif(is_array($this->QUERY_ARGS))\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->QUERY_ARGS as $id=>$value) \n\t\t\t\t\t{\n\t\t\t\t\t\t//NEW::change made to be able to run queries without having to pass arguments\n\t\t\t\t\t\tif ($value)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$bind_values[$i] = $value['value'];\n\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t$bind_types .= $value['type'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tcall_user_func_array('mysqli_stmt_bind_param',\n\t\t\t\t\t\t\t\t\t array_merge ( array($stmt,$bind_types),\n\t\t\t\t\t\t\t\t\t $this->ref_values($bind_values)\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t \n\t\t\t\t$count = $stmt->execute();\n\t\t\t\t\n\t\t\t\t//Get sql result based on query type\n\t\t\t\tswitch ($this->QUERY_TYPE) {\n\t\t\t\t\tcase 'SELECT';\n\t\t\t\t\t\t$result_class_object = $this->fetch_data($stmt);\n\t\t\t\t\t\t$result = $this->std_class_object_to_array($result_class_object);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'INSERT';\n\t\t\t\t\t\t$result = $stmt->insert_id;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault; // UPDATE and others\n\t\t\t\t\t\t$result = $count;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$stmt->close();\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}",
"abstract public function execute($query);",
"public function apply($query);",
"function queryExecute($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in queryExecute function\",E_ERROR);\r\n\t\t}\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\r\n\t\tif($this->socket->query($query) === true) {\r\n\t\t\t$this->recordsUpdated = $this->socket->affected_rows;\r\n\t\t}\r\n\t}",
"public function query($query);",
"public function query($query);",
"public function query($query);",
"private function process_input()\n\t{\n\t//\t$report_end_datetime = OurTime::js_to_datetime($this->f_report_end, 1);\n\t\t\n\t\t$this->m_product_info_arr = DB::get_all_rows_fq ('\n\t\t\tSELECT products.*\n\t\t\tFROM products\n\t\t');\n\t\t\n\t\t//TESTING: show how many rows we got:\n\t\t//echo count($this->m_obj_info_arr);*/\n\n\t}",
"function tep_db_query($query){\n\t\tglobal $db;\n\t\treturn($db->Execute($query));\n\t}",
"private function RunBasicQuery() {\n // Prepare the Query\n $this->stmt = $this->db->prepare($this->sql);\n \n // Run the Query in the Database\n $this->stmt->execute();\n \n // Store the Number Of Rows Returned\n $this->num_rows = $this->stmt->rowCount();\n \n // Work with the results (as an array of objects)\n $this->rs = $this->stmt->fetchAll();\n \n // Free the statement\n $this->stmt->closeCursor(); \n }",
"private function executeQuery() {\n\t\t$recordset = $this->getConnection()->execute( $this );\n\t\t\n\t\tif( $recordset === false ) {\n\t\t\t$this->_recordset = array();\n\t\t} else {\n\t\t\t$this->_recordset = $recordset;\n\t\t}\n\n\t\t$this->_currentRow = 0;\n\t\t$this->isDirty( false );\n\t}",
"function customQuery($query) \t{\n $res = $this->execute($query);\n\t\t return $res;\n\t}",
"public function query()\n {\n }",
"public function query()\n {\n }",
"function process_list_query1($query)\n {\n\tglobal $log;\n\t$log->debug(\"Entering process_list_query1(\".$query.\") method ...\");\n\n $result =& $this->db->query($query,true,\"Error retrieving $this->object_name list: \");\n $list = Array();\n $rows_found = $this->db->getRowCount($result);\n if($rows_found != 0)\n {\n\t\t $contact = Array();\n for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index))\n\n {\n foreach($this->range_fields as $columnName)\n {\n if (isset($row[$columnName])) {\n\n $contact[$columnName] = $row[$columnName];\n }\n else\n {\n $contact[$columnName] = \"\";\n }\n\t }\n// TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence\n// vtiger_account query goes for ecery single vtiger_account row\n\n $list[] = $contact;\n }\n }\n\n $response = Array();\n $response['list'] = $list;\n $response['row_count'] = $rows_found;\n $response['next_offset'] = $next_offset;\n $response['previous_offset'] = $previous_offset;\n\n\n\t$log->debug(\"Exiting process_list_query1 method ...\");\n return $response;\n }",
"abstract function executeQuery($cons);",
"private function runQuery($query_request) {\n\n $stmt = $this->conn->prepare($query_request);\n\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function query( $query )\n {\n $this->free( );\n $this->db_query_result = @ mysql_query( $query );\n $this->fields_of_current_query = array();\n if ( $this->db_query_result )\n {\n $l_fnum = @mysql_num_fields($this->db_query_result);\n if($l_fnum > 0)\n {\n for($i = 0; $i < $l_fnum; $i++)\n $this->fields_of_current_query[] = mysql_field_name($this->db_query_result,$i);\n //var_dump($this->fields_of_current_query);\n }\n return true;\n }\n\n return false;\n }",
"function doQuery($query,$db='')\n\t{\n\n\t\tglobal $stats;\n\n\t\tif (DEBUG)\n\t\t{\n\t\t\t$stats['queries'][]\t= $query;\n\t\t\t$stats['querycount']\t= $stats['querycount']+1;\t// Number of queries\n\t\t}\n\n\t\t// change DB if neccessary\n\n\t\tif ($db!=='')\n\t\t\tselectDB($db);\n\n\t\t// perform query\n\n\t\t$result\t= @mssql_query($query);\n\n\t\tif (DEBUG)\n\t\t{\n\n\t\t\t$fh\t= @fopen(BASEDIR.'data'.DIRECTORY_SEPARATOR.'dblog.txt','a');\n\t\t\t@fputs($fh,$query.\"\\n\");\n\n\t\t\tif ($result !== true)\n\t\t\t{\n\n\t\t\t\t$error\t\t= mssql_get_last_message();\n\n\t\t\t\tif ((stristr($error,'Changed database context') === false) && (stristr($error,'Datenbankkontext wurde auf') === false))\n\t\t\t\t{\n\t\t\t\t\t@fputs($fh,\"\\n\".'ERROR: '.mssql_get_last_message().\"\\n\");\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t@fputs($fh,\"\\n\\n\".str_repeat('=',80).\"\\n\\n\\n\");\n\n\t\t\t@fclose($fh);\n\n\t\t}\n\n\t\t//\n\n\t\treturn $result;\n\n\t}",
"private function _handle_query()\n\t{\t\n\t\t$this->_http_query = $this->_request;\n\t\t\n\t\t$response_object = $this->payments->gateway_request($this->_api_endpoint, $this->_http_query, \"Content-Type: application/x-qbmsxml\");\t\n\t\t$response = $this->_parse_response($response_object);\n\t\t\n\t\treturn $response;\n\t}",
"abstract protected function query(Export $export);",
"function addQuery() {}",
"public function execute()\n\t{\n\t\t// Use cached results if found (previous count() or other internal call)\n\t\tif($this->activeQueryResults) {\n\t\t\t$results = $this->activeQueryResults;\n\t\t} else {\n\t\t\tif($this->activeQuery instanceof phpDataMapper_Database_Query_Interface) {\n\t\t\t\t$results = $this->query($this->activeQuery->sql(), $this->activeQuery->getParameters());\n\t\t\t\t$this->activeQueryResults = $results;\n\t\t\t} else {\n\t\t\t\t$results = array();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $results;\n\t}",
"private function executarQuery($query) {\n\n if(!$rs = pg_query($query)) {\n throw new Exception(self::MENSAGEM_ERRO_PROCESSAMENTO);\n }\n\n return $rs;\n }",
"public function queryAll($query);",
"function mapreduceQuery()\n {\n\n }",
"function run($query){\n $q = $this->handle->prepare($query);\n if($q === false)\n return $this->handle->errorInfo();\n $r = $q->execute();\n if($r === false)\n return [$q->errorCode(), 'Erro ao executar query: '.$q->errorInfo()[2].\"<br/>\\r\\n Query: \".$query];\n return $r;\n }",
"public static function query()\n {\n }",
"function sql_query($query) {\n\t\t// Added to log select queries\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->sql_query_preProcessAction($query);\n\t\t}\n\n\t\t$pointer = parent::sql_query($query);\n\n\t\t// Added to log select queries\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->sql_query_postProcessAction($query);\n\t\t}\n\n\t\treturn $pointer;\n\t}",
"function sql_query($query) {\n\t\t// Added to log select queries\n\t\tforeach($this->preProcessHookObjects as $preProcessHookObject) { /* @var $preProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPreProcessHookInterface */\n\t\t\t$preProcessHookObject->sql_query_preProcessAction($query);\n\t\t}\n\n\t\t$pointer = parent::sql_query($query);\n\n\t\t// Added to log select queries\n\t\tforeach($this->postProcessHookObjects as $postProcessHookObject) { /* @var $postProcessHookObject Tx_SandstormmediaPlumber_Hooks_DbPostProcessHookInterface */\n\t\t\t$postProcessHookObject->sql_query_postProcessAction($query);\n\t\t}\n\n\t\treturn $pointer;\n\t}",
"protected function processQuery()\n\t{\n\t\t// Type of input the field shows\n\t\t$this->input_type = $this->getAttribute('input_type');\n\n\t\t// Database Table\n\t\t$this->table = $this->getAttribute('table');\n\n\t\t// The field that the field will save on the database\n\t\t$this->key_field = (string) $this->getAttribute('key_field');\n\n\t\t// The column that the field shows in the input\n\t\t$this->value_field = (string) $this->getAttribute('value_field');\n\n\t\t// The option field that the field will save on the database\n\t\t$this->option_key_field = (string) $this->getAttribute('option_key_field');\n\n\t\t// The option value that the field shows in the input\n\t\t$this->option_value_field = (string) $this->getAttribute('option_value_field');\n\n\t\t// Flag to identify if the fk_value is multiple\n\t\t$this->value_multiple = (int) $this->getAttribute('value_multiple', 0);\n\n\t\t$this->required = (string) $this->getAttribute('required', 0);\n\n\t\t// Flag to identify if the fk_value hides the trashed items\n\t\t$this->hideTrashed = (int) $this->getAttribute('hide_trashed', 0);\n\t\t\n\t\t// Flag to identify if the fk_value hides the unpublished items\t\n\t\t$this->hideUnpublished = (int) $this->getAttribute('hide_unpublished', 0);\n\n\t\t// Flag to identify if the fk_value hides the published items\n\t\t$this->hidePublished = (int) $this->getAttribute('hide_published', 0);\n\n\t\t// Flag to identify if the fk_value hides the archived items\n\t\t$this->hideArchived = (int) $this->getAttribute('hide_archived', 0);\n\n\t\t// Flag to identify if the fk has default order\n\t\t$this->fk_ordering = (string) $this->getAttribute('fk_ordering');\n\n\t\t// The where SQL for foreignkey\n\t\t$this->condition = (string) $this->getAttribute('condition');\n\n\t\t// Flag for translate options\n\t\t$this->translate = (bool) $this->getAttribute('translate');\n\n\t\t// Initialize variables.\n\t\t$html = '';\n\t\t$fk_value = '';\n\n\t\t// Load all the field options\n\t\t$db = Factory::getContainer()->get('DatabaseDriver');\n\t\t$query = $db->getQuery(true);\n\n\t\t// Support for multiple fields on fk_values\n\t\tif ($this->value_multiple == 1)\n\t\t{\n\t\t\t// Get the fields for multiple value\n\t\t\t$this->value_fields = (string) $this->getAttribute('value_field_multiple');\n\t\t\t$this->value_fields = explode(',', $this->value_fields);\n\t\t\t$this->separator = (string) $this->getAttribute('separator');\n\n\t\t\t$fk_value = ' CONCAT(';\n\n\t\t\tforeach ($this->value_fields as $field)\n\t\t\t{\n\t\t\t\t$fk_value .= $db->quoteName($field) . ', \\'' . $this->separator . '\\', ';\n\t\t\t}\n\t\t\t\n\t\t\t$fk_value = substr($fk_value, 0, -(strlen($this->separator) + 6));\n\t\t\t$fk_value .= ') AS ' . $db->quoteName($this->value_field);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$fk_value = $db->quoteName($this->value_field);\n\t\t}\n\n\t\t$query\n\t\t\t->select(\n\t\t\t\tarray(\n\t\t\t\t\t$db->quoteName($this->key_field),\n\t\t\t\t\t$fk_value\n\t\t\t\t)\n\t\t\t)\n\t\t\t->from($this->table);\n\n\t\tif ($this->hideTrashed)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != -2');\n\t\t}\n\n\t\tif ($this->hideUnpublished)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != 0');\n\t\t}\n\n\t\tif ($this->hidePublished)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != 1');\n\t\t}\n\n\t\tif ($this->hideArchived)\n\t\t{\n\t\t\t$query->where($db->quoteName('state') . ' != 2');\n\t\t}\n\n\t\tif ($this->fk_ordering)\n\t\t{\n\t\t\t$query->order($this->fk_ordering);\n\t\t}\n\n\t\tif($this->condition)\n\t\t{\n\t\t\t$query->where($this->condition);\n\t\t}\n\n\t\t\n\n\t\treturn $query;\n\t}",
"public function executeQuery($q){ $this->makeConnection();\n //check for SQL injection\n\n //execute query\n $results = $this->connection->query($q);\n\n return $results;\n\n }",
"abstract public function\r\n\t\tget_query_for_something();",
"public function runCustomQuery($query, Database_Config $databaseConfig = NULL);",
"function executequery($result){\t\n\t\twhile($rowsf = mysqli_fetch_assoc($result)){\n\t\t\t$results[] = $rowsf;\n\t\t}\t\n\t\treturn $results;\n\t}",
"public function executeGenericDQLQuery($query){\n try{\n if(!$this->db)\n {\n $this->db = mysql_connect(self::DB_SERVER,self::DB_USER,self::DB_PASSWORD);\n }\n $result = mysql_query($query, $this->db);\n /* if(mysqli_errno($con) != 0){\n throw new Exception(\"Error :\".mysqli_errno($con).\" : \".mysqli_error($con));\n } */\n $rows = array();\n while($row = mysql_fetch_array($result)){\n array_push($rows,$row);\n }\n //mysqli_close($con);\n return $rows;\n \n }\n catch(Exception $e){\n $response = array();\n $response['status'] = false;\n $response['message'] = $e->getMessage();\n $this->response($this->json($response), 200);\n }\n \n }",
"abstract public function query($sql);",
"abstract protected function getQueryIterator();",
"function query_statements($q) {\r\n\t\textract($q);\r\n\t\tlist($resource_ids, $rule_values) = query_result($q);\r\n\t\tfor($i=0;$i<count($resource_ids);$i++) {\r\n\t\t\t$items[] = array('item_id'=>$resource_ids[$i], 'notes'=>get_notes($resource_ids[$i],$db));\r\n\t\t}\r\n\t\treturn $items;\r\n\t}",
"function query($query)\r\n\t{\r\n\t\t// Primero modificamos el query para averiguar la cantidad total de registros que devuelve el query.\r\n\t\t$count = 1;\r\n\t\t\r\n\t\t$query_count = $query;\r\n\t\tif(!$this->rs( @mysql_query($query_count, $this->conn()) ))\r\n\t\t{\r\n\t\t\t$this->error(\"Ocurrió un error al ejecutar el query <i><b>\\\"$query_count\\\"</b></i>. La base dijo : <b>\".mysql_error().\"</b>.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$this->total( mysql_num_rows($this->rs()) );\r\n\t\t\t\t\r\n\t\t/*\r\n\t\t$arrqry = preg_split('/from/', $query);\r\n\t\t$query_count = preg_replace(\"/select (.*) from/\", \"SELECT COUNT(*) FROM\",$arrqry[0].\" from\", $count);\r\n\t\t\r\n\t\tfor($i=1;$i<count($arrqry);$i++)\r\n\t\t\tif($i<count($arrqry)-1)\r\n\t\t\t\t$query_count .= \" \" . $arrqry[$i].\" from \";\t\t\t\t\r\n\t\t\telse\r\n\t\t\t\t$query_count .= \" \" . $arrqry[$i];\t\t\t\t\r\n\t //print \"-\".$query_count.\"-\";\r\n\t\tif(!$this->rs( @mysql_query($query_count, $this->conn()) ))\r\n\t\t{\r\n\t\t\t$this->error(\"Ocurrió un error al ejecutar el query <i><b>\\\"$query_count\\\"</b></i>. La base dijo : <b>\".mysql_error().\"</b>.\");\r\n\t\t\treturn false;\r\n\t\t}// Fin If\r\n\t\t$this->total( mysql_result($this->rs(), 0) );\r\n\t\t*/\r\n\t\t\r\n\t\t//echo \"total de registros: \".$this->total().\"<BR>\";\r\n\t\t//echo \"regs x pagina: \".$this->porPagina().\"<BR>\";\r\n\t\t$this->_totalPaginas = (ceil($this->total() / $this->porPagina()));\r\n\t\t//echo \"total de pags:\".$this->totalPaginas().\"<BR>\";\r\n\t\t\r\n\t\t// Comprobamos que no se intenta acceder a una página que no existe.\r\n\t\tif( $this->pagina() > $this->totalPaginas() )\r\n\t\t{\r\n\t\t\t$this->error(\"No exite la página \".$this->pagina().\" de resutados. Hay solo un total de \".$this->totalPaginas());\r\n\t\t\treturn false;\r\n\t\t}// Fin If\r\n\r\n\t\t// Ahora modificamos el Query del usuario, para poder agregarle los límites para realizar la paginación\r\n\t\t$query .= \" LIMIT \".($this->desde()-1).\",\".$this->porPagina();\r\n\t\t\r\n\t\t//echo $query;\r\n\t\tif(!$this->rs( @mysql_query($query, $this->conn()) ))\r\n\t\t{\r\n\t\t\t$this->error(\"Ocurrió un error al ejecutar el query \\\"$query\\\". La base dijo : \".mysql_error());\r\n\t\t\treturn false;\r\n\t\t}// Fin If\r\n\t\t$this->registros( mysql_num_rows( $this->rs() ));\r\n\t\treturn true;\r\n\t}",
"function db_query($db_query) {\n\t\t$result = pg_query($this->db_connection,$db_query)\n\t\t\tor die(\"Query: $db_query <br /> Error: \".pg_last_error($this->db_connection).\"<br />\");\n\t\treturn $result;\n\t}",
"public function execute()\n {\n \tif ( $this->cur_query != \"\" )\n \t{\n \t\t$res = $this->query( $this->cur_query );\n \t}\n \t\n \t$this->cur_query \t= \"\";\n \t$this->is_shutdown \t= false;\n\n \treturn $res;\n }",
"function query(\\database $dbase){\n //\n //Get the sql string \n $sql=$this->to_str();\n //\n // Execute the $sql on columns to get the $result\n $dbase->query($sql);\n \n }",
"public function execute()\n\t{\n\t\t$queryUrl = $this->buildQueryUrl();\n\t\t$storeId = $this->getParam('storeid');\n\t\t$arguments = array(\n\t\t\t\t'json.nl' => 'map',\n\t\t\t\t'rows' => $this->rows,\n\t\t\t\t'start' => $this->start,\n\t\t\t\t'fl' => @implode(',', $this->fieldList),\n\t\t\t\t'qf' => $this->queryFields,\n\t\t\t\t'spellcheck' => 'true',\n\t\t\t\t'spellcheck.collate' => 'true',\n\t\t\t\t'facet' => 'true',\n\t\t\t\t'facet.mincount' => 1,\n\t\t\t\t'facet.limit' => $this->facetLimit,\n\t\t\t\t'timestamp' => time(),\n\t\t\t\t'mm' => $this->mm,\n\t\t\t\t'defType'=> 'edismax',\n\t\t\t\t'wt'=> 'json',\n\t\t);\n\n\t\t$resultSet = $this->doRequest($queryUrl, $arguments, 'array');\n\n\t\tif (isset($resultSet['response']['numFound']) && intval($resultSet['response']['numFound']) > 0)\n\t\t{\n\t\t\treturn $resultSet;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$queryText = $this->getQueryText();\n\t\t\tif (isset($resultSet['spellcheck']['suggestions']['collation']))\n\t\t\t{\n\t\t\t\t$queryText = strtolower($resultSet['spellcheck']['suggestions']['collation']);\n\t\t\t}\n\n\t\t\tif (!empty($queryText))\n\t\t\t{\n\t\t\t\t$this->queryText = $queryText;\n\t\t\t\t$queryUrl = $this->buildQueryUrl();\n\t\t\t\t$arguments['mm'] = '0%';\n\n\t\t\t\t$resultSet = $this->doRequest($queryUrl, $arguments, 'array');\n\t\t\t}\n\t\t}\n\t\treturn $resultSet;\n\t}",
"function db_query_fetch($query) {\n\t\t$result = pg_query($this->db_connection,$query) or $this->print_db_error(\"Failed to query Database<br />\\nQuery: $query\");\n\t\tif($result) {\n\t\t\tfor($n=0;$row=pg_fetch_array($result);$n++) {\n\t\t\t\t$results[$n] = $row;\n\t\t\t}\n\t\t}\n\t\telse $results = array();\n\t\treturn $results;\n\t}",
"private function preExe(){\n\t\t$pre = $this->prepare($this->_query);\n\t\t$pre->execute();\n\t\treturn $pre->fetchAll();\n\t}",
"public function query($query = \"NONEE\"){\n\t\t\n\t\tif($update = $query === \"NONEE\")\n\t\t\t$query = $this->query; \t\t\t\t\t\n\t\t\n\t\t$this->query_total++;\n\t\t\n\t\t$query_check = trim($query);\n\t\t\n\t\tif($this->debug){\n\t\t\techo \"<br/><strong style=\\\"color:#E4C100\\\"><DEBUG></strong><br/>\";\n\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#D3C26E;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : \"\";\n\t\t\techo \"<span style=\\\"color:#E4C100\\\">\".$query.\"</span><br/><strong style=\\\"color:#E4C100\\\"></DEBUG></strong><br/>\";\n\t\t}\n\t\t\n\t\t$resultset = $this->showErrors ? mysqli_query($this->connection,$query) : @mysqli_query($this->connection,$query);\n\t\t\n\t\t$proceed_log = $this->log && ( \n\t\t(stripos($query_check,\"INSERT\") === 0 && $this->log_options{0} === '1')\n\t\t||\n\t\t(stripos($query_check,\"DELETE\") === 0 && $this->log_options{1} === '1')\n\t\t||\n\t\t(stripos($query_check,\"UPDATE\") === 0 && $this->log_options{2} === '1')\n\t\t||\n\t\t(stripos($query_check,\"SELECT\") === 0 && $this->log_options{3} === '1'));\n\t\t\n\t\tif(stripos($query_check,\"INSERT\") === 0 || stripos($query_check,\"DELETE\") === 0 || stripos($query_check,\"UPDATE\") === 0)\n\t\t\tif(!$resultset)\n\t\t\t\t$this->transaction = false;\n\t\t\n\t\tif($proceed_log){\n\t\t\t$log_fields = \"query,date,user\";\n\t\t\t$log_values=\"'\".$this->secure($query).\"',NOW(),\".$this->log_user;\n\t\t}\n\t\t\n\t\tif(!$resultset){\n\t\t\tif($this->showErrors){ \n\t\t\t\techo \"<br/><strong style=\\\"color:red\\\"><QERROR></strong><br/>\";\n\t\t\t\techo $this->comment != \"\" ? \"<span style=\\\"color:#E88888;font-style:italic\\\">#\".$this->comment.\"</span><br/>\" : $this->comment.\"nada\";\n\t\t\t\techo \"<span style=\\\"color:red\\\">\".mysqli_error($this->connection).\" at \".$query_check.\"</span><br/><strong style=\\\"color:red\\\"></QERROR></strong><br/>\";\n\t\t\t}\n\t\t\tif($proceed_log){\n\t\t\t\t$log_fields .= \",error\";\n\t\t\t\t$log_values .= \",'\".mysqli_error($this->connection).\"'\";\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($proceed_log){\t\t\t\n\t\t\t@mysqli_query($this->connection,\"INSERT INTO \".$this->log_table.\"($log_fields) VALUES($log_values)\");\n\t\t}\n\t\t\n\t\tif(!$resultset && $this->closeOnError) \n\t\t\texit;\n\t\t\n\t\tif($update)\n\t\t\t$this->resultset = $resultset;\n\t\t\n\t\treturn $resultset; \n\t}",
"protected function get_results_from_query() {\n\t\t\t\t\n\t\t\t\t$this->open_connection();\n\t\t\t\t\n\t\t\t\tif (!$this->conn) {\n\t\t\t\t\tthrow new Excepcion('No se pudo Conectar a la BD: ' . mysql_error());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\n\t\t\t\t\t$result = $this->conn->query($this->query);\n\t\t\t\t\n\t\t\t\t\t\tif (!$result) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tthrow new Excepcion('No se pudo ejecutar la consulta a la BD: ' . mysql_error());\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $result;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$result->close();\t\t\t\t\n\t\t\t\t$this->close_connection();\t\t\n\t\t\t\n\t\t}",
"protected function executeQuery() {\n return array();\n }",
"function query($q)\r\n {\r\n if($this->link)\r\n {\r\n $start = microtime(true);\r\n $this->res_id = mysql_query($q, $this->link);\r\n $end = microtime(true);\r\n $query->sql = $q;\r\n $query->exec_time = $end-$start;\r\n $this->queries[] = $query;\r\n \r\n }else\r\n {\r\n $this->error_msg = \"Could not execute query to $this->db_name database, wrong database link\";\r\n return 0;\r\n }\r\n if(!$this->res_id)\r\n {\r\n $this->error_msg = \"Could not execute query to $this->db_name database, wrong result id\";\r\n return 0;\r\n }\r\n return $this->res_id;\r\n }",
"function postProcess() {\n $this->beginPostProcess();\n\n $this->buildACLClause( $this->_aliases['contact'] );\n // build query\n $sql = $this->buildQuery();\n //echo $sql;\n // build array of result based on column headers. This method also allows\n // modifying column headers before using it to build result set i.e $rows.\n $this->buildRows($sql, $rows);\n\n // format result set.\n $this->formatDisplay($rows);\n\n // assign variables to templates\n $this->doTemplateAssignment($rows);\n\n // do print / pdf / instance stuff if needed\n //$this->endPostProcess($rows);\n }",
"function query($query=\"\")\n\t{\n\t\t$start = $this->getTime();\n\t\tif($query)\n\t\t{\n // debug(\"query\",$query);\n\t\t\t$this->_result_id=mysql_query($query,$this->_link_id);\n\t\t\t$this->_mysql_errno=mysql_errno($this->_link_id);\n\t\t\tif(!$this->_mysql_errno)\n\t\t\t{\n\t\t\t\tif(ereg(\"^insert\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas an insert type query\n\t\t\t\t\t$this->_query_type=4;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^select\", strtolower($query)) || ereg(\"^show\",strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a select or show query type\n\t\t\t\t\t$this->_query_type=1;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^delete\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a delete query type\n\t\t\t\t\t$this->_query_type=3;\n\t\t\t\t}\n\t\t\t\telseif(ereg(\"^update\", strtolower($query)))\n\t\t\t\t{\n\t\t\t\t\t// twas a update query type\n\t\t\t\t\t$this->_query_type=2;\n\t\t\t\t}\n elseif(ereg(\"^create\",strtolower($query)))\n {\n $this->_query_type=5;\n }\n elseif(ereg(\"^drop\",strtolower($query)))\n {\n $this->_query_type=6;\n }\n\n\t\t\t\tif($this->_query_type>0)\n\t\t\t\t{\n\t\t\t\t\tif($this->_query_type>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_num_rows=mysql_affected_rows();\n\t\t\t\t\t}elseif($this->_query_type<5){\n if(is_resource($this->_result_id)){\n $this->_num_rows=mysql_num_rows($this->_result_id);\n }else{\n $this->_num_rows=0;\n }\n\t\t\t\t\t}\n\t\t\t\t\tif($this->_query_type==4)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->_insert_id=mysql_insert_id();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_mysql_error=mysql_error();\n\t\t\t}\n\t\t}\n if($this->error_text()){\n Debug(\"Query\",$query);\n Debug(\"Error\",$this->error_text());\n }\n $this->logquery($query,$start);\n\t\treturn $this->_query_type;\n\t}",
"abstract public function query(Query $query): Result;",
"function _execQ($query, $param_strs, $params){\n $db = MySQLConnect::get_instance();\n $res = $db->prepare($query);\n \t array_unshift($params, $param_strs);\n call_user_func_array(array($res, 'bind_param'), $params);\n $bool = $res->execute();\n $sonuclar = $res->get_result();\n $rows = $sonuclar->fetch_all(MYSQLI_ASSOC);\n return $rows;\n }",
"public function query($query){\n\t\t$this->lastQuery = $query;\n\t\treturn $this->connection->query($query);\n\t}",
"function query($query) {\n\t\treturn $this->dbcr_query( $query, true );\n\t}",
"public function executeSQL($query){\n\t\t$this->lastQuery = $query;\t\t\n\t\tif($this->result = mysqli_query( $this->databaseLink,$query)){\n\t\t\tif (gettype($this->result) === 'object') {\n\t\t\t\t$this->records = @mysqli_num_rows($this->result);\n\t\t\t\t$this->affected = @mysqli_affected_rows($this->databaseLink);\n\t\t\t} else {\n\t\t\t\t$this->records = 0;\n\t\t\t\t$this->affected = 0;\n\t\t\t}\n\n\t\t\tif($this->records > 0){\n\t\t\t\t$this->arrayResults();\n\t\t\t\treturn $this->arrayedResult;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}else{\n\t\t\t$this->lastError = mysql_error($this->databaseLink);\n\t\t\techo $this->lastError;\n\t\t\treturn false;\n\t\t}\n\t}",
"public function query($query){ \n\t\tif($r = $this->mysqli->query($query)){\n\t\t\t$rows = array();\n\t\t\twhile(is_object($r) && $row = $r->fetch_assoc()){\n\t\t\t\t$rows[]= $row;\n\t\t\t}\n\t\t\t$result = new DB_result($rows, $query);\n\t\t\treturn $result;\n\t\t}\n\t\techo $this->mysqli->error . \"<br><br>\";\n\t\tdie(\"{$query}\");\n\n\t}",
"private function runQuery($query) {\r\n\t\treturn mysql_query($query, $this->sql);\r\n\t}",
"function dobatch ($p_query) {\n $query_split = preg_split (\"/[;]+/\", $p_query);\n foreach ($query_split as $command_line) {\n $command_line = trim($command_line);\n if ($command_line != '') {\n $query_result = mysql_query($command_line);\n if ($query_result == 0) {\n break;\n };\n };\n };\n return $query_result;\n}",
"private function ExecuteQuery()\n\t{\n\t\tswitch($this->querytype)\n\t\t{\n\t\t\tcase \"SELECT\":\n\t\t\t{\n\t\t\t\t$this->stmt->execute();\n\t\t\t\t$this->querydata = $this->stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"INSERT\":\n\t\t\tcase \"UPDATE\":\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$this->beginTransaction();\n\t\t\t\t\t$this->stmt->execute();\n\t\t\t\t\t$this->commit();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcatch (PDOException $e)\n\t\t\t\t{\n\t\t\t\t\t$this->rollBack();\n\t\t\t\t\techo(\"Query failed: \" . $e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"abstract public function getRow($query);",
"private function query($query, $singleColumn=false, $singleRow=false)\n\t{\n\t\tdebug(\"SQL: query\", $query);\n\t\tif($this->debug)\n\t\t\t$this->sqlLog[] = $query;\n\n\t\tif($this->offline) return;\n\n\t $this->connect(); //if connection not already open \n\t $result = $this->mysqlConnection->query($query);\n\t $rows = SqlManager::getResultData($result, $singleColumn, $singleRow);\n\t return $rows;\n\t}",
"public function query($query,$mode='single'){\n\t\t$this->lastsql=$query;\n\t\t\n\t\tswitch($mode){\n\t\t\tcase 1:\n\t\t\tcase '':\n\t\t\tcase 'single':\n\t\t\t\t$this->qresult=@parent::query($this->lastsql);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\tcase 'multi':\n\t\t\tcase 'multiple':\n\t\t\t\t$ok=@parent::multi_query($query);\n\t\t\t\tdo{\n\t\t\t \t$this->qresult=@parent::store_result();\n\t\t\t if(($ok==true)&&empty($this->qresult)){\n\t\t\t \t$this->qresult=true;\n\t\t\t }\n\t\t\t }while(@parent::next_result());\n\t\t\t break;\n\t\t}\n\t\t\n\t\tif($this->show_sql){\n\t\t\tprint('<br />'.$this->lastsql.'<br />');\n\t\t}\n\t\t\n\t\tif($this->errno!=0){\n\t\t\tif(($this->show_sql==false) && ($this->show_sql_error==true)){\n\t\t\t\tprint('<br />'.$this->lastsql);\n\t\t\t}\n\t\t\tif($this->show_error){\n\t\t\t\tprint('<br />'.$this->error);\n\t\t\t}\n\t\t}\n\t\tif(@$this->num_fields()){ \n\t\t\tfor($f=0;$f<@$this->num_fields();$f++){\n\t\t\t\t$info=@$this->qresult->fetch_field();\n\t\t\t\t$this->qresult->fields[$f]['name']=@$info->name;\n\t\t\t\t$this->qresult->fields[$f]['orgname']=@$info->orgname;\n\t\t\t\t$this->qresult->fields[$f]['table']=@$info->table;\n\t\t\t\t$this->qresult->fields[$f]['orgtable']=@$info->orgtable;\n\t\t\t\t$this->qresult->fields[$f]['def']=@$info->def;\n\t\t\t\t$this->qresult->fields[$f]['max_length']=@$info->max_length;\n\t\t\t\t$this->qresult->fields[$f]['flags']=@$info->flags;\n\t\t\t\t$this->qresult->fields[$f]['type']=@$info->type;\n\t\t\t\t$this->qresult->fields[$f]['decimals']=@$info->decimals;\n\t\t\t\t$this->qresult->table=@trim($this->qresult->fields[0]['table']);\n\t\t\t\tif(empty($this->qresult->table)){\n\t\t\t\t\t$this->qresult->table=$this->xml_root;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@$this->qresult->field_seek(0);\n\t\t}\n\t\t@$this->num_rows=is_object(@$this->qresult)?@$this->qresult->num_rows:null;\n\t\treturn @$this->qresult;\n\t}",
"function querySelect($query) {\r\n\t\t\r\n\t\tif (strlen(trim($query)) < 0 ) {\r\n\t\t\ttrigger_error(\"Database encountered empty query string in querySelect function\",E_USER_ERROR);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tif( !$this->connected ) \r\n\t\t\t$this->connect();\r\n\t\t\t\r\n\t\tif ($result = $this->socket->query($query)) {\r\n\t\t\t$this->recordsSelected = $result->num_rows;\r\n\t\t\t$this->databaseResults = $this->getData($result);\r\n\t\t\t$result->close();\t\t\t\r\n\t\t}\r\n\t\telseif($this->socket->errno!='')\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->error( $sql.\"Error querying database: \". $this->socket->error,false);\r\n\t\t\treturn false;\r\n\r\n\t\t\t}\r\n\t\t\r\n\t\treturn $this->databaseResults;\r\n\t}",
"public function execute($query)\n {\n }",
"abstract protected function initQuery(): void;"
] | [
"0.7243053",
"0.68959665",
"0.66625774",
"0.6573498",
"0.64958715",
"0.64958715",
"0.64958715",
"0.6477439",
"0.6459939",
"0.64528",
"0.6446971",
"0.64200705",
"0.641402",
"0.6405525",
"0.63854235",
"0.6378231",
"0.63738155",
"0.6347667",
"0.63402313",
"0.6337155",
"0.6326034",
"0.63184154",
"0.627483",
"0.6242489",
"0.6228719",
"0.62178093",
"0.62130666",
"0.62092423",
"0.62087977",
"0.62015635",
"0.6201444",
"0.6197406",
"0.6193475",
"0.6185668",
"0.6182011",
"0.61814654",
"0.6155063",
"0.6142544",
"0.6142544",
"0.6142544",
"0.6121892",
"0.61121374",
"0.61117446",
"0.6109294",
"0.6104936",
"0.6103097",
"0.6103097",
"0.60904866",
"0.6085524",
"0.6081188",
"0.606761",
"0.6063793",
"0.60474324",
"0.6044072",
"0.6042899",
"0.6042897",
"0.6030702",
"0.6028603",
"0.6026941",
"0.60195637",
"0.6017517",
"0.6010164",
"0.6010164",
"0.6007201",
"0.5985087",
"0.5975433",
"0.59719974",
"0.59671867",
"0.596669",
"0.5962098",
"0.59615326",
"0.59570134",
"0.59562856",
"0.5955564",
"0.59544575",
"0.59493935",
"0.59380203",
"0.5935991",
"0.5933639",
"0.5923281",
"0.5910962",
"0.59029853",
"0.5898341",
"0.5895682",
"0.5894439",
"0.5893329",
"0.5892132",
"0.5891992",
"0.5891",
"0.5890244",
"0.588936",
"0.58865887",
"0.58848315",
"0.5878145",
"0.5873683",
"0.5869456",
"0.585983",
"0.5858908",
"0.5852935",
"0.5850083"
] | 0.62916726 | 22 |
////////////////////////////////////////////////////////////////////////// GET THE LAST AUTO INCREMENT NUMBER FROM INSERTED DATA ////////////////////////////////////////////////////////////////////////// | public function insertId() {
if (!$this->connection) return false;
$result = @pg_query($this->connection, 'SELECT lastval()');
if ($result === false) return false;
$return = @pg_fetch_array($result);
pg_free_result($result);
return is_array($return) ? reset($return) : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getLastID()\n {\n return $this->driver->getInsertId();\n }",
"protected function getLastInsertId(){\n $iLastInsertId = $this->objDbConn->lastInsertId();\n return $iLastInsertId;\n }",
"public function getLastId() {\n return $this->LastInsertId;\n }",
"public function getLastId(){\n return $this->con->insertId();\n }",
"public function lastId(): int\n {\n return $this->lastId;\n }",
"public function lastId() : int\n\t{\n\t\treturn $this->handle->lastId();\n\t}",
"public function lastId(){\n return $this->lastId;\n }",
"public function getLastInsertId()\r\n {\r\n return $this->getMaster()->lastInsertId();\r\n }",
"public function getLastId()\n {\n return $this->adodb->insert_Id();\n }",
"public function getLastInsertId(){\n return $this->lastInsertId;\n }",
"public static function get_last_id(){\r\n\t\treturn self::$last_id;\r\n\t}",
"function getLastInsertID(){\r\n\t\t\r\n\t\treturn $this->connection->insert_id;\r\n\t}",
"function lastID(){\n return pg_last_oid($this->consulta);\n }",
"public function lastID(){\n return $this->_lastInsertID;\n }",
"public function getLast(): int {\n return $this->last;\n }",
"public function getLastInsertId(): int;",
"public function get_last_id() {\n\t\treturn $this->last_id;\n\t}",
"public function getLastInsertId(){\n\t\treturn $this->connection->insert_id;\n\t}",
"public function getLastId(){\n\n\t\t\treturn $this->lastInsertedIds;\n\t\t}",
"public function lastID(): int;",
"public function getLastInsertId()\t{\n\t\treturn $this->_hDb->lastInsertId();\n\t}",
"public function getOriginalIncrementId();",
"public function getLast()\n {\n $post = Post::findFirst([\"order\" => \"id DESC\"]);\n\n if($post == true)\n {\n return $post->id + 1;\n }\n else\n {\n return 1;\n }\n }",
"public function last_insert_id() {\n\t\treturn $this->adapter->lastInsertId();\n\t}",
"function get_last_inserted() {\n return $this->db->insert_id();\n }",
"public function getLastInsertID();",
"public function lastId()\r\n {\r\n return $this->getKey('last_id');\r\n }",
"private function get_last_number() {\n\t\treturn $this->settings['last_number'];\n\t}",
"function getLastInsertID(){\r\n $query = 'SELECT DISTINCT LAST_INSERT_ID() FROM ' . $this->table_name; \r\n $stmt = $this->dbConn->prepare($query);\r\n \r\n $stmt->execute();\r\n \r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n $lastID = $row['LAST_INSERT_ID()'];\r\n \r\n return $lastID;\r\n }",
"public function getLastID() {\n return $this->db->insert_id();\n }",
"public function lastInsertId()\n {\n return $this->_adapter->lastInsertId();\n }",
"public function getLastInsertId()\n {\n return $this->wpDatabase->insert_id;\n }",
"public function lastInsertId(){\n return $this->pdo->lastInsertId();\n }",
"public function getLastInsertId()\n {\n return $this->lastInsertId;\n }",
"public function lastInsert(){\n\t\treturn $this->dbh->lastInsertId();\n\t}",
"public function getLastInsertID()\n {\n return $this->_lastInsertID;\n }",
"function lastInsertId()\n\t{\n\t\treturn @$this->functions['insert_id']($this->connection_master);\n\t}",
"public function lastInsertId(): int {\n return intval( $this->pdo->lastInsertId() );\n }",
"public function getLastInsertID()\n {\n\t return $this->connections[ $this->activeConnection]->insert_id;\n }",
"public function getIncrementId(){\n return $this->_getData(self::INCREMENT_ID);\n }",
"function lastId()\n {\n return isset($this->_query) ? $this->_query->lastId() : $this->_lastid;\n }",
"public function lastInsertId () {\r\n return $this->cachedLastInsertId; // $this->db->lastInsertId();\r\n }",
"function getLastinsertId (){\n return $this->pdo->lastInsertId();\n }",
"function getLastId()\n {\n return mysqli_insert_id($this->Db);\n }",
"public function lastId()\n\t{\n\t\treturn $this->_instance->lastInsertId();\n\t}",
"function lastInsertId() {\n\t\treturn sqlite_last_insert_rowid($this->connection);\n\t}",
"public function getLastInsertId()\n {\n return $this->getPdo()->lastInsertId();\n }",
"public static function getLastRowId()\n {\n return self::$id;\n }",
"function lastInsertId() {\n return $this->pdo->lastInsertId();\n }",
"public function getLastInsertValue()\n {\n return $this->lastInsertValue;\n }",
"function lastID()\r\n\t{\r\n\t\tassert($this->link != null);\r\n\t\treturn intval($this->link->lastInsertId());\r\n\t}",
"public static function getLastInsertId()\n {\n return self::$sql->lastInsertId();\n }",
"public function getLastElementId()\n\t{\n\t\treturn $this->lastElementId;\n\t}",
"function getLastid(){\n $this->lastid = mysqli_insert_id($this->dcon);\n return $this->lastid;\n }",
"public function get_last_inserted_id(){\n\t\treturn $this->db->insert_id();\n\t}",
"public function lastId()\n {\n return $this->mysqli->insert_id;\n }",
"function last_inserted_id() {\n return mysql_insert_id($this->db_conn);\n }",
"public function getLastInsertedID(){\n // Return last created id\n return $this->connection->insert_id();\n }",
"public function getLastInsertId()\n {\n return $this->PDO->lastInsertId();\n }",
"public function lastId()\n\t{\n\t\treturn $this->lastInsertID();\n\t}",
"function last_id(){\n\t\treturn(-1);\n\t}",
"public function _next_val()\n\t{\n\t\t$res\t=\t $this->db-query( \"SELECT AUTO_INCREMENT next_val FROM information_schema.TABLES WHERE table_name='{$this->table}'\" );\n\t\treturn $res->next_val;\n\t}",
"public function lastID() {\n return $this->getPDO()->lastInsertId();\n }",
"public function getLastInsertId()\n {\n return $this->getHandler()->getConnection()->lastInsertId();\n }",
"public function getLastInsertId();",
"public function getLastInsertId();",
"public function getLastInsertId();",
"public function getAutoIncrementID()\n {\n $this->sql_query->query(\"SELECT LAST_INSERT_ID()\");\n $result = $this->sql_query->getSingleResult();\n return $result[0];\n }",
"public function getLastInsertedId() {\n\t\treturn $this->lastInsertedID;\n\t}",
"function getLastInsertID() {\n return mysql_insert_id($this->CONNECTION);\n }",
"function lastInsertId() \r\n\t{\r\n\t\t \r\n\t\treturn $this->socket->insert_id;\r\n\t\t \r\n\t}",
"abstract public function getLastInsertId();",
"private function getNewID()\n\t{\n\t\t$ids = array_keys($this->metadata['posts']);\n\t\t$lastId = (count($ids) > 0) ? max($ids) : 0;\n\n\t\treturn $lastId + 1;\n\t}",
"function get_last_inserted_id() {\n return $this->db->insert_id();\n }",
"public function last_insert()\n {\n return mysqli_insert_id($this->db);\n }",
"protected function getNextId()\n {\n return Field::max('id') + 1;\n }",
"public function lastInsertId(){\n return $this->link->lastInsertId();\n }",
"public function getLastId()\n {\n return $this->galleryMapper->getMaxId();\n }",
"public function lastInsertId()\n {\n return @db2_last_lastInsertId($this->connection);\n }",
"function get_last_id()\n {\n // TODO: Implement get_last_id() method.\n }",
"public function getPostIncrement() {\n\t\treturn $this->postIncrement;\n\t}",
"protected function getLastPrimaryKey()\n {\n return $this->getLastEntityId();\n }",
"function lastId() {\n return mysqli_insert_id($this->con);\n }",
"function LastInsertId($par_SeqOrGenName = '')\n\t{\n\t\treturn $this->__connection->lastInsertId($par_SeqOrGenName);\n\t}",
"abstract public function getAutoinc();",
"public static function lastId()\n {\n return self::connect()->lastInsertId();\n }",
"public function get_last_insert_id()\n\t\t{\n\t\t\treturn( $this->last_insert_id );\n\t\t}",
"public function get_new_id()\n {\n $query = \"select MAX(id) as id from team\";\n $res = $this->db->query($query);\n $res->result_array();\n $last_id = ($res->result()[0]->id)+1;\n return $last_id;\n }",
"public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId()\n {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId() {\n return $this->pdo->lastInsertId();\n }",
"public function lastInsertId() {\n return $this->pdo->lastInsertId();\n }",
"public function lastId()\n\t{\n\t\treturn mysqli_insert_id($this->connection);\n\t}",
"public function getLastInsertId()\n {\n $this->setActive(true);\n\n return self::$_pdo->lastInsertId();\n }",
"public function getLastInsertedId()\r\n\t{\r\n\t\treturn $this->db->getLastInsertedId();\r\n\t}",
"public function GetLastInsertID()\r\n\t{\r\n\t\treturn $this->last_insert_id;\r\n\t}",
"public function getLastBatchNo()\n {\n $query = \"SELECT max(BatchNumber) AS BatchNumber FROM voucherbatch\";\n $sql = Yii::app()->db->createCommand($query);\n $result = $sql->queryRow();\n \n if($result['BatchNumber'] > 0)\n return $result['BatchNumber'] + 1;\n else\n return 1;\n }"
] | [
"0.7151867",
"0.70067304",
"0.6898864",
"0.6889266",
"0.6884515",
"0.6878972",
"0.6873806",
"0.68623704",
"0.6833027",
"0.6815599",
"0.6814324",
"0.68067455",
"0.6806588",
"0.67990285",
"0.6798752",
"0.67983526",
"0.67900723",
"0.6788849",
"0.67822474",
"0.67672396",
"0.6759288",
"0.67437255",
"0.67372334",
"0.67297435",
"0.67262596",
"0.6704014",
"0.6699337",
"0.66913205",
"0.66845167",
"0.6683534",
"0.66823244",
"0.66699237",
"0.66680276",
"0.6667196",
"0.6663247",
"0.665969",
"0.66557693",
"0.6652717",
"0.6647897",
"0.66430813",
"0.66335714",
"0.6628022",
"0.6627318",
"0.6626201",
"0.6622364",
"0.6621458",
"0.6619845",
"0.6617917",
"0.6610644",
"0.6607903",
"0.6605175",
"0.6604106",
"0.6600386",
"0.65967244",
"0.6594605",
"0.65889406",
"0.6586815",
"0.6584221",
"0.6576878",
"0.6568726",
"0.6564272",
"0.65613365",
"0.6561016",
"0.65602845",
"0.6558735",
"0.6558735",
"0.6558735",
"0.65550196",
"0.6551727",
"0.65494883",
"0.65358114",
"0.6532427",
"0.6529862",
"0.65297586",
"0.65229833",
"0.6516324",
"0.65093786",
"0.6508225",
"0.6505341",
"0.6502946",
"0.6502866",
"0.6494326",
"0.6491157",
"0.6489462",
"0.64826876",
"0.647742",
"0.64756435",
"0.6474967",
"0.6473918",
"0.6473918",
"0.6473918",
"0.6473918",
"0.6473918",
"0.6473918",
"0.6473049",
"0.6473049",
"0.64723593",
"0.64669627",
"0.64663327",
"0.6457098",
"0.64527965"
] | 0.0 | -1 |
////////////////////////////////////////////////////////////////////////// GET THE NUMBER OF ROWS UPDATED BY THE LAST QUERY ////////////////////////////////////////////////////////////////////////// | public function updated() {
if (!$this->connection) return 0;
return @pg_affected_rows($this->connection);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNumRows()\n {\n \treturn $this->previouslyExecuted->num_rows;\n }",
"function numRows()\n {\n $this->getRows();\n return $this->row_counter;\n }",
"function getNumAffectedRows() {\r\n\t\t\treturn($this->privateVars['affectedrows']);\r\n\t\t}",
"public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}",
"function RowCount() {}",
"public function getNumRowsAffected(){\n\t\treturn $this->instance->getNumRowsAffected();\n\t}",
"function numrows() {\r\n\t\treturn $this->numrows;\r\n\t}",
"public function getNumAffectedRows()\n {\n \treturn $this->connections[$this->activeConnection]->affected_rows;\n }",
"function getNumRows() {\r\n\t\t\tif($this->privateVars['resultset']) {\r\n\t\t\t\tif(@mysql_num_rows($this->privateVars['resultset']))\r\n\t\t\t\t\treturn mysql_num_rows($this->privateVars['resultset']);\r\n\t\t\t}\r\n\t\t\treturn -1;\r\n\t\t}",
"public function getNumRowsAffected() {\n\t\treturn $this->rowsAffected;\n\t}",
"public function getNumRows()\n {\n $db = DB::conn();\n $query = \"SELECT COUNT(*) FROM \" . self::COMMENT_TABLE . \" WHERE thread_id = ?\";\n $where_params = array($this->thread_id);\n $count = $db->value($query, $where_params);\n return $count; \n }",
"public function numRows() {\n\t\t$val = $this->numResults;\n\t\t$this->numResults = array();\n\t\treturn $val;\n\t}",
"public function getNumRows() {\n\t\treturn $this->_num_rows;\n\t}",
"function getNRows() \n { \n if($this->rsQry)\n {\n return true;\n }\n else\n {\n\t\t\t return mysql_num_rows($this->rsQry);\n }\n\t\t}",
"public function numRows(){\n $val = $this->numResults;\n $this->numResults = array();\n return $val;\n }",
"function getRowCounter()\n {\n $this->getRows();\n return $this->row_counter;\n }",
"public function getNumRows();",
"public function getNumRows(){\n return $this->numrows;\n }",
"function nbrRows() {\n return mysqli_num_rows($this->result);\n }",
"function num_rows() {\n\t\n\t\t$num = @mysql_num_rows($this->rstemp);\n\t\tif ($this->debug) echo \"$num records returneds <br>\\n\\n\";\t\n\t\t\n\t\treturn $num;\t\t\n\t}",
"function NumRows() {}",
"public function rows(): int\n {\n return $this->rows;\n }",
"public function num_rows($query_result) {\n//\t\t\twhile ( OCIFetchINTO($query_result,$dumy,OCI_ASSOC) ) {\n//\t\t\t\t$i++;\n//\t\t\t}\n//\t\t\t//return ocifetchstatement($query_result,$dumy);\n//\t\t\treturn $i;\n\t\t}",
"function RowCount()\n\t{\n\t\tif (!isset($this->_intCurrentRow))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ($this->_intCurrentRow + 1);\n\t\t}\n\t}",
"function getRowCount() {\n\t\t$saleData = $this->getProducts();\n\t\t$saleSize = sizeof($saleData);\n\t\treturn $saleSize -=1;\n\t}",
"public function get_rows_count()\n\t{\n\t\treturn count($this->get_rows());\n\t}",
"function get_num_queries()\n {\n }",
"function get_row_count() {\n return $this->row_count;\n }",
"function lastNumRows() {\n\t\tif ($this->_result) {\n\t\t\tsqlite_num_rows($this->_result);\n\t\t}\n\t\treturn false;\n\t}",
"public abstract function row_count();",
"public function nbRows();",
"function NumRows() {\n\t\t\t$result = pg_num_rows($this->result);\n\t\t\treturn $result;\n\t\t}",
"function num_rows() {\r\n\t\treturn $this->dbh->num_rows();\r\n\t}",
"public function getRowCountAndClose(): int;",
"public function count() {\n return count($this->__rows__);\n }",
"function numRows()\n{\n\t$num = mysql_num_rows($this->res);\n\treturn $num;\n}",
"public function RowCount() {\n return $this->_row == '' ? $this->_rown : $this->_rown + 1;\n }",
"function CellCount() {\n return $this->rows[$this->LastRow]->CellCount();\n }",
"public function getRowsCount()\n {\n if (is_null($this->summaryRow)) {\n return count($this->rows);\n } else {\n return count($this->rows) + 1;\n }\n }",
"public function getNumRows() {\n\t\t$this->_numRows = mysqli_num_rows($this->_result);\n\t\treturn $this->_numRows;\n\t}",
"function getNumRows() {\r\n return mysql_num_rows($this->m_Result);\r\n }",
"function lastNumRows() {\n\t\tif ($this->hasResult()) {\n\t\t\treturn mysql_num_rows($this->_result);\n\t\t}\n\t\treturn null;\n\t}",
"function size()\n\t{\n return $this->_iRows;\n\t}",
"public abstract function GetNumRows();",
"function get_count()\n\t{\n\t\treturn $this->__num_rows;\n\t}",
"function lastNumRows ()\n {\n return $this->_result? pg_num_rows($this->_result): false;\n }",
"public function getRowCount()\n {\n return $this->row_count;\n }",
"public function getRowCount()\n {\n return $this->row_count;\n }",
"public function getRowCount()\n {\n return $this->row_count;\n }",
"public function numOfRows();",
"abstract public function getNumRows();",
"abstract public function getNumRows();",
"public function num_rows() {\n\t\treturn $this->GetNumRows();\n\t}",
"function num_rows()\r\n {\r\n return mysql_num_rows($this->res_id);\r\n }",
"public function numRows() : int\n\t{\n\t\treturn $this->handle->numRows($this->result);\n\t}",
"public function getRowsCount()\n {\n if ($this->num_rows === 0 && count($this->resultArray()) > 0) {\n $this->num_rows = count($this->resultArray());\n @oci_execute($this->stmt_id, OCI_DEFAULT);\n\n if ($this->curs_id) {\n @oci_execute($this->curs_id, OCI_DEFAULT);\n }\n }\n\n return $this->num_rows;\n }",
"public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }",
"function get_num_records()\n\t{\n\t\t$this->sql = 'SELECT COUNT(*) FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\treturn db_getOne($this->sql, $this->use_db);\n\t}",
"function num_rows()\n\t{\n\t\treturn @mysqli_num_rows($this->m_query_id);\n\t}",
"public function numRows() {\n\t\t$q = \"SELECT COUNT(*) FROM {$this->_name}\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\tlist($numRows) = sqlite_fetch_array($r, SQLITE_NUM);\n\t\treturn $numRows;\n\t}",
"public function cekRows(){\n $query = \"SELECT COUNT(*) AS numrows FROM \".NEWS_TABLE;\n $result = mysql_query($query) or die('Error, query failed');\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $numrows = $row['numrows']; \n \n return $numrows;\n }",
"public function num_rows() {\n\t\t\treturn $this->count();\n\t\t}",
"function get_total_replies(){\n global $db;\n $query = 'SELECT count(*) FROM replies';\n $statement = $db->prepare($query);\n $statement->execute();\n $total_replies = $statement->fetchAll();\n $total_replies = $statement->rowCount();\n $statement->closeCursor();\n return $total_replies;\n }",
"function numRows()\n\t{\n\t\treturn $this->_num_rows;\n\t}",
"public function get_row_count() {\n return 0;\n }",
"public function getNumberOfRows(){\r\n $this->setTable('subscribed');\r\n $table = $this->getTable();\r\n\r\n $sql = \"SELECT * FROM \" . $table;\r\n $stmt = $this->fetch()->query($sql);\r\n return $stmt->rowCount();\r\n }",
"public function countData($qr){\n\t\t$totalRow = mysql_num_rows($qr);\n\t\treturn $totalRow;\n\t}",
"public function getNumberOfRows();",
"public function getRowCount() {\n\t\treturn $this->ROW_COUNT;\n\t}",
"function numRows() {\r\n return mysql_num_rows( $this->Query_ID );\r\n }",
"function numRows()\n {\n return mysql_num_rows( $this->Query_ID );\n }",
"public function count()\n {\n return $this->rows;\n }",
"public function getAffectedItemsCount() {}",
"public function count() {\n\t\t$this->checkResultSet();\n\t\treturn $this->indexMax;\n\t}",
"public function fetchNrRecordsToGet();",
"public function numberOfRows();",
"public function lastNumRows()\n {\n return ($this->_result) ? db2_num_rows($this->_result) : false;\n }",
"function num_rows($query)\n\t{\n\t\treturn pg_num_rows($query);\n\t}",
"function affected_rows($query)\n\t{\n\t\treturn $query->rowCount();\n\t}",
"public function rows_affected() {\n\t\tif ($this->q) {\n\t\t\treturn $this->q->numrows();\n\t\t}\n\n\t\treturn 0;\n\t}",
"function count()\n{\n\tif (!$this->getSql()) return 0;\n\t$rows = $this->getClone()->select('count(*) as n');\n\treturn (int)$rows[0]['n'];\n}",
"public function getNumResultsStored() : int{\n return $this->numResults;\n }",
"function num_rows()\r\n\t{\r\n\t\tif ( ! $this->pdo_results ) {\r\n\t\t\t$this->pdo_results = $this->result_id->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t}\r\n\t\treturn sizeof($this->pdo_results);\r\n\t}",
"function num_rows_db($query) {\n\t\t$tmp = mysql_num_rows($query);\n\t\treturn ($tmp);\n\t}",
"function countRows($result)\n{\n $rownum = 0;\n while (OCI_Fetch_Array($result, OCI_BOTH)) {\n $rownum++;\n }\n return $rownum;\n}",
"function affected_rows() {\n\t\t// return mssql_affected_rows($this->Query_ID);\n\t\t$rsRows = mssql_query(\"Select @@rowcount as rows\", $this->Link_ID);\n\t\tif ($rsRows) { \n\t\t return mssql_result($rsRows, 0, \"rows\");\n\t\t}\n\t}",
"public function countRows()\n {\n return count($this->rows);\n }",
"public function getNumberOfRows() {\n return count($this->rows);\n }",
"function numResults() {\n\t\treturn $this->num_rows();\n\t}",
"public function rowCount()\n {\n return sasql_num_rows($this->result);\n }",
"public function count()\n {\n return count($this->_rows);\n }",
"public function getRowCount() {\n return $this->Read->rowCount();\n }",
"public function numberRows(): int\n {\n $number = 0;\n $dbResult = $this->query(\"SELECT FOUND_ROWS() AS number\");\n $data = $dbResult->fetch();\n if (isset($data[\"number\"])) {\n $number = $data[\"number\"];\n }\n return (int) $number;\n }",
"public function num_rows()\n {\n return @mysql_num_rows( $this->Query_ID );\n }",
"public function getNumRows(): int\n {\n if (is_int($this->numRows)) {\n return $this->numRows;\n }\n if ($this->resultArray !== []) {\n return $this->numRows = count($this->resultArray);\n }\n if ($this->resultObject !== []) {\n return $this->numRows = count($this->resultObject);\n }\n\n return $this->numRows = count($this->getResultArray());\n }",
"public function count() {\n return $this->row_count();\n }",
"function num_rows($rs)\n{\n\treturn @mysql_num_rows($rs);\n}",
"function NumQueries() {\n\t\t\treturn $this->querycount;\n\t\t}",
"public function get_rows(){ return $count = count($this->prod_id); }",
"abstract public function NumRows();",
"public function total_rows();"
] | [
"0.752873",
"0.72110677",
"0.7203379",
"0.710606",
"0.7068103",
"0.6964544",
"0.69570726",
"0.6914925",
"0.68982536",
"0.6890901",
"0.6851458",
"0.6849998",
"0.6848957",
"0.68477607",
"0.68439215",
"0.68327075",
"0.68173295",
"0.6809114",
"0.6800613",
"0.6798816",
"0.67719334",
"0.6770011",
"0.67696196",
"0.67656726",
"0.6758313",
"0.6742507",
"0.67317355",
"0.6728242",
"0.67232525",
"0.6719793",
"0.6715355",
"0.67130667",
"0.6696069",
"0.66858613",
"0.66784143",
"0.66775775",
"0.666897",
"0.66633034",
"0.66625065",
"0.6657055",
"0.66547954",
"0.6648808",
"0.66484773",
"0.6632599",
"0.6623953",
"0.6623314",
"0.66127354",
"0.66127354",
"0.66127354",
"0.66084754",
"0.66070753",
"0.66070753",
"0.65990824",
"0.65976375",
"0.65957063",
"0.659467",
"0.65750533",
"0.65734416",
"0.6570654",
"0.65697217",
"0.6568062",
"0.65646935",
"0.6555784",
"0.65480155",
"0.6536799",
"0.6529834",
"0.65206295",
"0.6518745",
"0.6518418",
"0.6513638",
"0.6504142",
"0.64917594",
"0.64894354",
"0.64868337",
"0.6485068",
"0.6475678",
"0.6471414",
"0.646511",
"0.64622736",
"0.64615566",
"0.64573455",
"0.644779",
"0.64463997",
"0.6445561",
"0.64398015",
"0.6437724",
"0.64372313",
"0.64296985",
"0.64242595",
"0.64229846",
"0.6417569",
"0.6417423",
"0.6414467",
"0.6413935",
"0.64010054",
"0.64004415",
"0.6400221",
"0.6400151",
"0.63883144",
"0.63831824",
"0.63820904"
] | 0.0 | -1 |
////////////////////////////////////////////////////////////////////////// GET THE LAST ERROR NUMBER ////////////////////////////////////////////////////////////////////////// | public function errno() {
$error = $this->error();
return empty($error) ? 0 : 1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_last_error() {\n\t\treturn $this->errors[count($this->errors - 1)];\n\t}",
"public final function last_error_code()\n {\n return isset($this->error) ? $this->error['code'] : 0;\n }",
"function lastErrNo(){\n if ( $this->connection ){\n return mysql_errno( $this->connection );\n } else {\n return mysql_errno();\n }\n }",
"public function errorNumber()\n\t{\n\t\treturn $this->_source->errorNumber();\n\t}",
"function lastError();",
"public function get_last_error() {\n\t\treturn $this->last_error;\n\t}",
"public function get_last_error() {\n\t\treturn $this->_error;\n\t}",
"abstract protected function _getErrorNumber();",
"public function getLastError() { return end($this->_traiat_errors); }",
"function msgsrv_last_error () {}",
"public function lastError()\r\n\t{\r\n\t\treturn @db2_stmt_errormsg();\r\n\t}",
"public function getError(): int\n {\n return $this->error;\n }",
"public function get_last_error() {\n return $this->last_error;\n }",
"public function get_last_error()\n {\n return $this->_error;\n }",
"public function lastError()\n {\n return $this->error;\n }",
"public function getLastError()\n {\n return 0;\n }",
"public function lastError()\n {\n if (!empty($this->_query->_ERRORS)) {\n echo '<pre>';\n echo $this->_query->_ERRORSPLAIN[ count($this->_query->_ERRORS) - 1 ];\n echo '</pre>';\n } elseif (!empty($this->_ERRORS)) {\n echo '<pre>';\n echo $this->_ERRORSPLAIN[ count($this->_ERRORS) - 1 ];\n echo '</pre>';\n }\n }",
"function error_number()\n\t{\n\t\treturn $this->_mysql_errno;\n\t}",
"protected function getLastError()\n {\n return error_get_last();\n }",
"public function lastError()\r\n\t{\r\n\t\treturn @mssql_get_last_message();\r\n\t}",
"public function getLastCode()\n {\n return $this->lastErrorCode;\n }",
"public function getLastErrorMessage()\n {\n return $this->lastErrorMessage;\n }",
"function ErrorNo()\n\t{\n\t\treturn 0;\n\t}",
"public function getErrNo() {\n return $this->get(self::ERR_NO);\n }",
"public function getErrorMsg()\r\n {\r\n return $this->lastErrorMsg;\r\n }",
"protected function get_error( ) {\n// i store only the latest word with 3 letters\n\n if (strlen($this->current_group_text) != 4) {\n if (strlen($this->current_group_text) == 3) {\n if ($this->current_group_text!='TAF') {\n $this->wxInfo['CODE_ERROR'] =$this->current_group_text;\n }\n $this->current_ptr++;\n }\n else {\n $this->current_ptr++;\n }\n } else {\n $this->current_group++;\n }\n }",
"function getError()\r\n\t{\r\n\t\treturn $this->error_code;\r\n\t}",
"public function lastError()\r\n\t{\r\n\t\tif( $this->conn->Errors->Count )\r\n\t\t\treturn $this->conn->Errors[ $this->conn->Errors->Count - 1 ]->Description;\r\n\t\t\r\n\t\treturn '';\r\n\t}",
"function error_number($query)\n\t{\n\t\tif(!is_object($query) || !method_exists($query, \"errorCode\"))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$errorcode = $query->errorCode();\n\n\t\treturn $errorcode;\n\t}",
"public function error($num = 0) {\n $numErrors = count($this->errors);\n if ($num === true) return $numErrors;\n elseif ($num < 0 || $num >= $numErrors)\n return false;\n return $this->errors[$numErrors - 1 - $num];\n }",
"public function getError() {\r\n return (is_null($this->error)) ? 0 : $this->error;\r\n }",
"abstract public function getLastError($return_number = false);",
"public function getErrorNumber() {\n return curl_errno($this->_getCommHandler());\n }",
"public function getError()\n {\n return imap_last_error();\n }",
"public function getLastError()\n {\n return $this->lastErrorMsg;\n }",
"public function getLastValidationError(): string;",
"private function getLastSocketError() {\n $errStr = '-1: Unknown error';\n\n if (function_exists('socket_import_stream')) {\n $socket = socket_import_stream($this->socket);\n $errCode = socket_last_error($socket);\n $errStr = $errCode . ': ' . socket_strerror($errCode);\n }\n\n return $errStr;\n }",
"public function getLastError()\r\n\t{\r\n\t\t// TODO: we should move this to returning an Error\r\n\t\t$numErrors = count($this->errors);\r\n\t\tif ($numErrors > 0)\r\n\t\t{\r\n\t\t\treturn $this->errors[$numErrors-1]['message'];\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}",
"public function getError() {\n return imap_last_error();\n }",
"public function getError() {\n\t\treturn $this->current_error;\n\t}",
"public function lastError(){\n $error = '';\n \n if ($this->connection){\n $error = mysql_error( $this->connection );\n }\n \n return $error;\n }",
"public function incrementErrorCount();",
"public function getErrorNo()\n {\n return curl_errno($this->ch);\n }",
"function getErro(){\n\t\t$erro;\n\t\tswitch ($this->intBanco){\n\t\t\tcase INT_SQLSERVER:\n\t\t\t\t$erro = mssql_get_last_message();\n\t\t\t\tbreak;\n\t\t\tcase INT_ORACLE:\n\t\t\t\t$erro1 = oci_error($this->cursor);\n\t\t\t\t$erro = $erro1[\"message\"];\n\t\t\t\tbreak;\n\t\t\tcase INT_POSTGRE:\n\t\t\t\t$erro = pg_last_error($this->conexao);\n\t\t\t\tbreak;\n\t\t\tcase INT_MYSQL:\n\t\t\t\t$erro = mysql_error();\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $erro;\n\t}",
"function GetError() \r\n{ \r\n$theerror = $this->LastError; \r\n$this->ClearError(); \r\nreturn $theerror; \r\n}",
"public final function last_error()\n {\n return isset($this->error) ? $this->error : false;\n }",
"public function getLast(): int {\n return $this->last;\n }",
"public function get_error_code()\n {\n }",
"public function getErrorCount();",
"function lastErrno();",
"public function getLastError()\n {\n if (!empty($this->_query->_ERRORS)) {\n return $this->_query->_ERRORSPLAIN[ count($this->_query->_ERRORS) - 1 ];\n } elseif (!empty($this->_ERRORS)) {\n return $this->_ERRORSPLAIN[ count($this->_ERRORS) - 1 ];\n }\n\n return false;\n }",
"public function get_last_error() {\n return @ldap_error($this->_conn);\n }",
"public function errNo()\n {\n return curl_errno($this->curl);\n }",
"public function getErrorcount() : int\n {\n return count($this->errors);\n }",
"protected function getLastDBError(\\MongoDB\\Database $db) {\n return $db->command([\n 'getLastError' => 1\n ])->toArray()[0];\n }",
"public function getError() {\n\t\treturn $this->lastError;\n\t}",
"protected function _getErrorNumber()\n {\n return '';\n }",
"public function lasterror(){\n\t\treturn mysqli_error($this->connection);\t\n\t}",
"public function getLastError() {\n\t\t\treturn $this->lastError;\n\t\t}",
"protected function _getErrorMessage()\n {\n return pg_last_error($this->conn_id);\n }",
"abstract public function getLastError();",
"abstract public function getLastError();",
"public function getErr() {}",
"public function getLastResult() {\n return $this->getLastReturnVar() === self::EXIT_NO_ERROR;\n }",
"public function getError()\n {\n return $this->currentError;\n }",
"public function getLastError()\n {\n return $this->lastError;\n }",
"public function getLastError()\n {\n return $this->lastError;\n }",
"public function getFailed(): int\n {\n return $this->failed;\n }",
"public function error()\n\t{\n\t\treturn reset($this->errors);\n\t}",
"protected function get_json_last_error()\n {\n }",
"public function getLastError();",
"private function get_last_number() {\n\t\treturn $this->settings['last_number'];\n\t}",
"public function getLastErrorCode(): ?string;",
"public function lastError(): string\n {\n $errno = smbclient_state_errno($this->state);\n return 'SMB: ' .$this->errorCode[$errno]?? \"error code $errno\";\n }",
"public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}",
"public function getErrorCount()\n {\n return $this->errorCount;\n }",
"private function get_failed_rows() {\n\t\treturn $this->failed_rows;\n\t}",
"public function getLastErrors(): iterable;",
"public static function getLastResult() {\n return self::$lastResult;\n }",
"function mg_api_last_error($error = null)\n{\n static $last_error;\n\n if (null === $error) {\n return $last_error;\n } else {\n $tmp = $last_error;\n $last_error = $error;\n\n return $tmp;\n }\n}",
"public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }",
"public function getLastErrorMessage(): ?string;",
"function getError()\n\t{\n\t\treturn $this->err;\n\t}",
"public function getError()\n {\n if (empty($this->error) != true){\n end($this->error); //Pointer to the end\n $key = key($this->error); //Get the key of last element\n $ret = array( \"code\" => $key, \"description\" => $this->error[$key] );\n reset($this->error);\n }else{\n $ret = array( \"code\" => \"get_error\", \"description\" => \"No are errors to show\" );\n }\n \n return $ret;\n }",
"function try_failure($count, $s, $e=\"\") {\n print \"> \". $s .\"*** failure ***<br />> Message: \". $e .\"<br />\";\n return ++$count;\n }",
"public function get_last_error_text() {\n\n if (!empty($this->last_error_text)) {\n return $this->last_error_text;\n }\n\n return FALSE;\n }",
"public function getLastError() {\n return $_SESSION['last_login_error'];\n }",
"public function lastDBError() {\n\t\t\t// Connect to the database\n\t\t\t$connection = $this->openConnection();\n\t\t\treturn $connection->error;\n\t\t}",
"public function errorcode();",
"public function getLastError() {}",
"public function getError()\n {\n $nb_errors = count($this->errors);\n\n if (0 === $nb_errors) {\n return null;\n }\n\n return $this->errors[$nb_errors - 1];\n }",
"function PopError(){\n\t\tif(count($this->_error_array)) return(array_pop($this->_error_array));\n\t\t\telse return(false);\n\t}",
"public function getError()\n\t{\n\t\treturn $this->err;\n\t}",
"function getlastmod(): int\n{\n error_clear_last();\n $safeResult = \\getlastmod();\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n return $safeResult;\n}",
"private function getLastXMLErrorMessage()\n {\n $errorMessage = null;\n $error = \\libxml_get_last_error();\n\n if ($error !== false) {\n $errorMessage = \\trim($error->message);\n }\n\n return $errorMessage;\n }",
"protected function getLastError() {}",
"public function get_error();",
"public function get_error();",
"public function getCode(): int\n\t{\n\t\treturn $this->err->getCode();\n\t}",
"public function getErrorCode(): int\n {\n return $this->error;\n }",
"public function getError()\n\t{\n\t\treturn $this->_usrError;\n\t}"
] | [
"0.7975947",
"0.76557386",
"0.7564555",
"0.74625975",
"0.73529553",
"0.7323814",
"0.72539985",
"0.72432494",
"0.724111",
"0.71671605",
"0.7087431",
"0.70497245",
"0.7046408",
"0.69754875",
"0.69714785",
"0.6960876",
"0.6958668",
"0.69529444",
"0.6928751",
"0.6927153",
"0.6919792",
"0.6913728",
"0.68210065",
"0.67974156",
"0.674876",
"0.6746417",
"0.67246836",
"0.6670539",
"0.6656278",
"0.6652396",
"0.6649728",
"0.66440433",
"0.6639159",
"0.663195",
"0.6615269",
"0.6605711",
"0.6587705",
"0.6567803",
"0.6547356",
"0.6535416",
"0.6533654",
"0.6509578",
"0.64978087",
"0.6492155",
"0.64904755",
"0.649037",
"0.6479628",
"0.6473458",
"0.64589626",
"0.6450689",
"0.6441498",
"0.64378595",
"0.6434075",
"0.6428293",
"0.642219",
"0.64130306",
"0.64057404",
"0.63881326",
"0.63864267",
"0.63598156",
"0.63574266",
"0.63574266",
"0.634857",
"0.63462985",
"0.6341441",
"0.6335015",
"0.6335015",
"0.6307841",
"0.63069445",
"0.6303528",
"0.6302802",
"0.62908167",
"0.628799",
"0.6276768",
"0.62707466",
"0.6235696",
"0.6226961",
"0.6224954",
"0.62195396",
"0.6214654",
"0.6202599",
"0.6199613",
"0.61806756",
"0.61768717",
"0.61685365",
"0.6165818",
"0.61487734",
"0.61377466",
"0.6137028",
"0.61235404",
"0.6113397",
"0.61044806",
"0.6101429",
"0.6098793",
"0.60970134",
"0.60941064",
"0.60863477",
"0.60863477",
"0.6079238",
"0.6074753",
"0.60603225"
] | 0.0 | -1 |
////////////////////////////////////////////////////////////////////////// GET THE LAST ERROR MESSAGE ////////////////////////////////////////////////////////////////////////// | public function error() {
if (!$this->connection) return @pg_last_error();
return pg_last_error($this->connection);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_last_error() {\n\t\treturn $this->errors[count($this->errors - 1)];\n\t}",
"public function getLastErrorMessage()\n {\n return $this->lastErrorMessage;\n }",
"public final function last_error_message()\n {\n return isset($this->error) ? $this->error['message'] : '';\n }",
"function msgsrv_last_error () {}",
"public function lastError()\n {\n if (!empty($this->_query->_ERRORS)) {\n echo '<pre>';\n echo $this->_query->_ERRORSPLAIN[ count($this->_query->_ERRORS) - 1 ];\n echo '</pre>';\n } elseif (!empty($this->_ERRORS)) {\n echo '<pre>';\n echo $this->_ERRORSPLAIN[ count($this->_ERRORS) - 1 ];\n echo '</pre>';\n }\n }",
"public function getLastErrorMessage(): ?string;",
"public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }",
"public function lastError()\r\n\t{\r\n\t\tif( $this->conn->Errors->Count )\r\n\t\t\treturn $this->conn->Errors[ $this->conn->Errors->Count - 1 ]->Description;\r\n\t\t\r\n\t\treturn '';\r\n\t}",
"public function getLastError()\r\n\t{\r\n\t\t// TODO: we should move this to returning an Error\r\n\t\t$numErrors = count($this->errors);\r\n\t\tif ($numErrors > 0)\r\n\t\t{\r\n\t\t\treturn $this->errors[$numErrors-1]['message'];\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}",
"public function get_last_error() {\n\t\treturn $this->_error;\n\t}",
"public function get_last_error() {\n\t\treturn $this->last_error;\n\t}",
"public function getErrorMsg()\r\n {\r\n return $this->lastErrorMsg;\r\n }",
"public function lastError()\r\n\t{\r\n\t\treturn @mssql_get_last_message();\r\n\t}",
"abstract public function getMsgError();",
"public function get_last_error() {\n return $this->last_error;\n }",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"public function get_last_error()\n {\n return $this->_error;\n }",
"public function getLastError() { return end($this->_traiat_errors); }",
"public function getLastError()\n {\n return $this->lastErrorMsg;\n }",
"protected function getLastError()\n {\n return error_get_last();\n }",
"protected function _getErrorMessage()\n {\n return pg_last_error($this->conn_id);\n }",
"function lastError();",
"public function get_last_error_text() {\n\n if (!empty($this->last_error_text)) {\n return $this->last_error_text;\n }\n\n return FALSE;\n }",
"public function lastError()\n {\n return $this->error;\n }",
"public function getMsgError() {\r\n return $this->msg_error;\r\n }",
"public function getLastError()\n {\n return $this->_errorMsg;\n }",
"public function getError()\n {\n return imap_last_error();\n }",
"public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }",
"public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}",
"public function getErrorMessage()\n {\n return $this->error_message;\n }",
"public function lastError(): string\n {\n $errno = smbclient_state_errno($this->state);\n return 'SMB: ' .$this->errorCode[$errno]?? \"error code $errno\";\n }",
"function get_error_message() {\n return $this->error_msg;\n }",
"private function getLastXMLErrorMessage()\n {\n $errorMessage = null;\n $error = \\libxml_get_last_error();\n\n if ($error !== false) {\n $errorMessage = \\trim($error->message);\n }\n\n return $errorMessage;\n }",
"public function getError() {\n\t\treturn $this->current_error;\n\t}",
"public function getError() {\n\t\treturn $this->lastError;\n\t}",
"public function getErrorMessage()\n {\n $errorMessages = $this->getErrorMessages();\n if (empty($errorMessages)) {\n return false;\n }\n return $errorMessages[0];\n }",
"public function getError() {\n return imap_last_error();\n }",
"public function lastError()\r\n\t{\r\n\t\treturn @db2_stmt_errormsg();\r\n\t}",
"public function getLastError() {\n\t\t\treturn $this->lastError;\n\t\t}",
"public function getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}",
"function GetError() \r\n{ \r\n$theerror = $this->LastError; \r\n$this->ClearError(); \r\nreturn $theerror; \r\n}",
"public function get_error_message() {\n\t\treturn $this->error_message;\n\t}",
"public function getMessage()\n {\n return $this->_error;\n }",
"public function lastError(){\n $error = '';\n \n if ($this->connection){\n $error = mysql_error( $this->connection );\n }\n \n return $error;\n }",
"public function getLastError()\n {\n return $this->lastError;\n }",
"public function getLastError()\n {\n return $this->lastError;\n }",
"function getErro(){\n\t\t$erro;\n\t\tswitch ($this->intBanco){\n\t\t\tcase INT_SQLSERVER:\n\t\t\t\t$erro = mssql_get_last_message();\n\t\t\t\tbreak;\n\t\t\tcase INT_ORACLE:\n\t\t\t\t$erro1 = oci_error($this->cursor);\n\t\t\t\t$erro = $erro1[\"message\"];\n\t\t\t\tbreak;\n\t\t\tcase INT_POSTGRE:\n\t\t\t\t$erro = pg_last_error($this->conexao);\n\t\t\t\tbreak;\n\t\t\tcase INT_MYSQL:\n\t\t\t\t$erro = mysql_error();\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $erro;\n\t}",
"abstract public function getLastError();",
"abstract public function getLastError();",
"public function getLastError(): string\r\n {\r\n return $this->lastError;\r\n }",
"function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}",
"public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }",
"public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}",
"public function getErrorMsg()\n\t{\n\t\treturn $this->error;\n\t}",
"public function getLastValidationError(): string;",
"public function getError()\r\n {\r\n return count($this->strError) == 0 ? null :\r\n (count($this->strError) == 1 ? $this->strError[0] :\r\n $this->strError);\r\n }",
"public function getLastError()\n {\n if (!empty($this->_query->_ERRORS)) {\n return $this->_query->_ERRORSPLAIN[ count($this->_query->_ERRORS) - 1 ];\n } elseif (!empty($this->_ERRORS)) {\n return $this->_ERRORSPLAIN[ count($this->_ERRORS) - 1 ];\n }\n\n return false;\n }",
"protected function get_error( ) {\n// i store only the latest word with 3 letters\n\n if (strlen($this->current_group_text) != 4) {\n if (strlen($this->current_group_text) == 3) {\n if ($this->current_group_text!='TAF') {\n $this->wxInfo['CODE_ERROR'] =$this->current_group_text;\n }\n $this->current_ptr++;\n }\n else {\n $this->current_ptr++;\n }\n } else {\n $this->current_group++;\n }\n }",
"protected function getLastPhpErrorMessage()\n {\n $lastError = error_get_last();\n if (!empty($lastError)) {\n $phpMessage = explode(':', $lastError['message'], 2);\n $phpMessage = trim(trim(end($phpMessage)), '.') . '.';\n return $phpMessage;\n }\n\n return '';\n }",
"public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }",
"public function getErrorMessage()\n\t\t{\n\t\t\t$error = $this->statement->errorInfo();\n\t\t\t$errorText \t= '<h6>Something happened ... :(</h6>';\n\t\t\t$errorText .= 'Error code : '.$error[0].'<br>';\n\t\t\t$errorText .= 'Driver error code : '.$error[1].'<br>';\n\t\t\t$errorText .= 'Error Message : '.$error[2].'<br>';\n\t\t\treturn $errorText;\n\t\t}",
"public function getLastError(): string\n {\n return $this->lastError;\n }",
"public function getError()\n {\n if (empty($this->error) != true){\n end($this->error); //Pointer to the end\n $key = key($this->error); //Get the key of last element\n $ret = array( \"code\" => $key, \"description\" => $this->error[$key] );\n reset($this->error);\n }else{\n $ret = array( \"code\" => \"get_error\", \"description\" => \"No are errors to show\" );\n }\n \n return $ret;\n }",
"public function get_error();",
"public function get_error();",
"public function getLastError();",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->errorMessage;\n }",
"public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }",
"public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}",
"public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}",
"public function getError();",
"public function getError();",
"public function getError();",
"public function getErrMsg() {\n $errMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()\n . '<br><b>Message: ' . $this->getMessage()\n . '</b><br>Exception Type: NoFormsFoundException';\n return $errMsg;\n }",
"public function getError()\n {\n return $this->currentError;\n }",
"public function getLastError() {}",
"function errorMsg() {\r\n return \r\n $this->resultError;\r\n }",
"public function getErrorMessage() {\n return $this->errorMessage;\n }",
"function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}",
"function get_error()\n\t{\n\t\tif ($this->error != \"\") {\n\t\t\treturn \"Error:\".$this->error;\n\t\t}\n\t\treturn \"\";\n\t}",
"public function getLastErrorCode(): ?string;",
"public function error()\n\t{\n\t\treturn reset($this->errors);\n\t}",
"protected function getLastError() {}",
"function getError()\r\n\t{\r\n\t\treturn $this->error_code;\r\n\t}",
"final public function error_get() : string{\r\n return (string) ($this->code != 0) ? \"[<b>{$this->code}</b>]: \".$this->message : $this->message;\r\n }",
"public function getError()\n\t{\n\t\t$arr = each($this->error);\n\t\treturn $arr['value'];\n\t}",
"function getError()\n\t{\n\t\treturn $this->err;\n\t}",
"public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}",
"function getError(){\n\t\t\treturn $this->error;\n\t\t}",
"public function getErrorMessage();",
"public function getErrorMessage();",
"public function getError() {}",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function getLastError() {\n\t\tif (null !== $this->connection) {\n\t\t\t$message = sprintf('%s (%i)', odbc_errormsg($this->connection), odbc_error($this->connection));\n\t\t\treturn $message;\n\t\t}\n\t}"
] | [
"0.8189831",
"0.81056446",
"0.7982793",
"0.7950936",
"0.77911425",
"0.7768822",
"0.7744018",
"0.7728154",
"0.77267426",
"0.766917",
"0.7662268",
"0.76616716",
"0.7609722",
"0.7503767",
"0.74661416",
"0.7450808",
"0.74405944",
"0.73984426",
"0.7347346",
"0.7340692",
"0.73337156",
"0.7326127",
"0.7316134",
"0.73088753",
"0.7282242",
"0.72649807",
"0.72431135",
"0.7239145",
"0.72077286",
"0.720057",
"0.71973217",
"0.719673",
"0.7193348",
"0.7183342",
"0.7180576",
"0.7179775",
"0.717797",
"0.71776956",
"0.71776605",
"0.717398",
"0.7171826",
"0.7156517",
"0.715465",
"0.7153486",
"0.7132895",
"0.7132895",
"0.7105128",
"0.7103041",
"0.7103041",
"0.7099208",
"0.70923215",
"0.7091309",
"0.70863336",
"0.70831364",
"0.70741624",
"0.7064184",
"0.7057183",
"0.70482296",
"0.70429105",
"0.70423186",
"0.7039435",
"0.70388556",
"0.7032637",
"0.701959",
"0.701959",
"0.7006012",
"0.69952303",
"0.69952303",
"0.69952303",
"0.69952303",
"0.69952303",
"0.69952303",
"0.69952303",
"0.69848657",
"0.69663507",
"0.696349",
"0.6957873",
"0.6957873",
"0.6957873",
"0.6952432",
"0.6947849",
"0.6941499",
"0.69378465",
"0.69338006",
"0.6933184",
"0.6929488",
"0.6911501",
"0.6909488",
"0.6903177",
"0.6902091",
"0.6892763",
"0.6881458",
"0.68800795",
"0.6876862",
"0.6876764",
"0.6875351",
"0.6875351",
"0.68737286",
"0.68721366",
"0.68721366",
"0.68651354"
] | 0.0 | -1 |
////////////////////////////////////////////////////////////////////////// GENERATE THE UPSERT PART OF THE QUERY ////////////////////////////////////////////////////////////////////////// | protected function _upsert($data) {
if (!pudl_array($data) || empty($data)) return false;
return ' ON CONFLICT (' .
$this->identifier(key($data)) .
') DO UPDATE SET ' .
$this->_update($data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateUpdateQuery($tableName, $columns, $rowData)\n{\n //Genereate the SET part of the query\n $i = 0;\n $set = \"\";\n\n for($i = 0; $i < count($columns); $i=$i+1)\n {\n\t//Check if the data value has been put inside single-quotes and add\n\t//them if needed\n\t$len = strlen($rowData[$i]);\n\tif( $len <= 1 || $rowData[$i][0] != \"'\" || $rowData[$i][$len-1] != \"'\" )\n\t $set = $set . $columns[$i] . \"='\" . $rowData[$i] . \"'\";\n\telse\n\t $set = $set . $columns[$i] . \"=\" . $rowData[$i];\n\n\tif ($i+1 < count($columns))\n\t $set = $set . \",\";\n }\n\n $len = strlen($rowData[0]);\n if( $len <= 1 || $rowData[0][0] != \"'\" || $rowData[0][$len-1] != \"'\" )\n\treturn \"UPDATE \" . $tableName . \" SET \" . $set . \" WHERE \" . $columns[0] . \"='\" . $rowData[0] . \"'\";\n else\n\treturn \"UPDATE \" . $tableName . \" SET \" . $set . \" WHERE \" . $columns[0] . \"=\" . $rowData[0];\n}",
"private function getInsertMixQuery()\n {\n\n /* Prepare data to insert into mysql */\n $this->equipment_id = isset($this->equipment_id) ? $this->equipment_id : \"0\";\n $this->department_id = isset($this->department_id) ? $this->department_id : \"0\";\n $this->voc = isset($this->voc) ? $this->voc : \"0.00\";\n $this->voclx = isset($this->voclx) ? $this->voclx : \"0.00\";\n $this->vocwx = isset($this->vocwx) ? $this->vocwx : \"0.00\";\n $this->rule_id = isset($this->rule_id) ? $this->rule_id : \"0\";\n\n\n $creation_time = isset($this->creation_time) ? $this->db->sqltext($this->creation_time) : time();\n\n $spentTime = (!empty($this->spent_time)) ? $this->db->sqltext($this->spent_time) : \"NULL\";\n\n $apmethod_id = isset($this->apmethod_id) ? \"{$this->db->sqltext($this->apmethod_id)}\" : \"NULL\";\n $exempt_rule = !empty($this->exempt_rule) ? \"'{$this->db->sqltext($this->exempt_rule)}'\" : \"NULL\";\n $waste_percent = isset($this->waste_percent) ? \"{$this->db->sqltext($this->waste_percent)}\" : \"NULL\";\n $recycle_percent = isset($this->recycle_percent) ? \"{$this->db->sqltext($this->recycle_percent)}\" : \"NULL\";\n $notes = !empty($this->notes) ? \"'{$this->db->sqltext($this->notes)}'\" : \"NULL\";\n $parentID = ($this->parent_id !== null) ? $this->db->sqltext($this->parent_id) : \"NULL\";\n $repairOrderId = ($this->wo_id !== null) ? $this->db->sqltext($this->wo_id) : \"NULL\";\n $stepId = ($this->getStepId() !== null) ? $this->db->sqltext($this->getStepId()) : \"NULL\";\n $pfpId = ($this->getPfpId() !== null) ? $this->db->sqltext($this->getPfpId()) : \"NULL\";\n\n\n $query = \"INSERT INTO \" . TB_USAGE . \" (equipment_id, department_id, \" .\n \"description, voc, voclx, vocwx, creation_time, spent_time, \" .\n \"rule_id, apmethod_id, exempt_rule, notes, waste_percent, \" .\n \"recycle_percent, iteration, parent_id, last_update_time, wo_id, step_id, pfp_id) VALUES (\" .\n \"{$this->db->sqltext($this->equipment_id)}, \" .\n \"{$this->db->sqltext($this->department_id)}, \" .\n \"'{$this->db->sqltext($this->description)}', \" .\n \"{$this->db->sqltext($this->voc)}, \" .\n \"{$this->db->sqltext($this->voclx)}, \" .\n \"{$this->db->sqltext($this->vocwx)}, \" .\n \"{$creation_time}, \" .\n \"{$spentTime}, \" .\n \"{$this->db->sqltext($this->rule_id)}, \" .\n \"{$apmethod_id}, \" .\n \"{$exempt_rule}, \" .\n \"{$notes}, \" .\n \"{$waste_percent}, \" .\n \"{$recycle_percent}, \" .\n \"{$this->db->sqltext($this->iteration)}, \" .\n \"{$parentID}, \" .\n \" NOW(), \" .\n \" {$repairOrderId}, \" .\n \" {$stepId}, \" .\n \" {$pfpId} \" .\n \") \";\n\n return $query;\n }",
"private function getUpdateMixQuery()\n {\n $spentTime = (!empty($this->spent_time)) ? $this->db->sqltext($this->spent_time) : \"NULL\";\n\n $pfpId = ($this->getPfpId() !== null) ? $this->db->sqltext($this->getPfpId()) : \"NULL\";\n\n $query = \"UPDATE \" . TB_USAGE . \" SET \";\n $query .= \"equipment_id={$this->db->sqltext($this->equipment_id)}, \";\n $query .= \"apmethod_id=\" . ((empty($this->apmethod_id)) ? \"NULL\" : \"{$this->db->sqltext($this->apmethod_id)}\") . \", \";\n $query .= \"voc={$this->db->sqltext($this->voc)}, \";\n $query .= \"voclx={$this->db->sqltext($this->voclx)}, \";\n $query .= \"vocwx={$this->db->sqltext($this->vocwx)}, \";\n $query .= \"waste_percent=\" . ((empty($this->waste_percent)) ? \"NULL\" : \"{$this->db->sqltext($this->waste_percent)}\") . \", \";\n $query .= \"recycle_percent=\" . ((empty($this->recycle_percent)) ? \"NULL\" : \"{$this->db->sqltext($this->recycle_percent)}\") . \", \";\n $query .= \"description='{$this->db->sqltext($this->description)}', \";\n $query .= \"rule_id={$this->db->sqltext($this->rule_id)}, \";\n $query .= \"exempt_rule = \" . ((empty($this->exempt_rule)) ? \"NULL\" : \"'{$this->db->sqltext($this->exempt_rule)}'\") . \", \";\n $query .= \"notes = \" . ((empty($this->notes)) ? \"NULL\" : \"'{$this->db->sqltext($this->notes)}'\") . \", \";\n $query .= \"creation_time = {$this->db->sqltext($this->creation_time)}, \";\n $query .= \"spent_time = {$spentTime}, \";\n $query .= \"iteration = {$this->db->sqltext($this->iteration)}, \";\n $query .= \"parent_id = \" . ((empty($this->parent_id)) ? \"NULL\" : $this->db->sqltext($this->parent_id)) . \", \";\n $query .= \"pfp_id = {$pfpId}, \";\n $query .= \"last_update_time = NOW() \";\n $query .= \" WHERE mix_id ={$this->db->sqltext($this->mix_id)}\";\n return $query;\n }",
"private function getPrepared()\n {\n $array = $this->ToArray();\n unset($array['currentPage']);\n unset($array['pageCount']);\n unset($array['errors']);\n unset($array['insert']);\n unset($array['table']);\n unset($array['Adapter']);\n unset($array['pdoFetch']);\n unset($array['cmsFetchMode']);\n unset($array[$this->primaryName]);\n unset($array['primaryName']);\n $prepared['update'] = '';\n foreach($array as $k=>$v)\n {\n $prepared['values'][':'.$k] = $v;\n $prepared['update'] .= '`'.$k.'`'.\"=\".':'.$k.',';\n }\n if ($prepared['update']{strlen($prepared['update'])-1} == ',')\n {\n $prepared['update'] = substr($prepared['update'],0,-1);\n }\n $prepared['set'] = implode(', ', array_keys($array));\n return $prepared;\n }",
"function getInsertUpdateDataString($dataArray, $tableName)\r\n\t{\r\n\t\t//INSERT INTO table (primarykeycol,col1,col2) VALUES (1,2,3) ON DUPLICATE KEY UPDATE col1=0, col2=col2+1\r\n\t\t$dataArray = get_object_vars($dataArray);\r\n\t\t$fieldArr = array();\r\n\t\t$dataArr = array();\r\n\t\tforeach($dataArray as $key=>$value)\r\n\t\t{\r\n\t\t\t$fieldArr[] = $key;\r\n\t\t\t$dataArr[] = \"'\".addslashes($value).\"'\";\r\n\t\t}\r\n\t\t$field = implode(\", \",$fieldArr);\r\n\t\t$data = implode(\", \",$dataArr);\r\n\t\t\r\n\t\t$updateDataArr = array();\r\n\t\tforeach($dataArray as $key=>$value)\r\n\t\t{\r\n\t\t\t$updateDataArr[] = $key.\" = '\".addslashes($value).\"'\";\r\n\t\t}\r\n\t\t$updateData = implode(\", \",$updateDataArr);\r\n\t\t\r\n\t\t$query = \"INSERT INTO \".$tableName.\" (\".$field.\") VALUES (\".$data.\") ON DUPLICATE KEY UPDATE \".$updateData.\";\";\r\n\t\treturn $query;\r\n\t}",
"function yy_r101(){\n $this->_retvalue = new SQL\\Update($this->yystack[$this->yyidx + -5]->minor, $this->yystack[$this->yyidx + -3]->minor);\n if ($this->yystack[$this->yyidx + -4]->minor) $this->_retvalue->joins($this->yystack[$this->yyidx + -4]->minor);\n if ($this->yystack[$this->yyidx + -2]->minor) $this->_retvalue->where($this->yystack[$this->yyidx + -2]->minor);\n if ($this->yystack[$this->yyidx + -1]->minor) $this->_retvalue->orderBy($this->yystack[$this->yyidx + -1]->minor);\n if ($this->yystack[$this->yyidx + 0]->minor) $this->_retvalue->limit($this->yystack[$this->yyidx + 0]->minor[0], $this->yystack[$this->yyidx + 0]->minor[1]);\n }",
"public function save(){\n\t\t$v = get_object_vars($this);\n\t\tunset($v['TABLE']);\n\t\tunset($v['IS_UPDATING']);\n\t\t$key_s = \"\";\n\t\t$key_v = \"\";\n\t\tforeach($v as $key => $val){\n\t\t\t$key_s .= \"$key, \";\n\t\t\t$key_v .= \"'$val', \";\n\t\t}\n\t\t$key_s = substr_replace($key_s, '', strlen($key_s)-2);\n\t\t$key_v = substr_replace($key_v, '', strlen($key_v)-2);\n\t\tif($this->IS_UPDATING){\n\t\t\t$str = \"\";\n\t\t\tunset($v['id']);\n\t\t\tforeach($v as $key => $val){\n\t\t\t\t$str .= $key . \"='$val', \";\n\t\t\t}\n\t\t\t$str = substr_replace($str, '', strlen($str)-2);\n\t\t\t$query = \"UPDATE {$this->TABLE} SET $str WHERE id = {$this->id}\";\n\t\t} else {\n\t\t\t$query = \"INSERT INTO {$this->TABLE} ($key_s) VALUES ($key_v)\";\n\t\t}\n\t\t$q = parent::query($query);\n\t\treturn $q;\n\t}",
"private function insertUnMatched()\n {\n $newElements = $this->unMatchedCollection->map(function ($item) {\n\n //Unset primary key property because it can create Integrity constraint violation: Duplicate ID\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($item->id);\n\n if(!empty($this->associativeColumns))\n {\n $newItem = new \\stdClass();\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n foreach ($this->associativePivots as $baseColumn => $mergeColumn)\n {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n\n $item = $newItem;\n }\n\n\n return get_object_vars($item);\n\n })->toArray();\n\n if (!empty($newElements))\n $this->rowInserted = DB::table($this->baseTable)->insert($newElements);\n }",
"private static function prepareUpdate($toupdate) {\n $updates = \"\";\n $keys = array_keys($toupdate);\n for($i = 0; $i < count($keys); $i++) {\n $updates .= $keys[$i] . \"=?\";\n $updates .= ($i < count($keys) - 1 ? \", \" : \" \");\n }\n $updates .= \"WHERE id=?\";\n return $updates;\n }",
"function Update()\n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$updateParam = \"\";\n\t\t$updateValue = \"\";\n\t\t$blobs = array();\n\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\t$command = 'if(isset($this->'.$fld['varname'].')) { ';\n\t\t\tif( $fld[\"key\"] )\n\t\t\t\t$command.= '$this->Param[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\telse\n\t\t\t\t$command.= '$this->Value[\\''.escapesq($fieldname).'\\'] = $this->'.$fld['varname'].';';\n\t\t\t$command.= ' }';\n\t\t\t\n\t\t\teval($command);\n\t\t\t\n\t\t\tif( !$fld[\"key\"] && !array_key_exists( strtoupper($fieldname), array_change_key_case($this->Param, CASE_UPPER) ) )\n\t\t\t{\n\t\t\t\tforeach($this->Value as $field => $value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateValue.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \", \";\n\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\t\n\t\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\t\t\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($this->Param as $field=>$value)\n\t\t\t\t{\n\t\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\n\t\t\t\t\t$updateParam.= $this->_connection->addFieldWrappers( $fieldname ).\"=\".$this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\tconstruct SQL and do update\t\n\t\tif ($updateParam)\n\t\t\t$updateParam = substr($updateParam, 0, -5);\n\t\tif ($updateValue)\n\t\t\t$updateValue = substr($updateValue, 0, -2);\n\t\t\t\n\t\tif ($updateValue && $updateParam)\n\t\t{\n\t\t\t$dalSQL = \"update \".$this->_connection->addTableWrappers( $this->m_TableName ).\" set \".$updateValue.\" where \".$updateParam;\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\n\t\t//\tcleanup\n\t\t$this->Reset();\n\t}",
"function updateViaPreparedPostHash($table,$key,$fields,$post,$data = array()){\n //print_pre($post,\"post hash\");\n //print_pre($data,\"data hash\");\n //print \"updateViaPreparedPostHash(): fields \" . implode(\",\",$fields) . \"<br>\\n\";\n if( ! isset($post[$key]) || $post[$key] == \"\" ){\n // then dont do anything\n //print \"updateViaPreparedPostHash(): post key failed<br>\\n\";\n return \"\";\n }\n $where = \" where $key='{$post[$key]}'\";\n \n // convert any special changes for html display to original values... ie: apostrophes\n foreach($post as &$p) $p = str_replace(array(\"'\",\"\\'\"),array(\"'\",\"'\"),$p);\n \n $fs = array();\n $vs = array();\n foreach( $fields as $field){\n if( $post[$field] != $data[$field] ) {\n $fs[] = \"$field=?\";\n $vs[] = $post[$field];\n }\n }\n //print \"updateViaPreparedPostHash(): field count: \" . count($fs) . \"<br>\\n\";\n \n if( count($fs) > 0) {\n $setstr = implode(\",\",$fs);\n $vstr = implode(\",\",$vs);\n $pq = \"update $table set \" . $setstr . $where;\n $stm = $this->dbh->prepare($pq);\n $status = $stm->execute($vs);\n //print \"updateViaPreparedPostHash(): prepared query: $pq : valstr: $vstr<br>\\n\";\n return $stm->queryString . \" with values: \" . $vstr;\n }\n else return \"\";\n \n //$this->mesgs .= \"qstr: $qstr<br>\\n\";\n }",
"protected function _update()\n\t{\n\t\t// UPDATE 'table' SET\n\t\t$this->_query = 'UPDATE '.$this->_table.' SET ';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$this->_query .= \"$key = '$value'\";\n\n\t\t\t$first = false;\n\t\t} // foreach\n\n\t\t// WHERE foo = 'bar'\n\t\t$this->_query .= ' WHERE ';\n\t\t$imax = count($this->_where);\n\t\t$first = true;\n\t\tfor($i=0; $i<$imax; $i++) {\n\t\t\t$this->_query .= ($first) ? ('') : (' AND '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $this->_where[$i]['row'].' ';\n\t\t\t$this->_query .= $this->_where[$i]['condition'].' \\'';\n\t\t\t$this->_query .= $this->_where[$i]['value'].'\\'';\n\t\t} // foreach\n\n\t\t// end ;\n\t\t$this->_query .= ';';\n\n\t\treturn $this->_query;\n\t}",
"public function getForUpdateSQL();",
"function import2ds() {\r\n $ok = 0;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if (isset($_REQUEST['field'][$colvar]) and !isset($this->ds->$colvar)) { # i hazardously ignore action state (updatable, insertable...)\r\n # note: below hasbeen moved to import_suggest_field_to_ds()\r\n if ($this->action == 'new' and $col->parentkey) {# special case for detail-new, parent-linked field val only supplied by post as field[fieldname][0]=val. let's copied this to all indices\r\n $value = $_REQUEST['field'][$colvar][0];\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n }\r\n else {\r\n $this->ds->$colvar = $_REQUEST['field'][$colvar];\r\n }\r\n $ok = 1;\r\n }\r\n elseif ($col->inputtype == 'checkbox' and !isset($_REQUEST['field'][$colvar][$i]) and !isset($this->ds->$colvar)) {\r\n # special case for checkbox. unchecked checkboxes do not generate empty key/val. so depending whether this is group checkboxes or single checkbox, we initialize it to correct value.\r\n # if we dont explicitly say its value is (ie, value=0), and the previous value in db is 1, then checkbox would never be saved as unchecked, since populate will passess current value in db.\r\n if ($col->enumerate != '') {\r\n $value = array(); # assign it to empty array. TODO: should test this.\r\n }\r\n else {\r\n $value = 0; # BOOLEAN 0/1\r\n }\r\n $this->ds->$colvar = array();\r\n for ($i=0; $i<$_REQUEST['num_row']; $i++) {\r\n $this->ds->{$colvar}[$i] = $value;\r\n }\r\n $ok = 1;\r\n }\r\n else {\r\n #~ echo 'not ok';\r\n }\r\n }\r\n\r\n $this->db_count = $ok;\r\n }",
"function augmentSQL(SQLQuery &$query) {\r\n\t}",
"public function mergeQuery(array $queryToBeAppended);",
"public function compileUpsert(Builder $query, array $values, array $uniqueBy, array $update)\n {\n $sql = $this->compileInsert($query, $values);\n\n $sql .= ' on conflict ('.$this->columnize($uniqueBy).') do update set ';\n\n $columns = collect($update)->map(function ($value, $key) {\n return is_numeric($key)\n ? $this->wrap($value).' = '.$this->wrapValue('excluded').'.'.$this->wrap($value)\n : $this->wrap($key).' = '.$this->parameter($value);\n })->implode(', ');\n\n return $sql.$columns;\n }",
"private function cObjData_updateRow( $uid )\n {\n static $firstVisit = true;\n\n // RETURN: empty row\n if ( empty( $this->rows[ $uid ] ) )\n {\n return;\n }\n // RETURN: empty row\n // Add each element of the row to cObj->data\n foreach ( ( array ) $this->rows[ $uid ] as $key => $value )\n {\n $this->pObj->cObj->data[ $key ] = $value;\n }\n\n // Add the field uid with the uid of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'uid' ] = $value;\n\n // Add the field value with the value of the current row\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'value' ] = $value;\n\n // Add the field hits with the hits of the filter item\n $key = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n $value = $this->rows[ $uid ][ $key ];\n $this->pObj->cObj->data[ 'hits' ] = $value;\n//$this->pObj->dev_var_dump( $this->pObj->cObj->data['hits'] );\n // Add the field rowNumber with the number of the current row\n $key = $this->pObj->prefixId . '.rowNumber';\n $value = $this->itemsPerHtmlRow[ 'currItemNumberInRow' ];\n\n // DRS\n if ( $firstVisit && $this->pObj->b_drs_cObjData )\n {\n foreach ( ( array ) $this->pObj->cObj->data as $key => $value )\n {\n $arr_prompt[] = '\\'' . $key . '\\' => \\'' . $value . '\\'';\n }\n $prompt = 'cObj->data of the first row: ' . implode( '; ', ( array ) $arr_prompt );\n t3lib_div::devlog( '[OK/COBJ] ' . $prompt, $this->pObj->extKey, -1 );\n }\n // DRS\n\n $firstVisit = false;\n }",
"public function addToInsertSQLArray();",
"function process_query_insert( $query )\n\t{\n\t\treturn $query;\n\t}",
"function execute(){\n\t\tcanonicalizeNQL($this->source->getDocument(),$this->source->getFirstChild()->getPath());\n\t\tcanonicalizeNQL($this->destination->getDocument(),$this->destination->getFirstChild()->getPath());\n\t\t\n\t\t// creating a third XML with only the root of the request, to copy the merging into it\n\t\t$operation = $this->source->nodename();\n\t\t$source_elementNode = $this->source->getFirstChild();\n\t\t$element = $source_elementNode->nodename();\n\t\t$this->query_final = new XML($this->source->toString());\n\t\t\n\t\t$this->query_final->removeChild('/*[1]/*[1]/INFO');\n\t\t$final_operationNode = $this->query_final->getElement('/*[1]');\n\t\t$final_elementNode = $this->query_final->getElement('/*[1]/*[1]');\n\t\t\n\t\t// mixing the INFO nodes\n\t\t$this->handleInfoNode();\n\t\t\n\t\t// copying SORT, PAGINATE, etc\n\t\t// first removing the existing one\n\t\tif($final_operationNode->getElement('SORT') && $this->destination->getElement('SORT')){\n\t\t\t$final_operationNode->removeChild('/SORT');\n\t\t}\n\t\tif($final_operationNode->getElement('PAGINATE') && $this->destination->getElement('PAGINATE')){\n\t\t\t$final_operationNode->removeChild('/PAGINATE');\n\t\t}\n\t\tif($final_operationNode->getElement('RETURN') && $this->destination->getElement('RETURN')){\n\t\t\t$final_operationNode->removeChild('/RETURN');\n\t\t}\n\t\t\n\t\t$nodes_to_import = $this->destination->getElements('/*[position()>1]');\n\t\tforeach($nodes_to_import as $node){\n\t\t\t$final_operationNode->appendChild($node->toString());\n\t\t}\n\t\t\n\t\t// copying other crits than INFO : DESCRIPTION, CATGEORY, DEPENDENCY\n\t\t//$final_elementNode->appendChild($this->destination->getFirstChild()->copyOf('/*[name()!=\"INFO\"]'));\n\t\t$other_children = $this->destination->getFirstChild()->getElements('/*[name()!=\"INFO\"]');\n\t\tforeach($other_children as $node){\n\t\t\t$final_elementNode->appendChild($node->toString());\n\t\t}\n\t\t\n\t\tquery_log($this->query_final->toString());\n\t\treturn $this->query_final;\n\t\treturn false;\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}",
"protected function rewriteData()\n\t{\n\t\t$db = $this->getDatabase();\n\n\t\t$fields = array('someval_facebook_valid', 'someval_facebook_type', 'someval_facebook_friends_or_likes',\n\t\t\t\t\t\t'someval_twitter_valid', 'someval_twitter_tweets', 'someval_twitter_followers', 'someval_twitter_following');\n\n\t\tforeach ($this->aData AS &$elm)\n\t\t{\n\t\t\t$query = $db->getQuery(true);\n\n\t\t\t$query->update($db->qn('#__accountdata'))\n\t\t\t\t\t->where('bid = ' . $elm->bid);\n\n\t\t\tforeach ($fields as $f)\n\t\t\t{\n\t\t\t\t$query->set($db->qn($f) . ' = ' . $db->q($elm->$f));\n\t\t\t}\n\n\t\t\t$db->setQuery($query);\n\n\t\t\tif (!$db->execute())\n\t\t\t{\n\t\t\t\tLog::add('Something went wrong for bid=:' . $elm->bid);\n\t\t\t}\n\t\t}\n\t}",
"function test_update($urabe, $body)\n{\n $values = $body->update_params;\n $column_name = $body->column_name;\n $column_value = $body->column_value;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->update($table_name, $values, \"$column_name = $column_value\");\n}",
"function yy_r102(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -2]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0])->fields($this->yystack[$this->yyidx + 0]->minor[1]);\n }",
"function unify($connect,$pred,$arg_list,$bindings) {\n\n print_psql(\"<unify pred='$pred'>\");\n\n print_psql(\"<arglist>\");\n print_r($arg_list);\n print_psql(\"</arglist>\");\n\n print_psql(\"<bindings>\");\n print_r($bindings);\n print_psql(\"</bindings>\");\n\n\n // get_satisfiers returns a triple:\n //\n // a) pred id\n // b) arglist\n // c) bindings set\n\n print_psql(\"<get_sat_rows>\");\n $satisfier_rows = get_sat_rows($connect,$pred,$arg_list,$bindings);\n\n $solutions = array();\n $solutions_arg_lists = array();\n $soln_i = 0;\n\n while($sat_row = pg_fetch_array($satisfier_rows,NULL,PGSQL_ASSOC)) {\n $pred_id = $sat_row['pred_id'];\n\n print_psql(\"<foundrow id='{$sat_row['pred_id']}'>\");\n \n $sat_arg_list = array();\n $sat_bindings = array();\n \n $i = 1;\n while($sat_row['arg'.$i]) {\n // note that $arg_list is the list of\n // arguments that is for this unify() call,\n // not the list of arguments that this row is returning.\n // we are setting sat_bindings with keys being the former \n // ie, the unify() call's arguments, not the arguments in $sat_row.\n $arg = $arg_list[$i-1];\n\n $sat_arg_list[] = $sat_row['arg'.$i];\n\n if ($sat_row[\"arg\".$i.\"type\"] == \"c\") {\n\t$key = $arg;\n\t$val = $sat_row[\"arg\".$i];\n }\n else {\n\t$key = $sat_row[\"arg\".$i];\n\t$val = $bindings[$arg];\n }\n\n // check to see if we've already set a value variable $arg in $bindings\n if (isset($sat_bindings[$key])) {\n\t\n\t// already set : is it consistent?\n\tif ($sat_bindings[$arg] != $val) {\n\t // no: unify fails.\n\t // (fixme: error handling: replace die with continue when done testing)\n\t die(\"inconsistent binding: tried to set to : {$bindings[$arg]}, but already set to : {$bindings[$arg]}\");\n\t}\n\telse {\n\t // $sat_bindings equal to old bindings; nothing needed.\n\t}\n }\n else {\n\t$sat_bindings[$key] = $val;\n }\n $i++;\n }\n\n $solutions[] = $sat_bindings;\n\n print_psql(\"<sat_arg_list>\");\n print_r($sat_arg_list);\n print_psql(\"</sat_arg_list>\");\n\n print_psql(\"<sat_bindings>\");\n print_r($sat_bindings);\n print_psql(\"</sat_bindings>\");\n\n $right_side_tuple = right_side($connect,$pred_id);\n\n $right_side_rows = $right_side_tuple[1];\n\n // FIXME: unify treatment of right_side being empty or not: \n\n if (count($right_side) == 0) {\n $solutions_arg_lists[$soln_i] = $arg_list;\n $soln_i++;\n $solutions[] = $sat_bindings;\n $right_side_sets = array();\n }\n else {\n $right_side_rows = unify_right_side_rows($connect,$right_side_rows,$sat_bindings);\n }\n\n $soln_i = 1;\n while($right_side_row = pg_fetch_array($right_side_rows,NULL, PGSQL_ASSOC)) {\n // add a arg-list for each solution.\n print_psql(\"<rs_set num=\\\"{$soln_i}\\\">\");\n print_r($right_side_row);\n print_psql(\"</rs_set>\");\n $soln_i++;\n }\n\n // create UNION ALL sql to create a row set to return.\n // http://www.postgresql.org/docs/8.1/interactive/sql-select.html#SQL-UNION\n\n // \"The result of UNION does not contain any duplicate rows unless the ALL option \n // is specified. ALL prevents elimination of duplicates. \n // (Therefore, UNION ALL is usually significantly quicker than UNION; \n // use ALL when you can.)\"\n\n // eg: \n /* \n\ncompany=# SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Bob' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION \n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Greg' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Eugene' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Salman' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Gustavo' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Lei' AS a2, 'Y' AS a2_from, 'B' AS a2_to UNION ALL\n SELECT 'Lex' AS a1 , 'X' AS a1_from, 'A' AS a1_to, 'Xavier' AS a2, 'Y' AS a2_from, 'B' AS a2_to;\n\n a1 | a1_from | a1_to | a2 | a2_from | a2_to \n-----+----------+--------+----------+----------+-------\n Lex | X | A | Bob | Y | B\n Lex | X | A | Eugene | Y | B\n Lex | X | A | Greg | Y | B\n Lex | X | A | Gustavo | Y | B\n Lex | X | A | Lei | Y | B\n Lex | X | A | Salman | Y | B\n Lex | X | A | Xavier | Y | B\n(7 rows)\n\ncompany=# \n\n\n */\n\n print_psql(\"</foundrow>\");\n }\n\n $n = count($solutions);\n print_psql(\"<solutions pred='$pred' count='$n'>\");\n\n $soln_i = 0;\n\n foreach($solutions as $solution) {\n print_psql(\"<solution id='$soln_i'>\");\n\n print_r($solution);\n\n $arg_i = 0;\n foreach($solutions_arg_lists[$soln_i] as $arg) {\n $val = $solution[$arg];\n $num = $arg_i+1;\n $to_name = $arg_list[$arg_i];\n print_psql(\"<arg num='$num' from_name='$arg' to_name='$to_name' val='$val'/>\");\n $arg_i++;\n $solutions_arg_lists[$soln_i][$arg_i] = $to_name;\n $solutions[$soln_i][$to_name] = $val;\n }\n\n print_psql(\"</solution>\");\n $soln_i++;\n\n }\n\n print_psql(\"</solutions>\");\n\n print_psql(\"</get_sat_rows>\");\n\n $solutions = array();\n $solutions_arg_lists = array();\n $soln_i = 0;\n\n print_psql(\"<get_satisfiers>\");\n $satisfiers_set = get_satisfiers($connect,$pred,$arg_list,$bindings);\n\n foreach($satisfiers_set as $sat_tuple) {\n\n // each $sat_tuple is a triple: < pred_id , list of (formal) parameters, bindings >\n\n print_psql(\"<sat_arg_list>\");\n print_r($sat_tuple[1]);\n print_psql(\"</sat_arg_list>\");\n print_psql(\"<sat_bindings>\");\n print_r($sat_tuple[2]);\n print_psql(\"</sat_bindings>\");\n\n $pred_id = $sat_tuple[0];\n $sat_arg_list = $sat_tuple[1];\n $sat_bindings = $sat_tuple[2];\n\n // each $sat_bindings is a set of \n // variable -> value bindings.\n\n $right_side_tuple = right_side($connect,$pred_id);\n\n $right_side = $right_side_tuple[0];\n $right_side_rows = $right_side_tuple[1];\n\n // FIXME: unify treatment of right_side being empty or not: \n\n if (count($right_side) == 0) {\n $solutions_arg_lists[$soln_i] = $arg_list;\n $soln_i++;\n $solutions[] = $sat_bindings;\n $right_side_sets = array();\n }\n else {\n $right_side_sets = unify_right_side($connect,$right_side,$sat_bindings);\n }\n\n // add a arg-list for each solution.\n foreach($right_side_sets as $set) {\n $solutions_arg_lists[$soln_i] = $sat_arg_list;\n $soln_i++;\n\n print_psql(\"<set>\");\n print_r($set);\n print_psql(\"</set>\");\n\n }\n $solutions = array_merge($solutions,$right_side_sets);\n }\n print_psql(\"</get_satisfiers>\");\n\n $n = count($solutions);\n print_psql(\"<solutions pred='$pred' count='$n'>\");\n\n $soln_i = 0;\n\n foreach($solutions as $solution) {\n print_psql(\"<solution id='$soln_i'>\");\n\n $new_solutions_arg_lists[$soln_i] = array();\n\n $arg_i = 0;\n foreach($solutions_arg_lists[$soln_i] as $arg) {\n $val = $solution[$arg];\n $num = $arg_i+1;\n $to_name = $arg_list[$arg_i];\n print_psql(\"<arg num='$num' from_name='$arg' to_name='$to_name' val='$val'/>\");\n $arg_i++;\n $new_solutions_arg_lists[$soln_i][$arg_i] = $to_name;\n $new_solutions[$soln_i][$to_name] = $val;\n }\n\n print_psql(\"</solution>\");\n $soln_i++;\n\n }\n\n print_psql(\"</solutions>\");\n print_psql(\"</unify>\");\n\n return array($new_solutions,$new_solutions_arg_lists);\n}",
"private\tfunction\t_prepareSaveQuery()\n\t\t{\n\t\t\tif(!$this->_columns) {\n\t\t\t\tself::$_queries[$this->_class]['save']\t=\tNULL;\n\t\t\t} else {\n\t\t\t\tself::$_queries[$this->_class]['save']\t=\t'INSERT INTO `'.$this->_table.'`(`'.implode('`,`', array_keys($this->_columns)).'`)'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rVALUES(?\".str_repeat(',?', sizeof($this->_columns) - 1).')'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rON DUPLICATE KEY UPDATE \".trim(self::$_queries[$this->_class]['updates'],', ');\n\t\t\t}\n\t\t\tunset(self::$_queries[$this->_class]['updates']);\n\t\t\t\n\t\t\treturn\tself::$_queries[$this->_class]['save'];\n\t\t}",
"function adv_update($table, array $data, array $where);",
"function data_merge($new)\n\t{\n\t\tif ((int) $this->debug >= 4) echo \"<p>so_sql::data_merge(\".print_r($new,true).\")</p>\\n\";\n\n\t\tif (!is_array($new) || !count($new))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tforeach($this->db_cols as $db_col => $col)\n\t\t{\n\t\t\tif (array_key_exists($col,$new))\n\t\t\t{\n\t\t\t\t$this->data[$col] = $new[$col];\n\t\t\t}\n\t\t}\n\t\tforeach($this->non_db_cols as $db_col => $col)\n\t\t{\n\t\t\tif (array_key_exists($col,$new))\n\t\t\t{\n\t\t\t\t$this->data[$col] = $new[$col];\n\t\t\t}\n\t\t}\n\t\tif (isset($new[self::USER_TIMEZONE_READ]))\n\t\t{\n\t\t\t$this->data[self::USER_TIMEZONE_READ] = $new[self::USER_TIMEZONE_READ];\n\t\t}\n\t\tif ((int) $this->debug >= 4) _debug_array($this->data);\n\t}",
"function AddDataDescriptiveStatisticsToDatabase($condition_dict, $projectID, $set_id, $branch_id, $file_id, $db, $standard_id_mappings)\n{\n\t/*foreach ($condition_dict as $cond) {\n\t\tif ($cond->is_control===1)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$insertArray = array();\n\t\tforeach ($cond->quant_dict_control_normalized as $key => $value) {\n\t\t\tarray_push($insertArray, array($projectID, $file_id, $set_id, $branch_id, $cond->condition_id, $key, $cond->quant_dict_avg_val[$key], $cond->quant_dict_mean_normalized[$key], $value, $cond->quant_dict_mean_normalized_p_value[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value[$key], $cond->quant_dict_sds[$key], $cond->quant_dict_control_normalized_p_value_bonferroni[$key], $cond->quant_dict_mean_normalized_p_value_bonferroni[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value_fdr[$key], $cond->quant_dict_mean_normalized_p_value_fdr[$key], $standard_id_mappings[$key]));\n\t\t}\n\t\t$chunked_array = array_chunk($insertArray, 2000);\n\t\tforeach ($chunked_array as $chunk) {\n\t\t\t$row_length = count($chunk[0]);\n\t\t\t$nb_rows = count($chunk);\n\t\t\t$length = $row_length * $nb_rows;\n\t\t\t$args = implode(',', array_map(\n\t\t\t\tfunction($el) { return '('.implode(',', $el).')'; },\n\t\t\t\tarray_chunk(array_fill(0, $length, '?'), $row_length)\n\t\t\t\t));\n\n\t\t\t$query_params = array();\n\t\t\tforeach($chunk as $array)\n\t\t\t{\n\t\t\t\tforeach($array as $value)\n\t\t\t\t{\n\t\t\t\t\t$query_params[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$insertText = \"INSERT INTO data_descriptive_statistics (project_id, file_id, set_id, branch_id, condition_id, unique_identifier_id, quant_val, fold_change_mean_norm, fold_change_control_norm, p_value_mean_norm, p_value_control_norm, std_dev, bonferroni_p_value_control_norm, bonferroni_p_value_mean_norm, fdr_p_value_control_norm, fdr_p_value_mean_norm, standard_molecule_id) VALUES \" . $args;\n\t\t\t$stmt = $db->prepare($insertText);\n\t\t\t$result = $stmt->execute($query_params);\n\t\t}\n\t}*/\n\t$new_file = fopen($set_id . '_data_descriptive_statistics.txt', \"w\");\n\tforeach ($condition_dict as $cond) {\n\t\tif ($cond->is_control===1)\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t$insertArray = array();\n\t\tforeach ($cond->quant_dict_control_normalized as $key => $value) {\n\t\t\t$newArray = array($projectID, $file_id, $set_id, $branch_id, $cond->condition_id, $key, $cond->quant_dict_avg_val[$key], $cond->quant_dict_mean_normalized[$key], $value, $cond->quant_dict_mean_normalized_p_value[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value[$key], $cond->quant_dict_sds[$key], $cond->quant_dict_control_normalized_p_value_bonferroni[$key], $cond->quant_dict_mean_normalized_p_value_bonferroni[$key],\n\t\t\t\t$cond->quant_dict_control_normalized_p_value_fdr[$key], $cond->quant_dict_mean_normalized_p_value_fdr[$key], $standard_id_mappings[$key]);\n\t\t\tfwrite($new_file, implode(\"\\t\", $newArray) . \"\\r\\n\");\n\t\t}\n\t}\n\tfclose($new_file);\n\t$query = \"LOAD DATA LOCAL INFILE '/var/www/html/DV/\" . $projectID . \"/\" . $set_id . \"_data_descriptive_statistics.txt' INTO TABLE data_descriptive_statistics FIELDS TERMINATED BY '\\t' OPTIONALLY ENCLOSED BY '\\\"' LINES TERMINATED BY '\\r\\n' (project_id, file_id, set_id, branch_id, condition_id, unique_identifier_id, quant_val, fold_change_mean_norm, fold_change_control_norm, p_value_mean_norm, p_value_control_norm, std_dev, bonferroni_p_value_control_norm, bonferroni_p_value_mean_norm, fdr_p_value_control_norm, fdr_p_value_mean_norm, standard_molecule_id)\";\n\t$stmt = $db->prepare($query, array(PDO::MYSQL_ATTR_LOCAL_INFILE => true));\n\t$result = $stmt->execute();\n\tunlink($set_id . '_data_descriptive_statistics.txt');\n}",
"function populate($rowid='',$merge=False, $sql='') {\r\n if ($sql == '')\r\n $sql = $this->create_sql_select($rowid);\r\n #~ echo \"\\n<br>\".$sql;\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error());\r\n $this->db_count = mysql_num_rows($res);\r\n $i = 0;\r\n while ($row = mysql_fetch_row($res)) {\r\n foreach ($this->_mapping_index as $idx=>$colvar) {\r\n # bugs! in case colvar has no column name (Virtual), then it's not available in mapping_index!!!\r\n # case found at subscriber case\r\n $value = $row[$idx];\r\n if ($rowid != '' and $merge and $this->properties[$colvar]->updatable and isset($_REQUEST['field'][$colvar][$i])) {\r\n $value = $_REQUEST['field'][$colvar][$i];\r\n }\r\n $this->ds->{$colvar}[] = $value;\r\n }\r\n $i += 1;\r\n }\r\n $this->_populated = True;\r\n }",
"function explodeUpdate($data_arr)\n\t{\n\t\t$ret=\"\";\n\t\twhile(list($key,$value)=each($data_arr))\n\t\t{\n\t\t\tif(!is_numeric($key))\n\t\t\t{\n\t\t\t\tif($ret)\n\t\t\t\t{\n\t\t\t\t\t$ret.=\",\" . $key . \"=\" . $this->sqlFormatField($value);\n\t\t\t\t}else{\n\t\t\t\t\t$ret=$key . \"=\" . $this->sqlFormatField($value);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}",
"public function constructCommitQuery()\n {\n $allKeysSet = count(array_diff($this->keys, array_keys($this->info))) === 0;\n // If all keys set, default to update; otherwise, default to insert\n\n $columnsString = '';\n $valuesString = '';\n $updateString = '';\n\n $tablesUsed = array(); // Not needed; only support for one table right now\n\n foreach ($this->info as $column => $value) {\n if (!in_array($column, $this->noCommitColumns) &&\n !isset($this->columnAliases[$column])) {\n $value = $this->connObj->escapeString($value);\n $canonical = $this->canonicalizeColumn($column, false, $tablesUsed, false);\n $columnsString .= \"{$canonical}, \";\n $valuesString .= \"'{$value}', \";\n }\n }\n\n $tablesUsed = array();\n $columnsString = substr($columnsString, 0, -2);\n $valuesString = substr($valuesString, 0, -2);\n $updateString = $this->constructUpdateString($tablesUsed);\n\n // Update or insert with one query!\n if ($this->connObj->canUseOnDuplicateKeyUpdate()) {\n return \"INSERT INTO \" . $this->tableName .\n \" ({$columnsString}) VALUES ({$valuesString}) \" .\n \"ON DUPLICATE KEY UPDATE {$updateString}\";\n }\n\n $insertQuery = \"INSERT INTO \" . $this->tableName . \" ({$columnsString}) VALUES ({$valuesString})\";\n if ($allKeysSet && !empty($this->keys)) {\n // Check if we have an existing row in the database\n $tablesUsedBlackHole = array(); // Waste variable\n\n $whereString = $this->constructKeyCondString();\n\n $columnsString = $this->constructSelectColumnsStringStatic($tablesUsedBlackHole, $this->keys);\n $selectQuery = \"SELECT {$columnsString} FROM {$this->tableName} WHERE {$whereString}\";\n $result = $this->query($selectQuery);\n\n if ($result !== false && $this->connObj->fetchResult($result) !== false) {\n return \"UPDATE {$this->tableName} SET {$updateString} WHERE {$whereString}\";\n } else {\n return $insertQuery;\n }\n } else {\n return $insertQuery;\n }\n }",
"public function upsert($table, $data, $where, $bindWhereParams = array(), $seq_name = null) {\n $insertString = $this->_prepareInsertString($data);\n $updateString = $this->_prepareUpdateString($data);\n\n $insert = \"INSERT INTO {$table} ({$insertString['names']}) SELECT {$insertString['values']}\";\n $upsert = \"UPDATE {$table} SET $updateString WHERE $where\";\n\n $this->_sql = \"WITH upsert AS ({$upsert} RETURNING *) {$insert} WHERE NOT EXISTS (SELECT * FROM upsert)\";\n //die($this->_sql);\n\n $sth = $this->_prepareAndBind($data);\n $sth = $this->_prepareAndBind($bindWhereParams, $sth);\n $result = $sth->execute();\n\n $this->_handleError($result, __FUNCTION__);\n return ($this->_driver === \"mysql\") ? $this->lastInsertId() : $this->lastInsertId($seq_name);\n\n }",
"function _query_insert_parse($query){\n $open_brace_first = strpos($query,\"(\",0)+1;\n $close_brace_first = strpos($query,\")\",0);\n $open_brace_second = strpos($query,\"(\",$open_brace_first)+1;\n $close_brace_second = strpos($query,\")\",$open_brace_second);\n \n $cols = substr($query,$open_brace_first,$close_brace_first-$open_brace_first);\n $cols_val = substr($query, $open_brace_second,$close_brace_second-$open_brace_second);\n \n $cols_arr = explode(\",\",$cols);\n $cols_val_arr = explode(\",\",$cols_val);\n \n $qmap = array();\n $len = count($cols_arr);\n for($i=0;$i<$len;$i++){\n $key = trim($cols_arr[$i]);\n $val = trim($cols_val_arr[$i],\"'\");\n $qmap[\"$key\"] = $val;\n }\n return $qmap;\n }",
"public function get_update_qry($vals){\n foreach($_POST AS $key => $value) { $_POST[$key] = $this->prep_sql($value); }\n\n $base = \"INSERT INTO `people` ( `first_name` , `last_name` , `address` \";\n $base .= \", `email` , `phone` , `social` , `username` , `password` ) \";\n $fmt_str = \"VALUES( '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' );\";\n $res = sprintf($fmt_str, // can't just unpack?...hrm\n\t $vals[$this->new_post_vars[0]],\n \t $vals[$this->new_post_vars[1]],\n \t $vals[$this->new_post_vars[2]],\n \t $vals[$this->new_post_vars[3]],\n \t $vals[$this->new_post_vars[4]],\n \t $vals[$this->new_post_vars[5]],\n \t $vals[$this->new_post_vars[6]],\n \t $vals[$this->new_post_vars[7]]);\n $fin = $base . $res;\n return $fin;\n }",
"function dbupinsert($table, $fields, $onduplicate, $funcs = null) {\r\n\tglobal $msq;\r\n\tlist($keys, $vals) = db_fields_to_keys_vals($fields, $funcs);\r\n\t$upds = [];\r\n\tforeach ($onduplicate as $o) {\r\n\t\t$upds []= $o.\" = values(\".$o.\") \";\r\n\t}\r\n\t$q = \"insert into \".$table.\" (\".implode(\", \",$keys).\") \".\r\n\t\t\t\" values (\".implode(\", \",$vals).\") \".\r\n\t\t\t\"ON DUPLICATE KEY UPDATE \".implode(\", \",$upds).\";\";\r\n\t// echo $q; exit;\r\n\tif (dbcommit($q) === false)\r\n\t\treturn false;\r\n\treturn mysqli_insert_id($msq);\r\n}",
"public function run()\n {\n Product::upsert([\n [\n 'id' => 1,\n 'name' => 'Product 1',\n 'state' => 'Weapon', //'Weapon', 'Accessories', 'Other'\n 'price' => 2000,\n 'is_disable' => 0,\n 'product_categories_id' => 8,//must be use valid category id\n 'product_types_id' => 3,//must be use valid product types id, which is connected with given category id\n 'product_brands_id' => 5,//must be use valid product brand id, which is connected with given category id\n ],\n [\n 'id' => 2,\n 'name' => 'Product 2',\n 'state' => 'Weapon', //'Weapon', 'Accessories', 'Other'\n 'price' => 1000,\n 'is_disable' => 0,\n 'product_categories_id' => 10,//must be use valid category id\n 'product_types_id' => 18,//must be use valid product types id, which is connected with given category id\n 'product_brands_id' => 65,//must be use valid product brand id, which is connected with given category id\n ],\n\n ], [], ['id']);\n\n ProductAttribute::upsert([\n [\n 'id' => 1,\n 'attributes_id' => 1,\n 'products_id' => 1,\n 'values' => json_encode([2,3])\n ],\n [\n 'id' => 2,\n 'attributes_id' => 2,\n 'products_id' => 2,\n 'values' => json_encode([55])\n ],\n\n ],[],['id']);\n\n /*ProductTag::upsert([ //use if needed\n [\n 'id' => 1,\n 'tags_id' => 2,\n 'products_id' => 2\n ]\n ],[],['id']);*/\n }",
"protected function _insert()\n\t{\n\t\t// INSERT INTO 'table'\n\t\t$this->_query = 'INSERT INTO '.$this->_table.' (';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$vals .= ($first) ? ('') : (', '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $key;\n\t\t\t$vals .= \"'$value'\";\n\t\t} // foreach\n\n\t\t$this->_query .= \") VALUES ($vals);\";\n\n\t\treturn $this->_query;\n\t}",
"public function getPrepStat($action, $table, $data){\n switch($action){\n //PUT\n case 0:\n $query = \"INSERT INTO \"; \n $query .= $table . \" (\"; \n $i = 0; $count = count($data) - 1;\n for($u = 0; $u < 2; $u++){\n foreach ($data as $columnName => $value) {\n if($i !== 0 && $i !== $count+1){\n $query .= \", \";\n }\n if($u === 1){\n if($i === $count+1){\n $query .= \") VALUES (\";\n }\n $query .= $columnName;\n if($i === ($count * 2)+1 ){\n $query .= \")\";\n }\n }else{\n $query .= ltrim($columnName, ':');\n }\n $i++;\n }\n }\n break;\n\n //GET\n case 1:\n $query = \"SELECT * FROM \" . $table; \n if(!empty($data)){\n $query .= \" WHERE \";\n $i = 0;\n foreach ($data as $columnName => $value) {\n if($i !== 0){\n $query .= \" AND \";\n }\n \n $query .= ltrim($columnName, ':').\" = \".$columnName;\n \n\n $i++;\n }\n }\n\n break;\n\n //PATCH\n case 2:\n $query = \"UPDATE \"; \n $query .= $table . \" SET \"; \n $i = 0;\n foreach ($data as $columnName => $value) {\n if($i !== 0 && $i !== count($data) - 1 ){\n $query .= \", \";\n }\n if($i !== count($data) - 1){\n $query .= ltrim($columnName, ':').\" = \".$columnName;\n }\n $i++;\n }\n end($data);\n $query .= \" WHERE id = \".key($data);\n break;\n\n //DELETE\n case 3:\n $query = \"DELETE FROM \".$table; \n end($data);\n $query .= \" WHERE id = \".key($data);\n break;\n\n default: return false; break;\n }\n\n\n return $this->db->prepare($query);\n\n\n\n }",
"function update($table, $id, $data){\n global $conn;\n$sql = \"UPDATE $table SET \";\n\n$i = 0;\n foreach ($data as $key => $value){\n if($i === 0){\n $sql = $sql . \" $key=?\"; \n } else{\n $sql = $sql . \", $key=?\";\n }\n$i++;\n}\n\n$sql = $sql . \" WHERE id=?\";\n$data['id'] = $id;\n$stmt = executeQuery($sql, $data);\nreturn $stmt->affected_rows;\n}",
"protected function insertBuildSQLSetValues(&$data, &$insert){\n $insert = parent::insertBuildSQLSetValues($data, $insert);\n $billingData = new BillingDataEntity($data->billingdata);\n // We get our own hydrator for billing data\n $hydrator = $this->insertGetHydratorInstance($billingData);\n $billingValues = $hydrator->extract($billingData);\n $insert->values($billingValues, \\Zend\\Db\\Sql\\Insert::VALUES_MERGE);\n return $insert;\n }",
"abstract function update (\\Database\\Query\\Query $query);",
"function genericupdate ($table, $primary, $data) {\n\n /* Support single and combined primary keys. */\n if(gettype($primary)=='string'){\n $primary=array($primary);\n }\n $where = '';\n foreach ($primary as $k) {\n $where .= $k.'=\"'.$data[$k].'\" AND ';\n unset($data[$k]);\n }\n $set = '';\n foreach ($data as $key => $value) {\n foreach ($primary as $k) {\n if($key != $k) continue; }\n if (substr($key,0,1) == '@')\n $set .= substr($key,1).'='.$value.',';\n else\n $set .= $key.'=\"'.mysql_real_escape_string($value).'\",';\n }\n // UPDATE table SET a=1, b=2, c=3\n $query = 'UPDATE '.$table.' SET '.substr($set,0,strlen($set)-1).\n ' WHERE '.substr($where,0,strlen($where)-5);\n return $query;\n}",
"function to_str() {\n //\n //Test if this sql has an elias \n $alias= is_null($this->alias) ? \"\":\"as `$this->alias`\";\n //\n //the update statement \n $smt=\"\"\n //This is an update statement \n .\"UPDATE \\n\"\n //\n //Get the root from expression as the source table of this update \n //statement \n . \"{$this->root->fromexp()} \\n\"\n . \"SET \\n\"\n //\n //get the values as key values pairs \n .\"{$this->str_values()} \\n\"\n //\n //The joins, if any\n . \"{$this->joins->to_str()} \\n\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\"\n //\n //include an ellias if any \n .\"$alias\";\n //\n //Return the sql statement\n return $smt;\n }",
"public function update($table, $data){//,$id\n $q=\"UPDATE `$table` SET \";\n\n $r=\"\";\n foreach($data as $key=>$val){\n $r.=\"`\".$key.\"`\".\"='$val',\";\n }\n $r=rtrim($r,\", \");\n //echo $r;\n $q1 = $q .$r. ' WHERE '.\"1\";\n\n \n if($q1)\n {\n $this->database_query($q1);\n }\n}",
"function _insertQuery(&$obj)\r\n {\r\n foreach ($obj->cleanVars as $k => $v) {\r\n ${$k} = $v;\r\n }\r\n\r\n $sql = sprintf(\"INSERT INTO %s (uid, roleid, deptid) VALUES (%u, %u, %u)\",\r\n $this->_db->prefix($this->_dbtable), $uid, $roleid, $deptid);\r\n\r\n return $sql;\r\n\r\n }",
"private function upsert_data() {\n foreach ($this->data as $course => $rows) {\n if (db::upsert($this->semester, $course, $rows) === false) {\n $this->log_it(db::$error);\n }\n }\n\n // Done.\n return true;\n }",
"function updateRecords($userData,$result,$database,$table,$where_clause,$where_reference,$remarks)\r\n{\r\n mysql_selectdb($database);\r\n \r\n foreach($userData as $field => $userInfo)\r\n {\r\n \r\n if(\r\n $userInfo > \"\" &&\r\n $field != \"XXX\" &&\r\n $field != \"submit\")\r\n {\r\n \r\n if($userInfo != $result[$field])\r\n {\r\n $query = \"UPDATE `$table` SET `$field` = $userInfo WHERE `$where_clause` = $where_reference\";\r\n $sql = mysql_query($query) or die (\"Bad Query:$query<br>\".mysql_error());\r\n saveSQL($query,$table.'_update.sql',$remarks);\r\n }## CHANGE\r\n }##USERINFO > \"\"\r\n }##FOR EACH \r\n}",
"function dbRawUpd($ePost)\n\t{\n\t\t\n\t\t$tFnc = new AB_querySession;\n\t\t$tObj = $tFnc->isOrgLevel($this->tblInfo->tblName);\n\t\t\n\t\t// if ($ab_Dusa[$this->tblInfo->tblName]['dimvalue'])\n\t\tif ($tObj != false)\n\t\t{\n\t\t\t// $wtmp = $ab_Dusa[$this->tblInfo->tblName]['dimvalue'];\n\t\t\t$wtmp = $tObj[\"oncreate\"];\n\t\t\t$wCol = substr($wtmp,0,strpos($wtmp,\":\"));\n\t\t\t$wVal = substr($wtmp,strpos($wtmp,\":\")+1);\n\t\t\t$wOva = $ePost[$wCol];\n\t\t\t$this->orgDim = $wOva;\n\t\t\t$this->newDim = $wVal;\n\t\t\t$this->dimIsNew = strpos($wOva,$wVal);\n\t\t\tif (strpos(\",\".$wOva,$wVal)==false)\n\t\t\t{\n\t\t\t\tif (strlen($wOva))\n\t\t\t\t{\n\t\t\t\t\t$wOva .= \",\";\n\t\t\t\t}\n\t\t\t\t$wOva .= $wVal;\n\t\t\t\t$ePost[$wCol] = $wOva;\n\t\t\t\t$this->dbUpdRec($ePost);\n\t\t\t\t$this->dbUpdRecEpost = $ePost;\n\t\t\t}\n\t\t\t\n\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"private function prepareQueryArray($input){\n global $Core;\n if(empty($input) || !is_array($input)){\n throw new Exception ($Core->language->error_input_must_be_a_non_empty_array);\n }\n $allowedFields = $this->getTableFields();\n $temp = array();\n\n $parentFunction = debug_backtrace()[1]['function'];\n if((stristr($parentFunction,'add') || $parentFunction == 'insert')){\n $requiredBuffer = $this->requiredFields;\n }\n else{\n $requiredBuffer = array();\n if(stristr($parentFunction,'translate')){\n $allowedFields = $this->translationFields;\n }\n }\n\n foreach ($input as $k => $v){\n if($k === 'added' && !$this->allowFieldAdded){\n throw new Exception ($Core->language->field_added_is_not_allowed);\n }\n if($k === 'id'){\n throw new Exception ($Core->language->field_id_is_not_allowed);\n }\n\n if(!isset($allowedFields[$k]) && !in_array($k,$allowedFields)){\n throw new Exception (get_class($this).\": The field $k does not exist in table {$this->tableName}!\");\n }\n\n if(!is_array($v)){\n $v = trim($v);\n }\n\n if(!empty($v) || ((is_numeric($v) && intval($v) === 0))){\n if(!empty($requiredBuffer) && ($key = array_search($k, $requiredBuffer)) !== false) {\n unset($requiredBuffer[$key]);\n }\n $fieldType = $this->tableFields[$k]['type'];\n if(stristr($fieldType,'int') || stristr($fieldType,'double')){\n if(!is_numeric($v)){\n $k = str_ireplace('_id','',$k);\n throw new Exception ($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_a_numeric_value);\n }\n $temp[$k] = $v;\n }\n else if($fieldType == 'date'){\n $t = explode('-',$v);\n if(count($t) < 3 || !checkdate($t[1],$t[2],$t[0])){\n $k = str_ireplace('_id','',$k);\n throw new Exception ($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_a_date_with_format);\n }\n $temp[$k] = $v;\n unset($t);\n }\n else{\n if(in_array($k,$this->explodeFields)){\n if(is_object($v)){\n $v = (array)$v;\n }\n else if(!is_array($v)){\n $v = array($v);\n }\n\n if($k == 'languages'){\n $tt = array();\n foreach($v as $lang){\n if(empty($lang)){\n throw new Exception ($Core->language->error_language_cannot_be_empty);\n }\n $langMap = $Core->language->getLanguageMap(false);\n\n if(!isset($langMap[$lang])){\n throw new Exception ($Core->language->error_undefined_or_inactive_language);\n }\n if(!is_numeric($lang)){\n $lang = $langMap[$lang]['id'];\n }\n $tt[] = $lang;\n }\n $v = '|'.implode('|',$tt).'|';\n }\n else{\n $tt = '';\n foreach($v as $t){\n if(!empty($t)){\n $tt .= str_replace($this->explodeDelimiter,'_',$t).$this->explodeDelimiter;\n }\n }\n $v = substr($tt,0,-1);\n unset($tt,$t);\n }\n }\n else if(is_array($v)){\n $k = str_ireplace('_id','',$k);\n throw new Exception($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_be_alphanumeric_string);\n }\n\n $temp[$k] = $Core->db->real_escape_string($v);\n }\n }\n else{\n if(stristr($parentFunction,'update') && isset($this->requiredFields[$k])){\n $k = str_ireplace('_id','',$k);\n throw new Exception($Core->language->error_field.' \\\"'.$Core->language->$k.'\\\" '.$Core->language->error_must_not_be_empty);\n }\n else $temp[$k] = '';\n }\n }\n\n if(!empty($requiredBuffer)){\n $temp = array();\n foreach($requiredBuffer as $r){\n $r = str_ireplace('_id','',$r);\n $temp[] = $Core->language->$r;\n }\n\n throw new Exception($Core->language->error_required_fields_missing.\": \".implode(', ',$temp));\n }\n\n return $temp;\n }",
"function _query_insert_replace($table='', $keyandvalue, $type='', $execute=true) { \n if ((! is_array($keyandvalue) && ($execute)) || $table=='' ) {\n\t\t\t$this->setParamaters();\n return false; \t\t\t\n\t\t} \n \n if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ))) {\n\t\t\t$this->setParamaters();\n return false; \t\t\t\n\t\t} \n \n $sql=\"$type INTO $table\";\n $v=''; $n='';\n\n if ($execute) {\n foreach($keyandvalue as $key=>$val) {\n $n.=\"$key, \";\n if(strtolower($val)=='null') $v.=\"NULL, \";\n elseif(in_array(strtolower($val), array( 'current_timestamp()', 'date()', 'now()' ))) $v.=\"CURRENT_TIMESTAMP(), \";\n else {\n\t\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t\t$v.= _TAG.\", \";\n\t\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t\t} else \n\t\t\t\t\t\t$v.= \"'\".$this->escape($val).\"', \";\n\t\t\t\t} \n }\n \n $sql .= \"(\". rtrim($n, ', ') .\") VALUES (\". rtrim($v, ', ') .\");\";\n\n\t\t\tif (($this->getPrepare()) && !empty($this->getParamaters())) \n\t\t\t\t$ok = $this->query($sql, true);\n\t\t\telse \n\t\t\t\t$ok = $this->query($sql);\n\t\t\t\t\n if ($ok)\n return $this->insert_id;\n else {\n\t\t\t\t$this->setParamaters();\n\t\t\t\treturn false; \t\t\t\n\t\t\t} \n } else {\n if (is_array($keyandvalue)) {\n if (array_keys($keyandvalue) === range(0, count($keyandvalue) - 1)) {\n foreach($keyandvalue as $key) {\n $n.=\"$key, \"; \n }\n $sql .= \" (\". rtrim($n, ', ') .\") \"; \n } else {\n\t\t\t\t\treturn false; \t\t\t\n\t\t\t\t} \n } \n return $sql;\n }\n\t}",
"public function assemble()\n {\n $queryString = array();\n\n $queryString[] = $this->query['type'];\n\n // Select query\n if ($this->query['type'] == \"SELECT\"\n or $this->query['type'] == \"SELECT DISTINCT\") {\n // Build columns to select\n $queryString[] = $this->buildSelectColumns();\n\n // From\n $queryString[] = \"FROM `{$this->query['table']}`\";\n\n // Joins\n if (array_key_exists('joins', $this->query)) {\n $queryString[] = $this->buildJoins();\n }\n\n // Where\n $queryString[] = $this->buildWhere();\n\n // Custom SQL\n if (array_key_exists('sql', $this->query)) {\n $queryString[] = $this->query['sql'];\n }\n\n // Order by\n if (array_key_exists('order_by', $this->query)) {\n $queryString[] = \"ORDER BY \" . implode(\", \", $this->query['order_by']);\n }\n }\n // Insert\n elseif ($this->query['type'] == \"INSERT INTO\") {\n // Table\n $queryString[] = \"`{$this->query['table']}`\";\n\n // Get the columns and values\n $columns = $values = array();\n foreach ($this->query['data'] as $column => $value) {\n $columns[] = $this->columnName($column);\n $values[] = $this->processValue($value);\n }\n\n // Add columns and values to query\n $queryString[] = \"(\" . implode(',', $columns) . \")\";\n $queryString[] = \"VALUES (\" . implode(',', $values) . \")\";\n }\n // Update\n elseif ($this->query['type'] == \"UPDATE\") {\n // Table\n $queryString[] = \"`{$this->query['table']}`\";\n\n // Set values\n $values = array();\n foreach ($this->query['data'] as $column => $value) {\n // Process column name\n $column = $this->columnName($column);\n\n // Add value to bind queue\n $valueBindKey = \"new_\" . str_replace(array('.', '`'), array('_', ''), $column);\n $this->valuesToBind[$valueBindKey] = $value;\n\n // Add to values\n $values[] = $column . \" = :{$valueBindKey}\";\n }\n\n // Add values to query\n $queryString[] = \"SET \" . implode(\", \", $values);\n\n $queryString[] = $this->buildWhere();\n }\n // Delete from\n elseif ($this->query['type'] == \"DELETE\") {\n // Table\n $queryString[] = \"FROM `{$this->query['table']}`\";\n\n // Where\n $queryString[] = $this->buildWhere();\n }\n\n return implode(\" \", str_replace(\"{prefix}\", $this->prefix, $queryString));\n }",
"function my_update_record( $table_name , $primary_key , $data_id , $datas ){\r\n\r\n\tglobal $connection;\r\n\r\n\t$build_query = \" UPDATE `\".$table_name .\"` SET \" ;\r\n\tforeach( $datas as $field => $value ){\r\n\t\r\n\t\t$build_query .= \"`\".$field .\"` = \". $value . \", \";\r\n\t\r\n\t}\r\n\t\r\n\t$query = rtrim( trim($build_query) , \",\" );\r\n\t\r\n\t$update_query = $query .\" WHERE `\".$primary_key.\"` = \". $data_id ; \r\n \r\n\t$result = my_query( $update_query );\r\n\t \r\n\treturn $connection->affected_rows ; \r\n\r\n}",
"private function updateBaseTable()\n {\n foreach ($this->mergeCollection as $key => $item)\n {\n $query = DB::table($this->baseTable);\n\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n $query = $query->whereIn($basePivot,[$item->$mergePivot]);\n }\n\n if(!in_array($this->primaryKey,$this->associativeColumns) && !in_array($this->primaryKey,$this->associativePivots))\n unset($item->id);\n\n if(!empty($this->associativeColumns)) {\n\n $newItem = new \\stdClass();\n\n foreach ($this->associativeColumns as $baseColumn => $mergeColumn) {\n $newItem->$baseColumn = $item->$mergeColumn;\n }\n\n $item = $newItem;\n }\n\n\n $this->rowUpdatedByMatched += $query->update(get_object_vars($item));\n }\n\n }",
"public function update() {\n $Sql = \"UPDATE \" . $this->tableName[0] . \" SET \";\n foreach ($this->fieldListArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_', \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 2);\n $Sql = $Sql . \" WHERE \";\n foreach ($this->conditionArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_' AND \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 4);\n //echo $Sql;\n return mysqli_query($this->dataBaseConnect->getConnection(), $Sql);\n }",
"function prepare_update($id = '', $data = []){\n // if there is no data to set, then return an empty string\n if($data == [] || $id == ''){\n return '';\n }\n $set_sql = '';\n $where_sql = '';\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n\n $where_sql = $this->create_where($id, []);\n \n return \"UPDATE {$this->table_name} $set_sql $where_sql;\";\n }",
"public function buildQuery() {\n\t\t// Build INSERT INTO table\n\t\t$queryString = [\n\t\t\t'INSERT INTO',\n\t\t\t$this->table,\n\t\t\t'(' . implode(', ', $this->columns) . ')', // Add column definition\n\t\t\t'VALUES'\n\t\t];\n\n\t\t// Add multiple value rows\n\t\t$values = [];\n\t\tforeach ($this->values as $valueRow) {\n\t\t\t$values[] = '(' . implode(', ', $valueRow) . ')';\n\t\t}\n\t\t$queryString[] = implode(',', $values);\n\n\t\tif ($this->ignoreConflictFields) {\n\t\t\t$conflictFields = implode(',', $this->ignoreConflictFields);\n\t\t\t$queryString[] = \"ON CONFLICT ($conflictFields) DO NOTHING\";\n\t\t}\n\n\t\treturn implode(' ', $queryString) . ';';\n\t}",
"function updateTable($final_result){\n\t\t$where = '1';\n\t\t$this->delete($where);\n\n\t\t//update table\n\t\tforeach ($final_result as $key => $value) {\n\t\t\t$row = $this->createRow();\n\t\t\t$row->y =$key;\n\t\t\t$row->x = $value;\n\t\t\t$row->save();\n\t\t}\n\t}",
"function merge_query($newquery) {\r\n foreach (array_merge($_GET,$newquery) as $k=>$v) $temparr[] = urlencode($k).'='.urlencode($v);\r\n return implode('&',$temparr);\r\n}",
"function general_fetch($post_json, $my, $append_sql, &$updtoken, $gkey, $parent = \"\", $id = \"\", $override_sql = \"\") {\n \n // Check params\n if (!isCorrectID($updtoken) || !isCorrectID($gkey) || !isCorrectID($parent) || !isCorrectID($id)) throw new Exception(INTERNAL);\n \n // Judge key pattern\n $keycnt = 0;\n $kv1 = $kv2 = \"\";\n if ($parent == \"\" && $id == \"\") {\n $sql_key = \"AND gkey = ? \";\n } elseif ($parent == \"\") {\n $sql_key = \"AND gkey = ? AND rkey = ? \";\n $kv1 = $id;\n $keycnt = 1;\n } elseif ($id == \"\") {\n $sql_key = \"AND gkey = ? AND pkey = ? \";\n $kv1 = $parent;\n $keycnt = 1;\n } else {\n $sql_key = \"AND gkey = ? AND pkey = ? AND rkey = ? \";\n $kv1 = $parent;\n $kv2 = $id;\n $keycnt = 2;\n }\n \n // make transaction data for callback\n $transaction_data = [];\n \n // Callback - onBeforeSelect\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"transaction_data\" => $transaction_data);\n callbackTo(\"onBeforeSelect\", $cbarr, $post_json[\"gkey\"]);\n $transaction_data = $cbarr[\"transaction_data\"];\n \n // Make SQL\n $sql_col = \"SELECT dataid, rkey, pkey, dkey, dvalue\";\n $sql_frm = \"FROM CHAP_DATAS\";\n $sql_whr = \"WHERE delf = 0 AND rdate IS NULL \" . $sql_key . $append_sql;\n $sql_odr = \"ORDER BY rkey desc, dkey\";\n $sql_etc = \"\";\n if ($override_sql != \"\") {\n $sql_whr = \"\";\n $sql_odr = \"\";\n $sql_etc = $override_sql;\n }\n\n \n // Callback - onConstractSelectSQL\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"columns\" => $sql_col, \"from\" => $sql_frm, \"where\" => $sql_whr, \"order\" => $sql_odr, \"etc\" => $sql_etc);\n callbackTo(\"onConstractSelectSQL\", $cbarr, $post_json[\"gkey\"]);\n $sql = $cbarr[\"columns\"] . \" \" . $cbarr[\"from\"] . \" \" . $cbarr[\"where\"] . \" \" . $cbarr[\"order\"] . \" \" . $cbarr[\"etc\"];\n \n // Do SELECT\n if ($stmt = $my->prepare($sql)) {\n \n // Bind query\n if ($keycnt == 0) {\n $stmt->bind_param(\"s\", $gkey);\n } elseif ($keycnt == 1) {\n $stmt->bind_param(\"ss\", $gkey, $kv1);\n } else {\n $stmt->bind_param(\"sss\", $gkey, $kv1, $kv2);\n }\n \n // Execute SQL\n $stmt->execute();\n $stmt->store_result();\n \n // Make onBreak function\n $fx_onBreak = null;\n if ($fx_onBreak == null) {\n $fx_onBreak = function(&$rows, &$tmp) {\n if ($rows == null) $rows = array();\n array_push($rows, $tmp);\n $tmp = [];\n };\n }\n \n // Init fetch buffer\n $dataid = $rkey = $pkey = $dkey = $dvalue = \"\";\n $rows_all = array();\n $current_key = \"\";\n $tmp = array();\n \n // Bind result\n $stmt->bind_result($dataid, $rkey, $pkey, $dkey, $dvalue);\n \n // Fetch\n while ($stmt->fetch()) {\n if ($current_key != \"\" && $current_key != $rkey) {\n \n // Callback - onRowFetched\n $skip = false;\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"transaction_data\" => $transaction_data, \"row\" => $tmp, \"skip\" => &$skip);\n callbackTo(\"onRowFetched\", $cbarr, $post_json[\"gkey\"]);\n $tmp = $cbarr[\"row\"];\n \n if ($skip) $tmp = []; else $fx_onBreak($rows_all, $tmp);\n }\n $tmp[\"id\"] = $rkey;\n $tmp[\"parent\"] = $pkey;\n $tmp[$dkey] = $dvalue;\n $current_key = $rkey;\n }\n if ($current_key != \"\") {\n \n // Callback - onRowFetched\n $skip = false;\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"transaction_data\" => $transaction_data, \"row\" => $tmp, \"skip\" => &$skip);\n callbackTo(\"onRowFetched\", $cbarr, $post_json[\"gkey\"]);\n $tmp = $cbarr[\"row\"];\n \n if ($skip) $tmp = []; else $fx_onBreak($rows_all, $tmp);\n }\n \n // Close\n $stmt->close();\n \n } else {\n error_log(\"[api.php] > Cannot prepare SQL.\");\n throw new Exception(DB_PREPARE_ERR);\n }\n \n // Get current tuple token to update itself\n $sql = \"SELECT token FROM CHAP_UPDTOKENS WHERE 1 = 1 \" . $sql_key;\n if ($stmt = $my->prepare($sql)) {\n \n // Bind query\n if ($keycnt == 0) {\n $stmt->bind_param(\"s\", $gkey);\n } elseif ($keycnt == 1) {\n $stmt->bind_param(\"ss\", $gkey, $kv1);\n } else {\n $stmt->bind_param(\"sss\", $gkey, $kv1, $kv2);\n }\n \n // Execute SQL\n $stmt->execute();\n $stmt->store_result();\n \n // Bind result\n $stmt->bind_result($updtoken);\n if (!$stmt->fetch()) {\n $updtoken = \"INITIALTOKEN\";\n }\n \n // Close\n $stmt->close();\n \n } else {\n error_log(\"[api.php] > Cannot prepare SQL (CHAP_UPDTOKENS).\");\n throw new Exception(DB_PREPARE_ERR);\n }\n \n // Callback - onAllDataFetched\n $cbarr = array(\"dbi\" => $my, \"json\" => $post_json, \"data\" => $rows_all);\n callbackTo(\"onAllDataFetched\", $cbarr, $post_json[\"gkey\"]);\n $rows_all = $cbarr[\"data\"];\n \n // Finalize\n return $rows_all;\n \n }",
"function jornadas_entity_update($entity, $type) {\n if($type=='data_jornadas'){\n db_delete('jormada_tiempo_produccion')->condition('jid',$entity->jid)->execute();\n \n foreach ($entity->production_time as $lid => $element) {\n foreach ($element as $fid => $time) {\n db_insert('jormada_tiempo_produccion')->fields(array('jid'=>$entity->jid,'lid'=>$lid,'fid'=>$fid,'time'=>$time))->execute();\n\n }\n }\n }\n \n\n}",
"function array_to_insert_clause($a_vars) {\n\tif (count($a_vars) == 0)\n\t\t\treturn \"\";\n\t$a_keys = array();\n\tforeach($a_vars as $k=>$v)\n\t\t\t$a_keys[] = $k;\n\treturn \"(`\".implode(\"`,`\",$a_keys).\"`) VALUES ('[\".implode(\"]','[\",$a_keys).\"]')\";\n}",
"function build_update($table,$arr,$where) {\n\t$str = \"UPDATE `\".$table.\"` SET \";\n\t$keys = array_keys($arr);\n\tfor($a=0;$a<count($keys);$a++) {\n\t\t$updates[] = \"`\".$keys[$a].\"`='\".str_replace(\"'\",\"''\",$arr[$keys[$a]]).\"'\";\n\t}\n\n\t$str .= implode(',',$updates).' WHERE '.$where;\n\n\treturn $str;\n}",
"function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }",
"public function getSql(){\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(in_array($key, static::$_fields)){\n $data[$key] = (string) $value;\n }\n }\n\n $data = $this->process_fields($table_name, $data, null );\n if (false === $data) {\n return false;\n }\n \n $fields1 = $fields2 = $values = array();\n foreach ( $data as $field => $value ) {\n \n if( $field == $pk ) {\n $duplicates[] = \"`$field` = LAST_INSERT_ID(`$field`)\";\n }\n \n if ( empty( $value['value'] ) ) {\n if( $field != $pk ) {\n $values[] = \"null\";\n $duplicates[] = \"`$field` = null\";\n } else {\n $values[] = \"null\";\n }\n continue;\n }\n\n $values[] = $wpdb->prepare($value['format'], $value['value']);\n $duplicates[] = \"`$field` = VALUES(`$field`)\";\n }\n\n $fields = '`'.implode( '`, `', array_keys($data)).'`';\n $values = implode( ',' , $values);\n $duplicates = implode( ', ', $duplicates );\n\n $sql = \"INSERT INTO `$table_name` ( $fields ) VALUES ( $values ) ON DUPLICATE KEY UPDATE $duplicates;\";\n \n return $sql;\n }",
"protected function getUpdateStatements() {}",
"private function transfer_data()\n\t{\n\t\t$num_rows = db::select_one(\"select count(*) from {$this->table}\");\n\t\t\n\t\tfor ($i = 0; $i < $num_rows; $i += BATCH_SIZE)\n\t\t{\n\t\t\techo \"$i / $num_rows (select {$this->before_alter_select_query} from {$this->table})\\n\";\n\t\t\t$r = mysql_query(\"select {$this->before_alter_select_query} from {$this->table} limit $i, \".BATCH_SIZE);\n\t\t\twhile ($d = mysql_fetch_assoc($r))\n\t\t\t{\n\t\t\t\tif ($this->renamed_cols)\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->renamed_cols as $before_key => $after_key)\n\t\t\t\t\t{\n\t\t\t\t\t\t$d[$after_key] = $d[$before_key];\n\t\t\t\t\t\tunset($d[$before_key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdb::insert($this->temp_table, $d);\n\t\t\t}\n\t\t}\n\t}",
"public abstract function getUpdateSQL($table, $data, $where, $values, $order, $limit);",
"private function getSQLForUpdate()\n {\n $table = $this->_sqlParts['from']['table'] . ($this->_sqlParts['from']['alias'] ? ' ' . $this->_sqlParts['from']['alias'] : '');\n $query = 'UPDATE ' . $table\n . ' SET ' . implode(\", \", $this->_sqlParts['set'])\n . ($this->_sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->_sqlParts['where']) : '');\n\n $query = ($this->_maxResults === null && $this->_firstResult == null)\n ? $query\n : $this->_connection->getAdapter()->applyLimit($query, $this->_firstResult, $this->_maxResults);\n\n return $query;\n }",
"public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }",
"function insert_on_duplicate_update_batch($table = '', $set = NULL)\n\t{\n\t\t\n\t\tif ( ! is_null($set))\n\t\t{\n\t\t\t$this->set_insert_batch($set);\n\t\t}\n\n\t\tif (count($this->ar_set) == 0)\n\t\t{\n\t\t\tif ($this->db_debug)\n\t\t\t{\n\t\t\t\t//No valid data array. Folds in cases where keys and values did not match up\n\t\t\t\treturn $this->display_error('db_must_use_set');\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($table == '')\n\t\t{\n\t\t\tif ( ! isset($this->ar_from[0]))\n\t\t\t{\n\t\t\t\tif ($this->db_debug)\n\t\t\t\t{\n\t\t\t\t\treturn $this->display_error('db_must_set_table');\n\t\t\t\t}\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$table = $this->ar_from[0];\n\t\t}\n\n\t\t// Batch this baby\n\t\tfor ($i = 0, $total = count($this->ar_set); $i < $total; $i = $i + 100)\n\t\t{\n\n\t\t\t$sql = $this->_insert_on_duplicate_update_batch($this->_protect_identifiers($table, TRUE, NULL, FALSE), $this->ar_keys, array_slice($this->ar_set, $i, 100));\n\n\t\t\t// echo $sql;\n\n\t\t\t$this->query($sql);\n\t\t}\n\n\t\t$this->_reset_write();\n\n\n\t\treturn TRUE;\n\t}",
"private function _insert_on_duplicate_update_batch($table, $keys, $values)\n\t{\n\t\tforeach($keys as $key)\n\t\t\t$update_fields[] = $key.'=VALUES('.$key.')';\n\n\t\treturn \"INSERT INTO \".$table.\" (\".implode(', ', $keys).\") VALUES \".implode(', ', $values).\" ON DUPLICATE KEY UPDATE \".implode(', ', $update_fields);\n\t}",
"function insert_or_update($table, $idcol, $idnum = NULL /*, trios of column,template(%d,%i,%n,%s),substitute can follow here*/) {\r\n \t$num_args = func_num_args()-3;\r\n \tif ($num_args % 3 != 0)\r\n \t\tthrow new Exception('Number of arguments to insert_or_update must be a multiple of three.');\r\n \tif ($num_args < 3)\r\n \t\tthrow new Exception('Must pass at least one column name,type,value trio to insert_or_update');\r\n \t$set_str = '';\r\n \t$set_args = array();\r\n \t$update_str = '';\r\n \tfor ($i = 0; $i < $num_args; $i += 3) {\r\n \t\t$key = func_get_arg(3+$i);\r\n \t\t$template = func_get_arg(3+$i+1);\r\n \t\t$value = func_get_arg(3+$i+2);\r\n \t\t\r\n \t\tif ($template == '%s')\r\n \t\t\tthrow new Exception('Dangerous template %s is not allowed. Use %n or \"%s\" (in quotes).');\r\n \t\t\r\n \t\t$set_str .= ($i == 0 ? '':', ').\"`$key`=$template \";\r\n \t\t$update_str .= ($i == 0 ? '':', ').\"`$key`=VALUES(`$key`)\"; // for ON DUPLICATE KEY UPDATE\r\n \t\t$n_count = substr_count($template, '%');\r\n \t\tif ($n_count == 1)\r\n \t\t\t$set_args[] = $value;\r\n \t\telse if ($n_count > 1 || $value !== NULL)\r\n \t\t\tthrow new Exception('Invalid use of % or data passed unexpectedly for colum \"'.$key.'\"');\r\n \t}\r\n \t$set_str = self::parse_args($set_str, $set_args);\r\n \tif ($idnum)\r\n \t\treturn $this->run('INSERT INTO `'.$table.'` SET `'.$idcol.'`=%d, '.$set_str.' ON DUPLICATE KEY UPDATE '.$update_str, $idnum);\r\n \telse\r\n \t\treturn $this->run('INSERT INTO `'.$table.'` SET '.$set_str);\r\n }",
"public function constructUpdateQuery()\n {\n $tablesUsed = array();\n $updateString = $this->constructUpdateString($tablesUsed, true);\n $condString = $this->constructCondString($tablesUsed);\n\n return 'UPDATE ' . implode(', ', $tablesUsed) . ' SET ' . $updateString . ' WHERE ' . $condString;\n }",
"public function updateSql(){\n\n $sql = \"UPDATE {$this->table} SET \";\n $i = 0;\n $size = sizeof($this->requestUpdateValues);\n\n foreach ($this->requestUpdateValues as $key=>$value) {\n $sql .= \"{$key} = {$this->params['columnName_Pdo'][$key]} \";\n $i++;\n if($i < $size) { $sql .= ' , '; }\n }\n \n $sql .= \" WHERE id IN ({$this->updateIds}) \";\n \n return $sql;\n }",
"public function inject()\n\t{\n\t\t$insert = '?id=1%27 and 1%3d1 union select ';\n\t\treturn $insert;\n\t}",
"function update_player_league($playerID, $leagueID, $player) {\r\n\tforeach($player as $key => $value){\r\n\t\t$values[] = array(\"col\" => $key, \"value\" => $value);\r\n\t}\r\n\t$cond[]= array(\"col\" => \"playerID\", \"value\" => $playerID);\r\n\t$cond[]= array(\"col\" => \"leagueID\", \"value\" => $leagueID);\r\n\r\n\t//print_r($cond);\r\n\t$ID = uli_update_record('player_league', $cond, $values);\r\n\tif ($ID){return TRUE;}\r\n\telse {return FALSE;}\r\n}",
"function test_update_by_field($urabe, $body)\n{\n $values = $body->update_params;\n $column_name = $body->column_name;\n $column_value = $body->column_value;\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n return $urabe->update_by_field($table_name, $values, $column_name, $column_value);\n}",
"function addToQuery(&$query, $tablename=\"\", $fieldaliasprefix=\"\", $rec=\"\", $level, $mode)\n {\n }",
"public function testSubstitutions()\n\t{\n\n\t\t$builder = $this->mySqlBuilderFactory();\n\t\t$query = new \\NilPortugues\\Sql\\QueryBuilder\\Manipulation\\Select('foo');\n\n\t\t$query\n\t\t\t->where()\n\t\t\t->equals('mike', 'roy')\n\t\t;\n\n\t\t$builder->write($query);\n\t\t$values = $builder->getValues();\n\t\t$this->assertTrue(is_array($values));\n\t\t$this->assertArrayHasKey('%1s', $values);\n\t}",
"function pre_query() {\n $this->view->field += $this->casetracker_fields;\n unset($this->view->field['cuid']); // this could be more surgical.\n }",
"public function getAllForInsertUpdate()\n {\n $data = [];\n foreach ($this->_values as $key => $value) {\n if ($key === '_id' || $key === '_rev') {\n continue;\n }\n\n if ($key === '_key' && $value === null) {\n // key value not yet set\n continue;\n }\n $data[$key] = $value;\n }\n if ($this->_key !== null) {\n $data['_key'] = $this->_key;\n }\n\n return $data;\n }",
"private function create_update_sql($arr) {\n return implode(\" = ?, \\n\", array_keys($arr)).' = ?';\n }",
"function company_update($table, $data) {\n\n //SELECT * FROM node WHERE nid >= 4490 AND nid <= 4541 ORDER BY nid DESC LIMIT 0, 2500;\n\n global $devel, $tablas, $U;\n\n if (!count($data)) {\n print_r(get_defined_vars());\n throw new Exception(\"ERROR: No existen parámetros para UPDATE en $table\");\n }\n\n $ids = array(\n 'PRIMARY_KEYS' => false,\n 'UNIQUES_KEYS' => false,\n 'INDEXES_KEYS' => false,\n 'COLUMNS_KEYS' => false,\n );\n\n // Buscamos la row por todas sus claves una a una hasta encontrarla\n foreach ($ids as $id => $dummy) {\n\n $keys = keys($table, $id);\n\n // Si la tabla tiene claves por las cuales buscar\n if ($keys) {\n\n // Hacemos otra consulta por dichas claves para buscar algun resultado\n $WHERE = where($keys, $data);\n $query = \"SELECT * FROM `$table` WHERE $WHERE\";\n $result = db_fetch(db_query($devel, $query));\n\n // Si hay resultado buscamos realmente que datos hay que cambiar y paramos\n if ($result) {\n\n // Por cada row obtenida (si no es PRIMARY_KEYS o UNIQUES_KEYS)\n foreach ($result as $row) {\n\n // Seteamos a cero los cambios a realizar\n $UPDATE = array();\n\n // Por cada campo de la row verificamos que los datos no sean iguales\n foreach ($row as $key => $value) {\n\n // Si existe realmente la clave dada en los datos\n if (isset($data[$key])) {\n\n // Si los datos no son iguales que los que hay en la base de datos\n if ($data[$key] != $value) {\n // Agregamos a la lista de actualizar para construir la query\n $UPDATE[$key] = $key;\n }\n }\n }\n\n // Si hemos encontrado campos para los que hay que actualizar\n if ($UPDATE) {\n\n $WHERE = where($keys, $data);\n $SET = set($UPDATE, $data);\n $query = \"UPDATE `$table` SET $SET WHERE $WHERE\";\n sql($query, $table, 'UPDATE');\n $U++;\n }\n }\n\n // Paramos el bucle de los KEYS ya que hemos encontrado dicha row/s\n break;\n }\n }\n }\n}",
"public function change()\n {\n$query =<<<'EOD'\n\nCREATE OR REPLACE FUNCTION materialize_paging_column(integer) RETURNS VOID\nVOLATILE\nLANGUAGE SQL STRICT\nAS $$\n update paging_table\n set m_prop_column_full = full_data,\n m_prop_column_small = small_data,\n m_column = cols\n from (SELECT jsonb_build_object('columns',\n jsonb_agg(jsonb_build_object(\n 'data',p.name,\n 'visible', coalesce(p.is_visible,false),\n 'primary', coalesce(is_primary,false),\n 'title', coalesce(p.title,p.name),\n 'orderable',Coalesce(p.is_orderable,true),\n 'is_filter',p.is_filter,\n 'type', pt.name,\n 'cd',coalesce(p.condition,pt.cond_default),\n 'cdi', p.item_condition) ORDER by p.priority)) as full_data,\n jsonb_build_object('columns',\n jsonb_agg(jsonb_build_object(\n 'data',p.name ,\n 'visible',coalesce(p.is_visible,false),\n 'primary',coalesce(is_primary,false),\n 'orderable',Coalesce(p.is_orderable,true),\n 'title', coalesce(p.title,p.name),\n 'type', pt.name) ORDER by priority)) as small_data,\n string_agg(p.name,',' ORDER BY priority) as cols,\n p.paging_table_id\n from paging_column as p\n left join paging_column_type as pt on p.paging_column_type_id = pt.id\n where p.paging_table_id = $1\n and p.is_visible is true or p.is_primary is true\n GROUP BY p.paging_table_id ) as rs\n where rs.paging_table_id = paging_table.id;\n$$;\n\ncreate or replace function rebuild_paging_prop(a_vw_view text, a_descr text, a_type_name text, a_is_mat boolean) returns text\nLANGUAGE plpgsql\nAS $$\nDECLARE\n val_object_table_id INTEGER = (SELECT id\n FROM paging_table\n WHERE name =a_vw_view);\nBEGIN\n drop table if EXISTS temp_paging_col_prop;\n\n create temp table temp_paging_col_prop as\n (\n SELECT pv.viewname as tablename, isc.column_name as col, t.typname AS col_type,pgi.id as col_type_id,p.attnum as pr\n FROM pg_views AS pv\n JOIN information_schema.columns AS isc ON pv.viewname = isc.table_name\n JOIN pg_attribute AS p ON p.attrelid = isc.table_name :: REGCLASS AND isc.column_name = p.attname\n JOIN pg_type AS t ON p.atttypid = t.oid\n left join paging_column_type as pgi on pgi.name = t.typname\n WHERE schemaname = 'public' and pv.viewname = a_vw_view\n union all\n SELECT pv.tablename as tablename, isc.column_name as col, t.typname AS col_type,pgi.id as col_type_id,p.attnum as pr\n FROM pg_tables AS pv\n JOIN information_schema.columns AS isc ON pv.tablename = isc.table_name\n JOIN pg_attribute AS p ON p.attrelid = isc.table_name :: REGCLASS AND isc.column_name = p.attname\n JOIN pg_type AS t ON p.atttypid = t.oid\n left join paging_column_type as pgi on pgi.name = t.typname\n where pv.schemaname = 'public' and pv.tablename = a_vw_view\n );\n\n --- delete if table not exists\n delete from paging_table\n where id = val_object_table_id\n and not exists (select 1\n from temp_paging_col_prop limit 1)\n RETURNING id\n into val_object_table_id;\n\n --- create object if not exists (return paging_table_id)\n select get_set_paging_table_object as id\n from get_set_paging_table_object((select tablename from temp_paging_col_prop limit 1),a_descr,a_type_name,a_is_mat)\n into val_object_table_id;\n\n --- update paging_columns_prop\n update paging_column\n set paging_column_type_id = r.col_type_id,priority = coalesce(priority,r.pr)\n from (select pcp.id,t.col_type_id,t.pr\n from temp_paging_col_prop as t\n join paging_column as pcp on pcp.name = t.col\n where pcp.paging_table_id = val_object_table_id\n ) as r\n where r.id = paging_column.id;\n\n insert into paging_column(paging_table_id,paging_column_type_id,name,priority)\n select val_object_table_id,col_type_id,col,pr\n from temp_paging_col_prop\n ON CONFLICT (paging_table_id,name) DO NOTHING;\n\n\n delete from paging_column\n where paging_column_type_id = val_object_table_id\n and name not in (select col from temp_paging_col_prop);\n\n perform materialize_paging_column((select id from paging_table where name =a_vw_view));\n\n RETURN '';\nEND;\n$$;\n\ncreate or replace function paging_columns_prop_before_update_paging_table_mat_trg() returns trigger\nLANGUAGE plpgsql\nAS $$\nBEGIN \n perform materialize_paging_column(new.paging_table_id);\nRETURN NEW;\nEND;\n$$;\n\nupdate paging_table\n set last_paging_table_materialize_info_id = null\nwhere name in ('paging_table','paging_column_type','paging_column');\n\ndelete from paging_table_materialize_info\n where paging_table_id in\n (select id from paging_table\nwhere name in ('paging_table','paging_column_type','paging_column'));\n\ndelete from paging_table\nwhere name in ('paging_table','paging_column_type','paging_column');\n\ncreate or replace function get_set_paging_table_object(a_name text, a_descr text, a_type text, a_is_mat boolean) returns integer\nLANGUAGE plpgsql\nAS $$\ndeclare\n val_id integer = (select id from paging_table where name = $1);\n val_type_id integer = (select id from paging_table_type where name = $3);\nBEGIN\n if (val_id is null)\n then\n insert into paging_table(name, descr,paging_table_type_id,is_materialize)\n select $1,$2,Coalesce(val_type_id,1),coalesce(a_is_mat,false)\n RETURNING id\n into val_id;\n END IF;\n RETURN val_id;\nEND;\n$$;\n\nselect rebuild_paging_prop('paging_table',null,'table',false);\nselect rebuild_paging_prop('paging_column_type',null,'table',false);\nselect rebuild_paging_prop('paging_column',null,'table',false);\n\nupdate paging_column\nset is_visible = false\nwhere paging_table_id in (select id from paging_table where name in ('paging_table','paging_column','paging_column_type'));\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_table')\nand name in ('id','name','descr');\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_column')\nand name in ('id','paging_table_id','paging_column_type_id','name','title','is_visible','is_orderable','is_primary','priority');\n\nupdate paging_column\nset is_visible = true,is_filter = false\nwhere paging_table_id in (select id from paging_table where name = 'paging_column_type')\nand name in ('id','name');\n\nselect materialize_worker('recreate','vw_gen_materialize',null);\n\nEOD;\n$this->execute($query);\n}",
"public function updateQuestion()\r\n{\r\n $query_string = \"UPDATE questions \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"quizid = :quizid, \";\r\n $query_string .= \"question = :question, \";\r\n $query_string .= \"choice1 = :choice1, \";\r\n $query_string .= \"choice2 = :choice2, \";\r\n $query_string .= \"choice3 = :choice3, \";\r\n $query_string .= \"choice4 = :choice4, \";\r\n $query_string .= \"ans = :ans \";\r\n $query_string .= \"WHERE questionid = :questionid \";\r\n\r\n return $query_string;\r\n}",
"function merge_users($useridfrom, $useridto){\n global $config;\n echo \"<p>At this point I would merge $useridfrom into $useridto.</p>\";\n\n // User ID data is found in \"simple\" fashion in the following fields:\n $simplereplace = array('DEPTS'=>'hod', 'FACULTIES'=>'dean', 'PUBLICATIONSADMINS'=>'userid', \n 'PUBLICATIONSNOTMINE'=>'userid', 'RAEADMINS'=>'userid',\n 'RAEENTRIES'=>'userid', 'RAEMYGROUPS'=>'userid', 'RAEMYSTUDENTS'=>'userid', 'RAEMYASSISTANTS'=>'userid', \n\t'RAEMYGRANTS'=>'userid', 'RAEMYPUBS'=>'userid');\n\n foreach($simplereplace as $table=>$field){\n $q = \"UPDATE $table SET $field='$useridto' where $field='$useridfrom'\";\n if($config['debug']){\n echo \"<p>$q</p>\";\n }\n mysql_query($q);\n }\n\n // It's found in comma-separated fashion in the following:\n // PUBLICATIONS.userlist\n $q = \"UPDATE PUBLICATIONS SET userlist=REPLACE(userlist, '$useridfrom', '$useridto') where userlist LIKE '%$useridfrom%'\";\n if($config['debug']){\n echo \"<p>$q</p>\";\n }\n $res = mysql_query($q);\n if(!$res){\n die(\"Error while updating publications associations: \".mysql_error());\n }\n \n // Finally, deal with the USERS.userid field which is now alone, having lost all its associations...\n $q = \"DELETE FROM USERS WHERE userid='$useridfrom' LIMIT 1\";\n if($config['debug']){\n echo \"<p>$q</p>\";\n }\n mysql_query($q);\n\n // Store a record in PUBLICATIONSTRANS\n recordtransaction(\"usermerge:$useridfrom>$useridto\", 0);\n\n // Then report back\n ?><p style=\"padding: 50px;\">Merge has been carried out.</p><?php\n\n}",
"function Evidence_Codes_Update($inaccred_evidenceasset_codes,$tacd,$tevidenceasset_code,$tevidenceseq) {\r\r\n\t// XH2($inaccred_evidenceasset_codes.\"-\".$tacd.\"-\".$tevidenceasset_code.\"-\".$tevidenceseq);\r\r\n\t// XH2(\"IN |\".$inaccred_evidenceasset_codes.\"|\");\r\r\n\t$tevidenceasset_codesa = explode (',', $inaccred_evidenceasset_codes); \r\r\n\tif ($tacd == \"A\") { array_push ($tevidenceasset_codesa, $tevidenceasset_code); }\t\r\r\n\tif ($tacd == \"C\") { $tevidenceasset_codesa[$tevidenceseq] = $tevidenceasset_code; }\t\r\r\n\tif ($tacd == \"D\") { $tevidenceasset_codesa[$tevidenceseq] = \"\"; }\t\r\r\n\t$outaccred_evidenceasset_codes = \"\"; $sep = \"\";\r\r\n\tforeach ( $tevidenceasset_codesa as $evidenceasset_code ) {\r\r\n\t\tif ($evidenceasset_code != \"\") {$outaccred_evidenceasset_codes = $outaccred_evidenceasset_codes.$sep.$evidenceasset_code; $sep = \",\";}\r\r\n\t}\r\r\n\t// XH2(\"OUT |\".$outaccred_evidenceasset_codes.\"|\");\t\r\r\n\treturn $outaccred_evidenceasset_codes; \r\r\n}",
"function update($_fields,$merge=true)\n\t{\n\t\tif ($merge) $this->data_merge($_fields);\n\n\t\t$fields = $this->data2db($_fields);\n\n\t\t// extract the keys from $fields or - if not set there - from $this->data\n\t\t$keys = array();\n\t\tforeach($this->db_key_cols as $col => $name)\n\t\t{\n\t\t\t$keys[$col] = isset($fields[$name]) ? $fields[$name] : $this->data[$name];\n\t\t\tunset($fields[$name]);\n\t\t}\n\t\t// extract the data from $fields\n\t\t$data = array();\n\t\tforeach($this->db_data_cols as $col => $name)\n\t\t{\n\t\t\tif (array_key_exists($name,$fields))\n\t\t\t{\n\t\t\t\t$data[$col] = $fields[$name];\n\t\t\t\tunset($fields[$name]);\n\t\t\t}\n\t\t}\n\t\t// add direct sql like 'etag=etag+1' (it has integer keys)\n\t\tforeach($fields as $key => $value)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\t$data[] = $value;\n\t\t\t}\n\t\t}\n\t\tif (!$data)\n\t\t{\n\t\t\treturn 0;\t// nothing to update\n\t\t}\n\t\tif (!$this->db->update($this->table_name,$data,$keys,__LINE__,__FILE__,$this->app))\n\t\t{\n\t\t\treturn $this->db->Errno;\n\t\t}\n\t\treturn 0;\n\t}",
"public function insert_update($table, $data, $update_data, $format = null, $where_format = null)\n {\n if (! is_array($data) || ! is_array($update_data)) {\n return false;\n }\n\n $bits = $update_bits = $ubits = array();\n foreach ((array) array_keys($data) as $field) {\n $bits[] = '?';\n }\n foreach ((array) array_keys($update_data) as $field) {\n $update_bits[] = \"`$field` = ?\";\n $ubits[] = \"`$field` = '\". $update_data[$field] .\"'\";\n }\n\n $query = \"INSERT INTO `\".$table.\"` (`\" . implode('`,`', array_keys($data)) . \"`) VALUES(\" . implode(',', $bits) . \") ON DUPLICATE KEY UPDATE \" . implode(', ', $update_bits);\n \n $query2 = \"INSERT INTO `\".$table.\"` (`\" . implode('`,`', array_keys($data)) . \"`) VALUES('\" . implode(\"','\", array_values($data)) . \"') ON DUPLICATE KEY UPDATE \" . implode(', ', $ubits);\n\n //Config::log(\"SQL[\".$query2.\"]\");\n\n // array_merge(array_values($format), array_values($where_format))\n return $this->query($query, array_merge(array_values($data), array_values($update_data)), $format);\n\n \n }",
"function addToQuery(&$query, $tablename=\"\", $fieldaliasprefix=\"\", $rec, $level, $mode)\n {\n }",
"function buildUpdate($params)\n {\n $result = '';\n $setStatement = '';\n $fieldList = $this->getFieldList($params['table']);\n reset($fieldList);\n\n while(current($fieldList))\n {\n if (in_array(current($fieldList), array_keys($params)))\n {\n $setStatement .= \"`\" . current($fieldList) . \"` = '\" . $params[current($fieldList)] . \"', \";\n }\n else\n {\n $this->setError(\"\", \"buildUpdate #001\");\n return false;\n }\n $fieldInfo = next($fieldList);\n }\n\n $setStatement = preg_replace(\"/,\\s*$/\", \"\", $setStatement);\n\n $result = \"UPDATE \" . $params[\"table\"] . \" SET \" . $setStatement;\n\n if (isset($params['where']))\n {\n $result .= \" WHERE \" . $params['where'] . \";\" ;\n }\n else\n {\n $result .= \";\";\n }\n\n return $result;\n }",
"function sys_view_row_update($rows, $result_total){\r\n // $ids is combi: id form # id row\r\n $ids = $_POST[\"id\"];\r\n $id_arr = explode(\"-\", $ids);\r\n $id_view = $id_arr[0];\r\n $id_row = $id_arr[1];\r\n $result = f_m_get_txt_data(\"model/data/d_sys_view.txt\", \"\", \"id='$id_view'\", \"\", \"\", \"form_row1\");\r\n $ref_id_db = \"id\";\r\n $ref_id_form = \"id_org\";\r\n $_POST[\"id_org\"] = $id_row;\r\n // get columnnames\r\n $column = f_m_get_columns_view_model(\"model/data/d_sys_view.txt\", \"\");\r\n // first always the same\r\n $store_id_db = \"id,\";\r\n $store_id_form = \"id_org,\";\r\n // add others\r\n $column_str = \"\";\r\n for($i = 1; $i < count($column); $i++){\r\n $column_str .= $column[$i] . \",\";\r\n }\r\n $column_str = substr($column_str, 0, strlen($column_str) - 1);\r\n $store_id_db .= $column_str;\r\n $store_id_form .= $column_str;\r\n s_m_put_txt_data(\"put_sys_view_row_update\", \"update\", $result[0][\"map_file\"], $ref_id_db, $ref_id_form, $store_id_db, $store_id_form);\r\n return $result_total;\r\n}",
"private function gen_provSQL() {\n\t\t\t$this -> Retun_val = true;\n\t\t}",
"private function _fillTmpTable()\n {\n $sql = new SqlStatement();\n $sql->select()\n ->from(array('p' => 'product'), array('p.*'));\n \n if ($this->subCategory) \n {\n $sql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->innerJoin(array('cp' => 'category_path'), 'cp.category_id = p2c.category_id')\n ->where('cp.path_id = ?', array($this->subCategory));\n }\n elseif ($this->topCategory) \n {\n $sql->innerJoin(array('p2c' => 'product_to_category'), 'p.product_id = p2c.product_id')\n ->where('p2c.category_id = ?', array($this->topCategory));\n }\n \n $searchConditions = $this->_prepareSearchConditions();\n if (count($searchConditions)) {\n $sql->innerJoin(array('pd' => 'product_description'), 'pd.product_id = p.product_id')\n ->multipleWhere($searchConditions, 'OR');\n }\n \n $sql2 = new SqlStatement();\n $sql2->select(array(\n 'p.product_id',\n 'p.price',\n 'discount' => 'MIN(pd2.price)',\n 'special' => 'MIN(ps.price)',\n 'total' => 'AVG(rating)',\n //@fixed_tax\n //@percent_tax\n ))\n ->from(array('p' => $sql))\n ->innerJoin(array('p2s' => 'product_to_store'), 'p.product_id = p2s.product_id')\n ->where('p2s.store_id = ?', (int)$this->config->get('config_store_id'))\n ->where(\"p.status = '1'\")\n ->where('p.date_available <= NOW()')\n ->group(array('p.product_id'));\n \n if (count($this->aggregate)) {\n foreach ($this->aggregate as $type => $group) {\n foreach ($group as $groupId => $values) {\n $tblAlias = strtolower(substr($type, 0, 1)) . $groupId;\n $sql2->innerJoin(array($tblAlias => self::FILTERS_TABLE), 'p.product_id = ' . $tblAlias . '.product_id');\n $sql2->where($tblAlias . '.type = ?', array($type));\n $sql2->where($tblAlias . '.group_id = ?', array($groupId));\n if ($type !== 'STOCK_STATUS') {\n foreach ($values as $k => $val) {\n $values[$k] = '\\'' . $this->db->escape($val) . '\\'';\n }\n $sql2->where($tblAlias . '.value IN (' . implode(', ', $values) . ')');\n } else {\n $terms = array();\n foreach ($values as $stockSt) {\n if ($stockSt == self::$IN_STOCK_STATUS) {\n $terms[] = '(p.quantity > 0 OR p.stock_status_id = ' . self::$IN_STOCK_STATUS . ')';\n } else {\n $terms[] = '(' . $tblAlias . '.value = \\'' . $this->db->escape($stockSt) . '\\' AND p.quantity = 0)';\n }\n }\n\n $sql2->where('(' . implode(' OR ', $terms) . ')');\n }\n }\n }\n }\n \n if ( self::$HIDE_OUT_OF_STOCK ) {\n $vals = array();\n if (isset($this->aggregate['OPTION'])) {\n foreach ($this->aggregate['OPTION'] as $values) {\n $vals = array_merge($vals, $values);\n }\n }\n $on = count($vals) \n ? \"p.product_id = pov.product_id AND pov.option_value_id IN (\" . implode(',', $vals) . \")\" \n : \"p.product_id = pov.product_id\";\n \n $sql2->leftJoin(array('pov' => 'product_option_value'), $on)\n ->where('( (pov.quantity IS NULL AND p.quantity > 0) OR pov.quantity > 0 )');\n }\n \n $sql2->leftJoin(array('pd2' => 'product_discount'), \"pd2.product_id = p.product_id \n AND pd2.quantity = '1'\n AND (pd2.date_start = '0000-00-00' OR pd2.date_start < NOW())\n AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())\n AND pd2.customer_group_id = '{$this->customerGroupId}'\")\n ->leftJoin(array('ps' => 'product_special'), \"ps.product_id = p.product_id \n AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())\n AND (ps.date_start = '0000-00-00' OR ps.date_start < NOW())\n AND ps.customer_group_id = '{$this->customerGroupId}'\")\n ->leftJoin(array('r1' => 'review'), 'r1.product_id = p.product_id AND r1.status = 1');\n\n if ($this->config->get('config_tax')) {\n $sql2->select(array('fixed_tax', 'percent_tax'))\n ->leftJoin(array('tr1' => $this->subquery->fixedTax), 'tr1.tax_class_id = p.tax_class_id')\n ->leftJoin(array('tr2' => $this->subquery->percentTax), 'tr2.tax_class_id = p.tax_class_id');\n } else {\n $sql2->select(array('fixed_tax' => '0', 'percent_tax' => '0'));\n }\n\n $this->db->query('CREATE TEMPORARY TABLE ' . DB_PREFIX . self::RESULTS_TABLE . ' (PRIMARY KEY (`product_id`)) ' . $sql2);\n }",
"protected function setKeysForSaveQuery(\\Illuminate\\Database\\Eloquent\\Builder $query) {\n if (is_array($this->primaryKey)) {\n foreach ($this->primaryKey as $pk) {\n $query->where($pk, '=', $this->original[$pk]);\n }\n return $query;\n }else{\n return parent::setKeysForSaveQuery($query);\n }\n }",
"protected function saveBase($base){\r\n\t\r\n\t$q = $this->id==0 ? \"INSERT INTO \"._SQLPREFIX_.$this->tableName.\" \": \"UPDATE \"._SQLPREFIX_.$this->tableName.\" SET \";\r\n\t \r\n\tif($this->id==0){\r\n\t\t\r\n\t\tforeach($base as $key => $item){\t\r\n\t\t\t$q .= $key>0 ? \",\".(string)$item->row->name: \"(\".(string)$item->row->name;\r\n\t\t}\r\n\t\t\r\n\t\tforeach($base as $key => $item){\t\r\n\t\t\t\r\n\t\t\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t\t\t$postvalue = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t\t\t}elseif((string)$item->row->attributes()->system_type=='text' || ( (string)$item->row->attributes()->system_type=='blob' && (string)$item->row->attributes()->cleanup==1 ) ){\r\n\t\t\t\t$postvalue = Filter::makeSafeString($this->sourceData['meta_value_'.(string)$item->row->name]);\r\n\t\t\t}else{\r\n\t\t\t\t$postvalue = $this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$value = DataValidator::saveData($postvalue, (string)$item->row->attributes()->system_type);\r\n\t\t\t$q .= $key>0 ? \"','\".Db::escapeField($value): \") VALUES ('\".Db::escapeField($value);\r\n\t\t}\r\n\t\t\r\n\t\t$q .= \"')\";\r\n\t\t\r\n\t}else{\r\n\t\tforeach($base as $key => $item){\t\r\n\t\t\t\r\n\t\t\tif((string)$item->row->attributes()->system_type=='bool'){\r\n\t\t\t\t$postvalue = !isset($this->sourceData['meta_value_'.(string)$item->row->name]) ? 0: 1;\r\n\t\t\t}elseif((string)$item->row->attributes()->system_type=='text' || ( (string)$item->row->attributes()->system_type=='blob' && (string)$item->row->attributes()->cleanup==1 ) ){\r\n\t\t\t\t$postvalue = Filter::makeSafeString($this->sourceData['meta_value_'.(string)$item->row->name]);\r\n\t\t\t}else{\r\n\t\t\t\t$postvalue = $this->sourceData['meta_value_'.(string)$item->row->name];\r\n\t\t\t}\r\n\r\n\t\t\t$value = DataValidator::saveData($postvalue, (string)$item->row->attributes()->system_type);\r\n\t\t\t$q .= $key>0 ? \", \".(string)$item->row->name.\" = '\".Db::escapeField($value).\"'\": (string)$item->row->name.\" = '\".Db::escapeField($value).\"'\";\r\n\t\t}\r\n\t\t\r\n\t\t$q .= \" WHERE \".$this->fieldName.\" = \".(int)$this->id;\r\n\t}\r\n\t\r\n\t//echo $q; \r\n\tDb::query($q);\r\n\tif($this->id == 0){\r\n\t\t$this->lastInsert = Db::get_last_id(_SQLPREFIX_.$this->tableName);\r\n\t}\r\n}",
"function lazyUpdate($table, $where, $data){\n \t$sql = 'SHOW COLUMNS FROM '.$table.';';//fetch all columns\n \t$query = mysql_query($sql);\n \t$set = '';\n \twhile($column = mysql_fetch_array($query)){\n \t\t//create the field- and value string\n \t\tif(isset($data[$column['Field']])){\n \t\t\t$set .= $column['Field'].'=\\''.mysql_real_escape_string($data[$column['Field']]).'\\', ';\n \t\t}\n \t}\n \t$set = substr($set,0,-2);\n \treturn mysql_query('UPDATE '.$table.' SET '.$set.' WHERE '.$where.';');//insert the data\n }",
"public function toSql(){\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 $data = $this->process_fields($table_name, $data, null );\n if (false === $data) {\n return false;\n }\n \n if( isset( $this->$pk ) ){\n $where = [$pk=>$this->$pk];\n $where = $this->process_fields($table_name, $where, null);\n if ( false === $where ) {\n return false;\n }\n \n $fields = $conditions = $values = array();\n foreach ( $data as $field => $value ) {\n if ( is_null( $value['value'] ) ) {\n $fields[] = \"`$field` = NULL\";\n continue;\n }\n\n $fields[] = \"`$field` = \" . $value['format'];\n $values[] = $value['value'];\n }\n \n foreach ( $where as $field => $value ) {\n if ( is_null( $value['value'] ) ) {\n $conditions[] = \"`$field` IS NULL\";\n continue;\n }\n\n $conditions[] = \"`$field` = \" . $value['format'];\n $values[] = $value['value'];\n }\n\n $fields = implode( ', ', $fields );\n $conditions = implode( ' AND ', $conditions );\n \n $sql = \"UPDATE `$table_name` SET $fields WHERE $conditions;\";\n return $wpdb->prepare($sql, $values);\n }else{\n $formats = $values = array();\n foreach ( $data as $value ) {\n if (is_null($value['value'])) {\n $formats[] = 'NULL';\n continue;\n }\n\n $formats[] = $value['format'];\n $values[] = $value['value'];\n }\n\n $fields = '`'.implode( '`, `', array_keys($data)).'`';\n $formats = implode( ', ', $formats);\n\n $sql = \"INSERT INTO `$table_name` ($fields) VALUES ($formats);\";\n return $wpdb->prepare($sql, $values);\n }\n \n return false;\n }"
] | [
"0.55745363",
"0.5494977",
"0.5457562",
"0.5446959",
"0.5444521",
"0.5440326",
"0.5375321",
"0.53691095",
"0.53545326",
"0.53493947",
"0.53467995",
"0.53102493",
"0.5262142",
"0.52501136",
"0.52376956",
"0.5234941",
"0.5190493",
"0.5188034",
"0.5159706",
"0.5156091",
"0.51534104",
"0.51520675",
"0.5146681",
"0.51306826",
"0.5125334",
"0.5124692",
"0.51123476",
"0.50966096",
"0.50775397",
"0.5073956",
"0.5060004",
"0.50576955",
"0.505519",
"0.5043265",
"0.50390685",
"0.5035354",
"0.50326157",
"0.5030742",
"0.50191194",
"0.5018276",
"0.50139946",
"0.50118655",
"0.50107145",
"0.49995664",
"0.4980588",
"0.49711245",
"0.49703518",
"0.49656826",
"0.4964229",
"0.49638334",
"0.49594855",
"0.49571356",
"0.49502257",
"0.49494717",
"0.49489966",
"0.49457675",
"0.49422294",
"0.49418068",
"0.4939011",
"0.49373558",
"0.49243182",
"0.49222544",
"0.49203005",
"0.49030688",
"0.49027362",
"0.4902656",
"0.49022135",
"0.48973912",
"0.48963186",
"0.48893017",
"0.48809132",
"0.48787436",
"0.48757032",
"0.48712736",
"0.48684093",
"0.4867806",
"0.4858296",
"0.48581636",
"0.4855014",
"0.48502815",
"0.48502716",
"0.48500404",
"0.48374966",
"0.4817118",
"0.48151648",
"0.48121238",
"0.48096576",
"0.48094556",
"0.480539",
"0.48029256",
"0.48013616",
"0.47987556",
"0.47947013",
"0.4793337",
"0.4793066",
"0.47930658",
"0.4786853",
"0.47836018",
"0.47829607",
"0.47823903"
] | 0.55072206 | 1 |
Returns an array of tokens this test wants to listen for. | public function register()
{
return array(T_OPEN_TAG);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTokens(): array\n {\n return $this->tokens;\n }",
"public function getAvailableTokens()\n {\n return array_keys( $this->tokens );\n }",
"public function getTokens() {\n\t\treturn array_keys($this->tokens);\n\t}",
"public function get_tokens()\n\t{\n\t\treturn $this->tokens;\n\t}",
"public function getTokens();",
"private function RequestTokens() {\n return (array)$this->oauth->getRequestToken();\n }",
"public function getTokens()\n {\n return $this->tokens;\n }",
"public function getToken()\n {\n return array($this->_token, $this->_token_secret);\n }",
"public function register()\n {\n return array_merge(\n\t\t\tPHP_CodeSniffer_Tokens::$assignmentTokens,\n\t\t\tPHP_CodeSniffer_Tokens::$comparisonTokens,\n\t\t\tPHP_CodeSniffer_Tokens::$booleanOperators,\n\t\t\tarray(\n\t\t\t\tT_WHILE,\n\t\t\t\tT_FOR,\n\t\t\t\tT_FOREACH,\n\t\t\t\tT_SWITCH,\n\t\t\t\tT_IF,\n\t\t\t\tT_ELSE,\n\t\t\t\tT_ELSEIF,\n\t\t\t\tT_CATCH,\n\t\t\t\tT_ARRAY,\n\t\t\t)\n\t\t);\n\n }",
"public function register()\n {\n $tokens = array();\n foreach ($this->deprecatedTypeCasts as $token => $versions) {\n $tokens[] = constant($token);\n }\n\n return $tokens;\n }",
"public function getTokens()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('tokens');\n }",
"public function getUserTokens();",
"public function register()\n {\n $tokens = array(\n T_FUNCTION,\n );\n\n if (version_compare(PHP_CodeSniffer::VERSION, '2.3.4') >= 0) {\n $tokens[] = T_RETURN_TYPE;\n }\n\n return $tokens;\n\n }",
"public function register()\n {\n return [\n T_FUNCTION,\n T_CLOSURE,\n T_FN,\n ];\n\n }",
"public function signalTokens()\n {\n return [\"'\", '\"', '=', ')'];\n }",
"public function register()\n {\n return [\n \\T_VARIABLE,\n \\T_FUNCTION,\n ];\n }",
"public function getUsersToNotifyOfTokenGiven() {\n return array(\n $this->getAuthorPHID(),\n );\n }",
"public function register()\n {\n $tokens = Tokens::$functionNameTokens;\n\n $tokens[] = T_VARIABLE;\n $tokens[] = T_CLOSE_CURLY_BRACKET;\n $tokens[] = T_CLOSE_SQUARE_BRACKET;\n $tokens[] = T_CLOSE_PARENTHESIS;\n\n return $tokens;\n\n }",
"public function getListeners(): array;",
"public function getProviderTokens()\n {\n return $this->provider_tokens;\n }",
"public static function get_tokens()\n\t{\n\t\treturn static::$client->get_tokens();\n\t}",
"public function register()\n {\n return array(\n T_FUNCTION,\n T_VARIABLE\n );\n\n }",
"public static function getWhitelist(): array\n {\n return static::pluck('word')->toArray();\n }",
"public function register()\n {\n return [\n T_IS_EQUAL,\n T_IS_NOT_EQUAL,\n T_IS_IDENTICAL,\n T_IS_NOT_IDENTICAL,\n ];\n }",
"public function register() {\n\n return [\n T_IF,\n T_WHILE,\n T_FOREACH,\n T_FOR,\n T_SWITCH,\n T_DO,\n T_ELSE,\n T_ELSEIF,\n T_TRY,\n T_CATCH\n ];\n\n }",
"public static function getApplicableListener(): array;",
"public function register() : array {\n\t\treturn [\n\t\t\tT_PRIVATE,\n\t\t];\n\t}",
"public function signalTokens()\n {\n return [\"'\", '\"', '\\\\'];\n }",
"protected function getStartingTrashTokens(): array\n {\n return [\n 'может'\n ];\n }",
"public function getStaticTokens()\n {\n $tokens = [];\n $sites = [];\n if (!$this->getValid()) {\n return $sites;\n }\n foreach ($this->xml->children() as $child) {\n if ($child->getName() == \"token\") {\n $token = $this->parseToken($child);\n if ($token !== false) {\n $tokens[$token['token']] = $token;\n }\n }\n }\n return $tokens;\n }",
"private function registered_events () {\n\n\t\t$triggers = array();\n\n\t\tforeach( get_option( 'nce_triggers' ) as $trigger => $enabled ) {\n\n\t\t\tif( $enabled == \"1\" ) {\n\n\t\t\t\t$triggers[] = $trigger;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $triggers;\n\n\t}",
"public function tokensDataProvider(): array\n {\n return [\n 'PHP 7' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NS_SEPARATOR, '\\\\'],\n 2 => [T_STRING, 'Object'],\n 3 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ],\n 'PHP 8' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NAME_FULLY_QUALIFIED, '\\\\Object'],\n 2 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ]\n ];\n }",
"public function get_access_tokens() {\n\t\t$tokens = get_user_meta($this->user->ID, self::META_TYK_ACCESS_TOKENS_KEY, true);\n\t\tif (!is_array($tokens)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// lambda to add an 'is_valid' attribute to each token\n\t\t$map_is_valid = function ($token) {\n\t\t\treturn array_merge($token, array(\n\t\t\t\t'is_valid' => $this->has_token($token['hash']),\n\t\t\t\t));\n\t\t};\n\n\t\treturn array_map($map_is_valid, $tokens);\n\t}",
"public function getTokens(Context $context);",
"public function register()\n {\n $tokens = parent::register();\n $tokens[] = T_ECHO;\n return $tokens;\n\n }",
"private function get_token() \n {\n if ($this->last_token === 'TK_TAG_SCRIPT' || $this->last_token === 'TK_TAG_STYLE') { //check if we need to format javascript\n $type = substr($this->last_token, 7);\n $token = $this->get_contents_to($type);\n if (!is_string($token)) {\n return $token;\n }\n return array($token, 'TK_' . $type);\n }\n if ($this->current_mode === 'CONTENT') {\n $token = $this->get_content();\n \n if (!is_string($token)) {\n return $token;\n } else {\n return array($token, 'TK_CONTENT');\n }\n }\n\n if ($this->current_mode === 'TAG') {\n $token = $this->get_tag();\n\n if (!is_string($token)) {\n return $token;\n } else {\n $tag_name_type = 'TK_TAG_' . $this->tag_type;\n return array($token, $tag_name_type);\n }\n }\n }",
"public function register()\n {\n return [\n T_CLOSE_PARENTHESIS,\n T_CLOSE_SHORT_ARRAY,\n T_OPEN_CURLY_BRACKET,\n T_SEMICOLON\n ];\n }",
"public static function register()\n\t{\n\t\tglobal $modSettings;\n\n\t\tif (empty($modSettings['emoji_selection']) || $modSettings['emoji_selection'] === 'noemoji')\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\t// $hook, $function, $file\n\t\treturn [\n\t\t\t[\n\t\t\t\t'integrate_pre_bbc_parser',\n\t\t\t\t'\\\\ElkArte\\\\EmojiIntegrate::integrate_pre_bbc_parser'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'integrate_editor_plugins',\n\t\t\t\t'\\\\ElkArte\\\\EmojiIntegrate::integrate_editor_plugins'\n\t\t\t],\n\t\t];\n\t}",
"public function providerDeviceToken()\n {\n return array(\n array('foo_bar', true),\n array(str_repeat('aq', 32), true),\n array(str_repeat('af', 32), false),\n array(str_repeat('AF', 32), false)\n );\n }",
"public function getLookahead(): array\n {\n return $this->lookahead;\n }",
"final public function register()\n {\n return [\n T_ARRAY,\n T_OPEN_SHORT_ARRAY,\n ];\n\n }",
"public static function registeredSignals(): array\n {\n return array_keys(self::$callbacks);\n }",
"public function register()\n {\n return [\n T_OPEN_TAG,\n T_OPEN_TAG_WITH_ECHO,\n ];\n\n }",
"public function register()\n {\n return [\n T_IS_EQUAL,\n T_IS_NOT_EQUAL,\n ];\n }",
"private function tokensOf($in) {\n $l= $this->newLexer('<?php '.$in.'?>');\n $tokens= [];\n do {\n try {\n if ($r= $l->advance()) {\n $tokens[]= [$l->token, $l->value, $l->position];\n }\n } catch (Throwable $e) {\n $tokens[]= [nameof($e), $e->getMessage()];\n $r= false;\n }\n } while ($r);\n return $tokens;\n }",
"public function getSubscriptions()\n {\n return [\n self::NAME.'.command.message',\n self::NAME.'.command.part',\n self::NAME.'.command.join',\n self::NAME.'.command.quit',\n self::NAME.'.command.kick',\n self::NAME.'.command.invite',\n ];\n }",
"public function extractTokens()\n {\n // Prepare the opening and closing tags for the regex\n $openingTag = sprintf( '\\\\%s', implode( '\\\\', str_split( $this->openingTag ) ) );\n $closingTag = sprintf( '\\\\%s', implode( '\\\\', str_split( $this->closingTag ) ) );\n\n // Build the regex\n $regex = sprintf( '/%s([A-Z-_0-9]+)%s/i', $openingTag, $closingTag );\n\n // Find all the tokens in the string\n preg_match_all( $regex, $this->content, $matches, PREG_PATTERN_ORDER );\n\n // If there are no matches, simply return an empty array\n if ( empty( $matches[1] ) )\n {\n return [];\n }\n\n // Return a unique list of tokens\n return array_unique( $matches[ 1 ] );\n }",
"public function register()\n {\n return [T_OPEN_SQUARE_BRACKET, T_OPEN_SHORT_ARRAY, T_OPEN_PARENTHESIS];\n }",
"public function getTokenParsers()\n {\n return array();\n }",
"public function getTokenParsers()\n {\n return array();\n }",
"public function provides()\n {\n return [\n 'tts',\n ];\n }",
"public function register()\n {\n return array(T_VARIABLE);\n\n }",
"function exportTokens() {\n\t\treturn $this->tokens;\n\t}",
"protected function connections()\n {\n return [\n 'tokens' => [\n 'to' => 'OAuthToken',\n 'description' => 'A list of all the access tokens of this client.'\n ]\n ];\n }",
"public function enumCommands()\n {\n $rVal = [];\n foreach ($this->xml->xpath('command') as $node) {\n $rVal[] = (string)$node[0]->attributes()->name;\n }\n\n return $rVal;\n }",
"public static function getListeners() : array\n {\n return Event::$listeners;\n }",
"protected static function allowedEvents()\n\t{\n\t\treturn array();\n\t}",
"public static function get_token_times()\n {\n $timer = &self::$timer;\n $session_start = $timer->__get('session_start');\n $session_checkpoint = $timer->__get('session_checkpoint');\n\n $times = array(\n 'session_start' => $session_start,\n 'session_checkpoint' => $session_checkpoint,\n );\n return $times;\n }",
"public function register(): array\n {\n return [\n T_CLASS, T_INTERFACE,\n ];\n }",
"public function register()\n {\n $this->assignment_tokens = \\Dekode\\GravityForms\\Vendor\\PHP_CodeSniffer\\Util\\Tokens::$assignmentTokens;\n unset($this->assignment_tokens[\\T_DOUBLE_ARROW]);\n $starters = \\Dekode\\GravityForms\\Vendor\\PHP_CodeSniffer\\Util\\Tokens::$booleanOperators;\n $starters[\\Dekode\\GravityForms\\Vendor\\T_SEMICOLON] = \\Dekode\\GravityForms\\Vendor\\T_SEMICOLON;\n $starters[\\Dekode\\GravityForms\\Vendor\\T_OPEN_PARENTHESIS] = \\Dekode\\GravityForms\\Vendor\\T_OPEN_PARENTHESIS;\n $starters[\\Dekode\\GravityForms\\Vendor\\T_INLINE_ELSE] = \\Dekode\\GravityForms\\Vendor\\T_INLINE_ELSE;\n $this->condition_start_tokens = $starters;\n return array(\\T_IF, \\T_ELSEIF, \\T_FOR, \\T_SWITCH, \\T_CASE, \\T_WHILE, \\Dekode\\GravityForms\\Vendor\\T_INLINE_THEN);\n }",
"public static function get_statuses() {\n return array(\n self::GUEST,\n self::REGISTERED\n );\n }",
"public function register()\n {\n return array(T_ARRAY);\n }",
"public static function getSubscribedEvents()\n {\n return array(\n SubscriptionNotificationCenterBridgeEvents::BUILD_TOKENS_FROM_RECIPIENT => array(\n array('buildRecipientTokens'),\n ),\n );\n }",
"public function getWhitelistedCSRFActions()\n {\n return array(\n 'notify'\n );\n }",
"private function getAppMentionEventData(): array {\n return [\n 'type' => 'app_mention',\n 'user' => 'W021FGA1Z',\n 'text' => 'You can count on <@U0LAN0Z89> for an honorable mention.',\n 'ts' => '1515449483.000108',\n 'channel' => 'C0LAN2Q65',\n 'event_ts' => '1515449483000108',\n ];\n }",
"public function getListeners($eventName): array;",
"protected static function getHeaderToken()\n {\n return [];\n }",
"protected static function getHeaderToken()\n {\n return [];\n }",
"public function register()\n {\n return array(\n T_WHITESPACE\n );\n }",
"public function register() {\n\t\treturn array(T_BACKTICK);\n\t}",
"function &get_xoops_token()\n{\n\tif ( class_exists('XoopsMultiTokenHandler') )\n\t{\n\t\t$token =& XoopsMultiTokenHandler::quickCreate( $this->_TOKEN_NAME );\n\t\t$name = $token->getTokenName();\n\t\t$value = $token->getTokenValue();\n\t}\n\telse\n\t{\n\t\t$name = 'token';\n\t\t$value = 0;\n\t}\n\t$arr = array($name, $value);\n\treturn $arr;\n}",
"public function getTokenClassNames() {\n\t\treturn array(TwitterOAuthToken::class);\n\t}",
"public function dataProviderCheckTokens()\n {\n return static::testTokens();\n }",
"public function getCallbacks(): array;",
"public function register() {\n\n return [\n T_OPEN_SQUARE_BRACKET,\n T_CLOSE_SQUARE_BRACKET,\n ];\n\n }",
"public function register() {\n return array(\n T_FUNCTION,\n );\n }",
"private function registeredCommands(): array\n {\n return [\n $this->container->get(SpinUpCommand::class),\n $this->container->get(RemoveCommand::class),\n $this->container->get(InitConfigCommand::class),\n $this->container->get(ReplaceParametersCommand::class),\n $this->container->get(GetFileGroupCommand::class),\n $this->container->get(RunWebhookGroupCommand::class),\n ];\n }",
"public function getListeners($event): array;",
"public static function getTags(): array\n {\n return static::$tags;\n }",
"public static function getSubscribedEvents(): array\n {\n return [\n WsServerEvent::HANDSHAKE_SUCCESS => 'handshakeOk',\n WsServerEvent::MESSAGE_RECEIVE => 'messageReceive',\n WsServerEvent::CLOSE_BEFORE => 'messageReceive',\n ];\n }",
"public static function getSubscribedEvents() {\n return [];\n }",
"public function getAcceptExtensions();",
"public function userCommands(): array\n {\n if (!array_key_exists('commands', $this->config)) {\n //Legacy config support\n return [];\n }\n\n return $this->config['commands'];\n }",
"public function register()\n {\n return Collections::arrayOpenTokensBC();\n }",
"public function provides()\n {\n $i = [];\n foreach ($this->commands as $key => $value) {\n array_push($i, 'command.forever.' . $key);\n }\n\n return $i;\n }",
"public function register()\n {\n return array(\n T_ARRAY,\n T_OPEN_SHORT_ARRAY,\n );\n }",
"public function register()\n {\n $this->assignment_tokens = Tokens::$assignmentTokens;\n unset($this->assignment_tokens[\\T_DOUBLE_ARROW]);\n $starters = Tokens::$booleanOperators;\n $starters[\\T_SEMICOLON] = \\T_SEMICOLON;\n $starters[\\T_OPEN_PARENTHESIS] = \\T_OPEN_PARENTHESIS;\n $starters[\\T_INLINE_ELSE] = \\T_INLINE_ELSE;\n $this->condition_start_tokens = $starters;\n return array(\\T_INLINE_THEN);\n }",
"public function register()\n\t{\n\t\treturn array(T_WHITESPACE);\n\t}",
"public function register()\n\t{\n\t\treturn array(T_WHITESPACE);\n\t}",
"public function register()\n {\n return array(\n T_FUNCTION,\n );\n }",
"public function getWords(): array\n {\n return $this->getWordList();\n }",
"public function getAccepted(): array\n {\n return $this->accept;\n }",
"protected function getTrimTokens(): array\n {\n return [\n 'или', 'и'\n ];\n }",
"public function getIdTokens()\n {\n return $this->idtokens;\n }",
"protected function getScanCommands()\n {\n $files = Finder::create()\n ->in($this->app['path.commands'])\n ->name('*Command.php');\n\n $commands = [];\n\n foreach ($files as $file) {\n if ($command = $this->getCommandFromSource($file)) {\n $commands = array_merge($commands, $command);\n }\n }\n\n return $commands;\n }",
"public function register()\n {\n return [\n T_COMMENT,\n T_DOC_COMMENT_OPEN_TAG,\n ];\n\n }",
"public function register()\n {\n return [\\T_FOREACH];\n }",
"public function subscribeOn(): array\n {\n }",
"public function gameTokens();",
"public function getFeedback()\n {\n $feedbackResponses = array();\n\n while ($fbCon = fread($this->getConnection(), 38)) {\n $arr = unpack(\"H*\", $fbCon);\n $rawhex = trim(implode(\"\", $arr));\n $token = substr($rawhex, 12, 64);\n\n if (!empty($token)) {\n $feedbackResponses[] = sprintf('Token was not registered anymore: %s', $token);\n }\n }\n\n fclose($this->getConnection());\n\n return $feedbackResponses;\n }",
"public function getEventNames()/*# : array */;"
] | [
"0.68133146",
"0.6487653",
"0.6397045",
"0.6326093",
"0.627041",
"0.6262117",
"0.6258998",
"0.6237562",
"0.6207032",
"0.6150431",
"0.6053098",
"0.5986526",
"0.5863179",
"0.5846821",
"0.5831157",
"0.5811848",
"0.5811663",
"0.5777088",
"0.57391036",
"0.57198495",
"0.57187",
"0.57060534",
"0.5692008",
"0.56691366",
"0.56670034",
"0.565774",
"0.5613328",
"0.55961156",
"0.5593078",
"0.55904895",
"0.55634683",
"0.5554095",
"0.5549648",
"0.5526373",
"0.5515866",
"0.55009735",
"0.5498305",
"0.549334",
"0.54842275",
"0.54709214",
"0.5449075",
"0.54315823",
"0.5420605",
"0.5395375",
"0.5384074",
"0.5374977",
"0.5374221",
"0.5325195",
"0.532137",
"0.532137",
"0.531613",
"0.53122795",
"0.5304745",
"0.529658",
"0.5289909",
"0.52882886",
"0.5283571",
"0.5275629",
"0.5275206",
"0.52744514",
"0.5269542",
"0.5249899",
"0.52475715",
"0.52421606",
"0.52351534",
"0.52345616",
"0.52330786",
"0.52330786",
"0.52306944",
"0.5227183",
"0.52233577",
"0.5222905",
"0.52204937",
"0.5219813",
"0.5213527",
"0.5213094",
"0.5204568",
"0.5198176",
"0.5189073",
"0.51827705",
"0.51816314",
"0.5181315",
"0.5175759",
"0.5172787",
"0.51717335",
"0.51635224",
"0.5161388",
"0.514346",
"0.514346",
"0.5142336",
"0.51401263",
"0.5135007",
"0.5131889",
"0.51203173",
"0.5119602",
"0.5115788",
"0.5113096",
"0.5104394",
"0.51019645",
"0.510129",
"0.509797"
] | 0.0 | -1 |
end register() Processes this sniff, when one of its tokens is encountered. | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$previousOpenTag = $phpcsFile->findPrevious(array(T_OPEN_TAG), ($stackPtr - 1));
if ($previousOpenTag !== false) {
return;
}
$tokens = $phpcsFile->getTokens();
$tokenLimit = count($tokens);
$tokenCount = 0;
for (; $tokenCount < $tokenLimit; $tokenCount++) {
$string = $tokens[$tokenCount]['content'];
if (! $this->es_latin1($string)) {
$error = "[Archivo#codificacion] No está permitidas cadenas de texto en una codificación distinta a LATIN1 (iso88591)";
$phpcsFile->addError($error, $tokenCount);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register() {\n\t\t// Nothing to do here, we're after the (de)activation hook.\n\t}",
"public function register()\n\t{\n\t\t// @noop\n\t}",
"abstract public function register ( );",
"abstract public function register();",
"abstract public function register();",
"abstract public function register();",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t//\n\t}",
"public function register()\n\t{\n\t\t\n\t}",
"public function register()\r\n\t{\r\n\r\n\t}",
"public function register()\r\n\t{\r\n\r\n\t}",
"public function register()\r\n\t{\r\n\r\n\t}",
"public function register() {\n\t\t//\n\t}",
"public function register() {\n\t\t//\n\t}",
"public function register() {\n\t\t//\n\t}",
"public function register()\n\t{\n //\n\t}",
"public function register()\n\t{\n\t}",
"public function register()\n\t{\n\t}",
"public function register()\n\t{\n\t}",
"public function register()\n\t{\n\t}",
"protected static function register() {}",
"public function _register()\n {\n }",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register()\r\n {\r\n //\r\n\t}",
"public function register(): void\n {\n }",
"public function register(): void\n {\n }",
"public function register(): void\n {\n }",
"public function register(): void\n {\n }",
"public function register(): void\n {\n }",
"public function register()\n {\n $this->registerZmop();\n }",
"public function register(): void;",
"public function register()\n {\n\t\t\t//\n }",
"public function register()\n\t{\n\n\t}",
"public function register()\n\t{\n\n\t}",
"public function register()\n\t{\n\n\t}",
"public function register()\n\t{\n\n\t}",
"public function register(){}",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n //\n }",
"public function register(): void\n {\n\n }",
"public function register() {}",
"public function register(){\n\t\t$this->registerOptimusAsAlias();\n\t\t$this->registerCommand();\n\t}",
"public function register()\n { }",
"public function register()\n {\n // Nothing is registered at this time\n }",
"public function register()\n {\n // Nothing is registered at this time\n }",
"public function register()\r\n {\r\n //\r\n }",
"public function register()\r\n {\r\n //\r\n }",
"public function register()\r\n {\r\n //\r\n }",
"public function register()\r\n {\r\n //\r\n }",
"public function register()\n {\n //\n\t\t\n }",
"public function register()\n {\n $this->registerFinite();\n }",
"public function register()\n {\n }",
"public function register()\r\n {\r\n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n \n }",
"public function register()\n {\n \n }",
"public function register()\n {\n $this->assignment_tokens = \\Dekode\\GravityForms\\Vendor\\PHP_CodeSniffer\\Util\\Tokens::$assignmentTokens;\n unset($this->assignment_tokens[\\T_DOUBLE_ARROW]);\n $starters = \\Dekode\\GravityForms\\Vendor\\PHP_CodeSniffer\\Util\\Tokens::$booleanOperators;\n $starters[\\Dekode\\GravityForms\\Vendor\\T_SEMICOLON] = \\Dekode\\GravityForms\\Vendor\\T_SEMICOLON;\n $starters[\\Dekode\\GravityForms\\Vendor\\T_OPEN_PARENTHESIS] = \\Dekode\\GravityForms\\Vendor\\T_OPEN_PARENTHESIS;\n $starters[\\Dekode\\GravityForms\\Vendor\\T_INLINE_ELSE] = \\Dekode\\GravityForms\\Vendor\\T_INLINE_ELSE;\n $this->condition_start_tokens = $starters;\n return array(\\T_IF, \\T_ELSEIF, \\T_FOR, \\T_SWITCH, \\T_CASE, \\T_WHILE, \\Dekode\\GravityForms\\Vendor\\T_INLINE_THEN);\n }",
"public function register()\n {\n $tokens = parent::register();\n $tokens[] = T_ECHO;\n return $tokens;\n\n }",
"public function register()\r\n {\r\n \r\n }",
"public function register() {\n\t}",
"public function register() {\n //\n }",
"public function register()\n { \n \n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n //\n }",
"public function register()\n {\n //\n }"
] | [
"0.6339625",
"0.6269645",
"0.6247827",
"0.6196842",
"0.6196842",
"0.6196842",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.61084336",
"0.6104712",
"0.6102213",
"0.6102213",
"0.6102213",
"0.60836416",
"0.60836416",
"0.60836416",
"0.6047151",
"0.60437787",
"0.60437787",
"0.60437787",
"0.60437787",
"0.60290015",
"0.6009898",
"0.6009662",
"0.6009662",
"0.6009662",
"0.6009662",
"0.6009662",
"0.6009662",
"0.6009662",
"0.6009662",
"0.60063446",
"0.59934473",
"0.59934473",
"0.59934473",
"0.59934473",
"0.59934473",
"0.59917647",
"0.5982151",
"0.5972188",
"0.59713525",
"0.59713525",
"0.59713525",
"0.59713525",
"0.59389824",
"0.593185",
"0.593185",
"0.593185",
"0.593185",
"0.593185",
"0.5911503",
"0.58995324",
"0.58948606",
"0.58842975",
"0.5863758",
"0.5863758",
"0.5852466",
"0.5852466",
"0.5852466",
"0.5852466",
"0.5839049",
"0.58373135",
"0.58222914",
"0.5821764",
"0.581502",
"0.58143955",
"0.58143955",
"0.581163",
"0.581163",
"0.58056056",
"0.58014745",
"0.57965857",
"0.5785191",
"0.5742836",
"0.57348377",
"0.5729226",
"0.5729226",
"0.5729226",
"0.5729226",
"0.5729226",
"0.5729226"
] | 0.0 | -1 |
Convert an array of data into display options. | public static function from(array $data): QuoteEmbedDisplayOptions {
return new QuoteEmbedDisplayOptions(
$data['showUserLabel'] ?? false,
$data['showCompactUserInfo'] ?? false,
$data['showDiscussionLink'] ?? false,
$data['showPostLink'] ?? false,
$data['showCategoryLink'] ?? false,
$data['renderFullContent'] ?? false,
$data['expandByDefault'] ?? false
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function display(array $data)\n {\n $this->option('json') ? $this->displayJson($data) : $this->displayForCli($data);\n }",
"function formatData($data) {\n\t$out = '<dl>';\n\tforeach ($data as $key => $value) {\n\t\t$out.= '<dt>'.$key.'</dt><dd>'.(is_array($value)? '': htmlspecialchars($value)).'</dd>';\n\t}\n\treturn $out.'</dl>';\n}",
"public function renderData(array $data)\n\t{\n\t\treturn $this->_format($this->_print($data));\n\t}",
"function bi_options_column($arr = array()){\r\n\t$arr_option = bi_options(array(\r\n\t\t\"chartBottomMargin\" => \"25\",\r\n\t\t\"chartTopMargin\" => \"50\",\r\n\t\t\"showLabels\" => \"1\",\r\n\t\t\"showLegend\" => \"1\",\r\n\t\t\"showValues\" => \"1\",\r\n\t\t\"exportEnabled\" => \"1\"\r\n\t));\r\n\tforeach($arr as $i => $val){\r\n\t\t$arr_option[$i] = $val;\r\n\t}\r\n\treturn $arr_option;\r\n}",
"public static function formatOptions(array ...$data): string\n {\n $htmlOptions = [];\n\n foreach (array_merge(...$data) as $attribute => $value) {\n $htmlOptions[] = $attribute . '=\"' . $value . '\"';\n }\n\n return implode(' ', $htmlOptions);\n }",
"public function formatData(array $data): array\n {\n return Arr::only($data, [\n 'sku',\n 'title',\n 'description',\n 'price',\n 'promotional_price',\n ]);\n }",
"public function exchangeArray($data)\n\t{\n\t\t if (is_array($data))\n\t\t {\n\t\t $this->setOptions($data);\n\t\t }\n\t}",
"public function exchangeArray($data)\n\t{\n\t\t if (is_array($data))\n\t\t {\n\t\t $this->setOptions($data);\n\t\t }\n\t}",
"function opt_2_html($arr) {\n\t$r = array();\n\tforeach($arr AS $key=>$value) {\n\t\t$r[] = sechoe('%s=\"%s\"',$key,$value);\n\t}\n\treturn join(' ', $r);\n}",
"public function setDisplay(array $display);",
"protected function RenderArray()\n {\n if ($this->m_QueryONRender && !$this->m_ActiveRecord && $this->m_DataObjName) {\n if (!$this->_run_search($resultRecords, $this->m_ClearSearchRule))\n return $this->ProcessDataObjError($ok);\n $this->UpdateActiveRecord($resultRecords[0]);\n }\n\n $columns = $this->m_RecordRow->RenderColumn();\n foreach($columns as $key=>$val) {\n $fields[$key][\"label\"] = $val;\n $fields[$key][\"required\"] = $this->GetControl($key)->m_Required;\n $fields[$key][\"description\"] = $this->GetControl($key)->m_Description;\n $fields[$key][\"value\"] = $this->GetControl($key)->m_Value;\t \n }\n\n $controls = $this->m_RecordRow->Render();\n if ($this->CanShowData()) {\n foreach($controls as $key=>$val) {\n $fields[$key][\"control\"] = $val;\n }\n }\n return $fields;\n }",
"public function query_result_ready_for_display($data){\n if($data != null && !empty($data)){\n foreach($data as &$row){\n $was_object = false;\n if(is_object($row)){\n $was_object = true;\n $row = json_decode(json_encode($row),true);\n }\n foreach($row as &$cell){\n if(is_array($cell)){\n $cell = $this->str_array_ready_for_display($cell);\n }else\n $cell = htmlspecialchars(stripslashes(trim($cell)));\n }\n if($was_object){\n $row = json_decode(json_encode($row));\n }\n }\n }\n\n return $data;\n }",
"public function show_options( array $opts ) : void {\t\n\t\t$i = -1;\n\t\twhile( ($i++) < sizeof( $opts ) - 1 ){\n\t\t\tif( $i == 1 )\n\t\t\t\techo \"<br><br>\";\n\t\t\tforeach( $opts[ $i ] as $optn => $optv ){\n\t\t\t\techo \"<span style='position: absolute;'>\".$optn.\" -> \".$optv.\"</span><br>\";\n\t\t\t}\n\t\t}\n\t}",
"public function display_field($data)\n\t\t{\n\t\t\t\t\t\t\n\t\t\t$r = '';\n\t\t\t$selected_entries = array();\n\t\t\t\n\t\t\tif(!is_array($data))\n\t\t\t{\n\t\t\t\t$data = explode(\"|\", $data);\n\t\t\t}\n\t\t\t\n\t\t\t// get our required js and css\n\t\t\t// @todo move this to the themes folder\n\n\t\t\t// are we displaying this already?\n\t\t\tif (! isset($this->cache['the_selectatron_displayed']))\n\t\t\t{\n\t\t\t\t$asset_path = $this->EE->config->item('theme_folder_url').'third_party/selectatron_assets/';\n\t\t\t\t$this->EE->cp->add_to_head('<link type=\"text/css\" href=\"'.$asset_path.'css/selectatron.css\" rel=\"stylesheet\" />');\n\t\t\t\t$this->EE->cp->add_to_head('<script type=\"text/javascript\" src=\"'.$asset_path.'js/jquery.bsmselect.js\"></script>');\n\t\t\t\t$this->EE->cp->add_to_head('<script type=\"text/javascript\" src=\"'.$asset_path.'js/selectatron.js\"></script>');\n\t\t\t\t// lets not repeat ourselves\n\t\t\t\t$this->cache['the_selectatron_displayed'] = TRUE;\n\t\t\t}\n\t\t\t\n\t\t\t// activate the bsmSelect!\n\t\t\t$this->EE->javascript->output(\"\n\t\t\t$(document).ready(function() {\n\t\t\t\t$('#field_id_\".$this->field_id.\"').bsmSelect({\n\t\t\t addItemTarget: 'bottom',\n\t\t\t title: '\".lang('please_select_an_entry').\"',\n\t\t\t animate: true,\n\t\t\t removeLabel: 'x',\n\t\t\t listClass: 'selectatron\".$this->field_id.\"',\n\t\t\t // highlight: true,\n\t\t\t sortable: true\n\t\t\t });\n\t\t\t});\n\t\t\t\");\n\t\t\t\n\t\t\t$selected_channels = $this->settings['channel_preferences'];\n\t\t\t\n\t\t\t// fetch our entries\n\t\t\t$entry_query = $this->EE->db->query(\"SELECT\n\t\t\texp_channel_titles.entry_id AS entry_id,\n\t\t\texp_channel_titles.title AS entry_title,\n\t\t\texp_channels.channel_title AS channel_title, \n\t\t\texp_channels.channel_id AS channel_id\n\t\t\tFROM exp_channel_titles\n\t\t\tINNER JOIN exp_channels\n\t\t\tON exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\tWHERE exp_channels.channel_id IN (\".$selected_channels.\")\n\t\t\tORDER BY exp_channels.channel_id ASC , exp_channel_titles.title ASC \");\n\n\t\t\tif($entry_query->num_rows == 0)\n\t\t\t{\n\t\t\t\treturn lang('no_entries_found');\n\t\t\t}\n\t\t\t\n\t\t\t$r .= \"<select id='field_id_\".$this->field_id.\"' multiple='multiple' name='field_id_\".$this->field_id.\"[]'>\";\n\t\t\t\n\t\t\t$channel = null;\n\t\t\t$selected_options = '';\n\t\t\t\n\t\t\tforeach ($entry_query->result_array() as $entry)\n\t\t\t{\n\t\t\t\tif($channel != $entry['channel_title'])\n\t\t\t\t{\n\t\t\t\t\t// if this is not the first channel\n\t\t\t\t\tif($channel != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t// close the optgroup\n\t\t\t\t\t\t$r .= \"</optgroup>\";\n\t\t\t\t\t}\n\t\t\t\t\t// set the current channel\n\t\t\t\t\t$channel = $entry['channel_title'];\n\t\t\t\t\t// open another opt channel\n\t\t\t\t\t$r .= \"<optgroup label='\" . $entry['channel_title'] .\"'> \\n\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$key = array_search($entry['entry_id'], $data);\n\t\t\t\t\n\t\t\t\t$selected = (in_array($entry['entry_id'], $data)) ? \" selected='selected' rel='\".$key.\"' \" : \"\";\n\t\t\t\t\n\t\t\t\tif(!$selected)\n\t\t\t\t{\n\t\t\t\t\t// just output the option\n\t\t\t\t\t$r .= \"<option value='\" . $entry['entry_id'] . \"'> \" . $entry['entry_title'] . \"</option> \\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// store the option as an array for output at the end\n\t\t\t\t\t$selected_options[$key] = \"<option value='\" . $entry['entry_id'] . \"'\" . $selected . \" > \" . $entry['entry_title'] . \"</option> \\n\";\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t\t// add our selected on the end, sorted correctly\n\t\t\t// bugfix/patch for now, might revisit for a better solution\n\t\t\tif(is_array($selected_options))\n\t\t\t{\n\t\t\t\t$r .= \"<optgroup label='\" . lang('selected_entries') .\"'>\\n\";\n\t\t\t\tksort($selected_options);\n\t\t\t\tforeach($selected_options as $option)\n\t\t\t\t{\n\t\t\t\t\t$r .= $option;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$r .= \"</select>\";\n\t\t\t\n\t\t\treturn $r;\n\n\t\t}",
"function get_select_options($select_data_array, $value_field, $display_field, $selected, $show_instr='Y', $instr_txt='Select')\n{\t\n\t$drop_HTML = \"\";\n\t#Determine whether to show the instruction option\n\tif($show_instr == 'Y'){\n\t\t$drop_HTML = \"<option value='' \";\n\t\t# Select by default if there is no selected option\n\t\tif($selected == '')\n\t\t{\n\t\t\t$drop_HTML .= \" selected\";\n\t\t}\n\t\n\t\t$drop_HTML .= \">- \".$instr_txt.\" -</option>\";\n\t}\n\t\n\tforeach($select_data_array AS $data_row)\n\t{\n\t\t$drop_HTML .= \" <option value='\".addslashes($data_row[$value_field]).\"' \";\n\t\t\n\t\t# Show as selected if value matches the passed value\n\t\t#check if passed value is an array\t\t\n if(is_array($selected)){\n \tif(in_array($data_row[$value_field], $selected)) $drop_HTML .= \" selected\";\n \n\t\t}elseif(!is_array($selected)){\n \tif($selected == $data_row[$value_field]) $drop_HTML .= \" selected\";\n }\t\t\n\t\t\t\t\n\t\t$display_array = array();\n\t\t# Display all data given based on whether what is passed is an array\n\t\tif(is_array($display_field))\n\t\t{\n\t\t\t$drop_HTML .= \">\";\n\t\t\t\n\t\t\tforeach($display_field AS $display)\n\t\t\t{\n\t\t\t\tarray_push($display_array, $data_row[$display]);\n\t\t\t}\n\t\t\t\n\t\t\t$drop_HTML .= implode(' - ', $display_array).\"</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$drop_HTML .= \">\".$data_row[$display_field].\"</option>\";\n\t\t}\n\t}\n\t\n\treturn $drop_HTML;\n}",
"public function formatData(array $data)\n {\n $this->data = json_encode($data);\n }",
"public function render($data, $options = array()) {\n\t\tif (!$data) {\n\t\t\treturn $this->Html->tag('p', __('There is no data to show.', true), array('class' => 'mh-message mh-alert'));\n\t\t}\n\t\t\n\t\tif (empty($options['columns'])) {\n\t\t\t$options['columns'] = array();\n\t\t}\n\n\t\t// Set table Options\n\t\tif(!empty($options['table'])) {\n\t\t\t$this->tableOptions = array_merge($this->tableOptions, $options['table']);\n\t\t\t$this->tableOptions['attr']['class'] = $this->tableOptions['class'];\n\t\t\t$this->tableOptions['attr']['id'] = $this->tableOptions['id'];\n\t\t\tunset($options['table']);\n\t\t}\n\t\t// Get default model \n\t\t$this->defaultModel = $this->params['models'][0];\n\t\tif (!empty($this->tableOptions['model'])) {\n\t\t\t$this->defaultModel = $this->tableOptions['model'];\n\t\t}\n\t\t\n\t\tif (!isset($this->Paginator->params['paging'])) {\n\t\t\t$this->Paginator->params['paging'] = array(\n\t\t\t\t$this->defaultModel => array(\n\t\t\t\t\t'defaults' => array(\n\t\t\t\t\t\t'page' => 1,\n\t\t\t\t\t\t'limit' => null\n\t\t\t\t\t),\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t'page' => 1,\n\t\t\t\t\t\t'limit' => null\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t\n\t\t\n\t\t\t\t\n\t\t$this->setFields($data);\n\t\t// Set and normalize data for table\n\t\t$this->normalize($data);\n\t\tif (isset($options['actions'])) {\n\t\t\t$options['columns']['actions']['actions'] = $options['actions'];\n\t\t\t$options['columns']['actions']['type'] = 'actions';\n\t\t}\n\t\tif (!empty($this->tableOptions['selection'])) {\n\t\t\techo $this->Html->script('/ui/js/selection', array('inline' => false));\n\t\t\t$selectionColumn = array('selection' => array('type' => 'selection'));\n\t\t\t$options['columns'] = array_merge($selectionColumn, $options['columns']);\n\t\t}\n\t\t// Set and normalize visible columns\n\t\t$this->setColumns($options['columns']);\n\t\t$code = $this->headers();\n\t\t$code .= $this->body();\n\t\t$code = $this->Html->tag('table', $code, $this->tableOptions['attr']);\n\t\t\n\t\tif (!empty($this->tableOptions['selection'])) {\n\t\t\t$code = $this->_buildSelectionForm($code);\n\t\t}\n\t\treturn $code;\n\t}",
"public static function format($info_array, $data_type)\n {\n }",
"protected function outputUnorderedList(array $data)\n {\n foreach ($data as $value) {\n $this->outputLine(' - ' . $value);\n }\n }",
"function display_choice($array)\n{\n\tglobal $config;\n\t\n\tswitch ($array['type']) {\n\tcase 'text':\n\t\techo '<input type=\"text\" id=\"' . $array['name'] . '\" name=\"' . $array['name'] . '\" value=\"' . $config[$array['name']] . '\" />';\n\t\tbreak;\n\tcase 'select':\n\t\techo '<select id=\"' . $array['name'] . '\" name=\"' . $array['name'] . '\" onchange=\"' . $array['script'] . '\">';\n\t\tforeach ($array['options'] as $option) {\n\t\t\techo \"<option label='\" . $option . \"' value='\" . $option . \"' \";\n\t\t\tif ($option == $config[$array['name']])\n\t\t\t\techo \"selected='selected'\";\n\t\t\techo \">\" . $option . \"</option>\\n\";\n\t\t}\n\t\techo '</select>';\n\t\tbreak;\n\n\tcase 'array':\n\t\techo '<input type=\"text\" name=\"' . $array['name'] . '\" value=\"' . implode(',',$config[$array['name']]) . '\" id=\"' . $array['name'] . '\" />';\n\t\tbreak;\n\n\tcase 'boolean':\n\t\techo '<select id=\"' . $array['name'] . '\" name=\"' . $array['name'] . '\" onchange=\"' . $array['script'] . '\">';\n\t\techo \"<option label='TRUE' value='TRUE' \";\n\t\tif ($config[$array['name']])\n\t\t\techo \"selected='selected'\";\n\t\techo \">TRUE</option>\\n\";\n\t\techo \"<option label='FALSE' value='FALSE' \";\n\t\tif (!$config[$array['name']])\n\t\t\techo \"selected='selected'\";\n\t\techo \">FALSE</option>\\n\";\t\t\n\t\techo '</select>';\n\t\tbreak;\n\t\t\n\tdefault:\n\t\tbreak;\n\t}\n}",
"function select_convert($arr) {\n\t$result = array();\n\tforeach($arr as $k => $v) {\n\t\t$result[] = array(\"fid\" => $k, \"fcaption\" => $v);\n\t}\n\treturn $result;\n}",
"public function render($data)\n {\n $result = array();\n $sizes = array();\n foreach($data as $i => $row)\n {\n foreach($this->columns as $c)\n {\n $sizes[$c] = max(mb_strlen($row[$c]), mb_strlen($c), isset($sizes[$c]) ? $sizes[$c] : 8);\n }\n }\n\n // render headers\n $this->renderSeparatorLine($sizes);\n foreach($this->columns as $c)\n {\n $size = $sizes[$c];\n printf(' %-'.$size.'s |', $c);\n }\n echo \"\\n\";\n $this->renderSeparatorLine($sizes);\n\n foreach($data as $i => $row)\n {\n foreach($this->columns as $c)\n {\n $item = $row[$c];\n $size = $sizes[$c];\n printf(' %-'.$size.'s |', $item);\n }\n echo \"\\n\";\n }\n $this->renderSeparatorLine($sizes);\n }",
"function display2DArray($array,$printoptionsflag){\n\t\tif($array==null){\n\t\t\tprint \"No results were found!\";\n\t\t} else {\n\t\t\tprint \"<table class=\\\"clients\\\"><tr>\";\n\t\t\t$first = $array[0];\n\t\t\t$keys = array_keys($first); //Return the keys of the array, use first element;\n\t\t\tfor ($i=0;$i<count($keys);$i++){\n\t\t\t\tprint \"<td>\".$keys[$i].\"</td>\\n\";\n\t\t\t}\n\t\t\tprint \"</tr>\";\n\t\t\tfor ($j=0;$j<count($array);$j++){\n\t\t\t\tprint \"<tr>\";\n\t\t\t\tfor ($i=0;$i<(count($keys));$i++){\n\t\t\t\t\tprint \"<td>\".$array[$j][$keys[$i]].\"</td>\\n\";\n\t\t\t\t}\n\t\t\t\tif ($printoptionsflag){\n\t\t\t\t\t$this->printOptions($array[$j]['Client_ID']);\n\t\t\t\t}\n\t\t\t\tprint \"</tr>\\n\";\n\t\t\t}\n\t\t\tprint \"</table>\\n\";\n\t\t}\n\t}",
"protected function renderArray() {}",
"private function formatArrayValues(array $data): string\n {\n return implode(\n ', ',\n array_map(\n function ($value) {\n return '\"'.$value.'\"';\n },\n $data\n )\n );\n }",
"protected function formatData(array $data): array\n {\n $qty = abs($data['qty'] ?? 1);\n\n return [\n 'qty' => $qty,\n 'description' => $data['description'] ?? 'Inventory update',\n 'type' => $data['type'] ?? 'increase',\n ];\n }",
"public function options($array = true)\n {\n\n $data = json_decode($this->session->get('izime.options'), $array);\n $numItems = count($data);\n $i = 0;\n $qut=\"'\";\n $fcode=\"\";\n foreach ($data as $key => $value) {\n\n if(++$i === $numItems) {\n if(gettype( $value == \"string\" ))\n $fcode.= $key. \":\". $qut . $value. $qut ;\n else\n $fcode.= $key. \":\". $value ;\n\n }else {\n\n if(gettype( $value == \"string\" ))\n $fcode.= $key. \":\" . $qut . $value . $qut . \",\";\n else\n $fcode.= $key. \":\" . $value . \",\";\n\n }\n\n }\n\n return $fcode ;\n\n }",
"protected abstract function formatArrayValue(array $value);",
"public function processData(array $data, array $options = []);",
"public function display_data() {\n return format_text($this->data, $this->dataformat, array('overflowdiv' => true));\n }",
"function displayConfig($arrayType, $type, $idName, $arrayOption = null) {\n $str = \"<select size='1' class='cbo' name='$idName' id='$idName'><option value=''>-- \" . $arrayOption[\"firstText\"] . \" --</option>\";\n if (is_array($arrayType))\n foreach ($arrayType as $key => $value) {\n $str .= \"<option value='\" . $key . \"' \" . (($type == $key) ? \"selected\" : \"\") . \">\" . $value . \"</option>\";\n }\n $str .= \"</select>\";\n return $str;\n }",
"function get_select_options($select_data_array, $value_field, $display_field, $selected, $show_instr='Y', $instr_txt='Select One')\n{\n $drop_HTML = \"\";\n #Determine whether to show the instruction option\n if($show_instr == 'Y'){\n $drop_HTML = \"<option value='' \";\n # Select by default if there is no selected option\n if($selected == '')\n {\n $drop_HTML .= \" selected\";\n }\n\n $drop_HTML .= \">- \".$instr_txt.\" -</option>\";\n }\n\n foreach($select_data_array AS $data_row)\n {\n $drop_HTML .= \" <option value='\".addslashes($data_row[$value_field]).\"' \";\n\n # Show as selected if value matches the passed value\n #check if passed value is an array\n if(is_array($selected)){\n if(in_array($data_row[$value_field], $selected)) $drop_HTML .= \" selected\";\n\n }elseif(!is_array($selected)){\n if($selected == $data_row[$value_field]) $drop_HTML .= \" selected\";\n }\n\n $display_array = array();\n # Display all data given based on whether what is passed is an array\n if(is_array($display_field))\n {\n $drop_HTML .= \">\";\n\n foreach($display_field AS $display)\n {\n array_push($display_array, $data_row[$display]);\n }\n\n $drop_HTML .= implode(' - ', $display_array).\"</option>\";\n }\n else\n {\n $drop_HTML .= \">\".$data_row[$display_field].\"</option>\";\n }\n }\n\n return $drop_HTML;\n}",
"public function get_stLight_options($data_options);",
"public function renderFromData(PhpRenderer $view, array $data, array $options = [])\n {\n if (!$data['collection']) return '';\n\n /** @var ItemSetRepresentation $canvasRepresentation */\n $collectionRepresentation = $this->api->read('item_sets', $data['collection'])->getContent();\n if (!$collectionRepresentation) return '';\n $manifestsToShow = $data['manifestsToShow'] ?? 4;\n\n // @todo original ids\n $collection = $this->collectionBuilder->buildResource(\n $collectionRepresentation,\n false,\n 1,\n (int)$manifestsToShow,\n 1\n );\n\n $vm = new ViewModel([\n 'manifestsToShow' => $data['manifestsToShow'] ?? 4,\n 'collection' => $collection->getCollection(),\n 'router' => $this->router,\n 'resource' => $collection,\n ]);\n\n $vm->setTemplate('iiif-storage/media/collection-snippet');\n return $this->twig->render($vm);\n }",
"private function arrayToPrint()\n\t{\n\t\t$this->view->addToReplace($this->langArr);\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->arrRender['CONTENT'] = $this->view\n\t\t\t->setTemplateFile('employeeedit')->renderFile();\n\t\t$this->view->addToReplace($this->arrRender);\n\t\t$this->view->setTemplateFile('index')->templateRender();\n\t}",
"private function _output_options_select($arr) {\n\t\t$output = '';\n\t\tforeach ($arr as $val => $opt) :\n\t\t\t$output .= '\n\t\t\t\t\t\t<option value=\"' . $val . '\">' . $opt . '</option>';\n\t\tendforeach;\n\t\treturn $output;\n\t}",
"private function set_display_data( $data ) {\n\t\t$this->display_data = $data;\n\t}",
"public function fromArray(array $data);",
"public function fromArray(array $data);",
"public function FormatedSelectCustomizadoDetalle($array){\n\n $comprobante_id2 = '';\n $description = '';\n $i = 0;\n $contador = 1;\n foreach ($array as $value){\n if(($value[\"comprobante_id\"] != $comprobante_id2) && ($comprobante_id2 != '')){\n //le quito la ulima coma\n $result[$i]['descripcion'] = (isset($result[$i]['descripcion'])) ? substr($result[$i]['descripcion'], 0, -1) : '';\n \n $i++;\n $description = '';\n } \n \n $description .= $value['descripcion'].\",\";\n $result[$i]['comprobante_id'] = $value['comprobante_id'];\n $result[$i]['cli_razon_social'] = $value['cli_razon_social'];\n $result[$i]['cli_ruc'] = $value['cli_ruc'];\n $result[$i]['tipo_documento'] = $value['tipo_documento'];\n $result[$i]['descripcion'] = $description;\n $result[$i]['serie'] = $value['serie'];\n $result[$i]['numero'] = $value['numero'];\n $result[$i]['fecha_de_emision'] = $value['fecha_de_emision'];\n $result[$i]['fecha_de_vencimiento'] = $value['fecha_de_vencimiento'];\n $result[$i]['total_gravada'] = $value['total_gravada'];\n $result[$i]['total_igv'] = $value['total_igv'];\n $result[$i]['total_a_pagar'] = $value['total_a_pagar'];\n $result[$i]['total_detraccion'] = $value['total_detraccion'];\n $result[$i]['tipo_de_cambio'] = $value['tipo_de_cambio'];\n $result[$i]['enviado_sunat'] = $value['enviado_sunat'];\n $result[$i]['estado_sunat'] = $value['estado_sunat'];\n $result[$i]['enviado_cliente'] = $value['enviado_cliente'];\n $result[$i]['enviado_equipo'] = $value['enviado_equipo'];\n $result[$i]['tipo_documento'] = $value['tipo_documento'];\n $result[$i]['empresa'] = $value['empresa'];\n $result[$i]['abreviado'] = $value['abreviado'];\n $result[$i]['moneda'] = $value['moneda'];\n $result[$i]['simbolo'] = $value['simbolo']; \n \n $comprobante_id2 = $value[\"comprobante_id\"];\n \n //solamente para quitar la ultima coma.\n if(count($array) == $contador){\n $result[$i]['descripcion'] = (isset($result[$i]['descripcion'])) ? substr($result[$i]['descripcion'], 0, -1) : '';\n }\n $contador ++;\n }\n return $result;\n }",
"public function format(array $record);",
"protected function initData()\n {\n foreach (['data', 'uploads'] as $option) {\n $value = $this->option($option);\n if ($value) {\n $this->info[$option] = explode(',', $value);\n }\n }\n }",
"public function grid_display_settings($data)\r\n\t{\r\n\t\t$return = array();\r\n\t\t$display_field_type_selected = (!isset($data['display_field_type']) || $data['display_field_type'] == '') ? FALSE : $data['display_field_type'];\r\n\t\t$return[] = $this->grid_dropdown_row(lang('display_type'), 'display_field_type', $this->field_types, $display_field_type_selected);\r\n\t\t\r\n\t\t$field_max_length = (!isset($data['field_max_length']) || $data['field_max_length'] == '') ? 128 : $data['field_max_length'];\r\n\t\t$field_options = array(\r\n\t\t\t'id'=>'field_max_length',\r\n\t\t\t'name'=>'field_max_length', \r\n\t\t\t'size'=>4,\r\n\t\t\t'value'=>$field_max_length, \r\n\t\t\t'class' => 'grid_input_text_small'\r\n\t\t);\r\n\t\t$return[] = $this->grid_settings_row(lang('field_max_length'), form_input($field_options));\r\n\t\t\r\n\t\t$member_groups = $this->EE->securitee_settings->get_member_groups();\r\n\t\t$decrypt_access_selected = (isset($data['decrypt_access']) && $data['decrypt_access'] != '') ? $data['decrypt_access'] : '******';\r\n\t\t$return[] = $this->grid_dropdown_row(lang('decrypt_access'), 'decrypt_access', $member_groups, $decrypt_access_selected, TRUE);\r\n\t\t\r\n\t\t$hidden_text = (!isset($data['hidden_text']) || $data['hidden_text'] == '') ? '******' : $data['hidden_text'];\r\n\t\t$field_options = array(\r\n\t\t\t\t'id'=>'hidden_text',\r\n\t\t\t\t'name'=>'hidden_text',\r\n\t\t\t\t'size'=>4,\r\n\t\t\t\t'value'=>$hidden_text,\r\n\t\t\t\t'class' => 'grid_input_text_small'\r\n\t\t);\t\t\r\n\t\t\r\n\t\t$return[] = $this->grid_settings_row(lang('hidden_text'), form_input($field_options));\r\n\t\t\t\t\r\n\t\treturn $return;\r\n\t}",
"function inkpro_add_blog_display_options( $options ) {\r\n\r\n\t$new_options = array(\r\n\t\t'standard' => esc_html__( 'Standard', 'inkpro' ),\r\n\t\t'grid' => esc_html__( 'Square grid', 'inkpro' ),\r\n\t\t'grid3' => esc_html__( 'Portrait grid', 'inkpro' ),\r\n\t\t'column' => esc_html__( 'Columns', 'inkpro' ),\r\n\t\t'masonry' => esc_html__( 'Masonry', 'inkpro' ),\r\n\t\t'metro' => esc_html__( 'Metro', 'inkpro' ),\r\n\t\t'medium-image' => esc_html__( 'Medium image', 'inkpro' ),\r\n\t\t'photo' => esc_html__( 'Photo', 'inkpro' ),\r\n\t);\r\n\r\n\t$options = array_merge( $new_options, $options );\r\n\t\r\n\treturn $options;\r\n}",
"protected function displayJson(array $data)\n {\n $this->output->writeln(json_encode($data));\n }",
"function wpeds_return_data_as_array($args) {\r\n\r\nglobal $wpeds_options,$zv_wpeds_dateformat_db,$zv_wpeds_numberformat_db;\r\n\r\n$wpeds_data = get_option('wpeds_data');\r\nif (empty($wpeds_data) || !$wpeds_data || count($wpeds_data) == 0) { return array(); }\r\n\r\n$allowedvariable = array('url','gettype','autoformat');\r\n\r\nif (!is_array($args)) { // the argument is string\r\n if ($args == '' || !$args || $args==null) { return; }\r\n $queryarray = wpeds_tt_parse_args($args,$allowedvariable);\r\n} else {\r\n $queryarray = wpeds_tt_remove_invalid_args($args,$allowedvariable);\r\n}\r\n\r\nif (empty($queryarray)) { return array(); }\r\n\r\n\r\n$autoformat = true;\r\nif (isset($queryarray['autoformat'])) {\r\n if ($queryarray['autoformat'] == 0 || $queryarray['autoformat'] == 'false') {\r\n $autoformat = false;\r\n }\r\n}\r\n\r\nif ($autoformat) {\r\n $usedateformat = $zv_wpeds_dateformat_db[0];\r\n if (!empty($wpeds_options) && isset($wpeds_options['dateformat']) && $wpeds_options['dateformat']!='') {\r\n if (in_array($wpeds_options['dateformat'],$zv_wpeds_dateformat_db)) {\r\n $usedateformat = $wpeds_options['dateformat'];\r\n }\r\n }\r\n \r\n $usenumberformat = ',';\r\n if (!empty($wpeds_options) && isset($wpeds_options['numberformat']) && $wpeds_options['numberformat']!='') {\r\n if (in_array($wpeds_options['numberformat'],$zv_wpeds_numberformat_db)) {\r\n $usenumberformat = $wpeds_options['numberformat'];\r\n }\r\n }\r\n}\r\n//echo '<pre>';\r\n//var_dump($queryarray);\r\n\r\nif (isset($queryarray['url'])) {//single data\r\n $queryarray['url'] = wpeds_formaturl($queryarray['url']);\r\n if (wpeds_validstaturl($queryarray['url'])) {\r\n if (isset($wpeds_data[$queryarray['url']])) {\r\n unset($wpeds_data[$queryarray['url']]['lastjump']);\r\n unset($wpeds_data[$queryarray['url']]['lastvalues']);\r\n if ($autoformat) { $wpeds_data[$queryarray['url']] = wpeds_apply_format_to_array($wpeds_data[$queryarray['url']],'single',$usenumberformat,$usedateformat); }\r\n return $wpeds_data[$queryarray['url']];\r\n }\r\n }\r\n} else {\r\n\r\n if (isset($queryarray['gettype'])) {//get all data of 1 type\r\n switch ($queryarray['gettype']) {\r\n case 'theme':\r\n foreach ($wpeds_data as $url => $data) {\r\n if (strtolower($data['type']) == 'wordpress theme') {\r\n unset($wpeds_data[$url]['lastjump']);\r\n unset($wpeds_data[$url]['lastvalues']);\r\n $thearray[] = $wpeds_data[$url];\r\n }\r\n }\r\n break;\r\n case 'plugin':\r\n foreach ($wpeds_data as $url => $data) {\r\n if (strtolower($data['type']) == 'wordpress plugin') {\r\n $thearray[] = $wpeds_data[$url];\r\n unset($thearray['lastjump']);\r\n unset($thearray['lastvalues']);\r\n }\r\n }\r\n break;\r\n default:\r\n $thearray = array();\r\n break;\r\n }\r\n if ($autoformat && count($thearray)>0) { $thearray = wpeds_apply_format_to_array($thearray,'multiple',$usenumberformat,$usedateformat); }\r\n return $thearray;\r\n }\r\n}\r\n\r\n}",
"protected function view() {\n global $str;\n\n $data = parent::view();\n // name, inhalt, opt -> rechte, label,tooltip\n $data[] = new d_feld('prod_land', self::getProdLand(), null, 698);\n $data[] = new d_feld('gattung', $str->getStr($this->content['gattung']), null, 579);\n $data[] = new d_feld('prodtech', self::getThisProdTech(), null, 571);\n $data[] = new d_feld('laenge', $this->content['laenge'], null, 580);\n $data[] = new d_feld('fsk', $this->content['fsk'], null, 581);\n $data[] = new d_feld('praedikat', $str->getStr($this->content['praedikat']), null, 582);\n $data[] = new d_feld('bildformat', self::getBildformat(), null, 608);\n $data[] = new d_feld('mediaspezi', self::getThisMediaSpez(), null, 583);\n $data[] = new d_feld('urauff', $this->content['urauffuehr'], null, 584);\n $data[] = new d_feld('regie', self::getRegie(), null, 1000);\n\n return $data;\n }",
"function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}",
"function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}",
"function array_display($array_name)\n{\n $r = '';\n $r .= '<style> table,td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n $r .= '<th>Index/Key</th>';\n $r .= '<th>Value</th>';\n $r .= '</tr>';\n foreach ($array_name as $index => $value) {\n $r .= '<tr>';\n $r .= '<td> '.$index.' </td>';\n if ($index == 'price') {\n $r .= '<td> $'.$value.' </td>';\n $r .= '</tr>';\n } else {\n $r .= '<td>'.$value.' </td>';\n $r .= '</tr>';\n }\n }\n $r .= '</table>';\n\n return $r;\n}",
"protected function displayForCli(array $data)\n {\n $platform = $data['platform'];\n $tables = $data['tables'];\n $views = $data['views'] ?? null;\n\n $this->newLine();\n\n $this->components->twoColumnDetail('<fg=green;options=bold>'.$platform['name'].'</>');\n $this->components->twoColumnDetail('Database', Arr::get($platform['config'], 'database'));\n $this->components->twoColumnDetail('Host', Arr::get($platform['config'], 'host'));\n $this->components->twoColumnDetail('Port', Arr::get($platform['config'], 'port'));\n $this->components->twoColumnDetail('Username', Arr::get($platform['config'], 'username'));\n $this->components->twoColumnDetail('URL', Arr::get($platform['config'], 'url'));\n $this->components->twoColumnDetail('Open Connections', $platform['open_connections']);\n $this->components->twoColumnDetail('Tables', $tables->count());\n\n if ($tableSizeSum = $tables->sum('size')) {\n $this->components->twoColumnDetail('Total Size', number_format($tableSizeSum / 1024 / 1024, 2).'MiB');\n }\n\n $this->newLine();\n\n if ($tables->isNotEmpty()) {\n $this->components->twoColumnDetail('<fg=green;options=bold>Table</>', 'Size (MiB)'.($this->option('counts') ? ' <fg=gray;options=bold>/</> <fg=yellow;options=bold>Rows</>' : ''));\n\n $tables->each(function ($table) {\n if ($tableSize = $table['size']) {\n $tableSize = number_format($tableSize / 1024 / 1024, 2);\n }\n\n $this->components->twoColumnDetail(\n $table['table'].($this->output->isVerbose() ? ' <fg=gray>'.$table['engine'].'</>' : null),\n ($tableSize ? $tableSize : '—').($this->option('counts') ? ' <fg=gray;options=bold>/</> <fg=yellow;options=bold>'.number_format($table['rows']).'</>' : '')\n );\n\n if ($this->output->isVerbose()) {\n if ($table['comment']) {\n $this->components->bulletList([\n $table['comment'],\n ]);\n }\n }\n });\n\n $this->newLine();\n }\n\n if ($views && $views->isNotEmpty()) {\n $this->components->twoColumnDetail('<fg=green;options=bold>View</>', '<fg=green;options=bold>Rows</>');\n\n $views->each(fn ($view) => $this->components->twoColumnDetail($view['view'], number_format($view['rows'])));\n\n $this->newLine();\n }\n }",
"public function formatApplicantArray(array $answers);",
"public function printOptValue($array){\n if(empty($array)){\n print \"<h1>Array is empty!</h1>\";\n return false;\n }\n foreach($array as $key => $value){\n print(\"<option value='$value'>$value</option>\");\n }\n\n }",
"function myShowArray($data)\n{\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n}",
"public static function fromArray(array $data);",
"private function formatData() {\n\t\t// Initialise arr variable\n\t\t$str = array();\n\n\t\t// Step through the fields\n\t\tforeach($this->data as $key => $value){\n\t\t\t// Stick them together as key=value pairs (url encoded)\n\t\t\t$str[] = $key . '=' . urlencode($value);\n\t\t}\n\n\t\t// Implode the arry using & as the glue and store the data\n\t\t$this->curl_str = implode('&', $str);\n\t}",
"public function fromArray(array $data)\n {\n if (! isset($data['name'])) {\n $data['name'] = '__NAME__';\n }\n $markup = sprintf(\n $this->template,\n $data['index'],\n $data['interpreter_id'],\n $data['index'],\n $data['event_id'],\n //$data['index'],\n //$data['name'],\n $data['name']\n );\n return $markup;\n }",
"protected function getAllViewDisplayIds() {\n $types = Views::pluginList();\n $options = [];\n foreach ($types as $key => $type) {\n if ($type['type'] === 'display') {\n $options[str_replace('display:', '', $key)] = $type['title']->render();\n }\n }\n return $options;\n }",
"public function toOptionArray() {\n// $arr = array(1=>'Спиди калкулатор',\n// 2=>'Фиксирана цена',\n// 3=>'Спиди калкулатор + надбавка за обработка');\n// 4=>'Цена от файл');\n \n $arr = array(1=>Mage::helper('core')->__('speedy calculator'),\n 2=>Mage::helper('core')->__('fixed price'),\n 3=>Mage::helper('core')->__('speedy_calc_handling'),\n 4=>Mage::helper('core')->__('table_rate'));\n \n $options = array();\n\n foreach ($arr as $key=>$value) {\n $options[] = array('value' => $key, 'label' => $value);\n }\n\n return $options;\n }",
"function label($array){\n //\n //Get the fields \n $fields= $this->fields->get_array();\n //\n //Ouptut a table\n echo \"<div name='{$this->entity->name}'>\";\n echo $this->header();\n //\n //Loop through the array and display the results in a table \n foreach ($array as $row) {\n //\n //Step through the columns\n foreach($fields as $field){\n //\n //Get the indexes of the field\n $name= is_null($field->alias) ? $field->column->name:$field->alias;\n //\n //Get the field value\n $value = $row[$name];\n \n echo \"<span> $name :<span>$value></span>\"; \n }\n }\n echo \"</div>\"; \n }",
"function bi_options($arr = array()){\r\n\t$arr_option = array(\r\n\t\t\"anchorAlpha\" => \"0\",\r\n\t\t\"animation\" => \"0\",\r\n\t\t\"bgAlpha\" => \"0\",\r\n\t\t\"canvasBgAlpha\" => \"0\",\r\n\t\t\"captionPadding\" => \"30\",\r\n\t\t\"divLineColor\" => \"CCCCCC\",\r\n\t\t\"enableSmartLabels\" => \"1\",\r\n\t\t\"legendBorderAlpha\" => \"0\",\r\n\t\t\"legendShadow\" => \"0\",\r\n\t\t\"lineAlpha\" => \"100\",\r\n\t\t\"lineThickness\" => \"2\",\r\n\t\t\"lineShadow\" => \"0\",\r\n\t\t\"numberPrefix\" => \"R$ \",\r\n\t\t\"paletteColors\" => \"#408DDB,#D63838,#20BA46,#E3E848,#C95FBD,#DBA123,#53D2DB,#B5B5B5,#936EC4,#A9C447,#9C8875,#333333,#EEEEEE\",\r\n\t\t\"plotGradientColor\" => \"\",\r\n\t\t\"showAlternatehGridColor\" => \"0\",\r\n\t\t\"showBorder\" => \"0\",\r\n\t\t\"showCanvasBorder\" => \"0\",\r\n\t\t\"showPlotBorder\" => \"0\",\r\n\t\t\"use3dlighting\" => \"0\",\r\n\t\t\"exportEnabled\" => \"1\"\r\n\t);\r\n\tforeach($arr as $i => $val){\r\n\t\t$arr_option[$i] = $val;\r\n\t}\r\n\treturn $arr_option;\r\n}",
"function _get_data_attrs($array){\n\t\t\t\tif(!function_exists('EVO_get_data_attrs')){\n\t\t\t\t\t$output = '';\n\t\t\t\t\tforeach($array as $key=>$val){\n\t\t\t\t\t\t$output .= 'data-'.$key.'=\"'.$val .'\" ';\n\t\t\t\t\t}\n\t\t\t\t\treturn $output;\n\t\t\t\t}else{\n\t\t\t\t\treturn EVO_get_data_attrs($array);\n\t\t\t\t}\n\t\t\t}",
"static function DisplayArray($array)\r\n {\r\n $depth = 0;\r\n if (is_array($array))\r\n {\r\n echo \"Array (<br />\";\r\n for($i = 0; $i < count($array); $i ++)\r\n {\r\n if (is_array($array[$i]))\r\n {\r\n DisplayInlineArray($array[$i], $depth + 1, $i);\r\n }\r\n else\r\n {\r\n echo \"[\" . $i . \"] => \" . $array[$i];\r\n echo \"<br />\";\r\n $depth = 0;\r\n }\r\n }\r\n echo \")<br />\";\r\n }\r\n else\r\n {\r\n echo \"Variabele is geen array\";\r\n }\r\n }",
"public function exchanegArray($_data)\n {\n $this->page_no = (int) gv('page_no', $_data);\n $this->category_no = (int) gv('category_no', $_data);\n $this->controller_no = (int) gv('controller_no', $_data);\n $this->page_title = (string) gv('page_title', $_data);\n $this->page_uri = (string) gv('page_uri', $_data);\n $this->page_description = (string) gv('page_description', $_data);\n $this->icon = (string) gv('icon', $_data);\n $this->order_no = (int) gv('order_no', $_data);\n $this->use_mobile = (int) gv('use_mobile', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }",
"public function formatData(array $data): array\n {\n $formattedData = [];\n\n foreach ($data as $key => $value) {\n if (is_array($value)) {\n $formattedData[$key] = $this->formatData($value);\n } elseif (is_string($value)) {\n $formattedData[$key] = $this->formatString($value);\n } else {\n $formattedData[$key] = $value;\n }\n }\n\n return $formattedData;\n }",
"public function render()\n {\n $out = [];\n $optionInfo = [];\n\n if ($this->title) {\n $out['title'] = $this->title;\n }\n\n if ($this->description) {\n $out['description'] = $this->description;\n }\n\n if ($this->footer) {\n $out['footer'] = $this->footer;\n }\n\n if ($this->imageUrl) {\n $out['image'] = [\n 'url' => $this->imageUrl,\n 'accessibilityText' => ($this->accessibilityText) ? $this->accessibilityText : 'accessibility text',\n ];\n }\n\n $out['openUrlAction'] = [\n 'url' => $this->openUrlAction,\n ];\n\n return $out;\n }",
"public function render(array $data): string;",
"public function convertArray(array $list){\n $o = $this->getHeader();\n if (count($list) > 0){\n foreach($list as $key => $value){\n \t$o .= \"<entry>\\n\";\n \t$o .= \"\\t<form>\\n\";\n\t$o .= \"\\t\\t<orth>\\n\";\n\t$infinitive = $value['infinitive'][0];\n\t$o .= \"\\t\\t\\t$infinitive\\n\";\n\t$o .= \"\\t\\t</orth>\\n\";\n\t$o .= \"\\t\\t<model>\\n\";\n\t$model = $value['model'];\n\t$o .= \"\\t\\t\\t$model\\n\";\n\t$o .= \"\\t\\t</model>\\n\";\n $o .= $this->convertConjugation($value);\n\t$o .= \"\\t</form>\\n\";\n \t$o .= \"</entry>\\n\";\n } // for\n } // if\n\n $o .= $this->getFooter();\n $this->createDownloadFile($o);\t \n }",
"function DisplayArray($array) {\n foreach ($array as $value) {\n if (is_array($value)) {\n DisplayArray($value);\n } else {\n echo $value . \"<br>\";\n }\n }\n }",
"public static function viewArray($array_in) {\n\t\tif (is_array($array_in)) {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">';\n\t\t\tif (count($array_in) == 0) {\n\t\t\t\t$result .= '<tr><td><font face=\"Verdana,Arial\" size=\"1\"><strong>EMPTY!</strong></font></td></tr>';\n\t\t\t} else {\n\t\t\t\tforeach ($array_in as $key => $val) {\n\t\t\t\t\t$result .= '<tr><td valign=\"top\"><font face=\"Verdana,Arial\" size=\"1\">' . htmlspecialchars((string)$key) . '</font></td><td>';\n\t\t\t\t\tif (is_array($val)) {\n\t\t\t\t\t\t$result .= self::viewArray($val);\n\t\t\t\t\t} elseif (is_object($val)) {\n\t\t\t\t\t\t$string = '';\n\t\t\t\t\t\tif (method_exists($val, '__toString')) {\n\t\t\t\t\t\t\t$string .= get_class($val) . ': ' . (string)$val;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string .= print_r($val, TRUE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (gettype($val) == 'object') {\n\t\t\t\t\t\t\t$string = 'Unknown object';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$string = (string)$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result .= '<font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' . nl2br(htmlspecialchars($string)) . '<br /></font>';\n\t\t\t\t\t}\n\t\t\t\t\t$result .= '</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result .= '</table>';\n\t\t} else {\n\t\t\t$result = '<table border=\"1\" cellpadding=\"1\" cellspacing=\"0\" bgcolor=\"white\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td><font face=\"Verdana,Arial\" size=\"1\" color=\"red\">' .\n\t\t\t\tnl2br(htmlspecialchars((string)$array_in)) .\n\t\t\t\t'<br /></font></td>\n\t\t\t</tr>\n\t\t</table>'; // Output it as a string.\n\t\t}\n\t\treturn $result;\n\t}",
"function bi_options_line($arr = array()){\r\n\t$arr_option = bi_options(array(\r\n\t\t\"chartBottomMargin\" => \"25\",\r\n\t\t\"chartTopMargin\" => \"50\",\r\n\t\t\"showValues\" => \"0\",\r\n\t\t\"exportEnabled\" => \"1\"\r\n\t));\r\n\tforeach($arr as $i => $val){\r\n\t\t$arr_option[$i] = $val;\r\n\t}\r\n\treturn $arr_option;\r\n}",
"public static function fromData(array $data);",
"public function fromArray(array $arrayData);",
"static function screening_array($data) {\n\t\tforeach ($data as $key=>$value) {\n\t\t\t$tmp[$key]=mysql::screening($value);\n\t\t}\n\t\treturn $tmp;\n\t}",
"public static function options(array $dataset, string $valueMember, string $displayMember, ?string $selectedValue = \"\")\n {\n foreach ($dataset as $elemento) {\n $selected = '';\n if (is_array($elemento)) {\n $selected = ($elemento[$valueMember] == $selectedValue) ? 'selected' : '';\n printf(\"<option value='%s' %s>%s</option>\", $elemento[$valueMember], $selected, htmlentities($elemento[$displayMember]));\n } elseif (is_object($elemento)) {\n $selected = ($elemento->$valueMember == $selectedValue) ? 'selected' : '';\n printf(\"<option value='%s' %s>%s</option>\", $elemento->$valueMember, $selected, htmlentities($elemento->$displayMember));\n }\n }\n }",
"public function getRenderedOptions()\n {\n $renderedOptions = [];\n $options = $this->getDataFromSqlServer();\n foreach ($options as $optionData) {\n $optionKey = $optionData[$this->filterField];\n\n $renderedOptions[$optionKey] = $optionData;\n $renderedOptions[$optionKey]['value'] = $this->renderOptionData($optionData);\n $renderedOptions[$optionKey]['selected'] = false;\n }\n return $renderedOptions;\n }",
"public function decode(array $data, $pickerKey, array $options, ArrayAccess $errors = null, $fieldDisplayName = null);",
"function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}",
"function multiple_arrayDisplay($multiple_array)\n{\n $r = '';\n $r .= '<style> td,th{border: solid 2px black;}</style>';\n $r .= '<table>';\n $r .= '<tr>';\n foreach ($multiple_array[0] as $key => $value) {\n $r .= '<th>'.$key.'</th>';\n }\n $r .= '</tr>';\n foreach ($multiple_array as $key => $value) {\n $r .= '<tr>';\n foreach ($value as $key1 => $value1) {\n if ($key1 == 'price') {\n $r .= '<td> $'.$value1.' </td>';\n } else {\n $r .= '<td>'.$value1.' </td>';\n }\n }\n $r .= '</tr>';\n }\n $r .= '</table>';\n\n return $r;\n}",
"public function setData(Array $data);",
"public function var_display_field($data)\n {\n return $this->display_field($data);\n }",
"function list_array( $des_array ){\n\tif( is_array( $des_array ) ){\n\t\techo '<ul>';\n\t\tforeach( $des_array as $item ){\n\t\t\techo '<li>' . $item . '</li>';\n\t\t}\n\t\techo '</ul>';\n\t}\n}",
"public function setDisplayFields($field_names){\n\t\t// TODO: add validation on field_names?\n\t\tif(is_array($field_names)){\n\t\t\t$this->display_fields = $field_names;\n\t\t}\t\t\n\t}",
"public function toString(array $data): string;",
"public function getConfigFromData(array $data = array())\n {\n return [\n 'multiItems' => [\n [\n [\n 'label' => 'application-review-business-type',\n 'value' => $this->formatRefdata($data['licence']['organisation']['type'])\n ]\n ]\n ]\n ];\n }",
"function demos_convert_list() {\n return array(\n 'item1' => t('Item1'),\n 'item2' => t('Item2'),\n 'description' => t('Description'),\n );\n}",
"public function datalist() {\n\t\t\tif ( false !== $this->data( 'options' ) ) {\n\t\t\t\techo '<datalist id=\"' . $this->js_field_id() . 'inputLists\">';\n\t\t\t\t$options = ( ! wponion_is_array( $this->data( 'options' ) ) ) ? $this->element_data( $this->data( 'options' ) ) : $this->data( 'options' );\n\n\t\t\t\tforeach ( $options as $key => $option ) {\n\t\t\t\t\tif ( wponion_is_array( $option ) && isset( $option['label'] ) ) {\n\t\t\t\t\t\techo $this->sel_option( $this->handle_options( $key, $option ) );\n\t\t\t\t\t} elseif ( wponion_is_array( $option ) && ! isset( $option['label'] ) ) {\n\t\t\t\t\t\techo '<optgroup label=\"' . $key . '\">';\n\t\t\t\t\t\tforeach ( $option as $k => $v ) {\n\t\t\t\t\t\t\techo $this->sel_option( $this->handle_options( $k, $v ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</optgroup>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo $this->sel_option( $this->handle_options( $key, $option ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</datalist>';\n\t\t\t}\n\t\t}",
"function rdisplay()\r\n\t{\r\n\t\t$select = $this->open_select().\"\\n\";\r\n\t\tforeach ($this->m_array_options as $options )\r\n\t\t{\r\n\t\t\t\t$selected = ($options['selected'] == true ) ? \"selected\" : \"\";\r\n\t\t\t\t\r\n\t\t\t\t$select .= \"<option value=\\\"\".$options['value'].\"\\\" $selected >\".$options['text'].\"</option> \\n\";\r\n\t\t}\r\n\t\t$select .= $this->close_select().\"\\n\";\r\n\t\treturn $select;\r\n\t}",
"public function parseData(array $data): void\n {\n $collection = new Collection($data);\n\n $this->labels = $collection->filter(static function ($item) {\n return is_string($item);\n })->map(function ($item, $key) {\n return new Label($item, $key, $this->slug);\n });\n\n $this->containers = $collection->filter(static function ($item) {\n return is_array($item);\n })->map(function ($item, $key) {\n return new self($item, $key, $this->slug);\n });\n }",
"public function toArrayDataProvider()\n {\n return array(\n array(),\n array(true)\n );\n }",
"protected function formatDataForSaving($data) {\n\t\t$widgets = array();\n\t\tforeach ($data['configuredWidgets'] as $widgetType) {\n\t\t\t$widgets[$widgetType]['id'] = $data[$widgetType]['id'];\n\t\t\t$widgets[$widgetType]['type'] = $data[$widgetType]['type'];\n\t\t}\n\n\t\treturn $widgets;\n\t}",
"function display_acp_options(&$display_vars, $mode)\n\t\t{\n\t\t\tglobal $config, $user;\n\n\t\t\tif ($mode == 'features')\n\t\t\t{\n\t\t\t\t$user->add_lang('mods/prime_birthdate');\n\t\t\t\t$display_vars['vars']['allow_birthdays'] = array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'int', 'type' => 'custom', 'function' => 'make_allow_birthdays_select', 'params' => array('{KEY}', '{CONFIG_VALUE}'), 'explain' => true);\n\t\t\t}\n\t\t\telse if ($mode == 'registration')\n\t\t\t{\n\t\t\t\t$user->add_lang('mods/prime_birthdate');\n\t\t\t\t$display_copy = $display_vars['vars'];\n\t\t\t\t$display_vars['vars'] = array();\n\t\t\t\tforeach ($display_copy as $key => $val)\n\t\t\t\t{\n\t\t\t\t\t$display_vars['vars'][$key] = $val;\n\t\t\t\t\tif ($key == 'chg_passforce')\t// Insert our option after this one\n\t\t\t\t\t{\n\t\t\t\t\t\t$display_vars['vars']['minimum_age'] = array('lang' => 'PRIME_BIRTHDATE_MIN','validate' => 'int',\t'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['PRIME_BIRTHDATE_YEARS_OLD']);\n\t\t\t\t\t\t$display_vars['vars']['maximum_age'] = array('lang' => 'PRIME_BIRTHDATE_MAX','validate' => 'int',\t'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['PRIME_BIRTHDATE_YEARS_OLD']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"final static public function displayOptions( ){\n\t\t\t\treturn static::$_displayOptions;\n\t\t\t}",
"public function setData(array $data)\n {\n if(key_exists('label', $data)) {\n $this->_rebuildSearchIndex = true;\n }\n if(key_exists('content', $data)) {\n $data['content'] = str_replace(\"\\r\\n\",\"\\n\", $data['content']);\n // normalize tabs\n $data['content'] = str_replace(\"\\t\",\" \", $data['content']);\n $data['content'] = str_replace(\" \",\"\\t\", $data['content']);\n }\n \n return parent::setData($data);\n }",
"function astrizstudios_pro_block_useArray($data,$o1)\r\n{\r\n\t$d = null;\r\n\r\n\t//Lets grab the data that we need.. We do not need to know which filter was it..\r\n\tif(isset($data['array_original']))\r\n\t{\r\n\t\t$keys = $data['array_original'];\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//Something is off..Send back the original values..\r\n\t\treturn $o1;\r\n\t}\r\n\r\n\tforeach($keys as $key => $v)\r\n\t{\r\n\t\t//Usually this would be the best way to deal with filtered output, by placing it in a new field there is original content and the filtered out one.\r\n\t\t//since WP is not using this to display the content, we can either make it be displayed by our own plugin, which would affect any other plugin that is set for displaying data or save it as it comes back..\r\n\t\t$d[$key] = $data['array_parsed'][$key]['text_parsed'];\r\n\t}\r\n\r\n\t//Lets make sure that we do not remove other data, which was not sent to the filter..\r\n\tforeach($d as $k => $v)\r\n\t{\r\n\t\t$o1[$k] = $v;\r\n\t}\r\n\r\n\treturn $o1;\r\n}",
"function changeArrayToString($data) {\n\t\t$str = '';\n\t\tforeach($data as $value)\n\t\t{\n\t\t\tif(empty($str))\n\t\t\t\t$str = '\"'.trim(strip_tags($value)).'\"';\n\t\t\telse\n\t\t\t\t$str .=' ,\"'.trim(strip_tags($value)).'\"';\n\t\t}\n\t\treturn $str;\n\t}",
"function display_result($array) {\n\tforeach ($array as $entry) {\n\t\tif ($entry != '')\n\t\t\techo \"<li>\" . $entry . \"</li>\\n\";\n\t}\n}",
"public function toOptionArray()\n {\n return array(\n array('value' => '.txt', 'label' => Mage::helper('expeditorinet')->__('.txt')),\n array('value' => '.csv', 'label' => Mage::helper('expeditorinet')->__('.csv')),\n );\n }",
"function InitDataPrintTitles()\n {\n $titles=array();\n foreach ($this->ColsDef[ \"AllowedDatas\" ] as $data)\n {\n $titles[ $this->MyMod_Data_Title($data) ]=$data;\n }\n\n $names=array_keys($titles);\n sort($names);\n\n $this->ColsDef[ \"SelectNames\" ]=array(0);\n $this->ColsDef[ \"SelectTitles\" ]=array(\"\");\n\n foreach ($names as $name)\n {\n array_push($this->ColsDef[ \"SelectNames\" ],$name);\n array_push($this->ColsDef[ \"SelectTitles\" ],$titles[ $name ]);\n }\n }",
"public function formatDataProvider(): array\n {\n return [\n [new PhoneNumber('8015551212'), '(%a) %e-%n', '', '(801) 555-1212'],\n [new PhoneNumber('8015551212 x55'), '(%a) %e-%n %x', 'ext. ', '(801) 555-1212 ext. 55'],\n [new PhoneNumber('8015551212'), '(%a) %e-%n %x', 'x', '(801) 555-1212'],\n ];\n }"
] | [
"0.65887356",
"0.5653705",
"0.559138",
"0.55119365",
"0.5437563",
"0.5375846",
"0.5371915",
"0.5371915",
"0.53670305",
"0.53471124",
"0.5326506",
"0.53130317",
"0.52393377",
"0.5238264",
"0.5220877",
"0.5218551",
"0.52113104",
"0.52023184",
"0.5193594",
"0.5189112",
"0.5188633",
"0.5186595",
"0.5173077",
"0.5166868",
"0.51284283",
"0.5128174",
"0.5113516",
"0.51082796",
"0.5108266",
"0.5093893",
"0.50938606",
"0.5090352",
"0.50863683",
"0.5078103",
"0.5074212",
"0.5055607",
"0.5047392",
"0.5041388",
"0.5041388",
"0.5031917",
"0.5022431",
"0.5016513",
"0.50103986",
"0.5002662",
"0.49955663",
"0.49871776",
"0.4986473",
"0.4974943",
"0.4974943",
"0.4974943",
"0.4974264",
"0.4972828",
"0.49702635",
"0.49488613",
"0.4948107",
"0.49465668",
"0.49462897",
"0.49456692",
"0.4934951",
"0.4925983",
"0.49211955",
"0.49119768",
"0.49072933",
"0.4907178",
"0.49024898",
"0.49020326",
"0.49007255",
"0.4893479",
"0.48860288",
"0.48786354",
"0.4867001",
"0.48613167",
"0.4859757",
"0.48582184",
"0.48562905",
"0.4850672",
"0.4848114",
"0.48374555",
"0.48374555",
"0.4833819",
"0.48324266",
"0.4829683",
"0.482335",
"0.4818406",
"0.48120847",
"0.48075655",
"0.48037645",
"0.47975552",
"0.47896278",
"0.4779419",
"0.47757265",
"0.47738016",
"0.476969",
"0.47689247",
"0.47547922",
"0.4753556",
"0.47527978",
"0.4752055",
"0.47492176",
"0.47469518"
] | 0.5265565 | 12 |
Minimum display options for something like a standard quote. | public static function minimal(bool $withDiscussionLink): QuoteEmbedDisplayOptions {
return new QuoteEmbedDisplayOptions(
false,
true,
$withDiscussionLink,
$withDiscussionLink,
false,
false,
false
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function lowPriorityOption() {\n\t\treturn '';\n\t}",
"final static public function displayOptions( ){\n\t\t\t\treturn static::$_displayOptions;\n\t\t\t}",
"public static function get_font_subset_option_elements() {\n\n\t\treturn '<option value=\"unknown\">' . esc_html__( 'Unknown', 'publisher' ) . '</option>';\n\t}",
"public function getOptions() {\n\t\tif ($this->row->options != '') {\n\t\t\t$options = explode(\";\", $this->row->options);\n\t\t}\n\t\tif ($this->row->intoptions != '') {\n\t\t\t$intoptions = explode(\";\", $this->row->intoptions);\n\t\t\t$options_map = array_combine($intoptions, $options);\n\t\t}\n\t\tif ($options) {\n\t\t\t$msg = \"Predefined Options:\\n\";\n\t\t\tif ($intoptions) {\n\t\t\t\tforeach ($options_map as $key => $label) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$key}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$label}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($options as $char) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$char}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$char}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}",
"public static function full(): QuoteEmbedDisplayOptions {\n return new QuoteEmbedDisplayOptions(\n true,\n false,\n true,\n true,\n true,\n true,\n true\n );\n }",
"private function renderOptions(): string\n {\n $str = '';\n if ($this->defaultText !== false) {\n $option = new OptionElement();\n $option->text = $this->defaultText;\n $option->value = $this->defaultValue;\n $str .= $option->render();\n }\n foreach ($this->arrOption as $option) {\n $this->setAutoOptionTitle($option);\n $str .= $option->render();\n }\n\n return $str;\n }",
"public function display_option_raw() {\n\n\t\t$desc = __( 'Because the [raw] shortcode isn\\'t a standard shortcode, having it enabled does effect the output of your content and may conflict with other plugins.', 'theme-blvd-shortcodes' );\n\t\t$this->display_yes_no( 'themeblvd_raw', $desc, 'yes' );\n\n\t}",
"public function getMinimumAmountDescription()\n {\n $descr = Mage::getStoreConfig('sales/minimum_order/multi_address_description');\n if (empty($descr)) {\n $descr = Mage::getStoreConfig('sales/minimum_order/description');\n }\n return $descr;\n }",
"public function getMinMessage()\n {\n return $this->getOption('min_message', 'Please add at least %min% number '\n .'of objects.');\n }",
"function help()\n\t{\n\t\t$help['b'] = array();\n\t\t$help['i'] = array();\n\t\t\n\t\t$help['b'][] = 'Laisser une ligne vide entre chaque bloc <em>de même nature</em>.';\n\t\t$help['b'][] = '<strong>Paragraphe</strong> : du texte et une ligne vide';\n\t\t\n\t\tif ($this->getOpt('active_title')) {\n\t\t\t$help['b'][] = '<strong>Titre</strong> : <code>!!!</code>, <code>!!</code>, '.\n\t\t\t'<code>!</code> pour des titres plus ou moins importants';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_hr')) {\n\t\t\t$help['b'][] = '<strong>Trait horizontal</strong> : <code>----</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_lists')) {\n\t\t\t$help['b'][] = '<strong>Liste</strong> : ligne débutant par <code>*</code> ou '.\n\t\t\t'<code>#</code>. Il est possible de mélanger les listes '.\n\t\t\t'(<code>*#*</code>) pour faire des listes de plusieurs niveaux. '.\n\t\t\t'Respecter le style de chaque niveau';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_pre')) {\n\t\t\t$help['b'][] = '<strong>Texte préformaté</strong> : espace devant chaque ligne de texte';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_quote')) {\n\t\t\t$help['b'][] = '<strong>Bloc de citation</strong> : <code>></code> ou '.\n\t\t\t'<code>;:</code> devant chaque ligne de texte';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_fr_syntax')) {\n\t\t\t$help['i'][] = 'La correction de ponctuation est active. Un espace '.\n\t\t\t\t\t\t'insécable remplacera automatiquement tout espace '.\n\t\t\t\t\t\t'précédant les marques \";\",\"?\",\":\" et \"!\".';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_em')) {\n\t\t\t$help['i'][] = '<strong>Emphase</strong> : deux apostrophes <code>\\'\\'texte\\'\\'</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_strong')) {\n\t\t\t$help['i'][] = '<strong>Forte emphase</strong> : deux soulignés <code>__texte__</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_br')) {\n\t\t\t$help['i'][] = '<strong>Retour forcé à la ligne</strong> : <code>%%%</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_ins')) {\n\t\t\t$help['i'][] = '<strong>Insertion</strong> : deux plus <code>++texte++</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_del')) {\n\t\t\t$help['i'][] = '<strong>Suppression</strong> : deux moins <code>--texte--</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_urls')) {\n\t\t\t$help['i'][] = '<strong>Lien</strong> : <code>[url]</code>, <code>[nom|url]</code>, '.\n\t\t\t'<code>[nom|url|langue]</code> ou <code>[nom|url|langue|titre]</code>.';\n\t\t\t\n\t\t\t$help['i'][] = '<strong>Image</strong> : comme un lien mais avec une extension d\\'image.'.\n\t\t\t'<br />Pour désactiver la reconnaissance d\\'image mettez 0 dans un dernier '.\n\t\t\t'argument. Par exemple <code>[image|image.gif||0]</code> fera un lien vers l\\'image au '.\n\t\t\t'lieu de l\\'afficher.'.\n\t\t\t'<br />Il est conseillé d\\'utiliser la nouvelle syntaxe.';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_img')) {\n\t\t\t$help['i'][] = '<strong>Image</strong> (nouvelle syntaxe) : '.\n\t\t\t'<code>((url|texte alternatif))</code>, '.\n\t\t\t'<code>((url|texte alternatif|position))</code> ou '.\n\t\t\t'<code>((url|texte alternatif|position|description longue))</code>. '.\n\t\t\t'<br />La position peut prendre les valeur L ou G (gauche), R ou D (droite) ou C (centré).';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_anchor')) {\n\t\t\t$help['i'][] = '<strong>Ancre</strong> : <code>~ancre~</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_acronym')) {\n\t\t\t$help['i'][] = '<strong>Acronyme</strong> : <code>??acronyme??</code> ou '.\n\t\t\t'<code>??acronyme|titre??</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_q')) {\n\t\t\t$help['i'][] = '<strong>Citation</strong> : <code>{{citation}}</code>, '.\n\t\t\t'<code>{{citation|langue}}</code> ou <code>{{citation|langue|url}}</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_code')) {\n\t\t\t$help['i'][] = '<strong>Code</strong> : <code>@@code ici@@</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_footnotes')) {\n\t\t\t$help['i'][] = '<strong>Note de bas de page</strong> : <code>$$Corps de la note$$</code>';\n\t\t}\n\t\t\n\t\t$res = '<dl class=\"wikiHelp\">';\n\t\t\n\t\t$res .= '<dt>Blocs</dt><dd>';\n\t\tif (count($help['b']) > 0)\n\t\t{\n\t\t\t$res .= '<ul><li>';\n\t\t\t$res .= implode(' ;</li><li>', $help['b']);\n\t\t\t$res .= '.</li></ul>';\n\t\t}\n\t\t$res .= '</dd>';\n\t\t\n\t\t$res .= '<dt>Éléments en ligne</dt><dd>';\n\t\tif (count($help['i']) > 0)\n\t\t{\n\t\t\t$res .= '<ul><li>';\n\t\t\t$res .= implode(' ;</li><li>', $help['i']);\n\t\t\t$res .= '.</li></ul>';\n\t\t}\n\t\t$res .= '</dd>';\n\t\t\n\t\t$res .= '</dl>';\n\t\t\n\t\treturn $res;\t\n\t}",
"public function option_description_string() {\n return '';\n }",
"public function getMin() {\n\t\t\treturn \"<p>Min: \".$this->min.\"</p>\";\n\t\t}",
"public function MyDefaultDisplayStyle(): string\n {\n return $this->getListConfigCalculated('DISPLAY');\n }",
"public function getWhatRequiredOptions()\n {\n $options = array(\n 1 => \"Refund\",\n 2 => \"Replacement\",\n 3 => \"Spare Part\",\n 4 => \"Other\"\n );\n return $options;\n }",
"function getOptionsSupported() {\n\t\treturn array(\tgettext('Default quota') => array('key' => 'quota_default', 'type' => OPTION_TYPE_TEXTBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('Default size limit in kilobytes.')),\n\t\t\t\t\t\t\t\t\tgettext('Allow ZIP files') => array('key' => 'quota_allowZIP', 'type' => OPTION_TYPE_CHECKBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('The size of a ZIP file may be slightly smaller than the sum of the <em>image</em> files it contains. Un-check this box if you wish to disable uploading of ZIP files.'))\n\t\t);\n\t}",
"function getShowHint() { return $this->readShowHint(); }",
"protected function getOptions()\n {\n return array(\n array('show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'),\n );\n }",
"public function getDisplayOptions()\n\t{\n\n\t\t$options = new stdClass();\n\n\t\t// search string applied to either sef or non sef\n\t\t$options->search_all = $this->_getState('search_all');\n\t\t// ordering column\n\t\t$options->filter_order = $this->_getState('filter_order');\n\t\t// show all/only custom/only automatic\n\t\t$options->filter_order_Dir = $this->_getState('filter_order_Dir');\n\n\t\t// return cached instance\n\t\treturn $options;\n\t}",
"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 getShowHint() { return $this->readShowHint(); }",
"public function displayHelp()\n {\n $sHelp = \"\nUsage:\n$this->sViewName [options]\n\n$this->sTempalteDesc\n\nOptions:\\n\";\n\n $iMaxLength = 2;\n\n foreach ($this->hOptionList as $hOption)\n {\n if (isset($hOption['long']))\n {\n $iTemp = strlen($hOption['long']);\n\n if ($iTemp > $iMaxLength)\n {\n $iMaxLength = $iTemp;\n }\n }\n }\n\n foreach ($this->hOptionList as $hOption)\n {\n $bShort = isset($hOption['short']);\n $bLong = isset($hOption['long']);\n\n if (!$bShort && !$bLong)\n {\n continue;\n }\n\n if ($bShort && $bLong)\n {\n $sOpt = '-' . $hOption['short'] . ', --' . $hOption['long'];\n }\n elseif ($bShort && !$bLong)\n {\n $sOpt = '-' . $hOption['short'] . \"\\t\";\n }\n elseif (!$bShort && $bLong)\n {\n $sOpt = ' --' . $hOption['long'];\n }\n\n $sOpt = str_pad($sOpt, $iMaxLength + 7);\n $sHelp .= \"\\t$sOpt\\t\\t{$hOption['desc']}\\n\\n\";\n }\n\n die($sHelp . \"\\n\");\n }",
"function getShowHint() {return $this->readShowHint();}",
"function pqurc_display_extra()\n {\n $extra_fi = get_option('pqurcode_extra');\n printf(\"<input type='text' id='%s' name='%s' value='%s' />\", 'pqurcode_extra', 'pqurcode_extra', $extra_fi);\n }",
"function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }",
"protected function getOptions()\n {\n return [\n ['show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'],\n ];\n }",
"private function showOptions() : void\n {\n $selectedOption = $this->console->choice(__('Please cheoose your option:'), $this->getAllOptions() );\n $this->setSelectedOption($selectedOption);\n $this->handleOption();\n }",
"function show_excerpts() {\n\treturn 'excerpts';\n}",
"function prim_options_requirement_limit() {\n $five_requirement_limit = array(\n 'alldeles_for_lag' => t('Alldeles för låg'),\n 'nagot_lag' => t('Något låg'),\n 'lamplig' => t('Lämplig'),\n 'nagot_hog' => t('Något hög'),\n 'alldeles_for_hog' => t('Alldeles för hög'),\n );\n\n return $five_requirement_limit;\n}",
"public function get_options_list() {\n\t\treturn array(\n\t\t\t'ring_logger_limit' => __('How many last records store?', 'wp-optimize')\n\t\t);\n\t}",
"function dblions_general_options() {\n\techo 'Edit general features';\n}",
"function build_default_core_options() {\n\n $core_options = array(\n 'key' => '',\n 'title' => '',\n 'menu_order' => 0,\n 'position' => 'normal',\n 'style' => 'default',\n 'label_placement' => 'top',\n 'instruction_placement' => 'label',\n 'hide_on_screen' => array()\n );\n\n return $core_options;\n }",
"public static function sanitations()\n {\n $s = [\n 'name' => 'single_line',\n 'description' => 'single_line'\n ];\n\n return $s;\n }",
"protected function getTextHelp()\n {\n return array(\n 'complexidade' => 'O Nível de Complexidade está relacionado diretamente com a natureza da atividade e o esforço necessário para a sua execução ou solução de incidente. Por esforço entende-se tempo que será gasto para execução ou nível de dificuldade da demanda.',\n 'impacto' => 'O Nível de Impacto está relacionado ao efeito nos processos de negócio do Inep ou da DTDIE, o quanto os serviços serão afetados com falha, necessidade de evolução ou adaptação e qual será o transtorno, interno ou externo, pela não realização ou falha na execução da atividade.',\n 'criticidade' => 'O nível de criticidade está relacionado ao tempo de execução considerando que atrasos, na execução das atividades ou na entrega dos artefatos, podem afetar um processo de negócio do Inep ou da DTDIE.',\n 'facim' => 'O Fator de Conhecimento Interno e Maturidade- FACIM- é um indicador que baliza a perspectiva de definição do conhecimento interno e da maturidade para a execução das atividades. Este indicador tem o objetivo de criar um parâmetro que avalia o nível de maturidade e conhecimento do Inep que é transferido para o contexto da necessidade em que a atividade será inserida.'\n );\n }",
"function printOptions()\n {\n $lines = $this->outputOptions();\n echo join( \"\\n\" , $lines );\n }",
"function admin_summary() {\n if (!is_array($this->value)) {\n return '';\n }\n\n $output = check_plain($this->value['column'] . ' ' . $this->operator);\n if (in_array($this->operator, $this->operator_values(2))) {\n $output .= ' ' . t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));\n }\n elseif (in_array($this->operator, $this->operator_values(1))) {\n $output .= ' ' . check_plain($this->value['value']);\n }\n\n return $output;\n }",
"public function display_minimum_price() {\n\t\t_deprecated_function( 'display_minimum_price', '2.0', 'WC_Name_Your_Price()->display->display_minimum_price' );\n\t\treturn $this->display->display_minimum_price();\n\t}",
"function get_spaces_options($zero_value = true){\r\n\t\t$available_spaces = $this->get_available_spaces();\r\n\t\tif( $available_spaces >= $this->min || ( empty($this->min) && $available_spaces > 0) ) {\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t<select name=\"em_tickets[<?php echo $this->id ?>][spaces]\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t$min = ($this->min > 0) ? $this->min:1;\r\n\t\t\t\t\t$max = ($this->max > 0) ? $this->max:get_option('dbem_bookings_form_max');\r\n\t\t\t\t?>\r\n\t\t\t\t<?php if($zero_value) : ?><option>0</option><?php endif; ?>\r\n\t\t\t\t<?php for( $i=$min; $i<=$max; $i++ ): ?>\r\n\t\t\t\t\t<option><?php echo $i ?></option>\r\n\t\t\t\t<?php endfor; ?>\r\n\t\t\t</select>\r\n\t\t\t<?php \r\n\t\t\treturn ob_get_clean();\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\t\r\n\t}",
"public function options(): array\n\t{\n\t\treturn collect(trans('site::order.help.in_stock_type', []))\n\t\t\t->prepend(trans('site::messages.select_no_matter'), '')\n\t\t\t->toArray();\n\t}",
"function inkpro_add_shop_display_options( $options ) {\r\n\r\n\tif ( class_exists( 'WooCommerce' ) ) {\r\n\t\t$options['loren'] = esc_html__( 'Loren', 'inkpro' );\r\n\t\t$options['agathe'] = esc_html__( 'Agathe', 'inkpro' );\r\n\t}\r\n\r\n\treturn $options;\r\n}",
"public function help(){\n\t\t$list = array();foreach($this->getEncryptionKeys() as $k=>$v){$list[]=$k;}\n\t\treturn \"Supported Encryped sections: \". rtrim(implode(',', $list), ',');\n\t}",
"function prim_options_four_extensions() {\n $four_extensions = array(\n 'inte_alls_mycket_litet' => t('Inte alls/Mycket litet'),\n 'ganska_liten' => t('Ganska liten'),\n 'ganska_stor' => t('Ganska stor'),\n 'mycket_stor' => t('Mycket stor'),\n );\n\n return $four_extensions;\n}",
"public function getExtendedHelpMessage()\n {\n $out = $this->getHelpMessage() . \"\\n\";\n\n $out .= \"Usage: summary [--short] [module]\\n\"\n . \"Show the summary of the most recent results of each module.\\n\"\n . \"If a module name is provided as an argument, it\\n\"\n . \"will display only the summary for that module.\\n\\n\"\n . \"This is the default module that is run when no\\n\"\n . \"module name is given when running qis.\\n\";\n\n $out .= \"\\nValid Options:\\n\"\n . $this->_qis->getTerminal()->do_setaf(3)\n . \" --short : Show only short information\\n\"\n . $this->_qis->getTerminal()->do_op();\n\n return $out;\n }",
"public function getValidOptions()\n\t{\n\t\treturn array('altField', 'altFormat', 'appendText', 'autoSize', 'buttonImage', 'buttonImageOnly', 'buttonText', 'calculateWeek',\n\t\t\t\t\t\t\t\t 'changeMonth', 'changeYear', 'closeText', 'constrainInput', 'currentText', 'dateFormat', 'dayNames', 'dayNamesMin',\n\t\t\t\t 'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',\n\t\t\t\t\t\t\t\t 'minDate', 'monthNames', 'monthNamesShort', 'navigationAsDateFormat', 'nextText', 'numberOfMonths', 'prevText',\n\t\t\t\t\t\t\t\t 'selectOtherMonths', 'shortYearCutoff', 'showAnim', 'showButtonPanel', 'showCurrentAtPos', 'showMonthAfterYear',\n\t\t\t\t 'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',\n\t\t\t\t\t\t\t\t 'beforeShow', 'beforeShowDay', 'onChangeMonthYear', 'onClose', 'onSelect');\n\t}",
"public function getHelp() {\n $help = parent::getHelp();\n $global_options = $this->getGlobalOptions();\n if (!empty($global_options)) {\n $help .= PHP_EOL . 'Global options:';\n foreach ($global_options as $name => $value) {\n $help .= PHP_EOL . ' [' . $name . '=' . $value . ']';\n }\n }\n return $help;\n }",
"final static public function restoreDisplayOptions( ){\n\t\t\t\tstatic::$_displayOptions = self::ERRALL & ~self::ERRTRC;\n\t\t\t\treturn;\n\t\t\t}",
"public function customizer_help() {\n\t\techo '\n\t\t<li>\n\t\t\t<p>\n\t\t\t\t' . __( 'Example text:', 'hellish-simplicity' ) . ' <code>' . esc_html( $this->default_header_text ) . '</code>\n\t\t\t</p>\n\t\t</li>';\n\t}",
"function getOptionsSupported() {\n\t\treturn array(\tgettext('Augment password hash:') => array('key' => 'extra_auth_hash_text', 'type' => OPTION_TYPE_TEXTBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('Extra text appended when hashing password to strengthen Zenphoto authentication.').'<p class=\"notebox\">'.gettext('<strong>Note:</strong> Changing this will require all users to reset their passwords! You should change your password immediately if you change this text.').'</p>'),\n\t\tgettext('Minimum password length:') => array('key' => 'min_password_lenght', 'type' => OPTION_TYPE_TEXTBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('Minimum number of characters a password must contain.')),\n\t\tgettext('Password characters:') => array('key' => 'password_pattern', 'type' => OPTION_TYPE_CLEARTEXT,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('Passwords must contain at least one of the characters from each of the groups. Groups are separated by \"|\". (Use \"\\|\" to represent the \"|\" character in the groups.)'))\n\t\t);\n\t}",
"public static function getDefaultOptions(){\n\n\t\t$options = array(\n\t\t\tWPC_OPTIONS => array(\n\t\t\t\tWPC_OPTIONS_LANGUAGE => 'en_US',\n\t\t\t\tWPC_OPTIONS_THEME => WPC_THEME_LIGHT\n\t\t\t),\n\t\t\tWPC_OPTIONS_COMMENTS => array(\n\t\t\t\tWPC_OPTIONS_COMMENTS_NUMBER => 6,\n\t\t\t\tWPC_OPTIONS_COMMENTS_WIDTH => 480,\n\t\t\t\tWPC_OPTIONS_COMMENTS_POSITION => WPC_CUSTOM_FIELD_VALUE_POSITION_BOTTOM,\n\t\t\t\tWPC_OPTIONS_COMMENTS_ENABLED => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_DISPLAY_EVERYWHERE => 'on',\n\t\t\t\tWPC_OPTIONS_DISPLAY_NOWHERE => ''\n\t\t\t),\n\t\t\tWPC_OPTIONS_LIKE_BUTTON => array(\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_SEND => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_LAYOUT => WPC_LAYOUT_STANDARD,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_WIDTH => 480,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_FACES => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_VERB => WPC_ACTION_LIKE,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_FONT => WPC_FONT_DEFAULT,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_POSITION => WPC_CUSTOM_FIELD_VALUE_POSITION_TOP,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_ENABLED => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_DISPLAY_EVERYWHERE => 'on'\n\t\t\t)\n\t\t);\n\n\t\treturn $options;\n\n\t}",
"public function formatting()\n\t{\n\t\tmd('sketchpad::help/output/formatting');\n\t}",
"public function getDisplayNames()\n {\n return $this->getOption('display_names');\n }",
"function selectandprint_filter_tips($filter, $format, $long = FALSE) {\n return t('Begin your select and print list with [selectandprint]. End it with [/selectandprint]. Put each list item on its own line. Separate your list items into groups by adding a @ at the beginning of the line where you want a group header');\n}",
"function AddDefaultOptions() {\n\t\n\t\t\t /* MODIFIED CODE */\n\t\n\t\t\t /* Wrap string in gettext function __() */\n\t\t\t add_option(self::PREFIX . '_cheesy_slogan_text', __('you can\\'t beat his prices!', self::PREFIX));\n\t\n\t\t\t /* END MODIFIED CODE */\n\t\n\t\t\t add_option(self::PREFIX . '_horrible_banner_image', '1');\n\t\n\t\t\t add_option(self::PREFIX . '_disgusting_background_enabled', true);\n\t\n\t\t\t add_option(self::PREFIX . '_annoying_popup_enabled', true);\n\t\t}",
"function rdisplay()\r\n\t{\r\n\t\t$select = $this->open_select().\"\\n\";\r\n\t\tforeach ($this->m_array_options as $options )\r\n\t\t{\r\n\t\t\t\t$selected = ($options['selected'] == true ) ? \"selected\" : \"\";\r\n\t\t\t\t\r\n\t\t\t\t$select .= \"<option value=\\\"\".$options['value'].\"\\\" $selected >\".$options['text'].\"</option> \\n\";\r\n\t\t}\r\n\t\t$select .= $this->close_select().\"\\n\";\r\n\t\treturn $select;\r\n\t}",
"protected function getOptions()\n {\n return [\n ['no-entities', null, InputOption::VALUE_NONE, 'Add translation without converting characters to entities'],\n ];\n }",
"function settings_html() {\n $this->render_setting( 'label_any' );\n $this->render_setting( 'modifiers' );\n $this->render_setting( 'orderby' );\n $this->render_setting( 'count' );\n }",
"public function get_help()\n\t{\n\t\treturn '';\n\t}",
"function showHelp()\n{\n global $cli;\n\n $cli->writeln(sprintf(_(\"Usage: %s [OPTIONS]...\"), basename(__FILE__)));\n $cli->writeln();\n $cli->writeln(_(\"Mandatory arguments to long options are mandatory for short options too.\"));\n $cli->writeln();\n $cli->writeln(_(\"-h, --help Show this help\"));\n $cli->writeln(_(\"-u, --username[=username] Horde login username\"));\n $cli->writeln(_(\"-p, --password[=password] Horde login password\"));\n $cli->writeln(_(\"-t, --type[=type] Export format\"));\n $cli->writeln(_(\"-r, --rpc[=http://example.com/horde/rpc.php] Remote url\"));\n $cli->writeln();\n}",
"public function showing_excerpts() {\n\n\t\tif ( null === $this->showing_excerpts ) {\n\n\t\t\t$this->showing_excerpts = 'yes' === get_option( $this->show_excerpts_option );\n\t\t}\n\n\t\treturn $this->showing_excerpts;\n\t}",
"function pqurc_display_width()\n {\n $width = get_option('pqurcode_width');\n printf(\"<input type='text' id='%s' name='%s' value='%s' />\", 'pqurcode_width', 'pqurcode_width', $width);\n }",
"public function messages()\n {\n return [\n 'content.min' => 'This text is too short, isn\\'t it? It must be at least :min characters!'\n ];\n }",
"public function hyphenationProvider()\n {\n return [[true], [false]];\n }",
"function prim_options_program() {\n $program = array(\n 'bf' => t('BF'),\n 'bp' => t('BP'),\n 'ec' => t('EC'),\n 'en' => t('EN'),\n 'es' => t('ES'),\n 'fp' => t('FP'),\n 'hp' => t('HP'),\n 'hr' => t('HR'),\n 'hv' => t('HV'),\n 'ib' => t('IB'),\n 'ip' => t('IP'),\n 'iv' => t('IV'),\n 'kx' => t('KX'),\n 'lp' => t('LP'),\n 'mp' => t('MP'),\n 'nv' => t('NV'),\n 'np' => t('NP'),\n 'op' => t('OP'),\n 'ov' => t('OV'),\n 'komvux' => t('Komvux'),\n );\n\n return $program;\n}",
"public function option_definition() {\n $options = parent::option_definition();\n $options['multi_type'] = array(\n 'default' => 'ol'\n );\n $options['list_class'] = array(\n 'default' => ''\n );\n $options['display_as_link'] = array(\n 'default' => FALSE\n );\n return $options;\n }",
"public function getQuotationLayoutAllowableValues()\n {\n return [\n self::QUOTATION_LAYOUT_DEFAULT_CLASSIC,\n self::QUOTATION_LAYOUT_STANDARD_CLASSIC,\n self::QUOTATION_LAYOUT_ENVELOPE_CLASSIC,\n self::QUOTATION_LAYOUT_DEFAULT_MODERN,\n self::QUOTATION_LAYOUT_STANDARD_MODERN,\n self::QUOTATION_LAYOUT_ENVELOPE_MODERN,\n ];\n }",
"function bb_print_mystique_option( $option ) {\r\n\techo bb_get_mystique_option( $option );\r\n}",
"function mb_options()\n {\n }",
"function virtual_product_type_options() {\n\t?>\n\t<div id=\"virtual_product_options\">\n\t\t<?php\n\t\t\t_e('Virtual products have no specific options.', 'jigoshop');\n\t\t?>\n\t</div>\n\t<?php\n}",
"protected function _getExtraOptions()\n {\n return array(\n 'table|t-s' => 'Which table to generate its DAO.',\n 'modelnamespace|M=s' => 'The model namespace',\n 'tablenamespace|T=s' => 'The table namespace'\n );\n }",
"function displayRequired( $value ){\n\t\n\tif ( $value == 1 ) {\n\t\t$display = '<span style=\"color:#CC0000; font-weight:bold;\">*</span>';\n\t} else {\n\t\t$display = '';\n\t}\n\t\n\treturn $display;\n}",
"public function admin_style()\n\t{\n\t\treturn '';\n\t}",
"public static function contract_options() {\n return array(\n '' => '',\n 'RENT' => __( 'Rent', 'inventor-properties' ),\n 'SALE' => __( 'Sale', 'inventor-properties' ),\n );\n }",
"public function get_options() {\n\t\t$options = parent::get_options();\n\n\t\t$options['show_in_admin_status_list'] = true;\n\n\t\t$label_value = __( 'Pending Revisions <span class=\"count\">(%s)</span>', 'wp-safe-edit' );\n\t\t$options['label_count'] = _n_noop( $label_value, $label_value );\n\n\t\treturn $options;\n\t}",
"public function display() {\n\t\tif ( $this->read_only && $this->selectable ) {\n\t\t\techo \"<input onClick='this.select();' type='text' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( get_option( $this->setting_id, $this->default_value ) ) . \"' readonly class='regular-text'>\";\n\t\t} elseif ( $this->read_only && ! $this->selectable ) {\n\t\t\techo \"<input type='text' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( get_option( $this->setting_id, $this->default_value ) ) . \"' readonly class='regular-text'>\";\n\t\t} else {\n\t\t\techo \"<input type='text' name='\" . esc_attr( $this->setting_id ) . \"' value='\" . esc_attr( get_option( $this->setting_id, $this->default_value ) ) . \"' class='regular-text'>\";\n\t\t}\n\t}",
"function specialdisplaytypes() {\n return array (\"xy_coord\"=>1, \"latlong\"=>1, \"matrix\"=>1);\n }",
"public function getDisplayFormatTypeAllowableValues()\n {\n return [\n self::DISPLAY_FORMAT_TYPE__DEFAULT,\n self::DISPLAY_FORMAT_TYPE_DATE,\n self::DISPLAY_FORMAT_TYPE_NUMBER,\n ];\n }",
"public function getMajorOptions() {\n\t\treturn array(\n\t\t\t\"Urban Planing\" => \"Urban Planing\",\n\t\t\t\"Urban Design\" => \"Urban Design\",\n \"Architecture\" => \"Architecture\",\n \"Landscape Architecture\" => \"Landscape Architecture\",\n );\n }",
"public function getDisplayTaxAndDutySeparately()\n {\n return Mage::getStoreConfig('iparcel/tax/mode') == Iparcel_All_Model_System_Config_Source_Tax_Mode::SEPARATELY;\n }",
"public function admin_options() {\n\n\t\t?>\n\t\t<h3><?php _e( 'PayU standard', 'woocommerce' ); ?></h3>\n\t\t<p><?php _e( 'PayU standard works by sending the user to PayU to enter their payment information.', 'woocommerce' ); ?></p>\n\n \t<?php if ( $this->is_valid_for_use() ) : ?>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t\t</table><!--/.form-table-->\n\n\t\t<?php else : ?>\n <div class=\"inline error\"><p><strong><?php _e( 'Gateway Disabled', 'woocommerce' ); ?></strong>: <?php _e( 'PayU does not support your store currency.', 'woocommerce' ); ?></p></div>\n\t\t<?php\n\t\t\tendif;\n\t}",
"public function getGroupsOptions()\n {\n return array(\n 'compulsory' => array(\n array('name' => 'Run Subtitle Spell Check before delivery', 'description' => 'Run Subtitle Spell Check before delivery', 'notice' => 'STOPPER'),\n array('name' => 'Run Subtitle Quality Check (SQC) before delivery', 'description' => 'Run Subtitle Quality Check (SQC) before delivery', 'notice' => 'STOPPER'),\n array('name' => 'Identical Narrative as in English template found', 'description' => 'When the text in the translate file is identical to the English template', 'notice' => 'STOPPER'),\n array('name' => 'Allow Empty Boxes', 'description' => 'Allow users to deliver file with empty boxes (boxes not containing any text)', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Lines Per Box', 'description' => 'The maximum lines allowed in one box', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Characters Per Line (Horizontal, Vertical)', 'description' => 'The maximum number of characters allowed per (horizontal, vertical) line', 'notice' => 'STOPPER'),\n array('name' => 'Main Title tag required', 'description' => 'The main title has not been tagged with a Main Title tag', 'notice' => 'STOPPER'),\n array('name' => 'Non-standard apostrophe used at position (pos)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'English template revision not acknowledged', 'description' => 'English template revision is not reviewed by a language user by clicking on the blinking red alarm clock', 'notice' => 'STOPPER'),\n array('name' => 'Minimum Box Duration', 'description' => 'The shortest duration allowed for a box. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Box Duration', 'description' => 'The longest duration allowed for a box. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Allow Box Overlap', 'description' => 'Allow users to deliver overlapping boxes', 'notice' => 'STOPPER'),\n array('name' => 'Floating captions found', 'description' => 'Allow caption to touch top or bottom', 'notice' => 'STOPPER'),\n array('name' => 'Teletext Character Set Only', 'description' => 'This is a special requirement for teletext deliveries as this format has restrictions on the characters allowed', 'notice' => 'STOPPER'),\n array('name' => 'Box start time is equal / exceeds its end time', 'description' => 'Timing discrepancy when a file has been imported into the system where the start timecode of a box can be greater than the end timecode of the box', 'notice' => 'STOPPER'),\n array('name' => 'Chapter stop overlaps with subtitle', 'description' => '', 'notice' => 'STOPPER'),\n ),\n \n 'spec' => array(\n array('name' => 'Maximum Lines Per Box', 'description' => 'The maximum lines allowed in one box', 'notice' => 'STOPPER'),\n array('name' => 'Minimum Frame Gap Between Boxes', 'description' => 'Minimal gap allowed between boxes. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Frame gap violation between consecutive boxes found', 'description' => 'This puts restrictions on the frame gaps allowed between boxes. This is meant to disallow small gaps (under 1 second) between consecutive boxes, a special requirement. Example: 3f;1s mean that gap >= 3 frames and < 1 second not allowed', 'notice' => 'STOPPER'),\n array('name' => 'Allow Italics', 'description' => 'Are italics allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Forced', 'description' => 'Allow Burned-in tag?', 'notice' => 'STOPPER'),\n array('name' => 'Only one sentence per box is allowed', 'description' => 'Only one sentence per subtitle is permitted', 'notice' => 'STOPPER'),\n array('name' => 'Text-heavy box found', 'description' => 'When too much text is present in a box as opposed to the box duration, readability gets affected', 'notice' => 'STOPPER'),\n ),\n \n 'compliance' => array(\n array('name' => 'Rating Allowed', 'description' => 'Is a rating allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Translator Credit Allowed', 'description' => 'Is the translator credit allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Disallowed characters found at start of subtitle', 'description' => 'Subtitle cannot start with any of the entered chars. Input chars as a string, without separators', 'notice' => 'STOPPER'),\n ),\n \n 'special' => array(\n array('name' => 'Allowable unedited auto-translation limit', 'description' => 'This special limit is set for translate jobs to define maximum allowable unedited auto translation in percents', 'notice' => 'STOPPER'),\n array('name' => 'Consecutive text-heavy 2-line subtitle found', 'description' => 'The maximum number of consecutive 2 line subs. Should be more than 1 or Disabled(-1). This is special requirement meant to discourage consecutive text heavy boxes', 'notice' => 'STOPPER'),\n array('name' => 'Space After Hypens Between Words', 'description' => 'Checks for space after or before a hyphen between two words. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Do Not Allow \"#\" Symbol', 'description' => 'This prevents users from delivering a file containing the pound symbol. This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Space After Double Chevron', 'description' => 'Requires a space after a double hyphen. This is meant for specific French captioning requirements', 'notice' => 'STOPPER'),\n array('name' => 'Space After Hyphens', 'description' => 'Set a required space after speaker hyphen. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Speaker Hyphens style', 'description' => 'Set a required speaker hyphen style. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Disallowed characters found in subtitle', 'description' => 'Subtitle cannot contain any of entered chars. Input chars as a string, without separators', 'notice' => 'STOPPER'),\n array('name' => 'Text contains invalid XML characters', 'description' => '', 'notice' => 'STOPPER'),\n ),\n \n 'captions' => array(\n array('name' => 'Allow 32 Character Lines With Italics', 'description' => 'Is it possible to add 32 character line with italics?', 'notice' => 'STOPPER'),\n array('name' => 'Sound Cue Format', 'description' => 'Examples: \"[music]\", \"(MUSIC)\", ...', 'notice' => 'STOPPER'),\n ),\n \n 'other' => array( \n array('name' => 'Possible acronym should be written without periods and spaces', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Possible acronym should be written without accents', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Semicolon should be removed', 'description' => 'This is one of the SDH system checks only for LAS language', 'notice' => 'STOPPER'),\n array('name' => 'Continuity ellipsis at the end of the box should be removed', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Extra punctuation found', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Double quotation marks should be written without spaces', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Period should be written after a closing quote', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Song box should be fully italicized', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Song box punctuation: only question and exclamation marks allowed at the end of line', 'description' => '', 'notice' => 'STOPPER'), \n array('name' => 'Song box is not translated. Please OMIT box because translation is not required', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Unallowable forward slash in dialog', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'HBO prohibited words', 'description' => 'Prevents the user from delivering a file containing some predefined words: \"A Em Por\", \"Até Entre Porém\", \"Ao Entretanto Quando\", \"Após Lhe Que\", \"Com Uma Se\", \"Como Me Sem\", \"Contudo Nos Sob\", \"Da O Sobre\", \"De Ou Te\", \"Desde Para Todavia\", \"Do Perante Vos\", \"E Pois\". This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Do Not Allow \"$\" At The Beginning Of Sentence', 'description' => 'This prevents users from delivering a file containing the \"$\" symbol. This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Positioning not allowed for this overlapped subtitle', 'description' => 'Positioning not allowed for particular overlapped subtitle. (For Japanese only)', 'notice' => 'STOPPER'),\n array('name' => 'Text casing does not match source', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Acceptance suggestion is unresolved', 'description' => 'Flagged for all boxes which are not accepted or declined by the QAer', 'notice' => 'STOPPER'),\n array('name' => 'Text alignment not permitted as per spec', 'description' => 'When text alignment does not match what is in the delivery specs', 'notice' => 'STOPPER'),\n array('name' => 'BRP Disallowed End Words', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'BRP Disallowed Start Words', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Text found on the first cell of the first gridline', 'description' => 'Text resting on the first cell of the first gridline.(i.e. position 0,0) (For CC mode only)', 'notice' => 'NOTICE'),\n array('name' => 'File should contain an EMPTY first box', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Single quaver box should be min 5 secs long and have min 1 sec gap after it', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Italics or Underline found within word', 'description' => 'When italics or underline tags are found inside words. (For CC mode only)', 'notice' => 'STOPPER'), \n array('name' => 'Enter some note for the box with error type: Translation (objective/subjective)', 'description' => 'It forces a QA user to input a note if box error type is Translation: objective/subjective. (For Netflix client only)', 'notice' => 'STOPPER'),\n array('name' => 'Incorrect text formatting (<HTML>|<P>)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Alignment / Positioning does not match source', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Box should be removed (omitted) according to the \"Texted\" delivery format', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Stand-alone punctuation present', 'description' => 'When any box in a file has only punctuation and no text in it', 'notice' => 'STOPPER'),\n array('name' => 'Double space found at line #(number)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Error type is not chosen', 'description' => 'When a QAer makes a change but does not select an error category', 'notice' => 'STOPPER'),\n ),\n );\n }",
"protected function _getExtraOptions()\n {\n $opts = array(\n 'table|t-s' => 'The table\\'s name.',\n 'setters|S-s'\t=> 'The setter method.'\n );\n\n return $opts;\n }",
"protected static function allowedOptions()\n\t{\n\t\treturn parent::allowedOptions();\n\t}",
"public function cheapestOptions()\n {\n return (isset($this->quotes) && (is_array($this->quotes))) ? array_slice($this->quotes, 0, $this->totalCarriers) : [];\n }",
"public function shortUsage()\n {\n return $this->summary\n ->setDescription($this->description)\n ->setCommand($this->name)\n ->setFilter($this->filter, $this->all())\n ->summarize();\n }",
"public function getPrintOptions() {\r\n\t\treturn $this->options->getPrint();\r\n\t}",
"function plugin_customfields_showValue($value, $size='') {\n if ($size!='') {\n echo '<div style=\"text-align:left;overflow:auto;border:1px solid #999;'.$size.'\">';\n }\n\n if ($value != '' && $value != ' ') {\n echo $value;\n } else {\n echo '-';\n }\n\n if ($size != '') {\n echo '</div>';\n }\n}",
"protected function getTabOptions() {\n $options = [\n 'members' => $this->t('Members'),\n 'admins' => $this->t('Administrators'),\n ];\n if (($this->currentUser->hasPermission('manage circle spaces') &&\n $this->moduleHandler->moduleExists('living_spaces_circles')) ||\n $this->moduleHandler->moduleExists('living_spaces_subgroup')\n ) {\n $options['inherit'] = $this->t('Inherited');\n }\n return $options;\n }",
"public static function get_suggested_policy_text()\n {\n }",
"protected function getOptions()\n\t{\n\t\t// Accepted modifiers\n\t\t$hash = md5($this->element);\n\n\t\tif (!isset(static::$options[$hash]))\n\t\t{\n\t\t\tstatic::$options[$hash] = parent::getOptions();\n\n\t\t\t$options = array();\n\t\t\t$limits = $this->defaultLimits;\n\n\t\t\t// Limits manually specified\n\t\t\tif (isset($this->element['limits']))\n\t\t\t{\n\t\t\t\t$limits = explode(',', $this->element['limits']);\n\t\t\t}\n\n\t\t\t// User wants to add custom limits\n\t\t\tif (isset($this->element['append']))\n\t\t\t{\n\t\t\t\t$limits = array_unique(array_merge($limits, explode(',', $this->element['append'])));\n\t\t\t}\n\n\t\t\t// User wants to remove some default limits\n\t\t\tif (isset($this->element['remove']))\n\t\t\t{\n\t\t\t\t$limits = array_diff($limits, explode(',', $this->element['remove']));\n\t\t\t}\n\n\t\t\t// Order the options\n\t\t\tasort($limits);\n\n\t\t\t// Add an option to show all?\n\t\t\t$showAll = isset($this->element['showall']) ? ($this->element['showall'] == \"true\") : true;\n\n\t\t\tif ($showAll)\n\t\t\t{\n\t\t\t\t$limits[] = 0;\n\t\t\t}\n\n\t\t\tif (!empty($limits))\n\t\t\t{\n\t\t\t\tforeach ($limits as $value)\n\t\t\t\t{\n\t\t\t\t\t$options[] = (object) array(\n\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t'text' => ($value != 0) ? JText::_('J' . $value) : JText::_('JALL')\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tstatic::$options[$hash] = array_merge(static::$options[$hash], $options);\n\t\t\t}\n\t\t}\n\n\t\treturn static::$options[$hash];\n\t}",
"function _echo_esc_attr( $option_key ) {\n\t\techo esc_attr( bf_get_option( $option_key, $this->option_panel_id ) );\n\t}",
"public static function es_admin_option() {\n\t}",
"public static function get_display_order() {\n\t\treturn 10;\n\t}",
"public function getDescriptions()\n {\n return ['help' => 'Show this list'];\n }",
"public function display_option_generator() {\n\n\t\t$desc = __( 'If our plugin\\'s shortcode generator causes any unwanted clutter or doesn\\'t fully jive with your WordPress setup, you can disable it here.', 'theme-blvd-shortcodes' );\n\t\t$this->display_yes_no( 'themeblvd_shortcode_generator', $desc, 'yes' );\n\n\t}",
"protected function formatter() {\n return '';\n }",
"function admin_options() {\r\n ?>\r\n <h3><?php _e('Bitcoin Payment','Bitcoin_Payment'); ?></h3>\r\n <table class=\"form-table\">\r\n <?php $this->generate_settings_html(); ?>\r\n </table> <?php\r\n }",
"function print_admin_styles()\n {\n }",
"public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }",
"public function displayValue() {\n\t\tif ($this->row->intoptions != \"\") {\n\t\t\t$options = explode(\";\", $this->row->options);\n\t\t\t$intoptions = explode(\";\", $this->row->intoptions);\n\t\t\t$intoptions2 = array_flip($intoptions);\n\t\t\t$key = $intoptions2[$this->row->value];\n\t\t\treturn \"<highlight>{$options[$key]}<end>\";\n\t\t} else {\n\t\t\treturn \"<highlight>\" . htmlspecialchars($this->row->value) . \"<end>\";\n\t\t}\n\t}",
"function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}",
"function showSafety() {\n $output = $this->outputBoilerplate('safety.html');\n return $output;\n }",
"function applicable_formats()\r\n\t\t{\r\n\t\t\treturn array('all' => true);\r\n\t\t}"
] | [
"0.64365447",
"0.6011334",
"0.5888091",
"0.5877862",
"0.57732046",
"0.5628446",
"0.5572568",
"0.5530587",
"0.5510755",
"0.5490056",
"0.54572374",
"0.54555917",
"0.54296887",
"0.54036623",
"0.53963715",
"0.5394083",
"0.538621",
"0.5383794",
"0.53835756",
"0.53619814",
"0.5359456",
"0.53478366",
"0.53343916",
"0.5332251",
"0.53224987",
"0.53128356",
"0.5308809",
"0.5279899",
"0.5273079",
"0.5252985",
"0.5246643",
"0.52359533",
"0.52191967",
"0.52109647",
"0.5205174",
"0.5203176",
"0.5184742",
"0.51690966",
"0.5166319",
"0.5150243",
"0.51460695",
"0.5139077",
"0.5136074",
"0.5128567",
"0.5120412",
"0.5117318",
"0.5115998",
"0.51100934",
"0.51006347",
"0.510041",
"0.5089807",
"0.5076531",
"0.50755715",
"0.5068535",
"0.5066428",
"0.5066146",
"0.50624406",
"0.5059671",
"0.5052202",
"0.5050029",
"0.5049853",
"0.50419474",
"0.5041723",
"0.5036298",
"0.5035168",
"0.5033807",
"0.500772",
"0.5004598",
"0.49945673",
"0.4983005",
"0.49805406",
"0.49779975",
"0.4977674",
"0.49759644",
"0.49701202",
"0.49630564",
"0.49516037",
"0.4943902",
"0.49382693",
"0.49379694",
"0.4936171",
"0.49358836",
"0.4934756",
"0.49321023",
"0.4929541",
"0.49246565",
"0.49074966",
"0.4905929",
"0.49011588",
"0.48972517",
"0.48960277",
"0.48953417",
"0.48937982",
"0.4892715",
"0.48890594",
"0.48861897",
"0.48839667",
"0.48816043",
"0.48727283",
"0.48698238",
"0.48688364"
] | 0.0 | -1 |
Minimum display options for something like a report. | public static function full(): QuoteEmbedDisplayOptions {
return new QuoteEmbedDisplayOptions(
true,
false,
true,
true,
true,
true,
true
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final static public function displayOptions( ){\n\t\t\t\treturn static::$_displayOptions;\n\t\t\t}",
"public function get_options_list() {\n\t\treturn array(\n\t\t\t'ring_logger_limit' => __('How many last records store?', 'wp-optimize')\n\t\t);\n\t}",
"public function lowPriorityOption() {\n\t\treturn '';\n\t}",
"public function render_screen_options()\n {\n }",
"public function getDisplayOptions()\n\t{\n\n\t\t$options = new stdClass();\n\n\t\t// search string applied to either sef or non sef\n\t\t$options->search_all = $this->_getState('search_all');\n\t\t// ordering column\n\t\t$options->filter_order = $this->_getState('filter_order');\n\t\t// show all/only custom/only automatic\n\t\t$options->filter_order_Dir = $this->_getState('filter_order_Dir');\n\n\t\t// return cached instance\n\t\treturn $options;\n\t}",
"final static public function restoreDisplayOptions( ){\n\t\t\t\tstatic::$_displayOptions = self::ERRALL & ~self::ERRTRC;\n\t\t\t\treturn;\n\t\t\t}",
"public static function get_font_subset_option_elements() {\n\n\t\treturn '<option value=\"unknown\">' . esc_html__( 'Unknown', 'publisher' ) . '</option>';\n\t}",
"function prim_options_requirement_limit() {\n $five_requirement_limit = array(\n 'alldeles_for_lag' => t('Alldeles för låg'),\n 'nagot_lag' => t('Något låg'),\n 'lamplig' => t('Lämplig'),\n 'nagot_hog' => t('Något hög'),\n 'alldeles_for_hog' => t('Alldeles för hög'),\n );\n\n return $five_requirement_limit;\n}",
"public function MyDefaultDisplayStyle(): string\n {\n return $this->getListConfigCalculated('DISPLAY');\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}",
"protected function defaultDisplayOptions() {\n $display_options = [];\n $display_options['access']['type'] = 'none';\n $display_options['cache']['type'] = 'tag';\n $display_options['query']['type'] = 'views_query';\n $display_options['exposed_form']['type'] = 'basic';\n $display_options['pager']['type'] = 'mini';\n $display_options['style']['type'] = 'default';\n $display_options['row']['type'] = 'fields';\n\n // Add default options array to each plugin type.\n foreach ($display_options as &$options) {\n $options['options'] = [];\n }\n\n // Add a least one field so the view validates and the user has a preview.\n // The base field can provide a default in its base settings; otherwise,\n // choose the first field with a field handler.\n $default_table = $this->base_table;\n $data = Views::viewsData()->get($default_table);\n if (isset($data['table']['base']['defaults']['field'])) {\n $default_field = $data['table']['base']['defaults']['field'];\n // If the table for the default field is different to the base table,\n // load the view table data for this table.\n if (isset($data['table']['base']['defaults']['table']) && $data['table']['base']['defaults']['table'] != $default_table) {\n $default_table = $data['table']['base']['defaults']['table'];\n $data = Views::viewsData()->get($default_table);\n }\n }\n else {\n foreach ($data as $default_field => $field_data) {\n if (isset($field_data['field']['id'])) {\n break;\n }\n }\n }\n // @todo Refactor the code to use ViewExecutable::addHandler. See\n // https://www.drupal.org/node/2383157.\n $display_options['fields'][$default_field] = [\n 'table' => $default_table,\n 'field' => $default_field,\n 'id' => $default_field,\n 'entity_type' => $data[$default_field]['entity type'] ?? NULL,\n 'entity_field' => $data[$default_field]['entity field'] ?? NULL,\n 'plugin_id' => $data[$default_field]['field']['id'],\n ];\n\n return $display_options;\n }",
"public function getMinMessage()\n {\n return $this->getOption('min_message', 'Please add at least %min% number '\n .'of objects.');\n }",
"function specialdisplaytypes() {\n return array (\"xy_coord\"=>1, \"latlong\"=>1, \"matrix\"=>1);\n }",
"public function showSettings()\n\t{\n\n\t\treturn $this->showDefaultSettings();\n\t}",
"public function getMajorOptions() {\n\t\treturn array(\n\t\t\t\"Urban Planing\" => \"Urban Planing\",\n\t\t\t\"Urban Design\" => \"Urban Design\",\n \"Architecture\" => \"Architecture\",\n \"Landscape Architecture\" => \"Landscape Architecture\",\n );\n }",
"public function screen_options(){\n\t\t$screen = get_current_screen();\n\n\t\t$page_main\t\t= $this->_admin_pages[ 'vfb-pro' ];\n\t\t$page_entries \t= $this->_admin_pages[ 'vfb-entries' ];\n\n\t\tswitch( $screen->id ) :\n\t\t\tcase $page_entries :\n\n\t\t\t\tadd_screen_option( 'per_page', array(\n\t\t\t\t\t'label'\t\t=> __( 'Entries per page', 'visual-form-builder-pro' ),\n\t\t\t\t\t'default'\t=> 20,\n\t\t\t\t\t'option'\t=> 'vfb_entries_per_page'\n\t\t\t\t) );\n\n\t\t\t\tbreak;\n\n\t\t\tcase $page_main :\n\n\t\t\t\tadd_screen_option( 'layout_columns', array(\n\t\t\t\t\t'max'\t\t=> 3,\n\t\t\t\t\t'default'\t=> 2\n\t\t\t\t) );\n\t\t\t\tadd_screen_option( 'per_page', array(\n\t\t\t\t\t'label'\t\t=> __( 'Forms per page', 'visual-form-builder-pro' ),\n\t\t\t\t\t'default'\t=> 20,\n\t\t\t\t\t'option'\t=> 'vfb_forms_per_page'\n\t\t\t\t) );\n\n\t\t\t\tbreak;\n\t\tendswitch;\n\t}",
"function Show_All() \n\t{\n\t\tglobal $eTraffic;\n\t\t\n\t\t$this->ShowIf('Debug Log', $this->Show_Log());\n\t\t$this->ShowIf('Traffic Counters', $eTraffic->Display());\n\t\t$this->ShowIf('Time Analysis', $this->Show_Performance());\n\t\t$this->ShowIf('SQL Analysis', $this->Show_SQL_Details());\n\t\t$this->ShowIf('Shortcodes / BBCode',$this->Show_SC_BB());\n\t\t$this->ShowIf('Paths', $this->Show_PATH());\n\t\t$this->ShowIf('Deprecated Function Usage', $this->Show_DEPRECATED());\n\t\t$this->ShowIf('Included Files', $this->Show_Includes());\n\t}",
"protected function calculateDisplayRange() {}",
"public function getGroupsOptions()\n {\n return array(\n 'compulsory' => array(\n array('name' => 'Run Subtitle Spell Check before delivery', 'description' => 'Run Subtitle Spell Check before delivery', 'notice' => 'STOPPER'),\n array('name' => 'Run Subtitle Quality Check (SQC) before delivery', 'description' => 'Run Subtitle Quality Check (SQC) before delivery', 'notice' => 'STOPPER'),\n array('name' => 'Identical Narrative as in English template found', 'description' => 'When the text in the translate file is identical to the English template', 'notice' => 'STOPPER'),\n array('name' => 'Allow Empty Boxes', 'description' => 'Allow users to deliver file with empty boxes (boxes not containing any text)', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Lines Per Box', 'description' => 'The maximum lines allowed in one box', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Characters Per Line (Horizontal, Vertical)', 'description' => 'The maximum number of characters allowed per (horizontal, vertical) line', 'notice' => 'STOPPER'),\n array('name' => 'Main Title tag required', 'description' => 'The main title has not been tagged with a Main Title tag', 'notice' => 'STOPPER'),\n array('name' => 'Non-standard apostrophe used at position (pos)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'English template revision not acknowledged', 'description' => 'English template revision is not reviewed by a language user by clicking on the blinking red alarm clock', 'notice' => 'STOPPER'),\n array('name' => 'Minimum Box Duration', 'description' => 'The shortest duration allowed for a box. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Box Duration', 'description' => 'The longest duration allowed for a box. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Allow Box Overlap', 'description' => 'Allow users to deliver overlapping boxes', 'notice' => 'STOPPER'),\n array('name' => 'Floating captions found', 'description' => 'Allow caption to touch top or bottom', 'notice' => 'STOPPER'),\n array('name' => 'Teletext Character Set Only', 'description' => 'This is a special requirement for teletext deliveries as this format has restrictions on the characters allowed', 'notice' => 'STOPPER'),\n array('name' => 'Box start time is equal / exceeds its end time', 'description' => 'Timing discrepancy when a file has been imported into the system where the start timecode of a box can be greater than the end timecode of the box', 'notice' => 'STOPPER'),\n array('name' => 'Chapter stop overlaps with subtitle', 'description' => '', 'notice' => 'STOPPER'),\n ),\n \n 'spec' => array(\n array('name' => 'Maximum Lines Per Box', 'description' => 'The maximum lines allowed in one box', 'notice' => 'STOPPER'),\n array('name' => 'Minimum Frame Gap Between Boxes', 'description' => 'Minimal gap allowed between boxes. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Frame gap violation between consecutive boxes found', 'description' => 'This puts restrictions on the frame gaps allowed between boxes. This is meant to disallow small gaps (under 1 second) between consecutive boxes, a special requirement. Example: 3f;1s mean that gap >= 3 frames and < 1 second not allowed', 'notice' => 'STOPPER'),\n array('name' => 'Allow Italics', 'description' => 'Are italics allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Forced', 'description' => 'Allow Burned-in tag?', 'notice' => 'STOPPER'),\n array('name' => 'Only one sentence per box is allowed', 'description' => 'Only one sentence per subtitle is permitted', 'notice' => 'STOPPER'),\n array('name' => 'Text-heavy box found', 'description' => 'When too much text is present in a box as opposed to the box duration, readability gets affected', 'notice' => 'STOPPER'),\n ),\n \n 'compliance' => array(\n array('name' => 'Rating Allowed', 'description' => 'Is a rating allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Translator Credit Allowed', 'description' => 'Is the translator credit allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Disallowed characters found at start of subtitle', 'description' => 'Subtitle cannot start with any of the entered chars. Input chars as a string, without separators', 'notice' => 'STOPPER'),\n ),\n \n 'special' => array(\n array('name' => 'Allowable unedited auto-translation limit', 'description' => 'This special limit is set for translate jobs to define maximum allowable unedited auto translation in percents', 'notice' => 'STOPPER'),\n array('name' => 'Consecutive text-heavy 2-line subtitle found', 'description' => 'The maximum number of consecutive 2 line subs. Should be more than 1 or Disabled(-1). This is special requirement meant to discourage consecutive text heavy boxes', 'notice' => 'STOPPER'),\n array('name' => 'Space After Hypens Between Words', 'description' => 'Checks for space after or before a hyphen between two words. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Do Not Allow \"#\" Symbol', 'description' => 'This prevents users from delivering a file containing the pound symbol. This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Space After Double Chevron', 'description' => 'Requires a space after a double hyphen. This is meant for specific French captioning requirements', 'notice' => 'STOPPER'),\n array('name' => 'Space After Hyphens', 'description' => 'Set a required space after speaker hyphen. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Speaker Hyphens style', 'description' => 'Set a required speaker hyphen style. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Disallowed characters found in subtitle', 'description' => 'Subtitle cannot contain any of entered chars. Input chars as a string, without separators', 'notice' => 'STOPPER'),\n array('name' => 'Text contains invalid XML characters', 'description' => '', 'notice' => 'STOPPER'),\n ),\n \n 'captions' => array(\n array('name' => 'Allow 32 Character Lines With Italics', 'description' => 'Is it possible to add 32 character line with italics?', 'notice' => 'STOPPER'),\n array('name' => 'Sound Cue Format', 'description' => 'Examples: \"[music]\", \"(MUSIC)\", ...', 'notice' => 'STOPPER'),\n ),\n \n 'other' => array( \n array('name' => 'Possible acronym should be written without periods and spaces', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Possible acronym should be written without accents', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Semicolon should be removed', 'description' => 'This is one of the SDH system checks only for LAS language', 'notice' => 'STOPPER'),\n array('name' => 'Continuity ellipsis at the end of the box should be removed', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Extra punctuation found', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Double quotation marks should be written without spaces', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Period should be written after a closing quote', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Song box should be fully italicized', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Song box punctuation: only question and exclamation marks allowed at the end of line', 'description' => '', 'notice' => 'STOPPER'), \n array('name' => 'Song box is not translated. Please OMIT box because translation is not required', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Unallowable forward slash in dialog', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'HBO prohibited words', 'description' => 'Prevents the user from delivering a file containing some predefined words: \"A Em Por\", \"Até Entre Porém\", \"Ao Entretanto Quando\", \"Após Lhe Que\", \"Com Uma Se\", \"Como Me Sem\", \"Contudo Nos Sob\", \"Da O Sobre\", \"De Ou Te\", \"Desde Para Todavia\", \"Do Perante Vos\", \"E Pois\". This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Do Not Allow \"$\" At The Beginning Of Sentence', 'description' => 'This prevents users from delivering a file containing the \"$\" symbol. This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Positioning not allowed for this overlapped subtitle', 'description' => 'Positioning not allowed for particular overlapped subtitle. (For Japanese only)', 'notice' => 'STOPPER'),\n array('name' => 'Text casing does not match source', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Acceptance suggestion is unresolved', 'description' => 'Flagged for all boxes which are not accepted or declined by the QAer', 'notice' => 'STOPPER'),\n array('name' => 'Text alignment not permitted as per spec', 'description' => 'When text alignment does not match what is in the delivery specs', 'notice' => 'STOPPER'),\n array('name' => 'BRP Disallowed End Words', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'BRP Disallowed Start Words', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Text found on the first cell of the first gridline', 'description' => 'Text resting on the first cell of the first gridline.(i.e. position 0,0) (For CC mode only)', 'notice' => 'NOTICE'),\n array('name' => 'File should contain an EMPTY first box', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Single quaver box should be min 5 secs long and have min 1 sec gap after it', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Italics or Underline found within word', 'description' => 'When italics or underline tags are found inside words. (For CC mode only)', 'notice' => 'STOPPER'), \n array('name' => 'Enter some note for the box with error type: Translation (objective/subjective)', 'description' => 'It forces a QA user to input a note if box error type is Translation: objective/subjective. (For Netflix client only)', 'notice' => 'STOPPER'),\n array('name' => 'Incorrect text formatting (<HTML>|<P>)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Alignment / Positioning does not match source', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Box should be removed (omitted) according to the \"Texted\" delivery format', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Stand-alone punctuation present', 'description' => 'When any box in a file has only punctuation and no text in it', 'notice' => 'STOPPER'),\n array('name' => 'Double space found at line #(number)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Error type is not chosen', 'description' => 'When a QAer makes a change but does not select an error category', 'notice' => 'STOPPER'),\n ),\n );\n }",
"function showLongerSettings()\n\t{\n\t\tinclude_once(\"./Services/Administration/classes/class.ilSetting.php\");\n\t\t$this->longer_settings = ilSetting::_getLongerSettings();\n\t\t$this->displayTools();\n\t}",
"public function getWhatRequiredOptions()\n {\n $options = array(\n 1 => \"Refund\",\n 2 => \"Replacement\",\n 3 => \"Spare Part\",\n 4 => \"Other\"\n );\n return $options;\n }",
"public static function getDefaultOptions(){\n\n\t\t$options = array(\n\t\t\tWPC_OPTIONS => array(\n\t\t\t\tWPC_OPTIONS_LANGUAGE => 'en_US',\n\t\t\t\tWPC_OPTIONS_THEME => WPC_THEME_LIGHT\n\t\t\t),\n\t\t\tWPC_OPTIONS_COMMENTS => array(\n\t\t\t\tWPC_OPTIONS_COMMENTS_NUMBER => 6,\n\t\t\t\tWPC_OPTIONS_COMMENTS_WIDTH => 480,\n\t\t\t\tWPC_OPTIONS_COMMENTS_POSITION => WPC_CUSTOM_FIELD_VALUE_POSITION_BOTTOM,\n\t\t\t\tWPC_OPTIONS_COMMENTS_ENABLED => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_DISPLAY_EVERYWHERE => 'on',\n\t\t\t\tWPC_OPTIONS_DISPLAY_NOWHERE => ''\n\t\t\t),\n\t\t\tWPC_OPTIONS_LIKE_BUTTON => array(\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_SEND => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_LAYOUT => WPC_LAYOUT_STANDARD,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_WIDTH => 480,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_FACES => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_VERB => WPC_ACTION_LIKE,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_FONT => WPC_FONT_DEFAULT,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_POSITION => WPC_CUSTOM_FIELD_VALUE_POSITION_TOP,\n\t\t\t\tWPC_OPTIONS_LIKE_BUTTON_ENABLED => WPC_OPTION_ENABLED,\n\t\t\t\tWPC_OPTIONS_DISPLAY_EVERYWHERE => 'on'\n\t\t\t)\n\t\t);\n\n\t\treturn $options;\n\n\t}",
"public function getOptions() {\n\t\tif ($this->row->options != '') {\n\t\t\t$options = explode(\";\", $this->row->options);\n\t\t}\n\t\tif ($this->row->intoptions != '') {\n\t\t\t$intoptions = explode(\";\", $this->row->intoptions);\n\t\t\t$options_map = array_combine($intoptions, $options);\n\t\t}\n\t\tif ($options) {\n\t\t\t$msg = \"Predefined Options:\\n\";\n\t\t\tif ($intoptions) {\n\t\t\t\tforeach ($options_map as $key => $label) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$key}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$label}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($options as $char) {\n\t\t\t\t\t$save_link = $this->text->makeChatcmd('Select', \"/tell <myname> settings save {$this->row->name} {$char}\");\n\t\t\t\t\t$msg .= \"<tab> <highlight>{$char}<end> ({$save_link})\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $msg;\n\t}",
"function SetUpDisplayGrps() {\n\t\tglobal $dealers_reports;\n\t\t$sWrk = @$_GET[EWRPT_TABLE_GROUP_PER_PAGE];\n\t\tif ($sWrk <> \"\") {\n\t\t\tif (is_numeric($sWrk)) {\n\t\t\t\t$this->DisplayGrps = intval($sWrk);\n\t\t\t} else {\n\t\t\t\tif (strtoupper($sWrk) == \"ALL\") { // display all groups\n\t\t\t\t\t$this->DisplayGrps = -1;\n\t\t\t\t} else {\n\t\t\t\t\t$this->DisplayGrps = 50; // Non-numeric, load default\n\t\t\t\t}\n\t\t\t}\n\t\t\t$dealers_reports->setGroupPerPage($this->DisplayGrps); // Save to session\n\n\t\t\t// Reset start position (reset command)\n\t\t\t$this->StartGrp = 1;\n\t\t\t$dealers_reports->setStartGroup($this->StartGrp);\n\t\t} else {\n\t\t\tif ($dealers_reports->getGroupPerPage() <> \"\") {\n\t\t\t\t$this->DisplayGrps = $dealers_reports->getGroupPerPage(); // Restore from session\n\t\t\t} else {\n\t\t\t\t$this->DisplayGrps = 50; // Load default\n\t\t\t}\n\t\t}\n\t}",
"function admin_summary() {\n if (!is_array($this->value)) {\n return '';\n }\n\n $output = check_plain($this->value['column'] . ' ' . $this->operator);\n if (in_array($this->operator, $this->operator_values(2))) {\n $output .= ' ' . t('@min and @max', array('@min' => $this->value['min'], '@max' => $this->value['max']));\n }\n elseif (in_array($this->operator, $this->operator_values(1))) {\n $output .= ' ' . check_plain($this->value['value']);\n }\n\n return $output;\n }",
"public function print_default_options_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t\t<p>WPCampus settings require the Advanced Custom Fields PRO plugin. <a href=\"<?php echo admin_url( 'plugins.php' ); ?>\">Manage plugins</a></p>\n\t\t</div>\n\t\t<?php\n\t}",
"public function set_display()\n {\n if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') {\n $this->sLimit = \"LIMIT \".mysql_real_escape_string($_GET['iDisplayStart']).\", \".\n mysql_real_escape_string($_GET['iDisplayLength']);\n }\n }",
"public function DisplaySettings() {\n $display_session = $this->user['DropdownDefault'];\n $level = substr($display_session->SelectedID, 0, 1);\n //Readable way to tell what level were on.\n if ($level == 'a') {\n $this->LevelView = 'Agency';\n } elseif ($level == 'g') {\n $this->LevelView = 'Group';\n } elseif ($level == 'c') {\n $this->LevelView = 'Client';\n } else {\n //if super admin\n $this->LevelView = 'Agency';\n //if group admin group level\n }\n }",
"public function getMin() {\n\t\t\treturn \"<p>Min: \".$this->min.\"</p>\";\n\t\t}",
"function display_acp_options(&$display_vars, $mode)\n\t\t{\n\t\t\tglobal $config, $user;\n\n\t\t\tif ($mode == 'features')\n\t\t\t{\n\t\t\t\t$user->add_lang('mods/prime_birthdate');\n\t\t\t\t$display_vars['vars']['allow_birthdays'] = array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'int', 'type' => 'custom', 'function' => 'make_allow_birthdays_select', 'params' => array('{KEY}', '{CONFIG_VALUE}'), 'explain' => true);\n\t\t\t}\n\t\t\telse if ($mode == 'registration')\n\t\t\t{\n\t\t\t\t$user->add_lang('mods/prime_birthdate');\n\t\t\t\t$display_copy = $display_vars['vars'];\n\t\t\t\t$display_vars['vars'] = array();\n\t\t\t\tforeach ($display_copy as $key => $val)\n\t\t\t\t{\n\t\t\t\t\t$display_vars['vars'][$key] = $val;\n\t\t\t\t\tif ($key == 'chg_passforce')\t// Insert our option after this one\n\t\t\t\t\t{\n\t\t\t\t\t\t$display_vars['vars']['minimum_age'] = array('lang' => 'PRIME_BIRTHDATE_MIN','validate' => 'int',\t'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['PRIME_BIRTHDATE_YEARS_OLD']);\n\t\t\t\t\t\t$display_vars['vars']['maximum_age'] = array('lang' => 'PRIME_BIRTHDATE_MAX','validate' => 'int',\t'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['PRIME_BIRTHDATE_YEARS_OLD']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function showOptions()\n {\n\treturn $this->getConfigData('checkout/delivery_options');\n }",
"function printOptions()\n {\n $lines = $this->outputOptions();\n echo join( \"\\n\" , $lines );\n }",
"public function getDisplayOptions()\n\t{\n\t\t$options = parent::getDisplayOptions();\n\n\t\t// get additional options vs base class\n\n\t\t// search string applied to pageid\n\t\t$options->search_pageid = $this->_getState('search_pageid');\n\t\t// component used in url\n\t\t$options->filter_component = $this->_getState('filter_component');\n\t\t// show all/only with duplicates/only w/o duplicates\n\t\t$options->filter_duplicate = $this->_getState('filter_duplicate');\n\t\t// show all/only with aliases/only w/o aliases\n\t\t$options->filter_alias = $this->_getState('filter_alias');\n\t\t// show all/only custom/only automatic\n\t\t$options->filter_url_type = $this->_getState('filter_url_type');\n\t\t// show all/only one language\n\t\t$options->filter_language = $this->_getState('filter_language');\n\n\t\t// record has a title\n\t\t$options->filter_title = $this->_getState('filter_title');\n\t\t// record has a description\n\t\t$options->filter_desc = $this->_getState('filter_desc');\n\n\t\t// we want to hide some types of urls: 404, duplicates\n\t\t$options->filter_hide_urls = $this->_getState('filter_hide_urls');\n\n\t\t// hit type selector\n\t\t$options->filter_hit_type = $this->_getState('filter_hit_type');\n\n\t\t// requested or not\n\t\t$options->filter_requested_urls = $this->_getState('filter_requested_urls');\n\n\t\t// return cached instance\n\t\treturn $options;\n\t}",
"public function screen_options() {\n $screen = get_current_screen();\n\n $page_main = $this->_admin_pages['swpm'];\n\n switch ($screen->id) {\n case $page_main :\n\n if (isset($_REQUEST['form'])) :\n add_screen_option('layout_columns', array(\n 'max' => 2,\n 'default' => 2\n ));\n else :\n add_screen_option('per_page', array(\n 'label' => __('Forms per page', 'swpm-form-builder'),\n 'default' => 20,\n 'option' => 'swpm_forms_per_page'\n ));\n endif;\n\n break;\n }\n }",
"protected function displayConfigHeader() {\n\t\t}",
"public function getPrintOptions() {\r\n\t\treturn $this->options->getPrint();\r\n\t}",
"public function getDisplaySettingsDefaultData()\n {\n $settings = array(\n 'screen_size' => '320_480',\n 'display_frequency' => 1,\n 'hide_after' => 1,\n 'display_position' => 1,\n 'who_to_show' => 'all',\n 'when_to_display' => 'immediately',\n 'time_in_seconds' => 5,\n 'scroll_percent' => 10,\n 'geo_location' => 'always'\n );\n return $settings;\n }",
"function getOptionsSupported() {\n\t\treturn array(\tgettext('Default quota') => array('key' => 'quota_default', 'type' => OPTION_TYPE_TEXTBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('Default size limit in kilobytes.')),\n\t\t\t\t\t\t\t\t\tgettext('Allow ZIP files') => array('key' => 'quota_allowZIP', 'type' => OPTION_TYPE_CHECKBOX,\n\t\t\t\t\t\t\t\t\t\t'desc' => gettext('The size of a ZIP file may be slightly smaller than the sum of the <em>image</em> files it contains. Un-check this box if you wish to disable uploading of ZIP files.'))\n\t\t);\n\t}",
"public function getMinimumAmountDescription()\n {\n $descr = Mage::getStoreConfig('sales/minimum_order/multi_address_description');\n if (empty($descr)) {\n $descr = Mage::getStoreConfig('sales/minimum_order/description');\n }\n return $descr;\n }",
"function SetUpDisplayGrps() {\n\t\tglobal $deals_details;\n\t\t$sWrk = @$_GET[EWRPT_TABLE_GROUP_PER_PAGE];\n\t\tif ($sWrk <> \"\") {\n\t\t\tif (is_numeric($sWrk)) {\n\t\t\t\t$this->DisplayGrps = intval($sWrk);\n\t\t\t} else {\n\t\t\t\tif (strtoupper($sWrk) == \"ALL\") { // display all groups\n\t\t\t\t\t$this->DisplayGrps = -1;\n\t\t\t\t} else {\n\t\t\t\t\t$this->DisplayGrps = 50; // Non-numeric, load default\n\t\t\t\t}\n\t\t\t}\n\t\t\t$deals_details->setGroupPerPage($this->DisplayGrps); // Save to session\n\n\t\t\t// Reset start position (reset command)\n\t\t\t$this->StartGrp = 1;\n\t\t\t$deals_details->setStartGroup($this->StartGrp);\n\t\t} else {\n\t\t\tif ($deals_details->getGroupPerPage() <> \"\") {\n\t\t\t\t$this->DisplayGrps = $deals_details->getGroupPerPage(); // Restore from session\n\t\t\t} else {\n\t\t\t\t$this->DisplayGrps = 50; // Load default\n\t\t\t}\n\t\t}\n\t}",
"public function displayHelp()\n {\n $sHelp = \"\nUsage:\n$this->sViewName [options]\n\n$this->sTempalteDesc\n\nOptions:\\n\";\n\n $iMaxLength = 2;\n\n foreach ($this->hOptionList as $hOption)\n {\n if (isset($hOption['long']))\n {\n $iTemp = strlen($hOption['long']);\n\n if ($iTemp > $iMaxLength)\n {\n $iMaxLength = $iTemp;\n }\n }\n }\n\n foreach ($this->hOptionList as $hOption)\n {\n $bShort = isset($hOption['short']);\n $bLong = isset($hOption['long']);\n\n if (!$bShort && !$bLong)\n {\n continue;\n }\n\n if ($bShort && $bLong)\n {\n $sOpt = '-' . $hOption['short'] . ', --' . $hOption['long'];\n }\n elseif ($bShort && !$bLong)\n {\n $sOpt = '-' . $hOption['short'] . \"\\t\";\n }\n elseif (!$bShort && $bLong)\n {\n $sOpt = ' --' . $hOption['long'];\n }\n\n $sOpt = str_pad($sOpt, $iMaxLength + 7);\n $sHelp .= \"\\t$sOpt\\t\\t{$hOption['desc']}\\n\\n\";\n }\n\n die($sHelp . \"\\n\");\n }",
"public function getDisplayFormatTypeAllowableValues()\n {\n return [\n self::DISPLAY_FORMAT_TYPE__DEFAULT,\n self::DISPLAY_FORMAT_TYPE_DATE,\n self::DISPLAY_FORMAT_TYPE_NUMBER,\n ];\n }",
"function getShowHint() { return $this->readShowHint(); }",
"public function options()\n {\n $options = apply_filters(\n $this->id . '_option_fields',\n [\n 'id' => $this->id, // upstream_milestones\n 'title' => $this->title,\n 'menu_title' => $this->menu_title,\n 'desc' => $this->description,\n 'show_on' => ['key' => 'options-page', 'value' => [$this->id],],\n 'show_names' => true,\n 'fields' => [\n [\n 'name' => upstream_milestone_label_plural(),\n 'id' => 'milestone_title',\n 'type' => 'title',\n ],\n [\n 'name' => 'Milestone Categories',\n 'id' => 'enable_milestone_categories',\n 'type' => 'radio',\n 'description' => '',\n 'options' => [\n '1' => __('Enabled', 'upstream'),\n '0' => __('Disabled', 'upstream'),\n ],\n 'default' => '0',\n ],\n ],\n ]\n );\n\n return $options;\n }",
"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}",
"public function get_display_description_options() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_display_description_options();\n\n }",
"public function getCurrentDisplayFields(){\n\t\treturn array(\n\t\t\t'Number'=>'Number',\n\t\t\t'Title'=>'Title',\n\t\t\t'ParentName'=>'Flowchart Page'\n\t\t);\n\t}",
"function checkForDefaultSettings(){\n\n if(!isset($this->settings[\"reportTitle\"]))\n $this->settings[\"reportTitle\"] = \"Packing List\";\n\n parent::checkForDefaultSettings();\n\n }",
"protected function getOptions()\n\t{\n\t\t// Accepted modifiers\n\t\t$hash = md5($this->element);\n\n\t\tif (!isset(static::$options[$hash]))\n\t\t{\n\t\t\tstatic::$options[$hash] = parent::getOptions();\n\n\t\t\t$options = array();\n\t\t\t$limits = $this->defaultLimits;\n\n\t\t\t// Limits manually specified\n\t\t\tif (isset($this->element['limits']))\n\t\t\t{\n\t\t\t\t$limits = explode(',', $this->element['limits']);\n\t\t\t}\n\n\t\t\t// User wants to add custom limits\n\t\t\tif (isset($this->element['append']))\n\t\t\t{\n\t\t\t\t$limits = array_unique(array_merge($limits, explode(',', $this->element['append'])));\n\t\t\t}\n\n\t\t\t// User wants to remove some default limits\n\t\t\tif (isset($this->element['remove']))\n\t\t\t{\n\t\t\t\t$limits = array_diff($limits, explode(',', $this->element['remove']));\n\t\t\t}\n\n\t\t\t// Order the options\n\t\t\tasort($limits);\n\n\t\t\t// Add an option to show all?\n\t\t\t$showAll = isset($this->element['showall']) ? ($this->element['showall'] == \"true\") : true;\n\n\t\t\tif ($showAll)\n\t\t\t{\n\t\t\t\t$limits[] = 0;\n\t\t\t}\n\n\t\t\tif (!empty($limits))\n\t\t\t{\n\t\t\t\tforeach ($limits as $value)\n\t\t\t\t{\n\t\t\t\t\t$options[] = (object) array(\n\t\t\t\t\t\t'value' => $value,\n\t\t\t\t\t\t'text' => ($value != 0) ? JText::_('J' . $value) : JText::_('JALL')\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tstatic::$options[$hash] = array_merge(static::$options[$hash], $options);\n\t\t\t}\n\t\t}\n\n\t\treturn static::$options[$hash];\n\t}",
"function admin_summary() {\r\n $fields = date_api_fields($this->definition['base']);\r\n if (!empty($this->options['date_fields'])) {\r\n $output = array();\r\n foreach ($this->options['date_fields'] as $field) {\r\n $output[] = $fields['name'][$field]['label'];\r\n }\r\n return implode('<br />'. $this->options['date_method'] .' ', $output);\r\n }\r\n else {\r\n return parent::admin_summary();\r\n }\r\n }",
"public function screen_option() {\n add_screen_option( 'per_page', [\n 'label' => __('Entry Per Page', 'wpcf7-entries'),\n 'default' => 15,\n 'option' => 'form_per_page'\n ] );\n }",
"function getShowHint() { return $this->readShowHint(); }",
"function settings_html() {\n $this->render_setting( 'label_any' );\n $this->render_setting( 'modifiers' );\n $this->render_setting( 'orderby' );\n $this->render_setting( 'count' );\n }",
"public function get_options() {\n\t\t$options = parent::get_options();\n\n\t\t$options['show_in_admin_status_list'] = true;\n\n\t\t$label_value = __( 'Pending Revisions <span class=\"count\">(%s)</span>', 'wp-safe-edit' );\n\t\t$options['label_count'] = _n_noop( $label_value, $label_value );\n\n\t\treturn $options;\n\t}",
"public function getValidOptions()\n\t{\n\t\treturn array('altField', 'altFormat', 'appendText', 'autoSize', 'buttonImage', 'buttonImageOnly', 'buttonText', 'calculateWeek',\n\t\t\t\t\t\t\t\t 'changeMonth', 'changeYear', 'closeText', 'constrainInput', 'currentText', 'dateFormat', 'dayNames', 'dayNamesMin',\n\t\t\t\t 'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',\n\t\t\t\t\t\t\t\t 'minDate', 'monthNames', 'monthNamesShort', 'navigationAsDateFormat', 'nextText', 'numberOfMonths', 'prevText',\n\t\t\t\t\t\t\t\t 'selectOtherMonths', 'shortYearCutoff', 'showAnim', 'showButtonPanel', 'showCurrentAtPos', 'showMonthAfterYear',\n\t\t\t\t 'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',\n\t\t\t\t\t\t\t\t 'beforeShow', 'beforeShowDay', 'onChangeMonthYear', 'onClose', 'onSelect');\n\t}",
"protected function getOptions()\n {\n return array(\n array('show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'),\n );\n }",
"function RGC_dashboard_columns() {\n add_screen_option(\n 'layout_columns',\n array(\n 'max' => 1,\n 'default' => 1\n )\n );\n}",
"private function renderOptions(): string\n {\n $str = '';\n if ($this->defaultText !== false) {\n $option = new OptionElement();\n $option->text = $this->defaultText;\n $option->value = $this->defaultValue;\n $str .= $option->render();\n }\n foreach ($this->arrOption as $option) {\n $this->setAutoOptionTitle($option);\n $str .= $option->render();\n }\n\n return $str;\n }",
"function rdisplay()\r\n\t{\r\n\t\t$select = $this->open_select().\"\\n\";\r\n\t\tforeach ($this->m_array_options as $options )\r\n\t\t{\r\n\t\t\t\t$selected = ($options['selected'] == true ) ? \"selected\" : \"\";\r\n\t\t\t\t\r\n\t\t\t\t$select .= \"<option value=\\\"\".$options['value'].\"\\\" $selected >\".$options['text'].\"</option> \\n\";\r\n\t\t}\r\n\t\t$select .= $this->close_select().\"\\n\";\r\n\t\treturn $select;\r\n\t}",
"public function showSpecs()\n {\n return $this->name . \" includes a \" . $this->chipset . \" chipset and \" . $this->internalMemory . \"GB of internal memory\";\n }",
"public function displayFullSummary()\n {\n return true;\n }",
"function getShowHint() {return $this->readShowHint();}",
"function get_spaces_options($zero_value = true){\r\n\t\t$available_spaces = $this->get_available_spaces();\r\n\t\tif( $available_spaces >= $this->min || ( empty($this->min) && $available_spaces > 0) ) {\r\n\t\t\tob_start();\r\n\t\t\t?>\r\n\t\t\t<select name=\"em_tickets[<?php echo $this->id ?>][spaces]\">\r\n\t\t\t\t<?php \r\n\t\t\t\t\t$min = ($this->min > 0) ? $this->min:1;\r\n\t\t\t\t\t$max = ($this->max > 0) ? $this->max:get_option('dbem_bookings_form_max');\r\n\t\t\t\t?>\r\n\t\t\t\t<?php if($zero_value) : ?><option>0</option><?php endif; ?>\r\n\t\t\t\t<?php for( $i=$min; $i<=$max; $i++ ): ?>\r\n\t\t\t\t\t<option><?php echo $i ?></option>\r\n\t\t\t\t<?php endfor; ?>\r\n\t\t\t</select>\r\n\t\t\t<?php \r\n\t\t\treturn ob_get_clean();\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\t\r\n\t}",
"function print_options(){\n\t\tforeach ($this->options as $value) {\n\t\t\t$this->print_option($value);\n\t\t}\n\t}",
"public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }",
"private function showHowRequestForm() {\r\n $this->config->showPrinterFriendly = false;\r\n echo '<h2>How would you like to use this time?</h2>';\r\n $this->showSubTimeTypeDropDown();\r\n echo '<input type=\"hidden\" name=\"maxCalDays\" value=\"' . $this->maxCalDays . '\" />';\r\n echo '<br/><br/><br/>';\r\n }",
"public function getCustomOptionsRequired()\n {\n $array = parent::getCustomOptionsRequired();\n\n $addArray = array(\n array(\n 'id' => 'advancedreports_stockvssold_options_estimation_threshold',\n 'type' => 'text',\n 'args' => array(\n 'label' => $this->__('Out of Stock Estimation Threshold'),\n 'title' => $this->__('Out of Stock Estimation Threshold'),\n 'name' => 'advancedreports_stockvssold_options_estimation_threshold',\n 'class' => 'validate-greater-than-zero',\n 'required' => true,\n ),\n 'default' => '90',\n ),\n );\n return array_merge($array, $addArray);\n }",
"private function showOptions() : void\n {\n $selectedOption = $this->console->choice(__('Please cheoose your option:'), $this->getAllOptions() );\n $this->setSelectedOption($selectedOption);\n $this->handleOption();\n }",
"public function info() {\n\t\treturn array (\n\t\t\t\t'text_type' => 'selection',\n\t\t\t\t'module' => 'ZSELEX',\n\t\t\t\t'text_type_long' => $this->__ ( 'Deal Of The Day (DOTD)' ),\n\t\t\t\t'allow_multiple' => true,\n\t\t\t\t'form_content' => false,\n\t\t\t\t'form_refresh' => false,\n\t\t\t\t'show_preview' => true,\n\t\t\t\t'admin_tableless' => true \n\t\t);\n\t}",
"public function admin_options(){\r\n echo '<h3>'.__('Netgíró Payment Gateway', 'netgiro').'</h3>';\r\n echo '<p>'.__('Verslaðu á netinu með Netgíró á einfaldan hátt.').'</p>';\r\n echo '<table class=\"form-table\">';\r\n $this -> generate_settings_html();\r\n echo '</table>';\r\n }",
"public function getDefaultOptions()\n {\n\n return array('validation_groups' => array('admEdit', 'Default'));\n\n }",
"public function showing_excerpts() {\n\n\t\tif ( null === $this->showing_excerpts ) {\n\n\t\t\t$this->showing_excerpts = 'yes' === get_option( $this->show_excerpts_option );\n\t\t}\n\n\t\treturn $this->showing_excerpts;\n\t}",
"public function toString()\n {\n return \"GUI is display full\";\n }",
"public function indexAction()\n {\n return '<i>Please select a display mode in the plugin.</i>';\n }",
"function jb_option_defaults() {\n\t \t$arr = array(\n\t\t'jb_featured_cat_slug' => 'home',\n\t\t'jb_featured_content_limit' => 55,\n\t\t'jb_post_content_limit' => 40\n\t);\n\treturn $arr;\n}",
"function options() {\n $options = array();\n \n if (Configure::read('Rating.showMouseOverMessages')) {\n $options = Configure::read('Rating.mouseOverMessages');\n unset($options['login'], $options['rated'], $options['delete']);\n } else {\n $options = range(0, Configure::read('Rating.maxRating'));\n unset($options[0]);\n }\n \n return $options;\n }",
"public function top_show($options)\n {\n $SHOW_RECOMMEND = false;\n $LIMIT_RECOMMEND = 3;\n\n $DIRNAME = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];\n\n $order = $options[1];\n $limit = (int)$options[2];\n $title_length = (int)$options[3];\n $cat_title_length = (int)$options[4];\n $desc_length = (int)$options[5];\n $newdays = (int)$options[6];\n $popular = (int)$options[7];\n $max_width = (int)$options[8];\n $width_default = (int)$options[9];\n\n $gm_mode = isset($options[10]) ? (int)$options[10] : 0;\n $gm_latitude = isset($options[11]) ? (float)$options[11] : 0;\n $gm_longitude = isset($options[12]) ? (float)$options[12] : 0;\n $gm_zoom = isset($options[13]) ? (int)$options[13] : 0;\n $gm_height = isset($options[14]) ? (int)$options[14] : 0;\n $gm_timeout = isset($options[15]) ? (int)$options[15] : 0;\n\n // use config value\n // $gm_desc_length = isset($options[16]) ? intval($options[16]) : 0;\n // $gm_wordwrap = isset($options[17]) ? intval($options[17]) : 0;\n // $gm_marker_width = isset($options[18]) ? intval($options[18]) : 0;\n\n // NOT use\n // $gm_control = isset($options[19]) ? intval($options[19]) : 1;\n // $gm_type_control = isset($options[20]) ? intval($options[20]) : 1;\n\n // time_create\n if (($order != 'hits') && ($order != 'rating') && ($order != 'time_create')) {\n $order = 'time_update';\n }\n\n $lid_array = array();\n\n $block = array();\n $block['dirname'] = $DIRNAME;\n $block['lang_hits'] = _MB_WEBLINKS_HITS;\n $block['lang_rating'] = _MB_WEBLINKS_RATING;\n $block['lang_votes'] = _MB_WEBLINKS_VOTES;\n $block['lang_comments'] = _MB_WEBLINKS_COMMENTS;\n $block['lang_more'] = _MB_WEBLINKS_MORE;\n\n $gm_links = array();\n $show_webmap = false;\n $webmap_div_id = '';\n $webmap_func = '';\n $webmap_style = '';\n\n // config\n $conf =& weblinks_get_config($DIRNAME);\n if (!isset($conf['broken_threshold'])) {\n return $block;\n }\n\n $broken = $conf['broken_threshold'];\n\n $link_param = array(\n 'order' => $order,\n 'title_length' => $title_length,\n 'cat_title_length' => $cat_title_length,\n 'desc_length' => $desc_length,\n 'newdays' => $newdays,\n 'popular' => $popular,\n 'max_width' => $max_width,\n 'width_default' => $width_default,\n\n // hack for multi language\n 'is_japanese_site' => weblinks_multi_is_japanese_site(),\n );\n\n $rows1 = $this->get_rows_order_in_link($order, $broken, $limit);\n if (!is_array($rows1) || !count($rows1)) {\n return $block;\n }\n\n foreach ($rows1 as $row1) {\n $lid_array[] = $row1['lid'];\n $link = $this->build_link($row1, $link_param);\n $block['links'][] = $link;\n\n if ($link['google_use']) {\n $gm_links[] = $link;\n }\n }\n\n // randum recommend link\n if ($SHOW_RECOMMEND && $LIMIT_RECOMMEND) {\n $rows3 = $this->get_rows_recommend_in_link($broken, $LIMIT_RECOMMEND);\n if (!is_array($rows3) || !count($rows3)) {\n return $block;\n }\n\n foreach ($rows3 as $row3) {\n $link = $thos->build_link($row3, $link_param);\n $block['recommend_links'][] = $link;\n\n // not in latest link\n if (!in_array($row3['lid'], $lid_array) && $link['google_use']) {\n $gm_links[] = $link;\n }\n }\n }\n\n $block['show_recommend'] = $SHOW_RECOMMEND;\n\n // google map\n $gm_name = $DIRNAME . '_b_' . $order;\n $gm_param = array(\n 'dirname' => $DIRNAME,\n 'latitude' => $gm_latitude,\n 'longitude' => $gm_longitude,\n 'zoom' => $gm_zoom,\n 'name' => $gm_name,\n 'mode' => $gm_mode,\n 'style_height' => $gm_height,\n 'links' => $gm_links,\n 'conf' => $conf,\n );\n\n $webmap_param = $this->_webmap_class->build_map_block($gm_param);\n if (is_array($webmap_param)) {\n $show_webmap = $webmap_param['show_webmap'];\n $webmap_div_id = $webmap_param['webmap_div_id'];\n $webmap_func = $webmap_param['webmap_func'];\n $webmap_style = $webmap_param['webmap_style'];\n }\n\n $block['show_webmap'] = $show_webmap;\n $block['webmap_div_id'] = $webmap_div_id;\n $block['webmap_func'] = $webmap_func;\n $block['webmap_style'] = $webmap_style;\n $block['webmap_timeout'] = $gm_timeout;\n\n return $block;\n }",
"public function screen_option() {\r\n\t\t$option = 'per_page';\r\n\t\t$args = [\r\n\t\t\t'label' => 'Files',\r\n\t\t\t'default' => 5,\r\n\t\t\t'option' => 'file_per_page'\r\n\t\t];\r\n\r\n\t\tadd_screen_option( $option, $args );\r\n\t\t\r\n\t}",
"function scorm_get_popup_options_array(){\n global $CFG;\n return array('resizable'=> isset($CFG->scorm_resizable) ? $CFG->scorm_resizable : 0,\n 'scrollbars'=> isset($CFG->scorm_scrollbars) ? $CFG->scorm_scrollbars : 0,\n 'directories'=> isset($CFG->scorm_directories) ? $CFG->scorm_directories : 0,\n 'location'=> isset($CFG->scorm_location) ? $CFG->scorm_location : 0,\n 'menubar'=> isset($CFG->scorm_menubar) ? $CFG->scorm_menubar : 0,\n 'toolbar'=> isset($CFG->scorm_toolbar) ? $CFG->scorm_toolbar : 0,\n 'status'=> isset($CFG->scorm_status) ? $CFG->scorm_status : 0);\n}",
"function build_default_core_options() {\n\n $core_options = array(\n 'key' => '',\n 'title' => '',\n 'menu_order' => 0,\n 'position' => 'normal',\n 'style' => 'default',\n 'label_placement' => 'top',\n 'instruction_placement' => 'label',\n 'hide_on_screen' => array()\n );\n\n return $core_options;\n }",
"public function setDisplay(array $display);",
"private static function get_views_options() {\n\t\t$views = FrmProDisplay::getAll( array(), 'post_title' );\n\t\t$views_options = array_map( 'self::set_view_options', $views );\n\t\t$views_options = array_reverse( $views_options );\n\n\t\treturn $views_options;\n\t}",
"public function generic_show($options)\n {\n $DIRNAME = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];\n $limit = (int)$options[1];\n $title_length = (int)$options[2];\n $cat_title_length = (int)$options[3];\n $desc_length = (int)$options[4];\n $newdays = (int)$options[5];\n $popular = (int)$options[6];\n $max_width = (int)$options[7];\n $width_default = (int)$options[8];\n $show_date = (int)$options[9];\n $show_mode_url = (int)$options[10];\n $flag_url_empty = (int)$options[11];\n $cid = (int)$options[12];\n $flag_subcat = (int)$options[13];\n $mode_link = $options[14];\n $flag_random = (int)$options[15];\n $order = $options[16];\n $sort = $options[17];\n\n $gm_mode = isset($options[18]) ? (int)$options[18] : 0;\n $gm_latitude = isset($options[19]) ? (float)$options[19] : 0;\n $gm_longitude = isset($options[20]) ? (float)$options[20] : 0;\n $gm_zoom = isset($options[21]) ? (int)$options[21] : 0;\n $gm_height = isset($options[22]) ? (int)$options[22] : 0;\n $gm_timeout = isset($options[23]) ? (int)$options[23] : 0;\n\n // use config value\n // $gm_desc_length = isset($options[24]) ? intval($options[24]) : 0;\n // $gm_wordwrap = isset($options[25]) ? intval($options[25]) : 0;\n // $gm_marker_width = isset($options[26]) ? intval($options[26]) : 0;\n\n // NOT use\n // $gm_control = isset($options[27]) ? intval($options[27]) : 1;\n // $gm_type_control = isset($options[28]) ? intval($options[28]) : 1;\n\n if (($order != 'time_update')\n && ($order != 'time_create')\n && ($order != 'hits')\n && ($order != 'rating')\n && ($order != 'title')\n ) {\n $order = 'lid';\n }\n\n if ($sort != 'DESC') {\n $sort = 'ASC';\n }\n\n if (($mode_link != 'recommend') && ($mode_link != 'mutual')) {\n $mode_link = '';\n }\n\n $show_title = 1;\n if ($title_length == 0) {\n $show_title = 0;\n }\n\n $gm_links = array();\n $show_webmap = false;\n $webmap_div_id = '';\n $webmap_func = '';\n $webmap_style = '';\n\n $block = array();\n $block['dirname'] = $DIRNAME;\n $block['lang_hits'] = _MB_WEBLINKS_HITS;\n $block['lang_rating'] = _MB_WEBLINKS_RATING;\n $block['lang_votes'] = _MB_WEBLINKS_VOTES;\n $block['lang_comments'] = _MB_WEBLINKS_COMMENTS;\n $block['lang_random'] = _MB_WEBLINKS_RANDOM;\n $block['show_title'] = $show_title;\n $block['show_date'] = $show_date;\n $block['show_mode_url'] = $show_mode_url;\n\n // config\n $conf =& weblinks_get_config($DIRNAME);\n if (!isset($conf['broken_threshold'])) {\n return $block;\n }\n\n $link_param = array(\n 'order' => $order,\n 'title_length' => $title_length,\n 'desc_length' => $desc_length,\n 'cat_title_length' => $cat_title_length,\n 'newdays' => $newdays,\n 'popular' => $popular,\n 'max_width' => $max_width,\n 'width_default' => $width_default,\n );\n\n $sql_param = array(\n 'flag_url_empty' => $flag_url_empty,\n 'flag_subcat' => $flag_subcat,\n 'flag_random' => $flag_random,\n 'mode_link' => $mode_link,\n 'cid' => $cid,\n 'order' => $order,\n 'sort' => $sort,\n 'limit' => $limit,\n 'broken' => $conf['broken_threshold'],\n );\n\n $rows = $this->get_rows_generic_in_link($sql_param);\n if (!is_array($rows) || !count($rows)) {\n return $block;\n }\n\n foreach ($rows as $row) {\n $link = $this->build_link($row, $link_param);\n $block['links'][] = $link;\n\n if ($link['google_use']) {\n $gm_links[] = $link;\n }\n }\n\n // google map\n $gm_name = $DIRNAME . '_b_g_' . $order;\n $gm_param = array(\n 'dirname' => $DIRNAME,\n 'latitude' => $gm_latitude,\n 'longitude' => $gm_longitude,\n 'zoom' => $gm_zoom,\n 'name' => $gm_name,\n 'mode' => $gm_mode,\n 'style_height' => $gm_height,\n 'links' => $gm_links,\n 'conf' => $conf,\n );\n\n $webmap_param = $this->_webmap_class->build_map_block($gm_param);\n if (is_array($webmap_param)) {\n $show_webmap = $webmap_param['show_webmap'];\n $webmap_div_id = $webmap_param['webmap_div_id'];\n $webmap_func = $webmap_param['webmap_func'];\n $webmap_style = $webmap_param['webmap_style'];\n }\n\n $block['show_webmap'] = $show_webmap;\n $block['webmap_div_id'] = $webmap_div_id;\n $block['webmap_func'] = $webmap_func;\n $block['webmap_style'] = $webmap_style;\n $block['webmap_timeout'] = $gm_timeout;\n\n return $block;\n }",
"function selectandprint_filter_tips($filter, $format, $long = FALSE) {\n return t('Begin your select and print list with [selectandprint]. End it with [/selectandprint]. Put each list item on its own line. Separate your list items into groups by adding a @ at the beginning of the line where you want a group header');\n}",
"function options_summary(&$categories, &$options) {\n // It is very important to call the parent function here:\n parent::options_summary($categories, $options);\n\n $block_sets = strip_tags($this->get_option('block_sets'));\n if (empty($block_sets)) {\n $block_sets = t('None');\n }\n\n if (strlen($block_sets) > 16) {\n $block_sets = substr($block_sets, 0, 16) . '...';\n }\n\n $options['block_sets'] = array(\n 'category' => 'block',\n 'title' => t('Sets'),\n 'value' => $block_sets,\n );\n }",
"public function display_minimum_price() {\n\t\t_deprecated_function( 'display_minimum_price', '2.0', 'WC_Name_Your_Price()->display->display_minimum_price' );\n\t\treturn $this->display->display_minimum_price();\n\t}",
"public function render_per_page_options()\n {\n }",
"function displayFilterOptions() {\n\n if ($this->isPageType()) { \n\n $templates = $this->getAllPageTemplates(); \n\n echo '<select name=\"template\">';\n echo '<option value=\"\">Show all</option>';\n \n $currTemplate = isset($_GET['template'])? $_GET['template']:'';\n\n foreach ($templates as $template) {\n echo \"<option value={$template} \";\n if($template == $currTemplate) { echo 'selected=\"selected\"'; }\n echo \">\" . $template .\"</option>\"; \n }\n \n echo '</select>'; \n }\n }",
"public function showList() {\n\t \treturn 0;\n\t }",
"public function getDisplay();",
"public function ovpnDisplayConfigSet()\n {\n foreach ($this as $key=>$value) {\n echo \"$key = $value<br />\\n\";\n }\n }",
"function applicable_formats()\r\n\t\t{\r\n\t\t\treturn array('all' => true);\r\n\t\t}",
"public function getDisplayNames()\n {\n return $this->getOption('display_names');\n }",
"function _sf_get_per_page_options() {\n\t\t\n\t\t//// GETS THE ARRAY\n\t\t$values = explode(\"\\n\", ddp('lst_per_page'));\n\t\tif(!is_array($values)) { $values = array(9); }\n\t\t$opts = array();\n\t\t\n\t\t//// NEED TO VALIDATE THEM\n\t\tforeach($values as $val) {\n\t\t\t\n\t\t\t//// IF ITS A NUMBER\n\t\t\tif(is_numeric(trim($val))) {\n\t\t\t\t\n\t\t\t\t$opts[] = absint(trim($val));\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//// MAKES SURE ITS NOT EMPTY\n\t\tif(count($opts) == 0) { $opts[] = 9; }\n\t\t\n\t\treturn $opts;\n\t\t\n\t}",
"protected function getTabOptions() {\n $options = [\n 'members' => $this->t('Members'),\n 'admins' => $this->t('Administrators'),\n ];\n if (($this->currentUser->hasPermission('manage circle spaces') &&\n $this->moduleHandler->moduleExists('living_spaces_circles')) ||\n $this->moduleHandler->moduleExists('living_spaces_subgroup')\n ) {\n $options['inherit'] = $this->t('Inherited');\n }\n return $options;\n }",
"function help()\n\t{\n\t\t$help['b'] = array();\n\t\t$help['i'] = array();\n\t\t\n\t\t$help['b'][] = 'Laisser une ligne vide entre chaque bloc <em>de même nature</em>.';\n\t\t$help['b'][] = '<strong>Paragraphe</strong> : du texte et une ligne vide';\n\t\t\n\t\tif ($this->getOpt('active_title')) {\n\t\t\t$help['b'][] = '<strong>Titre</strong> : <code>!!!</code>, <code>!!</code>, '.\n\t\t\t'<code>!</code> pour des titres plus ou moins importants';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_hr')) {\n\t\t\t$help['b'][] = '<strong>Trait horizontal</strong> : <code>----</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_lists')) {\n\t\t\t$help['b'][] = '<strong>Liste</strong> : ligne débutant par <code>*</code> ou '.\n\t\t\t'<code>#</code>. Il est possible de mélanger les listes '.\n\t\t\t'(<code>*#*</code>) pour faire des listes de plusieurs niveaux. '.\n\t\t\t'Respecter le style de chaque niveau';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_pre')) {\n\t\t\t$help['b'][] = '<strong>Texte préformaté</strong> : espace devant chaque ligne de texte';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_quote')) {\n\t\t\t$help['b'][] = '<strong>Bloc de citation</strong> : <code>></code> ou '.\n\t\t\t'<code>;:</code> devant chaque ligne de texte';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_fr_syntax')) {\n\t\t\t$help['i'][] = 'La correction de ponctuation est active. Un espace '.\n\t\t\t\t\t\t'insécable remplacera automatiquement tout espace '.\n\t\t\t\t\t\t'précédant les marques \";\",\"?\",\":\" et \"!\".';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_em')) {\n\t\t\t$help['i'][] = '<strong>Emphase</strong> : deux apostrophes <code>\\'\\'texte\\'\\'</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_strong')) {\n\t\t\t$help['i'][] = '<strong>Forte emphase</strong> : deux soulignés <code>__texte__</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_br')) {\n\t\t\t$help['i'][] = '<strong>Retour forcé à la ligne</strong> : <code>%%%</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_ins')) {\n\t\t\t$help['i'][] = '<strong>Insertion</strong> : deux plus <code>++texte++</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_del')) {\n\t\t\t$help['i'][] = '<strong>Suppression</strong> : deux moins <code>--texte--</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_urls')) {\n\t\t\t$help['i'][] = '<strong>Lien</strong> : <code>[url]</code>, <code>[nom|url]</code>, '.\n\t\t\t'<code>[nom|url|langue]</code> ou <code>[nom|url|langue|titre]</code>.';\n\t\t\t\n\t\t\t$help['i'][] = '<strong>Image</strong> : comme un lien mais avec une extension d\\'image.'.\n\t\t\t'<br />Pour désactiver la reconnaissance d\\'image mettez 0 dans un dernier '.\n\t\t\t'argument. Par exemple <code>[image|image.gif||0]</code> fera un lien vers l\\'image au '.\n\t\t\t'lieu de l\\'afficher.'.\n\t\t\t'<br />Il est conseillé d\\'utiliser la nouvelle syntaxe.';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_img')) {\n\t\t\t$help['i'][] = '<strong>Image</strong> (nouvelle syntaxe) : '.\n\t\t\t'<code>((url|texte alternatif))</code>, '.\n\t\t\t'<code>((url|texte alternatif|position))</code> ou '.\n\t\t\t'<code>((url|texte alternatif|position|description longue))</code>. '.\n\t\t\t'<br />La position peut prendre les valeur L ou G (gauche), R ou D (droite) ou C (centré).';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_anchor')) {\n\t\t\t$help['i'][] = '<strong>Ancre</strong> : <code>~ancre~</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_acronym')) {\n\t\t\t$help['i'][] = '<strong>Acronyme</strong> : <code>??acronyme??</code> ou '.\n\t\t\t'<code>??acronyme|titre??</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_q')) {\n\t\t\t$help['i'][] = '<strong>Citation</strong> : <code>{{citation}}</code>, '.\n\t\t\t'<code>{{citation|langue}}</code> ou <code>{{citation|langue|url}}</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_code')) {\n\t\t\t$help['i'][] = '<strong>Code</strong> : <code>@@code ici@@</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_footnotes')) {\n\t\t\t$help['i'][] = '<strong>Note de bas de page</strong> : <code>$$Corps de la note$$</code>';\n\t\t}\n\t\t\n\t\t$res = '<dl class=\"wikiHelp\">';\n\t\t\n\t\t$res .= '<dt>Blocs</dt><dd>';\n\t\tif (count($help['b']) > 0)\n\t\t{\n\t\t\t$res .= '<ul><li>';\n\t\t\t$res .= implode(' ;</li><li>', $help['b']);\n\t\t\t$res .= '.</li></ul>';\n\t\t}\n\t\t$res .= '</dd>';\n\t\t\n\t\t$res .= '<dt>Éléments en ligne</dt><dd>';\n\t\tif (count($help['i']) > 0)\n\t\t{\n\t\t\t$res .= '<ul><li>';\n\t\t\t$res .= implode(' ;</li><li>', $help['i']);\n\t\t\t$res .= '.</li></ul>';\n\t\t}\n\t\t$res .= '</dd>';\n\t\t\n\t\t$res .= '</dl>';\n\t\t\n\t\treturn $res;\t\n\t}",
"function show_excerpts() {\n\treturn 'excerpts';\n}",
"public function options_page_overview() \n\t\t{\n\t\t\t$html = '';\n\t\t\t\n\t\t\tforeach( $this->size_groups as $size_group => $sizes ) \n\t\t\t{\n\t\t\t\t$html .= '<h3>' . $this->get_group_headline( $size_group ) . '</h3>';\n\t\t\t\t\n\t\t\t\t$html .= '<ul>';\n\t\t\t\t\n\t\t\t\tforeach( $sizes as $key => $image ) \n\t\t\t\t{\n\t\t\t\t\t$info = $image['width'] . '*' . $image['height'];\n\t\t\t\t\tif( isset( $image['crop'] ) && true === $image['crop'] )\n\t\t\t\t\t{\n\t\t\t\t\t\t$info .= ' ' . __( '(cropped)', 'avia_framework' );\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$info .= ' - ' . $this->get_image_key_info( $key );\n\t\t\t\t\t\n\t\t\t\t\t$html .= '<li>' . $info . '</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html .= '</ul>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}",
"public function isCatalogBackendMinQtyVisible()\n {\n return Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_BACKEND_MIN_QTY);\n }"
] | [
"0.6745142",
"0.5972785",
"0.59471923",
"0.5920971",
"0.58925045",
"0.5819825",
"0.579602",
"0.5783647",
"0.5685275",
"0.56688607",
"0.56592786",
"0.56036586",
"0.55998087",
"0.55973196",
"0.5549102",
"0.5523627",
"0.5499107",
"0.54899323",
"0.5485577",
"0.54766375",
"0.5441133",
"0.54364246",
"0.5426016",
"0.54254234",
"0.5425046",
"0.5423287",
"0.5418956",
"0.54180473",
"0.54061913",
"0.5405394",
"0.5386998",
"0.53751355",
"0.53718084",
"0.53651965",
"0.53612936",
"0.53594947",
"0.535882",
"0.5350838",
"0.5350089",
"0.5327721",
"0.53096163",
"0.530262",
"0.528268",
"0.5274941",
"0.5273339",
"0.5273339",
"0.5268799",
"0.52656275",
"0.52651036",
"0.5264762",
"0.5259254",
"0.5258317",
"0.52548045",
"0.52378947",
"0.5235058",
"0.52305454",
"0.5229296",
"0.52288437",
"0.5226462",
"0.52250105",
"0.521429",
"0.5212276",
"0.5208361",
"0.52006435",
"0.5198231",
"0.51764053",
"0.51757526",
"0.517295",
"0.51610684",
"0.5159127",
"0.5132903",
"0.5127915",
"0.5127181",
"0.5119695",
"0.5117106",
"0.5115107",
"0.51137817",
"0.51107967",
"0.51080304",
"0.5107743",
"0.5101111",
"0.51004755",
"0.5095885",
"0.50916934",
"0.50897944",
"0.50875545",
"0.5087005",
"0.50818795",
"0.5077295",
"0.5077062",
"0.50737196",
"0.5073214",
"0.50727624",
"0.506893",
"0.50655043",
"0.50652426",
"0.50588334",
"0.50576866",
"0.5054498",
"0.50541306"
] | 0.5195128 | 65 |
Parse and return an array of extensions from the XML. | protected function parseExtensions(\SimpleXMLElement $extensions): array
{
$extensions = $extensions->asXML();
$return = array();
if (preg_match('/<gpxtpx:hr>(.*)<\/gpxtpx:hr>/', $extensions, $matches)) {
$return[] = HR::fromValue($matches[1]);
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getExtensionsForCheck()\n {\n $res = array();\n $items = (array) $this->getNode(self::XML_PATH_CHECK_EXTENSIONS);\n\n foreach ($items as $name => $value) {\n if (!empty($value)) {\n $res[$name] = array();\n foreach ($value as $subname => $subvalue) {\n $res[$name][] = $subname;\n }\n }\n else {\n $res[$name] = (array) $value;\n }\n }\n\n return $res;\n }",
"public function getSupportedExtensions()\n\t{\n\t\treturn array('xml');\n\t}",
"public function getExtensions(): array;",
"public function getExtensions();",
"public static function getAllExtensions():array;",
"public function extensions(): array;",
"public function getExtensions() {}",
"public function getExtensions() {}",
"protected function getExtensionsData()\n {\n $result = [];\n try {\n $extensionsData = file_get_contents(self::URL_EXTENSIONS);\n\n if ($extensionsData && is_string($extensionsData)) {\n $result = json_decode($extensionsData, true);\n }\n } catch (\\Exception $e) {\n return false;\n }\n\n return $result;\n }",
"public function extensionsContent(): array;",
"public static function getList(\\DOMElement $parent)\n {\n $ret = array();\n foreach (Utils::xpQuery($parent, './saml_protocol:Extensions/*') as $node) {\n $ret[] = new Chunk($node);\n }\n\n return $ret;\n }",
"public static function getLoadedExtensionListArray() {}",
"public function getExtensionsAsArray() {\n if($this->mode == 'serial') {\n return $this->getSerialExtensionsAsArray();\n }\n else {\n return $this->getParallelExtensionsAsArray();\n }\n }",
"protected function getExtensions() {\n $listing = new ExtensionDiscovery($this->root);\n // Ensure that tests in all profiles are discovered.\n $listing->setProfileDirectories([]);\n $extensions = $listing->scan('module', TRUE);\n $extensions += $listing->scan('profile', TRUE);\n $extensions += $listing->scan('theme', TRUE);\n return $extensions;\n }",
"public function listExtensions()\n {\n $result = [];\n foreach ($this->extensionClassNames as $className) {\n $result[] = $this->getExtension($className);\n }\n\n usort($result, function($a, $b) {\n if ($a->getExtensionSortOrder() >= $b->getExtensionSortOrder()) {\n return 1;\n }\n\n return -1;\n });\n\n return $result;\n }",
"public function getExtensions($extension = null, $version = null)\n {\n $extensions = array(\n 'dom' => array('5.0.0', '', '20031129')\n );\n return $extensions;\n }",
"public function getExtensions()\n {\n return $this->extension;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getExtensions()\n {\n return $this->extensions;\n }",
"public function getValidExtensions();",
"public function extensions(): array\n {\n return collect($this->extensions)\n ->filter(fn (bool $enabled) => $enabled)\n ->keys()\n ->mapWithKeys(fn (string $extension) => [\n $extension => $this->meta(\"extensions.$extension.view\") ?? ('seo::extensions.' . $extension),\n ])\n ->toArray();\n }",
"public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach ($extensions as $extension) {\n $results[$extension] = extension_loaded($extension);\n }\n\n return $results;\n }",
"public static function loadedExtensions()\n {\n $list = [];\n foreach( get_loaded_extensions() as $ext )\n {\n $ext = strtolower( trim( $ext ) );\n $list[ $ext ] = $ext;\n }\n ksort( $list );\n return $list;\n }",
"public static function getAllowedExtension()\n\t{\n\t\treturn ['xml' => 'XML'];\n\t}",
"public static function getExtensions()\n {\n return self::$_extensions;\n }",
"public function get_supported_extensions() {\n return array();\n }",
"public function all()\n\t{\n\t\t$extensions = array();\n\n\t\t// Loop through extensions directories\n\t\tforeach ($this->extensions_directories() as $directory)\n\t\t{\n\t\t\t// Get our extension slug - always\n\t\t\t// matches the folder name.\n\t\t\t$slug = basename($directory);\n\n\t\t\t// Read extension info. Always do this even\n\t\t\t// if no details are required as this will\n\t\t\t// validate the extension.\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$extensions[$slug] = $this->get($slug);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tksort($extensions);\n\t\treturn array_values($extensions);\n\t}",
"protected function getExtensions()\n {\n if (file_exists(realpath(__DIR__.'/../../../../../config/twig.php'))) {\n $this->config = require realpath(__DIR__.'/../../../../../config/twig.php');\n } else {\n $this->config = require realpath(__DIR__.'/../../config/twig.php');\n }\n\n return isset($this->config['extensions']) ? $this->config['extensions'] : [];\n }",
"public static function getExtensions()\n {\n }",
"public function getAvailableExtensions() {}",
"public static function getLoadedExtensions(): array\n {\n $result = [];\n\n $extensions = get_loaded_extensions();\n asort($extensions);\n\n foreach ($extensions as $extension) {\n $result[$extension] = static::getVersion($extension);\n }\n\n return $result;\n }",
"public function getAcceptExtensions();",
"protected function getExtensions()\n {\n if (!(Mage::app()->loadCache('alfa9_modules_html')) ||\n (time() - Mage::app()->loadCache('alfa9_modules_html_timestamp')) > Mage::getStoreConfig(Alfa9_Base_Helper_Data::XML_PATH_RSS_DELAY)\n ) {\n $client = new Zend_Http_Client(Alfa9_Base_Helper_Data::HTML_MODULES_URL);\n $response = $client->request();\n if ($response->getStatus()==200) {\n $extensions = new Zend_Dom_Query($response->getBody());\n Mage::app()->saveCache(time(), 'alfa9_modules_html_timestamp');\n } else {\n $extensions = NULL;\n Mage::getSingleton('adminhtml/session')->addError($this->__('Our online shop is under maintenance right now. We are sorry for the inconveniences, but we will return back to bussines shortly.'));\n }\n Mage::app()->saveCache(serialize($extensions), 'alfa9_modules_html');\n }\n return @unserialize(Mage::app()->loadCache('alfa9_modules_html'));\n }",
"protected function getAllExtensionNames()\n {\n $extensionNames = $this->getMageBridge()->_module_()->getAllExtensionNames();\n return is_array($extensionNames) ? $extensionNames : array();\n }",
"protected function getExtensionsPackagesData()\n {\n $resultData = [];\n $extensionsParsedJson = $this->getExtensionsData();\n\n if ($extensionsParsedJson && is_array($extensionsParsedJson)) {\n foreach ($extensionsParsedJson as $extName => $extData) {\n if ($extName && $extData) {\n $resultData[$extName] = $extData;\n }\n }\n }\n\n return $resultData;\n }",
"public function extensions();",
"protected function getExtensionsToLoad() {}",
"protected function getAcceptedExtensions(): array\n {\n return array_keys($this->getConfigResolverAdapters());\n }",
"static public function getAllowedExtensions()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('extention')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->extention;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public final function getAcceptedExtensions() { \n return $this->acceptedExtensions; }",
"private function getExtensions($zend = false)\n {\n $data = array();\n $extensions = get_loaded_extensions($zend);\n foreach ($extensions as $extension) {\n $data[$extension] = phpversion($extension);\n }\n\n return $data;\n }",
"public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }",
"public function phpExt(): array\n {\n return \\get_loaded_extensions();\n }",
"public function getExtensions($extension = null, $version = null)\n {\n $extensions = array(\n 'filter' => array('5.2.0', '', '0.11.0')\n );\n return $extensions;\n }",
"public function getExtensions($extension = null, $version = null);",
"protected function getAcceptFileTypes()\n {\n $extensions = $this->getValidator()->getAllowedExtensions();\n if (!$extensions) {\n return [];\n }\n $extentionString = \"\";\n $i = 0;\n foreach ($extensions as $extension) {\n if ($i == 0) {\n $extentionString .= \".{$extension}\";\n } else {\n $extentionString .= \", .{$extension}\";\n }\n $i++;\n }\n return $extentionString;\n }",
"public function ext() :array\n {\n $extension = DB::query(\"SELECT `link_table`.`lt_size` AS 'size', `file_extension`.`fe_extension` AS 'extension' FROM `user_table` JOIN `link_table` ON `user_table`.`ut_id` = `link_table`.`ut_link` JOIN `file_extension` ON `file_extension`.`fe_id` = `link_table`.`fe_link` WHERE `user_table`.`ut_id` = :u_id\", array(':u_id'=>$_SESSION['user_id']));\n $ex = [];\n $i = 0;\n foreach ($extension as $ext) {\n $ex[$i] = array(strtoupper($ext['extension']), round($ext['size']/1048576, 2));\n $i++;\n }\n return $ex;\n }",
"protected function getExtensions()\r\n {\r\n return array(new ValidatorExtension(Validation::createValidator()));\r\n }",
"public function gatherExtensionVersions()\n {\n $extensions = array(\n 'Iparcel_All' => 0,\n 'Iparcel_CartHandoff' => 0,\n 'Iparcel_GlobaleCommerce' => 0,\n 'Iparcel_Logistics' => 0\n );\n\n $allExtensions = Mage::app()->getConfig()->getNode('modules')->asArray();\n\n foreach ($extensions as $key => &$version) {\n if (array_key_exists($key, $allExtensions)) {\n $version = $allExtensions[$key]['version'];\n } else {\n unset($extensions[$key]);\n }\n }\n\n return $extensions;\n }",
"private function extensionNameToCriteria(string $extensionName): array\n\t{\n\t\t$parts = explode('_', $extensionName, 3);\n\n\t\tswitch ($parts[0])\n\t\t{\n\t\t\tcase 'pkg':\n\t\t\t\treturn [\n\t\t\t\t\t'type' => 'package',\n\t\t\t\t\t'element' => $extensionName,\n\t\t\t\t];\n\n\t\t\tcase 'com':\n\t\t\t\treturn [\n\t\t\t\t\t'type' => 'component',\n\t\t\t\t\t'element' => $extensionName,\n\t\t\t\t];\n\n\t\t\tcase 'plg':\n\t\t\t\treturn [\n\t\t\t\t\t'type' => 'plugin',\n\t\t\t\t\t'folder' => $parts[1],\n\t\t\t\t\t'element' => $parts[2],\n\t\t\t\t];\n\n\t\t\tcase 'mod':\n\t\t\t\treturn [\n\t\t\t\t\t'type' => 'module',\n\t\t\t\t\t'element' => $extensionName,\n\t\t\t\t\t'client_id' => 0,\n\t\t\t\t];\n\n\t\t\t// That's how we note admin modules\n\t\t\tcase 'amod':\n\t\t\t\treturn [\n\t\t\t\t\t'type' => 'module',\n\t\t\t\t\t'element' => substr($extensionName, 1),\n\t\t\t\t\t'client_id' => 1,\n\t\t\t\t];\n\n\t\t\tcase 'file':\n\t\t\t\treturn [\n\t\t\t\t\t'type' => 'file',\n\t\t\t\t\t'element' => $extensionName,\n\t\t\t\t];\n\n\t\t\tcase 'lib':\n\t\t\t\treturn [\n\t\t\t\t\t'type' => 'library',\n\t\t\t\t\t'element' => $parts[1],\n\t\t\t\t];\n\t\t}\n\n\t\treturn [];\n\t}",
"protected function get_addons() {\n\t\t//preinitialize addon array\n\t\t$addons = array();\n\n\t\t//get a dir object on the addon directory\n\t\t$addon_directory = D_INCLUDE.'layout/addons/';\n\t\t$addon_directory_object = dir($addon_directory);\n\n\t\t//read through each file\n\t\twhile (false !== ($file = $addon_directory_object->read())) {\n\t\t\t//skip the unix virtual . and .. files\n\t\t\tif ($file === '.' or $file === '..') continue;\n\n\t\t\t//get the type of the file, include it and save it to an array\n\t\t\t//example: function.abc.php\n\t\t\t$filetype = explode('.', $file);\n\t\t\tswitch ($filetype[0]) {\n\t\t\t\t//function\n\t\t\t\tcase 'function':\n\t\t\t\t\tinclude_once($addon_directory.$file);\n\t\t\t\t\tif (function_exists(\"layout_\".$filetype[1])) {\n\t\t\t\t\t\tarray_push($addons, $filetype[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrigger_error('Addon '.htmlentities($file, ENT_QUOTES).' included but not recognized.', E_USER_NOTICE);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t//other\n\t\t\t\tcase 'other':\n\t\t\t\t\tinclude_once($addon_directory.$file);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\ttrigger_error('Addon '.htmlentities($file, ENT_QUOTES).' not recognized.', E_USER_NOTICE);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $addons;\n\t}",
"public function load_extensions()\n\t{\n\t\t$this->extensions = array();\n\n\t\t// Do not try to load any extensions if the extension table\n\t\t// does not exist or when installing or updating.\n\t\t// Note: database updater invokes this code, and in 3.0\n\t\t// there is no extension table therefore the rest of this function\n\t\t// fails\n\t\tif (defined('IN_INSTALL') || version_compare($this->config['version'], '3.1.0-dev', '<'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$sql = 'SELECT *\n\t\t\tFROM ' . $this->extension_table;\n\n\t\t$result = $this->db->sql_query($sql);\n\t\t$extensions = $this->db->sql_fetchrowset($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\tforeach ($extensions as $extension)\n\t\t{\n\t\t\t$extension['ext_path'] = $this->get_extension_path($extension['ext_name']);\n\t\t\t$this->extensions[$extension['ext_name']] = $extension;\n\t\t}\n\n\t\tksort($this->extensions);\n\n\t\tif ($this->cache)\n\t\t{\n\t\t\t$this->cache->put($this->cache_name, $this->extensions);\n\t\t}\n\t}",
"public function getAllowedExtensions()\n {\n return $this->_allowedExtensions;\n }",
"protected static function getExtensionConfiguration(): array\n {\n return GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('lux');\n }",
"function getExtList() {\n\t\tGLOBAL $LANG;\n\n\t\t$confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['llxmltranslate']);\n\n\t\t$extList = array('' => '');\n\t\tforeach($this->extPathList as $path) {\n\t\t\t$dir = PATH_site . $path;\n\t\t\tif (is_dir($dir)) {\n\t\t\t\t$dirs = t3lib_div::get_dirs($dir);\n\t\t\t\tif (is_array($dirs)) {\n\t\t\t\t\tforeach ($dirs as $dirname) {\n\t\t\t\t\t\tif ($dirname{0} != '.') {\n\t\t\t\t\t\t\t$path = $dir . $dirname;\n\t\t\t\t\t\t\t$version = $this->getExtVersion($dirname, $path);\n\t\t\t\t\t\t\tif ($version) {\n\t\t\t\t\t\t\t\t$extTitle = $this->getExtTitle($dirname, $path);\n\t\t\t\t\t\t\t\t$extTitle = str_replace(' ',' ',$this->mb_str_pad($extTitle, 45));\n\t\t\t\t\t\t\t\t$dirname = str_replace(' ',' ',$this->mb_str_pad($dirname, 30));\n\t\t\t\t\t\t\t\tif ($confArr['OrderByTitleExtension']) {\n\t\t\t\t\t\t\t\t\t$TitleInFirst = 1;\n\t\t\t\t\t\t\t\t\t$extList[$path] = $extTitle.$dirname.$version;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$TitleInFirst = 0;\n\t\t\t\t\t\t\t\t\t$extList[$path] = $dirname.$extTitle.$version;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($confArr['HideExtensionWithoutFiles']) {\n\t\t\t\t\t\t\t\t\t// Hide extension without files\n\t\t\t\t\t\t\t\t\t$files = $this->getllxmlFiles($path);\n\t\t\t\t\t\t\t\t\tif (empty($files))\t{\n\t\t\t\t\t\t\t\t\t\tunset($extList[$path]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tasort($extList);\n\t\tif ($TitleInFirst) {\n\t\t\t$Select_header = str_replace(' ',' ',$this->mb_str_pad($LANG->getLL('title_extension'),45)).str_replace(' ',' ',$this->mb_str_pad($LANG->getLL('key_extension'),30)).$LANG->getLL('version_extension');\n\t\t} else {\n\t\t\t$Select_header = str_replace(' ',' ',$this->mb_str_pad($LANG->getLL('key_extension'),30)).str_replace(' ',' ',$this->mb_str_pad($LANG->getLL('title_extension'),45)).$LANG->getLL('version_extension');\n\t\t}\n\t\t// Delete empty line (where do from this line ?)\n\t\tforeach($extList as $key => $value) {\n\t\t\t$temp = trim($key);\n\t\t\tif(empty($temp)){\n\t\t\t\tunset($extList[$key]);\n\t\t\t}\n\t\t}\n\t\t// Add new option for statistic view only\n\t\t$statistic = array();\n\t\tif ($this->MOD_SETTINGS['function'] == 4) {\n\t\t\t$statistic = array('' => $LANG->getLL('view_global_statistic'),'____' => str_replace(' ',' ',$this->mb_str_pad('',82,'=')));\n\t\t}\n\t\t$extList = array_merge(array('__' => $Select_header, '___' => str_replace(' ',' ',$this->mb_str_pad('',82,'='))),$statistic,$extList);\n\t\treturn $extList;\n\t}",
"public function getAllowedExtensions()\n {\n return $this->allowedExtensions;\n }",
"public function getAllowedExtensions()\n {\n return $this->allowedExtensions;\n }",
"protected function getFileExtensions() {\n\t\treturn $this->fileExtensions;\n\t}",
"public function getAllowedExtensions(){\n return $this->allowedExtensions;\n }",
"public function getSupportedFileExtensions() {}",
"public function getSEOExtensions() {\n\t\t$this->load->model('setting/setting');\n\t\t\t\t\n\t\t$installed_extensions = array();\n\t\t$query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"extension WHERE type = 'module' ORDER BY code\");\n\t\tforeach ($query->rows as $result) {\n\t\t\t$installed_extensions[] = $result['code'];\n\t\t}\n\t\t\n\t\t$installed_seo_extensions = $this->model_setting_setting->getSetting('d_seo_extension');\n\t\t$installed_seo_extensions = isset($installed_seo_extensions['d_seo_extension_install']) ? $installed_seo_extensions['d_seo_extension_install'] : array();\n\t\t\n\t\t$seo_extensions = array();\n\t\t$files = glob(DIR_APPLICATION . 'controller/extension/module/' . $this->codename . '*.php');\n\t\tif ($files) {\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$seo_extension = basename($file, '.php');\n\t\t\t\tif (in_array($seo_extension, $installed_extensions) && in_array($seo_extension, $installed_seo_extensions)) {\n\t\t\t\t\t$seo_extensions[] = $seo_extension;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $seo_extensions;\n\t}",
"public function getNameAndExtension()\n {\n\t$name = $this->getName();\n\t$nameWithoutExtension = $this->getName();\n\t$extension = '';\n\n\t$pointIndex = strrpos($name, '.');\n\tif ( $pointIndex !== false )\n\t{\n\t $nameWithoutExtension = substr($name, 0, $pointIndex);\n\t $extension = substr($name, $pointIndex);\n\t}\n\n\treturn Array($nameWithoutExtension, $extension);\n }",
"function getInstalledExtensions()\r\n\t{\r\n\t\tglobal $sourcedir, $smcFunc, $modSettings;\r\n\t\r\n\t\t$extensions = array();\r\n\t\tif ($dh = opendir($sourcedir . '/ProjectTools/'))\r\n\t\t{\r\n\t\t\twhile (($file = readdir($dh)) !== false)\r\n\t\t\t{\r\n\t\t\t\tif ($file[0] == '.')\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\tif (is_dir($sourcedir . '/ProjectTools/' . $file . '/') && file_exists($sourcedir . '/ProjectTools/' . $file . '/Extension.php'))\r\n\t\t\t\t{\r\n\t\t\t\t\t$extension = self::loadExtension($file, false);\r\n\t\t\t\t\t\r\n\t\t\t\t\t$extInfo = $extension->getExtensionInfo();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$extensions[$file] = array(\r\n\t\t\t\t\t\t'id' => $file,\r\n\t\t\t\t\t\t'name' => $extInfo['title'],\r\n\t\t\t\t\t\t'version' => $extInfo['version'],\r\n\t\t\t\t\t\t'api_version' => $extInfo['api_version'],\r\n\t\t\t\t\t\t'filename' => $file,\r\n\t\t\t\t\t\t'enabled' => in_array($file, $modSettings['projectExtensions']),\r\n\t\t\t\t\t\t'can_enable' => $extInfo['api_version'] === 2,\r\n\t\t\t\t\t\t'can_disable' => true, // Todo: check if it's in use\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tclosedir($dh);\r\n\t\t\r\n\t\treturn $extensions;\r\n\t}",
"function getllxmlFiles($extPath)\t{\n\n\t\t// Initialize:\n\t\t$files = array();\n\n\t\tif (!$extPath) {\n\t\t\t// Traverse extension locations:\n\t\t\tforeach($this->extPathList as $path)\t{\n\t\t\t\tif (is_dir(PATH_site . $path))\t{\n\t\t\t\t\t$files = t3lib_div::getAllFilesAndFoldersInPath($files, PATH_site . $path, 'xml');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$files = t3lib_div::getAllFilesAndFoldersInPath($files, $extPath . '/', 'xml');\n\t\t}\n\n\t\t// Remove prefixes\n\t\t$files = t3lib_div::removePrefixPathFromList($files, PATH_site);\n\n\t\t// Remove all non-locallang files (looking at the prefix)\n\t\tforeach($files as $key => $value)\t{\n\t\t\tif (substr(basename($value), 0, 9) != 'locallang')\t{\n\t\t\t\tunset($files[$key]);\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}",
"public function getExtension();",
"public function getExtension();",
"public function getExtension();",
"static function xmlToArray($xml)\n {\n $domXml = new DOMDocument();\n if (!$domXml->loadxml($xml))\n {\n throw new Exception('Invalid XML');\n }\n $rootNode = $domXml->documentElement;\n $array = array();\n foreach($rootNode->childNodes as $child)\n {\n $array[$child->nodeName] = self::xmlDecode($child->nodeValue);\n }\n return $array;\n }",
"public function getExtensions($extension = null, $version = null)\n {\n $extensions = array(\n 'apc' => array('4.0.0', '', '3.1.7')\n );\n return $extensions;\n }",
"public static function mimes_by_ext($extension)\r\n {\r\n $mimes = Core::config('mimes');\r\n\r\n return isset($mimes[$extension])?((array)$mimes[$extension]):array();\r\n }",
"public function getSupportedExtensions()\n {\n return array_keys($this->convertersByExtension);\n }",
"public static function getExtensions($mime)\n {\n if (isset(static::$mimes[$mime])) {\n return (array) static::$mimes[$mime];\n }\n return null;\n }",
"public function getExttypes(){\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('distinct(type)');\n\t\t\t$query->from('#__extensions');\n\t\t\t$query->where('protected=0');\n\t\t\t$db->setQuery($query);\n\t\t\t$arrDatos = $db->loadRowList();\n\t\t\tif(!$arrDatos){\n\t\t\t\t$arrDatos= array();\n\t\t\t}\n\t\t\treturn $arrDatos;\n\t\t}",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"public function getExtensionAttributes();",
"private function getSupportedMimeTypes(string $extensions): array\n {\n $mimeTypes = [];\n\n foreach (explode(',', $extensions) as $extension) {\n if (isset($GLOBALS['TL_MIME'][$extension])) {\n $mimeTypes[] = $GLOBALS['TL_MIME'][$extension];\n }\n }\n\n return $mimeTypes;\n }",
"public function getExtensionNames()\n {\n if ($this->extensionNames == '*') {\n $this->extensionNames = $this->getAllExtensionNames();\n }\n return $this->extensionNames;\n }",
"public function getExtension() {}",
"public function getExtension() {}",
"public function getPhpExtensionsConfig() {\n\t\treturn $this->_getConfigValueArrayMultiple('PHPextensions');\n\t}",
"public function getMatchableExtensions();",
"function getExtension() ;",
"function getExtensionsFile($filename) {\r\n\t\tif ( !file_exists($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' does not exist\");\r\n\t\t}\r\n\t\tif ( !is_readable($filename) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' is not readable\");\r\n\t\t}\r\n\t\t\r\n\t\t$exts = @parse_ini_file($filename, true);\r\n\t\tif ( !is_array($exts) ) {\r\n\t\t\tthrow new ftpException(\"Extensions-file '$filename' could not be loaded\");\r\n\t\t}\r\n\t\t\r\n\t\t$this->_file_extensions = array();\r\n\t\t\r\n\t\tif ( isset($exts['ASCII']) ) {\r\n\t\t\tforeach ( $exts['ASCII'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_ASCII;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( isset($exts['BINARY']) ) {\r\n\t\t\tforeach ( $exts['BINARY'] as $ext => $bogus ) {\r\n\t\t\t\t$this->_file_extensions[$ext] = FTP_BINARY;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"protected function encodeExtensions($data)\n {\n $extensions = [];\n\n for( $j = 0; $j < strlen($data); )\n {\n $extType = Core::_unpack( 'n', $data[$j] . $data[$j+1] );\n $extDataLen = Core::_unpack( 'n', $data[$j+2] . $data[$j+3] );\n\n if( 0 == $extDataLen )\n {\n $j += 2 + 2;\n continue;\n }\n\n $extData = substr( $data, $j+4, $extDataLen );\n\n $j += 2 + 2 + $extDataLen;\n\n $extensions[] = ['type' => $extType, 'data' => $extData];\n }\n\n return $extensions;\n }",
"protected function getContainerExtensions(): array\n {\n return [new BestItContentfulExtension()];\n }",
"public abstract function getExtension();"
] | [
"0.7070322",
"0.6718482",
"0.6706279",
"0.66566133",
"0.66333497",
"0.66222453",
"0.64639866",
"0.64633375",
"0.6461583",
"0.6433685",
"0.6416894",
"0.6402385",
"0.6389342",
"0.6364007",
"0.62730086",
"0.61852634",
"0.6159045",
"0.6148548",
"0.6148548",
"0.6148548",
"0.6148548",
"0.61477655",
"0.6123394",
"0.6067732",
"0.60479283",
"0.602232",
"0.60197884",
"0.60006183",
"0.59558153",
"0.5953549",
"0.5939869",
"0.5911191",
"0.5896241",
"0.5866828",
"0.58016336",
"0.57868534",
"0.57678944",
"0.5766251",
"0.5747599",
"0.57451564",
"0.5743478",
"0.57072437",
"0.5677982",
"0.5675248",
"0.5675248",
"0.5641918",
"0.56149465",
"0.5611888",
"0.56048113",
"0.5598479",
"0.55834657",
"0.55766165",
"0.5564372",
"0.55540454",
"0.5528857",
"0.55275923",
"0.5511425",
"0.55060995",
"0.55060995",
"0.54693466",
"0.54478484",
"0.544317",
"0.54143804",
"0.541273",
"0.54087025",
"0.5406423",
"0.5383093",
"0.5383093",
"0.5383093",
"0.5343783",
"0.53285986",
"0.53238666",
"0.5315504",
"0.53140527",
"0.5301398",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52886504",
"0.52804905",
"0.5260868",
"0.5256084",
"0.5253224",
"0.5250435",
"0.52190983",
"0.52141386",
"0.52125674",
"0.5203531",
"0.5190653",
"0.5181624"
] | 0.691873 | 1 |
Create a new mailing list | public function testExistingMember() {
$this->Member->MailList->save(['address' => 'test2', 'domain_id' => '52f8928d-6588-4f6f-ab87-430ef6570d8e']);
$mailListId = $this->Member->MailList->id;
$member = [
'Member' => [
'name' => 'Test Guy',
'email_address' => '[email protected]'
],
'MailList' => ['MailList' => [$mailListId]]
];
$this->Member->save($member);
//Should still only be two members
$count = $this->Member->find('count');
$this->assertEqual($count, 2);
//But this member should have 2 lists
$member = $this->Member->find('first', [
'conditions' => ['email_address' => '[email protected]'],
'contain' => ['MailList']
]);
$this->assertCount(2, $member['MailList']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function create_contact($list_id, $email);",
"public function create(Request $request)\n {\n \n if ($request->ajax()) {\n return view('admin.mailing_lists.form');\n }\n\n return view('admin.mailing_lists.create');\n }",
"public function create($n,$d){\n if(get_instance()->ecl('Instance')->mod('lists', 'save_list', [get_instance()->ecl('Instance')->user(),'email',$n,$d])) {\n display_mess(112);\n } else {\n display_mess(113);\n }\n }",
"public function create()\n {\n return view('mail.addlist');\n }",
"public function create()\n {\n return view('contactslists.create');\n }",
"public function create()\n {\n return view('lists.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('banlists.create');\n\t}",
"public function create()\n\t{\n\n\n\t return view('admin.mailbox.create');\n\t}",
"public function createList($listName, $companyId){\n\n $sql = \"INSERT INTO recipient_lists(company_id, list_name) VALUES (?,?)\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute([$companyId, $listName]);\n\n \n }",
"public function testCreateListSuccessfully(): void\n {\n $this->post('/mailchimp/lists', static::$listData);\n\n $content = \\json_decode($this->response->getContent(), true);\n\n $this->assertResponseOk();\n $this->seeJson(static::$listData);\n self::assertArrayHasKey('mail_chimp_id', $content);\n self::assertNotNull($content['mail_chimp_id']);\n\n $this->createdListIds[] = $content['mail_chimp_id']; // Store MailChimp list id for cleaning purposes\n }",
"public function create()\n {\n $tasklist = new Tasklist;\n\n return view('tasklists.create', [\n 'tasklist' => $tasklist,\n ]);\n }",
"function create_list($create_list_data, $email, $auth){\n \n \n$url = 'https://us20.api.mailchimp.com/3.0/lists'; /* This URL is used for creating a new mailchimp list, \ndocumentation: https://developer.mailchimp.com/documentation/mailchimp/reference/lists/#create-post_lists */\n \n$jsonString = json_encode($create_list_data); // json_encode converts $data to JSON code \n \n$curl = curl_init(); // Initializing cURL session\n \ncurl_setopt_array($curl, array( \nCURLOPT_URL => $url, // Set CURLOPT_URL option for a cURL transfer and the value is the URL for creating a new Mailchimp list\nCURLOPT_HTTPHEADER =>array('Content-Type: application/json', // Here the value is the JSON application and the authentication for accessing Mailchimp\n 'Authorization: Basic '.$auth),\nCURLOPT_RETURNTRANSFER => true, // It returns the transfer as a string\nCURLOPT_TIMEOUT => 10, // Maximum number of seconds to allow cURL functions to execute, set to 10 \nCURLOPT_POST => true, // Alternative port number to connect to\nCURLOPT_SSL_VERIFYPEER => false, // Verify the peer's SSL certificate\nCURLOPT_POSTFIELDS => $jsonString, // Post our JSON data \n));\n \n$result = curl_exec($curl); // Take URL and pass it to the browser\n \n$info = curl_getinfo($curl); // info about cURL session \n \n$httpCode = curl_getinfo($curl , CURLINFO_HTTP_CODE); //Output HTTP_CODE info\n \ncurl_close($curl); // close cURL resource, and free up system resources\n \nreturn $result; // Return the result \n \n}",
"public function makeMailingListItem($mailingListItemFields = [])\n {\n /** @var MailingListItemRepository $mailingListItemRepo */\n $mailingListItemRepo = App::make(MailingListItemRepository::class);\n $theme = $this->fakeMailingListItemData($mailingListItemFields);\n return $mailingListItemRepo->create($theme);\n }",
"public function postCreate(Request $request) {\n\n $this->validate($request, [\n 'description' => 'required',\n 'subject' => 'required',\n 'totalPoint' => 'required|integer',\n ]);\n\n // $description = $request->input('description');\n // $subject = $request->input('subject');\n // $totalPoint = $request->input('totalPoint');\n $list = new \\App\\Lists();\n $list->subject = $request->subject;\n $list->description = $request->description;\n $list->totalPoint = $request->totalPoint;\n $list->user_id = \\Auth::id();\n\n $list->save();\n\n \\Session::flash('message','Your list was created');\n return redirect('/profile');\n }",
"public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}",
"public function create()\n {\n return view('booklists.create');\n }",
"public function store(MailingListRequest $request)\n {\n $input = $request->all();\n\n $mailingList = $this->mailingListRepository->create($input);\n\n if ($request->ajax()) {\n $data = [\n 'id' => $mailingList->id,\n 'name' => $mailingList->name,\n ];\n\n return response()->json($data);\n }\n\n Flash::success('Mailing List saved successfully.');\n\n return redirect(route('mailing-lists.index'));\n }",
"public function createList($body)\n {\n $response = $this->post(Resources::$Contactslist, ['body' => $body]);\n if (!$response->success()) {\n $this->throwError('MailjetService:createList() failed', $response);\n }\n return $response;\n }",
"public function testMailingList() {\n\t}",
"public function createListRecipient($body)\n {\n $response = $this->post(Resources::$Listrecipient, ['body' => $body]);\n if (!$response->success()) {\n $this->throwError('MailjetService:createListRecipient() failed', $response);\n }\n return $response;\n }",
"public function create()\n {\n // Not needed cause this is coming from the item listing\n }",
"public function create()\n\t{\n\n\t\t$post = $this->store('create', '/thread/new');\n\n\t\tredirect('/threads?id=' . $post->id);\n\t}",
"public function create()\n {\n\n $email_id = date('Y-m-d_H-i-s') . '.' . $this->template;\n $email_data = [\n 'title' => $this->template, \n 'data' => serialize($this->data), \n 'email' => $this->to,\n 'id' => $email_id,\n 'date' => date('Y-m-d H:i:s')\n ];\n\n Storage::putYAML('statamify/emails/' . $email_id, $email_data);\n\n }",
"public function create() {\n $members = \\Member::get()->lists('name_uid', 'id');\n $this->layout->content = View::make('admin.bills.create', array(\n 'members' => $members\n ));\n }",
"public function create()\n {\n return view('lists.create',['list'=>new ListModel()]);//добавляем пустую переменнуб list\n }",
"public function create()\n {\n return view('admin.orderlists.add');\n }",
"function create_contact($email, $lists = array(), $additional_fields = array())\n\t{\n\t\t$lists_url = str_replace('https:', 'http:', $this->api_url . \"lists\");\n\n\t\t// build the XML post data\n\t\t$xml_post = '\n<entry xmlns=\"http://www.w3.org/2005/Atom\">\n <title type=\"text\"> </title>\n <updated>2008-07-23T14:21:06.407Z</updated>\n <author></author>\n <id>data:,none</id>\n <summary type=\"text\">Contact</summary>\n <content type=\"application/vnd.ctct+xml\">\n <Contact xmlns=\"http://ws.constantcontact.com/ns/1.0/\">\n <EmailAddress>'.$email.'</EmailAddress>\n <OptInSource>'.$this->action_type.'</OptInSource>\n';\n\n\tif($additional_fields):\n\tforeach($additional_fields as $field => $value):\n\t\t$xml_post .= \"<$field>$value</$field>\\n\";\n\tendforeach;\n\tendif;\n\n\t$xml_post .= '<ContactLists>';\n\tif($lists):\n\tif(is_array($lists)):\n\t\tforeach($lists as $k => $id):\n\t\t\t$xml_post .= '<ContactList id=\"'.$lists_url.'/'.$id.'\" />';\n\t\tendforeach;\n\telse:\n\t\t$xml_post .= '<ContactList id=\"'.$lists_url.'/'.$lists.'\" />';\n\tendif;\n\tendif;\n\t$xml_post .= '</ContactLists>';\n\n$xml_post .= '\n </Contact>\n </content>\n</entry>';\n\t\t$this->http_set_content_type('application/atom+xml');\n\n\t\t$xml = $this->load_url(\"contacts\", 'post', $xml_post, 201);\n\n\t\tif(isset($this->http_response_headers['Location']) && trim($this->http_response_headers['Location']) != ''):\n\t\t\treturn $this->get_id_from_link($this->http_response_headers['Location']);\n\t\tendif;\n\n\t\treturn false;\n\t}",
"public function actionCreate()\n {\n $request = Yii::app()->request;\n $notify = Yii::app()->notify;\n $list = new CustomerSuppressionList();\n\n if ($request->isPostRequest && ($attributes = (array)$request->getPost($list->modelName, array()))) {\n $list->attributes = $attributes;\n $list->customer_id = (int)Yii::app()->customer->getId();\n \n if (!$list->save()) {\n $notify->addError(Yii::t('app', 'Your form has a few errors, please fix them and try again!'));\n } else {\n $notify->addSuccess(Yii::t('app', 'Your form has been successfully saved!'));\n }\n\n Yii::app()->hooks->doAction('controller_action_save_data', $collection = new CAttributeCollection(array(\n 'controller' => $this,\n 'success' => $notify->hasSuccess,\n 'email' => $list,\n )));\n\n if ($collection->success) {\n $this->redirect(array('suppression_lists/index'));\n }\n }\n\n $this->setData(array(\n 'pageMetaTitle' => $this->data->pageMetaTitle . ' | '. Yii::t('suppression_lists', 'Suppression lists'),\n 'pageHeading' => Yii::t('suppression_lists', 'Create new'),\n 'pageBreadcrumbs' => array(\n Yii::t('suppression_lists', 'Suppression lists') => $this->createUrl('suppression_lists/index'),\n Yii::t('app', 'Create new'),\n )\n ));\n\n $this->render('form', compact('list'));\n }",
"public function createNewList(Request $request)\n\t{\n\t\t//dd($request->listName);\n\t\tDB::table('lists')->insertOrIgnore([\n\t\t\t\"name\" => $request->listName,\n\t\t\t\"user_id\" => Auth::user()->id\n\t\t]);\n\t\treturn redirect(url('/yourLists'));\n\t}",
"function create_campaign_list($id) {\n require_once 'createsend-php-5.1.2/csrest_lists.php';\n $auth = array('api_key' => CM_API_KEY);\n $wrap = new CS_REST_Lists(NULL, $auth);\n\n $name = get_the_category_by_ID($id);\n\n $result = $wrap->create(CM_CLIENT_ID, array(\n 'Title' => $name,\n 'UnsubscribePage' => null,\n 'ConfirmedOptIn' => false,\n 'ConfirmationSuccessPage' => null,\n 'UnsubscribeSetting' => CS_REST_LIST_UNSUBSCRIBE_SETTING_ONLY_THIS_LIST\n ));\n\n // save list ID as category meta\n add_term_meta($id, 'list_id', $result->response);\n}",
"public function createMailMessage();",
"public function create()\n {\n return view('playlists.create');\n }",
"public function getCreate()\n {\n //\n return view('lists.create');\n }",
"public function create() {\n return view('mails.create');\n }",
"public function createAction()\n\t{\n\t\t$contact = new Contacts();\n\t\t$success = $contact->save($this->request->getPost(), array('name', 'phone', 'email'));\n\n\t\tif ($success) {\n\t\t\t$this->flash->success(\"Contact Successfully Saved!\");\n\t\t\t$this->dispatcher->forward(['action' => 'index']);\n\t\t}\n\t\telse {\n\t\t\t$this->flash->error(\"Following Errors occurred: <br/>\");\n\n\t\t\tforeach ($contact->getMessages() as $message) {\n\t\t\t\t$this->flash->error($message);\n\t\t\t}\n\n\t\t\t$this->dispatcher->forward(['action' => 'new']);\n\t\t}\n\t}",
"public function create(Request $request)\n {\n \n try {\n\n UserList::create([\n 'name' => $request->name,\n 'user_id' => $request->user()->id\n ]);\n\n } catch (Exception $e) {\n\n $request->session()->flash('message', ['error' =>'The list could not be created']);\n return redirect(url()->previous());\n }\n\n $request->session()->flash('message', ['success' =>'A list was successfully created']);\n return redirect(url()->previous());\n }",
"public function create()\n {\n return view('template_joblist/add_joblist');\n }",
"function CreateNewsletter()\n\t{\n\t\t$newsletterapi = $this->GetApi();\n\n\t\t$GLOBALS['Action'] = 'Create&SubAction=Step2';\n\t\t$GLOBALS['CancelButton'] = GetLang('CreateNewsletterCancelButton');\n\t\t$GLOBALS['Heading'] = GetLang('CreateNewsletter');\n\t\t$GLOBALS['Intro'] = GetLang('CreateNewsletterIntro');\n\t\t$GLOBALS['NewsletterDetails'] = GetLang('CreateNewsletterHeading');\n\n\t\t$GLOBALS['FormatList'] = '';\n\t\t$allformats = $newsletterapi->GetAllFormats();\n\t\tforeach ($allformats as $id => $name) {\n\t\t\tif ($name == 'TextAndHTML') {\n\t\t\t\t$recommended = ' ' . GetLang('Recommended');\n\t\t\t} else {\n\t\t\t\t$recommended = '';\n\t\t\t}\n\t\t\t$GLOBALS['FormatList'] .= '<option value=\"' . $id . '\">' . GetLang('Format_' . $name) . $recommended .'</option>';\n\t\t}\n\n\t\t$templateselects = $this->GetTemplateList();\n\t\t$GLOBALS['TemplateList'] = $templateselects;\n\n\t\t$this->ParseTemplate('Newsletter_Form_Step1');\n\t}",
"public function create()\n\t{\n\n $CityMod = M('hangye');\n $hangye_list = $CityMod->field('id,title')->where(\" status=1 \" )->order('sort asc')->select();\n //echo \"<pre>\";print_r($hangye_list);exit;\n $this->assign('hangye_list', $hangye_list);\n\n\n\n if(isset($_POST['dosubmit'])){\n //echo \"<pre>\";print_r($_POST);exit;\n\t $contactMod = M('contact');\n\t\t\t\n\t\t\t$rst=$this->CheckcontactData_Post();\n\t\t\t\n\t\t\tif (false === $contactMod->create()) {\n\t\t\t\t$this->error($module->getError());\n\t\t\t}\n\t\t\t\n\t if($contactMod->create()) {\n\n\t \t//echo \"<pre>\";print_r($contactMod);exit;\n\n\t \t//使用 $contactMod->email\n \t\t$rst=$this->CheckcontactData_Mod($contactMod);\n\t \t$contactMod->create_time=time();\n\t \t$contactMod->password=md5($contactMod->password);\n\t \t\n\t \t$result = $contactMod->add();\n\t if($result) {\n\t $this->success('操作成功!');\n\t }else{\n\t $this->error('写入错误!');\n\t }\n\t }else{\n\t $this->error($contactMod->getError());\n\t }\n\t\t\t\n\t\t}else{\n\n\t\t\t$PageTitle = L('信息反馈');\n\t\t\t$PageMenu = array(\n\t\t\t\t\tarray( U('contact/listing'), L('信息反馈列表') ),\n\t\t\t);\n\t\t\t$this->setPagething( $PageTitle, $PageMenu, true);\n\t\t\t$this->display();\n\t\t}\n\t}",
"public function create()\n {\n $languages = Languages::get();\n return view('admin.mails.create', compact('languages'));\n }",
"public function create() {\n\n\t\treturn view('/mailer/createform');\n\n\t}",
"public function create()\n {\n if (!isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n $id = Project::insert($_POST['name'], $_POST['creator']);\n\n $project = Project::find($id);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }",
"public function store(CbpFormRequest $request)\n {\n \n $validatedData = $request->validated();\n \n CbpList::create($validatedData);\n\n return redirect('/cbplist')->with('success',\"CBP List Created successfully.\");\n }",
"public function create($listName, $subject, $content)\n {\n $listProperties = $this->getListProperties($listName);\n\n return $this->mailChimp->campaigns->create('regular',\n [\n 'list_id' => $listProperties['id'],\n 'subject' => $subject,\n 'from_email' => $listProperties['fromEmail'],\n 'from_name' => $listProperties['fromName'],\n 'to_name' => $listProperties['toName'],\n\n ],\n [\n 'html' => $content,\n ]);\n }",
"public function create()\n {\n return view('inbox.create');\n }",
"public function createNewListItem(Request $request)\n\t{\n\t\t$user = Auth::user()->id;\n\t\t//DB::table('lists')->where('user_id', Auth::user()->id)\n\n\t\t$list = DB::table('lists')->find($request->List_id);\n\t\t//dd($user,$list);\n\n\t\tif ($list == null || $user == null) {\n\t\t\treturn redirect(url('/yourLists'));\n\n\t\t} elseif ($user == $list->user_id) {\n\t\t\tDB::table('list_items')->insertOrIgnore([\n\t\t\t\t\"name\" => $request->listItemName,\n\t\t\t\t\"description\" => $request->description,\n\t\t\t\t\"List_id\" => $request->List_id,\n\t\t\t\t\"user_id\" => Auth::user()->id\n\t\t\t]);\n\t\t\treturn redirect(url('/yourLists'));\n\n\t\t} else {\n\t\t\treturn redirect(url('/yourLists'));\n\t\t}\n\t}",
"public function create()\n {\n\n createLog(MessageContact::class);\n return view('backEnd.admin.messagecontact.create');\n }",
"public function create()\n {\n return view('admin/playlists/create');\n }",
"public function create()\n {\n return view('architect.messageRecipient.create');\n }",
"public function run()\n {\n EmailList::create([\n 'name' => 'Free Pick',\n 'description' => 'Weekly emails showcasing our free pick along with the list of tutorials and curiosities about the piece and composer.'\n ]);\n }",
"public function create()\n {\n $contacts = Contact ::all();\n return view('emails.create', compact('contacts'));\n }",
"public function create()\n {\n return view(\"List.form\");\n }",
"public function create()\n {\n //\n $this->message->sendMessage();\n }",
"public function getMailingList() {\n\t\tApp::uses('MailingList', 'Model');\n\t\treturn new MailingList();\n\t}",
"public function create()\n {\n $this->view->course_list_array = \\App\\Http\\Models\\Course::courseListArray();\n $this->view->title = 'Add Questionnaire';\n return $this->view('tes.form-management.questionnaire-list.add-questionnaire');\n }",
"public function create()\n {\n\n $contacts=Contact::all();\n\n\n\n $themes=Theme::all();\n $lists=Lists::all();\n return view('mail.sendemail' ,compact('contacts','lists','themes'));\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 createTask()\n\t{\n\t\tif ( $this->taskValidate() ) {\n\t\t\tTask::create([\n\t\t\t\t\t'name' => htmlspecialchars($_POST['inputTaskName']),\n\t\t\t\t\t'email' => htmlspecialchars($_POST['inputTaskMail']),\n\t\t\t\t\t'text' => htmlspecialchars($_POST['inputTaskText'])\n\t\t\t\t]);\n\t\t}\n\t\t// to index\n\t\t\theader('Location: /');\n\t}",
"public function createnewaddressbookAction()\n {\n $addressBookName = $this->getRequest()->getParam('name');\n $visibility = $this->getRequest()->getParam('visibility');\n $website = $this->getRequest()->getParam('website', 0);\n $client = Mage::helper('ddg')->getWebsiteApiClient($website);\n if ($addressBookName !== '' && $client instanceof Dotdigitalgroup_Email_Model_Apiconnector_Client) {\n $response = $client->postAddressBooks($addressBookName, $visibility);\n if (isset($response->message))\n Mage::getSingleton('adminhtml/session')->addError($response->message);\n else\n Mage::getSingleton('adminhtml/session')->addSuccess('Address book : '. $addressBookName . ' created.');\n }\n\n }",
"function add_list( $name, $creator, $can_delete, $items )\n\t{\n $this->db->trans_start();\n\n $this->db->set('name', $name );\n $this->db->set('creator', $creator );\n if( $can_delete !== NULL ) {\n $this->db->set('can_delete', $can_delete );\n } \n $this->db->insert('lists');\n\t\t$id = $this->db->insert_id();\n\n\t\tfor( $i = 0; $i < count($items); $i++ ) {\n\t\t\t\t$this->db->set('list_id', $id );\n $this->db->set('data_id', $items[$i]['id']);\n\t\t\t\t$this->db->set('title', $items[$i]['title']);\n\t\t\t\t$this->db->set('type', $items[$i]['type'] );\n\t\t\t\t$this->db->set('sort_order', $i + 1);\n\t\t\t\t$this->db->insert('list_items');\n }\n\n $this->db->trans_complete();\n\t}",
"function evel_list_create($scope, $tag, $name, $mode, $localpart = null, $domain = null) {\n global $evel_client;\n $params = func_get_args();\n $result = $evel_client->call('EvEl.list_create', $params);\n return $result;\n}",
"public function create() {\n\t\t$user = $this->current_user();\n\t\t$message = $this->discussion->create_message($this->message_data() + ['creator' => ['id' => $user->_id, 'name' => $user->name]]);\n\n\t\tif ($this->discussion->push_message($message)) {\n\t\t\treturn $this->redirect(['Discussions::show', 'id' => $this->discussion->_id, 'project_id' => $this->discussion->project_id]);\n\t\t}\n\n\t\treturn compact('message');\n\t}",
"public function listingCreate($form){\n \n ///do things only if submited by \"create button\"\n if (!$form['add_postage']->submittedBy){\n \n //things to do when form is submitted by create button\n //unset postage textbox counter on success\n unset($this->hlp->sess(\"postage\")->counter);\n \n $values = $form->getValues(True);\n $postage = $this->lHelp->returnPostageArray($values);\n $procValues = $this->lHelp->getProcValues($values); \n $listingID = $this->listings->create($procValues);\n \n if (!empty($postage['options'])){\n $this->listings->writeListingPostageOptions($listingID, $postage);\n }\n \n $this->redirect(\"Listings:in\");\n }\n }",
"public function postCreateMail()\n {\n if ($this->_activeMail->getData('recipient_email') == '') {\n $recipient_email = $this->cart->getData('email');\n $recipient_name = $this->cart->getCustomerFirstname(). ' ' .$this->cart->getCustomerLastname();\n $data = [\n 'recipient_email' => $recipient_email,\n 'recipient_name' => $recipient_name\n ];\n $this->_activeMail->addData($data)->save();\n }\n }",
"public function create()\n {\n \treturn view('admin.subject.add');\n }",
"public function create()\n\t{\n\t\treturn View::make('messages.create');\n\t}",
"public function createAction(){\n \n $this->_form->customSubmitBtn = $this->xhr;\n $this->_form->build( $this->uri,\n $this->consumer_id,\n $this->user_id,\n $this->id);\n \n \n \n $this->result = Main_Forms_Handler::onPost($this->_form ,\n $this->post,\n $this->_model,\n \"createNote\",\n $this->params,\n $this->_helper,\n $this->indexAction . $this->consumer_id,\n \"Note created.\",\n $this->xhr); \n \n $this->_onSubmit();\n\n }",
"public function createNewsletter($mailinglist_id, $data) {\n if (empty($mailinglist_id)) {\n throw new MailerException(\"Mailinglist ID is required and cannot be empty.\");\n }\n\n if (empty($data) || empty($data['title']) || empty($data['template'])) {\n throw new MailerException(\"Newsletter title and template are required.\");\n }\n\n $path = 'mailinglists/' . $mailinglist_id . '/newsletters.json';\n $data = array('newsletter' => $data);\n return $this->request($path, 'POST', $data);\n }",
"public function actionCreate()\n {\n $model = new FeedbackType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \tYii::$app->getSession()->setFlash('success', $model->fkt_form_name.' '.$model->fkt_list_name.' 添加成功,结果将展示在列表。');\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create()\n {\n //return view('app.pages.contact');\n return view('app.messages.create');\n }",
"public function create(){\n \t//solo los administradores pueden listar preguntas\n // if(!Login::isAdmin())\n // throw new Exception(\"Debes ser administrador\");\n \t//recupera la lista de modulos\n $modulos=Modulo::get();\n\n //cagar los usuarios\n $usuario=Login::getUsuario();\n\n require_once 'view/pregunta/form_new.php';\n }",
"public function mailing_list_subscribe()\n\t{\n\t\t// get parameters for first name, last name and email\n\t\t$first_name = ee()->TMPL->fetch_param('first_name');\n\t\t$last_name = ee()->TMPL->fetch_param('last_name');\n\t\t$email = ee()->TMPL->fetch_param('email');\n\n\t\tif(empty($email))\n\t\t{\n\t\t\treturn;\n\t\t}\t\n\n\t\t$this->update_constant_contact('create', $email, $first_name, $last_name);\n\n\t}",
"public function create()\n {\n // Listado de areas\n $areas = Area::orderBy('name', 'ASC')->pluck('name', 'id')->all();\n // Retorno la vista correspondiente\n return view('panel.mails.create', compact('areas'));\n }",
"public function create_new()\n\t{\n\t\trequire_once(MODELS . '/Post.php');\n\t\t$model = new Post();\n\t\t$result = $model->create_new();\n\t\tif ($result){\n\t\t\theader('Location:/home');\n\t\t\tuser_msg('Post created successfully'); // <-- this doesn't work, why?\n\t\t}\n\t}",
"public function create()\n {\n //\n return view('announcements.create');\n }",
"public function create()\n {\n //\n return view('admin.departments.create', ['title' => trans('admin.add')]);\n }",
"public function create()\n\t{\n\t\t//return View::make('departments.create');\n\t}",
"public function postListName(Request $request)\n {\n $this->validate($request, [\n 'list_name' => 'required',\n ]);\n\n return $this->boardList->createList($request, Auth::id());\n }",
"public function create()\n {\n return view('addressbook.create');\n }",
"public function actionCreate() {\n $model = new ListContact;\n\n\n \n if(isset($_POST['yt0'])){\n \n $req = ListContact::model()->SearchFilter();\n \n }\n else{\n $req = ListContact::model()->FindALLWithBlackList();\n \n }\n \n require_once 'protected/models/technique.php';\n $technique = new Technique(); \n $contact = $technique->arrayToObject($req);\n \n\n if (isset($_POST['ListContact'])) {\n\n if (isset($_POST['yt1'])) {\n $model->attributes = $_POST['ListContact'];\n\n if ($model->save()) {\n $contact = ListContact::model()->findByPk($model->list_id);\n $contacts_id = $_POST['contact_id'];\n $contact->contacts = $contacts_id;\n $contact->save();\n $this->redirect(array('view', 'id' => $model->list_id));\n }\n }\n \n if( isset($_POST['yt2'])) {\n $list_id = $_POST['ListContact']['list_id'];\n $contact = ListContact::model()->findByPk($list_id);\n $contacts_id = $_POST['contact_id_of_list'];\n $contact->contacts = $contacts_id;\n $contact->save();\n $this->redirect(array('view', 'id' => $list_id));\n }\n }\n \n \n $categories = new BusinessCategory;\n $isolanguages = new IsoLanguage;\n $georegion = new GeoRegion;\n \n $listcontact = ListContact::model()->findAll();\n $this->render('create', array(\n 'model' => $model, 'contact' => $contact, 'listcontact' => $listcontact, 'categories' => $categories,\n 'isolanguages' => $isolanguages, 'georegion' => $georegion\n ));\n }",
"public function create()\n {\n return view(\"add_contact\", compact(\"\"));\n }",
"public function create()\n {\n\n $title = \"Ajouter une newsletter\";\n\n return view('dashboard.cruds.newsletter.create', compact('title'));\n }",
"public function create()\n {\n return view('list.create');\n }",
"public function __construct(MailList $list, array $data)\n {\n $this->list = $list;\n $this->data = $data;\n\n }",
"public function create()\n {\n // I skip using this create function because I use a modal form for inserting data using modal in index view via index function.\n }",
"public function createAction()\n {\n $record = new \\SmartAccounts\\Entity\\Emails();\n\n $form = $this->emailsService->getCreateEmailsForm();\n\n if ($this->request->isPost()) {\n $form->setData($this->request->getPost());\n if ($form->isValid()) {\n \t$data = $form->getData();\n \t\n \t$record->setDisabled($data->getDisabled());\n \t$record->setEmail($data->getEmail());\n \t$record->setCustomerId($data->getCustomerId());\n \t\n $this->emailsService->createEmails($record, $this->identity());\n\n $this->flashMessenger()->setNamespace('success')\n ->addMessage('You have successfullly created a new Emails.');\n\n return $this->redirect()->toRoute('rocket-admin/accounts/emails');\n } else {\n $this->flashMessenger()->setNamespace('error')\n ->addMessage('There was an error trying to create a new Emails.');\n }\n }\n\n $uri = $this->getRequest()->getUri();\n $base = sprintf('%s://%s', $uri->getScheme(), $uri->getHost());\n $this->viewHelperManager->get('HeadScript')\n ->appendFile($base . '/assets/rocket-admin/ckeditor/ckeditor.js');\n $this->viewHelperManager->get('InlineScript')\n ->appendScript(\"$(function () {CKEDITOR.replace('emails-fieldset[html]');});\", 'text/javascript');\n\n return new ViewModel(array(\n 'record' => $record,\n 'form' => $form,\n ));\n }",
"public function create()\n\t{\n\t\t$this->data += [\n\t\t\t'breadcrumb'=>'<li><a href=\"'. route('home') .'\"><i class=\"fa fa-home\"></i> ផ្ទាំងដើម</a></li><li><a href=\"'. route('quotations.index') .'\"><i class=\"fa fa-file-contract\"></i> កិច្ចសន្យា</li></a></li><li class=\"active\"><i class=\"fa fa-plus\"></i> បន្ថែមថ្មី</li>',\n\t\t\t// Select Data From Table\n\t\t\t'companies' => Companies::orderBy('com_name', 'asc')->get(),\n\t\t];\n\t\t// return view('agreements.create',$this->data);\n\t\treturn (($this->globalNotitfy->permission($this->module)=='true')? view('agreements.create',$this->data) : view('errors.permission',$this->data) );\n\t}",
"public function create()\n\t{\n\t\treturn View::make('discussions.create');\n\t}",
"public function create() {\n $this->createPersonHeader();\n $this->createRecipientHeader();\n $this->createBody();\n $this->createText();\n $this->createFooter();\n }",
"public function create()\n {\n return view('managecontactus.create'); \n }",
"public function create()\n {\n //\n return view('Forum.create');\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'status' => 'required|max:10', \n 'content' => 'required|max:191',\n ]);\n\n $request->user()->tasklists()->create([\n 'content' => $request->content,\n 'status' => $request->status,\n ]);\n\n\n return redirect('/');\n }",
"public function create()\n\t{\n\t\treturn View::make('orderdeliveries.create');\n\t}",
"public function create()\n\t{\n\t\t$form = \\View::make('message.form');\n\t\t$form->project_id = \\Session::get('active_project');\n\t\t$form->action = array('action' => 'Toomdrix\\Pm\\MessageController@store', 'class'=>'form-signup');\n\t\treturn $form;\n\t}",
"public function create()\n {\n $outlets = Outlet::pluck('name', 'id')->toArray();\n $departments = Department::pluck('name', 'id')->toArray();\n $groups = [\n \"outlet\" => $outlets,\n \"department\" => $departments\n ];\n //return dd($groups);\n return view('architect.smsRecipient.create', compact('groups'));\n }",
"public function create() {\n return view('project.contact.create');\n }",
"public function create()\n {\n // die('here');\n return view('message.create');\n }",
"public function create()\n {\n return view('message_forums.create');\n }",
"public function CreateTask()\n {\n\n $data = $this->GetParamsFromRequestBody('create');\n\n if (!isset($data['status'])) {\n $data['status'] = \"open\";\n }\n\n $data['createdby'] = $this->loggedUser->getId();\n\n $this->insertArrayIntoDatabase('todo_task', $data);\n $id = mysql_insert_id();\n\n $this->response = array(\n \"status\" => 0,\n \"id\" => $id\n );\n $this->responseStatus = 201;\n }",
"public function store(CreateRequest $request)//валидация идет через CreateRequest\n {\n $list=ListModel::create([\n 'user_id'=>\\Auth::user()->id,\n 'name'=>$request->get('name')\n ]);\n $lis=\\Lang::get('listindex.List');\n $create=\\Lang::get('listindex.create');\n return redirect('/lists')->with(['flash_message'=> $lis.' '.$list->name.' '.$create]);\n\n }",
"public function create()\n {\n return view('messages.create');\n }"
] | [
"0.7257925",
"0.6861846",
"0.6759401",
"0.6706444",
"0.6558756",
"0.6353066",
"0.6348631",
"0.6306885",
"0.62878215",
"0.6268132",
"0.6243164",
"0.6235844",
"0.621534",
"0.62035984",
"0.61996657",
"0.61826664",
"0.60922223",
"0.60446686",
"0.60182184",
"0.59797776",
"0.597933",
"0.59752965",
"0.5964083",
"0.59616303",
"0.59383047",
"0.593521",
"0.5931196",
"0.5915327",
"0.58935255",
"0.5884527",
"0.5835257",
"0.58297366",
"0.58245903",
"0.581959",
"0.5801934",
"0.5794414",
"0.57915574",
"0.57897156",
"0.57806593",
"0.5779438",
"0.57590187",
"0.5754993",
"0.5745515",
"0.5731616",
"0.5707272",
"0.5705144",
"0.56992185",
"0.5692113",
"0.56861913",
"0.5684839",
"0.5667088",
"0.5657445",
"0.5655629",
"0.5647701",
"0.56472576",
"0.563943",
"0.5633627",
"0.5626135",
"0.5603146",
"0.55953",
"0.5594556",
"0.5593303",
"0.5591653",
"0.5575696",
"0.5572901",
"0.5570924",
"0.55512637",
"0.5547454",
"0.55419624",
"0.55414015",
"0.5538621",
"0.55375886",
"0.55248654",
"0.5521202",
"0.5514132",
"0.5507175",
"0.5506974",
"0.5506385",
"0.55032754",
"0.5502812",
"0.55005306",
"0.54905325",
"0.5486352",
"0.5481136",
"0.54686576",
"0.54619706",
"0.5458916",
"0.5453719",
"0.5450063",
"0.5449394",
"0.5446039",
"0.5443932",
"0.5441826",
"0.5433206",
"0.5431828",
"0.5427499",
"0.5417219",
"0.54132396",
"0.5407091",
"0.540161",
"0.5385917"
] | 0.0 | -1 |
Returns the underlying logger instance. | public function getLogger(): LoggerInterface
{
return $this->logger;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getLogger()\r\n {\r\n if ($this->logger === null) {\r\n $this->logger = $this->create();\r\n }\r\n\r\n return $this->logger;\r\n }",
"public function getLoggerInstance()\n {\n return $this->logInstance;\n\n }",
"public function getLogger()\n {\n if (!$this->logger)\n {\n $this->logger = $this->getDi()->getShared('logger');\n }\n return $this->logger;\n }",
"protected function getLogger()\n {\n return $this->_logger;\n }",
"protected function getLogger()\n {\n return $this->_logger;\n }",
"protected function getLogger()\n {\n return $this->_logger;\n }",
"protected function getLogger()\n {\n if (null === $this->logger) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"public function getLogger()\n {\n if (null === $this->logger) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"public function getLogger()\n {\n if ($this->logger === null) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"public function getLogger() : Logger {\n return $this->context->getLogger();\n }",
"public function getLogger()\n {\n return $this->_logger;\n }",
"public function getLogger()\n {\n return $this->_logger;\n }",
"public function getLogger()\n {\n return $this->_logger;\n }",
"public function getLogger()\n {\n return $this->logger;\n }",
"public function getLogger()\n {\n return $this->logger;\n }",
"private function getLogger()\n {\n return $this->logger;\n }",
"public function getLogger() : Logger\n {\n return $this->logger;\n \n }",
"public function logger()\n {\n return $this->logger;\n }",
"public function logger()\n {\n return $this->logger;\n }",
"public static function get() {\n return self::$logger;\n }",
"protected function getLogger() {\n if (is_null($this->logger)) {\n $this->logger = Logger::getLogger('report.sqldatagenerator');\n }\n\n return($this->logger);\n }",
"public function getLogger()\n {\n return $this->getService('logger');\n }",
"public final function getLogger ()\n {\n return $this->context->getLogger();\n }",
"public function getLogger()\n {\n return $this->log;\n }",
"public function getLogger()\n {\n $log_name = 'importer';\n $logger = CustomLog::create( $this->getLog(), $log_name );\n return $logger;\n }",
"public static function get()\n {\n if (self::$logger === null) {\n self::$logger = self::getBoolIni(\"datadog.trace.debug\")\n ? new ErrorLogLogger(LogLevel::DEBUG)\n : new NullLogger(LogLevel::EMERGENCY);\n }\n return self::$logger;\n }",
"static public function getLogger()\n\t{\n\t\tif (! self::$instance) {\n\t\t\tself::configureInstance();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"function get_logger() {\n return $this->logger;\n }",
"public function getLogger(): Logger\n {\n if(empty($this->logger)) {\n $path = C::Storage()->getLogPath() . DS . date(\"Y-m-d\") . '-' . $this->channel . '.log';\n $logger = new Logger('Task');\n $loglevel = Logger::toMonologLevel(C::Config()->get('main:logging.logoutput.level', 'info'));\n $permissions = C::Config()->get('main:logging.file_permission', 0664);\n $logger->pushHandler(new StreamHandler($path, $loglevel, true, $permissions));\n\n $this->logger = $logger;\n }\n\n return $this->logger;\n }",
"protected function current_logger() {\n\t\treturn tribe( 'logger' )->get_current_logger();\n\t}",
"function logger() {\n\t\t/** @var \\Phanda\\Logging\\Manager $loggingManager */\n\t\t$loggingManager = phanda()->create(\\Phanda\\Logging\\Manager::class);\n\n\t\treturn $loggingManager->getLogger();\n\t}",
"public function getLogger() {\n\t\tif (is_object($this->logger)) {\n\t\t\treturn $this->logger;\n\t\t}\n\t\tif (property_exists($this,'application') && is_object($this->application)) {\n\t\t\treturn $this->application->getLogger();\n\t\t}\n\t\treturn null;\n\t}",
"public static function getInstance()\n {\n // the class exists\n $class = __CLASS__;\n sfFlexibleLogger::$logger = new $class();\n sfFlexibleLogger::$logger->initialize();\n\n return sfFlexibleLogger::$logger;\n }",
"public static function getInstance()\r\n \t{\r\n \t\t$logger = ConfService::getLogDriverImpl();\r\n \t\treturn $logger;\r\n \t}",
"public static function getInstance()\r\n {\r\n if (!sfLogger::$logger)\r\n {\r\n // the class exists\r\n $class = __CLASS__;\r\n sfLogger::$logger = new $class();\r\n sfLogger::$logger->initialize();\r\n }\r\n\r\n return sfLogger::$logger;\r\n }",
"public function getLogger(): LoggerInterface\n {\n return $this->logger;\n }",
"public function getLogger(): LoggerInterface\n {\n return $this->logger;\n }",
"public function getLogger(){ return $this->_logger; }",
"public function getLogger() : LoggerInterface\n {\n if (null === $this->logger) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"public function getLogger(): LogManager\n {\n return $this->logger;\n }",
"protected function _getLogger()\n {\n if ($this->_logger === null) {\n $this->_logger = new Zend_Log();\n $writer = new Zend_Log_Writer_Stream(STDOUT, 'a');\n $formatter = new Zend_Log_Formatter_Simple('%priorityName%: %message%' . PHP_EOL);\n $writer->setFormatter($formatter);\n if (!$this->getArg('debug')) {\n $writer->addFilter(Zend_Log::INFO);\n } else {\n $writer->addFilter(Zend_Log::DEBUG);\n }\n $this->_logger->addWriter(\n $writer\n );\n }\n\n return $this->_logger;\n }",
"public function getLogger(): Logger\n {\n return API::ffi()->ts_parser_logger($this->data);\n }",
"public function getLogger(): LoggerInterface\n {\n if ($this->logger === null) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"protected function logger() {\n if (!$this->logger)\n $this->logger = Support_Resources::logger('Routing');\n return $this->logger;\n }",
"public function getLogger()\n {\n return $this->logger = Zend_Registry::get('logDb');\n }",
"public function getLogger() {\n return $this->logger ?: \\Drupal::service('logger.factory')->get('search_api');\n }",
"public function getAppLogger()\n {\n return $this->oLogger;\n }",
"public static function _getLogger()\n {\n return TechDivision_Logger_Logger::forClass(\n __CLASS__,\n 'TDProject/META-INF/log4php.properties'\n );\n }",
"private static function loggerInterface(): LoggerInterface {\n\n if (self::$loggerInterface == null) {\n self::$loggerInterface = LoggerFactory::create();\n }\n return self::$loggerInterface;\n }",
"public function logger($instance = null)\n {\n if ($instance === null) {\n return $this->getLogger();\n }\n\n return $this->_logger = $instance;\n }",
"static public function get_instance( )\n\t{\n\t\tif (is_null(self::$_instance)) {\n\t\t\tself::$_instance = new Log( );\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"static private function getLogger(){\n \n if (!isset(self::$loggerM)){\n self::$loggerM = LoggerMgr::Instance()->getLogger(__CLASS__);\n }\n return self::$loggerM;\n }",
"public function getLoggerAware()\n {\n $aware = new LoggerAware();\n return $aware;\n }",
"private function logger()\n {\n $msgLog = new Logger('RequestResponseLogs');\n $msgLog->pushHandler(new StreamHandler(storage_path('logs/amadeus.log'), Logger::INFO));\n return $msgLog;\n }",
"public function getLogger()\n {\n if (null === $this->_logger) {\n $options = $this->getOptions();\n\n if (!isset($options['debuglog'])) {\n throw new Exception(\"Debug log path undefined in application.ini\");\n }\n try {\n $db = Zend_Registry::get('db2');\n $columnMapping = array('priority' => 'priority', 'message' => 'message');\n // $writer = new Zend_Log_Writer_Stream($options['debuglog']);\n $writer = new Zend_Log_Writer_Db($db, 'logs', $columnMapping);\n $this->_logger = new Zend_Log($writer);\n } catch (Exception $e) {\n $this->_logger = null;\n }\n\n if (isset($options['firebug']) && (\"1\" == $options['firebug'])) {\n try {\n $writer = new Zend_Log_Writer_Firebug();\n if (null !== $this->_logger) {\n $this->_logger->addWriter($writer);\n } else {\n $this->_logger = new Zend_Log($writer);\n }\n } catch (Exception $e) {\n $this->_logger = null;\n }\n }\n }\n // voeg toe aan de registry zodat we deze later eenvoudig kunnen gebruiken\n if (null !== $this->_logger) {\n// $this->_logger->info('==========================================================');\n Zend_Registry::set('logger', $this->_logger);\n }\n\n return $this->_logger;\n }",
"protected function getLoggerService()\n {\n $this->services['logger'] = $instance = new \\Symfony\\Bridge\\Monolog\\Logger('app');\n\n $instance->useMicrosecondTimestamps(true);\n $instance->pushHandler($this->get('monolog.handler.console'));\n $instance->pushHandler($this->get('monolog.handler.main'));\n\n return $instance;\n }",
"public function getLogger(): ?LoggerInterface\n {\n return $this->logger;\n }",
"protected function log_manager() {\n\t\treturn tribe( 'logger' );\n\t}",
"public function getObject() {\n return Log::getInstance();\n }",
"public function getMessageLogger()\n {\n if (null === self::$_messageLogger) {\n self::$_messageLogger = Mage::getSingleton('tmcore/module_messageLogger');\n }\n return self::$_messageLogger;\n }",
"public function getLogger(): ?LoggerInterface\n {\n return $this->make(LoggerInterface::class) ?? null;\n }",
"protected function getLoggerService()\n {\n return $this->services['logger'] = new \\Symfony\\Component\\HttpKernel\\Log\\Logger();\n }",
"public function getLogging()\n {\n return isset($this->logging) ? $this->logging : null;\n }",
"public function init()\n {\n return $this->getLogger();\n }",
"public static function getLoggerInst(){\n if(!isset(self::$_instance) || empty(self::$_instance)){\n self::$_instance = new LoggersPlugin();\n }\n return self::$_instance;\n }",
"public function getLogger();",
"public function getLogger();",
"public static function getInstance()\n {\n \t\n \t\n \t\n if (!self::$instance)\n {\n \t\n \t$error_log_file = SYS_PATH.E_LOG;\n \t\n \ttry {\n \t\t\n \t\tif(!file_exists($error_log_file))\n \t\t\t$file = fopen($error_log_file, \"w\");\n \t\t \t\t \n \t\tif(!is_writeable($error_log_file))\n \t\t\tthrow new Exception($this->logFile .\" is not a writeable file\");\n \t\t\n \t} catch (Exception $e) {\n \t\tthrow new Exception($this->logFile .\" is not a writeable file\");\n \t}\n \t\n \t\n self::$instance = new Logger();\n \n self::$logFile = $error_log_file;\n \n }\n return self::$instance;\n }",
"public static function getLogger();",
"public static function getLogger($resource, $config=array()) {\n if (!isset(self::$loggerInstances[$resource])) {\n self::$loggerInstances[$resource] = new Logger();\n }\n Logger::$loggerInstances[$resource]->resource = $resource;\n Logger::configure(Logger::$loggerInstances[$resource], $config);\n return Logger::$loggerInstances[$resource];\n }",
"public static function getLogger($name)\n {\n if (Registry::hasLogger($name)) {\n return Registry::getInstance($name);\n }\n\n if (static::shouldInheritOnUndefined() === true) {\n // We don't want root to inherit from root.\n if ($name === 'root') {\n return self::createLogger($name);\n }\n\n $parent = self::getParent($name);\n $handlers = array(new NullHandler()); // Pass the child a null handler, so we don't log to stderr twice.\n return self::createLogger($name, $handlers, array(), $parent);\n }\n\n return self::createLogger($name);\n }",
"protected function newEventLogger(): Logger\n {\n return new Logger($this->logger);\n }",
"protected function getLogService() {\n return $this->_logService ?\n $this->_logService :\n $this->_logService = $this->getServiceLocator()->get('LogService');\n }",
"public function getLogObject()\n {\n return $this->log;\n }",
"public function getLogger(\n \t$logType = TechDivision_Logger_System::LOG_TYPE_SYSTEM)\n {\n \treturn $this->getContainer()->getLogger();\n }",
"public function getLogger(\n \t$logType = TechDivision_Logger_System::LOG_TYPE_SYSTEM)\n {\n \treturn $this->getContainer()->getLogger();\n }",
"protected function createLogDriver()\n {\n return new LogTransport($this->app->make('log')->getMonolog());\n }",
"private static function getInstance()\n {\n if (empty(static::$instance)) {\n static::$instance = new WC_Logger(self::$additionalHandlers);\n }\n\n return static::$instance;\n }",
"public function getDefaultLogger(): LoggerInterface\n {\n return $this->channel('default');\n }",
"public static function getInstance($name): Logger\n {\n if (!isset(self::$loggers[$name])) {\n throw new InvalidArgumentException(sprintf('Requested \"%s\" logger instance is not in the registry', $name));\n }\n\n return self::$loggers[$name];\n }",
"public static function instance()\n\t{\n\t\tif (self::$_instance === NULL)\n\t\t{\n\t\t\t// Create a new instance\n\t\t\tself::$_instance = new self;\n\n\t\t\t// Write the logs at shutdown\n\t\t\tregister_shutdown_function(array(self::$_instance, 'write'));\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public function getAccessLogger()\n {\n return $this->accessLogger;\n }",
"public function getLog()\n {\n return $this->get('log');\n }",
"public function getLog()\n {\n return $this->get('log');\n }",
"public function getLoger(){\n\t\treturn $this->_loger;\n\t}",
"protected static function logger($channel) {\n return \\Drupal::logger($channel);\n }",
"protected function getMockLogger()\n {\n return $this->getMock('\\Psr\\Log\\LoggerInterface', array(), array(), '', false);\n }",
"protected function _getLogger(\n $logType = TechDivision_Logger_System::LOG_TYPE_SYSTEM)\n {\n \treturn $this->getLogger();\n }",
"protected function _getLogger(\n $logType = TechDivision_Logger_System::LOG_TYPE_SYSTEM)\n {\n \treturn $this->getLogger();\n }",
"public static function getMonolog(){\n\t\treturn \\Illuminate\\Log\\Writer::getMonolog();\n\t}",
"public static function getLogger($loggerName)\r\n\t{\n\t\tif (!array_key_exists($loggerName, self::$_loggers)) {\n\t\t\t$config = Celsus_Service_Manager::getInstance()->getState()->getConfig()->log->$loggerName;\r\n\r\n\t\t\tif ($config instanceof Zend_Config) {\r\n\t\t\t\t$config = $config->toArray();\r\n\t\t\t}\r\n\r\n\t\t\tif (!is_array($config) || empty($config)) {\r\n\t\t\t\t/** @see Zend_Log_Exception */\r\n\t\t\t\trequire_once 'Zend/Log/Exception.php';\r\n\t\t\t\tthrow new Zend_Log_Exception('Configuration must be an array or instance of Zend_Config');\r\n\t\t\t}\r\n\r\n\t\t\t$log = new static;\r\n\r\n\t\t\tif (array_key_exists('timestampFormat', $config)) {\r\n\t\t\t\tif (null != $config['timestampFormat'] && '' != $config['timestampFormat']) {\r\n\t\t\t\t\t$log->setTimestampFormat($config['timestampFormat']);\r\n\t\t\t\t}\r\n\t\t\t\tunset($config['timestampFormat']);\r\n\t\t\t}\n\n\t\t\t$log->addWriter($config);\n\n\t\t\tself::$_loggers[$loggerName] = $log;\n\t\t}\n\n\t\treturn self::$_loggers[$loggerName];\r\n\t}",
"abstract protected function getLogger(): Logger;",
"public function getLoggerCallable()\n {\n return $this->loggerCallable;\n }",
"public function getLoggerCallable()\n {\n return $this->loggerCallable;\n }",
"public function getLog()\n {\n if (null == $this->log) {\n $this->log = new LogSamling('innslag', $this->getId());\n }\n return $this->log;\n }",
"public function getLog()\n {\n return $this->log;\n }",
"public static function getStaticLogger($resource, $config=array()) {\n $logger = new Logger();\n $logger->resource = $resource;\n Logger::configure($logger, $config);\n return $logger;\n }",
"public static function instance( $name ) {\n\n if( !isset( self::$instance[ $name ] ) ) {\n self::$instance[ $name ] = new Log( $name );\n }\n\n return self::$instance[ $name ];\n }",
"private function createDefaultLogger(): LoggerInterface\n {\n $logger = new Logger();\n\n $writer = new Stream('php://stdout');\n $writer->setFormatter(new Simple('%message%'));\n $logger->addWriter($writer);\n\n return new PsrLoggerAdapter($logger);\n }",
"public function getLogger($name)\n {\n /* @var $slf4pLogger Logger */\n\t\t/* @var $newInstance Logger */\n\t\t/* @var $oldInstance Logger */\n\t\t/* #var $phpLogger \\KM\\Util\\Logging\\Logger */\n\t\t$name = (string) $name;\n \n // The root logger in KM\\Util\\Logging is \"\"\n if (strtolower($name) === strtolower(Logger::ROOT_LOGGER_NAME)) {\n $name = '';\n }\n \n $slf4pLogger = $this->loggerMap->get($name);\n if ($slf4pLogger != null) {\n return $slf4pLogger;\n } else {\n $phpLogger = \\KM\\Util\\Logging\\Logger::getLogger($name);\n $newInstance = new PDKLoggerAdapter($phpLogger);\n $oldInstance = $this->loggerMap->putIfAbsent($name, $newInstance);\n return ($oldInstance == null) ? $newInstance : $oldInstance;\n }\n }"
] | [
"0.84347945",
"0.832248",
"0.8305504",
"0.82983613",
"0.82983613",
"0.82983613",
"0.82789123",
"0.8212735",
"0.8206923",
"0.82044375",
"0.8188466",
"0.8188466",
"0.8188466",
"0.81521577",
"0.81521577",
"0.81105614",
"0.80710655",
"0.8018034",
"0.8018034",
"0.7982013",
"0.7924629",
"0.79020995",
"0.7832397",
"0.7797058",
"0.77563566",
"0.77513975",
"0.773571",
"0.77201205",
"0.7716463",
"0.7702693",
"0.7698351",
"0.7691032",
"0.76908964",
"0.765971",
"0.76497346",
"0.763935",
"0.763935",
"0.7573579",
"0.75553393",
"0.75426733",
"0.7527809",
"0.7470405",
"0.7455362",
"0.74187446",
"0.74108094",
"0.73710257",
"0.7288492",
"0.7263345",
"0.71910834",
"0.71891445",
"0.7177858",
"0.7176225",
"0.7165146",
"0.7116959",
"0.70799375",
"0.7013673",
"0.7001812",
"0.69866467",
"0.695154",
"0.6944028",
"0.69343954",
"0.6862676",
"0.6831431",
"0.6827498",
"0.68212116",
"0.6788457",
"0.6788457",
"0.66874003",
"0.6659344",
"0.6642027",
"0.66334474",
"0.6633353",
"0.66271317",
"0.66063535",
"0.6588071",
"0.6588071",
"0.65843135",
"0.6535245",
"0.65165687",
"0.64887846",
"0.6474789",
"0.64675486",
"0.6463978",
"0.6463978",
"0.64278305",
"0.64245397",
"0.6422108",
"0.641395",
"0.641395",
"0.6405713",
"0.6397033",
"0.6373793",
"0.63256884",
"0.63256884",
"0.62877053",
"0.6269144",
"0.6262573",
"0.62449616",
"0.6244266",
"0.61779535"
] | 0.75565815 | 38 |
Sets the global logger context. | public function setContext(array $context): static
{
$this->context = $context;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function initLogger(): void\n {\n $customPath = $this->context->getConfigurationService()->getLogPath();\n $severity = $this->context->getConfigurationService()->getLogSeverity();\n\n Logger::resetErrors();\n $this->logger = Logger::getInstance(__CLASS__, $customPath, $severity);\n }",
"public function setContext(&$context)\n {\n $this->context = $context;\n }",
"protected static function configureInstance()\n\t{\n\t\t$logger = new Logger('Default');\n\t\t$logger->pushHandler(new StreamHandler(__DIR__.'/../../logs/app.log', Logger::DEBUG));\n\n\t\tself::$instance = $logger;\n\t}",
"public function setContext($context) {\n $this->context = $context;\n }",
"public function __construct(){\n Logger::configure('../../loggingconfiguration.xml');\n // Fetch a logger, it will inherit settings from the root logger\n $this->log = Logger::getLogger(__CLASS__);\n }",
"public function setContext($context) {\r\n\t\t$this->context= $context;\r\n\t}",
"public function setContext($context)\r\n {\r\n $this->context = $context;\r\n }",
"protected function setLoggers(): void\n {\n if (config('core-middleware.loggers')) {\n $this->ray = config('core-middleware.loggers.ray');\n $this->log = config('core-middleware.loggers.log');\n }\n }",
"public function setLogger( &$logger )\n {\n $this->_logger = $logger;\n }",
"public function setContext(Context $context)\r\n\t{\r\n\t\t$this->context = $context;\r\n\t}",
"private function setAppOnContext()\n {\n if ($this->context instanceof KernelAwareContext) {\n $this->context->setApp($this->kernel);\n }\n }",
"public function setContext($context);",
"public function setContext($context);",
"function setLogger(&$logger) {\n\t\t$this->logger = $logger;\n\t}",
"public function setContext($context)\n {\n $this->context = $context;\n }",
"public function setLogger(Logger $logger);",
"private function initLogger()\n {\n\n // Check logir exists\n if (!file_exists(LOGDIR)) {\n Throw new FrameworkException(sprintf('Logdir does not exist. Please create \"%s\" and make sure it is writable.', LOGDIR));\n }\n\n // Check logdir to be writable\n if (!is_writable(LOGDIR)) {\n Throw new FrameworkException(sprintf('Logdir \"%s\" is not writable. Please set proper accessrights', LOGDIR));\n }\n\n $this->di->mapFactory('core.logger', '\\Core\\Logger\\Logger');\n\n /* @var $logger \\Core\\Logger\\Logger */\n $this->logger = $this->di->get('core.logger');\n $this->logger->registerStream(new \\Core\\Logger\\Streams\\FileStream(LOGDIR . '/core.log'));\n\n $this->di->mapValue('core.logger.default', $this->logger);\n }",
"public function setLogInstance(): void\n {\n $this->log_instance = QueryLogger::initializeQueryChainLog($this);\n }",
"public function set_logger( $logger ) {\n\t\t$this->logger = $logger;\n\t}",
"public function setContext($context = \"default\")\n {\n $this->context = $context;\n }",
"public function setLogger($logger);",
"public final function withLog ()\n {\n\n $this->withLog = true;\n\n }",
"public function setLogger($logger){\n\t\t$this->_logger = $logger;\n\t}",
"public function init()\n {\n if (\n !$this->serviceContainer->isRegistered(ServiceContainer::SERVICE_LOGGER)\n || !($this->getLogger() instanceof LoggerInterface)\n ) {\n $this->setService(ServiceContainer::SERVICE_LOGGER, new NullLogger());\n }\n $this->getControllerDispatcher()->setLogger($this->getLogger());\n }",
"public static function init()\n {\n $output = \"[%datetime%] %channel% %level_name% > %message%\\n\\n\";\n $formatter = new LineFormatter($output, null, true);\n\n $stream = new StreamHandler('../debug/main.log');\n\n $stream->setFormatter($formatter);\n\n self::$logger['main'] = new \\Monolog\\Logger('Main');\n self::$logger['main']->pushHandler($stream);\n\n self::$logger['db'] = self::$logger['main']->withName('Database');\n self::$logger['auth'] = self::$logger['main']->withName('Auth');\n self::$logger['upload'] = self::$logger['main']->withName('Uploader');\n\n // self::$logger['exception']\n // = self::$logger['main']->withName('Unhandled');\n // ErrorHandler::register(self::$logger['exception']);\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 }",
"public function setLogger(Logger $logger)\n {\n $this->_logger = $logger;\n }",
"public static function set($logger)\n {\n self::$instance = $logger;\n }",
"protected function context() {\n return ArrayHelper::filter($GLOBALS, $this->logVars);\n }",
"public function setContext(string $context): void\n {\n $this->context = $context;\n }",
"public function setAsGlobal()\n {\n static::$instance = $this;\n }",
"protected function setLogEntryFields($context)\n {\n if (count($this->log_entry_fields) === 0) {\n return $this;\n }\n\n foreach ($this->log_entry_fields as $key => $value) {\n\n if (isset($context[$key])) {\n $this->log_entry->$key = $context[$key];\n } else {\n $this->log_entry->$key = $value;\n }\n }\n\n return $this;\n }",
"public function setLogger($logger)\r\n\t{ $this->logger = $logger;\r\n\t}",
"public function setLogger($logger)\n {\n $this->_logger = $logger;\n }",
"public function setupDefaultContextVariables(): void\n {\n $this->sharedState()->basePath = '/';\n }",
"private function initLogger()\n {\n $objectManager = ObjectManager::getInstance();\n if ($this->klevuLoggerFQCN && !($this->logger instanceof $this->klevuLoggerFQCN)) {\n $this->logger = $objectManager->get($this->klevuLoggerFQCN);\n }\n\n if (!($this->logger instanceof LoggerInterface)) {\n $this->logger = $objectManager->get(LoggerInterface::class);\n }\n }",
"public static function setLogger($logger)\n {\n self::$_logger = $logger;\n }",
"public function init()\n {\n return $this->getLogger();\n }",
"static public function set(string $loggerName = 'app', string $logPath = 'app.log')\n {\n if (static::$loggers[$loggerName]['instance']) {\n return static::$loggers[$loggerName]['instance'];\n }\n\t return static::$loggers[$loggerName]['instance'] = Loader::get(XCoreLog::class, $logPath);\n }",
"public function setControllerContext()\n {\n $typo3Version = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Information\\Typo3Version::class);\n if (version_compare($typo3Version->getVersion(), '11.0', '<')) {\n $requestBuilder = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Mvc\\Web\\RequestBuilder::class);\n\n $requestBuilder->injectConfigurationManager($this->configurationManager);\n $requestBuilder->injectObjectManager($this->objectManager);\n $requestBuilder->injectExtensionService($this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Service\\ExtensionService::class));\n $requestBuilder->injectEnvironmentService($this->objectManager->get(\\TYPO3\\CMS\\Extbase\\Service\\EnvironmentService::class));\n $this->response = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response::class);\n $this->request = $requestBuilder->build();\n\n $this->uriBuilder = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder::class);\n $this->controllerContext = $this->buildControllerContext();\n $flashMessageService = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Messaging\\FlashMessageService::class);\n $this->controllerContext->injectFlashMessageService($flashMessageService);\n }\n }",
"public function setContext(array $context = []): void;",
"protected function setupLogger()\n {\n $this->log = new Logger('philip');\n if (isset($this->config['debug']) && $this->config['debug'] == true) {\n $log_path = isset($this->config['log']) ? $this->config['log'] : false;\n\n if (!$log_path) {\n throw new \\Exception(\"If debug is enabled, you must supply a log file location.\");\n }\n\n try {\n $format = \"[%datetime% - %level_name%]: %message%\";\n $handler = new StreamHandler($log_path, Logger::DEBUG);\n $handler->setFormatter(new LineFormatter($format));\n $this->log->pushHandler($handler);\n } catch (\\Exception $e) {\n throw \\Exception(\"Unable to open/read log file.\");\n }\n } else {\n $this->log->pushHandler(new NullHandler());\n }\n }",
"public function setLogger($logger)\n {\n $this->logger = $logger;\n if (@$this->server_info) $this->logConnection();\n }",
"private function set_log_type () {\n\t\t# check settings\n\t\t$this->log_type = $this->settings->log;\n\t}",
"public function setLogger(CsviHelperLog $log)\n\t{\n\t\t$this->log = $log;\n\t}",
"function __construct() {\r\n\t\tparent::__construct();\r\n\t\t$this->log = Logger::getInstance();\r\n\t}",
"protected function setupLogging()\n\t{\n\t\t// Here we will configure the error logger setup for the application which\n\t\t// is built on top of the wonderful Monolog library. By default we will\n\t\t// build a basic log file setup which creates a single file for logs.\n\n\t\tLog::useFiles(storage_path().'/logs/laravel.log');\n\t}",
"public function enableLogging()\n {\n global $log;\n if (! $this->logger)\n {\n // create a log channel\n $this->logger = new \\Monolog\\Logger('SQL');\n $this->logger->pushHandler($log);\n }\n }",
"private static function _initLog()\n {\n if (!empty(self::$config->log->servers)) {\n $servers = self::$config->log->servers->toArray();\n } else {\n $servers = self::LOG_SERVERS;\n }\n\n if (php_sapi_name() == 'cli') {\n $extra = [\n 'command' => implode(' ', $_SERVER['argv']),\n 'mem' => memory_get_usage(true),\n ];\n } elseif (isset($_REQUEST['udid'])) {\n //for app request\n $extra = [\n 'h' => $_SERVER['HTTP_HOST'] ?? '',\n 'uri' => $_SERVER['REQUEST_URI'] ?? '',\n 'v' => $_REQUEST['v'] ?? '',\n 'd' => $_REQUEST['udid'] ?? '',\n 't' => $_REQUEST['mytoken'] ?? $_REQUEST['mytoken_sid'] ?? '',\n 'os' => $_REQUEST['device_os'] ?? '',\n 'm' => $_REQUEST['device_model'] ?? '',\n 'p' => $_REQUEST['platform'] ?? '',\n 'l' => $_REQUEST['language'] ?? '',\n 'real_ip' => \\Util::getClientIp(),\n ];\n } else {\n //pc or other ?\n $extra = [\n 'h' => $_SERVER['HTTP_HOST'] ?? '',\n 'uri' => $_SERVER['REQUEST_URI'] ?? '',\n 'v' => $_REQUEST['v'] ?? '',\n 't' => $_REQUEST['mytoken'] ?? $_REQUEST['mytoken_sid'] ?? '',\n 'p' => $_REQUEST['platform'] ?? '',\n 'l' => $_REQUEST['language'] ?? '',\n 'ua' => $_SERVER['HTTP_USER_AGENT'] ?? '',\n 'real_ip' => \\Util::getClientIp(),\n ];\n }\n\n if (\\Yaf\\ENVIRON != 'product') {\n \\Log::setLogFile(self::$config->log->path);\n }\n\n LoggerHandler::setServers($servers);\n LoggerHandler::setEnv(\\YAF\\ENVIRON);\n LoggerHandler::setExtra($extra);\n LoggerHandler::setUniqueId($_REQUEST['preRequestId'] ?? self::$request->header('preRequestId'));\n }",
"public function setLogger($logger)\n {\n $this->_logger = Horde_ActiveSync::_wrapLogger($logger);\n }",
"public function setLogger($logger)\n {\n $this->logger = $logger;\n }",
"public function setlog($d = true){\n\t\t$this->log = $d;\n\t}",
"protected function initializeContext(): void\n {\n $this->context->setAspect('date', new DateTimeAspect(new \\DateTimeImmutable('@' . $GLOBALS['EXEC_TIME'])));\n $this->context->setAspect('visibility', new VisibilityAspect(true, true));\n $this->context->setAspect('workspace', new WorkspaceAspect(0));\n $this->context->setAspect('backend.user', new UserAspect(null));\n }",
"public static function staticInit() {\n self::$logger = Logger::getLogger(\"servicecontract_edit\");\n }",
"public function __construct()\n {\n $this->setDefaultLogger(new NullLogger());\n }",
"function setLogMode($value)\n {\n $this->_props['LogMode'] = $value;\n }",
"public function setContext(array $context): void\n\t{\n\t\t$this->context = $context;\n\t}",
"function __construct()\r\n\t{\r\n\t\tparent::__construct();\r\n\t\t$this->log = Logger::getInstance();\r\n\t}",
"function __construct() {\n $this->logging_enabled = false;\n }",
"public function setLogger(Logger $logger = null)\n {\n $this->logger = $logger;\n }",
"public function setLogger(Logger $logger): void\n {\n API::ffi()->ts_parser_set_logger($this->data, $logger);\n }",
"public function setContext($context) {\n\t\treturn $this->setPrivateSetting('context', $context);\n\t}",
"function init(&$context){}",
"private function setupLog()\n {\n $path = JFactory::getConfig()->get('log_path');\n\n $fileName = 'ecr_log.php';\n $entry = '';\n\n if('preserve' == JFactory::getApplication()->input->get('logMode')\n && JFile::exists($path.'/'.$fileName)\n )\n {\n $entry = '----------------------------------------------';\n }\n else if(JFile::exists($path.'/'.$fileName))\n {\n JFile::delete($path.'/'.$fileName);\n }\n\n JLog::addLogger(\n array(\n 'text_file' => $fileName\n , 'text_entry_format' => '{DATETIME}\t{PRIORITY}\t{MESSAGE}'\n , 'text_file_no_php' => true\n )\n , JLog::INFO | JLog::ERROR\n );\n\n if('' != $entry)\n JLog::add($entry);\n\n return $this;\n }",
"public function __construct()\n {\n self::$_logger = new Zend_Log(\n new Zend_Log_Writer_Stream(\n APPLICATION_PATH . '/../var/logs/system.log'\n )\n );\n }",
"function initLogging() {\n\tif (DEVELOPMENT_ENVIRONMENT == true) {\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', 'On');\n\t} else {\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', 'Off');\n\t\tini_set('log_errors', 'On');\n\t\t/*ini_set('error_log', ROOT . DS . 'tmp' . DS . 'logs' . DS . com_create_guid() . '.log');*/\n\t}\n}",
"abstract protected function setContext(array $context);",
"final public function __construct() {\n $this->_logger = new public_logger();\n }",
"private static function Init()\n\t\t{\n\t\tglobal $config;\n\t\tif(isset($config['infolog']))\n\t\t\t{\n\t\t\tself::$info_log=$config['infolog'];\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tself::$info_log=ROOT_DIR.DS.'log'.DS.'info.log';\n\t\t\t}\n\t\tif(isset($config['errorlog']))\n\t\t\t{\n\t\t\tself::$error_log=$config['errorlog'];\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tself::$error_log=ROOT_DIR.DS.'log'.DS.'error.log';\n\t\t\t}\n\t\t}",
"public function setLogger(DocBlox_Core_Log $log = null)\n {\n foreach ($this->behaviours as $behaviour) {\n $behaviour->setLogger($log);\n }\n }",
"private function _setUpLogger(&$logger = null)\n\t{\n\t\tstatic $_names = array();\n\n\t\tif (!$logger)\n\t\t{\n\t\t\t$logger = (object) array(\n\t\t\t\t'namespace' => 'com_flexicontent.filemanager.uploader',\n\t\t\t\t'filename' => 'mediadata_log.php',\n\t\t\t\t'detailed_log' => false,\n\t\t\t);\n\t\t}\n\n\t\tif (!isset($_names[$logger->namespace]))\n\t\t{\n\t\t\t$_names[$logger->namespace] = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tjimport('joomla.log.log');\n\t\tJLog::addLogger(\n\t\t\tarray(\n\t\t\t\t'text_file' => $logger->filename, // Sets the target log file\n\t\t\t\t'text_entry_format' => '{DATE} {TIME} {PRIORITY} {MESSAGE}' // Sets the format of each line\n\t\t\t),\n\t\t\tJLog::ALL, // Sets messages of all log levels to be sent to the file\n\t\t\tarray($logger->namespace) // category of logged messages\n\t\t);\n\t}",
"protected function registerLogLevel(){\n require_once __DIR__ . '/../../config/constant.php';\n $monolog = Log::getMonolog();\n foreach($monolog->getHandlers() as $handler) {\n $handler->setLevel(Config::get('app.log-level'));\n }\n }",
"public function setLogger(LoggerInterface $logger): void {\n $this->logger = $logger;\n $this->routeBuilder->setLogger($logger);\n $this->routeTreeManager->setLogger($logger);\n $this->pathExtractor->setLogger($logger);\n }",
"private function loadLogger()\n {\n // inizializza logger\n Logger::setOptions(array('filter_level' => Config::get('LOG/level'),\n 'log_dir' => Config::get('LOG/dir', Config::get('application.dir') . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . $this->application),\n 'late_write' => Config::get('LOG/late_write', true)\n ));\n }",
"public function setLoger($_loger){\n\t\t$this->_loger = $_loger;\n\n\t\treturn $this;\n\t}",
"public function __construct()\n {\n $this->loggerMap = new HashMap('<string, \\Slf4p\\Logger>');\n }",
"public function setContext($context_object = null)\n\t{\n\t\t$this->connection->context = $context_object;\n\t}",
"public function setLogger(Base_Log_Interface $logger);",
"public static function initialize()\n {\n container()->forgetInstance(ILogger::class);\n container()->instance(ILogger::class, container()->make(ILoggerManagerInterface::class)->newLogger(SwooleMaster::getConfig()->getLogDir(), sprintf(SwooleMaster::getTopic() . sprintf(\"-tasker#%d\", self::$id))));\n }",
"public function init()\n {\n if ($this->packer == null) {\n $this->packer = new MsgpackOrJsonPacker();\n } else if (!($this->packer instanceof \\Fluent\\Logger\\PackerInterface)) {\n $this->packer = Yii::createComponent($this->packer);\n }\n $this->_logger = new FluentLogger($this->host, $this->port, $this->options, $this->packer);\n }",
"public function __construct()\n {\n $log_enhancer_channel_name = config('logging.bkstar123_log_enhancer.channel_name');\n $this->customLogger = Log::channel($log_enhancer_channel_name);\n }",
"function Moxiecode_Logger() {\n\t\t$this->_path = \"\";\n\t\t$this->_filename = \"{level}.log\";\n\t\t$this->setMaxSize(\"100k\");\n\t\t$this->_maxFiles = 10;\n\t\t$this->_level = MC_LOGGER_DEBUG;\n\t\t$this->_format = \"[{time}] [{level}] {message}\";\n\t}",
"public function setDrupalContext(DrupalContext $drupal_context): void {\n $this->drupalContext = $drupal_context;\n }",
"protected function setTypo3Context() {}",
"public function initLogger($options = array()) {\n\t\t$this->logger = new FileLogger($options);\n\t}",
"private function __construct()\n {\n $levels = Conf::inst()->get('log.levels');\n $this->levels = $this->levelNames = array();\n foreach ($levels as $key => $name) {\n $this->levels[$name] = $key;\n $this->levelNames[] = $name;\n }\n\n $loggingLevel = Conf::inst()->get('log.level');\n $this->loggingLevel = $this->levels[$loggingLevel];\n $this->file = fopen(__DIR__ . \"/../log/\" . Conf::inst()->get('log.file'), \"a\");\n }",
"public function setGlobalInstance(){\n self::$instance = $this;\n }",
"public function setLogFile($path, $use_root_path = true)\n\t{\n\t\tself::$__file_path = $path;\n\t\tself::$__file_use_root_path = (bool)$use_root_path;\n\t}",
"private function __set_global()\n {\n $this->__db->setAsGlobal();\n }",
"public function setContext(array $context)\n {\n $this->context = $context;\n }",
"protected function _initLog()\n {\n // make sure the db bootstrap is done\n $this->bootstrap('db');\n \n // add the logger\n $writer = new SG_Log_Writer_Db();\n $logger = new Zend_Log($writer);\n $logger->registerErrorHandler();\n Zend_Registry::set('SG_Logger', $logger);\n }",
"public static function globalContext(array $context): void\n\t{\n\t\tif(static::$context === null)\n\t\t{\n\t\t\tstatic::$context = []; // init\n\t\t}\n\n\t\tforeach($context as $k => $v)\n\t\t{\n\t\t\tif(isset(static::$context[$k]))\n\t\t\t{\n\t\t\t\tthrow new Exception('Global context key \"' . $k . '\" already exists');\n\t\t\t}\n\n\t\t\tstatic::$context[$k] = $v;\n\t\t}\n\t}",
"public static function initialize() {\n\t\tself::$log_location = \\Config::LOG_LOCATION;\n\t\tself::$start_time = microtime(true);\n\t\tself::debug(\"Loaded Core classes. Initialized Log class.\");\n\t}",
"public static function initSysLog() {}",
"public function set():void\n {\n try {\n if (!\\file_exists(ABSPATH . '/wp-content/log.json')) {\n \\file_put_contents(ABSPATH . '/wp-content/log.json', '[]');\n }\n } catch (Exception $ex) {\n error_log(get_class($this) . ' function ' . __FUNCTION__ . '() line ' . $ex->line . ': ' . $ex->message);\n }\n }",
"public function setLog(Applog $log)\n\t\t{\n\t\t\t$this->log = $log;\n\t\t}",
"public function __construct()\n {\n $this->log = new Monolog('');\n $this->log->pushProcessor(new PsrLogMessageProcessor);\n\n $config = array_merge([\n 'type' => 'daily',\n 'level' => 'debug',\n 'max_files' => 5,\n 'app_file' => 'app.log',\n 'cli_file' => 'cli.log',\n 'permission' => 0664,\n ], config('logger', []));\n\n $file = storage_path('logs/' . $config[is_console() ? 'cli_file' : 'app_file']);\n $levels = $this->log->getLevels();\n $level = $levels[strtoupper($config['level'])];\n $format = \"[%datetime%] %level_name%: %message% %context%\\n\";\n\n switch ($config['type']) {\n case 'single':\n $this->log->pushHandler(\n $handler = new StreamHandler($file, $level, true, $config['permission'], false)\n );\n\n $handler->setFormatter(new LineFormatter($format, null, true, true));\n break;\n case 'daily':\n $this->log->pushHandler(\n $handler = new RotatingFileHandler($file, $config['max_files'], $level, true, $config['permission'], false)\n );\n $handler->setFormatter(new LineFormatter($format, null, true, true));\n break;\n case 'syslog':\n $this->log->pushHandler(\n new SyslogHandler(config('app.name', 'Pletfix'), LOG_USER, $level)\n );\n break;\n case 'errorlog':\n $this->log->pushHandler(\n $handler = new ErrorLogHandler(ErrorLogHandler::OPERATING_SYSTEM, $level)\n );\n $handler->setFormatter(new LineFormatter($format, null, true, true));\n break;\n default:\n throw new RuntimeException('Invalid log type in configuration \"app.log\".');\n }\n }",
"function get_logger() {\n return $this->logger;\n }",
"protected static function init()\n {\n if (empty(static::$registry)) {\n static::$registry = new LogEngineRegistery();\n }\n\n if (static::$dirtyConfig) {\n echo '111';\n }\n\n static::$dirtyConfig = false;\n }"
] | [
"0.6411262",
"0.6124032",
"0.6053022",
"0.59118754",
"0.59105396",
"0.59047884",
"0.58802354",
"0.5869756",
"0.58524776",
"0.5843797",
"0.5813488",
"0.5803566",
"0.5803566",
"0.5799859",
"0.5774521",
"0.57625854",
"0.5755257",
"0.5749208",
"0.57268727",
"0.572639",
"0.57126707",
"0.5638097",
"0.56228864",
"0.5602998",
"0.5590529",
"0.55829173",
"0.55829173",
"0.55829173",
"0.55297524",
"0.55076444",
"0.55023146",
"0.5499001",
"0.54752624",
"0.54735196",
"0.5460595",
"0.543399",
"0.54309183",
"0.54230374",
"0.5389637",
"0.5388788",
"0.53460765",
"0.5340219",
"0.53374577",
"0.53370965",
"0.5326505",
"0.5315105",
"0.5313466",
"0.5304852",
"0.5295421",
"0.52812696",
"0.5271255",
"0.52478296",
"0.5235261",
"0.5235178",
"0.52331793",
"0.5217554",
"0.52118045",
"0.5207773",
"0.52006704",
"0.51973045",
"0.51906407",
"0.51893306",
"0.51892287",
"0.5189158",
"0.5177033",
"0.51533943",
"0.5152294",
"0.5151356",
"0.5151029",
"0.515065",
"0.51405853",
"0.51395386",
"0.513709",
"0.51344085",
"0.513221",
"0.5126656",
"0.51256984",
"0.51228374",
"0.51227635",
"0.512075",
"0.5119887",
"0.51187444",
"0.51057273",
"0.5104625",
"0.50944453",
"0.5088931",
"0.5088252",
"0.5085102",
"0.50778097",
"0.50771403",
"0.5068338",
"0.50666404",
"0.5056596",
"0.50539756",
"0.5045671",
"0.504334",
"0.5037361",
"0.5036491",
"0.50217694",
"0.5017391",
"0.5016371"
] | 0.0 | -1 |
Returns the global logger context. | public function getContext(): array
{
return $this->context;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function context() {\n return ArrayHelper::filter($GLOBALS, $this->logVars);\n }",
"protected function current_logger() {\n\t\treturn tribe( 'logger' )->get_current_logger();\n\t}",
"public final function getLogger ()\n {\n return $this->context->getLogger();\n }",
"public static function context() {\n\t\treturn self::get_context();\n\t}",
"public static function context()\n {\n return self::$_context;\n }",
"public static function get() {\n return self::$logger;\n }",
"public function getAppLogger()\n {\n return $this->oLogger;\n }",
"function get_logger() {\n return $this->logger;\n }",
"public static function getInstance()\r\n \t{\r\n \t\t$logger = ConfService::getLogDriverImpl();\r\n \t\treturn $logger;\r\n \t}",
"public function getContext()\n {\n return self::$context;\n }",
"public function init()\n {\n return $this->getLogger();\n }",
"public function getLogger() : Logger {\n return $this->context->getLogger();\n }",
"public function getContext() {\n\t\treturn $this->getPrivateSetting('context');\n\t}",
"private function getLogger()\n {\n return $this->logger;\n }",
"public function logger()\n {\n return $this->logger;\n }",
"public function logger()\n {\n return $this->logger;\n }",
"protected function getLogger()\n {\n return $this->_logger;\n }",
"protected function getLogger()\n {\n return $this->_logger;\n }",
"protected function getLogger()\n {\n return $this->_logger;\n }",
"public function getLogger()\n {\n return $this->_logger;\n }",
"public function getLogger()\n {\n return $this->_logger;\n }",
"public function getLogger()\n {\n return $this->_logger;\n }",
"protected function logger() {\n if (!$this->logger)\n $this->logger = Support_Resources::logger('Routing');\n return $this->logger;\n }",
"public function getLogger()\n {\n if (!$this->logger)\n {\n $this->logger = $this->getDi()->getShared('logger');\n }\n return $this->logger;\n }",
"public function getMessageLogger()\n {\n if (null === self::$_messageLogger) {\n self::$_messageLogger = Mage::getSingleton('tmcore/module_messageLogger');\n }\n return self::$_messageLogger;\n }",
"public static function get()\n {\n if (self::$logger === null) {\n self::$logger = self::getBoolIni(\"datadog.trace.debug\")\n ? new ErrorLogLogger(LogLevel::DEBUG)\n : new NullLogger(LogLevel::EMERGENCY);\n }\n return self::$logger;\n }",
"public function getLogger()\n {\n return $this->logger;\n }",
"public function getLogger()\n {\n return $this->logger;\n }",
"public function getcontext()\n {\n return $this->context;\n }",
"public function getLogger()\n {\n return $this->log;\n }",
"public function context()\n {\n return $this->context;\n }",
"public function context()\n {\n return $this->context;\n }",
"private function getLogger()\r\n {\r\n if ($this->logger === null) {\r\n $this->logger = $this->create();\r\n }\r\n\r\n return $this->logger;\r\n }",
"public function get_ctx() \n {\n return $this->ctx;\n }",
"protected function getContext()\n {\n return $this->_context;\n }",
"protected function getContext()\n {\n return $this->_context;\n }",
"public function getContext()\r\n {\r\n return $this->context;\r\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getContext()\n {\n return $this->context;\n }",
"public function getLogging()\n {\n return isset($this->logging) ? $this->logging : null;\n }",
"public function getContext() {\n\t\treturn $this->context;\n\t}",
"protected function getContext()\n\t{\n\t\treturn $this->context;\n\t}",
"public function getContext()\n\t{\n\t\treturn $this->context;\n\t}",
"public function getContext() {\n return $this->context;\n }",
"protected function getContext() {\n\t\treturn $this->context;\n\t}",
"public function getContext() {\r\n\t\treturn $this->context;\r\n\t}",
"public function getContext()\r\n\t{\r\n\t\treturn $this->context;\r\n\t}",
"public function getContext() {\n return $this->context;\n }",
"public function getContext() {\n return $this->context;\n }",
"public function getLogger(){ return $this->_logger; }",
"public function getDefaultContext()\n {\n return $this->defaultContext;\n }",
"public function getContext ()\n {\n return $this->context;\n }",
"public function getLogger()\n {\n return $this->getService('logger');\n }",
"public function getLoggerInstance()\n {\n return $this->logInstance;\n\n }",
"public function getContext()\n\t\t{\n\t\t\treturn $this->context;\n\t\t}",
"public final function getContext ()\n {\n return $this->context;\n }",
"public final function getContext ()\n {\n return $this->context;\n }",
"protected function getLogger() {\n if (is_null($this->logger)) {\n $this->logger = Logger::getLogger('report.sqldatagenerator');\n }\n\n return($this->logger);\n }",
"public static function getContext()\n {\n if (isset(self::$context) == false) {\n self::$context = new Context();\n }\n\n return self::$context;\n }",
"function logger() {\n\t\t/** @var \\Phanda\\Logging\\Manager $loggingManager */\n\t\t$loggingManager = phanda()->create(\\Phanda\\Logging\\Manager::class);\n\n\t\treturn $loggingManager->getLogger();\n\t}",
"public final function getContext ()\n {\n\n return $this->context;\n\n }",
"static private function getLogger(){\n \n if (!isset(self::$loggerM)){\n self::$loggerM = LoggerMgr::Instance()->getLogger(__CLASS__);\n }\n return self::$loggerM;\n }",
"public function getCurrentContext()\n\t{\n\t\treturn $this->context_name;\n\t}",
"public function getObject() {\n return Log::getInstance();\n }",
"public static function getDefaultContext() {\n if (!self::$context)\n return self::getEmptyObject();\n else\n return self::$context;\n }",
"public static function getCurrent()\n\t{\n\t\tif (Application::hasInstance())\n\t\t{\n\t\t\t$application = Application::getInstance();\n\t\t\treturn $application->getContext();\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getLogger() {\n\t\tif (is_object($this->logger)) {\n\t\t\treturn $this->logger;\n\t\t}\n\t\tif (property_exists($this,'application') && is_object($this->application)) {\n\t\t\treturn $this->application->getLogger();\n\t\t}\n\t\treturn null;\n\t}",
"public static function getInstance()\r\n {\r\n if (!sfLogger::$logger)\r\n {\r\n // the class exists\r\n $class = __CLASS__;\r\n sfLogger::$logger = new $class();\r\n sfLogger::$logger->initialize();\r\n }\r\n\r\n return sfLogger::$logger;\r\n }",
"public function get_contextlevel() {\n return $this->contextlevel;\n }",
"protected function log_manager() {\n\t\treturn tribe( 'logger' );\n\t}",
"public function getContext();",
"public function getContext();",
"public function getContext();",
"public function getContext();",
"public function getContext();",
"public function getContext(): mixed;",
"function &getContext() {\n\t\treturn $this->_context;\n\t}",
"public static function getInstance()\n {\n // the class exists\n $class = __CLASS__;\n sfFlexibleLogger::$logger = new $class();\n sfFlexibleLogger::$logger->initialize();\n\n return sfFlexibleLogger::$logger;\n }",
"protected function getLogger()\n {\n if (null === $this->logger) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"public function getLoger(){\n\t\treturn $this->_loger;\n\t}",
"public static function getContext(){\n if(!isset(self::$instance)){\n self::$instance = new JeproshopContext();\n }\n return self::$instance;\n }",
"public function getLogger() {\n return $this->logger ?: \\Drupal::service('logger.factory')->get('search_api');\n }",
"public function getLogger()\n {\n $log_name = 'importer';\n $logger = CustomLog::create( $this->getLog(), $log_name );\n return $logger;\n }",
"public function getLogger()\n {\n if ($this->logger === null) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"function getCurrentContext();",
"public function getContext() : Context {\n return $this->context;\n }",
"protected function getContext() {}",
"function get_current_log() {\n\t\tif ( isset( $this->log ) ) {\n\t\t\treturn $this->log;\n\t\t}\n\t\treturn false;\n\t}",
"public function getLogger()\n {\n if (null === $this->logger) {\n $this->logger = new NullLogger();\n }\n\n return $this->logger;\n }",
"static public function getLogger()\n\t{\n\t\tif (! self::$instance) {\n\t\t\tself::configureInstance();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public function getHandlerContext()\n {\n return $this->getHandlerConfig()->getHandlerContext();\n }",
"public function getAccessLogger()\n {\n return $this->accessLogger;\n }"
] | [
"0.7465003",
"0.71243525",
"0.7105336",
"0.70830077",
"0.7041044",
"0.6961882",
"0.6781158",
"0.6693",
"0.66503245",
"0.6615806",
"0.6608724",
"0.65675485",
"0.6488755",
"0.64881057",
"0.64748615",
"0.64748615",
"0.64521724",
"0.64521724",
"0.64521724",
"0.64515525",
"0.64515525",
"0.64515525",
"0.6443775",
"0.64029086",
"0.6382203",
"0.6374294",
"0.63640666",
"0.63640666",
"0.63437486",
"0.6341058",
"0.63186485",
"0.63186485",
"0.6310591",
"0.6308382",
"0.62851804",
"0.62851804",
"0.6282402",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62820005",
"0.62779135",
"0.62764645",
"0.6272163",
"0.62716514",
"0.62671715",
"0.6265926",
"0.62642336",
"0.62588763",
"0.6253703",
"0.6253703",
"0.62516177",
"0.6238733",
"0.6234704",
"0.6226197",
"0.6222613",
"0.6220398",
"0.6178232",
"0.6178232",
"0.6175914",
"0.6168425",
"0.61680686",
"0.61590314",
"0.61111826",
"0.610258",
"0.60637534",
"0.60600364",
"0.6059113",
"0.6029488",
"0.6029191",
"0.6023203",
"0.59838045",
"0.5977473",
"0.5977473",
"0.5977473",
"0.5977473",
"0.5977473",
"0.5973347",
"0.5955518",
"0.5931291",
"0.5908374",
"0.5903557",
"0.59010905",
"0.5896294",
"0.588575",
"0.58826506",
"0.58778656",
"0.58731776",
"0.5870295",
"0.5845706",
"0.5844105",
"0.58440894",
"0.5841407",
"0.58387494"
] | 0.0 | -1 |
Sets up the widgets name etc | public function __construct() {
$widget_ops = array(
'class_name' => 'twitter_multiple_timelines',
'description' => 'Show one or more timeline(s) from Twitter',
);
parent::__construct( 'twitter_multiple_timelines', 'Twitter Multiple Timelines', $widget_ops );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}",
"public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}",
"function onReady() {\n\t\t$this->text = $this->config->text;\n\t\tif (empty($this->text))\n\t\t\t$this->text = \"initial settings| set this widget | /admin set headsup\";\n\t\t\n\t\t$this->url = $this->config->url;\n\t\tif (empty($this->url))\n\t\t\t$this->url = \"\";\n\t\t\n\t\t$this->width = $this->config->width;\n\t\tif (empty($this->width))\n\t\t\t$this->width = 50;\n\t\t\n\t\t$this->pos = $this->config->pos;\n\t\tif (empty($this->pos))\n\t\t\t$this->pos = \"80,-85\";\n\t\t\n\t\tforeach ($this->storage->players as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t\tforeach ($this->storage->spectators as $login => $player) {\n\t\t\t$this->showWidget($login);\n\t\t}\n\t}",
"public function _register_widgets()\n {\n }",
"function customize_controls_init()\n {\n }",
"public function customize_controls_init()\n {\n }",
"function wowaries_widgets_init() {\n /* WowAriesProject generated Register Sidebars Begin */\n\n /* WowAriesProject generated Register Sidebars End */\n}",
"function ourWidgetsInit(){\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Sidebar',\n\t\t\t'id' => 'sidebar1',\n\t\t\t'before_widget' => '<div class=\"widget-item\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"my-special-class\">',\n\t\t\t'after_title' => '</h4>'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 1',\n\t\t\t'id' => 'footer1'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 2',\n\t\t\t'id' => 'footer2'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 3',\n\t\t\t'id' => 'footer3'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 4',\n\t\t\t'id' => 'footer4'\n\t\t));\n\t}",
"function arphabet_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => 'Event Widget',\n\t\t'id' => 'event_widget',\n\t)\n \t);\n\tregister_sidebar( array(\n\t\t'name' => 'Landing Photo Widget',\n\t\t'id' => 'landingphoto_widget',\n\t)\n \t);\n\tregister_sidebar( array(\n\t\t'name' => 'Gallery Widget',\n\t\t'id' => 'gallery_widget',\n\t)\n\t );\n\t register_sidebar( array(\n\t\t'name' => 'About Widget',\n\t\t'id' => 'about_widget',\n\t)\n \t);\n}",
"private function initializeWidgetIdentifier() {}",
"function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}",
"function ccac_2020_new_widgets_init() {\n /* Pinegrow generated Register Sidebars Begin */\n\n /* Pinegrow generated Register Sidebars End */\n}",
"function pramble_widget_setup() {\n\t\t /**\n\t\t\t* Creates a sidebar\n\t\t\t* @param string|array Builds Sidebar based off of 'name' and 'id' values.\n\t\t\t*/\n\t\t\t$args = array(\n\t\t\t\t'name' => 'Sidebar',\n\t\t\t\t'id' => 'sidebar-1',\n\t\t\t\t'description' => 'standard sidebar',\n\t\t\t\t'class' => 'custom',\n\t\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t\t'after_widget' => '</aside>',\n\t\t\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t\t\t'after_title' => '</h2>',\n\t\t\t);\n\t\t\n\t\t\tregister_sidebar( $args );\n\t\n\t\t\t}",
"function SetWidget() {\n\t\t\n\t\t\tif ( !function_exists('register_sidebar_widget') ) \n\t\t\treturn;\n\t\t\t\n\t\t\t// This registers our widget so it appears with the other available\n\t\t\t// widgets and can be dragged and dropped into any active sidebars.\n\t\t\tregister_sidebar_widget(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteo'));\n\t\t\n\t\t\t// This registers our optional widget control form.\n\t\t\tregister_widget_control(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteoControl'), 450, 325);\n\t\t}",
"public function widgets_init() {\n\t\tregister_sidebar(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Sidebar', 'hellish-simplicity' ),\n\t\t\t\t'id' => 'sidebar',\n\t\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s\">',\n\t\t\t\t'after_widget' => '</aside>',\n\t\t\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t\t\t'after_title' => '</h1>',\n\t\t\t)\n\t\t);\n\t}",
"public function __construct($_name)\n { \n\t\t$this->widget_name = $_name;\n }",
"public function init(){\n /*you can set initial default values and other stuff here.\n * it's also a good place to register any CSS or Javascript your\n * widget may need. */ \n }",
"public function widgets_init() {\n\t\t// Set widgets_init action function.\n\t\tadd_action( 'widgets_init', array( $this, 'register_sidebars' ) );\n\t\tregister_widget( 'DX\\MOP\\Student_Widget' );\n\t}",
"public function init()\n {\n // Initialize widget.\n }",
"function yellow_widgets_init() {\n\n\tregister_sidebar( array(\n\t 'name' => 'Sidebar',\n\t 'id' => 'sidebar',\n\t 'before_widget' => '<div class=\"media-body\">',\n\t 'after_widget' => '</div>',\n\t 'before_title' => '<div class=\"card-header\">',\n\t 'after_title' => '</div>',\n\t));\n\tregister_sidebar( array(\n\t\t'name' => 'Footer',\n\t\t'id' => 'footer',\n\t\t'before_widget' => '',\n\t\t'after_widget' => '',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t ));\n\t\n \n }",
"function arphabet_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Widgets',\n\t\t'id' => 'footer-widgets',\n\t\t'description' => 'Place widgets for the footer here.',\n\t\t'before_widget' => '<div class=\"col-md-4\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Sidebar Widgets',\n\t\t'id' => 'sidebar-widgets',\n\t\t'description' => 'Place widgets for the sidebar here.',\n\t\t'before_widget' => '<div class=\"widget\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n}",
"function ois_load_widgets() {\r\n register_widget( 'OptinSkin_Widget' );\r\n}",
"function nabi_widgets_init() {\n\n\t// Language Selector Widget\n\tregister_sidebar( array(\n\t\t'name' => 'Language Widget',\n\t\t'id' => 'languagewidget',\n\t\t'before_title' => ''\n\t) );\n\n\t// Second nav additionnal content Widget\n\tregister_sidebar( array(\n\t\t'name' => 'Second Nav Widget',\n\t\t'id' => 'secondnavwidget',\n\t\t'before_title' => ''\n\t) );\n\n}",
"function arphabet_widgets_init() {\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name' => 'Counter',\n\t\t\t'id' => 'counter_1',\n\t\t\t'before_widget' => '<div class=\"csc_box\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h2 class=\"csc_title\">',\n\t\t\t'after_title' => ' <i class=\"fa fa-users\"></i></h2>'\n\t\t)\n\t);\n}",
"public function afterLoadRegisterControlsUI(){\n\t\t\n\t}",
"public function output_widget_control_templates()\n {\n }",
"protected function get_widgets()\n {\n }",
"function widgets_init_now() {\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Текст вверху шапки'\n\t\t\t,'id' => 'header_top'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Несколько виджетов будут расположены в строчку. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок для виджета рассылки в подвале'\n\t\t\t,'id' => 'footer_mailings'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок контактов в подвале'\n\t\t\t,'id' => 'footer_contacts'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Подробнее о системе обучения в Linguamore'\n\t\t\t,'id' => 'homepage_education-feats'\n\t\t\t,'description' => 'Блок, расположенный на странице \"Преимущества\". Добавьте сюда виджет \"Rich Text\" из левой части страницы. Иконки можно добавить кнопкой \"Add Media\". Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t}",
"function control_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'control' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n}",
"function InitChildControls() {\n }",
"function darksnow_widgets_init() {\n\n\t\n\t\n\t\n}",
"public function build_controls()\n\t{\n\t\t$this->add_control( 'title', [\n\t\t\t'label' => __( 'Title' )\n\t\t] );\n\t\t$this->add_control( 'content', [\n\t\t\t'label' => __( 'Content' ),\n\t\t\t'type' => 'textarea'\n\t\t] );\n\t\t$this->add_control( 'link_url', [\n\t\t\t'label' => __( 'URL' )\n\t\t] );\n\t\t$this->add_control( 'link_text', [\n\t\t\t'label' => __( 'Link Text' )\n\t\t] );\n\t\t$this->add_control( 'link_target', [\n\t\t\t'label' => __( 'Open link in a new window/tab' ),\n\t\t\t'type' => 'checkbox',\n\t\t\t'value' => '1'\n\t\t] );\n\t}",
"function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}",
"function widget_init() {\n if ( function_exists('register_sidebar') )\n \n register_sidebar(\n array(\n 'name' => 'Footer',\n 'before_widget' => '<div class = \"footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '',\n 'after_title' => '',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Event Navigation',\n 'before_widget' => '<div class=\"custom-widget top-round card slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Frontpage News',\n 'before_widget' => '<div class=\"custom-widget card top-round slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n }",
"public static function init()\n {\n add_action( 'widgets_init', array(__CLASS__, 'register') );\n }",
"function nicholls_widgets_init() {\n\tregister_widget('WP_Widget_Nicholls_Department');\n}",
"function bly_generate_widgets_init() {\n\t\t$widgets = array(\n\t\t\t'right-slide-in' => __( 'Right Slide In', 'generatepress' ),\n\t\t);\n\t\tforeach ( $widgets as $id => $name ) {\n\t\t\tregister_sidebar( array(\n\t\t\t\t'name' => $name,\n\t\t\t\t'id' => $id,\n\t\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget inner-padding %2$s\">',\n\t\t\t\t'after_widget' => '</aside>',\n\t\t\t\t'before_title' => apply_filters( 'generate_start_widget_title', '<h2 class=\"widget-title\">' ),\n\t\t\t\t'after_title' => apply_filters( 'generate_end_widget_title', '</h2>' ),\n\t\t\t) );\n\t\t}\n\t}",
"function initiate_widgets() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer twitter',\n\t\t'id' => 'footer_twitter',\n\t\t'before_widget' => '<div class=\"c-twitter\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"o-twitter-header\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer facebook',\n\t\t'id' => 'footer_facebook',\n\t\t'before_widget' => '<div class=\"c-twitter\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"o-twitter-header\">',\n\t\t'after_title' => '</h4>',\n\t) );\n\n}",
"protected function init()\n {\n $this->setTitle('core_layout.edit_layout');\n $this->addElement([\n 'plugin' => 'hidden',\n 'name' => 'base_script',\n 'value' => 'view'\n ]);\n $this->addElement([\n 'plugin' => 'hidden',\n 'name' => 'item_script',\n 'value' => 'view',\n ]);\n }",
"public function addWidget()\r\n {\r\n }",
"function our_widget_inits(){\n\tregister_sidebar(array(\n\t\t'name' => 'Sidebar',\n\t\t'id' => 'sidebar1',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s widget_area\">',\n\t\t'after_widget' => \"</div>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 1',\n\t\t'id' => 'footer1',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 2',\n\t\t'id' => 'footer2',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => 'Footer area 3',\n\t\t'id' => 'footer3',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t));\n}",
"function parquesWidgets()\n{\n\t//add classes\n\tinclude_once(TEMPLATEPATH.'/widgets/widgettexto.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-social.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-home.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-progreso.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-categorias.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-banner.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-timelines.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/widget-flickr.php');\n\tinclude_once(TEMPLATEPATH.'/widgets/nav-menu-narrativas.php');\n\n\t//add widget\n \tregister_widget( 'Widget_Texto' );\n \tregister_widget( 'Widget_Social' );\n \tregister_widget( 'Widget_Home' );\n \tregister_widget( 'Widget_Progreso' );\n \tregister_widget( 'Widget_Categorias' );\n \tregister_widget( 'Widget_Banner' );\n \tregister_widget( 'Widget_Timelines' );\n \tregister_widget( 'Widget_Flickr' );\n \tregister_widget( 'Widget_Narrativas' );\n\n\n}",
"function Task_widgets_init() {\n \n // The SideBar\n register_sidebar( array(\n 'name' => esc_html__( 'SideBar', 'Task' ),\n 'id' => 'sidebar-1',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n // The Banner Above The Navigation Bar In The Header\n register_sidebar( array(\n 'name' => esc_html__( 'Banner Above Navigation Bar', 'Task' ),\n 'id' => 'sidebar-2',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n // The Square Banner Next To The 3 Main Posts\n register_sidebar( array(\n 'name' => esc_html__( 'The Square Banner Next To The 3 Main Posts', 'Task' ),\n 'id' => 'sidebar-3',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n // The Side Banner In The Left\n register_sidebar( array(\n 'name' => esc_html__( 'The Side Banner In The Left', 'Task' ),\n 'id' => 'sidebar-4',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n }",
"function dl_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Página de Contacto',\n\t\t'id'\t\t\t=> 'contact-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Barra Lateral',\n\t\t'id'\t\t\t=> 'sidebar-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Search Menu',\n\t\t'id'\t\t\t=> 'menu-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\n}",
"public function action_widgets_init() {\n\n // Our widgets\n register_widget( '\\Pedestal\\Widgets\\Recent_Content_Widget' );\n register_widget( '\\Pedestal\\Widgets\\Recent_Video_Widget' );\n\n if ( PEDESTAL_ENABLE_INSTAGRAM_OF_THE_DAY ) {\n register_widget( '\\Pedestal\\Widgets\\Daily_Insta_Widget' );\n }\n\n // Unregister core widgets we won't be using\n unregister_widget( 'WP_Widget_Archives' );\n unregister_widget( 'WP_Widget_Calendar' );\n unregister_widget( 'WP_Widget_Categories' );\n unregister_widget( 'WP_Widget_Custom_HTML' );\n unregister_widget( 'WP_Widget_Links' );\n unregister_widget( 'WP_Widget_Media_Audio' );\n unregister_widget( 'WP_Widget_Media_Gallery' );\n unregister_widget( 'WP_Widget_Media_Image' );\n unregister_widget( 'WP_Widget_Media_Video' );\n unregister_widget( 'WP_Widget_Meta' );\n unregister_widget( 'WP_Widget_Pages' );\n unregister_widget( 'WP_Widget_Recent_Comments' );\n unregister_widget( 'WP_Widget_Recent_Posts' );\n unregister_widget( 'WP_Widget_RSS' );\n unregister_widget( 'WP_Widget_Search' );\n unregister_widget( 'WP_Widget_Tag_Cloud' );\n unregister_widget( 'WP_Widget_Text' );\n\n // Unregister widgets added by plugins\n unregister_widget( 'P2P_Widget' );\n }",
"function CreateChildControls() {\n }",
"public function widgets_init() {\n\t\t\t\n\t\t// init default widgets\n\t\twpu_widgets_init();\n\t\t\n\t\t// register any sub-plugin widget\n\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t$this->extras->widgets_init();\n\t\t}\n\t}",
"static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}",
"public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Hello_World() );\n\t}",
"function _s_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', '_s' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Right Sidebar',\n\t\t'id' => 'sidebar-2',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n}",
"function uwmadison_widgets_init() {\n\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Main Sidebar', 'uw-madison-160' ),\n\t\t\t'id' => 'sidebar-1',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t) );\n\n\t}",
"public static function init () : void\n {\n add_action(\"widgets_init\", function ()\n {\n self::unregister_widget();\n self::register_widget();\n self::register_sidebar();\n });\n }",
"function ajy_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Header', 'ajy' ),\n\t\t'id' => 'header-widget-area',\n 'description' => 'These are widgets for the header.',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n \n register_sidebar( array(\n\t\t'name' => __( 'Navigation', 'ajy' ),\n\t\t'id' => 'nav-widget-area',\n 'description' => 'These are widgets for the navigation area.',\n\t\t'before_widget' => '', //no wrapper\n\t\t'after_widget' => '',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n \n register_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'ajy' ),\n\t\t'id' => 'sidebar-widget-area',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n \n register_sidebar( array(\n\t\t'name' => __( 'Footer', 'ajy' ),\n\t\t'id' => 'footer-widget-area',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n}",
"function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }",
"function kcsite_widgets_init() {\t\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Left sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-l',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Right sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-r',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\n/*\n\t\tregister_sidebar( array(\n\t\t\t'name' => __('Banners Before Footer', 'kcsite'),\n\t\t\t'id' => 'sidebar-banners-before-footer',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s help-inline\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t//'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t//'after_title' => '</h3>',\n\t\t) );*/\n\t}",
"public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Main_Slider() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Text() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Noble_Cause() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Image() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Project_Facts() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Pillers_Forest() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Fancy_Heading() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Blog_Listing() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Main_Gallery() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Default_Sub_Header() );\n\n\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Banner() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Woo_Listing() );\t\t \n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Events_Listing() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Events_Call_To_Action() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Contact() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Islamic_Centre_Newsletter() );\n\t}",
"function registerWidgets( ) {\r\n\t\t\twp_register_sidebar_widget( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetOutput' ) );\r\n\t\t\twp_register_widget_control( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetControlOutput' ) );\r\n\t\t}",
"public static function init() {\n //Register widget settings...\n self::update_dashboard_widget_options(\n self::wid, //The widget id\n array( //Associative array of options & default values\n 'username' => '',\n\t\t\t\t'apikey' => '',\n\t\t\t\t'project_id' => '',\n ),\n true //Add only (will not update existing options)\n );\n\n //Register the widget...\n wp_add_dashboard_widget(\n self::wid, //A unique slug/ID\n __( 'Rankalyst Statistik', 'affiliatetheme-backend' ),//Visible name for the widget\n array('AT_Rankalyst_Widget','widget'), //Callback for the main widget content\n array('AT_Rankalyst_Widget','config') //Optional callback for widget configuration content\n );\n }",
"function cwcg_load_widget() {\n register_widget( 'cwcg_test_grid_widget' );\n}",
"protected function registerButtons() {}",
"protected function registerButtons() {}",
"function themes_name_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Copyright', 'themes_name' ),\n\t\t'id' => 'copyright',\n\t\t'container' \t\t=> false,\n\t\t'before_widget' => '',\n\t\t'after_widget' => ''\n\t) );\n}",
"function resource_page_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Resource Page Left Col',\n\t\t'id' => 'resource_page',\n\t\t'before_widget' => '<div id=\"resourcePageNavWidget\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n\n}",
"protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'settings',\n\t\t\t[\n\t\t\t\t'label' => __( 'Brand list Settings', 'xstore-core' ),\n\t\t\t\t'tab' \t=> \\Elementor\\Controls_Manager::TAB_CONTENT,\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'ids',\n\t\t\t[\n\t\t\t\t'label' \t=>\t__( 'Select Brand', 'xstore-core' ),\n\t\t\t\t'type' \t\t=>\t\\Elementor\\Controls_Manager::SELECT2,\n\t\t\t\t'multiple' \t=>\ttrue,\n\t\t\t\t'options' \t=>\tElementor::get_terms('brand'),\n\t\t\t\t'label_block'\t=> 'true',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_a_z',\n\t\t\t[\n\t\t\t\t'label' => __( 'Display A-Z filter', 'xstore-core' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'description' => __( 'Do not forget switch on Customize -> Speed Optimization -> Masonry Scripts', 'xstore-core' ),\n\t\t\t\t'label_on' => __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' => __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'columns',\n\t\t\t[\n\t\t\t\t'label' \t=> __( 'Columns', 'xstore-core' ),\n\t\t\t\t'type' \t\t=> \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t'default' \t=> '',\n\t\t\t\t'options' \t=> [\n\t\t\t\t\t'1' => esc_attr__( '1', 'xstore' ),\n\t\t\t\t\t'2' => esc_attr__( '2', 'xstore' ),\n\t\t\t\t\t'3' => esc_attr__( '3', 'xstore' ),\n\t\t\t\t\t'4' => esc_attr__( '4', 'xstore' ),\n\t\t\t\t\t'5' => esc_attr__( '5', 'xstore' ),\n\t\t\t\t\t'6' => esc_attr__( '6', 'xstore' ),\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'alignment',\n\t\t\t[\n\t\t\t\t'label' \t => __( 'Alignment', 'xstore-core' ),\n\t\t\t\t'type' \t\t => \\Elementor\\Controls_Manager::SELECT,\n\t\t\t\t'options' \t => [\n\t\t\t\t\t'left' \t => esc_html__('Left', 'xstore-core') , \n\t\t\t\t\t'center' => esc_html__('Center', 'xstore-core') , \n\t\t\t\t\t'right'\t => esc_html__('Right', 'xstore-core') \n\t\t\t\t],\n\t\t\t\t'default'\t => 'left'\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'capital_letter',\n\t\t\t[\n\t\t\t\t'label' => __( 'Display brands capital letter', 'xstore-core' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' => __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'brand_image',\n\t\t\t[\n\t\t\t\t'label' => __( 'Brand image', 'xstore-core' ),\n\t\t\t\t'type' => \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' => __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' => __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' => 'yes',\n\t\t\t\t'default' => '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'size',\n\t\t\t[\n\t\t\t\t'label' \t=>\t__( 'Images size', 'xstore-core' ),\n\t\t\t\t'type' \t\t=>\t\\Elementor\\Controls_Manager::TEXT,\n\t\t\t\t'condition' => ['brand_image' => 'yes'],\n\t\t\t\t'default' \t=>\t'',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'brand_title',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Brand title', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> 'yes',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'tooltip',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Title with tooltip', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'brand_desc',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Brand description', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'hide_empty',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Hide empty', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'show_product_counts',\n\t\t\t[\n\t\t\t\t'label' \t\t=> __( 'Show Product Counts', 'xstore-core' ),\n\t\t\t\t'type'\t\t\t=> \\Elementor\\Controls_Manager::SWITCHER,\n\t\t\t\t'label_on' \t\t=> __( 'Yes', 'xstore-cores' ),\n\t\t\t\t'label_off' \t=> __( 'No', 'xstore-cores' ),\n\t\t\t\t'return_value' \t=> 'yes',\n\t\t\t\t'default' \t\t=> '',\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'class',\n\t\t\t[\n\t\t\t\t'label' \t=>\t__( 'Extra Class', 'xstore-core' ),\n\t\t\t\t'type' \t\t=>\t\\Elementor\\Controls_Manager::TEXT,\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\n\t}",
"function ya_widgets_init() {\n\t// Sidebars\n\t$primary = array(\n\t\t\t'name' => __('Sidebar Primary', 'yatheme'),\n\t\t\t'id' => 'primary',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s\"><div class=\"sidebar-right\">',\n\t\t\t'after_widget' => '</div></section>',\n\t\t\t'before_title' => '<h3>',\n\t\t\t'after_title' => '</h3>'\n\t);\n\tregister_sidebar($primary);\n\t$slide = array(\n\t\t\t'name' => __('Sidebar Slideshow', 'yatheme'),\n\t\t\t'id' => 'slideshow',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s\">',\n\t\t\t'after_widget' => '</section>',\n\t\t\t'before_title' => '',\n\t\t\t'after_title' => ''\n\t);\n\tregister_sidebar($slide);\n\t$sideba_home = array(\n\t\t\t'name' => __('Sidebar Home', 'yatheme'),\n\t\t\t'id' => 'sidebar-home',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s hwidget\">',\n\t\t\t'after_widget' => '</section>',\n\t\t\t'before_title' => '<h2>',\n\t\t\t'after_title' => '</h2>'\n\t);\n\tregister_sidebar($sideba_home);\n\t$footer = array(\n\t\t\t'name' => __('Footer', 'yatheme'),\n\t\t\t'id' => 'footer',\n\t\t\t'before_widget' => '<section class=\"widget %1$s %2$s\"><div class=\"widget-inner\">',\n\t\t\t'after_widget' => '</div></section>',\n\t\t\t'before_title' => '<h4>',\n\t\t\t'after_title' => '</h4>'\n\t);\n\tregister_sidebar($footer);\n\n\t// Widgets\n\tregister_widget('YA_Posts_Widget');\n\tregister_widget('YA_Gallery_Widget');\n}",
"function perusecretland_widgets_init() {\n // Top widgets\n $args = array(\n 'name' => 'Top Widgets',\n 'id' => 'top-widgets',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n );\n register_sidebar( $args );\n // Floating sidebar\n $args = array(\n 'name' => 'Floating Sidebar',\n 'id' => 'floating-sidebar',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n );\n register_sidebar( $args );\n}",
"public static function a_widget_init() {\n\t\t\treturn register_widget(__CLASS__);\n\t\t}",
"function arphabet_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Widget oben rechts',\n 'id' => 'widget_top_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget mitte rechts',\n 'id' => 'widget_center_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Widget unten rechts',\n 'id' => 'widget_bottom_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Newsletter Widget',\n 'id' => 'newsletter_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Custom Footer Widget',\n 'id' => 'footer_widget',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n\n}",
"protected function _register_controls() {\n\t}",
"function MyPenandPantry_WidgetInit()\n{\n\tregister_sidebar(array(\n\t\t'name' => 'Social-icon-bar',\n\t\t'id' => 'sidebar1',\n\t\t'before_widget' => '<div class=\"widget-item\">',\n\t\t'after_widget' => '</div>'\n\t));\n}",
"function wpb_load_widget() {\n\t\tregister_widget( 'dmv_widget' );\n\t}",
"function twentyten_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'twentyten' ),\n\t\t'id' => 'sidebar-principal',\n\t\t'description' => __( 'Arraste os itens desejados até aqui. ', 'twentyten' ),\n\t\t'before_widget' => '<div class=\"widget %2$s\" id=\"%1$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n}",
"function ptoys_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'ptoys' ),\n\t\t'id' => 'sidebar-1',\n\t\t'description' => __( 'Add widgets here to appear in your sidebar.', 'ptoys' ),\n\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</section>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n}",
"function __construct() {\n $widget_ops = array( 'classname' => 'wplms_dash_mymodules', 'description' => __('My Courses, Units, Quizzes, Assignments, Finished Courses widget for Dashboard', 'wplms-dashboard') );\n $control_ops = array( 'width' => 300, 'height' => 350, 'id_base' => 'wplms_dash_mymodules' );\n parent::__construct( 'wplms_dash_mymodules', __(' DASHBOARD : My Modules Widget', 'wplms-dashboard'), $widget_ops, $control_ops );\n }",
"function arphabet_widgets_init() {\r\n\r\n\tregister_sidebar( array(\r\n\t\t'name' => 'left sidebar',\r\n\t\t'id' => 'left_1',\r\n\t\t'before_widget' => '<div id=\"genres_box\">',\r\n\t\t'after_widget' => '</div>',\r\n\t\t'before_title' => '',\r\n\t\t'after_title' => '',\r\n\t) );\r\n\r\n}",
"function ourWidgetsInit() {\n // register widget location\n register_sidebar( array(\n 'name' => 'Sidebarr',\n 'id' => 'sidebar1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"a-special-class\">',\n 'after_title' => '</h2>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 1',\n 'id' => 'footer1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 2',\n 'id' => 'footer2',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 3',\n 'id' => 'footer3',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n\n register_sidebar( array(\n 'name' => 'Footer Area 4',\n 'id' => 'footer4',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>'\n ));\n}",
"protected function init()\n {\n $this->setTitle('core_layout.edit_layout');\n }",
"function theme_widgets_init() {\n\t // Area 1\n\t register_sidebar( array (\n\t 'name' => 'Primary Widget Area',\n\t 'id' => 'primary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\n\t // Area 2\n\t register_sidebar( array (\n\t 'name' => 'Secondary Widget Area',\n\t 'id' => 'secondary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\t}",
"function theme_widgets_init() {\n\t // Area 1\n\t register_sidebar( array (\n\t 'name' => 'Primary Widget Area',\n\t 'id' => 'primary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\n\t // Area 2\n\t register_sidebar( array (\n\t 'name' => 'Secondary Widget Area',\n\t 'id' => 'secondary_widget_area',\n\t 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n\t 'after_widget' => \"</li>\",\n\t 'before_title' => '<h3 class=\"widget-title\">',\n\t 'after_title' => '</h3>',\n\t ) );\n\t}",
"function init()\n {\n $rcmail = rcmail::get_instance();\n\n $this->add_texts('localization/', false);\n\n // register task\n $this->register_task('dspam');\n\n // register actions\n $this->register_action('index', array($this, 'action'));\n\n // add taskbar button\n $this->add_button(array(\n 'command' => 'dspam',\n 'class' => 'button-help',\n 'classsel' => 'button-help button-selected',\n 'innerclass' => 'button-inner',\n 'label' => 'dspam.dspam',\n ), 'taskbar');\n\n $skin = $rcmail->config->get('skin');\n if (!file_exists($this->home.\"/skins/$skin/help.css\"))\n $skin = 'default';\n\n // add style for taskbar button (must be here) and Help UI \n $this->include_stylesheet(\"skins/$skin/help.css\");\n }",
"public function addsButtons() {}",
"public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Dropdown() );\n\t}",
"function russianroulette_widgets_init() {\n \tregister_sidebar( array(\n \t\t'name' => __( 'Sidebar', 'russianroulette' ),\n \t\t'id' => 'sidebar-1',\n \t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n \t\t'after_widget' => '</aside>',\n \t\t'before_title' => '<h1 class=\"widget-title\">',\n \t\t'after_title' => '</h1>',\n \t) );\n }",
"static function init() {\n\t\t\t$classname = get_called_class();\n\t\t\tadd_action( 'widgets_init', $classname . '::register_widget' );\n\t\t\tadd_shortcode( $classname, $classname . '::register_shortcode' );\n\t\t}",
"public function create_widgets () {\n wp_enqueue_style( 'wedevs-latest-post-style' );\n\n add_action( 'wp_dashboard_setup', [ $this, 'add_dashboard_widgets' ] );\n }",
"protected function _register_controls()\r\n {\r\n\r\n\r\n $this->start_controls_section(\r\n 'slider_settings_section',\r\n [\r\n 'label' => esc_html__('Query Settings', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_CONTENT,\r\n ]\r\n );\r\n $this->add_control(\r\n 'column',\r\n [\r\n 'label' => esc_html__('Column', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n '3' => esc_html__('04 Column', 'aapside-master'),\r\n '4' => esc_html__('03 Column', 'aapside-master'),\r\n '2' => esc_html__('06 Column', 'aapside-master')\r\n ),\r\n 'label_block' => true,\r\n 'description' => esc_html__('select grid column', 'aapside-master'),\r\n 'default' => '4'\r\n ]\r\n );\r\n $this->add_control(\r\n 'total',\r\n [\r\n 'label' => esc_html__('Total Post', 'aapside-master'),\r\n 'type' => Controls_Manager::TEXT,\r\n 'description' => esc_html__('enter how many post you want to show, enter -1 for unlimited', 'aapside-master'),\r\n 'default' => '-1'\r\n ]\r\n );\r\n $this->add_control(\r\n 'category',\r\n [\r\n 'label' => esc_html__('Category', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT2,\r\n 'multiple' => true,\r\n 'label_block' => true,\r\n 'description' => esc_html__('select category, for all category leave it blank', 'aapside-master'),\r\n 'options' => appside_master()->get_terms_names('portfolio-cat', 'id', true)\r\n ]\r\n );\r\n $this->add_control(\r\n 'orderby',\r\n [\r\n 'label' => esc_html__('Order By', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n 'ID' => esc_html__('ID', 'aapside-master'),\r\n 'title' => esc_html__('Title', 'aapside-master'),\r\n 'date' => esc_html__('Date', 'aapside-master'),\r\n ),\r\n 'description' => esc_html__('select order by', 'aapside-master'),\r\n 'default' => 'ID'\r\n ]\r\n );\r\n $this->add_control(\r\n 'order',\r\n [\r\n 'label' => esc_html__('Order', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n 'ASC' => esc_html__('Ascending', 'aapside-master'),\r\n 'DESC' => esc_html__('Descending', 'aapside-master'),\r\n ),\r\n 'description' => esc_html__('select order.', 'aapside-master'),\r\n 'default' => 'ASC'\r\n ]\r\n );\r\n $this->add_control(\r\n 'pagination',\r\n [\r\n 'label' => esc_html__('Pagination', 'aapside-master'),\r\n 'type' => Controls_Manager::SWITCHER,\r\n 'description' => esc_html__('you can set yes to show pagination.', 'aapside-master'),\r\n 'default' => 'yes'\r\n ]\r\n );\r\n $this->add_control(\r\n 'pagination_alignment',\r\n [\r\n 'label' => esc_html__('Pagination Alignment', 'aapside-master'),\r\n 'type' => Controls_Manager::SELECT,\r\n 'options' => array(\r\n 'left' => esc_html__('Left Align', 'aapside-master'),\r\n 'center' => esc_html__('Center Align', 'aapside-master'),\r\n 'right' => esc_html__('Right Align', 'aapside-master'),\r\n ),\r\n 'description' => esc_html__('you can set pagination alignment.', 'aapside-master'),\r\n 'default' => 'left',\r\n 'condition' => array('pagination' => 'yes')\r\n ]\r\n );\r\n $this->end_controls_section();\r\n\r\n $this->start_controls_section(\r\n 'thumbnail_settings_section',\r\n [\r\n 'label' => esc_html__('Thumbnail Styling', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n $this->add_control('thumb_border_radius', [\r\n 'label' => esc_html__('Border Radius', 'aapside-master'),\r\n 'type' => Controls_Manager::DIMENSIONS,\r\n 'size_units' => ['px', '%', 'em'],\r\n 'selectors' => [\r\n \"{{WRAPPER}} .hard-single-item-02 .thumb img\" => \"border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};\"\r\n ]\r\n ]);\r\n $this->add_control(\r\n 'thumbnail_bottom_gap',\r\n [\r\n 'label' => esc_html__('Thumbnail Bottom Gap', 'aapside-master'),\r\n 'type' => Controls_Manager::SLIDER,\r\n 'size_units' => ['px', '%'],\r\n 'range' => [\r\n 'px' => [\r\n 'min' => 0,\r\n 'max' => 100,\r\n 'step' => 1,\r\n ],\r\n '%' => [\r\n 'min' => 0,\r\n 'max' => 100,\r\n ],\r\n ],\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .thumb' => 'margin-bottom: {{SIZE}}{{UNIT}};',\r\n ],\r\n ]\r\n );\r\n $this->end_controls_section();\r\n\r\n\r\n /* title styling tabs start */\r\n $this->start_controls_section(\r\n 'title_settings_section',\r\n [\r\n 'label' => esc_html__('Title Styling', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n $this->start_controls_tabs(\r\n 'style_tabs'\r\n );\r\n\r\n $this->start_controls_tab(\r\n 'style_normal_tab',\r\n [\r\n 'label' => __('Normal', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('title_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .title' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n $this->end_controls_tab();\r\n\r\n $this->start_controls_tab(\r\n 'style_hover_tab',\r\n [\r\n 'label' => __('Hover', 'aapside-master'),\r\n ]\r\n );\r\n $this->add_control('title_hover_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .title:hover' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n\r\n $this->end_controls_tab();\r\n\r\n $this->end_controls_tabs();\r\n\r\n $this->end_controls_section();\r\n\r\n /* title styling tabs end */\r\n\r\n /* readmore styling tabs start */\r\n $this->start_controls_section(\r\n 'readmore_settings_section',\r\n [\r\n 'label' => esc_html__('Category Styling', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n\r\n $this->start_controls_tabs(\r\n 'readmore_style_tabs'\r\n );\r\n\r\n $this->start_controls_tab(\r\n 'readmore_style_normal_tab',\r\n [\r\n 'label' => __('Normal', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('readmore_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .catagory a' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n $this->end_controls_tab();\r\n\r\n $this->start_controls_tab(\r\n 'readmore_style_hover_tab',\r\n [\r\n 'label' => __('Hover', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('readmore_hover_color', [\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'type' => Controls_Manager::COLOR,\r\n 'selectors' => [\r\n '{{WRAPPER}} .hard-single-item-02 .content .catagory a:hover' => \"color:{{VALUE}}\"\r\n ]\r\n ]);\r\n $this->end_controls_tab();\r\n\r\n $this->end_controls_tabs();\r\n\r\n $this->end_controls_section();\r\n /* readmore styling tabs end */\r\n\r\n /* pagination styling tabs start */\r\n $this->start_controls_section(\r\n 'pagination_settings_section',\r\n [\r\n 'label' => esc_html__('Pagination Settings', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n\r\n $this->start_controls_tabs(\r\n 'pagination_style_tabs'\r\n );\r\n\r\n $this->start_controls_tab(\r\n 'pagination_style_normal_tab',\r\n [\r\n 'label' => __('Normal', 'aapside-master'),\r\n ]\r\n );\r\n\r\n $this->add_control('pagination_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination` ul li a\" => \"color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span\" => \"color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_border_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Border Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination ul li a\" => \"border-color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span\" => \"border-color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_hr', [\r\n 'type' => Controls_Manager::DIVIDER\r\n ]);\r\n $this->add_group_control(Group_Control_Background::get_type(), [\r\n 'name' => 'pagination_background',\r\n 'label' => esc_html__('Background', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .portfolio-pagination ul li a, {{WRAPPER}} .portfolio-pagination ul li span\"\r\n ]);\r\n\r\n $this->end_controls_tab();\r\n\r\n $this->start_controls_tab(\r\n 'pagination_style_hover_tab',\r\n [\r\n 'label' => __('Hover', 'aapside-master'),\r\n ]\r\n );\r\n $this->add_control('pagination_hover_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination ul li a:hover\" => \"color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span.current\" => \"color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_hover_border_color', [\r\n 'type' => Controls_Manager::COLOR,\r\n 'label' => esc_html__('Border Color', 'aapside-master'),\r\n 'selectors' => [\r\n \"{{WRAPPER}} .portfolio-pagination ul li a:hover\" => \"border-color: {{VALUE}}\",\r\n \"{{WRAPPER}} .portfolio-pagination ul li span.current\" => \"border-color: {{VALUE}}\",\r\n ]\r\n ]);\r\n $this->add_control('pagination_hover_hr', [\r\n 'type' => Controls_Manager::DIVIDER\r\n ]);\r\n $this->add_group_control(Group_Control_Background::get_type(), [\r\n 'name' => 'pagination_hover_background',\r\n 'label' => esc_html__('Background', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .portfolio-pagination ul li a:hover, {{WRAPPER}} .Portfolio-pagination ul li span.current\"\r\n ]);\r\n\r\n\r\n $this->end_controls_tab();\r\n\r\n $this->end_controls_tabs();\r\n\r\n $this->end_controls_section();\r\n /* pagination styling tabs end */\r\n\r\n /* Typography tabs start */\r\n $this->start_controls_section(\r\n 'typography_settings_section',\r\n [\r\n 'label' => esc_html__('Typography Settings', 'aapside-master'),\r\n 'tab' => Controls_Manager::TAB_STYLE,\r\n ]\r\n );\r\n $this->add_group_control(Group_Control_Typography::get_type(), [\r\n 'name' => 'title_typography',\r\n 'label' => esc_html__('Title Typography', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .hard-single-item-02 .content .title\"\r\n ]);\r\n $this->add_group_control(Group_Control_Typography::get_type(), [\r\n 'name' => 'post_meta_typography',\r\n 'label' => esc_html__('Category Typography', 'aapside-master'),\r\n 'selector' => \"{{WRAPPER}} .hard-single-item-02 .content .cats\"\r\n ]);\r\n $this->end_controls_section();\r\n\r\n /* Typography tabs end */\r\n }",
"function register_zijcareebuilderjobswidget() {\n register_widget( 'ZijCareerBuilderJobs' );\n}",
"function register_browse_widget() {\n\tregister_widget(\"browse_index_widget\");\t\n}",
"public function register_controls()\n {\n }",
"public function register_widget() {\n register_widget( 'WPP_Widget' );\n }",
"function arphabet_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Page Sidebar',\n\t\t'id' => 'page-sidebar',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}",
"protected function _register_controls() {\r\n\r\n\t\t$this->start_controls_section(\r\n\t\t\t'settings_section',\r\n\t\t\t[\r\n\t\t\t\t'label' => esc_html__( 'General Settings', 'aapside-master' ),\r\n\t\t\t\t'tab' => Controls_Manager::TAB_CONTENT,\r\n\t\t\t]\r\n\t\t);\r\n\t\t$this->add_control( 'title', [\r\n\t\t\t'label' => esc_html__( 'Title', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( 'Primary Plan', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter title', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'featured', [\r\n\t\t\t'label' => esc_html__( 'Featured', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::SWITCHER,\r\n\t\t\t'default' => 'no',\r\n\t\t\t'description' => esc_html__( 'enable featured', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'price', [\r\n\t\t\t'label' => esc_html__( 'Price', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( '250', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter price', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'sign', [\r\n\t\t\t'label' => esc_html__( 'Sign', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( '$', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter sign', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'month', [\r\n\t\t\t'label' => esc_html__( 'Month', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( '/Mo', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter month', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'btn_text', [\r\n\t\t\t'label' => esc_html__( 'Button Text', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t'default' => esc_html__( 'Get Started', 'aapside-master' ),\r\n\t\t\t'description' => esc_html__( 'enter button text', 'aapside-master' )\r\n\t\t] );\r\n\t\t$this->add_control( 'btn_link', [\r\n\t\t\t'label' => esc_html__( 'Button Link', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::URL,\r\n\t\t\t'default' => array(\r\n\t\t\t\t'url' => '#'\r\n\t\t\t),\r\n\t\t\t'description' => esc_html__( 'enter button link', 'aapside-master' )\r\n\t\t] );\r\n\r\n\t\t$this->add_control( 'feature_items', [\r\n\t\t\t'label' => esc_html__( 'Feature Item', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::REPEATER,\r\n\t\t\t'default' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t'feature' => esc_html__( '5 Analyzer', 'aapside-master' )\r\n\t\t\t\t],\r\n\t\t\t],\r\n\t\t\t'fields' => [\r\n\t\t\t\t[\r\n\t\t\t\t\t'name' => 'feature',\r\n\t\t\t\t\t'label' => esc_html__( 'Feature', 'aapside-master' ),\r\n\t\t\t\t\t'type' => Controls_Manager::TEXT,\r\n\t\t\t\t\t'description' => esc_html__( 'enter feature item.', 'aapside-master' ),\r\n\t\t\t\t\t'default' => esc_html__( '5 Analyzer', 'aapside-master' )\r\n\t\t\t\t]\r\n\t\t\t],\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\r\n\t\t$this->start_controls_section( 'styling_section', [\r\n\t\t\t'label' => esc_html__( 'Styling Settings', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\t\t$this->add_control( 'title_color', [\r\n\t\t\t'label' => esc_html__( 'Title Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-header .name\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_control( 'price_color', [\r\n\t\t\t'label' => esc_html__( 'Price Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-header .price-wrap .price\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_control( 'month_color', [\r\n\t\t\t'label' => esc_html__( 'Month Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-header .price-wrap .month\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_control( 'features_color', [\r\n\t\t\t'label' => esc_html__( 'Features Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-body ul\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\r\n\t\t/* button styling start */\r\n\t\t$this->start_controls_section( 'button_styling_section', [\r\n\t\t\t'label' => esc_html__( 'Button Styling', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\t\t$this->start_controls_tabs(\r\n\t\t\t'button_style_tabs'\r\n\t\t);\r\n\r\n\t\t$this->start_controls_tab(\r\n\t\t\t'button_style_normal_tab',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Normal', 'aapside-master' ),\r\n\t\t\t]\r\n\t\t);\r\n\t\t$this->add_control( 'button_normal_color', [\r\n\t\t\t'label' => esc_html__( 'Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Background::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Button Background', 'aapside-master' ),\r\n\t\t\t'name' => 'button_normal_bg_color',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Border::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Border', 'aapside-master' ),\r\n\t\t\t'name' => 'button_normal_border',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\"\r\n\t\t] );\r\n\r\n\t\t$this->end_controls_tab();\r\n\r\n\t\t$this->start_controls_tab(\r\n\t\t\t'button_style_hover_tab',\r\n\t\t\t[\r\n\t\t\t\t'label' => __( 'Hover', 'aapside-master' ),\r\n\t\t\t]\r\n\t\t);\r\n\t\t$this->add_control( 'button_hover_color', [\r\n\t\t\t'label' => esc_html__( 'Color', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::COLOR,\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn:hover\" => \"color: {{VALUE}}\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Background::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Button Background', 'aapside-master' ),\r\n\t\t\t'name' => 'button_hover_bg_color',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn:hover\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Border::get_type(), [\r\n\t\t\t'label' => esc_html__( 'Border', 'aapside-master' ),\r\n\t\t\t'name' => 'button_hover_border',\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn:hover\"\r\n\t\t] );\r\n\r\n\t\t$this->end_controls_tab();\r\n\r\n\t\t$this->end_controls_tabs();\r\n\t\t$this->add_control( 'button_divider', [\r\n\t\t\t'type' => Controls_Manager::DIVIDER\r\n\t\t] );\r\n\t\t$this->add_responsive_control( 'button_border_radius', [\r\n\t\t\t'label' => esc_html__( 'Border Radius', 'aapside-master' ),\r\n\t\t\t'type' => Controls_Manager::DIMENSIONS,\r\n\t\t\t'units' => [ 'px', '%', 'em' ],\r\n\t\t\t'selectors' => [\r\n\t\t\t\t\"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\" => \"border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};\"\r\n\t\t\t]\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\t\t/* button styling end */\r\n\r\n\t\t/* border color start */\r\n\t\t$this->start_controls_section( 'hover_border_section', [\r\n\t\t\t'label' => esc_html__( 'Hover Border Style', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\r\n\t\t$this->add_group_control( Group_Control_Background::get_type(), [\r\n\t\t\t'name' => 'hover_background',\r\n\t\t\t'label' => esc_html__( 'Active Border Color', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02:after\"\r\n\t\t] );\r\n\r\n\t\t$this->end_controls_section();\r\n\t\t/* border color end */\r\n\r\n\r\n\t\t/* button styling start */\r\n\t\t$this->start_controls_section( 'typography_section', [\r\n\t\t\t'label' => esc_html__( 'Typography Settings', 'aapside-master' ),\r\n\t\t\t'tab' => Controls_Manager::TAB_STYLE\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'title_typography',\r\n\t\t\t'label' => esc_html__( 'Title Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-header .name\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'price_typography',\r\n\t\t\t'label' => esc_html__( 'Price Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-header .price-wrap\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'features_typography',\r\n\t\t\t'label' => esc_html__( 'Features Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-body ul\"\r\n\t\t] );\r\n\t\t$this->add_group_control( Group_Control_Typography::get_type(), [\r\n\t\t\t'name' => 'button_typography',\r\n\t\t\t'label' => esc_html__( 'Button Typography', 'aapside-master' ),\r\n\t\t\t'selector' => \"{{WRAPPER}} .single-price-plan-02 .price-footer .boxed-btn\"\r\n\t\t] );\r\n\t\t$this->end_controls_section();\r\n\t\t/* button styling end */\r\n\t}",
"function widget_load() {\n\t\tregister_widget('ilgelo_wSocial');\n\t\tregister_widget('ilgelo_wTwitter');\n\t\tregister_widget('ilgelo_banner');\n\t}",
"public function setInit()\n {\n $container = strtoupper($this->getCurrentWidget()->getPlugin());\n $NameAction = strtolower($this->getCurrentWidget()->getAction());\n $method = \":\"; \n $xmlConfig = $this->getCurrentWidget()->getConfigXml(); \n // if the configXml field of the widget isn't configured correctly.\n try {\n $xmlConfig = new \\Zend_Config_Xml($xmlConfig);\n } catch (\\Exception $e) {\n return \" \\n\";\n } \n // we add all css files.\n if ( $xmlConfig->widgets->get('css') ){\n \tif (is_object($xmlConfig->widgets->css)) {\n \t\t$all_css = $xmlConfig->widgets->css->toArray();\n \t\t$this->script['init'][$container.$NameAction.$method.'css'] = \"{% initWidget('css:\".json_encode($all_css, JSON_UNESCAPED_UNICODE).\"') %}\";\n \t} elseif (is_string($xmlConfig->widgets->css)) {\n \t\t$this->script['init'][$container.$NameAction.$method.'css'] = \"{% initWidget('css:\".json_encode(array($xmlConfig->widgets->css), JSON_UNESCAPED_UNICODE).\"') %}\";\n \t}\n }\n // we add all js files.\n if ( $xmlConfig->widgets->get('js') ){\n \tif (is_object($xmlConfig->widgets->js)) {\n \t\t$all_js = $xmlConfig->widgets->js->toArray();\n \t\t$this->script['init'][$container.$NameAction.$method.'js'] = \"{% initWidget('js:\".json_encode($all_js, JSON_UNESCAPED_UNICODE).\"') %}\";\n \t} elseif (is_string($xmlConfig->widgets->js)) {\n \t\t$this->script['init'][$container.$NameAction.$method.'js'] = \"{% initWidget('js:\".json_encode(array($xmlConfig->widgets->js), JSON_UNESCAPED_UNICODE).\"') %}\";\n \t}\n }\n // we apply init methods of the applyed service.\n if ( $xmlConfig->widgets->get('gedmo') && $xmlConfig->widgets->gedmo->get('controller') ) {\n $controller = $xmlConfig->widgets->gedmo->controller;\n $values = explode(':', $controller);\n $entity = strtolower($values[1]);\n $method .= strtolower($values[2]);\n $this->script['init'][$container.$NameAction.$method] = \"{% initWidget('\". $container . \":\" . $NameAction . $method .\"') %}\";\n }elseif ( $xmlConfig->widgets->get('content') && $xmlConfig->widgets->content->get('controller') ) {\n $controller = $xmlConfig->widgets->content->controller;\n str_replace(':', ':', $controller, $count);\n if ($count == 1) {\n $this->script['init'][$container.$NameAction.$method] = \"{% initWidget('\". $container . \":\" . $NameAction . \":\" . $controller .\"') %}\";\n }\n }elseif ( $xmlConfig->widgets->get('search') && $xmlConfig->widgets->search->get('controller') ) {\n $controller = $xmlConfig->widgets->search->controller;\n str_replace(':', ':', $controller, $count);\n if ($count == 1) {\n $this->script['init'][$container.$NameAction.$method] = \"{% initWidget('\". $container . \":\" . $NameAction . \":\" . $controller .\"') %}\";\n }\n } else {\n $this->script['init'][$container.$NameAction.$method] = \"{% initWidget('\". $container . \":\" . $NameAction . $method .\"') %}\";\n }\n }",
"public function init()\n\t{\n\t\tparent::init();\n\n\t\tif(isset($this->buttons['view']) && isset($this->viewButtonVisible))\n\t\t\t$this->buttons['view']['visible']=$this->viewButtonVisible;\n\t\tif(isset($this->buttons['update']) && isset($this->updateButtonVisible))\n\t\t\t$this->buttons['update']['visible']=$this->updateButtonVisible;\n\t\tif(isset($this->buttons['delete']) && isset($this->deleteButtonVisible))\n\t\t\t$this->buttons['delete']['visible']=$this->deleteButtonVisible;\n\t}",
"function FoodByNight_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer Right',\n\t\t'id' => 'footer_right',\n\t\t'before_widget' => '<ul class=\"list-inline\">',\n\t\t'after_widget' => '</ul>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Social_Link_Widget' );\n\n\tregister_sidebar( array(\n\t\t'name' => 'Popups',\n\t\t'id' => 'popups',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\tregister_widget( 'Contact_Popup_Widget' );\n\n}",
"function hw_load_widget() {\n\tregister_widget( 'hw_cal_widget' );\n\tregister_widget( 'hw_custom_post_list_widget' );\n}",
"protected function _register_controls()\n {\n $this->tab_content();\n $this->tab_style();\n }",
"function aitWidgetsInit(){\r\n\taitRegisterWidgetAreas(array(\r\n\t\t'home-sidebar'\t\t=> array('name' => __('Home Sidebar', 'ait')),\r\n\t\t'page-sidebar'\t\t=> array('name' => __('Page Sidebar', 'ait')),\r\n\t\t'blog-sidebar'\t\t=> array('name' => __('Blog Sidebar', 'ait')),\r\n\t\t'post-sidebar'\t\t=> array('name' => __('Post Sidebar', 'ait')),\r\n\t\t'footer-sidebar'\t=> array('name' => __('Footer Widgets Area', 'ait'))\r\n\t));\r\n}",
"function header_widgets_init() {\r\n\r\n\tregister_sidebar( array(\r\n\t\t'name' => 'Header Widget',\r\n\t\t'id' => 'header_widget',\r\n\t\t'before_widget' => '<div class=\"header-widget\">',\r\n\t\t'after_widget' => '</div>',\r\n\t\t'before_title' => '',\r\n\t\t'after_title' => '',\r\n\t) );\r\n\r\n}",
"protected function _register_controls() {\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_settings',\n\t\t\t[\n\t\t\t\t'label' => __( 'Clients Settings', 'elementor-main-clients' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t 'clients-columns',\n\t\t \t[\n\t\t \t'label' \t=> esc_html__( 'Column', 'essential-addons-elementor' ),\n\t\t \t'type' \t\t\t=> Controls_Manager::SELECT,\n\t\t \t'default' \t\t=> '2',\n\t\t \t'options' \t\t=> [\t\t\t\t\n\t\t\t\t\t'1' => esc_html__('1 Column', 'baldiyaat'),\n\t\t\t\t\t'2' => esc_html__('2 Column', 'baldiyaat'),\n\t\t\t\t\t'3' => esc_html__('3 Column', 'baldiyaat'),\n\t\t\t\t\t'4' => esc_html__('4 Column', 'baldiyaat'),\n\t\t\t\t\t'6' => esc_html__('6 Column', 'baldiyaat')\n\t\t \t],\n\t\t \t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'thumbnail-size',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Thumbnail Size', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::SELECT,\n\t\t\t\t'label_block' \t=> false,\n\t\t\t\t'default' => esc_html__( 'hide', 'essential-addons-elementor' ),\n\t\t \t'options' => wpha_get_thumbnail_list(),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'num-fetch',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Num Fetch', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t'label_block' => false,\n\t\t\t\t'default' => 10,\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Clients Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_config_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Clients Images', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'slider',\n\t\t\t[\n\t\t\t\t'type' => Controls_Manager::REPEATER,\n\t\t\t\t'seperator' => 'before',\n\t\t\t\t'default' => [\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t\t[ 'main_clients_settings_slide' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png' ],\n\t\t\t\t],\n\t\t\t\t'fields' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide',\n\t\t\t\t\t\t'label' => esc_html__( 'Image', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::MEDIA,\n\t\t\t\t\t\t'default' => [\n\t\t\t\t\t\t\t'url' => KODEFOREST_MAIN_URL . 'assets/clients/simple-clients.png',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_title',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Title', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_caption',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Caption', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::TEXT,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => esc_html__( '', 'essential-addons-elementor' )\n\t\t\t\t\t],\n\t\t\t\t\t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_enable_slide_link',\n\t\t\t\t\t\t'label' => __( 'Enable Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::SWITCHER,\n\t\t\t\t\t\t'default' => 'false',\n\t\t\t\t\t\t'label_on' => esc_html__( 'Yes', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'label_off' => esc_html__( 'No', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'return_value' => 'true',\n\t\t\t\t\t\t\n\t\t\t\t \t],\n\t\t\t\t \t[\n\t\t\t\t\t\t'name' => 'main_clients_settings_slide_link',\n\t\t\t\t\t\t'label' => esc_html__( 'Image Link', 'essential-addons-elementor' ),\n\t\t\t\t\t\t'type' => Controls_Manager::URL,\n\t\t\t\t\t\t'label_block' => true,\n\t\t\t\t\t\t'default' => [\n\t\t \t\t\t'url' => '#',\n\t\t \t\t\t'is_external' => '',\n\t\t \t\t\t],\n\t\t \t\t\t'show_external' => true,\n\t\t \t\t\t'condition' => [\n\t\t \t\t\t\t'main_clients_settings_enable_slide_link' => 'true'\n\t\t \t\t\t]\n\t\t\t\t\t]\n\t\t\t\t],\n\t\t\t\t'title_field' => '{{main_clients_settings_slide_title}}',\n\t\t\t]\n\t\t);\n\n\t\t$this->end_controls_section();\n\t\t\n\t\t/**\n\t\t * Clients Text Settings\n\t\t */\n\t\t$this->start_controls_section(\n\t\t\t'main_clients_color_settings',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Color & Design', 'essential-addons-elementor' ),\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_sub_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Sub Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .kode-sub-title' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_title_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Title Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .slide-caption-title' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_caption_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Caption Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .slide-caption-des' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_button_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Button Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .banner_text_btn .bg-color' => 'color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->add_control(\n\t\t\t'main_clients_button_bg_color',\n\t\t\t[\n\t\t\t\t'label' => esc_html__( 'Image Button BG Color', 'essential-addons-elementor' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '#f4f4f4',\n\t\t\t\t'selectors' => [\n\t\t\t\t\t'{{WRAPPER}} .slide-item .slide-caption .banner_text_btn .bg-color' => 'background-color: {{VALUE}};',\n\t\t\t\t],\n\t\t\t]\n\t\t);\n\t\t\n\t\t$this->end_controls_section();\n\t\t\n\t\t\n\t}"
] | [
"0.7268984",
"0.7268984",
"0.71292907",
"0.7066058",
"0.69506377",
"0.68922555",
"0.685116",
"0.6792727",
"0.6730674",
"0.6706911",
"0.66611874",
"0.6652217",
"0.6645855",
"0.6620171",
"0.6581971",
"0.65692586",
"0.6553118",
"0.65520185",
"0.65310806",
"0.6495505",
"0.64912826",
"0.6481913",
"0.6471775",
"0.6461584",
"0.6455803",
"0.6450222",
"0.64399844",
"0.6431256",
"0.64024484",
"0.63898396",
"0.6386073",
"0.6383928",
"0.63808715",
"0.6379131",
"0.63781625",
"0.63603085",
"0.6354925",
"0.63357997",
"0.6329905",
"0.63274187",
"0.63225275",
"0.63209987",
"0.63072735",
"0.63015854",
"0.6296903",
"0.6295306",
"0.6285434",
"0.6283952",
"0.627495",
"0.62680674",
"0.6266772",
"0.6266144",
"0.62600183",
"0.625216",
"0.62475765",
"0.62472993",
"0.62402046",
"0.6224373",
"0.6206424",
"0.6200082",
"0.61985177",
"0.61883396",
"0.61639243",
"0.61486155",
"0.61457056",
"0.61447984",
"0.6142214",
"0.6138461",
"0.613392",
"0.61296016",
"0.6122081",
"0.61178476",
"0.6114482",
"0.61132884",
"0.6109492",
"0.61083263",
"0.6101539",
"0.60915005",
"0.60915005",
"0.6091103",
"0.6082397",
"0.60802686",
"0.60759145",
"0.60633874",
"0.6059898",
"0.60560733",
"0.60553026",
"0.6054126",
"0.6045603",
"0.60412544",
"0.6039269",
"0.6036985",
"0.60367775",
"0.6031158",
"0.60272014",
"0.6023148",
"0.60180354",
"0.60173154",
"0.6015441",
"0.6008271",
"0.6005299"
] | 0.0 | -1 |
Outputs the content of the widget | public function widget( $args, $instance ) {
global $wpdb;
// outputs the content of the widget
$query = "SELECT * FROM ".$wpdb->prefix."twitter_multiple_timelines";
$tweets = $wpdb->get_results($query);
if (sizeof($tweets)) :
?>
<ol class="tweets">
<?php
foreach ($tweets as $tweet) :
$tweet_text = Twitter_Autolink::create()
->setNoFollow(false)
->autoLink($tweet->text);
?>
<li>
<div class="msg">
<span class="twit">
<a href="http://twitter.com/<?php echo $tweet->user; ?>" target="_blank"><?php echo $tweet->user; ?></a> :
</span>
<span class="msgtxt">
<?php echo $tweet_text; ?>
</span>
</div>
<div class="info">
<a href="https://twitter.com/<?php echo $tweet->user; ?>/status/<?php echo $tweet->tweet_id; ?>" class="tweet-link"><?php echo $this->getRelativeTime($tweet->created_at); ?></a>
</div>
<p class="clearleft"></p>
</li>
<?php
// echo $this->c( $do_more = 0 );
endforeach;
?>
</ol>
<?php
endif;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function output() {\n\t\t\techo $this->before();\n\t\t\techo wponion_input_group_html( $this->data( 'prefix' ), $this->data( 'surfix' ), $this->element_html() );\n\t\t\techo $this->datalist();\n\t\t\techo $this->after();\n\t\t}",
"public function displayComponent() {\n\t\t\n\t\t\t$this->outputLine($this->_content);\n\t\t\t\n\t\t}",
"public function render_content()\n\t\t{ ?>\n\t\t\t<label>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->description ); ?></span>\n <p class=\"description\">\n <span class=\"typography-size-label\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\"><input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"public function render_content()\n\t\t{ ?>\n\t\t\t<label><p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?>\n </span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() );?>\" class=\"slider-input\" />\n <span class=\"px\">px</span>\n </span></p></label> <?php // WPCS: XSS ok. ?>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"public function render_content() {\n\t\t\t?>\n\t\t\t<label>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<span class=\"description customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t</label>\n\t\t\t<div class=\"wds-customize-text-editor\">\n\t\t\t\t<?php\n\t\t\t\t// Setttings for the editor.\n\t\t\t\t$settings = array(\n\t\t\t\t\t'textarea_name' => $this->id,\n\t\t\t\t\t'textarea_rows' => 4,\n\t\t\t\t\t'media_buttons' => true,\n\t\t\t\t);\n\n\t\t\t\t// Add the editor.\n\t\t\t\twp_editor( $this->value(), $this->id, $settings );\n\n\t\t\t\t// Only enqueue scripts once.\n\t\t\t\tif ( 0 === self::$count ) {\n\t\t\t\t\t$this->enqueue_scripts();\n\t\t\t\t}\n\n\t\t\t\t// add the footer scripts.\n\t\t\t\t$this->add_footer_scripts();\n\n\t\t\t\t// Increment count.\n\t\t\t\t++self::$count;\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function render_content() {\n?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"public function run() {\r\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\r\n\t\t$contents=ob_get_contents();\r\n\t\tob_end_clean();\r\n\t\tif($this->activeDataProvider === null) {\r\n\t\t\techo $contents;\r\n\t\t} else {\r\n\t\t\tif(($this->hideOnEmpty === true) && ($this->activeDataProvider->totalItemCount == 0)) {\r\n\t\t\t\techo $contents;\r\n\t\t\t} else {\r\n\t\t\t\t$this->render('TableWidget', array(\r\n\t\t\t\t\t'activeDataProvider' => $this->activeDataProvider,\r\n\t\t\t\t\t'fields' => $this->getFields(),\r\n\t\t\t\t\t'title' => $this->title,\r\n\t\t\t\t\t'pagination' => $this->enablePagination,\r\n\t\t\t\t\t'catalog' => $this->getCatalog(),\r\n\t\t\t\t\t'htmlOptions' => $this->htmlOptions,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function render_content() { ?>\n\t\t\t<label>\n <p style=\"margin-bottom:0;\">\n <span class=\"customize-control-title\" style=\"margin:0;display:inline-block;\"><?php echo esc_html( $this->label ); ?></span>\n <span class=\"value\">\n <input name=\"<?php echo esc_attr( $this->id ); ?>\" type=\"text\" <?php $this->link(); ?> value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"slider-input\" />\n <span class=\"px\">%</span>\n </span>\n </p>\n </label>\n\t\t\t<div class=\"slider\"></div>\n\t\t<?php\n\t\t}",
"public function run()\n\t{\n\t\t$this->renderContent();\n\t\t$content=ob_get_clean();\n\t\tif($this->hideOnEmpty && trim($content)==='')\n\t\t\treturn;\n\t\techo $content;\n\t}",
"public function render_content() { ?>\n\t\t<label>\n\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t<div class=\"customize-control-content\">\n\t\t\t\t<textarea class=\"widefat\" cols=\"45\" rows=\"5\" <?php $this->link(); ?>><?php echo esc_textarea( $this->value() ); ?></textarea>\n\t\t\t</div>\n\t\t</label>\n\t<?php }",
"public function display() {\n echo $this->render();\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 }",
"public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"slider-custom-control\">\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span><input type=\"number\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-slider-value\" <?php $this->link(); ?> />\n\t\t\t\t<div class=\"slider\" slider-min-value=\"<?php echo esc_attr( $this->input_attrs['min'] ); ?>\" slider-max-value=\"<?php echo esc_attr( $this->input_attrs['max'] ); ?>\" slider-step-value=\"<?php echo esc_attr( $this->input_attrs['step'] ); ?>\"></div><span class=\"slider-reset dashicons dashicons-image-rotate\" slider-reset-value=\"<?php echo esc_attr( $this->value() ); ?>\"></span>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function display() {\n\t\techo $this->data;\n\t\treturn;\n\t}",
"public function output(WidgetInterface $widget);",
"public function show_contents() {\n $inputs_array = $this->container->get_inputs_array();\n \n foreach( $inputs_array as $input_name => $input_value ) {\n $contents .= $inputs_array[ $input_name ]->render();\n }\n\n return $contents;\n }",
"public function render_content() {\n\t\t?>\n\t\t\t<input\n\t\t\t\tid=\"_customize-input-gutenberg_widget_blocks\"\n\t\t\t\ttype=\"hidden\"\n\t\t\t\tvalue=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t<?php $this->link(); ?>\n\t\t\t/>\n\t\t<?php\n\t\tthe_gutenberg_widgets( 'gutenberg_customizer' );\n\t}",
"public function render_content() {\n\n\t\tif ( empty( $this->choices ) ) {\n\t\t\treturn;\n\t\t} ?>\n\n\t\t<?php if ( ! empty( $this->label ) ) : ?>\n\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t<?php endif; ?>\n\n\t\t<?php if ( ! empty( $this->description ) ) : ?>\n\t\t\t<span class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\t\t<?php endif; ?>\n\n\t\t<?php $multi_values = ! is_array( $this->value() ) ? explode( ',', $this->value() ) : $this->value(); ?>\n\n\t\t<ul>\n\t\t\t<?php foreach ( $this->choices as $value => $label ) : ?>\n\n\t\t\t\t<li>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<input type=\"checkbox\"\n\t\t\t\t\t\t value=\"<?php echo esc_attr( $value ); ?>\" <?php checked( in_array( $value, $multi_values ) ); ?> />\n\t\t\t\t\t\t<?php echo esc_html( $label ); ?>\n\t\t\t\t\t</label>\n\t\t\t\t</li>\n\n\t\t\t<?php endforeach; ?>\n\t\t</ul>\n\n\t\t<input type=\"hidden\" <?php $this->link(); ?> value=\"<?php echo esc_attr( implode( ',', $multi_values ) ); ?>\"/>\n\t<?php }",
"public function Show(){\n\t\techo(\"\n\t\t<div class='$this->claseCSS'>\n\t\t<div class='WidgetTitle'><a id='TitleBlock' href='$this->masURL'><div id='TitleText'>$this->Titulo</div></a></div>\n\t\t\t$this->Contenido\n\t\t\t<div class='footer'><a href='$this->masURL'>Ver más...</a></div>\n\t\t</div>\n\t\t\");\n\t}",
"public function run()\n {\n $this->renderContent();\n echo ob_get_clean();\n }",
"public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"tinymce-control\">\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<textarea id=\"<?php echo esc_attr( $this->id ); ?>\" class=\"customize-control-tinymce-editor\" <?php $this->link(); ?>><?php echo esc_attr( $this->value() ); ?></textarea>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function output_markup()\n\t\t{\t\t\t\n\t\t\techo $this->markup;\n\t\t\t\n\t\t}",
"public function run()\n {\n echo \"\\n\" . $this->renderBodyEnd();\n echo \"\\n\" . Html::endTag('div');\n\n }",
"public function showContents() {\n\t\techo $this -> getContents();\n\t\texit ;\n\t}",
"public function render( ){\n\t\treturn $this->__childWidget->render();\n\t}",
"public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"toggle-switch-control\">\n\t\t\t\t<div class=\"toggle-switch\">\n\t\t\t\t\t<input type=\"checkbox\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" class=\"toggle-switch-checkbox\" value=\"<?php echo esc_attr( $this->value() ); ?>\"\n\t\t\t\t\t<?php\n\t\t\t\t\t$this->link();\n\t\t\t\t\tchecked( $this->value() );\n\t\t\t\t\t?>\n\t\t\t\t\t>\n\t\t\t\t\t<label class=\"toggle-switch-label\" for=\"<?php echo esc_attr( $this->id ); ?>\">\n\t\t\t\t\t\t<span class=\"toggle-switch-inner\"></span>\n\t\t\t\t\t\t<span class=\"toggle-switch-switch\"></span>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function render_content()\n {\n ?>\n <label>\n\t\t\t<select <?php $this->link(); ?>>\n\t\t\t\t<?php\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'none', selected($this->value(), 'none', false), 'none');\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'capitalize', selected($this->value(), 'capitalize', false), 'capitalize');\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'uppercase', selected($this->value(), 'uppercase', false), 'uppercase');\n\t\t\t\tprintf('<option value=\"%s\" %s>%s</option>', 'lowercase', selected($this->value(), 'lowercase', false), 'lowercase');\n\t\t\t\t?>\n </select>\n\t\t\t<p class=\"description\"><?php echo esc_html( $this->label ); ?></p>\n </label>\n <?php\n }",
"public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"wpcolorpicker_alpha_color_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<input type=\"text\" class=\"color-picker\" id=\"<?php echo esc_attr( $this->id ); ?>\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $this->value() ); ?>\" class=\"customize-control-colorpicker-alpha-color\" <?php echo esc_attr( $this->attributes ); ?> <?php $this->link(); ?> />\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function renderContents()\n {\n if ($this->close) {\n echo '<button class=\"close\" data-dismiss=\"alert\">×</button>';\n }\n echo $this->message;\n }",
"protected function output() {\n\t\treturn $this->before() . $this->option( 'content' ) . $this->after();\n\t}",
"public function render_content() {\n\t\t\t$allowed_html = array(\n\t\t\t\t'a' => array(\n\t\t\t\t\t'href' => array(),\n\t\t\t\t\t'title' => array(),\n\t\t\t\t\t'class' => array(),\n\t\t\t\t\t'target' => array(),\n\t\t\t\t),\n\t\t\t\t'br' => array(),\n\t\t\t\t'em' => array(),\n\t\t\t\t'strong' => array(),\n\t\t\t\t'i' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t);\n\t\t\t?>\n\t\t\t<div class=\"single-accordion-custom-control\">\n\t\t\t\t<div class=\"single-accordion-toggle\"><?php echo esc_html( $this->label ); ?><span class=\"accordion-icon-toggle dashicons dashicons-plus\"></span></div>\n\t\t\t\t<div class=\"single-accordion customize-control-description\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( is_array( $this->description ) ) {\n\t\t\t\t\t\techo '<ul class=\"single-accordion-description\">';\n\t\t\t\t\t\tforeach ( $this->description as $key => $value ) {\n\t\t\t\t\t\t\techo '<li>' . esc_attr( $key ) . wp_kses( $value, $allowed_html ) . '</li>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</ul>';\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo wp_kses( $this->description, $allowed_html );\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function render() {\n echo $this->getHtml();\n }",
"abstract protected function displayContent();",
"public function run()\n {\n $this->renderContentEnd();\n echo CHtml::closeTag('div') . \"\\n\";\n\n $this->useViewTemplate(\"box\")->selfRender();\n }",
"public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"text_radio_button_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t<div class=\"radio-buttons\">\n\t\t\t\t\t<?php foreach ( $this->choices as $key => $value ) { ?>\n\t\t\t\t\t\t<label class=\"radio-button-label\">\n\t\t\t\t\t\t\t<input type=\"radio\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php $this->link(); ?> <?php checked( esc_attr( $key ), $this->value() ); ?>/>\n\t\t\t\t\t\t\t<span><?php echo esc_attr( $value ); ?></span>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t<?php\t} ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function display() {\n return $this->out(call_user_func_array([$this, 'render'], func_get_args()));\n }",
"public function render() {\n echo \"<!DOCTYPE html>\\n\";\n echo \"<html>\\n\";\n $this->show_head();\n \n echo\"\\n<body>\\n\";\n echo $this->show_contents();\n\n echo \"\\n</body>\";\n echo \"\\n</html>\\n\\n\";\n }",
"public function renderWidget()\n {\n $id = $this->attr['id'];\n $name = $this->attr['name'];\n $contents = '';\n $values = $this->getValue();\n foreach ( $this->params['choices'] as $key => $label )\n {\n $options = $this->params;\n $options['attr'] = $this->attr;\n $options['attr']['id'] = $id . \"_$key\";\n $options['attr']['name'] = $name . \"[$key]\";\n $options['attr']['value'] = $key;\n if ( isset( $values[$key] ) && $values[$key] )\n {\n $options['attr']['checked'] = 'checked';\n }\n $widget = new InputCheckboxWidget( $options );\n $contents .= HtmlToolkit::buildTag( 'label', array(), false, $widget->render() . ' ' . $label );\n }\n\n return $contents;\n }",
"public function render_content() {\n\n\t\t\t// Process the palette\n\t\t\tif ( is_array( $this->palette ) ) {\n\t\t\t\t$palette = implode( '|', $this->palette );\n\t\t\t} else {\n\t\t\t\t// Default to true.\n\t\t\t\t$palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true';\n\t\t\t}\n\n\t\t\t// Support passing show_opacity as string or boolean. Default to true.\n\t\t\t$show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true';\n\n\t\t\t?>\n\t\t\t\t<label>\n\t\t\t\t\t<?php\n\t\t\t\t\t// Output the label and description if they were passed in.\n\t\t\t\t\tif ( isset( $this->label ) && '' !== $this->label ) {\n\t\t\t\t\t\techo '<span class=\"customize-control-title\">' . esc_html( sanitize_text_field( $this->label ) ) . '</span>';\n\t\t\t\t\t}\n\t\t\t\t\tif ( isset( $this->description ) && '' !== $this->description ) {\n\t\t\t\t\t\techo '<span class=\"description customize-control-description\">' . esc_html( sanitize_text_field( $this->description ) ) . '</span>';\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</label>\n\t\t\t\t<input class=\"alpha-color-control\" type=\"text\" data-show-opacity=\"<?php echo esc_attr( $show_opacity ); ?>\" data-palette=\"<?php echo esc_attr( $palette ); ?>\" data-default-color=\"<?php echo esc_attr( $this->settings['default']->default ); ?>\" <?php $this->link(); ?> />\n\t\t\t<?php\n\t\t}",
"public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}",
"public function output()\n {\n if (isset($this->label)) {\n $this->label->output();\n }\n parent::output(Element::OUTPUT_COMPONENT);\n }",
"public function printContent()\n {\n echo $this->content;\n }",
"public function drawContent()\n\t\t{\n\t\t}",
"public function run()\n {\n return \\yii\\helpers\\Html::tag($this->container, $this->content, $this->getOptions());\n }",
"protected function output() {\n\t\t\techo $this->before();\n\t\t\tif ( wponion_is_array( $this->data( 'options' ) ) ) {\n\t\t\t\tforeach ( $this->data( 'options' ) as $slug => $option ) {\n\t\t\t\t\t$field_args = $this->handle_args( 'title', $option, array(\n\t\t\t\t\t\t'settings' => $this->data( 'settings' ),\n\t\t\t\t\t), array(\n\t\t\t\t\t\t'id' => $slug,\n\t\t\t\t\t\t'type' => 'color_picker',\n\t\t\t\t\t\t'wrap_class' => 'wpo-col-xs-12 wpo-col-md-3',\n\t\t\t\t\t) );\n\n\t\t\t\t\tif ( isset( $field_args['label'] ) ) {\n\t\t\t\t\t\t$title = $field_args['label'];\n\t\t\t\t\t\t$field_args['title'] = $title;\n\t\t\t\t\t\tunset( $field_args['label'] );\n\t\t\t\t\t}\n\t\t\t\t\techo $this->sub_field( $field_args, $this->value( $slug ), $this->name() );\n\t\t\t\t}\n\t\t\t}\n\t\t\techo $this->after();\n\t\t}",
"public function Display()\n\t\t{\n\t\t\techo \"<html>\\n<head>\\n\";\n\t\t\t$this -> DisplayTitle();\n\t\t\t$this -> DisplayKeywords();\n\t\t\t$this -> DisplayStyles();\n\t\t\techo \"</head>\\n<body>\\n\";\n\t\t\t$this -> DisplayHeader();\n\t\t\t$this -> DisplayMenu($this->buttons);\n\t\t\techo $this->content;\n\t\t\t$this -> DisplayFooter();\n\t\t\techo \"</body>\\n</html>\\n\";\n\t\t}",
"public function render_content() {\n\t\t\t$allowed_html = array(\n\t\t\t\t'a' => array(\n\t\t\t\t\t'href' => array(),\n\t\t\t\t\t'title' => array(),\n\t\t\t\t\t'class' => array(),\n\t\t\t\t\t'target' => array(),\n\t\t\t\t),\n\t\t\t\t'br' => array(),\n\t\t\t\t'em' => array(),\n\t\t\t\t'strong' => array(),\n\t\t\t\t'i' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t\t'span' => array(\n\t\t\t\t\t'class' => array(),\n\t\t\t\t),\n\t\t\t\t'code' => array(),\n\t\t\t);\n\t\t\t?>\n\t\t\t<div class=\"simple-notice-custom-control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo wp_kses( $this->description, $allowed_html ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"function printContent()\t{\n\t\techo $this->content;\n\t}",
"function printContent()\t{\n\t\techo $this->content;\n\t}",
"public function display() {\n\t\t$this->init();\n\t\treturn $this->output();\n\t}",
"public function output_widget_control_templates()\n {\n }",
"public function render_widget() {\n\t\t$this->get_db_values();\n\t\tif ( wponion_is_callable( $this->option( 'callback' ) ) ) {\n\t\t\techo wponion_callback( $this->option( 'callback' ), array( $this->get_db_values(), $this ) );\n\t\t}\n\t}",
"public function emit()\n {\n echo <<<HTML\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>{$this->title}</title>\n <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3\" crossorigin=\"anonymous\">\n </head>\n <body>\n\n HTML;\n\n if ($this->contain)\n {\n echo <<<HTML\n <main class=\"container\">\n\n HTML;\n }\n\n $this->emitted = true;\n }",
"public function run()\n {\n Html::addCssClass($this->wrapperOptions, 'page-header');\n\n echo Html::beginTag(\"div\", $this->wrapperOptions);\n\n if (!empty($this->buttons)) {\n echo ButtonGroup::widget(\n [\n 'options' => $this->buttonGroupOptions,\n 'buttons' => $this->buttons,\n ]\n );\n }\n\n echo Html::tag(\"h1\", $this->title, $this->titleOptions);\n\n echo Html::endTag(\"div\");\n }",
"public function render_content() {\n\t\t\n\t\t$multiple = '';\n\t\tif ( $this->multi == 1 ) {\n\t\t\t$multiple = 'multiple';\n\t\t}\n\t\t\n\t\tif( $this->choices ) {\n\t\t\t?>\n\t\t\t<div class=\"<?php echo $this->relation; ?>\">\n\t\t\t\t<label>\n\t\t\t\t <span class=\"customize-control-title\"><?php echo esc_html($this->label); ?><span class=\"cody-help\" data-title=\"<?php echo wp_kses_post($this->description); ?>\"></span></span>\n\t\t\t\t <select <?php $this->link(); echo $multiple; ?>>\n\t\t\t\t\t <?php\n\t\t\t\t\t\t\tforeach ( $this->choices as $key=>$val ) {\n\t\t\t\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', $key, selected( $this->value(), $val, false ), $val );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t ?>\n\t\t\t\t </select>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t\t<?php\n\t\t} else { ?>\n\t\t\t<div class=\"<?php echo $this->relation; ?>\">\n\t\t\t\t<label>\n\t\t\t\t <span class=\"customize-control-title\">\n\t\t\t\t\t<?php echo esc_html($this->label); ?>\n\t\t\t\t\t<span class=\"cody-help\" data-title=\"<?php echo wp_kses_post($this->description); ?>\"></span>\n\t\t\t\t</span>\n\t\t\t\t <?php echo esc_html( 'Items not found' ); ?>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t<?php }\n }",
"public function render_content()\n {\n CustomizerAddon::view( 'controls.switch', ['control' => &$this] );\n }",
"public function render_content() {\n\t\t\t?>\n\t\t\t<div class=\"image_radio_button_control\">\n\t\t\t\t<?php if ( ! empty( $this->label ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if ( ! empty( $this->description ) ) { ?>\n\t\t\t\t\t<span class=\"customize-control-description\"><?php echo esc_html( $this->description ); ?></span>\n\t\t\t\t<?php } ?>\n\n\t\t\t\t<?php foreach ( $this->choices as $key => $value ) { ?>\n\t\t\t\t\t<label class=\"radio-button-label\">\n\t\t\t\t\t\t<input type=\"radio\" name=\"<?php echo esc_attr( $this->id ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\" <?php $this->link(); ?> <?php checked( esc_attr( $key ), $this->value() ); ?>/>\n\t\t\t\t\t\t<img src=\"<?php echo esc_attr( $value['image'] ); ?>\" alt=\"<?php echo esc_attr( $value['name'] ); ?>\" title=\"<?php echo esc_attr( $value['name'] ); ?>\" />\n\t\t\t\t\t</label>\n\t\t\t\t<?php\t} ?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"function dumpContents()\r\n {\r\n $attributes = $this->_getCommonAttributes();\r\n\r\n $value = ($this->_text != \"\") ? \"value=\\\"\" . $this->_text . \"\\\"\" : \"\";\r\n\r\n echo \"<input type=\\\"$this->_type\\\" id=\\\"$this->_name\\\" name=\\\"$this->_name\\\" $value $attributes />\";\r\n }",
"public function render_content() {\n\n if ( empty( $this->choices ) )\n return; ?>\n\n <?php if ( !empty( $this->label ) ) : ?>\n <span class=\"customize-control-title\"><?php echo esc_html( $this->label ); ?></span>\n <?php endif; ?>\n\n <?php if ( !empty( $this->description ) ) : ?>\n <span class=\"description customize-control-description\"><?php echo $this->description; ?></span>\n\n <?php endif; ?>\n\n <?php $multi_values = !is_array( $this->value() ) ? explode( ',', $this->value() ) : $this->value(); ?>\n\t\t\n\n\t\t<div class=\"checkbox-list\">\n\t\t<?php\n\n\t\t$term_tax = get_theme_mod('wpg_last_in_term_tax','category');\n\t\t\n\t\tforeach ( $this->choices as $key => $label ) {\n\n\t\t\t$class_list = $term_tax == $key ? 'show-list' : '';\n\t\t\n\t\t\tprintf('<ul class=\"%s %s\">', $key, $class_list);\n\n\t\t\t\tforeach ( $this->choices[$key] as $value => $label ) { ?>\n\t\t <li>\n\t\t <label>\n\t\t \t<input type=\"checkbox\" value=\"<?php echo esc_attr( $value ); ?>\" <?php checked( in_array( $value, $multi_values ) ); ?> />\n\t\t <?php echo esc_html( $label ); ?>\n\t\t </label>\n\t\t \t</li>\n\n\n\t\t<?php \n\t\t\t\t}\n\t\t\techo '</ul>';\n\t\t}\n\t\t?>\n\n\t\t</div>\n <input id=\"category-chosen\" type=\"hidden\" <?php $this->link(); ?> value=\"<?php echo esc_attr( implode( ',', $multi_values ) ); ?>\" />\n <?php }",
"public function display() {\r\n\t\t$this->script();\r\n\t\t$this->html();\r\n\t\t\r\n\t}",
"public function output()\n {\n echo \"<{$this->container} class='{$this->class}'>\";\n echo $this->menuHtml;\n echo \"</{$this->container}>\";\n }",
"public function run()\n\t{\n\t\techo \"</ul>\";\n\t}",
"public static function renderContent() {}",
"public function display()\n {\n $this->output = '';\n $output = $this->load($this->_layout);\n $this->output = $this->output.$output;\n\n return $this->output;\n }",
"public function run(){\n echo CHtml::closeTag($this->listTag);\n echo CHtml::closeTag($this->containerTag);\n }",
"function widgetControlOutput( ) {\r\n\t\t\t$options = get_option( 'ILuvWalking.com Widget' );\r\n\t\t\tif( isset( $_POST[ \"iluvwalking-com-submit\" ] ) ) {\r\n\t\t\t\t$options[ 'title' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-title' ] ) );\r\n\t\t\t\t$options[ 'name' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-name' ] ) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdate_option( 'ILuvWalking.com Widget', $options );\r\n\t\t\t\r\n\t\t\t$title = attribute_escape( $options[ 'title' ] );\r\n\t\t\t$name = attribute_escape( $options[ 'name' ] );\r\n\t\t\t\r\n\t\t\tinclude ( 'views/widget-control.php' );\r\n\t\t}",
"public function getContent()\n {\n $this->_html = '<h2>' . $this->displayName . '</h2>';\n if (Tools::isSubmit('btnSubmit')) {\n $this->updateConfiguration();\n }\n $this->showConfigurationForm();\n return $this->_html;\n }",
"public function display ()\n {\n echo $this->as_text ();\n }",
"public function display()\n\t{\n\t\tob_start();\n\t\t\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $content;\n\t}",
"public function render()\n\t{\n\t\techo $this->export();\n\t}",
"public function render()\n {\n echo $this->__toString();\n\n }",
"public function output() {\n\n\t\t$data = $this->get_alert_data();\n\n\t\tif ( empty( $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\n\t\t\t'<div id=\"wpforms-builder-license-alert\">\n\t\t\t\t<img src=\"%1$s\" />\n\t\t\t\t<h3>%2$s</h3>\n\t\t\t\t<p>%3$s</p>\n\t\t\t\t<div>\n\t\t\t\t\t<a href=\"%4$s\" class=\"button button-primary\">%5$s</a>\n\t\t\t\t\t<a href=\"%6$s\" class=\"button button-secondary\">%7$s</a>\n\t\t\t\t\t<button class=\"close\"></button>\n\t\t\t\t</div>\n\t\t\t</div>',\n\t\t\t\\esc_url( WPFORMS_PLUGIN_URL . 'assets/images/sullie-builder-mobile.png' ),\n\t\t\t\\esc_html( $data['heading'] ),\n\t\t\t\\esc_html( $data['description'] ),\n\t\t\t\\esc_url( $data['button-primary-url'] ),\n\t\t\t\\esc_html( $data['button-primary'] ),\n\t\t\t\\esc_url( $data['button-secondary-url'] ),\n\t\t\t\\esc_html( $data['button-secondary'] )\n\t\t);\n\n\t\t\\add_filter( 'wpforms_builder_output', '__return_false' );\n\t}",
"function dumpContents()\r\n {\r\n\r\n if($this->_include != \"\")\r\n {\r\n include($this->_include);\r\n }\r\n else\r\n {\r\n\r\n $class = ($this->Style != \"\")? \"class=\\\"$this->StyleClass\\\"\": \"\";\r\n $hint = $this->HintAttribute();\r\n $draggable = ($this->_draggable) ? \"draggable=\\\"true\\\"\" : \"\";\r\n $events = $this->readJsEvents();\r\n \r\n echo \"<div id=\\\"$this->_name\\\" $hint $class $draggable $events >\\n\";\r\n echo $this->dumpLayoutContents();\r\n echo \"</div>\\n\";\r\n }\r\n\r\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n }",
"public function render_content()\n {\n if ( !empty( $this->label ) && !empty( $this->url ) ) : ?>\n <a\n href=\"<?= esc_url( $this->url ) ?>\"\n title=\"<?= esc_attr( !empty( $this->description ) ? $this->description : $this->label ) ?>\"\n target=\"<?= esc_attr( $this->target ) ?>\"\n ><?= esc_html( $this->label ) ?></a>\n <?php endif;\n }",
"protected function render_content() {\n\t\t\t?>\n\t\t\t\t<div class=\"customizer-divider\"></div>\n\t\t\t<?php\n\t\t}",
"public function printContent()\n {\n $this->includeFieldComponent('selectwithpopup');\n }",
"public function show() {\n echo $this->mountElement();\n }",
"public function display()\n {\n $output = \"\";\n\n // Ouverture\n /// ID HTML\n $openId = $this->getAttr('container_id');\n /// Classes HTML\n $openClass = [];\n $openClass[] = 'tiFyForm-FieldContainer';\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getType();\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getSlug();\n if ($this->getErrors()) :\n $openClass[] = 'tiFyForm-FieldContainer--error';\n endif;\n $openClass[] = $this->getAttr('container_class');\n if ($this->getAttr('required')) :\n $openClass[] = 'tiFyForm-FieldContainer--required';\n endif;\n $output .= $this->form()\n ->factory()\n ->fieldOpen($this, $openId, join(' ', $openClass));\n\n // Contenu du champ\n $output .= $this->type()->_display();\n\n // Fermeture\n $output .= $this->form()->factory()->fieldClose($this);\n\n return $output;\n }",
"public function doRender(){\r\n\t\t$label = ($this->label != '') ? Label::get($this)->doRender() : '';\r\n\r\n\t\treturn\r\n\t\t\t '<div class=\"'.$this->printWrapperClasses().'\">'\r\n\t\t\t\t.$label\r\n\t\t\t\t.'<div class=\"'.parent::WIDGETCLASS.'\">'\r\n\t\t\t\t\t.'<input'\r\n\t\t\t\t\t\t.$this->printId()\r\n\t\t\t\t\t\t.$this->printName()\r\n\t\t\t\t\t\t.' type=\"file\"'\r\n\t\t\t\t\t\t.$this->printTitle()\r\n\t\t\t\t\t\t.$this->printAccept()\r\n\t\t\t\t\t\t.$this->printSize()\r\n\t\t\t\t\t\t.$this->printMaxLength()\r\n\t\t\t\t\t\t.$this->printCssClasses()\r\n\t\t\t\t\t\t.$this->printJavascriptEventHandler()\r\n\t\t\t\t\t\t.$this->printTabindex()\r\n\t\t\t\t\t\t.$this->printReadonly()\r\n\t\t\t\t\t\t.$this->printDisabled()\r\n\t\t\t\t\t\t.$this->masterForm->printSlash()\r\n\t\t\t\t\t.'>'\r\n\t\t\t\t.'</div>'\r\n\t\t\t\t.$this->masterForm->printFloatBreak()\r\n\t\t\t.'</div>'\r\n\t\t;\r\n\t}",
"private function _render()\n {\n $content = '';\n\n if (is_array($this->widgets)) {\n // clean path vars\n self::_clean_paths();\n\n foreach ($this->widgets as $parts) {\n\n $content = '';\n\n $type = (array_key_exists('type', $parts)) ? $parts['type'] : '';\n $src = (array_key_exists('src', $parts)) ? $parts['src'] : '';\n $title = (array_key_exists('title', $parts)) ? $parts['title'] : '';\n $alt = (array_key_exists('alt', $parts)) ? $parts['alt'] : 1;\n $cols = (array_key_exists('cols', $parts)) ? $parts['cols'] : 1;\n\n // process action commands (these don't follow the convention of standard widgets)\n switch ($type) {\n case 'clear':\n // push content directly into dashboard array\n $content = \"<div style='clear:both'></div>\";\n $this->_dashboard[] = $content;\n continue 2;\n break;\n }\n\n // check if individual keys supplied instead of an array of values\n if (array_key_exists('src', $parts)) {\n\n // individual keys supplied so construct appropriate array\n $parts = array(array('type'=>$type, 'src'=>$src, 'alt'=>$alt));\n }\n\n // process each part\n foreach ($parts as $part) {\n\n if (! is_array($part)) continue;\n\n // add any part-specific sub-headings as <H3>\n $content .= (array_key_exists('title', $part)) ? \"<\".$this->widget_subheading.\">\".$part['title'].\"</\".$this->widget_subheading.\">\" : '';\n\n switch ($part['type']) {\n //======================================\n case 'oop':\n //======================================\n\n // run an external controller to produce widget contents\n if ($this->oop_alt) {\n // alternative location will be:\n // [oop_path]/[dashboard_folder]/[dashboard_name]/[controller_name].[ext]\n // eg. [application/controllers]/[dashboard]/[safety]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash_fldr, $this->dash).$part['src'].EXT;\n\n } else {\n\n // normal location will be\n // [oop_path]/[dashboard_name]/[dashboard_folder]/[controller_name].[ext]\n // eg. [application/controllers]/[safety]/[dashboard]/[test_dash].[php]\n $file_name = $this->_makepath($this->oop_path, $this->dash, $this->dash_fldr).$part['src'].EXT;\n }\n\n if (file_exists($file_name)) {\n\n include_once $file_name;\n\n // create an instance of the controller so we can run it\n $cname = ucfirst($part['src']);\n $c = new $cname;\n\n // always run the index() method to build content\n $content .= $c->index();\n\n } else {\n\n $content .= 'WARNING: Unable to find controller: '.$file_name;\n }\n\n break;\n\n //======================================\n case 'html':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $part['src'];\n\n break;\n\n //======================================\n case 'curl':\n //======================================\n\n // html or text content being directly supplied from controller\n $content .= $this->_curl_response($part['src']);\n\n break;\n\n //======================================\n case 'img':\n //======================================\n\n // create an <img> tag widget referencing an external image file\n // $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path.PS.$this->dash.PS.$this->dash_fldr.PS.$part['src'] : '';\n $img_file = (array_key_exists('src', $part)) ? $this->_makepath($this->asset_path, $this->img_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n $img_alt = (array_key_exists('alt', $part)) ? $part['alt'] : '';\n\n if (file_exists(FCPATH.$img_file)) {\n\n $content .= \"<img src='\".$img_file.\"' width='100%' alt='{$img_alt}' title='{$img_alt}' class='modalview' type='image' />\";\n\n } else {\n\n $content = 'WARNING: Unable to find img: '.FCPATH.$img_file;\n }\n\n break;\n\n //======================================\n case 'file':\n //======================================\n\n // pull widget contents directly from an external file\n $file_name = (array_key_exists('src', $part)) ? $this->_makepath(FCPATH.$this->asset_path, $this->file_path, $this->dash, $this->dash_fldr).$part['src'] : '';\n\n if (file_exists($file_name)) {\n $content .= file_get_contents($file_name);\n\n } else {\n\n $content .= 'WARNING: Unable to find file: '.$file_name;\n }\n\n break;\n }\n }\n\n // add this widget to dashboard\n $this->_dashboard[] = $this->_widget($title, $content, $cols);\n }\n }\n\n return $content;\n }",
"public function renderWidgets()\r\n {\r\n foreach ($this->_widgets as $widget)\r\n {\r\n echo current($widget);\r\n }\r\n\r\n }",
"public function render_content() {\n\t\tif ( ! empty( $this->button_text ) ) {\n\t\t\techo '<button type=\"button\" class=\"button menu-shortcut ' . esc_attr( $this->button_class ) . '\" tabindex=\"0\">';\n\t\t\tif ( ! empty( $this->button_class ) ) {\n\t\t\t\techo '<i class=\"fa ' . esc_attr( $this->icon_class ) . '\" style=\"margin-right: 10px\"></i>';\n\t\t\t}\n\t\t\techo esc_html( $this->button_text );\n\t\t\techo '</button>';\n\t\t}\n\t}",
"public function render_content() {\n\t\t$name = '_options-dimension-' . $this->id;\n\t\t$values = $this->value();\n\t\t$fields = $this->fields;\n\n\t\tif ( ! is_array( $values ) )\n\t\t\t$values = explode( ',', $this->value() );\n\n\t\t$field_index = 0;\n\t\t?>\n\t\t<div class=\"options-control-inputs\">\n\t\t\t<?php foreach ( $fields as $id => $title ): ?>\n\t\t\t\t<label for=\"<?php __esc_attr( $name . '_' . $id ) ?>\">\n\t\t\t\t\t<span><?php __esc_html( $title ) ?></span>\n\t\t\t\t\t<input type=\"text\" name=\"op-options[<?php __esc_attr( $this->id ) ?>][]\"\n\t\t\t\t\t\t value=\"<?php __esc_attr( $values[$field_index++] ) ?>\"\n\t\t\t\t\t\t id=\"<?php __esc_attr( $name . '_' . $id ) ?>\" />\n\t\t\t\t</label>\n\t\t\t<?php endforeach ?>\n\t\t</div>\n\t\t<?php\n\t}",
"public function display() {\r\n echo $this->template;\r\n }",
"public function renderContent() {}",
"public function html()\n {\n $random_quote = $this->randomQuote();\n $cp_path = CP_ROUTE;\n return $this->view('widget', compact('random_quote','cp_path'))->render();\n }",
"function toScreen(){\n\t\t\tif($content = $this->process()){\n\t\t\t\techo \"<pre>\";\n\t\t\t\techo nl2br(htmlspecialchars($content));\n\t\t\t\techo \"</pre>\";\n\t\t\t\t\n\t\t\t\techo $content;\n\t\t\t}else{\n\t\t\t\ttrigger_error(\"An error occured during XML Data generation\",1);\n\t\t\t}\n\t\t}"
] | [
"0.73488283",
"0.7252489",
"0.7207826",
"0.7132263",
"0.7126315",
"0.70807445",
"0.7037168",
"0.70329165",
"0.70078623",
"0.69940513",
"0.69416595",
"0.68990564",
"0.6886719",
"0.68797773",
"0.68469715",
"0.6824509",
"0.6823479",
"0.6822049",
"0.6815259",
"0.6787865",
"0.6782808",
"0.67743844",
"0.67629224",
"0.676184",
"0.6758436",
"0.6752936",
"0.6740152",
"0.67397344",
"0.67234904",
"0.6699867",
"0.66943187",
"0.6693576",
"0.6693565",
"0.66880554",
"0.6676375",
"0.6674178",
"0.6658891",
"0.66520274",
"0.6651431",
"0.6651124",
"0.6639118",
"0.6631975",
"0.6624274",
"0.6615271",
"0.6584535",
"0.65706146",
"0.65678763",
"0.6557049",
"0.6557049",
"0.65529907",
"0.65511453",
"0.6523201",
"0.6517186",
"0.6513614",
"0.65010774",
"0.649964",
"0.6496423",
"0.64866525",
"0.64762294",
"0.6475834",
"0.64738405",
"0.64657915",
"0.6459192",
"0.6455638",
"0.64536375",
"0.6453083",
"0.64461017",
"0.64434206",
"0.64427036",
"0.6431932",
"0.64176404",
"0.6407945",
"0.6398593",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.6398335",
"0.637133",
"0.6370282",
"0.63648826",
"0.63470674",
"0.6338226",
"0.63363045",
"0.6332684",
"0.6326823",
"0.63185155",
"0.6314365",
"0.63120055",
"0.6307867",
"0.6306453",
"0.6302039"
] | 0.0 | -1 |
Outputs the options form on admin | public function form( $instance ) {
$account = isset( $instance['account'] ) ? $instance['account'] : '';
$hashTag = isset( $instance['hashTag'] ) ? $instance['hashTag'] : '';
$retweets = $instance['retweets'];
$CONSUMER_KEY = isset( $instance['CONSUMER_KEY'] ) ? $instance['CONSUMER_KEY'] : '';
$CONSUMER_SECRET = isset( $instance['CONSUMER_SECRET'] ) ? $instance['CONSUMER_SECRET'] : '';
?>
<p>
<label>Account
<input class="account widefat" id="account" name="account" type="text" value="<?php echo esc_attr( $account ); ?>" />
</label>
<br /><small>Séparer les différents comptes par une virgule</small>
</p>
<p>
<label>HashTag
<input class="hashTag widefat" id="hashTag" name="hashTag" type="text" value="<?php echo esc_attr( $hashTag ); ?>" />
</label>
<br /><small>Séparer les différents hashtags par une virgule</small>
</p>
<p>
<label>
<input type="checkbox" id="retweets" name="retweets"<?php if ($retweets) { echo ' checked'; } ?>> Inclure les retweets
</label>
</p>
<p>
<label for="">CONSUMER KEY
<input class="CONSUMER_KEY widefat" id="CONSUMER_KEY" name="CONSUMER_KEY" type="text" value="<?php echo esc_attr( $CONSUMER_KEY ); ?>" />
</label>
<br /><small>Ces informations se trouvent dans l'onglet "Keys And Access Tokens" de votre application twitter</small>
</p>
<p>
<label for="">CONSUMER SECRET
<input class="CONSUMER_SECRET widefat" id="CONSUMER_SECRET" name="CONSUMER_SECRET" type="text" value="<?php echo esc_attr( $CONSUMER_SECRET ); ?>" />
</label>
<br /><small>Ces informations se trouvent dans l'onglet "Keys And Access Tokens" de votre application twitter</small>
</p>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function adminOptions() {\r\n\t\t\tTrackTheBookView::render('admin-options');\r\n\t\t}",
"public function admin_options() {\r\n echo '<h3>' . __('Mondido', 'mondido') . '</h3>';\r\n echo '<p>' . __('Mondido, Simple payments, smart functions', 'mondido') . '</p>';\r\n echo '<table class=\"form-table\">';\r\n // Generate the HTML For the settings form.\r\n $this->generate_settings_html();\r\n echo '</table>';\r\n }",
"public function admin_options() {\n\n\t\t\t?>\n\t\t\t<h3>ATOS</h3>\n\t\t\t<p><?php _e('Acceptez les paiements par carte bleue grâce à Atos.', 'woothemes'); ?></p>\n\t\t\t<p><?php _e('Plugin créé par David Fiaty', 'woothemes'); ?> - <a href=\"http://www.cmsbox.fr\">http://www.cmsbox.fr</a></p>\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php\n\t\t\t\t// Generate the HTML For the settings form.\n\t\t\t\t$this->generate_settings_html();\n\t\t\t?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}",
"public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e($this->getSettingsDescription(), 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }",
"public function form( $instance ) {\n \t// outputs the options form on admin\n }",
"public function admin_options(){\r\n echo '<h3>'.__('Netgíró Payment Gateway', 'netgiro').'</h3>';\r\n echo '<p>'.__('Verslaðu á netinu með Netgíró á einfaldan hátt.').'</p>';\r\n echo '<table class=\"form-table\">';\r\n $this -> generate_settings_html();\r\n echo '</table>';\r\n }",
"public function admin_options() {\n\t\t\t?>\n\t\t\t<img style=\"float:right\" src=\"<?php echo plugin_dir_url(__FILE__); ?>coinsimple.png\" />\n\t\t\t<h3><?php _e('CoinSimple', 'woocommerce');?></h3>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t\t</table><!--/.form-table-->\n\t\t\t<?php\n\t\t}",
"public function admin_options() {\n\n echo '<h3>'.__('MTN Mobile Money Settings', 'woocommerce').'</h3>';\n echo '<table class=\"form-table\">';\n\n $this->generate_settings_html();\n echo '</table>';\n }",
"function admin_options() {\r\n ?>\r\n <h3><?php _e('Bitcoin Payment','Bitcoin_Payment'); ?></h3>\r\n <table class=\"form-table\">\r\n <?php $this->generate_settings_html(); ?>\r\n </table> <?php\r\n }",
"public static function _options_page(){\n\t\tif( isset($_POST['urls']) ){\n\t\t\tself::updateUrls($_POST['urls']);\n\t\t}\n\t\t\n\t\t$vars = (object) array();\n\t\t$vars->messages = implode( \"\\n\", self::$messages );\n\t\t$vars->path = self::$path;\n\t\t$vars->urls = self::getUrls();\n\t\tself::render( 'admin', $vars );\n\t}",
"public function form( $instance ) {\n\t\t// outputs the options form on admin\n\t\t\n\t\n\t}",
"public function admin_options() {\n\n ?>\n <h3>交通银行支付平台</h3>\n \n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }",
"public function admin_options() { ?>\n <h3><?php _e( 'Veritrans', 'woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Veritrans.', 'woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }",
"public function form( $instance ) {\n\t\t// outputs the options form on admin\n\t}",
"public function form( $instance ) {\n\t\t// outputs the options form on admin\n\t}",
"public function form( $instance ) {\n\t\t// outputs the options form on admin\n\t}",
"public function admin_options() { ?>\n <h3><?php _e( $this->pluginTitle(), 'midtrans-woocommerce' ); ?></h3>\n <p><?php _e('Allows payments using Midtrans.', 'midtrans-woocommerce' ); ?></p>\n <table class=\"form-table\">\n <?php\n // Generate the HTML For the settings form. generated from `init_form_fields`\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n <?php\n }",
"public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }",
"public function admin_options() {\n\n\t\tparent::admin_options();\n\n\t\tob_start();\n\t\t?>\n\t\t// Hide service labels if admin opts to show carrier service levels\n\t\t$( '.hide_service_labels_if_checked' ).change( function() {\n\n\t\t\t\tif ( $( this ).is( ':checked' ) ) {\n\t\t\t\t\t$( this ).closest( 'tr' ).nextUntil( 'p' ).hide();\n\t\t\t\t} else {\n\t\t\t\t\t$( this ).closest( 'tr' ).nextUntil( 'p' ).show();\n\t\t\t\t}\n\t\t} ).change();\n\t\t// Hide additional handling fee field if there's no base handling fee entered\n\t\t$( 'input[name=\"woocommerce_shipwire_handling_fee\"]' ).change( function() {\n\t\t\tif ( '' === $( this ).val() ) {\n\t\t\t\t$( 'input[name=\"woocommerce_shipwire_additional_handling_fee\"]' ).closest( 'tr' ).hide();\n\t\t\t} else {\n\t\t\t\t$( 'input[name=\"woocommerce_shipwire_additional_handling_fee\"]' ).closest( 'tr' ).show();\n\t\t\t}\n\t\t} ).change();\n\n\t\t<?php\n\t\twc_enqueue_js( ob_get_clean() );\n\t}",
"public function admin_options() {\n\t\t\t?>\n\t\t\t\t<h3><?php esc_html_e('Cointopay Checkout', 'Cointopay'); ?></h3>\n\n\t\t\t\t<div id=\"wc_get_started\">\n\t\t\t\t<span class=\"main\"><?php esc_html_e('Provides a secure way to accept crypto currencies.', 'Cointopay'); ?></span>\n\t\t\t\t<p><a href=\"https://app.cointopay.com/index.jsp?#Register\" target=\"_blank\" class=\"button button-primary\"><?php esc_html_e('Join free', 'Cointopay'); ?></a> <a href=\"https://cointopay.com\" target=\"_blank\" class=\"button\"><?php esc_html_e('Learn more about WooCommerce and Cointopay', 'Cointopay'); ?></a></p>\n\t\t\t\t</div>\n\n\t\t\t\t<table class=\"form-table\">\n\t\t\t <?php $this->generate_settings_html(); ?>\n\t\t\t\t</table>\n\t\t\t\t<?php\n\n\t\t}",
"public function options_page() {\n\t\t$this->render_settings();\n\t}",
"public function display_options_page() {\n if (! current_user_can('manage_options')) {\n wp_die(__('You do not have sufficient permissions to access this page.'));\n }\n?>\n<div class=\"wrap\">\n <h2><?php esc_attr_e($this->title); ?> Options</h2>\n <form action=\"options.php\" method=\"post\">\n <?php if (function_exists('settings_errors')): settings_errors(); endif; ?>\n <?php settings_fields($this->group); ?>\n <?php foreach ($this->sections as $section): do_settings_sections($section); endforeach; ?>\n <p class=\"submit\">\n <input type=\"submit\" name=\"Submit\" value=\"<?php esc_attr_e('Save Changes'); ?>\" class=\"button-primary\" />\n </p>\n </form>\n</div>\n<?php\n }",
"public function admin_options() {\n\n\t\t?>\n\t\t<h3><?php _e( 'PayU standard', 'woocommerce' ); ?></h3>\n\t\t<p><?php _e( 'PayU standard works by sending the user to PayU to enter their payment information.', 'woocommerce' ); ?></p>\n\n \t<?php if ( $this->is_valid_for_use() ) : ?>\n\n\t\t\t<table class=\"form-table\">\n\t\t\t<?php $this->generate_settings_html(); ?>\n\t\t\t</table><!--/.form-table-->\n\n\t\t<?php else : ?>\n <div class=\"inline error\"><p><strong><?php _e( 'Gateway Disabled', 'woocommerce' ); ?></strong>: <?php _e( 'PayU does not support your store currency.', 'woocommerce' ); ?></p></div>\n\t\t<?php\n\t\t\tendif;\n\t}",
"public function display_options_page() {\n\t\t?>\n\t\t<div class=\"wrap ee-breakouts-admin\">\n\t\t\t<div id=\"icon-options-general\" class=\"icon32\"></div>\n\t\t\t<h2><?php _e('EE Breakouts Settings', 'event_espresso'); ?></h2>\n\t\t\t<div id=\"poststuff\">\n\t\t\t\t<div id=\"post-body-content\">\n\t\t\t\t\t<div class=\"form-wrap\">\n\t\t\t\t\t\t<form action=\"options.php\" method=\"post\">\n\t\t\t\t\t\t\t<?php settings_fields('ee_breakout_options'); ?>\n\t\t\t\t\t\t\t<?php do_settings_sections('ee_breakouts_admin'); ?>\n\t\t\t\t\t\t\t<span class=\"submit\">\n\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button primary-button\" name=\"update_ee_breakout_options\" value=\"Save Options\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div> <!-- end .form-wrap -->\n\t\t\t\t</div> <!-- end #post-body-content -->\n\t\t\t</div> <!-- end #poststuff -->\n\t\t</div> <!-- end .wrap -->\n\t\t<?php\n\t}",
"public function menu_html()\r\n\t{\r\n\t echo '<h1>'.get_admin_page_title().'</h1>';\r\n\t ?>\r\n\t <form method=\"post\" action=\"options.php\">\r\n\t \t<?php settings_fields('bookingSearch_settings') ?>\r\n\t \t<?php do_settings_sections('bookingSearch_settings') ?> <br>\r\n\t\t\t<?php submit_button(__('Save changes','Booking-search')); ?>\r\n\t </form>\r\n\t <?php\r\n\r\n\t}",
"public function admin_options() {\n\t\t\t?>\n\t \t<h3><?php _e('Payment Express', 'woothemes'); ?></h3>\n\t \t<p><?php _e('Allows credit card payments by Payment Express PX-Pay method', 'woothemes'); ?></p>\n\t \t<table class=\"form-table\">\n\t \t<?php\n\t\t\t\t// Generate the HTML For the settings form.\n\t\t\t\t$this->generate_settings_html();\n\t\t\t?>\n\t\t\t</table><!--/.form-table-->\n\t \t<?php\n\t\t}",
"function category_browsing_options_form()\r\n\t//admin options for category_browsing_options module\r\n\t{\r\n\t\t$this->body .= \"<tr><td class=\\\"col_hdr\\\" colspan=\\\"2\\\" style=\\\"width: 100%; font-weight: bold; text-align: center;\\\">Options selected below will be applied to the Category Browsing Options Module</td></tr>\";\r\n\t\t$show_options = array (\r\n\t\t\t'cat_browse_opts_as_ddl' => $this->db->get_site_setting('cat_browse_opts_as_ddl'),\r\n\t\t\t'cat_browse_all_listings' => $this->db->get_site_setting('cat_browse_all_listings'),\r\n\t\t\t'cat_browse_end_today' => $this->db->get_site_setting('cat_browse_end_today'),\r\n\t\t\t'cat_browse_has_pics' => $this->db->get_site_setting('cat_browse_has_pics'),\r\n\t\t\t'cat_browse_has_pics' => $this->db->get_site_setting('cat_browse_has_pics'),\r\n\t\t\t'cat_browse_class_only' => $this->db->get_site_setting('cat_browse_class_only'),\r\n\t\t\t'cat_browse_auc_only' => $this->db->get_site_setting('cat_browse_auc_only'),\r\n\t\t\t'cat_browse_buy_now' => $this->db->get_site_setting('cat_browse_buy_now'),\r\n\t\t\t'cat_browse_buy_now_only' => $this->db->get_site_setting('cat_browse_buy_now_only'),\r\n\t\t\t'cat_browse_auc_bids' => $this->db->get_site_setting('cat_browse_auc_bids'),\r\n\t\t\t'cat_browse_auc_no_bids' => $this->db->get_site_setting('cat_browse_auc_no_bids')\r\n\t\t\t\r\n\t\t);\r\n\t\t$ddlTooltip = geoHTML::showTooltip('Show as Dropdown', 'Choose yes to display the module\\'s options in a dropdown list, or no to show them as a text-based, delimeter-separated list.');\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_opts_as_ddl\",\"Show as Dropdown $ddlTooltip\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_all_listings\",\"All listings\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_end_today\",\"Listings Ending within 24 hours\");\r\n\t\t$this->input_radio_yes_no($show_options,\"cat_browse_has_pics\",\"Listings with Photos\");\r\n\t\t\r\n\t\tif(geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t{\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_class_only\",\"Classifieds only\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_only\",\"Auctions only\");\r\n\t\t}\r\n\t\tif(geoMaster::is('auctions'))\r\n\t\t{\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_buy_now\",\"Auctions using Buy Now\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_buy_now_only\",\"Auctions using Buy Now Only\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_bids\",\"Auctions with Bids\");\r\n\t\t\t$this->input_radio_yes_no($show_options,\"cat_browse_auc_no_bids\",\"Auctions without Bids\");\r\n\t\t}\r\n\t\t\r\n\t}",
"public function render_options_page()\n\t{\n\t\treturn include 'src/views/form.php';\n\t}",
"public function optionsPage()\r\n {\r\n $this->updateOptions();\r\n include_once($this->path . '/views/options.php');\r\n }",
"function optionPage() {\r\n\t\t$out = $uninstall = '';\r\n\r\n\t\t// Check write permissions\r\n\t\t$this->_checkDir();\r\n\r\n\t\t// Settings update or delete\r\n\t\tif(isset($_POST['options_update'])) { // options update\r\n\t\t\t// strip slashes array\r\n\t\t\t$_POST = $this->stripArray($_POST);\r\n\r\n\t\t\t$this->options['user_lvl'] = $_POST['vp_userlevel'];\r\n\t\t\t$this->options['show_option'] = $_POST['vp_show'];\r\n\t\t\t$this->options['class_name'] = $_POST['vp_classname'];\r\n\t\t\t$this->options['class_name_with_type'] = $_POST['vp_classwithtype'];\r\n\t\t\t$this->options['ins_shortcode'] = (isset($_POST['vp_shortcode']) && $_POST['vp_shortcode']=='1' ? '1' : '0');\r\n\t\t\t$this->updateOptions();\r\n\r\n\t\t\t$_POST = '';\r\n\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\r\n\t\t} elseif(isset($_POST['uninst'])) { // uninstall\r\n\t\t\t$this->deleteOptions();\r\n\t\t\tif (file_exists($this->data_dir))\r\n\t\t\t\t$this->_removeDir($this->data_dir);\r\n\t\t\t$this->note .= __('All files and folders have (probably) been deleted. Now click <strong>Plugins</strong> in the admin panel above and <b>Deactivate</b> the VideoPop plugin.', $this->textdomain_name);\r\n\t\t\t$this->note .= \"<br />\" . $this->data_dir;\r\n\t\t\t$this->error++;\r\n\t\t\t$this->initOptions();\r\n\t\t\terror_reporting(0);\r\n\t\t}\r\n\r\n\t\t// Add Options\r\n\t\t$out .= \"<div class=\\\"wrap\\\">\\n\";\r\n\t\t$out .= \"<h2>\".__('VideoPop+ Options', $this->textdomain_name).\"</h2><br />\\n\";\r\n\t\t$out .= \"<form method=\\\"post\\\" id=\\\"update_options\\\" action=\\\"\".$this->admin_action.\"\\\">\\n\";\r\n\t\t$out .= \"<table class=\\\"optiontable form-table\\\" style=\\\"margin-top:0;\\\"><tbody>\\n\";\r\n\r\n\t\t// Add User Level\r\n\t\t// Permission -- Subscriber = 0, Contributor = 1, Author = 2, Editor = 7, Administrator = 9\r\n\t\t$out .= \"<tr>\\n\";\r\n\t\t$out .= \"<td><strong>\".__('User Level', $this->textdomain_name).\"</strong></td>\";\r\n\t\t$out .= \"<td><select name=\\\"vp_userlevel\\\">\";\r\n\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($this->options['user_lvl'],'0').\">\".__('subscriber', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"1\\\"\".$this->_setOptionSelected($this->options['user_lvl'],'1').\">\".__('contributor', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"2\\\"\".$this->_setOptionSelected($this->options['user_lvl'],'2').\">\".__('author', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"7\\\"\".$this->_setOptionSelected($this->options['user_lvl'],'7').\">\".__('editor', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"9\\\"\".$this->_setOptionSelected($this->options['user_lvl'],'9').\">\".__('administrator', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"</select> </td>\";\r\n\t\t$out .= \"<td>\".__('Set the user level the user needs to have (at least) to manage/upload/delete videos', $this->textdomain_name).\"</td>\\n\";\r\n\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t// Add Method of display\r\n\t\t$out .= \"<tr>\\n\";\r\n\t\t$out .= \"<td><strong>\".__('Method of display', $this->textdomain_name).\"</strong></td>\";\r\n\t\t$out .= \"<td><select name=\\\"vp_show\\\">\";\r\n\t\t$out .= \"<option value=\\\"popup\\\"\" .$this->_setOptionSelected($this->options['show_option'],'popup').\">\". __('Pop up', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"lightpop\\\"\".$this->_setOptionSelected($this->options['show_option'],'lightpop').\">\".__('LightPop', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"inline\\\"\" .$this->_setOptionSelected($this->options['show_option'],'inline').\">\". __('In line', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"none\\\"\" .$this->_setOptionSelected($this->options['show_option'],'none').\">\". __('The effect none', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"</select> </td>\";\r\n\t\t$out .= \"<td>\".__('Please select it from "Pop up", "LightPop", "In line", and "The effect none".', $this->textdomain_name);\r\n\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t// Add Class Name Setting\r\n\t\t$out .= \"<tr style=\\\"border-style:none;\\\">\\n\";\r\n\t\t$out .= \"<td style=\\\"border-style:none;\\\"><strong>\".__('Class name of the link tag', $this->textdomain_name).\"</strong></td>\";\r\n\t\t$out .= \"<td style=\\\"border-style:none;\\\"><input type=\\\"text\\\" name=\\\"vp_classname\\\" value=\\\"\".$this->options['class_name'].\"\\\"/> </td>\";\r\n\t\t$out .= \"<td style=\\\"border-style:none;\\\">\".__('Please set the class name of the link tag.', $this->textdomain_name).\"</td>\\n\";\r\n\t\t$out .= \"</tr>\\n\";\r\n\t\t$out .= \"<tr>\\n\";\r\n\t\t$out .= \"<td></td>\";\r\n\t\t$out .= \"<td colspan=\\\"2\\\"><select name=\\\"vp_classwithtype\\\">\";\r\n\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($this->options['class_name_with_type'],'0').\">\".__('Without File Type', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"<option value=\\\"1\\\"\".$this->_setOptionSelected($this->options['class_name_with_type'],'1').\">\".__('With File Type', $this->textdomain_name).\"</option>\";\r\n\t\t$out .= \"</select> </td>\";\r\n\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t// Insert Editor Option (Shortcode or HTML Tag?)\r\n\t\t$out .= \"<tr>\\n\";\r\n\t\t$out .= \"<td><strong>\".__('Insert Editor Option', $this->textdomain_name).\"</strong></td>\";\r\n\t\t$out .= \"<td colspan=\\\"2\\\"><input type=\\\"checkbox\\\" name=\\\"vp_shortcode\\\" value=\\\"1\\\" style=\\\"margin-right:0.5em;\\\" \".($this->options['ins_shortcode']=='1' ? \" checked\" : \"\").\" />\".__('Shortcode is inserted in the editor.', $this->textdomain_name).\"</td>\";\r\n\t\t$out .= \"</tr>\\n\";\r\n\t\t$out .= \"<tr>\\n\";\r\n\r\n\t\t$out .= \"</tbody></table>\\n\";\r\n\r\n\t\t// Add Update Button\r\n\t\t$out .= \"<div style=\\\"text-align:right;margin-top:1em;\\\">\";\r\n\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"options_update\\\" value=\\\"\".__('Update Options', $this->textdomain_name).\"\\\" class=\\\"button\\\" />\";\r\n\t\t$out .= \"</div>\";\r\n\t\t$out .= \"</form></div>\\n\";\r\n\r\n\t\t// Add uninstall\r\n\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"margin-top:2em;\\\">\\n\";\r\n\t\t$out .= \"<h2>\".__('Uninstall', $this->textdomain_name).\"</h2><br />\\n\";\r\n\t\t$out .= \"<p>\".__('If you want to keep your videos and the popup functionality of your links but want to get rid of the additional menus in the control panel, just deactivate the plugin.<br />For a complete uninstall including all uploaded videos use the uninstall button.', $this->textdomain_name).\"</p>\\n\";\r\n\t\t$out .= \"<div style=\\\"text-align:right;\\\">\";\r\n\t\t$out .= \"<form method=\\\"post\\\" id=\\\"uninstall\\\" action=\\\"\".$this->admin_action.\"\\\">\\n\";\r\n\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"uninst\\\" value=\\\"\".__('Uninstall VideoPop+', $this->textdomain_name).\"\\\" onclick=\\\"javascript:check=confirm('\".__('You are about to delete all your settings and Videos! The links you created with VideoPop will not work after uninstall! Proceed with uninstall?', $this->textdomain_name).\"');if(check==false) return false;\\\" class=\\\"button\\\" />\\n\";\r\n\t\t$out .= \"</form>\\n\";\r\n\t\t$out .= \"</div>\\n\";\r\n\t\t$out .= \"</div>\\n\";\r\n\r\n\t\t// Output\r\n\t\techo (!empty($this->note) ? \"<div id=\\\"message\\\" class=\\\"updated fade\\\"><p>{$this->note}</p></div>\\n\" : '' ).\"\\n\";\r\n\t\techo ($this->error > 0 ? '' : $out).\"\\n\";\r\n\t}",
"public function options_page_html() {\n // check user capabilities\n if ( ! current_user_can( 'manage_options' ) ) {\n return;\n }\n\n // add error/update messages\n\n // check if the user have submitted the settings\n // wordpress will add the \"settings-updated\" $_GET parameter to the url\n if ( isset( $_GET['settings-updated'] ) ) {\n // add settings saved message with the class of \"updated\"\n add_settings_error( 'settcalc_messages', 'settcalc_message', __( 'Settings Saved', 'settcalc' ), 'updated' );\n }\n\n // show error/update messages\n settings_errors( 'settcalc_messages' );\n ?>\n <div class=\"wrap\">\n <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n <form action=\"options.php\" method=\"post\">\n <?php\n // output security fields for the registered setting \"wporg\"\n settings_fields( 'settcalc' );\n // output setting sections and their fields\n // (sections are registered for \"wporg\", each field is registered to a specific section)\n do_settings_sections( 'settcalc' );\n // output save settings button\n submit_button( 'Save Settings' );\n ?>\n </form>\n </div>\n <?php\n }",
"public function optionsAction()\n\t{\n\t\treturn '';\n\t}",
"public function admin_options() {\n?>\n\t\t<h3><?php _e('Authorize SIM', WC_Authorize_SIM::TEXT_DOMAIN); ?></h3>\n \t<p><?php _e('Authorize SIM works by sending the user to Authorize to enter their payment information.', WC_Authorize_SIM::TEXT_DOMAIN); ?></p>\n \t<div class=\"updated\"><p>\n \t\t<strong><?php _e('Authorize.Net config:', WC_Authorize_SIM::TEXT_DOMAIN) ?></strong>\n \t\t<?php _e( 'Please login to Authorize and go to Account >> Settings >> Response/Receipt URLs' ); ?>\n \t\t<ol>\n\t \t\t<li><?php _e( 'Click \"Add URL\", and set this value for URL textbox: ') ?><strong><?php echo $this->notify_url ?></strong></li>\n\t \t\t<li><?php _e( 'Click \"Submit\" to complete', WC_Authorize_SIM::TEXT_DOMAIN ) ?></li>\n \t\t</ol>\n \t</p></div>\n \t<table class=\"form-table\">\n \t\t<?php $this->generate_settings_html(); ?>\n\t\t</table><!--/.form-table--> \t\n<?php\n }",
"function zdtw_menu_options_callback() {\n echo '<form id=\"'.$this->prefix.'-form\" class=\"zd-settings-form\" method=\"POST\" action=\"options.php\">'.\"\\n\";\n\n// print_r( $this->options );\n// echo $this->settings_page_id;\n\n // settings_fields( $option_group )\n settings_fields( $this->settings_page_id );\n// settings_fields( $this->prefix . '-general-section' );\n\n do_settings_fields( $this->settings_page_id, $this->prefix .'-general-section' );\n\n submit_button();\n\n echo '</form>'.\"\\n\";\n }",
"function options_page_html()\n\t\t{\n\t\t\tif (!current_user_can('manage_options')) {\n\t\t\t\twp_die(__('You do not have sufficient permissions to access this page.'));\n\t\t\t}\n\t\t\t\n\t\t\techo '<div class=\"wrap\">';\n\t\t\techo '<h2>';\n\t\t\techo 'Verify Meta Tags Plugin Options';\n\t\t\techo '</h2>';\n\t\t\techo '<form method=\"post\" action=\"options.php\">';\n\t\t\tsettings_fields('vmt-options-page');\n\t\t\tdo_settings_sections('vmt-options-page');\n\t\t\techo '<p class=submit>';\n\t\t\techo '<input type=\"submit\" class=\"button-primary\" value=\"' . __('Save Changes') . '\" />';\n\t\t\techo '</p>';\n\t\t\techo '</form>';\n\t\t\techo '</div>';\n\t\t}",
"public function admin_options()\n {\n ?>\n <h3><?php _e('PAYSTO', 'woocommerce'); ?></h3>\n <p><?php _e('Settings payment recieve from PAYSTO system.', 'woocommerce'); ?></p>\n\n <?php if ($this->is_valid_for_use()): ?>\n\n <table class=\"form-table\">\n\n <?php\n // Generate the HTML For the settings form.\n $this->generate_settings_html();\n ?>\n </table><!--/.form-table-->\n\n <?php else: ?>\n <div class=\"inline error\"><p>\n <strong><?php _e('Gate swich off', 'woocommerce'); ?></strong>:\n <?php _e('PAYSTO not support currency used in your store.', 'woocommerce'); ?>\n </p></div>\n <?php\n endif;\n\n }",
"public function render_options_page() {\r\n\r\n\t\tinclude( Views::load_view( TBSC_OPTIONS_PLUGIN_DIR . 'src/views/options-page/options-page.php' ) );\r\n\r\n\t}",
"public function form( $instance ) {\n\t\t// outputs the options form on admin\n $this->getForm($instance);\n\t}",
"public function create_options_page() {\n print '<div class=\"wrap\">';\n screen_icon();\n printf( '<h2>%s</h2>', __( 'Instagram Settings', 'bii-instagram' ) );\n print '<form method=\"post\" action=\"options.php\">';\n settings_fields( 'bii_instagram' );\n do_settings_sections( 'bii-instagram' );\n submit_button();\n print '</form>';\n print '</div>';\n }",
"public function view_option_page() {\n\t\tinclude_once plugin_dir_path( __FILE__ ) . 'options.php';\n\t}",
"public function adminPage () {\n\t\t\t// global $themename, $shortname, $options;\n\t\t\t$up_dir = wp_upload_dir();\n\t\t\tif ( ! empty( $_REQUEST['saved'] ) ) {\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p><strong>' . sprintf( __( '%s settings saved!', $this->domain ), $this->themename ) . '</strong></p></div>';\n\t\t\t}\n\n\t\t\tif ( ! empty( $_REQUEST['reset'] ) ) {\n\t\t\t\techo '<div id=\"message\" class=\"updated fade\"><p><strong>' . sprintf( __( '%s settings reset.', $this->domain ), $this->themename ) . '</strong></p></div>';\n\t\t\t}\n\t\t\t?>\n\n\t\t<div id=\"ttf-options\" class=\"wrap\">\n\t\t\t<div id=\"icon-themes\" class=\"icon32\"><br></div>\n\t\t\t<h2><?php _e( 'Theme Options', $this->domain ); ?></h2>\n\t\t\t<div id=\"ttf-options-body\">\n\t\t\t\t<form method=\"post\" action=\"\">\n\t\t\t\t\t<?php wp_nonce_field( 'save-theme-options', 'save-theme-options-nonce' );\n\t\t\t\t\tfor ($i = 0; $i < count($this->options); $i++) :\n\t\t\t\t\t\tswitch ($this->options[$i][\"type\"]) :\n\t\t\t\t\t\t\tcase \"subhead\":\n\t\t\t\t\t\t\t\tif ($i != 0) :\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-save-button submit\">\n\t\t\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"save\" />\n\t\t\t\t\t\t\t\t\t\t<input class=\"button-primary\" type=\"submit\" value=\"<?php esc_attr_e( 'Save changes', $this->domain ); ?>\" name=\"save\"/>\n\t\t\t\t\t\t\t\t\t</div><!--end ttf-save-button-->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- ttf-option -->\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"ttf-option\">\n\t\t\t\t\t\t\t\t\t<h3><?php echo $this->options[$i][\"name\"]; ?> <a href=\"#\"><?php _e( 'Edit', $this->domain ); ?></a></h3>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-option-body clear\">\n\t\t\t\t\t\t\t\t\t\t<?php if ( isset( $this->options[$i][\"notice\"] ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"notice\"><?php echo $this->options[$i][\"notice\"]; ?></p>\n\t\t\t\t\t\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase \"checkbox\":\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"ttf-field check clear\">\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-d\"><?php echo $this->options[$i][\"desc\"]; ?></div>\n\t\t\t\t\t\t\t\t\t<input id=\"<?php echo $this->options[$i][\"id\"]; ?>\" type=\"checkbox\" name=\"<?php echo $this->options[$i][\"id\"]; ?>\" value=\"true\"<?php echo (get_option($this->options[$i]['id'])) ? ' checked=\"checked\"' : ''; ?> />\n\t\t\t\t\t\t\t\t\t<label for=\"<?php echo $this->options[$i][\"id\"]; ?>\"><?php echo $this->options[$i][\"name\"]; ?></label>\n\t\t\t\t\t\t\t\t</div><!--end ttf-field check-->\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"radio\":\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-field radio clear\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-d\"><?php echo $this->options[$i][\"desc\"]; ?></div>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t$radio_setting = get_option($this->options[$i]['id']);\n\t\t\t\t\t\t\t\t\t\t\t$checked = \"\";\n\t\t\t\t\t\t\t\t\t\t\tforeach ($this->options[$i]['options'] as $key => $val) :\n\t\t\t\t\t\t\t\t\t\t\t\tif ($radio_setting != '' &&\t$key == get_option($this->options[$i]['id']) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($key == $this->options[$i]['std']){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$checked = 'checked=\"checked\"';\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"radio\" name=\"<?php echo esc_attr( $this->options[$i]['id'] ); ?>\" value=\"<?php echo esc_attr( $key ); ?>\"<?php echo $checked; ?> /><?php echo $val; ?><br />\n\t\t\t\t\t\t\t\t\t\t\t<?php endforeach; ?>\n\t\t\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\"><?php echo $this->options[$i][\"name\"]; ?></label>\n\t\t\t\t\t\t\t\t\t</div><!--end ttf-field radio-->\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"upload\":\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-field logo-upload clear\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-d\"><?php echo $this->options[$i][\"desc\"]; ?></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-c\">\n\t\t\t\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\"><?php echo $this->options[$i][\"name\"]; ?></label>\n\t\t\t\t\t\t\t\t\t\t\t<input id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" type=\"text\" name=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" class=\"<?php echo esc_attr( $this->options[$i][\"class\"] ); ?>\" value=\"<?php\n\t\t\t\t\t\t\t\t\t\t\t\t$id = get_option( $this->options[$i][\"id\"] );\n\t\t\t\t\t\t\t\t\t\t\t\techo esc_attr( '' != $id ? $id : $this->options[$i][\"std\"] ); ?>\" />\n\t\t\t\t\t\t\t\t\t\t\t<input id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>_upload_button\" type=\"button\" value=\"Upload Logo\" data-type=\"image\" data-field-id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" class=\"button\" />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div><!--end ttf-field text-->\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"text\":\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-field text clear\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-d\"><?php echo $this->options[$i][\"desc\"]; ?></div>\n\t\t\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\"><?php echo $this->options[$i][\"name\"]; ?></label>\n\t\t\t\t\t\t\t\t\t\t<input id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" type=\"text\" name=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" value=\"<?php\n\t\t\t\t\t\t\t\t\t\t\t$id = get_option( $this->options[$i][\"id\"] );\n\t\t\t\t\t\t\t\t\t\t\techo esc_attr( stripslashes( '' != $id ? $id : $this->options[$i][\"std\"] ) ); ?>\" />\n\t\t\t\t\t\t\t\t\t</div><!--end ttf-field text-->\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"colorpicker\":\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-field colorpicker clear\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-d\"><?php echo $this->options[$i][\"desc\"]; ?> </div>\n\t\t\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\"><?php echo $this->options[$i][\"name\"]; ?> <a href=\"#<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>_colorpicker\" onclick=\"toggleColorpicker (this, '<?php echo esc_js( $this->options[$i][\"id\"] ); ?>', 'open', '<?php _e( 'show color picker', $this->domain ); ?>', '<?php _e( 'hide color picker', $this->domain ); ?>')\"><?php _e( 'show color picker', $this->domain ); ?></a></label>\n\t\t\t\t\t\t\t\t\t\t<div id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>_colorpicker\" class=\"colorpicker_container\"></div>\n\t\t\t\t\t\t\t\t\t\t<input id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" type=\"text\" name=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" value=\"<?php\n\t\t\t\t\t\t\t\t\t\t\t$id = get_option($this->options[$i][\"id\"]);\n\t\t\t\t\t\t\t\t\t\t\techo esc_attr( $id ? $id : $this->options[$i][\"std\"] ); ?>\" />\n\t\t\t\t\t\t\t\t\t</div><!--end ttf-field colorpicker-->\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"select\":\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-field select clear\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-d\"><?php echo $this->options[$i][\"desc\"]?></div>\n\t\t\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\"><?php echo $this->options[$i][\"name\"]; ?></label>\n\t\t\t\t\t\t\t\t\t\t<select id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" name=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\">\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( (array) $this->options[$i][\"options\"] as $key => $val) :\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( '' == get_option($this->options[$i][\"id\"]) || is_null( get_option($this->options[$i][\"id\"] ) ) ) : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $key; ?>\"<?php echo ($key == $this->options[$i]['std']) ? ' selected=\"selected\"' : ''; ?>><?php echo $val; ?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php else : ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $key; ?>\"<?php echo get_option($this->options[$i][\"id\"]) == $key ? ' selected=\"selected\"' : ''; ?>><?php echo $val; ?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php endif;\n\t\t\t\t\t\t\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t</div><!--end ttf-field select-->\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"textarea\":\n\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t<div class=\"ttf-field textarea clear\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"ttf-field-d\"><?php echo $this->options[$i][\"desc\"]?></div>\n\t\t\t\t\t\t\t\t\t\t<label for=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\"><?php echo $this->options[$i][\"name\"]?></label>\n\t\t\t\t\t\t\t\t\t\t<textarea id=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" name=\"<?php echo esc_attr( $this->options[$i][\"id\"] ); ?>\" <?php\n\t\t\t\t\t\t\t\t\t\t\techo ( $this->options[$i][\"options\"] ? ' rows=\"' . $this->options[$i][\"options\"][\"rows\"] . '\" cols=\"' . $this->options[$i][\"options\"][\"cols\"] . '\"' : '' );\n\t\t\t\t\t\t\t\t\t\t?>><?php\n\t\t\t\t\t\t\t\t\t\t\techo htmlspecialchars(\n\t\t\t\t\t\t\t\t\t\t\t\t'' != get_option($this->options[$i]['id']) ? get_option($this->options[$i]['id']) : $this->options[$i]['std'],\n\t\t\t\t\t\t\t\t\t\t\t\tENT_QUOTES\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t?></textarea>\n\t\t\t\t\t\t\t\t\t</div><!--end ttf-options-ttf-field textarea-->\n\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tendswitch;\n\t\t\t\t\t\tendfor;\n\t\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"ttf-save-button submit\">\n\t\t\t\t\t\t<input class=\"button-primary\" type=\"submit\" value=\"<?php esc_attr_e( 'Save changes', $this->domain ); ?>\" name=\"save\"/>\n\t\t\t\t\t</div><!--end ttf-save-button-->\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class=\"ttf-saveall-button submit\">\n\t\t\t\t<input class=\"button-primary\" type=\"submit\" value=\"<?php esc_attr_e( 'Save all changes', $this->domain ); ?>\" name=\"save\" />\n\t\t\t</div>\n\t\t</form>\n\n\t\t<div class=\"ttf-reset-button submit\">\n\t\t\t<form method=\"post\" action=\"\">\n\t\t\t\t<?php wp_nonce_field( 'reset-theme-options', 'reset-theme-options-nonce' ); ?>\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"reset\" />\n\t\t\t\t<input class=\"ttf-reset\" type=\"submit\" value=\"<?php esc_attr_e( 'Reset all options', $this->domain ); ?>\" name=\"reset\" />\n\t\t\t</form>\n\t\t</div>\n\n\t\t<script type=\"text/javascript\">\n\t\t\t<?php\n\t\t\tfor ($i = 0; $i < count($this->options); $i++) :\n\t\t\t\tif ($this->options[$i]['type'] == 'colorpicker') :\n\t\t\t\t\t?>\n\t\t\t\t\tjQuery(\"#<?php echo esc_js( $this->options[$i][\"id\"] ); ?>_colorpicker\").farbtastic(\"#<?php echo esc_js( $this->options[$i][\"id\"] ); ?>\");\n\t\t\t\t\t<?php\n\t\t\t\tendif;\n\t\t\tendfor;\n\t\t\t?>\n\t\t\tjQuery( '.colorpicker_container' ).hide();\n\t\t</script>\n\t</div><!--end ttf-options-body-->\n</div><!--end wrap-->\n<?php\n\t\t}",
"public function admin_options() {\n \t\t?>\n \t\t<thead><tr><th scope=\"col\" width=\"200px\"><?php echo apply_filters( 'tgm_jigoshop_custom_gateway_title', 'Client Payments' ); ?></th><th scope=\"col\" class=\"desc\"><?php echo apply_filters( 'tgm_jigoshop_custom_gateway_description', 'This payment gateway is setup specifically for client billing accounts. Orders will be processed and billed directly to existing client accounts.' ); ?></th></tr></thead>\n \t\t<tr>\n\t \t<td class=\"titledesc\"><?php echo apply_filters( 'tgm_jigoshop_enable_custom_gateway_title', 'Enable Client Payments?' ) ?>:</td>\n\t \t\t<td class=\"forminp\">\n\t\t \t\t<select name=\"jigoshop_tgm_custom_gateway_enabled\" id=\"jigoshop_tgm_custom_gateway_enabled\" style=\"min-width:100px;\">\n\t\t \t\t<option value=\"yes\" <?php if ( get_option( 'jigoshop_tgm_custom_gateway_enabled' ) == 'yes' ) echo 'selected=\"selected\"'; ?>><?php _e( 'Yes', 'jigoshop' ); ?></option>\n\t\t \t\t<option value=\"no\" <?php if ( get_option( 'jigoshop_tgm_custom_gateway_enabled' ) == 'no' ) echo 'selected=\"selected\"'; ?>><?php _e( 'No', 'jigoshop' ); ?></option>\n\t\t \t\t</select>\n\t \t\t</td>\n\t \t</tr>\n\t \t<tr>\n\t \t<td class=\"titledesc\"><a href=\"#\" tip=\"<?php echo apply_filters( 'tgm_jigoshop_method_tooltip_description', 'This controls the title which the user sees during checkout.' ); ?>\" class=\"tips\" tabindex=\"99\"></a><?php echo apply_filters( 'tgm_jigoshop_method_tooltip_title', 'Method Title' ) ?>:</td>\n\t \t\t<td class=\"forminp\">\n\t\t \t\t<input class=\"input-text\" type=\"text\" name=\"jigoshop_tgm_custom_gateway_title\" id=\"jigoshop_tgm_custom_gateway_title\" value=\"<?php if ( $value = get_option( 'jigoshop_tgm_custom_gateway_title' ) ) echo $value; else echo 'Client Payments'; ?>\" />\n\t \t\t</td>\n\t \t</tr>\n\t \t<tr>\n\t \t<td class=\"titledesc\"><a href=\"#\" tip=\"<?php echo apply_filters( 'tgm_jigoshop_message_tooltip_description', 'This message lets the customer know that the order and total will be processed to their billing account.' ); ?>\" class=\"tips\" tabindex=\"99\"></a><?php echo apply_filters( 'tgm_jigoshop_message_tooltip_title', 'Customer Message' ) ?>:</td>\n\t \t\t<td class=\"forminp\">\n\t\t \t\t<input class=\"input-text wide-input\" type=\"text\" name=\"jigoshop_tgm_custom_gateway_description\" id=\"jigoshop_tgm_custom_gateway_description\" value=\"<?php if ( $value = get_option( 'jigoshop_tgm_custom_gateway_description' ) ) echo $value; ?>\" />\n\t \t\t</td>\n\t \t</tr>\n\n \t\t<?php\n \t}",
"function wpdc_divi_child_options_page(){\r\n\t\t\r\n\t\t$options = get_option('wpdc_options');\r\n\t\t\r\n echo '<div class=\"wrap\">';\r\n\t\techo '<h2>'.WPDC_THEME_NAME.' Options <span style=\"font-size:10px;\">Ver '.WPDC_VER.'</span></h2>';\r\n\t\techo '<form method=\"post\" action=\"options.php\">';\r\n\t\tsettings_fields('wpdc_plugin_options_group');\r\n\t\tsettings_errors();\r\n\t\trequire_once('views.php');\t\t// load table settings\r\n\t\techo '<div style=\"clear:both;\"></div>';\r\n\t\techo '</div>';\r\n\t\techo '<div style=\"clear:both;\"></div>';\r\n echo '</form>';\r\n }",
"function em_ms_admin_options_page() {\n\tglobal $wpdb,$EM_Notices;\n\t//Check for uninstall/reset request\n\tif( !empty($_REQUEST['action']) && $_REQUEST['action'] == 'uninstall' ){\n\t\tem_admin_options_uninstall_page();\n\t\treturn;\n\t}\t\n\tif( !empty($_REQUEST['action']) && $_REQUEST['action'] == 'reset' ){\n\t\tem_admin_options_reset_page();\n\t\treturn;\n\t}\t\n\t//TODO place all options into an array\n\t$events_placeholders = '<a href=\"'.EM_ADMIN_URL .'&events-manager-help#event-placeholders\">'. __('Event Related Placeholders','events-manager') .'</a>';\n\t$locations_placeholders = '<a href=\"'.EM_ADMIN_URL .'&events-manager-help#location-placeholders\">'. __('Location Related Placeholders','events-manager') .'</a>';\n\t$bookings_placeholders = '<a href=\"'.EM_ADMIN_URL .'&events-manager-help#booking-placeholders\">'. __('Booking Related Placeholders','events-manager') .'</a>';\n\t$categories_placeholders = '<a href=\"'.EM_ADMIN_URL .'&events-manager-help#category-placeholders\">'. __('Category Related Placeholders','events-manager') .'</a>';\n\t$events_placeholder_tip = \" \". sprintf(__('This accepts %s and %s placeholders.','events-manager'),$events_placeholders, $locations_placeholders);\n\t$locations_placeholder_tip = \" \". sprintf(__('This accepts %s placeholders.','events-manager'), $locations_placeholders);\n\t$categories_placeholder_tip = \" \". sprintf(__('This accepts %s placeholders.','events-manager'), $categories_placeholders);\n\t$bookings_placeholder_tip = \" \". sprintf(__('This accepts %s, %s and %s placeholders.','events-manager'), $bookings_placeholders, $events_placeholders, $locations_placeholders);\n\t\n\tglobal $save_button;\n\t$save_button = '<tr><th> </th><td><p class=\"submit\" style=\"margin:0px; padding:0px; text-align:right;\"><input type=\"submit\" class=\"button-primary\" name=\"Submit\" value=\"'. __( 'Save Changes', 'events-manager') .' ('. __('All','events-manager') .')\" /></p></td></tr>';\n\t//Do some multisite checking here for reuse\n\t?>\t\n\t<script type=\"text/javascript\" charset=\"utf-8\"><?php include(EM_DIR.'/includes/js/admin-settings.js'); ?></script>\n\t<script type=\"text/javascript\" charset=\"utf-8\">\n\t\tjQuery(document).ready(function($){\n\t\t\t//events\n\t\t\t$('input[name=\"dbem_ms_global_events\"]').change(function(){\n\t\t\t\tif( $('input:radio[name=\"dbem_ms_global_events\"]:checked').val() == 1 ){\n\t\t\t\t\t$(\"tr#dbem_ms_global_events_links_row\").show();\n\t\t\t\t\t$('input:radio[name=\"dbem_ms_global_events_links\"]:checked').trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(\"tr#dbem_ms_global_events_links_row, tr#dbem_ms_events_slug_row\").hide();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}).first().trigger('change');\n\t\t\t$('input[name=\"dbem_ms_global_events_links\"]').change(function(){\n\t\t\t\tif( $('input:radio[name=\"dbem_ms_global_events_links\"]:checked').val() == 1 ){\n\t\t\t\t\t$(\"tr#dbem_ms_events_slug_row\").hide();\t\n\t\t\t\t}else{\t\t\t\t\n\t\t\t\t\t$(\"tr#dbem_ms_events_slug_row\").show();\n\t\t\t\t}\n\t\t\t}).first().trigger('change');\n\t\t\t//locations\n\t\t\t$('input[name=\"dbem_ms_mainblog_locations\"]').change(function(){\n\t\t\t\tif( $('input:radio[name=\"dbem_ms_mainblog_locations\"]:checked').val() == 1 ){\n\t\t\t\t\t$(\"tbody.em-global-locations\").hide();\n\t\t\t\t}else{\n\t\t\t\t\t$(\"tbody.em-global-locations\").show();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}).first().trigger('change');\n\t\t\t$('input[name=\"dbem_ms_global_locations\"]').change(function(){\n\t\t\t\tif( $('input:radio[name=\"dbem_ms_global_locations\"]:checked').val() == 1 ){\n\t\t\t\t\t$(\"tr#dbem_ms_global_locations_links_row\").show();\n\t\t\t\t\t$('input:radio[name=\"dbem_ms_global_locations_links\"]:checked').trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(\"tr#dbem_ms_global_locations_links_row, tr#dbem_ms_locations_slug_row\").hide();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}).first().trigger('change');\n\t\t\t$('input[name=\"dbem_ms_global_locations_links\"]').change(function(){\n\t\t\t\tif( $('input:radio[name=\"dbem_ms_global_locations_links\"]:checked').val() == 1 ){\n\t\t\t\t\t$(\"tr#dbem_ms_locations_slug_row\").hide();\t\n\t\t\t\t}else{\n\t\t\t\t\t$(\"tr#dbem_ms_locations_slug_row\").show();\t\t\t\t\n\t\t\t\t}\n\t\t\t});\t\t\n\t\t\t//MS Mode selection hiders \n\t\t\t$('input[name=\"dbem_ms_global_table\"]').change(function(){ //global\n\t\t\t\tif( $('input:radio[name=\"dbem_ms_global_table\"]:checked').val() == 1 ){\n\t\t\t\t\t$(\"tbody.em-global-options\").show();\n\t\t\t\t\t$('input:radio[name=\"dbem_ms_mainblog_locations\"]:checked').trigger('change');\n\t\t\t\t}else{\n\t\t\t\t\t$(\"tbody.em-global-options\").hide();\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}).first().trigger('change');\t\n\t\t});\n\t</script>\n\t<style type=\"text/css\">.postbox h3 { cursor:pointer; }</style>\n\t<div class=\"wrap <?php if(empty($tabs_enabled)) echo 'tabs-active' ?>\">\n\t\t<div id='icon-options-general' class='icon32'><br /></div>\n\t\t<h1 id=\"em-options-title\"><?php _e ( 'Event Manager Options', 'events-manager'); ?></h1>\n\t\t<h2 class=\"nav-tab-wrapper\">\n\t\t\t<?php\n\t\t\t$tabs_enabled = defined('EM_SETTINGS_TABS') && EM_SETTINGS_TABS;\n\t\t\tif( $tabs_enabled ){\n\t\t\t\t$general_tab_link = esc_url(add_query_arg( array('em_tab'=>'general')));\n\t\t\t}else{\n\t\t\t\t$general_tab_link = '';\n\t\t\t}\n\t\t\t?>\n\t\t\t<a href=\"<?php echo $general_tab_link ?>#general\" id=\"em-menu-general\" class=\"nav-tab nav-tab-active\"><?php esc_html_e('General','events-manager'); ?></a>\n\t\t\t<?php\n\t\t\t$custom_tabs = apply_filters('em_ms_options_page_tabs', array());\n\t\t\tforeach( $custom_tabs as $tab_key => $tab_name ){\n\t\t\t\t$tab_link = !empty($tabs_enabled) ? esc_url(add_query_arg( array('em_tab'=>$tab_key))) : '';\n\t\t\t\t$active_class = !empty($tabs_enabled) && !empty($_GET['em_tab']) && $_GET['em_tab'] == $tab_key ? 'nav-tab-active':'';\n\t\t\t\techo \"<a href='$tab_link#$tab_key' id='em-menu-$tab_key' class='nav-tab $active_class'>$tab_name</a>\";\n\t\t\t}\n\t\t\t?>\n\t\t</h2>\n\t\t<?php echo $EM_Notices; ?>\n\t\t<form id=\"em-options-form\" method=\"post\" action=\"\">\n\t\t\t<div class=\"metabox-holder\"> \n\t\t\t<!-- // TODO Move style in css -->\n\t\t\t<div class='postbox-container' style='width: 99.5%'>\n\t\t\t<div id=\"\">\n\t\t\t<?php if( !$tabs_enabled || ($tabs_enabled && (empty($_REQUEST['em_tab']) || $_REQUEST['em_tab'] == 'general')) ): //make less changes for now, since we don't have any core tabs to add yet ?>\n\t\t \t<div class=\"em-menu-general em-menu-group\">\n\t\t\t\t<div class=\"postbox \" id=\"em-opt-ms-options\" >\n\t\t\t\t\t<div class=\"handlediv\" title=\"<?php __('Click to toggle', 'events-manager'); ?>\"><br /></div><h3><span><?php _e ( 'Multi Site Options', 'events-manager'); ?></span></h3>\n\t\t\t\t\t<div class=\"inside\">\n\t\t\t <table class=\"form-table\">\n\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\tem_options_radio_binary ( __( 'Enable global tables mode?', 'events-manager'), 'dbem_ms_global_table', __( 'Setting this to yes will make all events save in the main site event tables (EM must also be activated). This allows you to share events across different blogs, such as showing events in your network whilst allowing users to display and manage their events within their own blog. Bear in mind that activating this will mean old events created on the sub-blogs will not be accessible anymore, and if you switch back they will be but new events created during global events mode will only remain on the main site.','events-manager') );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t<tbody class=\"em-global-options\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tglobal $current_site;\n\t\t\t\t\t\t\t$global_slug_tip = __('%s belonging to other sub-sites will have an extra slug prepended to it so that your main site can differentiate between its own %s and those belonging to other sites in your network.','events-manager');\n\t\t\t\t\t\t\t$global_link_tip = __( 'When displaying global %s on the main site you have the option of users viewing the %s details on the main site or being directed to the sub-site.','events-manager');\n\t\t\t\t\t\t\t$global_post_tip = __( 'Displays %s from all sites on the network by default. You can still restrict %s by blog using shortcodes and template tags coupled with the <code>blog</code> attribute. Requires global tables to be turned on.','events-manager');\n\t\t\t\t\t\t\t$global_link_tip2 = __('You <strong>must</strong> have assigned a %s page in your <a href=\"%s\">main blog settings</a> for this to work.','events-manager');\n\t\t\t\t\t\t\t$options_page_link = get_admin_url($current_site->blog_id, 'edit.php?post_type='.EM_POST_TYPE_EVENT.'&page=events-manager-options#pages');\n\t\t\t\t\t\t\t?><tr class=\"em-header\"><td><h4><?php echo sprintf(__('%s Options','events-manager'),__('Event','events-manager')); ?></h4></td></tr><?php\n\t\t\t\t\t\t\tem_options_radio_binary ( sprintf(__( 'Display global events on main blog?', 'events-manager'), __('events','events-manager')), 'dbem_ms_global_events', sprintf($global_post_tip, __('events','events-manager'), __('events','events-manager')) );\n\t\t\t\t\t\t\tem_options_radio_binary ( sprintf(__( 'Link sub-site %s directly to sub-site?', 'events-manager'), __('events','events-manager')), 'dbem_ms_global_events_links', sprintf($global_link_tip, __('events','events-manager'), __('event','events-manager')).sprintf($global_link_tip2, __('event','events-manager'), $options_page_link) );\n\t\t\t\t\t\t\tem_options_input_text ( sprintf(__( 'Global %s slug', 'events-manager'),__('event','events-manager')), 'dbem_ms_events_slug', sprintf($global_slug_tip, __('Events','events-manager'), __('events','events-manager')).__('Example:','events-manager').'<code>http://yoursite.com/events/<strong>event</strong>/subsite-event-slug/', EM_EVENT_SLUG );\n\t\t\t\t\t\t\t?><tr class=\"em-header\"><td><h4><?php echo sprintf(__('%s Options','events-manager'),__('Location','events-manager')); ?></h4></td></tr><?php\n\t\t\t\t\t\t\tem_options_radio_binary ( sprintf(__( 'Locations on main blog?', 'events-manager'), __('locations','events-manager')), 'dbem_ms_mainblog_locations', __('If you would prefer all your locations to belong to your main blog, users in sub-sites will still be able to create locations, but the actual locations are created and reside in the main blog.','events-manager') );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t<tbody class=\"em-global-options em-global-locations\">\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\tem_options_radio_binary ( sprintf(__( 'Display global %s on main blog?', 'events-manager'), __('locations','events-manager')), 'dbem_ms_global_locations', sprintf($global_post_tip, __('locations','events-manager'), __('locations','events-manager')) );\n\t\t\t\t\t\t\tem_options_radio_binary ( sprintf(__( 'Link sub-site %s directly to sub-site?', 'events-manager'), __('locations','events-manager')), 'dbem_ms_global_locations_links', sprintf($global_link_tip, __('locations','events-manager'), __('location','events-manager')).sprintf($global_link_tip2, __('location','events-manager'), $options_page_link) );\n\t\t\t\t\t\t\tem_options_input_text ( sprintf(__( 'Global %s slug', 'events-manager'),__('location','events-manager')), 'dbem_ms_locations_slug', sprintf($global_slug_tip, __('Locations','events-manager'), __('locations','events-manager')).__('Example:','events-manager').'<code>http://yoursite.com/locations/<strong>location</strong>/subsite-location-slug/', EM_LOCATION_SLUG );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t<?php echo $save_button; ?>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t \n\t\t\t\t\t</div> <!-- . inside --> \n\t\t\t\t</div> <!-- .postbox --> \n\t\t\t\t\n\t\t\t\t<?php \n\t\t\t\t//including shared MS/non-MS boxes\n\t\t\t\tem_admin_option_box_caps();\n\t\t\t\tem_admin_option_box_image_sizes();\n\t\t\t\tem_admin_option_box_email();\n\t\t\t\tem_admin_option_box_uninstall();\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t<?php do_action('em_ms_options_page_footer'); ?>\n\t\t\t</div> <!-- .em-menu-general -->\n\t\t\t<?php endif; ?>\n\t\t\t<?php\n\t\t\t//other tabs\n\t\t\tif( $tabs_enabled ){\n\t\t\t\tif( array_key_exists($_REQUEST['em_tab'], $custom_tabs) ){\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"em-menu-bookings em-menu-group\">\n\t\t\t\t\t\t<?php do_action('em_ms_options_page_tab_'. $_REQUEST['em_tab']); ?>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tforeach( $custom_tabs as $tab_key => $tab_name ){\n\t\t\t\t\t?>\n\t\t\t\t\t<div class=\"em-menu-<?php echo esc_attr($tab_key) ?> em-menu-group\" style=\"display:none;\">\n\t\t\t\t\t\t<?php do_action('em_ms_options_page_tab_'. $tab_key); ?>\n\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t}\n\t\t\t}\n\t\t\t?>\n\n\t\t\t<p class=\"submit\">\n\t\t\t\t<input type=\"submit\" class=\"button-primary\" name=\"Submit\" value=\"<?php esc_attr_e( 'Save Changes', 'events-manager'); ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"em-submitted\" value=\"1\" />\n\t\t\t\t<input type=\"hidden\" name=\"_wpnonce\" value=\"<?php echo wp_create_nonce('events-manager-options'); ?>\" />\n\t\t\t</p> \n\t\t\t\n\t\t\t</div> <!-- .metabox-sortables -->\n\t\t\t</div> <!-- .postbox-container -->\n\t\t\t\n\t\t\t</div> <!-- .metabox-holder -->\t\n\t\t</form>\n\t</div>\n\t<?php\n}",
"public function display_analytics_options_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2>WSU Analytics Settings</h2>\n\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t<?php\n\t\twp_nonce_field( 'wsuwp-analytics-options' );\n\t\tdo_settings_sections( $this->settings_page );\n\n\t\tsubmit_button();\n\t\t?>\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"update\" />\n\t\t\t\t<input type=\"hidden\" name=\"option_page\" value=\"wsuwp-analytics\" />\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\t}",
"public function optionsdemo_settings_content() { ?>\n\t\t\t<div class=\"wrap\">\t\t\t\t\n\t\t\t\t<form method=\"POST\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\t\t\t\tsettings_fields( 'optionsdemo' );\n\t\t\t\t\tdo_settings_sections( 'optionsdemo' );\n\t\t\t\t\tsubmit_button();\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t</div> <?php\n\t\t}",
"public static function es_admin_option() {\n\t}",
"function options_form() {\n return array(\n );\n }",
"function handle_options()\r\n {\r\n $options = $this->get_options();\r\n \r\n if (isset($_POST['submitted'])) {\r\n \t\t\r\n \t\t//check security\r\n \t\tcheck_admin_referer('snazzy-nonce');\r\n \t\t\r\n $options = array();\r\n \r\n $options['years'] = htmlspecialchars($_POST['years']);\r\n $options['mini'] = $_POST['mini'];\r\n $options['posts'] = $_POST['posts'];\r\n $options['pages'] = $_POST['pages'];\r\n \r\n update_option($this->db_option, $options);\r\n \r\n echo '<div class=\"updated fade\"><p>Plugin settings saved.</p></div>';\r\n }\r\n \r\n $layout = $options['layout'];\r\n $years = stripslashes($options['years']);\r\n $mini = $options['mini'] == 'on' ? 'checked' : '';\r\n $posts = $options['posts'] == 'on' ? 'checked' : '';\r\n $pages = $options['pages'] == 'on' ? 'checked' : '';\r\n \r\n // URL for form submit, equals our current page\r\n $action_url = $_SERVER['REQUEST_URI'];\r\n \r\n include('snazzy-archives-options.php');\r\n }",
"function wpbs_echo_option()\n {\n include wpbs_advs_plugin_dir . 'admin/view/adminLayout.php';\n }",
"public function form()\n\t{\n\t?>\n\t<table class=\"form-table\">\n\t\t<tbody>\n\t\t<?php foreach( (array) $this->InstanceRegistred as $id => $args ) : ?>\n\t\t\t<tr>\n\t\t\t\t<th><?php echo $args['title'];?></th>\n\t\t\t\t<td>\n\t\t\t\t<?php \n\t\t\t\t\twp_dropdown_pages(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'name' \t\t\t\t=> $args['name'],\n\t\t\t\t\t\t\t'post_type' \t\t=> $args['post_type'],\n\t\t\t\t\t\t\t'selected' \t\t\t=> $args['selected'],\n\t\t\t\t\t\t\t'sort_column' \t\t=> $args['listorder'],\n\t\t\t\t\t\t\t'show_option_none' \t=> $args['show_option_none']\t\t\t\t\t\t\t\n\t\t\t\t\t\t)\n\t\t\t\t\t);\t\t\t\t\n\t\t\t\t?>\t\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t<?php endforeach;?>\n\t\t</tbody>\n\t</table>\n\t<?php\t\t\n\t}",
"public function admin_page_display() {\n ?>\n <div class=\"wrap cmb_options_page <?php echo $this->key; ?>\">\n <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>\n <?php cmb_metabox_form( self::option_fields(), $this->key ); ?>\n </div>\n <?php\n }",
"public function admin_page_display() {\n ?>\n <div class=\"wrap cmb_options_page <?php echo self::$key; ?>\">\n <h2><?php echo esc_html( get_admin_page_title() ); ?></h2>\n <?php cmb_metabox_form( self::option_fields(), self::$key ); ?>\n </div>\n <?php\n }",
"public function add_options_html() {\n\n $has_nav = ( count( $this->pre_tabs ) > 1 ) ? true : false;\n $show_all = ( ! $has_nav ) ? ' csf-show-all' : '';\n $ajax_class = ( $this->args['ajax_save'] ) ? ' csf-save-ajax' : '';\n $sticky_class = ( $this->args['sticky_header'] ) ? ' csf-sticky-header' : '';\n $wrapper_class = ( $this->args['framework_class'] ) ? ' '. $this->args['framework_class'] : '';\n\n echo '<div class=\"csf csf-theme-'. $this->args['theme'] .' csf-options'. $wrapper_class .'\" data-slug=\"'. $this->args['menu_slug'] .'\" data-unique=\"'. $this->unique .'\">';\n\n $notice_class = ( ! empty( $this->notice ) ) ? ' csf-form-show' : '';\n $notice_text = ( ! empty( $this->notice ) ) ? $this->notice : '';\n\n echo '<div class=\"csf-form-result csf-form-success'. $notice_class .'\">'. $notice_text .'</div>';\n\n $error_class = ( ! empty( $this->errors ) ) ? ' csf-form-show' : '';\n\n echo '<div class=\"csf-form-result csf-form-error'. $error_class .'\">';\n if( ! empty( $this->errors ) ) {\n foreach ( $this->errors as $error ) {\n echo '<i class=\"csf-label-error\">!</i> '. $error .'<br />';\n }\n }\n echo '</div>';\n\n echo '<div class=\"csf-container\">';\n\n echo '<form method=\"post\" action=\"\" enctype=\"multipart/form-data\" id=\"csf-form\">';\n\n echo '<input type=\"hidden\" class=\"csf-section-id\" name=\"csf_transient[section]\" value=\"1\">';\n wp_nonce_field( 'csf_options_nonce', 'csf_options_nonce' );\n\n echo '<div class=\"csf-header'. esc_attr( $sticky_class ) .'\">';\n echo '<div class=\"csf-header-inner\">';\n\n echo '<div class=\"csf-header-left\">';\n echo '<h1>'. $this->args['framework_title'] .'</h1>';\n echo '</div>';\n\n echo '<div class=\"csf-header-right\">';\n\n echo ( $has_nav && $this->args['show_all_options'] ) ? '<div class=\"csf-expand-all\" title=\"'. esc_html__( 'show all options', 'csf' ) .'\"><i class=\"fa fa-outdent\"></i></div>' : '';\n\n echo ( $this->args['show_search'] ) ? '<div class=\"csf-search\"><input type=\"text\" placeholder=\"'. esc_html__( 'Search option(s)', 'csf' ) .'\" /></div>' : '';\n\n echo '<div class=\"csf-buttons\">';\n echo '<input type=\"submit\" name=\"'. $this->unique .'[_nonce][save]\" class=\"button button-primary csf-save'. $ajax_class .'\" value=\"'. esc_html__( 'Save', 'csf' ) .'\" data-save=\"'. esc_html__( 'Saving...', 'csf' ) .'\">';\n echo ( $this->args['show_reset_section'] ) ? '<input type=\"submit\" name=\"csf_transient[reset_section]\" class=\"button button-secondary csf-reset-section csf-confirm\" value=\"'. esc_html__( 'Reset Section', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'\">' : '';\n echo ( $this->args['show_reset_all'] ) ? '<input type=\"submit\" name=\"csf_transient[reset]\" class=\"button button-secondary csf-warning-primary csf-reset-all csf-confirm\" value=\"'. esc_html__( 'Reset All', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'\">' : '';\n echo '</div>';\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n echo '</div>';\n echo '</div>';\n\n echo '<div class=\"csf-wrapper'. $show_all .'\">';\n\n if( $has_nav ) {\n echo '<div class=\"csf-nav csf-nav-options\">';\n\n echo '<ul>';\n\n $tab_key = 1;\n\n foreach( $this->pre_tabs as $tab ) {\n\n $tab_error = $this->error_check( $tab );\n $tab_icon = ( ! empty( $tab['icon'] ) ) ? '<i class=\"'. $tab['icon'] .'\"></i>' : '';\n\n if( ! empty( $tab['subs'] ) ) {\n\n echo '<li class=\"csf-tab-depth-0\">';\n\n echo '<a href=\"#tab='. $tab_key .'\" class=\"csf-arrow\">'. $tab_icon . $tab['title'] . $tab_error .'</a>';\n\n echo '<ul>';\n\n foreach ( $tab['subs'] as $sub ) {\n\n $sub_error = $this->error_check( $sub );\n $sub_icon = ( ! empty( $sub['icon'] ) ) ? '<i class=\"'. $sub['icon'] .'\"></i>' : '';\n\n echo '<li class=\"csf-tab-depth-1\"><a id=\"csf-tab-link-'. $tab_key .'\" href=\"#tab='. $tab_key .'\">'. $sub_icon . $sub['title'] . $sub_error .'</a></li>';\n\n $tab_key++;\n }\n\n echo '</ul>';\n\n echo '</li>';\n\n } else {\n\n echo '<li class=\"csf-tab-depth-0\"><a id=\"csf-tab-link-'. $tab_key .'\" href=\"#tab='. $tab_key .'\">'. $tab_icon . $tab['title'] . $tab_error .'</a></li>';\n\n $tab_key++;\n }\n\n }\n\n echo '</ul>';\n\n echo '</div>';\n\n }\n\n echo '<div class=\"csf-content\">';\n\n echo '<div class=\"csf-sections\">';\n\n $section_key = 1;\n\n foreach( $this->pre_sections as $section ) {\n\n $onload = ( ! $has_nav ) ? ' csf-onload' : '';\n $section_icon = ( ! empty( $section['icon'] ) ) ? '<i class=\"csf-icon '. $section['icon'] .'\"></i>' : '';\n\n echo '<div id=\"csf-section-'. $section_key .'\" class=\"csf-section'. $onload .'\">';\n echo ( $has_nav ) ? '<div class=\"csf-section-title\"><h3>'. $section_icon . $section['title'] .'</h3></div>' : '';\n echo ( ! empty( $section['description'] ) ) ? '<div class=\"csf-field csf-section-description\">'. $section['description'] .'</div>' : '';\n\n if( ! empty( $section['fields'] ) ) {\n\n foreach( $section['fields'] as $field ) {\n\n $is_field_error = $this->error_check( $field );\n\n if( ! empty( $is_field_error ) ) {\n $field['_error'] = $is_field_error;\n }\n\n $value = ( ! empty( $field['id'] ) && isset( $this->options[$field['id']] ) ) ? $this->options[$field['id']] : '';\n\n CSF::field( $field, $value, $this->unique, 'options' );\n\n }\n\n } else {\n\n echo '<div class=\"csf-no-option csf-text-muted\">'. esc_html__( 'No option provided by developer.', 'csf' ) .'</div>';\n\n }\n\n echo '</div>';\n\n $section_key++;\n }\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n\n echo '</div>';\n\n echo '<div class=\"csf-nav-background\"></div>';\n\n echo '</div>';\n\n if( ! empty( $this->args['show_footer'] ) ) {\n\n echo '<div class=\"csf-footer\">';\n\n echo '<div class=\"csf-buttons\">';\n echo '<input type=\"submit\" name=\"csf_transient[save]\" class=\"button button-primary csf-save'. $ajax_class .'\" value=\"'. esc_html__( 'Save', 'csf' ) .'\" data-save=\"'. esc_html__( 'Saving...', 'csf' ) .'\">';\n echo ( $this->args['show_reset_section'] ) ? '<input type=\"submit\" name=\"csf_transient[reset_section]\" class=\"button button-secondary csf-reset-section csf-confirm\" value=\"'. esc_html__( 'Reset Section', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset this section options?', 'csf' ) .'\">' : '';\n echo ( $this->args['show_reset_all'] ) ? '<input type=\"submit\" name=\"csf_transient[reset]\" class=\"button button-secondary csf-warning-primary csf-reset-all csf-confirm\" value=\"'. esc_html__( 'Reset All', 'csf' ) .'\" data-confirm=\"'. esc_html__( 'Are you sure to reset all options?', 'csf' ) .'\">' : '';\n echo '</div>';\n\n echo ( ! empty( $this->args['footer_text'] ) ) ? '<div class=\"csf-copyright\">'. $this->args['footer_text'] .'</div>' : '';\n\n echo '<div class=\"clear\"></div>';\n echo '</div>';\n\n }\n\n echo '</form>';\n\n echo '</div>';\n\n echo '<div class=\"clear\"></div>';\n\n echo ( ! empty( $this->args['footer_after'] ) ) ? $this->args['footer_after'] : '';\n\n echo '</div>';\n\n }",
"public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New Optin', 'mailoptin'));\n $this->register_core_settings($instance, true);\n $instance->build(true);\n }",
"public function print_default_options_page() {\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t\t<p>WPCampus settings require the Advanced Custom Fields PRO plugin. <a href=\"<?php echo admin_url( 'plugins.php' ); ?>\">Manage plugins</a></p>\n\t\t</div>\n\t\t<?php\n\t}",
"public function form()\n {\n $this->switch('footer_remove', Support::trans('main.footer_remove'))\n ->default(admin_setting('footer_remove'));\n $defaultColors = [\n 'default' => '墨蓝',\n 'blue' => '蓝',\n 'blue-light' => '亮蓝',\n 'green' => '墨绿',\n ];\n foreach (explode(\",\", ServiceProvider::setting('additional_theme_colors')) as $value) {\n if (!empty($value)) {\n [$k, $v] = explode(\":\", $value);\n $defaultColors[$k] = $v;\n }\n }\n\n $this->radio('theme_color', Support::trans('main.theme_color'))\n ->options($defaultColors)\n ->default(admin_setting('theme_color'));\n $this->radio('sidebar_style', Support::trans('main.sidebar_style'))\n ->options([\n 'default' => '默认',\n 'sidebar-separate' => '菜单分离',\n 'horizontal_menu' => '水平菜单'\n ])\n ->default(admin_setting('sidebar_style'));\n $this->switch('grid_row_actions_right', Support::trans('main.grid_row_actions_right'))\n ->help('启用后表格行操作按钮将永远贴着最右侧。')\n ->default(admin_setting('grid_row_actions_right'));\n }",
"public static function options_page()\n\t\t\t{\n\t\t\t\tif (!current_user_can('manage_options'))\n\t\t\t\t{\n\t\t\t\t\twp_die( __('You do not have sufficient permissions to access this page.') );\n\t\t\t\t}\n\t\n\t\t\t\t$plugin_id = HE_PLUGINOPTIONS_ID;\n\t\t\t\t// display options page\n\t\t\t\tinclude(self::file_path('options.php'));\n\t\t\t}",
"public function index() {\n return $this->view->render(\n 'admin/main.html.twig', [\n 'options' => $this->manager->all()\n ]\n );\n }",
"function wcfm_options_page_html() {\n\t\tglobal $WCFM;\n\t\t// check user capabilities\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t return;\n\t\t}\n\t\t\n\t\t// add error/update messages\n\t\t\n\t\tif ( isset( $_GET['settings-updated'] ) ) {\n\t\t // add settings saved message with the class of \"updated\"\n\t\t add_settings_error( 'wcfm_messages', 'wcfm_message', __( 'Settings Saved', $WCFM->text_domain ), 'updated' );\n\t\t}\n\t\t\n\t\t// show error/update messages\n\t\tsettings_errors( 'wcfm_messages' );\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t<form action=\"options.php\" method=\"post\">\n\t\t\t<div style=\"float: left; display: inline-block; width: 60%;\">\n\t\t\t\t <?php \n\t\t\t\t\t settings_fields( 'wcfm' );\n\t\t\t\t\t do_settings_sections( 'wcfm' );\n\t\t\t\t\t submit_button( 'Save Settings' );\n\t\t\t\t ?>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"wcfm_admin_message_wrapper\">\n\t\t\t\t<div class=\"wcfm_admin_message wcfm_admin_help_docs\">\n\t\t\t\t\t<h2>How can we help you?</h2>\n\t\t\t\t\t<ul style=\"list-style: outside; margin-left: 50px;\">\n\t\t\t\t\t <li><a target=\"_blank\" href=\"https://wclovers.com/blog/woocommerce-multivendor-marketplace-wcfm-marketplace/\">WCFM - Marketplace</a></li>\n\t\t\t\t\t <li><a target=\"_blank\" href=\"http://wclovers.com/knowledgebase/\">WCFM - Documentation</a></li>\n\t\t\t\t\t <li><a target=\"_blank\" href=\"https://wclovers.com/wcfm-tutorials/\">WCFM - Video Tutorial</a></li>\n\t\t\t\t\t\t<li><a target=\"_blank\" href=\"https://wclovers.com/blog/woocommerce-frontend-manager/\">WCFM - what will do for you?</a></li>\n\t\t\t\t\t\t<li><a target=\"_blank\" href=\"https://wclovers.com/blog/wcfm-dashboard-as-site-template/\">Customize WCFM Dashboard</a></li>\n\t\t\t\t\t\t<li><a target=\"_blank\" href=\"https://wclovers.com/blog/choose-best-woocommerce-multi-vendor-marketplace-plugin/\">Choose your Marketplace plugin</a></li>\n\t\t\t\t\t\t<li><a target=\"_blank\" href=\"https://wclovers.com/blog/location-products-wcfm/\">WCFM -> GEO my WP</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t<?php if(!WCFM_Dependencies::wcfmvm_plugin_active_check()) { ?>\n\t\t\t\t\t<div class=\"wcfm_admin_message\">\n\t\t\t\t\t\t<h2>Setup vendor subscription in 5 minutes -</h2>\n\t\t\t\t\t\t<a class=\"primary membership_btn\" href=\"https://wordpress.org/plugins/wc-multivendor-membership/\" target=\"_blank\">WCFM - Membership</a>\n\t\t\t\t\t</div>\n\t\t\t\t<?php } ?>\n\t\t\t\t<?php if(!WCFM_Dependencies::wcfmu_plugin_active_check()) { ?>\n\t\t\t\t\t<div class=\"wcfm_admin_message\">\n\t\t\t\t\t\t<h2>Are you looking for something like this?</h2>\n\t\t\t\t\t\t<ul style=\"list-style: outside; margin-left: 50px;\">\n\t\t\t\t\t\t <li>Live Chat Module</li>\n\t\t\t\t\t\t\t<li>Support Ticket System</li>\n\t\t\t\t\t\t\t<li>Vendor Followers</li>\n\t\t\t\t\t\t\t<li>Store Invoice</li>\n\t\t\t\t\t\t\t<li>Product Importer</li>\n\t\t\t\t\t\t\t<li>Shipping Tracking</li>\n\t\t\t\t\t\t\t<li>Advanced Custom Fields</li>\n\t\t\t\t\t\t\t<li>GEO Map integration</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<a class=\"primary\" href=\"https://wclovers.com/product/woocommerce-frontend-manager-ultimate/\" target=\"_blank\">Click here to get all this...</a>\n\t\t\t\t\t</div>\n\t\t\t\t<?php } elseif(!WCFM_Dependencies::wcfma_plugin_active_check()) { ?>\n\t\t\t\t\t<div class=\"wcfm_admin_message\">\n\t\t\t\t\t\t<h2>How a store can even without Analytics?</h2>\n\t\t\t\t\t\t<ul style=\"list-style: outside; margin-left: 50px;\">\n\t\t\t\t\t\t\t<li>Analytics by Region</li>\n\t\t\t\t\t\t\t<li>Analytics by Store</li>\n\t\t\t\t\t\t\t<li>Analytics by Product</li>\n\t\t\t\t\t\t\t<li>Analytics by Category</li>\n\t\t\t\t\t\t\t<li>Analytics Comparison</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t<a class=\"primary\" href=\"https://wclovers.com/product/woocommerce-frontend-manager-analytics/\" target=\"_blank\">Click here to get all this...</a>\n\t\t\t\t\t</div>\n\t\t\t\t<?php } ?>\n\t\t\t\t<div class=\"wcfm_admin_message wcfm_admin_support_docs\">\n\t\t\t\t\t<h2>All we want is Love!!</h2>\n\t\t\t\t\t<ul style=\"list-style: outside; margin-left: 50px;\">\n\t\t\t\t\t\t<li><a href=\"https://twitter.com/wcfmlovers\" target=\"_blank\">Get in touch</a></li>\n\t\t\t\t\t\t<li><a href=\"https://wordpress.org/support/plugin/wc-frontend-manager/reviews/\" target=\"_blank\">Be with US</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</form>\n\t\t</div>\n\t\t<?php\n }",
"function cjpopups_admin_form($options){\n\trequire_once(sprintf('%s/admin_form.php', cjpopups_item_path('includes_dir')));\n}",
"function cmh_add_options_page() {\r\n\tadd_options_page('Correct My Headings Options Page', 'Correct My Headings', 'manage_options', __FILE__, 'cmh_render_form');\r\n}",
"public function optionsdemo_settings_content() { ?>\n <div class=\"wrap\">\n <div id=\"icon-themes\" class=\"icon32\"><br/></div>\n <h1>Options Demo</h1>\n <form action=\"options.php\" method=\"POST\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\tsettings_fields( \"optionsdemo_general\" );\n\t\t\t\t\t\tdo_settings_sections( \"optionsdemo_general\" );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tsubmit_button( esc_html__( 'Save Setting', 'optionsdemo' ) )\n\t\t\t\t\t?>\n </form>\n </div>\n\t\t<?php }",
"public function render_admin_page() {\n $option_name = $this->name; \n include_once( dirname( __FILE__ ) . '/views/admin-page.php' );\n }",
"function cbstdsys_render_form() {\n\t?>\n\t<div class=\"wrap\">\n\n\t\t<!-- Display Plugin Icon, Header, and Description -->\n\t\t<div class=\"icon32\" id=\"icon-options-general\"><br></div>\n\t\t<h2><span style=\"font-family:Consolas,Monaco,Courier,monospace\">cb-std-sys</span>-<?php _e('Settings'); ?>, Version <?php echo CB_STD_SYS_VERSION; ?></h2>\n\n\t\t<!-- Beginning of the Plugin Options Form -->\n\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t<?php settings_fields('cbstdsys_plugin_options'); ?>\n\n<!--\n <fieldset>\n <legend><?php _e('Content','cb-std-sys'); ?></legend>\n\n \t\t\t<table class=\"form-table\">\n-->\n<?php render_form_fields( get_cbstdsys_options(), 'cbstdsys', 'cbstdsys_options' ); ?>\n<!--\n </table>\n\n </fieldset>\n-->\n\t\t\t<p class=\"submit\">\n\t\t\t<input type=\"submit\" class=\"button-primary\" value=\"<?php _e('Save Changes') ?>\" />\n\t\t\t</p>\n\n\t\t</form>\n\n\t</div>\n\t<?php\n}",
"function options() {\n\t\tif ( ! current_user_can( 'manage_options' ) )\t{\n\t\t\twp_die( __( 'You do not have sufficient permissions to access this page.' ) );\n\t\t}\n\t\tinclude WP_PLUGIN_DIR . '/qoorate/admin_options_page.php';\n\t}",
"public function settings_view() {\n?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2><?php _e('Google Analytics Options', 'wp-google-analytics') ?></h2>\n\t\t\t<form action=\"options.php\" method=\"post\" id=\"wp_google_analytics\">\n\t\t\t\t<?php\n\t\t\t\t\tsettings_fields( 'wga' );\n\t\t\t\t\tdo_settings_sections( 'wga' );\n\t\t\t\t\tsubmit_button( __( 'Update Options', 'wp-google-analytics' ) );\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n<?php\n\t}",
"function save_admin_options()\n {\n return update_option($this->options_name, $this->options);\n }",
"function mmf_admin_actions() {\n\t\tadd_options_page(\"MapMyFitness\", \"MapMyFitness\", 1, \"mmf\", \"mmf_admin\");\n\t}",
"function options_form(&$form, &$form_state) {\n parent::options_form($form, $form_state);\n $handlers = $this->display->handler->get_handlers('field');\n if (empty($handlers)) {\n $form['error_markup'] = array(\n '#value' => t('You need at least one field before you can configure your table settings'),\n '#prefix' => '<div class=\"error form-item description\">',\n '#suffix' => '</div>',\n );\n return;\n }\n\n // Create an array of allowed columns from the data we know:\n foreach ($handlers as $field => $handler) {\n if ($label = $handler->label()) {\n $field_names[$field] = $label;\n }\n else {\n $field_names[$field] = $handler->ui_name();\n }\n }\n $field_names[''] = '<none>';\n $field_names['--static--'] = '<static value>';\n\n $form['shop']['name'] = array(\n '#type' => 'textfield',\n '#default_value' => $this->options['shop']['name'],\n '#title' => t('Shop name'),\n );\n $form['shop']['company'] = array(\n '#type' => 'textfield',\n '#default_value' => $this->options['shop']['company'],\n '#title' => t('Shop company'),\n );\n $form['shop']['url'] = array(\n '#type' => 'textfield',\n '#default_value' => $this->options['shop']['url'],\n '#title' => t('Shop url'),\n );\n $form['currencies'] = array(\n '#type' => 'textarea',\n '#title' => t('Currencies'),\n '#default_value' => $this->options['currencies'],\n '#description' => t(\"List of currencies used in the shop. One currency - one selement. 'id' element is code of currency, 'rate' is currency rate. 'rate' also can be CBRF, NBU, NBK or CB.\"),\n );\n //only taxonomy vocabularies can now be used as categories\n $vocabularies = array('' => '<none>');\n foreach (taxonomy_get_vocabularies() as $v) {\n $vocabularies[$v->vid] = $v->name;\n }\n $form['vocabulary'] = array(\n '#type' => 'select',\n '#title' => t('Vocabulary'),\n '#default_value' => $this->options['vocabulary'],\n '#options' => $vocabularies,\n '#description' => t('What vocabulary to use for categories tag.'),\n );\n\n foreach (yandexmarket_fields() as $tag => $value) {\n $safe = str_replace(array('][', '_', ' '), '-', $tag);\n // the $id of the column for dependency checking.\n $id = 'edit-style-options-yacolumns-' . $safe . '-field';\n $types = yandexmarket_types($tag);\n $form['yacolumns'][$tag] = array(\n '#type' => 'fieldset',\n '#title' => $tag . ' (' . implode(', ', $types) . ')',\n '#collapsible' => TRUE,\n '#tree' => TRUE,\n '#collapsed' => ($this->options['yacolumns'][$tag]['field'] == ''\n || !isset($this->options['yacolumns'][$tag]['field']))?TRUE:FALSE,\n );\n $form['yacolumns'][$tag]['field'] = array(\n '#type' => 'select',\n '#options' => $field_names,\n '#default_value' => $this->options['yacolumns'][$tag]['field'],\n );\n $form['yacolumns'][$tag]['static'] = array(\n '#type' => 'textfield',\n '#title' => t('Static value'),\n '#size' => 40,\n '#default_value' => $this->options['yacolumns'][$tag]['static'],\n '#process' => array('ctools_dependent_process'),\n '#dependency' => array($id => array('--static--')),\n );\n $form['yacolumns'][$tag]['description'] = array(\n '#value' => '<div>' . $value['description'] . '</div>',\n );\n }\n return $form;\n\n }",
"public function render_admin() {\n\t\t$route_id = !empty( $_GET[ 'route' ] ) ? sanitize_text_field( $_GET[ 'route' ] ) : false;\n\t\t?>\n\t\t\t<main class=\"wrap\">\n\t\t\t\t<h1><?= $this->title; ?></h1>\n\t\t\t\t<hr>\n\t\t\t\t<form method=\"post\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\t\t\t\t\tif ( $route_id ) {\n\t\t\t\t\t\t\tinclude 'views/route.php';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinclude 'views/dashboard.php';\n\t\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t</main>\n\t\t<?php\n\t}",
"function adminMenu() {\r\n\t\t\tadd_options_page('Track The Book Settings', 'Track The Book', 8, 'trackthebook.php', array($this,'adminOptions'));\r\n\t\t}",
"public function admin() {\n\t\tglobal $wpdb, $current_user;\n\n\t\tget_currentuserinfo();\n\n\t\t// Save current user ID\n\t\t$user_id = $current_user->ID;\n\n\t\t// Get the Form Order type settings, if any\n\t\t$user_form_order_type = get_user_meta( $user_id, 'vfb-form-order-type', true );\n\n\t\t$form_nav_selected_id = ( isset( $_REQUEST['form'] ) ) ? $_REQUEST['form'] : '0';\n\t?>\n\t<div class=\"wrap\">\n\t\t<h2>\n\t\t\t<?php _e( 'Visual Form Builder Pro', 'visual-form-builder-pro' ); ?>\n<?php\n\t\t\t// Add New link\n\t\t\techo sprintf( ' <a href=\"%1$s\" class=\"add-new-h2\">%2$s</a>', esc_url( admin_url( 'admin.php?page=vfb-add-new' ) ), esc_html( __( 'Add New', 'visual-form-builder-pro' ) ) );\n\n\t\t\t// If searched, output the query\n\t\t\tif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )\n\t\t\t\techo '<span class=\"subtitle\">' . sprintf( __( 'Search results for \"%s\"' , 'visual-form-builder-pro'), $_REQUEST['s'] );\n?>\n\t\t</h2>\n<?php\n\t\t\t// Display form editor or the form list\n\t\t\tif ( isset( $_GET['form'] ) && 'edit' == $_GET['action'] ) :\n\t\t\t\tinclude_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/admin-form-creator.php' );\n\t\t\telse :\n?>\n\t\t\t<div id=\"vfb-form-list\">\n\t\t\t\t<div id=\"vfb-main\" class=\"vfb-order-type-<?php echo ( in_array( $user_form_order_type, array( 'order', '' ) ) ) ? 'order' : 'list'; ?>\">\n\t\t\t\t<?php $this->all_forms(); ?>\n\t\t\t\t</div> <!-- #vfb-main -->\n\t\t\t</div> <!-- #vfb-form-list -->\n<?php\n\t\t\tendif;\n?>\n\t</div>\n\t<?php\n\t}",
"public function display() {\r\n\r\n\t\t$this->echoOptionHeader();\r\n\r\n\t\tif ( ! empty( $this->options ) ) {\r\n\t\t\tforeach ( $this->options as $option ) {\r\n\r\n\t\t\t\t// Display the name of the option.\r\n\t\t\t\t$name = $option->getName();\r\n\t\t\t\tif ( ! empty( $name ) && ! $option->getHidden() ) {\r\n\t\t\t\t\techo '<span class=\"tf-group-name\">' . esc_html( $name ) . '</span> ';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Disable wrapper printing.\r\n\t\t\t\t$option->echo_wrapper = false;\r\n\r\n\t\t\t\t// Display the option field.\r\n\t\t\t\techo '<span class=\"tf-group-option\">';\r\n\t\t\t\t$option->display();\r\n\t\t\t\techo '</span>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->echoOptionFooter();\r\n\t}",
"public function lp_rating_settings_html() {\n // check user capabilities\n if (!current_user_can('manage_options')) {\n return;\n }\n \n ?>\n <div class=\"wrap\">\n <h1><?php echo esc_html(get_admin_page_title()); ?></h1>\n <form action=\"options.php\" method=\"post\">\n <?php\n // output security fields for the registered setting \"lp_rating_settings\"\n settings_fields('lp_rating_settings');\n \n // output setting sections and their fields\n do_settings_sections('lp_rating_settings');\n \n // output save settings button\n submit_button('Save Settings');\n ?>\n </form>\n </div>\n <?php\n }",
"public function add_options_page() {\n $this->options_page = add_menu_page( $this->title, $this->title, 'manage_options', self::$key, array( $this, 'admin_page_display' ) );\n }",
"public function options_form(&$form, &$form_state) {\n $form['display_as_link'] = array(\n '#title' => t('Display as link'),\n '#description' => t('Display this identifier as a link.'),\n '#type' => 'checkbox',\n '#default_value' => $this->options['display_as_link'],\n '#weight' => 1,\n );\n $form['multiple_field_settings'] = array(\n '#type' => 'fieldset',\n '#title' => t('Multiple field settings'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n '#weight' => 5,\n );\n $form['multi_type'] = array(\n '#type' => 'radios',\n '#title' => t('Display type'),\n '#options' => array(\n 'ul' => t('Unordered list'),\n 'ol' => t('Ordered list'),\n ),\n '#dependency' => array('edit-options-group-rows' => array(TRUE)),\n '#default_value' => $this->options['multi_type'],\n '#fieldset' => 'multiple_field_settings',\n );\n $form['list_class'] = array(\n '#type' => 'textfield',\n '#title' => t('Class to apply to list'),\n '#default_value' => $this->options['list_class'],\n '#fieldset' => 'multiple_field_settings',\n '#weight' => 5,\n );\n parent::options_form($form, $form_state);\n }",
"function cil_plugin_optionMenu_list()\n{\n\t//show admin options view, this view exists in cil_adminOptionsView.php\n\tdo_action('show_cil_admin_manage_lists');\n}",
"public function mm_options_page() { \n $tmp = $this->plugin_dir . '/inc/views/options-page.php';\n \n ob_start();\n include( $tmp );\n $output = ob_get_contents();\n ob_end_clean();\n echo $output;\n }",
"function cbp_display_options_page() {\n\t?>\n\t<div>\n\t<h2>Chibipaint Integration Settings</h2>\n\tAll fields are required.\n\t<form action=\"options.php\" method=\"post\">\n\t<?php settings_fields('cbp_option_group');\n\tdo_settings_sections('options_cbp');\n\tsubmit_button();\n\t?>\n\t</form></div>\n\n\t<?php\n}",
"function htpmpro_options_page_html() {\r\n\t // check user capabilities\r\n\t if ( ! current_user_can( 'manage_options' ) ) {\r\n\t \treturn;\r\n\t }\r\n\r\n\t // show message when updated\r\n\t if ( isset( $_GET['settings-updated'] ) ) {\r\n\t \tadd_settings_error( 'htpmpro_messages', 'htpmpro_message', esc_html__( 'Settings Saved', 'htpmpro' ), 'updated' );\r\n\t }\r\n\t \r\n\t // show error/update messages\r\n\t settings_errors( 'htpmpro_messages' );\r\n\t ?>\r\n\t\t<div class=\"wrap\">\r\n\t\t\t<h1><?php echo esc_html( 'WP Plugin Manager' ); ?> <?php echo esc_html( get_admin_page_title() ); ?></h1>\r\n\t\t\t<form action=\"options.php\" method=\"post\">\r\n\t\t\t\t<?php\r\n\t\t\t\t\t// output general section and their fields\r\n\t\t\t\t\tdo_settings_sections( 'options_group_general' );\r\n\r\n\t\t\t\t\t// general option fields\r\n\t\t\t\t\tsettings_fields( 'options_group_general' );\r\n\r\n\t\t\t\t\t// output save settings button\r\n\t\t\t\t\tsubmit_button( 'Save Settings' );\r\n\t\t\t\t?>\r\n\t\t\t</form>\r\n\t\t</div>\r\n\t<?php\r\n}",
"public function admin_menu() \n\t{\n\t\tadd_options_page('Generuoti laiškus', 'Generuoti laiškus', 'manage_options', 'kd-letters', array($this, 'admin_menu_options'));\n\t}",
"function lbcb_options_page(){\n?>\n\t<div class=\"wrap\">\n\t<form method=\"post\" action=\"options.php\">\n\t<?php settings_fields( 'lbcb_options_group' ); ?>\n\t<div class=\"icon32 swatch-icon32-color\"><br /></div>\n\t<h2 class=\"updatehook\"><?php _e('LB Colorbox settings', 'lbcb_textdomain' ); ?></h2>\n\t<table class=\"form-table\">\n\t<tbody>\n\n\t<?php do_settings_sections( 'lbcb_options_group' ); ?>\n\n\t</tbody>\n\t</table>\n\n\t<p class=\"submit\">\n\t<?php lbcb_print_option_buttons(); ?>\n\t</p>\n\t</form>\n<?php\n}",
"public function settings_admin_page()\n {\n add_action('wp_cspa_before_closing_header', [$this, 'back_to_optin_overview']);\n add_action('wp_cspa_before_post_body_content', array($this, 'optin_theme_sub_header'), 10, 2);\n add_filter('wp_cspa_main_content_area', [$this, 'optin_form_list']);\n\n $instance = Custom_Settings_Page_Api::instance();\n $instance->page_header(__('Add New', 'mailoptin'));\n $this->register_core_settings($instance);\n $instance->build(true, true);\n }",
"public function add_options_page()\n {\n }",
"public function form( $instance ) {\n\t\t// outputs the options form on admin\n\t\t\n $title = ! empty( $instance['title'] ) ? $instance['title'] : '';\n $usernames = ! empty( $instance['usernames'] ) ? $instance['usernames'] : '';\n $output = '';\n \n if(isset($instance['error'])){\n $output .= '<p>'.$instance['error'].'</p>';\n }\n \n $output .= '<p><label for=\"'.$this->get_field_id('title').'\">Title:</label><br>';\n $output .= '<input type=\"text\" id=\"'.$this->get_field_id('title').'\" name=\"'.$this->get_field_name('title').'\" value=\"'.esc_attr($title).'\" /></p>';\n \n $output .= '<p><label for=\"'.$this->get_field_id('usernames').'\">Twitter Usernames:</label><br>';\n $output .= '<input type=\"text\" id=\"'.$this->get_field_id('usernames').'\" name=\"'.$this->get_field_name('usernames').'\" value=\"'.esc_attr($usernames).'\" />';\n $output .= '<br><small>Enter a comma-separated list of own accounts.</small></p>';\n \n\t\techo $output;\n\t\t\n\t}",
"public function add_options_page() {\n $this->options_page = add_menu_page( $this->title, $this->title, 'manage_options', $this->key, array( $this, 'admin_page_display' ) );\n }",
"function initlab_options_page_html() {\n // check user capabilities\n if (!current_user_can('manage_options')) {\n return;\n }\n\n // add error/update messages\n\n // check if the user have submitted the settings\n // WordPress will add the \"settings-updated\" $_GET parameter to the url\n if (isset($_GET['settings-updated'])) {\n // add settings saved message with the class of \"updated\"\n add_settings_error('initlab_messages', 'initlab_message', __('Settings saved.', 'initlab-addons'), 'updated');\n }\n\n // show error/update messages\n settings_errors('initlab_messages');\n ?>\n <div class=\"wrap\">\n <h1><?php echo esc_html(get_admin_page_title()); ?></h1>\n <form action=\"options.php\" method=\"post\">\n <?php\n // output security fields for the registered setting \"initlab\"\n settings_fields('initlab');\n // output setting sections and their fields\n // (sections are registered for \"initlab\", each field is registered to a specific section)\n do_settings_sections('initlab');\n // output save settings button\n submit_button();\n ?>\n </form>\n </div>\n <?php\n}",
"public function show_settings() {\n\n\t\twoocommerce_admin_fields( $this->get_settings() );\n\t}",
"function bn_project_options_page_html() {\n\t// check user capabilities\n\tif (! current_user_can('manage_options')) {\n\t\treturn;\n\t\t// add error/update messages\n\t}\n\t// check if the user have submitted the settings\n\t// wordpress will add the \"settings-updated\" $_GET parameter to the url\n\tif ( isset( $_GET['settings-updated'] ) ) {\n\t\t// add settings saved message with the class of \"updated\"\n\t\tadd_settings_error( 'bn_project_messages', 'bn_project_message', __( 'Zapisano ustawienia', 'bn_project' ), 'updated' );\n\t}\n\n\t// show error/update messages\n\tsettings_errors( 'bn_project_messages' );\n\t?>\n\t<div class=\"wrap\">\n\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t<form action=\"options.php\" method=\"post\">\n\t<?php\n\t// output security fields for the registered setting \"bn_project\"\n\tsettings_fields( 'bn_project' );\n\t// output setting sections and their fields\n\t// (sections are registered for \"bn_project\", each field is registered to a specific section)\n\tdo_settings_sections( 'bn_project' );\n\t// output save settings button\n\tsubmit_button( 'Zapisz' );\n\t?>\n\t</form>\n\t</div>\n\t<?php\n}",
"function admin_config(){\n \n if(!acf_current_user_can_admin())\n return;\n \n global $plugin_page;\n \n if(!$plugin_page)\n return;\n \n $page = acf_get_options_page($plugin_page);\n \n if(!acf_maybe_get($page, 'menu_slug'))\n return;\n \n // Get Dynamic Options Page\n $acfe_dop_options_page = get_posts(array(\n 'post_type' => $this->post_type,\n 'posts_per_page' => 1,\n 'name' => $page['menu_slug']\n ));\n \n if(empty($acfe_dop_options_page))\n return;\n \n $acfe_dop_options_page = $acfe_dop_options_page[0];\n \n ?>\n <script type=\"text/html\" id=\"tmpl-acfe-dop-title-config\">\n <a href=\"<?php echo admin_url('post.php?post=' . $acfe_dop_options_page->ID . '&action=edit'); ?>\" class=\"page-title-action acfe-dop-admin-config\"><span class=\"dashicons dashicons-admin-generic\"></span></a>\n </script>\n\n <script type=\"text/javascript\">\n (function($){\n\n // Add button\n $('.wrap h1').append($('#tmpl-acfe-dop-title-config').html());\n\n })(jQuery);\n </script>\n <?php\n \n }",
"public function form()\r\n {\r\n $this->switch('field_select_create', Support::trans('main.select_create'))\r\n ->default(admin_setting('field_select_create'));\r\n }",
"public function admin_page_display()\n {\n?>\n <div class=\"wrap cmb2-options-page <?php echo $this->key; ?>\">\n <h2><?php echo esc_html(get_admin_page_title()); ?></h2>\n <?php cmb2_metabox_form($this->metabox_id, $this->key); ?>\n </div>\n<?php\n }",
"public function admin_page_display() {\n\t\t?>\n\t\t<div class=\"wrap cmb2-options-page <?php echo $this->key; ?>\">\n\t\t\t<h2><?php echo esc_html( get_admin_page_title() ); ?></h2>\n\t\t\t<?php cmb2_metabox_form( $this->metabox_id, $this->key ); ?>\n\t\t\t\n\t\t</div>\n\t\t<?php\n\t}",
"public function actionMyOptions()\n {\n echo \"option1 - $this->option1\\n\\roption2 - $this->option2\\n\\rcolor - $this->color\\n\\r\";\n }",
"function ba_options_page_html() {\n if (!current_user_can('manage_options')) {\n return;\n }\n\n if (isset($_GET['settings-updated'])) {\n add_settings_error('ba_messages', 'ba_messages', __('Settings Saved', 'ba_theme_options'), 'updated');\n }\n settings_errors('ba_messages');\n ?>\n\n <form action=\"options.php\" method=\"post\">\n <?php\n settings_fields('ba_theme_options');\n do_settings_sections('ba_theme_options');\n submit_button('Save');\n ?>\n </form>\n\n<?php\n}",
"public function add_options_page() {\n add_options_page($this->title, $this->title, 'manage_options', $this->page, array(&$this, 'display_options_page'));\n }",
"public function print_settings_page() {\n\n\t\t?>\n\t\t<div class=\"wrap\">\n\t\t\t<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t\t<form method=\"post\" action=\"options.php\" novalidate=\"novalidate\">\n\t\t\t\t<?php\n\n\t\t\t\t// Setup fields.\n\t\t\t\tsettings_fields( 'conf_schedule' );\n\n\t\t\t\t?>\n\t\t\t\t<div id=\"poststuff\">\n\t\t\t\t\t<div id=\"post-body\" class=\"metabox-holder columns-2\">\n\n\t\t\t\t\t\t<div id=\"postbox-container-1\" class=\"postbox-container\">\n\t\t\t\t\t\t\t<div id=\"side-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t// Print side boxes.\n\t\t\t\t\t\t\t\tdo_meta_boxes( $this->settings_page_id, 'side', array() );\n\n\t\t\t\t\t\t\t\t// Print save button.\n\t\t\t\t\t\t\t\tsubmit_button( __( 'Save Changes', 'conf-schedule' ), 'primary', 'conf_schedule_save_changes_side', false );\n\n\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div id=\"postbox-container-2\" class=\"postbox-container\">\n\n\t\t\t\t\t\t\t<div id=\"normal-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t\t\t\t\t<?php do_meta_boxes( $this->settings_page_id, 'normal', array() ); ?>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div id=\"advanced-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t\t\t\t\t<?php do_meta_boxes( $this->settings_page_id, 'advanced', array() ); ?>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t// Print save button.\n\t\t\t\t\t\t\tsubmit_button( __( 'Save Changes', 'conf-schedule' ), 'primary', 'conf_schedule_save_changes_bottom', false );\n\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t</div>\n\t\t\t\t\t<br class=\"clear\" />\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\n\t}",
"private function showOptions() : void\n {\n $selectedOption = $this->console->choice(__('Please cheoose your option:'), $this->getAllOptions() );\n $this->setSelectedOption($selectedOption);\n $this->handleOption();\n }",
"function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\n }",
"public function process_admin_options() {\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ) update_option( 'jigoshop_tgm_custom_gateway_enabled', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_enabled' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_title'] ) ) update_option( 'jigoshop_tgm_custom_gateway_title', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_title'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_title' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_description'] ) ) update_option( 'jigoshop_tgm_custom_gateway_description', \tjigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_description'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_description' );\n \t}"
] | [
"0.849304",
"0.8480907",
"0.83540624",
"0.7990609",
"0.7971901",
"0.7929803",
"0.78537714",
"0.78492403",
"0.7825237",
"0.7788278",
"0.7758197",
"0.7739689",
"0.7733534",
"0.7705504",
"0.7705504",
"0.7705504",
"0.7678409",
"0.76395667",
"0.7620891",
"0.76168656",
"0.76071805",
"0.7573118",
"0.75166214",
"0.7514092",
"0.7492571",
"0.74654347",
"0.7451635",
"0.744347",
"0.74417216",
"0.7364039",
"0.73395765",
"0.7283044",
"0.7269005",
"0.7261865",
"0.7255435",
"0.7244775",
"0.72367215",
"0.7229749",
"0.7190026",
"0.71826655",
"0.71464294",
"0.7119794",
"0.7113577",
"0.70688266",
"0.7065187",
"0.70620346",
"0.70571434",
"0.70376253",
"0.7030539",
"0.7028267",
"0.7003827",
"0.7001988",
"0.69864094",
"0.6972337",
"0.696566",
"0.6955535",
"0.6951468",
"0.69394386",
"0.69171333",
"0.69065833",
"0.6904515",
"0.6899104",
"0.6890213",
"0.6883098",
"0.68662536",
"0.6852343",
"0.68505484",
"0.6839138",
"0.6838699",
"0.6838544",
"0.6837286",
"0.68232805",
"0.68212986",
"0.681954",
"0.68119997",
"0.6804221",
"0.67966",
"0.6794903",
"0.6792532",
"0.6786762",
"0.67851126",
"0.678344",
"0.6781718",
"0.67794997",
"0.67761815",
"0.67757523",
"0.67589384",
"0.67558956",
"0.6748895",
"0.67391425",
"0.6735207",
"0.673125",
"0.6727325",
"0.6724731",
"0.67234576",
"0.6722587",
"0.6717472",
"0.6715635",
"0.671558",
"0.671471",
"0.67117834"
] | 0.0 | -1 |
Processing widget options on save | public function update( $new_instance, $old_instance ) {
$new_instance[ 'account' ] = isset($_POST['account']) ? $_POST['account'] : '';
$new_instance[ 'hashTag' ] = isset($_POST['hashTag']) ? $_POST['hashTag'] : '';
$new_instance[ 'retweets' ] = $_POST['retweets'];
$new_instance[ 'CONSUMER_KEY' ] = isset($_POST['CONSUMER_KEY']) ? $_POST['CONSUMER_KEY'] : '';
$new_instance[ 'CONSUMER_SECRET' ] = isset($_POST['CONSUMER_SECRET']) ? $_POST['CONSUMER_SECRET'] : '';
return $new_instance;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save_widget() {\n\t\t$this->get_cache();\n\t\t$this->get_db_values();\n\t\tif ( 'POST' === $_SERVER['REQUEST_METHOD'] && isset( $_POST[ $this->unique() ] ) ) {\n\t\t\t$this->get_db_values();\n\t\t\t$this->get_cache();\n\t\t\t$instance = new Save_Handler( array(\n\t\t\t\t'module' => &$this,\n\t\t\t\t'unique' => $this->unique(),\n\t\t\t\t'fields' => $this->fields(),\n\t\t\t\t'db_values' => $this->get_db_values(),\n\t\t\t) );\n\t\t\t$instance->run();\n\n\t\t\t$this->options_cache['field_errors'] = $instance->get_errors();\n\t\t\t$this->set_db_cache( $this->options_cache );\n\t\t\t$this->set_db_values( $instance->get_values() );\n\t\t\tif ( ! empty( $instance->get_errors() ) ) {\n\t\t\t\twp_redirect( add_query_arg( 'wponion-save', 'error' ) );\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->init_theme()->render();\n\t\t}\n\t}",
"public function save_widget_state() {\n\n\t\tcheck_ajax_referer( 'mi-admin-nonce', 'nonce' );\n\n\t\t$default = self::$default_options;\n\t\t$current_options = $this->get_options();\n\n\t\t$reports = $default['reports'];\n\t\tif ( isset( $_POST['reports'] ) ) {\n\t\t\t$reports = json_decode( sanitize_text_field( wp_unslash( $_POST['reports'] ) ), true );\n\t\t\tforeach ( $reports as $report => $reports_sections ) {\n\t\t\t\t$reports[ $report ] = array_map( 'boolval', $reports_sections );\n\t\t\t}\n\t\t}\n\n\t\t$options = array(\n\t\t\t'width' => ! empty( $_POST['width'] ) ? sanitize_text_field( wp_unslash( $_POST['width'] ) ) : $default['width'],\n\t\t\t'interval' => ! empty( $_POST['interval'] ) ? absint( wp_unslash( $_POST['interval'] ) ) : $default['interval'],\n\t\t\t'compact' => ! empty( $_POST['compact'] ) ? 'true' === sanitize_text_field( wp_unslash( $_POST['compact'] ) ) : $default['compact'],\n\t\t\t'reports' => $reports,\n\t\t\t'notice30day' => $current_options['notice30day'],\n\t\t);\n\n\t\tarray_walk( $options, 'sanitize_text_field' );\n\t\tupdate_user_meta( get_current_user_id(), 'monsterinsights_user_preferences', $options );\n\n\t\twp_send_json_success();\n\n\t}",
"public function save()\n {\n update_option($this->optionKey, $this->fields);\n }",
"function emb_save_options() {\n\t}",
"function wp_ajax_save_widget()\n {\n }",
"function save_options(){\n\t\t\n\t\t$nonsavable_types=array('open', 'close','subtitle','title','documentation','block','blockclose');\n\t\n\t\t//insert the default values if the fields are empty\n\t\tforeach ($this->options as $value) {\n\t\t\tif(isset($value['id']) && get_option($value['id'])===false && isset($value['std']) && !in_array($value['type'], $nonsavable_types)){\n\t\t\t\tupdate_option( $value['id'], $value['std']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t//save the field's values if the Save action is present\n\t\tif ( $_GET['page'] == HANA_OPTIONS_PAGE ) {\n\t\t\tif ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] ) {\n\t\t\t\t//verify the nonce\n\t\t\t\tif ( empty($_POST) || !wp_verify_nonce($_POST['hana-theme-options'],'hana-theme-update-options') )\n\t\t\t\t{\n\t\t\t\t\tprint 'Sorry, your nonce did not verify.';\n\t\t\t\t\texit;\n\t\t\t\t}else{\n\t\t\t\t\tif(!get_option(HANA_SHORTNAME.'_first_save')){\n\t\t\t\t\t\tupdate_option(HANA_SHORTNAME.'_first_save','true');\n\t\t\t\t\t}\n\t\t\t\t\tforeach ($this->options as $value) {\n\t\t\t\t\t\tif(isset($value['id']) ) if( isset( $_REQUEST[ $value['id'] ] ) && !in_array($value['type'], $nonsavable_types)) {\n\t\t\t\t\t\t\tupdate_option( $value['id'], $_REQUEST[ $value['id'] ] );\n\t\t\t\t\t\t} elseif(!in_array($value['type'], $nonsavable_types)){\n\t\t\t\t\t\t\tdelete_option( $value['id'] );\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t/* Update the values for the custom options that contain unlimited suboptions - for example when having\n\t\t\t\t\t\t * a slider with fields \"title\" and \"imageurl\", for all the entities the titles will be saved in one field,\n\t\t\t\t\t\t * separated by a separator. In this case, if the field name is slider_title and it contains some data like\n\t\t\t\t\t\t * title 1|*|title2|*|title3 (|*| is the separator), then all this data will be saved into a custom field\n\t\t\t\t\t\t * with id slider_titles.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif($value['type']=='custom'){\n\t\t\t\t\t\t\tforeach($value['fields'] as $field){\n\t\t\t\t\t\t\t\tupdate_option( $field['id'].'s', $_REQUEST[ $field['id'].'s' ] );\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\theader(\"Location: admin.php?page=\".HANA_OPTIONS_PAGE.\"&saved=true\");\n\t\t\t\t\tdie;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}",
"public function saveForm() {\n\n\t\tforeach ( $this->getOptionsList() as $element ) {\n\t\t\t$element->save();\n\t\t}\n\t\t$this->setLastAction( self::ACTION_SAVE );\n\n\t\t$custom_style = new Custom_CSS_Style();\n\t\t$custom_style->reinit();\n\t}",
"function beaver_extender_custom_options_save() {\n\t\n\tcheck_ajax_referer( 'custom-options', 'security' );\n\t\n\tif ( ! empty( $_POST['extender']['css_builder_popup_active'] ) || beaver_extender_get_custom_css( 'css_builder_popup_active' ) )\n\t\t$custom_css = beaver_extender_preserve_backslashes( beaver_extender_get_custom_css( 'custom_css' ) );\n\telse\n\t\t$custom_css = $_POST['extender']['custom_css'];\n\n\t$css_update = array(\n\t\t'custom_css' => $custom_css,\n\t\t'css_builder_popup_active' => ! empty( $_POST['extender']['css_builder_popup_active'] ) ? 1 : 0\n\t);\n\t$css_update_merged = array_merge( beaver_extender_custom_css_options_defaults(), $css_update );\n\tupdate_option( 'beaver_extender_custom_css', $css_update_merged );\n\t\n\t$functions_default = '<?php\n/* Do not remove this line. Add your functions below. */\n';\n\t\n\tif ( ! empty( $_POST['custom_functions'] ) ) {\n\t\t\n\t\t$functions_update = array(\n\t\t\t'custom_functions_effect_admin' => ! empty( $_POST['custom_functions']['custom_functions_effect_admin'] ) ? 1 : 0,\n\t\t\t'custom_functions' => ( $_POST['custom_functions']['custom_functions'] != '' ) ? $_POST['custom_functions']['custom_functions'] : $functions_default\n\t\t);\n\t\t$functions_update_merged = array_merge( beaver_extender_custom_functions_options_defaults(), $functions_update );\n\t\tupdate_option( 'beaver_extender_custom_functions', $functions_update_merged );\n\t\t\n\t}\n\n\tif ( ! empty( $_POST['custom_js'] ) ) {\n\t\t\n\t\t$js_update = array(\n\t\t\t'custom_js_in_head' => ! empty( $_POST['custom_js']['custom_js_in_head'] ) ? 1 : 0,\n\t\t\t'custom_js' => $_POST['custom_js']['custom_js']\n\t\t);\n\t\t$js_update_merged = array_merge( beaver_extender_custom_js_options_defaults(), $js_update );\n\t\tupdate_option( 'beaver_extender_custom_js', $js_update_merged );\n\t\t\n\t}\n\n\tif ( ! empty( $_POST['custom_template_ids'] ) ) {\n\t\t\n\t\t$template_ids_empty = true;\n\t\tforeach( $_POST['custom_template_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( ! empty( $key ) )\n\t\t\t\t$template_ids_empty = false;\n\n\t\t}\n\t\tforeach( $_POST['custom_template_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( empty( $key ) && !$template_ids_empty ) {\n\t\t\t\t\n\t\t\t\techo 'Please fill in ALL \"File Name\" fields';\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tbeaver_extender_update_templates( $_POST['custom_template_ids'], $_POST['custom_template_names'], $_POST['custom_template_types'], $_POST['custom_template_post_types'], $_POST['custom_template_textarea'] );\n\t\t\n\t}\n\n\tif ( ! empty( $_POST['custom_label_names'] ) ) {\n\t\t\n\t\t$label_names_empty = true;\n\t\tforeach( $_POST['custom_label_names'] as $key ) {\n\t\t\t\n\t\t\tif ( ! empty( $key ) ) {\n\t\t\t\t\n\t\t\t\t$label_names_empty = false;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tforeach( $_POST['custom_label_names'] as $key ) {\n\t\t\t\n\t\t\tif ( empty( $key ) && !$label_names_empty ) {\n\t\t\t\t\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tbeaver_extender_update_labels( $_POST['custom_label_names'] );\n\n\t\tif ( ! empty( $_POST['custom_label_create_conditionals'] ) ) {\n\t\t\t\n\t\t\t$custom_conditional_ids = array();\n\t\t\t$custom_conditional_tags = array();\n\t\t\tforeach( $_POST['custom_label_create_conditionals'] as $key => $value ) {\n\t\t\t\t\n\t\t\t\t$custom_conditional_ids[] = 'has_label_' . str_replace( '-', '_', beaver_extender_sanitize_string( $_POST['custom_label_names'][$key] ) );\n\t\t\t\t$custom_conditional_tags[] = 'beaver_extender_has_label(\\'' . beaver_extender_sanitize_string( $_POST['custom_label_names'][$key] ) . '\\')';\n\t\t\t\t\n\t\t\t}\n\t\t\tbeaver_extender_update_conditionals( $custom_conditional_ids, $custom_conditional_tags );\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\tif ( ! empty( $_POST['custom_widget_conditionals_list'] ) )\n\t\t$custom_widget_conditionals_list = $_POST['custom_widget_conditionals_list'];\n\telse\n\t\t$custom_widget_conditionals_list = array();\n\t\n\tif ( ! empty( $_POST['custom_hook_conditionals_list'] ) )\n\t\t$custom_hook_conditionals_list = $_POST['custom_hook_conditionals_list'];\n\telse\n\t\t$custom_hook_conditionals_list = array();\n\t\n\tif ( ! empty( $_POST['custom_conditional_ids'] ) ) {\n\t\t\n\t\t$conditional_ids_empty = true;\n\t\tforeach( $_POST['custom_conditional_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( ! empty( $key ) )\n\t\t\t\t$conditional_ids_empty = false;\n\t\t\t\t\n\t\t}\n\t\tforeach( $_POST['custom_conditional_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( empty( $key ) && !$conditional_ids_empty ) {\n\t\t\t\t\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tbeaver_extender_update_conditionals( $_POST['custom_conditional_ids'], $_POST['custom_conditional_tags'] );\n\t\t\n\t}\n\tif ( ! empty( $_POST['custom_widget_ids'] ) ) {\n\t\t\n\t\t$widget_ids_empty = true;\n\t\tforeach( $_POST['custom_widget_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( ! empty( $key ) )\n\t\t\t\t$widget_ids_empty = false;\n\t\t\t\t\n\t\t}\n\t\tforeach( $_POST['custom_widget_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( empty( $key ) && !$widget_ids_empty ) {\n\t\t\t\t\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tbeaver_extender_update_widgets( $_POST['custom_widget_ids'], $custom_widget_conditionals_list, $_POST['custom_widget_hook'], $_POST['custom_widget_class'], $_POST['custom_widget_description'], $_POST['custom_widget_status'], $_POST['custom_widget_priority'] );\n\t\n\t}\n\tif ( ! empty( $_POST['custom_hook_ids'] ) ) {\n\t\t\n\t\t$hook_ids_empty = true;\n\t\tforeach( $_POST['custom_hook_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( ! empty( $key ) )\n\t\t\t\t$hook_ids_empty = false;\n\n\t\t}\n\t\tforeach( $_POST['custom_hook_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( empty( $key ) && !$hook_ids_empty ) {\n\t\t\t\t\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tbeaver_extender_update_hooks( $_POST['custom_hook_ids'], $custom_hook_conditionals_list, $_POST['custom_hook_hook'], $_POST['custom_hook_status'], $_POST['custom_hook_priority'], $_POST['custom_hook_textarea'] );\n\t\n\t}\n\t\n\tbeaver_extender_write_files( $css = true );\n\t\n\techo 'Custom Options Updated';\n\texit();\n\t\n}",
"function save_options() {\r\n\t\t$this->version = BF_VERSION;\r\n\t\t\r\n\t\t$this->feed_url = (string)$_POST['bf-rss-feed-url'];\r\n\t\t$this->comments_feed_url = (string)$_POST['bf-rss-comments-url'];\r\n\t\t$this->footer_message = (string)($_POST['bf-footer-message']);\r\n\t\t\r\n\t\t$this->featured_cat = (int)$_POST['bf-cat-featured'];\r\n\t\t$this->news_cat = (int)$_POST['bf-cat-news'];\r\n\t\t$this->asides_cat = (int)$_POST['bf-cat-asides'];\r\n\t\t\r\n\t\t$this->home_link = (string)$_POST['bf-nav-home'];\r\n\t\t$this->blog_link = (string)$_POST['bf-nav-blog'];\r\n\t\t$this->single_parent = (string)$_POST['bf-nav-singleparent'];\r\n\t\t$this->topnav_linkcat = (int)$_POST['bf-nav-linkcat'];\r\n\t\t\r\n\t\t$this->display_author = (boolean)$_POST['bf-layout-display-author'];\r\n\r\n\t\t$this->hooks = array();\r\n\t\t$hook_classes = $_POST['bf-hook-cond'];\r\n\t\t$hook_filters = $_POST['bf-hook-filter'];\r\n\t\t$hook_positions = $_POST['bf-hook-position'];\r\n\t\t$hook_codes = $_POST['bf-hook-html'];\r\n\t\t\r\n\t\tfor ( $i = 0; $i < count($hook_positions); $i++ ) {\r\n\t\t\t$this->hooks[] = array(\r\n\t\t\t\t'ID'\t\t=>\t(string)stripslashes($hook_classes[$i]),\r\n\t\t\t\t'filter'\t=>\t$hook_filters[$i],\r\n\t\t\t\t'position'\t=>\t(string)stripslashes($hook_positions[$i]),\r\n\t\t\t\t'code'\t\t=>\t$hook_codes[$i]\r\n\t\t\t);\r\n\t\t}\r\n\t}",
"public function sarbacane_save_widget() {\n\t\t$this->save_newsletter ();\n\t}",
"public function save_option() {\n\t\tupdate_option( self::OPTION_NAME, $this->ryte_option );\n\t}",
"public function save_settings() {\n\n\t\twoocommerce_update_options( $this->get_settings() );\n\t}",
"function genesis_extender_custom_options_save()\n{\n\tcheck_ajax_referer( 'custom-options', 'security' );\n\t\n\tif( !empty( $_POST['extender']['css_builder_popup_active'] ) || genesis_extender_get_custom_css( 'css_builder_popup_active' ) )\n\t\t$custom_css = genesis_extender_preserve_backslashes( genesis_extender_get_custom_css( 'custom_css' ) );\n\telse\n\t\t$custom_css = $_POST['extender']['custom_css'];\n\n\t$css_update = array(\n\t\t'custom_css' => $custom_css,\n\t\t'css_builder_popup_active' => !empty( $_POST['extender']['css_builder_popup_active'] ) ? 1 : 0\n\t);\n\t$css_update_merged = array_merge( genesis_extender_custom_css_options_defaults(), $css_update );\n\tupdate_option( 'genesis_extender_custom_css', $css_update_merged );\n\t\n\t$functions_default = '<?php\n/* Do not remove this line. Add your functions below. */\n';\n\t\n\tif( !empty( $_POST['custom_functions'] ) )\n\t{\n\t\t$functions_update = array(\n\t\t\t'custom_functions_effect_admin' => !empty( $_POST['custom_functions']['custom_functions_effect_admin'] ) ? 1 : 0,\n\t\t\t'custom_functions' => ( $_POST['custom_functions']['custom_functions'] != '' ) ? $_POST['custom_functions']['custom_functions'] : $functions_default\n\t\t);\n\t\t$functions_update_merged = array_merge( genesis_extender_custom_functions_options_defaults(), $functions_update );\n\t\tupdate_option( 'genesis_extender_custom_functions', $functions_update_merged );\n\t}\n\n\tif( !empty( $_POST['custom_js'] ) )\n\t{\n\t\t$js_update = array(\n\t\t\t'custom_js_in_head' => !empty( $_POST['custom_js']['custom_js_in_head'] ) ? 1 : 0,\n\t\t\t'custom_js' => $_POST['custom_js']['custom_js']\n\t\t);\n\t\t$js_update_merged = array_merge( genesis_extender_custom_js_options_defaults(), $js_update );\n\t\tupdate_option( 'genesis_extender_custom_js', $js_update_merged );\n\t}\n\n\tif ( ! empty( $_POST['custom_template_ids'] ) ) {\n\t\t\n\t\t$template_ids_empty = true;\n\t\tforeach( $_POST['custom_template_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( ! empty( $key ) )\n\t\t\t\t$template_ids_empty = false;\n\n\t\t}\n\t\tforeach( $_POST['custom_template_ids'] as $key ) {\n\t\t\t\n\t\t\tif ( empty( $key ) && !$template_ids_empty ) {\n\t\t\t\t\n\t\t\t\techo 'Please fill in ALL \"File Name\" fields';\n\t\t\t\texit();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tgenesis_extender_update_templates( $_POST['custom_template_ids'], $_POST['custom_template_names'], $_POST['custom_template_types'], $_POST['custom_template_post_types'], $_POST['custom_template_textarea'] );\n\t\t\n\t}\n\n\tif( !empty( $_POST['custom_label_names'] ) )\n\t{\n\t\t$label_names_empty = true;\n\t\tforeach( $_POST['custom_label_names'] as $key )\n\t\t{\n\t\t\tif( !empty( $key ) )\n\t\t\t{\n\t\t\t\t$label_names_empty = false;\n\t\t\t}\n\t\t}\n\t\tforeach( $_POST['custom_label_names'] as $key )\n\t\t{\n\t\t\tif( empty( $key ) && !$label_names_empty )\n\t\t\t{\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\tgenesis_extender_update_labels( $_POST['custom_label_names'] );\n\n\t\tif( !empty( $_POST['custom_label_create_conditionals'] ) )\n\t\t{\n\t\t\t$custom_conditional_ids = array();\n\t\t\t$custom_conditional_tags = array();\n\t\t\tforeach( $_POST['custom_label_create_conditionals'] as $key => $value )\n\t\t\t{\n\t\t\t\t$custom_conditional_ids[] = 'has_label_' . str_replace( '-', '_', genesis_extender_sanatize_string( $_POST['custom_label_names'][$key] ) );\n\t\t\t\t$custom_conditional_tags[] = 'extender_has_label(\\'' . genesis_extender_sanatize_string( $_POST['custom_label_names'][$key] ) . '\\')';\n\t\t\t}\n\t\t\tgenesis_extender_update_conditionals( $custom_conditional_ids, $custom_conditional_tags );\n\t\t}\n\t}\n\t\n\tif( !empty( $_POST['custom_widget_conditionals_list'] ) )\n\t{\n\t\t$custom_widget_conditionals_list = $_POST['custom_widget_conditionals_list'];\n\t}\n\telse\n\t{\n\t\t$custom_widget_conditionals_list = array();\n\t}\n\t\n\tif( !empty( $_POST['custom_hook_conditionals_list'] ) )\n\t{\n\t\t$custom_hook_conditionals_list = $_POST['custom_hook_conditionals_list'];\n\t}\n\telse\n\t{\n\t\t$custom_hook_conditionals_list = array();\n\t}\n\t\n\tif( !empty( $_POST['custom_conditional_ids'] ) )\n\t{\n\t\t$conditional_ids_empty = true;\n\t\tforeach( $_POST['custom_conditional_ids'] as $key )\n\t\t{\n\t\t\tif( !empty( $key ) )\n\t\t\t{\n\t\t\t\t$conditional_ids_empty = false;\n\t\t\t}\n\t\t}\n\t\tforeach( $_POST['custom_conditional_ids'] as $key )\n\t\t{\n\t\t\tif( empty( $key ) && !$conditional_ids_empty )\n\t\t\t{\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\tgenesis_extender_update_conditionals( $_POST['custom_conditional_ids'], $_POST['custom_conditional_tags'] );\n\t}\n\tif( !empty( $_POST['custom_widget_ids'] ) )\n\t{\n\t\t$widget_ids_empty = true;\n\t\tforeach( $_POST['custom_widget_ids'] as $key )\n\t\t{\n\t\t\tif( !empty( $key ) )\n\t\t\t{\n\t\t\t\t$widget_ids_empty = false;\n\t\t\t}\n\t\t}\n\t\tforeach( $_POST['custom_widget_ids'] as $key )\n\t\t{\n\t\t\tif( empty( $key ) && !$widget_ids_empty )\n\t\t\t{\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\tgenesis_extender_update_widgets( $_POST['custom_widget_ids'], $custom_widget_conditionals_list, $_POST['custom_widget_hook'], $_POST['custom_widget_class'], $_POST['custom_widget_description'], $_POST['custom_widget_status'], $_POST['custom_widget_priority'] );\n\t}\n\tif( !empty( $_POST['custom_hook_ids'] ) )\n\t{\n\t\t$hook_ids_empty = true;\n\t\tforeach( $_POST['custom_hook_ids'] as $key )\n\t\t{\n\t\t\tif( !empty( $key ) )\n\t\t\t{\n\t\t\t\t$hook_ids_empty = false;\n\t\t\t}\n\t\t}\n\t\tforeach( $_POST['custom_hook_ids'] as $key )\n\t\t{\n\t\t\tif( empty( $key ) && !$hook_ids_empty )\n\t\t\t{\n\t\t\t\techo 'Please fill in ALL \"Name\" fields';\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\tgenesis_extender_update_hooks( $_POST['custom_hook_ids'], $custom_hook_conditionals_list, $_POST['custom_hook_hook'], $_POST['custom_hook_status'], $_POST['custom_hook_priority'], $_POST['custom_hook_textarea'] );\n\t}\n\t\n\tgenesis_extender_write_files( $css = true, $ez = false );\n\t\n\techo 'Custom Options Updated';\n\texit();\n}",
"public function save()\n\t{\n\t\t$old_options = get_option($this->filterName);\n\t\t//create new options\n\t\t$this->options = is_array($old_options) ? array_merge($old_options, $this->options) : $this->options;\n\t\t\n\t\t//verify default value\n\t\t$this->defaultOptions($this->options);\n\t\tupdate_option($this->filterName, $this->options);\n\t}",
"function handle_options()\r\n {\r\n $options = $this->get_options();\r\n \r\n if (isset($_POST['submitted'])) {\r\n \t\t\r\n \t\t//check security\r\n \t\tcheck_admin_referer('snazzy-nonce');\r\n \t\t\r\n $options = array();\r\n \r\n $options['years'] = htmlspecialchars($_POST['years']);\r\n $options['mini'] = $_POST['mini'];\r\n $options['posts'] = $_POST['posts'];\r\n $options['pages'] = $_POST['pages'];\r\n \r\n update_option($this->db_option, $options);\r\n \r\n echo '<div class=\"updated fade\"><p>Plugin settings saved.</p></div>';\r\n }\r\n \r\n $layout = $options['layout'];\r\n $years = stripslashes($options['years']);\r\n $mini = $options['mini'] == 'on' ? 'checked' : '';\r\n $posts = $options['posts'] == 'on' ? 'checked' : '';\r\n $pages = $options['pages'] == 'on' ? 'checked' : '';\r\n \r\n // URL for form submit, equals our current page\r\n $action_url = $_SERVER['REQUEST_URI'];\r\n \r\n include('snazzy-archives-options.php');\r\n }",
"function store(){\n update_option( $this->option_name, $this->settings );\n }",
"public function saveConfigOptions() {}",
"public function mm_options_save() {\n $options = $this->options;\n\n //'include_css','show_captions','file_link','itemtag','icontag','captiontag','columns','size'\n if(wp_verify_nonce($_REQUEST['_wp_mm_bg_nonce'],'mm_bg')) {\n if ( isset($_POST['submit']) ) {\n ( function_exists('current_user_can') && !current_user_can('manage_options') ) ? die(__('Cheatin’ uh?', 'mm_custom')) : null;\n \n $options['include_css'] = ( isset($_POST['mm-include_css']) ? 'true' : 'false' );\n $options['show_captions'] = ( isset($_POST['mm-show_captions']) ? 'true' : 'false' );\n $options['file_link'] = ( isset($_POST['mm-file_link']) ? 'true' : 'false' );\n $options['itemtag'] = ( isset($_POST['mm-itemtag']) ? stripslashes ( strip_tags($_POST['mm-itemtag'] ) ) : '' );\n $options['icontag'] = ( isset($_POST['mm-icontag']) ? stripslashes ( strip_tags($_POST['mm-icontag'] ) ) : '' );\n $options['captiontag'] = ( isset($_POST['mm-captiontag']) ? stripslashes ( strip_tags($_POST['mm-captiontag'] ) ) : '' );\n $options['columns'] = ( isset($_POST['mm-columns']) ? stripslashes ( strip_tags($_POST['mm-columns'] ) ) : '' );\n $options['size'] = ( isset($_POST['mm-size']) ? stripslashes ( strip_tags($_POST['mm-size'] ) ) : '' );\n $css = ( isset($_POST['mm-css']) ? stripslashes ( strip_tags($_POST['mm-css'] ) ) : 'false' );\n \n if($css != 'false') {\n $this->mm_update_css($css);\n update_option('mm_gallery_css', $css);\n }\n update_option('mm_gallery_options', $options);\n }\n }\n }",
"public function save_builder_settings() {\n\t\t_deprecated_function( 'save_builder_settings', '1.6', 'save_builder' );\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforminator_validate_ajax( \"forminator_save_builder_fields\" );\n\n\t\t$submitted_data = $this->get_post_data();\n\t\t$fields = array();\n\t\t$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;\n\t\t$id = intval( $id );\n\t\t$title = sanitize_text_field( $submitted_data['formName'] );\n\t\t$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';\n\t\t$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';\n\n\t\tif ( is_null( $id ) || $id <= 0 ) {\n\t\t\t$form_model = new Forminator_Custom_Form_Model();\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = Forminator_Custom_Form_Model::STATUS_PUBLISH;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$form_model = Forminator_Custom_Form_Model::model()->load( $id );\n\n\t\t\tif ( ! is_object( $form_model ) ) {\n\t\t\t\twp_send_json_error( __( \"Form model doesn't exist\", Forminator::DOMAIN ) );\n\t\t\t}\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = $form_model->status;\n\t\t\t}\n\t\t}\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data, 'forminator_sanitize_field' );\n\n\t\t// Sanitize settings\n\t\t$settings = forminator_sanitize_field( $submitted_data['data'] );\n\n\t\t// Sanitize custom css\n\t\tif ( isset( $submitted_data['data']['custom_css'] ) ) {\n\t\t\t$settings['custom_css'] = sanitize_textarea_field( $submitted_data['data']['custom_css'] );\n\t\t}\n\n\t\t// Sanitize thank you message\n\t\tif ( isset( $submitted_data['data']['thankyou-message'] ) ) {\n\t\t\t$settings['thankyou-message'] = $submitted_data['data']['thankyou-message'];\n\t\t}\n\n\t\t// Sanitize user email message\n\t\tif ( isset( $submitted_data['data']['user-email-editor'] ) ) {\n\t\t\t$settings['user-email-editor'] = $submitted_data['data']['user-email-editor'];\n\t\t}\n\n\t\t// Sanitize admin email message\n\t\tif ( isset( $submitted_data['data']['admin-email-editor'] ) ) {\n\t\t\t$settings['admin-email-editor'] = $submitted_data['data']['admin-email-editor'];\n\t\t}\n\n\t\t$settings['formName'] = $title;\n\t\t$settings['version'] = $version;\n\t\t$form_model->settings = $settings;\n\n\t\t// status\n\t\t$form_model->status = $status;\n\n\t\t// Save data\n\t\t$id = $form_model->save();\n\n\t\t// add privacy settings to global option\n\t\t$override_privacy = false;\n\t\tif ( isset( $settings['enable-submissions-retention'] ) ) {\n\t\t\t$override_privacy = filter_var( $settings['enable-submissions-retention'], FILTER_VALIDATE_BOOLEAN );\n\t\t}\n\t\t$retention_number = null;\n\t\t$retention_unit = null;\n\t\tif ( $override_privacy ) {\n\t\t\t$retention_number = 0;\n\t\t\t$retention_unit = 'days';\n\t\t\tif ( isset( $settings['submissions-retention-number'] ) ) {\n\t\t\t\t$retention_number = (int) $settings['submissions-retention-number'];\n\t\t\t}\n\t\t\tif ( isset( $settings['submissions-retention-unit'] ) ) {\n\t\t\t\t$retention_unit = $settings['submissions-retention-unit'];\n\t\t\t}\n\t\t}\n\n\t\tforminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );\n\n\t\twp_send_json_success( $id );\n\t}",
"public function afterSave()\n\t{\n\t\t//annoying on every edit, move to a checkbox on form and handle in controller\n\t}",
"public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}",
"function beaver_extender_custom_options() {\n\t\n\t$custom_functions = get_option( 'beaver_extender_custom_functions' );\n\t$custom_js = get_option( 'beaver_extender_custom_js' );\n\t$custom_templates = beaver_extender_get_templates();\n\t$custom_labels = beaver_extender_get_labels();\n\t$custom_conditionals = beaver_extender_get_conditionals();\n\t$custom_widgets = beaver_extender_get_widgets();\n\t$custom_hooks = beaver_extender_get_hooks();\n?>\n\t<div class=\"wrap\">\n\t\t\n\t\t<div id=\"beaver-extender-custom-saved\" class=\"beaver-extender-update-box\"></div>\n\n\t\t<?php\n\t\tif ( ! empty( $_POST['action'] ) && $_POST['action'] == 'reset' ) {\n\t\t\t\n\t\t\tbeaver_extender_reset_delete_template();\n\t\t\tupdate_option( 'beaver_extender_custom_css', beaver_extender_custom_css_options_defaults() );\n\t\t\tupdate_option( 'beaver_extender_custom_functions', beaver_extender_custom_functions_options_defaults() );\n\t\t\tupdate_option( 'beaver_extender_custom_js', beaver_extender_custom_js_options_defaults() );\n\t\t\tupdate_option( 'beaver_extender_custom_templates', array() );\n\t\t\tupdate_option( 'beaver_extender_custom_labels', array() );\n\t\t\tupdate_option( 'beaver_extender_custom_conditionals', array() );\n\t\t\tupdate_option( 'beaver_extender_custom_widget_areas', array() );\n\t\t\tupdate_option( 'beaver_extender_custom_hook_boxes', array() );\n\n\t\t\tbeaver_extender_get_custom_css( null, $args = array( 'cached' => false, 'array' => false ) );\n\t\t\t$custom_functions = get_option( 'beaver_extender_custom_functions' );\n\t\t\t$custom_js = get_option( 'beaver_extender_custom_js' );\n\t\t\t$custom_templates = beaver_extender_get_templates();\n\t\t\t$custom_labels = beaver_extender_get_labels();\n\t\t\t$custom_conditionals = beaver_extender_get_conditionals();\n\t\t\t$custom_widgets = beaver_extender_get_widgets();\n\t\t\t$custom_hooks = beaver_extender_get_hooks();\n\n\t\t\tbeaver_extender_write_files( $css = true );\n\t\t?>\n\t\t\t<script type=\"text/javascript\">jQuery(document).ready(function($){ $('#beaver-extender-custom-saved').html('Custom Options Reset').css(\"position\", \"fixed\").fadeIn('slow');window.setTimeout(function(){$('#beaver-extender-custom-saved').fadeOut( 'slow' );}, 2222); });</script>\n\t\t<?php\n\t\t}\n\n\t\tif ( ! empty( $_GET['activetab'] ) ) { ?>\n\t\t\t<script type=\"text/javascript\">jQuery(document).ready(function($) { $('#<?php echo $_GET['activetab']; ?>').click(); });</script>\t\n\t\t<?php\n\t\t} ?>\n\t\t\n\t\t<div id=\"icon-options-general\" class=\"icon32\"></div>\n\t\t\n\t\t<h2 id=\"beaver-extender-admin-heading\"><?php _e( 'Extender - Custom Options', 'extender' ); ?></h2>\n\t\t\n\t\t<div class=\"beaver-extender-css-builder-button-wrap\">\n\t\t\t<span id=\"show-hide-custom-css-builder\" class=\"button\"><?php _e( 'CSS Builder', 'extender' ); ?></span>\n\t\t</div>\n\n\t\t<div class=\"beaver-extender-php-builder-button-wrap\">\n\t\t\t<span id=\"show-hide-custom-php-builder\" class=\"button\"><?php _e( 'PHP Builder', 'extender' ); ?></span>\n\t\t</div>\n\t\t\n\t\t<div id=\"beaver-extender-admin-wrap\">\n\t\t\n\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-css-builder.php' ); ?>\n\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-php-builder.php' ); ?>\n\t\t\t\n\t\t\t<form action=\"/\" id=\"custom-options-form\" name=\"custom-options-form\">\n\t\t\t\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"beaver_extender_custom_options_save\" />\n\t\t\t\t<input type=\"hidden\" name=\"security\" value=\"<?php echo wp_create_nonce( 'custom-options' ); ?>\" />\n\t\t\t\n\t\t\t\t<div id=\"beaver-extender-floating-save\">\n\t\t\t\t\t<input type=\"submit\" value=\"<?php _e( 'Save Changes', 'extender' ); ?>\" name=\"Submit\" alt=\"Save Changes\" class=\"beaver-extender-save-button button button-primary\"/>\n\t\t\t\t\t<img class=\"beaver-extender-ajax-save-spinner\" src=\"<?php echo site_url() . '/wp-admin/images/spinner-2x.gif'; ?>\" />\n\t\t\t\t\t<span class=\"beaver-extender-saved\"></span>\n\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t<div id=\"beaver-extender-custom-options-nav\" class=\"beaver-extender-admin-nav\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li id=\"beaver-extender-custom-options-nav-css\" class=\"beaver-extender-options-nav-all beaver-extender-options-nav-active\"><a href=\"#\">CSS</a></li><li id=\"beaver-extender-custom-options-nav-functions\" class=\"beaver-extender-options-nav-all\"><a href=\"#\">Functions</a></li><li id=\"beaver-extender-custom-options-nav-js\" class=\"beaver-extender-options-nav-all\"><a href=\"#\">JS</a></li><li id=\"beaver-extender-custom-options-nav-templates\" class=\"beaver-extender-options-nav-all\"><a href=\"#\">Templates</a></li><li id=\"beaver-extender-custom-options-nav-labels\" class=\"beaver-extender-options-nav-all\"><a href=\"#\">Labels</a></li><li id=\"beaver-extender-custom-options-nav-conditionals\" class=\"beaver-extender-options-nav-all\"><a href=\"#\">Conditionals</a></li><li id=\"beaver-extender-custom-options-nav-widget-areas\" class=\"beaver-extender-options-nav-all\"><a href=\"#\">Widget Areas</a></li><li id=\"beaver-extender-custom-options-nav-hook-boxes\" class=\"beaver-extender-options-nav-all\"><a class=\"beaver-extender-options-nav-last\" href=\"#\">Hook Boxes</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class=\"beaver-extender-custom-options-wrap\">\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-css.php' ); ?>\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-functions.php' ); ?>\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-js.php' ); ?>\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-templates.php' ); ?>\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-labels.php' ); ?>\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-conditionals.php' ); ?>\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-widget-areas.php' ); ?>\n\t\t\t\t\t<?php require_once( BBEXT_PATH . 'lib/admin/boxes/custom-hook-boxes.php' ); ?>\n\t\t\t\t</div>\n\t\t\t\n\t\t\t</form>\n\n\t\t\t<div id=\"beaver-extender-admin-footer\">\n\t\t\t\t<p>\n\t\t\t\t\t<a href=\"https://cobaltapps.com\" target=\"_blank\">CobaltApps.com</a> | <a href=\"http://extenderdocs.cobaltapps.com/\" target=\"_blank\">Docs</a> | <a href=\"https://cobaltapps.com/my-account/\" target=\"_blank\">My Account</a> | <a href=\"https://cobaltapps.com/forum/\" target=\"_blank\">Community Forum</a> | <a href=\"https://cobaltapps.com/affiliates/\" target=\"_blank\">Affiliates</a> ·\n\t\t\t\t\t<a><span id=\"show-options-reset\" class=\"beaver-extender-options-reset-button button\" style=\"margin:0; float:none !important;\"><?php _e( 'Custom Options Reset', 'extender' ); ?></span></a><a href=\"http://extenderdocs.cobaltapps.com/article/156-custom-options-reset\" class=\"tooltip-mark\" target=\"_blank\">[?]</a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div style=\"display:none; width:160px; border:none; background:none; margin:0 auto; padding:0; float:none; position:inherit;\" id=\"show-options-reset-box\" class=\"beaver-extender-custom-fonts-box\">\n\t\t\t\t<form style=\"float:left;\" id=\"beaver-extender-reset-custom-options\" method=\"post\">\n\t\t\t\t\t<input style=\"background:#D54E21; width:160px !important; color:#FFFFFF !important; -webkit-box-shadow:none; box-shadow:none;\" type=\"submit\" value=\"<?php _e( 'Reset Custom Options', 'extender' ); ?>\" class=\"beaver-extender-reset button\" name=\"Submit\" onClick='return confirm(\"<?php _e( 'Are you sure your want to reset your Beaver Extender Custom Options?', 'extender' ); ?>\")'/><input type=\"hidden\" name=\"action\" value=\"reset\" />\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t</div> <!-- Close Wrap -->\n<?php\n}",
"function ot_after_save($options) {\r\n\t\t$clones = $options;\r\n\t\t$used_shortcodes = array();\r\n\t\t$global_css = '';\r\n\t\tforeach($options as $key => $val){\r\n\t\t\tif($key == 'archives_footer_cta_content'){\r\n\r\n\t\t\t\t$replacements = array();\r\n\t\t\t\t$css = $this->cactus_parse_inlinecss($val, $used_shortcodes, $replacements);\r\n\r\n\t\t\t\tif($css != ''){\r\n\r\n\t\t\t\t\t$new_val = $val;\r\n\t\t\t\t\tforeach($replacements as $replace){\r\n\t\t\t\t\t\t$new_val = str_replace($replace[0], $replace[1], $new_val);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$global_css .= ';' . $css;\r\n\t\t\t\t\t$clones[$key] = $new_val;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(startsWith($global_css,';')){\r\n\t\t\t$global_css = substr($global_css,1);\r\n\t\t}\r\n\r\n\t\t$shortcodes = get_option('ct_shortcodes_used_in_ot');\r\n\t\tif(!isset($shortcodes) || !is_array($shortcodes)){\r\n\t\t\tadd_option('ct_shortcodes_used_in_ot', array());\r\n\t\t}\r\n\r\n\t\t$shortcodes = $used_shortcodes;\r\n\t\tupdate_option('ct_shortcodes_used_in_ot', $shortcodes);\r\n\r\n\r\n\t\t// update global custom CSS in theme options, to be called in every pages\r\n\t\t$global_custom_css = get_option('ct_ot_custom_css');\r\n\t\tif(!isset($global_custom_css) || !is_array($global_custom_css)){\r\n\t\t\tadd_option('ct_ot_custom_css', '');\r\n\t\t}\r\n\r\n\t\t$global_custom_css = $global_css;\r\n\t\tupdate_option('ct_ot_custom_css', $global_custom_css);\r\n\r\n\t\tupdate_option(ot_options_id(), $clones);\r\n\r\n\t}",
"function save_meta_options( $postID ){\n\t\t$post = $_POST;\n\t\tif((isset($post['update']) || isset($post['save']) || isset($post['publish']))){\n\n\n\t\t\t$user_template = (isset($post['pagelines_template'])) ? $post['pagelines_template'] : '';\n\n\t\t\tif($user_template != ''){\n\n\t\t\t\t$set = pl_meta($postID, PL_SETTINGS);\n\t\t\t\t\n\t\t\t\t$set['draft']['page-template'] = $user_template; \n\t\t\t\t$set['live']['page-template'] = $user_template; \n\t\t\t\t\n\t\t\t\tpl_meta_update($postID, PL_SETTINGS, $set);\n\t\t\t}\n\n\n\t\t}\n\t}",
"function cinerama_edge_save_options() {\n\t\tglobal $cinerama_edge_global_options;\n\n\t\tif ( current_user_can( 'administrator' ) ) {\n\t\t\t$_REQUEST = stripslashes_deep( $_REQUEST );\n\n\t\t\tunset( $_REQUEST['action'] );\n\n\t\t\tcheck_ajax_referer( 'edgtf_ajax_save_nonce', 'edgtf_ajax_save_nonce' );\n\n\t\t\t$cinerama_edge_global_options = array_merge( $cinerama_edge_global_options, $_REQUEST );\n\n\t\t\tupdate_option( 'edgtf_options_cinerama', $cinerama_edge_global_options );\n\n\t\t\tdo_action( 'cinerama_edge_action_after_theme_option_save' );\n\t\t\techo esc_html__( 'Saved', 'cinerama' );\n\n\t\t\tdie();\n\t\t}\n\t}",
"protected function _afterSave()\r\n {\r\n // invoke parent method\r\n parent::_afterSave();\r\n // check if package is new\r\n if ($this->_isNew == true) {\r\n // initialize the options\r\n $options = \tarray(\r\n \t\t\t'price'\t\t => 0,\r\n \t\t\t'price_type'\t=> 'fixed'\r\n \t\t);\r\n // load the available subscription information\r\n \t\t$subscriptionTypes = Mage::getModel('channel/subscription_type')\r\n \t\t ->getCollection();\r\n // create the custom options\r\n foreach ($subscriptionTypes as $subscription) {\r\n // initialize the array for the custom options\r\n $values = array();\r\n // set the default values\r\n $options['is_require'] = $subscription->getIsRequired();\r\n $options['type'] = $subscription->getType();\r\n // add the option information\r\n foreach ($subscription->getOptions() as $option) {\r\n $values[] = array(\r\n \t\t\t\t'title'\t\t => $option->getTitle(),\r\n \t\t\t\t'price'\t\t => $option->getPrice(),\r\n \t\t\t\t'price_type'\t=> $option->getPriceType(),\r\n \t\t\t 'sku'\t\t\t=> $option->getSku(),\r\n 'sort_order'\t=> $option->getSortOrder()\r\n \t\t\t);\r\n }\r\n // prepare the custom option\r\n \t$data = Mage::helper('channel')\r\n ->setCustomOption(\r\n $this->getId(),\r\n $subscription->getTitle(),\r\n $options,\r\n $values\r\n );\r\n // attache the custom option to the package\r\n \t\t$option = Mage::getModel('catalog/product_option')\r\n \t\t ->setData($data)\r\n \t\t ->setProduct($this)\r\n \t\t ->save();\r\n }\r\n }\r\n }",
"public static function wpabstats_admin_html_save()\n {\n if( isset( $_POST['wpabstats_setting_post'] ) )\n {\n /**\n * GLOBAL ACTIVATION\n */\n delete_option('_wpabstats_active');\n\n $isActive = \"off\";\n\n if( isset( $_POST['wpabstats_active'] ) ) $isActive = $_POST['wpabstats_active'];\n\n if( $isActive === \"on\" ) add_option( '_wpabstats_active', 'on' );\n\n /**\n * WIDGET CHART PAGE VIEW ON DASHBOARD\n */\n delete_option('_wpabstats_chart_page_widget');\n\n $isActive = \"off\";\n\n if( isset( $_POST['wpabstats_chart_page_widget'] ) ) $isActive = $_POST['wpabstats_chart_page_widget'];\n\n if( $isActive === \"on\" ) add_option( '_wpabstats_chart_page_widget', 'on' );\n\n\n /**\n * WIDGET VISITOR VIEW ON DASHBOARD\n */\n delete_option('_wpabstats_visitor_container_widget');\n\n $isActive = \"off\";\n\n if( isset( $_POST['wpabstats_visitor_container_widget'] ) ) $isActive = $_POST['wpabstats_visitor_container_widget'];\n\n if( $isActive === \"on\" ) add_option( '_wpabstats_visitor_container_widget', 'on' );\n\n /**\n * WIDGET CHART ARTICLE VIEW ON DASHBOARD\n */\n delete_option('_wpabstats_chart_article_widget');\n\n $isActive = \"off\";\n\n if( isset( $_POST['wpabstats_chart_article_widget'] ) ) $isActive = $_POST['wpabstats_chart_article_widget'];\n\n if( $isActive === \"on\" ) add_option( '_wpabstats_chart_article_widget', 'on' );\n\n\n /**\n * WIDGET BROWSER VIEW ON DASHBOARD\n */\n delete_option('_wpabstats_browser_widget');\n\n $isActive = \"off\";\n\n if( isset( $_POST['wpabstats_browser_widget'] ) ) $isActive = $_POST['wpabstats_browser_widget'];\n\n if( $isActive === \"on\" ) add_option( '_wpabstats_browser_widget', 'on' );\n }\n }",
"private function _saveQcontrol() {\r\n\r\n }",
"function saveCharSelectorSettingsObject()\n\t{\n\t\tglobal $ilSetting, $ilCtrl, $lng, $tpl;\n\t\t\n\t\trequire_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';\n\t\t$char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_ADMIN);\n\t\t$form = $this->initCharSelectorSettingsForm($char_selector);\n if ($form->checkInput())\n {\n\t\t $char_selector->getFormValues($form);\n\n\t\t $ilSetting->set('char_selector_availability', $char_selector->getConfig()->getAvailability());\n\t\t $ilSetting->set('char_selector_definition', $char_selector->getConfig()->getDefinition());\n\t\t\t\n\t\t ilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t $ilCtrl->redirect($this, \"showCharSelectorSettings\");\n }\n $form->setValuesByPost();\n $tpl->setContent($form->getHTML());\n\t}",
"function customize_save($customizer)\n {\n }",
"function save_option() {\n\t\t\tcheck_ajax_referer('ajax-nonce', 'nonce');\n\t\t\tif (isset($_POST['option']) && isset($_POST['value'])) {\n\t\t\t\tupdate_option($_POST['option'], stripslashes($_POST['value']));\n\t\t\t\techo 'saved';\n\t\t\t} else {\n\t\t\t\techo 'notsaved';\n\t\t\t}\n\t\t\tdie();\n\t\t}",
"protected function _beforeSave()\n {\n $this->cleanCache();\n $this->setTypeHasOptions(false);\n $this->setTypeHasRequiredOptions(false);\n\n $this->getTypeInstance(true)->beforeSave($this);\n\n $hasOptions = false;\n $hasRequiredOptions = false;\n\n /**\n * $this->_canAffectOptions - set by type instance only\n * $this->getCanSaveCustomOptions() - set either in controller when \"Custom Options\" ajax tab is loaded,\n * or in type instance as well\n */\n $this->canAffectOptions($this->_canAffectOptions && $this->getCanSaveCustomOptions());\n if ($this->getCanSaveCustomOptions()) {\n $options = $this->getProductOptions();\n if (is_array($options)) {\n $this->setIsCustomOptionChanged(true);\n foreach ($this->getProductOptions() as $option) {\n $this->getOptionInstance()->addOption($option);\n if ((!isset($option['is_delete'])) || $option['is_delete'] != '1') {\n if (!empty($option['file_extension'])) {\n $fileExtension = $option['file_extension'];\n if (0 !== strcmp($fileExtension, Mage::helper('core')->removeTags($fileExtension))) {\n Mage::throwException(Mage::helper('catalog')->__('Invalid custom option(s).'));\n }\n }\n $hasOptions = true;\n }\n }\n foreach ($this->getOptionInstance()->getOptions() as $option) {\n if ($option['is_require'] == '1') {\n $hasRequiredOptions = true;\n break;\n }\n }\n }\n }\n\n /**\n * Set true, if any\n * Set false, ONLY if options have been affected by Options tab and Type instance tab\n */\n if ($hasOptions || (bool)$this->getTypeHasOptions()) {\n $this->setHasOptions(true);\n if ($hasRequiredOptions || (bool)$this->getTypeHasRequiredOptions()) {\n $this->setRequiredOptions(true);\n } elseif ($this->canAffectOptions()) {\n $this->setRequiredOptions(false);\n }\n } elseif ($this->canAffectOptions()) {\n $this->setHasOptions(false);\n $this->setRequiredOptions(false);\n }\n parent::_beforeSave();\n }",
"function widget_opml_browser_init() {\r\n\t\r\n\t// Check for the required API functions\r\n\tif ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )\r\n\t\treturn;\r\n\r\n\t// This saves options and prints the widget's config form.\r\n\tfunction widget_opml_browser_control($number) {\r\n\r\n $options = $newoptions = get_option('widget_opml_browser');\r\n if ( $_POST[\"opml-browser-submit-$number\"] ) {\r\n $newoptions[$number]['title'] = strip_tags(stripslashes($_POST[\"opml-browser-title-$number\"]));\r\n $newoptions[$number]['opmlurl'] = $_POST[\"opml-browser-opmlurl-$number\"];\r\n $newoptions[$number]['opmlpath'] = $_POST[\"opml-browser-opmlpath-$number\"];\r\n $newoptions[$number]['opmltitle'] = $_POST[\"opml-browser-opmltitle-$number\"];\r\n\t $newoptions[$number]['imageurl'] = $_POST[\"opml-browser-imageurl-$number\"];\r\n $newoptions[$number]['monda'] = $_POST[\"opml-browser-monda-$number\"];\r\n $newoptions[$number]['reqhtml'] = $_POST[\"opml-browser-reqhtml-$number\"];\r\n $newoptions[$number]['reqfeed'] = $_POST[\"opml-browser-reqfeed-$number\"];\r\n $newoptions[$number]['noself'] = $_POST[\"opml-browser-noself-$number\"];\r\n $newoptions[$number]['opmllink'] = $_POST[\"opml-browser-opmllink-$number\"];\r\n $newoptions[$number]['showfolders'] = $_POST[\"opml-browser-showfolders-$number\"];\r\n $newoptions[$number]['closeall'] = $_POST[\"opml-browser-closeall-$number\"];\r\n\t $newoptions[$number]['sortitems'] = $_POST[\"opml-browser-sortitems-$number\"];\r\n\t $newoptions[$number]['flatten'] = $_POST[\"opml-browser-flatten-$number\"];\r\n\t $newoptions[$number]['tooltips'] = $_POST[\"opml-browser-tooltips-$number\"];\r\n $newoptions[$number]['indent'] = $_POST[\"opml-browser-indent-$number\"];\r\n\t $newoptions[$number]['credit'] = $_POST[\"opml-browser-credit-$number\"];\r\n wp_cache_delete(\"opml-browser-content-$number\");\r\n }\r\n if ( $options != $newoptions ) {\r\n $options = $newoptions;\r\n update_option('widget_opml_browser', $options);\r\n }\r\n $browser = new OpmlBrowser();\r\n ?>\r\n\t<div style=\"text-align:right\">\r\n\t <label for=\"opml-browser-title-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Widget title: <input type=\"text\" id=\"opml-browser-title-<?php echo $number; ?>\" name=\"opml-browser-title-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo htmlspecialchars($options[$number]['title'], ENT_COMPAT, \"UTF-8\", false); ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-opmlurl-<?php echo $number; ?>\" style=\"display:block\">\r\n\t OPML URL: <input type=\"text\" id=\"opml-browser-opmlurl-<?php echo $number; ?>\" name=\"opml-browser-opmlurl-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['opmlurl']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-opmlpath-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Local path: <input type=\"text\" id=\"opml-browser-opmlpath-<?php echo $number; ?>\" name=\"opml-browser-opmlpath-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['opmlpath']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-opmltitle-<?php echo $number; ?>\" style=\"display:block\">\r\n\t OPML title override: <input type=\"text\" id=\"opml-browser-opmltitle-<?php echo $number; ?>\" name=\"opml-browser-opmltitle-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['opmltitle']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-imageurl-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Image URL: <input type=\"text\" id=\"opml-browser-imageurl-<?php echo $number; ?>\" name=\"opml-browser-imageurl-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['imageurl']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-monda-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Use rss.png from wp-includes/images (Monda option)? <input type=\"checkbox\" id=\"opml-browser-monda-<?php echo $number; ?>\" name=\"opml-browser-monda-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['monda'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-reqhtml-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Exclude if no HTML link? <input type=\"checkbox\" id=\"opml-browser-reqhtml-<?php echo $number; ?>\" name=\"opml-browser-reqhtml-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['reqhtml'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-reqfeed-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Exclude if no feed link? <input type=\"checkbox\" id=\"opml-browser-reqfeed-<?php echo $number; ?>\" name=\"opml-browser-reqfeed-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['reqfeed'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-noself-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Exclude <?php echo $browser->host;?>? <input type=\"checkbox\" id=\"opml-browser-noself-<?php echo $number; ?>\" name=\"opml-browser-noself-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['noself'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-opmllink-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Link to OPML? <input type=\"checkbox\" id=\"opml-browser-opmllink-<?php echo $number; ?>\" name=\"opml-browser-opmllink-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['opmllink'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-showfolders-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Show clickable folders for categories? <input type=\"checkbox\" id=\"opml-browser-showfolders-<?php echo $number; ?>\" name=\"opml-browser-showfolders-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['showfolders'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-closeall-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Start with folders closed? <input type=\"checkbox\" id=\"opml-browser-closeall-<?php echo $number; ?>\" name=\"opml-browser-closeall-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['closeall'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-sortitems-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Sort items? <input type=\"checkbox\" id=\"opml-browser-sortitems-<?php echo $number; ?>\" name=\"opml-browser-sortitems-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['sortitems'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n\t <label for=\"opml-browser-flatten-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Flatten hierarchy? <input type=\"checkbox\" id=\"opml-browser-flatten-<?php echo $number; ?>\" name=\"opml-browser-flatten-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['flatten'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n\t <label for=\"opml-browser-tooltips-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Include OPML descriptions as tooltips? <input type=\"checkbox\" id=\"opml-browser-tooltips-<?php echo $number; ?>\" name=\"opml-browser-tooltips-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['tooltips'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-indent-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Left indent (CSS margin) <input type=\"text\", id=\"opml-browser-indent-<?php echo $number; ?>\" name=\"opml-browser-indent-<?php echo $number; ?>\" size=\"10\" value=\"<?php echo $options[$number]['indent']; ?>\" />\r\n\t </label>\r\n\t <label for=\"opml-browser-credit-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Include "Get this widget" link (please)? <input type=\"checkbox\" id=\"opml-browser-credit-<?php echo $number; ?>\" name=\"opml-browser-credit-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['credit'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n\t <input type=\"hidden\" name=\"opml-browser-submit-<?php echo $number; ?>\" id=\"opml-browser-submit-<?php echo $number; ?>\" value=\"1\" />\r\n\t</div>\r\n\t <?php\r\n\t}\r\n \r\n\r\n\t// This prints the widget\r\n\tfunction widget_opml_browser($args, $number = 1) {\r\n \r\n \t extract($args);\r\n\t $defaults = array('title' => 'Blogroll');\r\n\t $options = (array) get_option('widget_opml_browser');\r\n\t\r\n\t foreach ( $defaults as $key => $value )\r\n\t\tif ( !isset($options[$number][$key]) )\r\n\t\t\t$options[$number][$key] = $defaults[$key];\r\n\t\r\n\t echo $before_widget;\r\n\t echo $before_title . $options[$number]['title'] . $after_title;\r\n\t ?>\r\n\r\n <div id=\"opml-browser-box-<?php echo $number; ?>\">\r\n <?php\r\n if ($widget_content = wp_cache_get(\"opml-browser-content-$number\")) {\r\n echo $widget_content; // Found it in the cache\r\n }\r\n else\r\n {\r\n if (isset($options[$number]['opmlpath']) && ($options[$number]['opmlpath'] != ''))\r\n $filename = $options[$number]['opmlpath'];\r\n else\r\n $filename = $options[$number]['opmlurl'];\r\n if (isset($filename) && ($filename != '')) {\r\n $browser = new OpmlBrowser();\r\n $browser->filename = $filename;\r\n if ($options[$number]['opmllink'] == '1')\r\n {\r\n $browser->opmlurl = $options[$number]['opmlurl'];\r\n $browser->opmltitle = $options[$number]['opmltitle'];\r\n }\r\n\t\t\t$imageurl = $options[$number]['imageurl'];\r\n\t\t\tif (isset($imageurl) && ($imageurl != ''))\r\n\t\t\t{\r\n\t\t\t if (substr_compare($imageurl, '/', -1) != 0)\r\n\t\t\t {\r\n\t\t\t $imageurl .= '/';\r\n\t\t\t }\r\n\t\t\t $browser->image_url = $imageurl;\r\n\t\t\t}\r\n\t\t\t$browser->monda = ($options[$number]['monda'] == '1');\r\n $browser->require_html = ($options[$number]['reqhtml'] == '1');\r\n $browser->require_feed = ($options[$number]['reqfeed'] == '1');\r\n $browser->exclude_self = ($options[$number]['noself'] == '1');\r\n\t\t\t$browser->show_folders = ($options[$number]['showfolders'] == '1');\r\n $browser->closeall = ($options[$number]['closeall'] == '1');\r\n $browser->sort_items = ($options[$number]['sortitems'] == '1');\r\n\t\t\t$browser->flatten = ($options[$number]['flatten'] == '1');\r\n\t\t\t$browser->tooltips = ($options[$number]['tooltips'] == '1');\r\n $browser->margin = $options[$number]['indent'];\r\n\t\t\t$browser->credit = ($options[$number]['credit'] == '1');\r\n $browser->name = \"-widget-$number-\";\r\n $widget_content = $browser->render();\r\n\t\t\tif ($browser->credit)\r\n\t\t\t{\r\n\t\t\t $widget_content.= '<div id=\"opml-browser-link-' . $number . '\" class=\"opml-browser-link\"><a href=\"http://chipstips.com/?tag=phpopmlbrowse\">Get this widget</a></div>';\r\n\t\t\t}\r\n echo $widget_content;\r\n wp_cache_add(\"opml-browser-content-$number\", $widget_content);\r\n }\r\n else\r\n {\r\n echo \"<p>OPML URL or file not specified</p>\";\r\n }\r\n }\r\n ?>\r\n </div>\r\n\t <?php\r\n\t\techo $after_widget;\r\n\t}\r\n\r\n function widget_opml_browser_register()\r\n {\r\n // Check for version upgrade\r\n $options = get_option('widget_opml_browser');\r\n $need_update = false;\r\n if (isset($options['version'])) {\r\n $curver = $options['version'];\r\n if ($curver < 1.2) {\r\n $curver = 1.2;\r\n $options['version'] = $curver;\r\n $options[1]['title'] = $options['title'];\r\n $options[1]['opmlurl'] = $options['opmlurl'];\r\n $options[1]['opmlpath'] = $options['opmlpath'];\r\n $options[1]['reqhtml'] = $options['reqhtml'];\r\n $options[1]['reqfeed'] = $options['reqfeed'];\r\n $options[1]['noself'] = $options['noself'];\r\n $options[1]['opmllink'] = $options['opmllink'];\r\n $options[1]['closeall'] = $options['closeall'];\r\n $options[1]['indent'] = $options['indent'];\r\n $options['number'] = 1;\r\n $need_update = true;\r\n }\r\n /* No changes to options between 1.2 and 2.2 */\r\n\t if ($curver < 2.2) {\r\n\t $curver = 2.2;\r\n $options['version'] = $curver;\r\n\t\tfor ($i = 1; $i <= $options['number']; $i++)\r\n\t\t{\r\n\t\t $options[$i]['imageurl'] = get_settings('siteurl') . '/wp-content/plugins/opml-browser/images/';\r\n\t\t $options[$i]['tooltips'] = '1';\r\n\t\t $options[$i]['credit'] = '1';\r\n\t\t}\r\n\t\t$need_update = true;\r\n\t }\r\n\t if ($curver < 2.3) {\r\n\t $curver = 2.3;\r\n\t\t$options['version'] = $curver;\r\n\t\tfor ($i = 1; $i <= $options['number']; $i++)\r\n\t\t{\r\n\t\t $options[$i]['showfolders'] = '1';\r\n\t\t}\r\n\t\t$need_update = true;\r\n\t }\r\n\t if ($curver < 2.4) {\r\n\t $curver = 2.4;\r\n\t\t$options['version'] = $curver;\r\n\t\t$need_update = true;\r\n\t }\r\n }\r\n else {\r\n $curver = 2.4;\r\n $options['version'] = $curver;\r\n\t $options[1]['imageurl'] = get_settings('siteurl') . '/wp-content/plugins/opml-browser/images/';\r\n\t $options[1]['tooltips'] = '1';\r\n $options[1]['indent'] = \"5px\";\r\n\t $options[1]['credit'] = '1';\r\n $need_update = true;\r\n }\r\n\r\n $number = $options['number'];\r\n if ( $number < 1 ) {\r\n $number = 1;\r\n $options['number'] = 1;\r\n $need_update = true;\r\n }\r\n else if ( $number > 9 ) {\r\n $number = 9;\r\n $options['number'] = 9;\r\n $need_update = true;\r\n }\r\n\r\n // Apply any upgrades here by testing $curver and setting $need_update to true\r\n\r\n if ($need_update)\r\n update_option('widget_opml_browser', $options);\r\n\r\n for ($i = 1; $i <= 9; $i++) {\r\n $name = array('opml-browser %s', null, $i);\r\n register_sidebar_widget($name, $i <= $number ? 'widget_opml_browser' : /* unregister */ '', $i);\r\n register_widget_control($name, $i <= $number ? 'widget_opml_browser_control' : /* unregister */ '', 550, 500, $i);\r\n }\r\n add_action('sidebar_admin_setup', 'widget_opml_browser_setup');\r\n add_action('sidebar_admin_page', 'widget_opml_browser_page');\r\n\r\n // add the Link to the OPML file For Autodiscovery\r\n add_action('wp_head', 'opml_browser_head');\t\r\n\r\n // Add a filter for embedded browsers in content\r\n add_filter('the_content', 'opml_browser_content_filter');\r\n }\r\n\r\n function widget_opml_browser_setup() {\r\n $options = $newoptions = get_option('widget_opml_browser');\r\n if ( isset($_POST['opml-browser-number-submit']) ) {\r\n $number = (int) $_POST['opml-browser-number'];\r\n if ( $number > 9 ) $number = 9;\r\n else if ( $number < 1 ) $number = 1;\r\n $newoptions['number'] = $number;\r\n }\r\n if ( $options != $newoptions ) {\r\n $options = $newoptions;\r\n update_option('widget_opml_browser', $options);\r\n widget_opml_browser_register();\r\n }\r\n }\r\n\r\n function widget_opml_browser_page() {\r\n $options = $newoptions = get_option('widget_opml_browser');\r\n?>\r\n\t<div class=\"wrap\">\r\n\t\t<form method=\"POST\">\r\n\t\t\t<h2>OPML Browser Widgets</h2>\r\n\t\t\t<p><?php _e('How many opml-browser widgets would you like?'); ?>\r\n\t\t\t<select id=\"opml-browser-number\" name=\"opml-browser-number\" value=\"<?php echo $options['number']; ?>\">\r\n<?php for ( $i = 1; $i < 10; ++$i ) echo \"<option value='$i' \".($options['number']==$i ? \"selected='selected'\" : '').\">$i</option>\"; ?>\r\n\t\t\t</select>\r\n\t\t\t<span class=\"submit\"><input type=\"submit\" name=\"opml-browser-number-submit\" id=\"opml-browser-number-submit\" value=\"<?php _e('Save'); ?>\" /></span></p>\r\n\t\t</form>\r\n\t</div>\r\n<?php\r\n }\r\n\r\n function opml_browser_head(){\r\n $options = (array) get_option('widget_opml_browser');\r\n $number = $options['number'];\r\n for ($i = 1; $i <= 9; $i++) {\r\n $opmlurl = $options[$i]['opmlurl'];\r\n if (isset($opmlurl) && $opmlurl != '')\r\n echo ' <link rel=\"outline\" type=\"text/x-opml\" title=\"OPML\" href=\"'.$opmlurl.'\" />';\r\n }\r\n\t$filepath = get_settings('siteurl') . '/wp-content/plugins/opml-browser/';\r\n\t$filebase = $filepath . 'opml-browser.';\r\n // Link our JavaScript\r\n\techo '<script language=\"javascript\" type=\"text/javascript\" src=\"' . $filebase . 'js\"></script>';\r\n\t// and our stylesheet\r\n\techo '<link rel=\"StyleSheet\" type=\"text/css\" href=\"' . $filebase . 'css\"/>';\r\n\t// Set the image URL for JavaScript\r\n\techo '<script language=\"javascript\" type=\"text/javascript\">opml_browser.image_url = \\'' .\r\n\t\t$filepath . 'images\\';</script>';\r\n }\r\n\r\n function opml_browser_content_filter($text) {\r\n $textarray = preg_split(\"/(\\[opml-browser.*\\])/sU\", $text, -1, PREG_SPLIT_DELIM_CAPTURE);\r\n $limit = count($textarray);\r\n $output = '';\r\n for ($i = 0; $i < $limit; $i++) {\r\n $content = $textarray[$i];\r\n if (preg_match(\"/\\[opml-browser(.*)\\]/sU\", $content, $bcode)) {\r\n $bcode = $bcode[1];\r\n $bcode = preg_replace(array('/\\”/','/\\″/'), '\"', $bcode, -1);\r\n $browser = new OpmlBrowser();\r\n $browser->opmlurl = parse_attribute_value($bcode, \"opmlurl\");\r\n $browser->filename = parse_attribute_value($bcode, \"filename\");\r\n if (is_null($browser->filename) || $browser->filename == '') {\r\n $browser->filename = $browser->opmlurl;\r\n }\r\n if (parse_attribute_value($bcode, \"link_opml\") != \"1\") {\r\n $browser->opmlurl = null;\r\n }\r\n $browser->opmltitle = parse_attribute_value($bcode, 'opmltitle');\r\n\t\t$imageurl = parse_attribute_value($bcode, 'imageurl');\r\n\t\tif (isset($imageurl) && ($imageurl != ''))\r\n\t\t{\r\n\t\t if (substr_compare($imageurl, '/', -1) != 0)\r\n\t\t {\r\n\t\t $imageurl .= '/';\r\n\t\t }\r\n\t\t $browser->image_url = $imageurl;\r\n\t\t}\r\n\t\t$browser->monda = (parse_attribute_value($bcode, 'monda') == '1');\r\n $browser->require_html = (parse_attribute_value($bcode, 'require_html') == '1');\r\n $browser->require_feed = (parse_attribute_value($bcode, 'require_feed') == '1');\r\n $browser->exclude_self = (parse_attribute_value($bcode, 'exclude_self') == '1');\r\n $browser->show_folders = (parse_attribute_value($bcode, 'show_folders') != '0');\r\n $browser->closeall = (parse_attribute_value($bcode, 'closeall') == '1');\r\n\t\t$browser->sort_items = (parse_attribute_value($bcode, 'sort') == '1');\r\n\t\t$browser->flatten = (parse_attribute_value($bcode, 'flatten') == '1');\r\n\t\t$browser->tooltips = (parse_attribute_value($bcode, 'tooltips') != '0');\r\n $browser->margin = parse_attribute_value($bcode, 'margin');\r\n\t\t$browser->credit = (parse_attribute_value($bcode, 'credit') != '0');\r\n $browser->name = parse_attribute_value($bcode, 'name');\r\n $output .= $browser->render();\r\n }\r\n else\r\n $output .= $content;\r\n }\r\n return $output;\r\n }\r\n\r\n widget_opml_browser_register();\r\n}",
"function save_admin_options()\n {\n return update_option($this->options_name, $this->options);\n }",
"function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}",
"function wdm_add_widget_menu_callback() {\n\n\n\t\t$saved = false;\n\t\tif ( isset( $_POST[ 'uploadcare_hidden' ] ) && $_POST[ 'uploadcare_hidden' ] == 'Y' ) {\n\t\t\tif ( isset( $_POST[ 'uploadcare_public' ] ) ) {\n\t\t\t\t$uploadcare_public = $_POST[ 'uploadcare_public' ];\n\t\t\t\tupdate_option( 'uploadcare_public', $uploadcare_public );\n\t\t\t} else {\n\t\t\t\t$uploadcare_public = \"\";\n\t\t\t}\n\t\t\t$uploadcare_secret = $_POST[ 'uploadcare_secret' ];\n\t\t\tupdate_option( 'uploadcare_secret', $uploadcare_secret );\n\n\t\t\t$uploadcare_locale = $_POST[ 'uploadcare_locale' ];\n\t\t\tupdate_option( 'uploadcare_locale', $uploadcare_locale );\n\n\t\t\t$uploadcare_js = stripslashes( $_POST[ 'uploadcare_js' ] );\n\t\t\t//$uploadcare_js= array('wdm_js'=>$uploadcare_js);\n\t\t\tupdate_option( 'uploadcare_js', $uploadcare_js );\n\n\t\t\t$saved = true;\n\t\t} else {\n\t\t\t$uploadcare_public\t = get_option( 'uploadcare_public' );\n\t\t\t$uploadcare_secret\t = get_option( 'uploadcare_secret' );\n\t\t\t$uploadcare_locale\t = get_option( 'uploadcare_locale' );\n\t\t\t$uploadcare_js\t\t = stripslashes( get_option( 'uploadcare_js', true ) );\n\n\t\t}\n\t\t?>\n\n\t\t<?php if ( $saved ): ?>\n\t\t\t<div class=\"updated\"><p><strong><?php _e( 'Options saved.' ); ?></strong></p></div>\n\t\t<?php endif; ?>\n\n\n\n\t\t<div class=\"wrap\">\n\t\t\t<div id=\"icon-options-general\" class=\"icon32\"><br></div>\n\t\t<?php echo \"<h2>\" . __( 'Uploadcare', 'uploadcare_settings' ) . \"</h2>\"; ?>\n\t\t\t<form name=\"oscimp_form\" method=\"post\" action=\"<?php echo str_replace( '%7E', '~', $_SERVER[ 'REQUEST_URI' ] ); ?>\">\n\t\t\t\t<input type=\"hidden\" name=\"uploadcare_hidden\" value=\"Y\">\n\t\t\t\t<h3>API Keys <a href=\"https://uploadcare.com/documentation/keys/\">[?]</a></h3>\n\t\t\t\t<p>\n\t\t<?php _e( 'Public key: ' ); ?>\n\t\t\t\t\t<input type=\"text\" name=\"uploadcare_public\" value=\"<?php echo $uploadcare_public; ?>\" size=\"20\">\n\t\t<?php _e( 'ex: demopublickey' ); ?>\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t<?php _e( \"Secret key: \" ); ?>\n\t\t\t\t\t<input type=\"text\" name=\"uploadcare_secret\" value=\"<?php echo $uploadcare_secret; ?>\" size=\"20\">\n\t\t<?php _e( 'ex: demoprivatekey' ); ?>\n\t\t\t\t</p>\n\t\t\t\t<p>\n\t\t<?php _e( \"Uploadcare Locale: \" ); ?>\n\t\t\t\t\t<input type=\"text\" name=\"uploadcare_locale\" value=\"<?php echo $uploadcare_locale; ?>\" size=\"20\">\n\t\t\t\t\tYou can get your Locale name <a href=\"http://www.lingoes.net/en/translator/langcode.htm\">here</a>\n\t\t\t\t</p>\n\n\t\t\t\t<h3>Enter your JS code </h3>\n\t\t\t\t<textarea rows=\"5\" cols=\"50\" name=\"uploadcare_js\"><?php echo $uploadcare_js; ?></textarea>\n\n\t\t\t\t<p class=\"submit\">\n\t\t\t\t\t<?php submit_button(); ?>\n\t\t\t\t</p>\n\t\t\t</form>\n\t\t\t<div>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>Files uploaded to demo account (demopublickey) are deleted after some time.</li>\n\t\t\t\t\t<li>You can get your own account <a href=\"https://uploadcare.com/pricing/\">here</a>.</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}",
"public function save_settings( $settings ) {\n\t\t$settings['_multiwidget'] = 1;\n\t\tupdate_option( $this->option_name, $settings );\n\t}",
"public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\t}",
"protected function _afterSave()\n {\n if ($this->isValueChanged()) {\n Mage::getModel('core/design_package')->cleanMergedJsCss();\n }\n }",
"function widget_opml_browser_control($number) {\r\n\r\n $options = $newoptions = get_option('widget_opml_browser');\r\n if ( $_POST[\"opml-browser-submit-$number\"] ) {\r\n $newoptions[$number]['title'] = strip_tags(stripslashes($_POST[\"opml-browser-title-$number\"]));\r\n $newoptions[$number]['opmlurl'] = $_POST[\"opml-browser-opmlurl-$number\"];\r\n $newoptions[$number]['opmlpath'] = $_POST[\"opml-browser-opmlpath-$number\"];\r\n $newoptions[$number]['opmltitle'] = $_POST[\"opml-browser-opmltitle-$number\"];\r\n\t $newoptions[$number]['imageurl'] = $_POST[\"opml-browser-imageurl-$number\"];\r\n $newoptions[$number]['monda'] = $_POST[\"opml-browser-monda-$number\"];\r\n $newoptions[$number]['reqhtml'] = $_POST[\"opml-browser-reqhtml-$number\"];\r\n $newoptions[$number]['reqfeed'] = $_POST[\"opml-browser-reqfeed-$number\"];\r\n $newoptions[$number]['noself'] = $_POST[\"opml-browser-noself-$number\"];\r\n $newoptions[$number]['opmllink'] = $_POST[\"opml-browser-opmllink-$number\"];\r\n $newoptions[$number]['showfolders'] = $_POST[\"opml-browser-showfolders-$number\"];\r\n $newoptions[$number]['closeall'] = $_POST[\"opml-browser-closeall-$number\"];\r\n\t $newoptions[$number]['sortitems'] = $_POST[\"opml-browser-sortitems-$number\"];\r\n\t $newoptions[$number]['flatten'] = $_POST[\"opml-browser-flatten-$number\"];\r\n\t $newoptions[$number]['tooltips'] = $_POST[\"opml-browser-tooltips-$number\"];\r\n $newoptions[$number]['indent'] = $_POST[\"opml-browser-indent-$number\"];\r\n\t $newoptions[$number]['credit'] = $_POST[\"opml-browser-credit-$number\"];\r\n wp_cache_delete(\"opml-browser-content-$number\");\r\n }\r\n if ( $options != $newoptions ) {\r\n $options = $newoptions;\r\n update_option('widget_opml_browser', $options);\r\n }\r\n $browser = new OpmlBrowser();\r\n ?>\r\n\t<div style=\"text-align:right\">\r\n\t <label for=\"opml-browser-title-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Widget title: <input type=\"text\" id=\"opml-browser-title-<?php echo $number; ?>\" name=\"opml-browser-title-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo htmlspecialchars($options[$number]['title'], ENT_COMPAT, \"UTF-8\", false); ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-opmlurl-<?php echo $number; ?>\" style=\"display:block\">\r\n\t OPML URL: <input type=\"text\" id=\"opml-browser-opmlurl-<?php echo $number; ?>\" name=\"opml-browser-opmlurl-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['opmlurl']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-opmlpath-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Local path: <input type=\"text\" id=\"opml-browser-opmlpath-<?php echo $number; ?>\" name=\"opml-browser-opmlpath-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['opmlpath']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-opmltitle-<?php echo $number; ?>\" style=\"display:block\">\r\n\t OPML title override: <input type=\"text\" id=\"opml-browser-opmltitle-<?php echo $number; ?>\" name=\"opml-browser-opmltitle-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['opmltitle']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-imageurl-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Image URL: <input type=\"text\" id=\"opml-browser-imageurl-<?php echo $number; ?>\" name=\"opml-browser-imageurl-<?php echo $number; ?>\" size=\"50\" value=\"<?php echo $options[$number]['imageurl']; ?>\" />\r\n\t </label>\r\n <label for=\"opml-browser-monda-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Use rss.png from wp-includes/images (Monda option)? <input type=\"checkbox\" id=\"opml-browser-monda-<?php echo $number; ?>\" name=\"opml-browser-monda-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['monda'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-reqhtml-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Exclude if no HTML link? <input type=\"checkbox\" id=\"opml-browser-reqhtml-<?php echo $number; ?>\" name=\"opml-browser-reqhtml-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['reqhtml'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-reqfeed-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Exclude if no feed link? <input type=\"checkbox\" id=\"opml-browser-reqfeed-<?php echo $number; ?>\" name=\"opml-browser-reqfeed-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['reqfeed'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-noself-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Exclude <?php echo $browser->host;?>? <input type=\"checkbox\" id=\"opml-browser-noself-<?php echo $number; ?>\" name=\"opml-browser-noself-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['noself'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-opmllink-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Link to OPML? <input type=\"checkbox\" id=\"opml-browser-opmllink-<?php echo $number; ?>\" name=\"opml-browser-opmllink-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['opmllink'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-showfolders-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Show clickable folders for categories? <input type=\"checkbox\" id=\"opml-browser-showfolders-<?php echo $number; ?>\" name=\"opml-browser-showfolders-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['showfolders'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-closeall-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Start with folders closed? <input type=\"checkbox\" id=\"opml-browser-closeall-<?php echo $number; ?>\" name=\"opml-browser-closeall-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['closeall'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-sortitems-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Sort items? <input type=\"checkbox\" id=\"opml-browser-sortitems-<?php echo $number; ?>\" name=\"opml-browser-sortitems-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['sortitems'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n\t <label for=\"opml-browser-flatten-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Flatten hierarchy? <input type=\"checkbox\" id=\"opml-browser-flatten-<?php echo $number; ?>\" name=\"opml-browser-flatten-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['flatten'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n\t <label for=\"opml-browser-tooltips-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Include OPML descriptions as tooltips? <input type=\"checkbox\" id=\"opml-browser-tooltips-<?php echo $number; ?>\" name=\"opml-browser-tooltips-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['tooltips'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n <label for=\"opml-browser-indent-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Left indent (CSS margin) <input type=\"text\", id=\"opml-browser-indent-<?php echo $number; ?>\" name=\"opml-browser-indent-<?php echo $number; ?>\" size=\"10\" value=\"<?php echo $options[$number]['indent']; ?>\" />\r\n\t </label>\r\n\t <label for=\"opml-browser-credit-<?php echo $number; ?>\" style=\"display:block\">\r\n\t Include "Get this widget" link (please)? <input type=\"checkbox\" id=\"opml-browser-credit-<?php echo $number; ?>\" name=\"opml-browser-credit-<?php echo $number; ?>\" value=\"1\" <?php if ($options[$number]['credit'] == '1') { ?>checked=\"true\"<?php } ?> />\r\n\t </label>\r\n\t <input type=\"hidden\" name=\"opml-browser-submit-<?php echo $number; ?>\" id=\"opml-browser-submit-<?php echo $number; ?>\" value=\"1\" />\r\n\t</div>\r\n\t <?php\r\n\t}",
"public function onsave() {\n\n\tif( filter_input( INPUT_POST, 'content' ) ) {\n\t global $post;\n do_shortcode( stripslashes( filter_input( INPUT_POST, 'content' ) ) );\n\t if( isset( $this->shortcode['elements'] ) ) {\n $this->assign_repeatable();\n }\n $meta = get_post_meta( $post->ID, 'pwp_form', true );\n $meta['definition'] = $this->shortcode;\n update_post_meta( $post->ID, 'definition', $meta );\n }\n }",
"static function saveHandlerOptions ()\n {\n // There is no option yet\n return;\n }",
"public function vendorscms_app_save_after(Varien_Event_Observer $observer){\r\n\t\t$app \t\t= $observer->getEvent()->getApp();\r\n\t\t$request \t= $observer->getEvent()->getRequest();\r\n\t\tif($data = $request->getPost()){\r\n\t\t\t/*Save frontend instances*/\r\n\t\t\tif(isset($data['block_app_option'])){\r\n\t\t\t\t$blockAppOptionData = $data['block_app_option'];\r\n\t\t\t\t\r\n\t\t\t\t$option = Mage::getModel('vendorscms/appoption');\r\n\t\t\t\t$data = array(\r\n\t\t\t\t\t'app_id'\t=> $app->getId(),\r\n\t\t\t\t\t'code'\t\t=> 'block_app_option',\r\n\t\t\t\t);\r\n\t\t\t\t$option->setData($data);\r\n\t\t\t\tif($blockAppOptionData['option_id']){\r\n\t\t\t\t\t$option->setId($blockAppOptionData['option_id']);\r\n\t\t\t\t}\r\n\t\t\t\tunset($blockAppOptionData['option_id']);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t$option->setData('value',json_encode($blockAppOptionData));\r\n\t\t\t\t$option->save();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function siteorigin_panels_save_options(){\n\tif( !current_user_can('manage_options') ) return;\n\tif( empty($_POST['_wpnonce']) || !wp_verify_nonce( $_POST['_wpnonce'], 'save_panels_settings' ) ) return;\n\n\t// Save the post types settings\n\t$post_types = isset( $_POST['siteorigin_panels_post_types'] ) ? array_keys( $_POST['siteorigin_panels_post_types'] ) : array();\n\n\t$settings = isset( $_POST['siteorigin_panels_settings'] ) ? $_POST['siteorigin_panels_settings'] : array();\n\tforeach($settings as $f => $v){\n\t\tswitch($f){\n\t\t\tcase 'inline-css' :\n\t\t\tcase 'responsive' :\n\t\t\tcase 'copy-content' :\n\t\t\tcase 'animations' :\n\t\t\tcase 'bundled-widgets' :\n\t\t\t$settings[$f] = !empty($settings[$f]);\n\t\t\t\tbreak;\n\t\t\tcase 'margin-bottom' :\n\t\t\tcase 'margin-sides' :\n\t\t\tcase 'mobile-width' :\n\t\t\t$settings[$f] = intval($settings[$f]);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Checkbox settings\n\t$settings['responsive'] = !empty($settings['responsive']);\n\t$settings['copy-content'] = !empty($settings['copy-content']);\n\t$settings['animations'] = !empty($settings['animations']);\n\t$settings['inline-css'] = !empty($settings['inline-css']);\n\t$settings['bundled-widgets'] = !empty($settings['bundled-widgets']);\n\n\t// Post type settings\n\t$settings['post-types'] = $post_types;\n\n\tupdate_option('siteorigin_panels_settings', $settings);\n\n\tglobal $siteorigin_panels_settings;\n\t$siteorigin_panels_settings = false;\n}",
"function theme_save_settings()\n\t{\n\t\tglobal $pagenow;\n\t\t\n\t\tif ( $pagenow == 'themes.php' && $_GET['page'] == 'theme-options' )\n\t\t{\n\t\t\tif ( isset ( $_GET['tab'] ) )\n\t\t\t{\n\t\t\t\t$tab = $_GET['tab'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tab = 'general';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tswitch ( $tab )\n\t\t\t{\n\t\t\t\tcase 'general' :\n\t\t\t\t\n\t\t\t\t\tupdate_option( 'logo_image', $_POST['logo_image'] );\n\t\t\t\t\tupdate_option( 'header_background_image', $_POST['header_background_image'] );\n\t\t\t\t\tupdate_option( 'select_text_logo', $_POST['select_text_logo'] );\n\t\t\t\t\tupdate_option( 'theme_site_title', $_POST['theme_site_title'] );\n\t\t\t\t\tupdate_option( 'select_tagline', $_POST['select_tagline'] );\n\t\t\t\t\tupdate_option( 'theme_tagline', $_POST['theme_tagline'] );\n\t\t\t\t\tupdate_option( 'logo_login', $_POST['logo_login'] );\n\t\t\t\t\tupdate_option( 'logo_login_hide', $_POST['logo_login_hide'] );\n\t\t\t\t\tupdate_option( 'favicon', $_POST['favicon'] );\n\t\t\t\t\tupdate_option( 'apple_touch_icon', $_POST['apple_touch_icon'] );\n\t\t\t\t\tupdate_option( 'google_map_api_key', $_POST['google_map_api_key'] );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'style' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'char_set_latin', $_POST['char_set_latin'] );\n\t\t\t\t\tupdate_option( 'char_set_latin_ext', $_POST['char_set_latin_ext'] );\n\t\t\t\t\tupdate_option( 'char_set_cyrillic', $_POST['char_set_cyrillic'] );\n\t\t\t\t\tupdate_option( 'char_set_cyrillic_ext', $_POST['char_set_cyrillic_ext'] );\n\t\t\t\t\tupdate_option( 'char_set_greek', $_POST['char_set_greek'] );\n\t\t\t\t\tupdate_option( 'char_set_greek_ext', $_POST['char_set_greek_ext'] );\n\t\t\t\t\tupdate_option( 'char_set_vietnamese', $_POST['char_set_vietnamese'] );\n\t\t\t\t\tupdate_option( 'extra_font_styles', $_POST['extra_font_styles'] );\n\t\t\t\t\tupdate_option( 'classic_navigation_menu', $_POST['classic_navigation_menu'] );\n\t\t\t\t\tupdate_option( 'mobile_zoom', $_POST['mobile_zoom'] );\n\t\t\t\t\tupdate_option( 'custom_css', $_POST['custom_css'] );\n\t\t\t\t\tupdate_option( 'external_css', $_POST['external_css'] );\n\t\t\t\t\tupdate_option( 'external_js', $_POST['external_js'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'animation' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'classic_layout', $_POST['classic_layout'] );\n\t\t\t\t\tupdate_option( 'mobile_only_classic_layout', $_POST['mobile_only_classic_layout'] );\n\t\t\t\t\tupdate_option( 'pf_details_page_in_animation', $_POST['pf_details_page_in_animation'] );\n\t\t\t\t\tupdate_option( 'pf_details_page_out_animation', $_POST['pf_details_page_out_animation'] );\n\t\t\t\t\tupdate_option( 'pixelwars__ajax', $_POST['pixelwars__ajax'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'blog' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'theme_excerpt', $_POST['theme_excerpt'] );\n\t\t\t\t\tupdate_option( 'pagination', $_POST['pagination'] );\n\t\t\t\t\tupdate_option( 'about_the_author_module', $_POST['about_the_author_module'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'seo' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'theme_og_protocol', $_POST['theme_og_protocol'] );\n\t\t\t\t\tupdate_option( 'theme_seo_fields', $_POST['theme_seo_fields'] );\n\t\t\t\t\tupdate_option( 'site_description', $_POST['site_description'] );\n\t\t\t\t\tupdate_option( 'site_keywords', $_POST['site_keywords'] );\n\t\t\t\t\tupdate_option( 'tracking_code_head', $_POST['tracking_code_head'] );\n\t\t\t\t\tupdate_option( 'tracking_code_body', $_POST['tracking_code_body'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public function save_settings() {\n\n\t\tif ( !isset( $_REQUEST['action'] ) || !isset( $_GET['page'] ) )\n\t\t\treturn;\n\n\t\tif ( 'vfb-settings' !== $_GET['page'] )\n\t\t\treturn;\n\n\t\tif ( 'vfb_settings' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\tcheck_admin_referer( 'vfb-update-settings' );\n\n\t\t$data = array();\n\n\t\tforeach ( $_POST['vfb-settings'] as $key => $val ) {\n\t\t\t$data[ $key ] = esc_html( $val );\n\t\t}\n\n\t\tupdate_option( 'vfb-settings', $data );\n\t}",
"public function save()\n {\n return update_option($this->optionName, $this->settings);\n }",
"function save_widget($instance, $new_instance, $old_instance, $widget)\n {\n }",
"function save_widget($instance, $new_instance, $old_instance, $widget)\n {\n }",
"function theme_save_settings()\n\t{\n\t\tglobal $pagenow;\n\t\t\n\t\tif ( $pagenow == 'themes.php' && $_GET['page'] == 'theme-options' )\n\t\t{\n\t\t\tif ( isset ( $_GET['tab'] ) )\n\t\t\t{\n\t\t\t\t$tab = $_GET['tab'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tab = 'general';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tswitch ( $tab )\n\t\t\t{\n\t\t\t\tcase 'general' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'logo_type', $_POST['logo_type'] );\n\t\t\t\t\tupdate_option( 'select_text_logo', $_POST['select_text_logo'] );\n\t\t\t\t\tupdate_option( 'theme_site_title', $_POST['theme_site_title'] );\n\t\t\t\t\tupdate_option( 'logo_image', $_POST['logo_image'] );\n\t\t\t\t\tupdate_option( 'select_tagline', $_POST['select_tagline'] );\n\t\t\t\t\tupdate_option( 'theme_tagline', $_POST['theme_tagline'] );\n\t\t\t\t\tupdate_option( 'logo_login', $_POST['logo_login'] );\n\t\t\t\t\tupdate_option( 'logo_login_hide', $_POST['logo_login_hide'] );\n\t\t\t\t\tupdate_option( 'favicon', $_POST['favicon'] );\n\t\t\t\t\tupdate_option( 'apple_touch_icon', $_POST['apple_touch_icon'] );\n\t\t\t\t\tupdate_option( 'copyright_text', $_POST['copyright_text'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'style' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'char_set_latin', $_POST['char_set_latin'] );\n\t\t\t\t\tupdate_option( 'char_set_latin_ext', $_POST['char_set_latin_ext'] );\n\t\t\t\t\tupdate_option( 'char_set_cyrillic', $_POST['char_set_cyrillic'] );\n\t\t\t\t\tupdate_option( 'char_set_cyrillic_ext', $_POST['char_set_cyrillic_ext'] );\n\t\t\t\t\tupdate_option( 'char_set_greek', $_POST['char_set_greek'] );\n\t\t\t\t\tupdate_option( 'char_set_greek_ext', $_POST['char_set_greek_ext'] );\n\t\t\t\t\tupdate_option( 'char_set_vietnamese', $_POST['char_set_vietnamese'] );\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'nav_menu_search', $_POST['nav_menu_search'] );\n\t\t\t\t\tupdate_option( 'extra_font_styles', $_POST['extra_font_styles'] );\n\t\t\t\t\tupdate_option( 'footer_widget_locations', $_POST['footer_widget_locations'] );\n\t\t\t\t\tupdate_option( 'footer_widget_columns', $_POST['footer_widget_columns'] );\n\t\t\t\t\tupdate_option( 'mobile_zoom', $_POST['mobile_zoom'] );\n\t\t\t\t\tupdate_option( 'custom_css', $_POST['custom_css'] );\n\t\t\t\t\tupdate_option( 'external_css', $_POST['external_css'] );\n\t\t\t\t\tupdate_option( 'external_js', $_POST['external_js'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'blog' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'blog_type', $_POST['blog_type'] );\n\t\t\t\t\tupdate_option( 'post_sidebar', $_POST['post_sidebar'] );\n\t\t\t\t\tupdate_option( 'theme_excerpt', $_POST['theme_excerpt'] );\n\t\t\t\t\tupdate_option( 'pagination', $_POST['pagination'] );\n\t\t\t\t\tupdate_option( 'all_formats_homepage', $_POST['all_formats_homepage'] );\n\t\t\t\t\tupdate_option( 'about_the_author_module', $_POST['about_the_author_module'] );\n\t\t\t\t\tupdate_option( 'post_share_links_single', $_POST['post_share_links_single'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'portfolio' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'pf_ajax', $_POST['pf_ajax'] );\n\t\t\t\t\tupdate_option( 'pf_item_per_page', $_POST['pf_item_per_page'] );\n\t\t\t\t\tupdate_option( 'pf_content_editor', $_POST['pf_content_editor'] );\n\t\t\t\t\tupdate_option( 'pf_share_links_single', $_POST['pf_share_links_single'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'gallery' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'gl_ajax', $_POST['gl_ajax'] );\n\t\t\t\t\tupdate_option( 'gl_item_per_page', $_POST['gl_item_per_page'] );\n\t\t\t\t\tupdate_option( 'gl_ajax_single', $_POST['gl_ajax_single'] );\n\t\t\t\t\tupdate_option( 'gl_item_per_page_single', $_POST['gl_item_per_page_single'] );\n\t\t\t\t\tupdate_option( 'gl_slideshow_interval_single', $_POST['gl_slideshow_interval_single'] );\n\t\t\t\t\tupdate_option( 'gl_circular_single', $_POST['gl_circular_single'] );\n\t\t\t\t\tupdate_option( 'gl_next_on_click_image_single', $_POST['gl_next_on_click_image_single'] );\n\t\t\t\t\tupdate_option( 'gl_content_editor', $_POST['gl_content_editor'] );\n\t\t\t\t\tupdate_option( 'gl_share_links_single', $_POST['gl_share_links_single'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'sidebar' :\n\t\t\t\t\n\t\t\t\t\tupdate_option( 'no_sidebar_name', esc_attr( $_POST['new_sidebar_name'] ) );\n\t\t\t\t\t\n\t\t\t\t\tif ( esc_attr( $_POST['new_sidebar_name'] ) != \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( get_option( 'sidebars_with_commas' ) == \"\" )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tupdate_option( 'sidebars_with_commas', esc_attr( $_POST['new_sidebar_name'] ) );\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\tupdate_option( 'sidebars_with_commas', get_option( 'sidebars_with_commas' ) . ',' . esc_attr( $_POST['new_sidebar_name'] ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'seo' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'theme_og_protocol', $_POST['theme_og_protocol'] );\n\t\t\t\t\tupdate_option( 'theme_seo_fields', $_POST['theme_seo_fields'] );\n\t\t\t\t\tupdate_option( 'site_description', $_POST['site_description'] );\n\t\t\t\t\tupdate_option( 'site_keywords', $_POST['site_keywords'] );\n\t\t\t\t\tupdate_option( 'tracking_code_head', $_POST['tracking_code_head'] );\n\t\t\t\t\tupdate_option( 'tracking_code', $_POST['tracking_code'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 'contact' :\n\t\t\t\t\t\n\t\t\t\t\tupdate_option( 'map_embed_code', $_POST['map_embed_code'] );\n\t\t\t\t\tupdate_option( 'enable_map', $_POST['enable_map'] );\n\t\t\t\t\tupdate_option( 'contact_form_email', $_POST['contact_form_email'] );\n\t\t\t\t\tupdate_option( 'contact_form_captcha', $_POST['contact_form_captcha'] );\n\t\t\t\t\tupdate_option( 'disable_contact_form', $_POST['disable_contact_form'] );\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t// end switch\n\t\t}\n\t\t// end if\n\t}",
"function widget_text_save_callback() {\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$data = $_POST['data'];\r\n\r\n\t\t$vals = explode('&', $data);\r\n\r\n\t\tforeach($vals as $item){\r\n\t\t\t$arr = explode('=', $item);\r\n\t\t\t$key = urldecode($arr[0]);\r\n\t\t\t$val = urldecode($arr[1]);\r\n\t\t\tif(endsWith($key, '[text]')) {\r\n\t\t\t\t// so this a Text Widget submission, continue to process\r\n\t\t\t\t\r\n\t\t\t\t$used_shortcodes = array();\r\n\t\t\t\t$replacements = array();\r\n\t\t\t\t$css = $this->cactus_parse_inlinecss($val, $used_shortcodes, $replacements);\r\n\t\t\t\t\r\n\t\t\t\tfile_put_contents(dirname(__FILE__) . '/log.txt',$css, FILE_APPEND);\r\n\t\t\t\tif($css != ''){\r\n\t\t\t\t\t$new_val = $val;\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($replacements as $replace){\r\n\t\t\t\t\t\t$new_val = str_replace($replace[0], $replace[1], $new_val);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$widget = str_replace('[text]', '', $key);\r\n\r\n\t\t\t\t\t// update global custom CSS, to be called in every pages\r\n\t\t\t\t\t$global_custom_css = get_option('ct_custom_css');\r\n\t\t\t\t\tif(!isset($global_custom_css) || !is_array($global_custom_css)){\r\n\t\t\t\t\t\t$global_custom_css = array();\r\n\t\t\t\t\t\tadd_option('ct_custom_css', $global_custom_css);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$global_custom_css[$widget] = $css;\r\n\t\t\t\t\tupdate_option('ct_custom_css', $global_custom_css);\r\n\r\n\t\t\t\t\t$shortcodes = get_option('ct_shortcodes_used_in_widgets');\r\n\t\t\t\t\tif(!isset($shortcodes) || !is_array($shortcodes)){\r\n\t\t\t\t\t\t$shortcodes = array();\r\n\t\t\t\t\t\tadd_option('ct_shortcodes_used_in_widgets', $shortcodes);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$shortcodes[$widget] = $used_shortcodes;\r\n\t\t\t\t\tupdate_option('ct_shortcodes_used_in_widgets', $shortcodes);\r\n\r\n\t\t\t\t\tpreg_match('/(.*)\\[(.*)\\]/', $widget, $matches);\r\n\t\t\t\t\t$id_base = substr($matches[1], 7);\r\n\r\n\t\t\t\t\t$widget_options = get_option('widget_' . $id_base);\r\n\r\n\t\t\t\t\t$widget_options[$matches[2]]['text'] = $new_val;\r\n\r\n\t\t\t\t\tupdate_option('widget_' . $id_base, $widget_options);\r\n\r\n\t\t\t\t\t// do this silently. So echo empty;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twp_die(); // this is required to terminate immediately and return a proper response\r\n\t}",
"function lgmac_save_options() {\n\n//var_dump($_POST); die();\n\tif(!current_user_can('publish_pages')) {\n\t\twp_die('Vous n\\'êtes pas autorisé à effectuer cette opération');\n\t}\n\n\tcheck_admin_referer('lgmac_options_verify');\n\n\t$opts = get_option('lgmac_opts');\n\n\t//sauvegarde légende\n\t$opts['legend_01'] = sanitize_text_field($_POST['lgmac_legend_01']);\n\n\t//sauvegarde image\n\t$opts['image_01_url'] = sanitize_text_field($_POST['lgmac_image_url_01']);\n\n\t//valeur de legende dans la bdd\n\tupdate_option('lgmac_opts', $opts);\n\n\t// redirection vers la page des options avec l'url de la page\n\twp_redirect(admin_url('admin.php?page=lgmac_theme_opts&status=1'));\n\texit;\n\n}",
"public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }",
"function _sp_custom_meta_boxes_save( $post_id ) {\n\tglobal $wpdb;\n\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n\t\treturn;\t\t\t\n\t\n\t// Check permissions\n\tif ( ! current_user_can( 'manage_options' ) )\n\t\treturn;\t\n\n\t/////////////////////////////////////////////////////\n\t// wpautop\n\t/////////////////////////////////////////////////////\n\tif ( ! empty( $_POST['_sp_meta_wpautop_nonce'] ) && check_admin_referer( '_sp_process_meta_wpautop', '_sp_meta_wpautop_nonce' ) ) {\n\t\t$wpautop = isset( $_POST['wpautop'] ) && $_POST['wpautop'] === 'on' ? true : false;\n\n\t\tif ( isset( $wpautop ) && $wpautop === true ) \n\t\t\tupdate_post_meta( $post_id, '_sp_disable_wpautop', 'on' );\n\t\telseif ( isset( $wpautop ) && $wpautop !== true )\n\t\t\tupdate_post_meta( $post_id, '_sp_disable_wpautop', 'off' );\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// site layout\n\t/////////////////////////////////////////////////////\n\tif ( ! empty( $_POST['_sp_meta_site_layout_nonce'] ) && check_admin_referer( '_sp_process_meta_site_layout', '_sp_meta_site_layout_nonce' ) ) {\n\t\t/////////////////////////////////////////////////////\n\t\t// custom layout\n\t\t/////////////////////////////////////////////////////\n\t\t$custom_layout = sanitize_text_field( $_POST['custom_layout'] );\n\n\t\tif ( ! empty( $custom_layout ) )\n\t\t\tupdate_post_meta( $post_id, '_sp_custom_layout', $custom_layout );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// disable sitewide widgets\n\t\t/////////////////////////////////////////////////////\n\t\t$disable_sitewide_widgets = isset( $_POST['disable_sitewide_widgets'] ) && $_POST['disable_sitewide_widgets'] === 'on' ? true : false;\n\n\t\tif ( isset( $disable_sitewide_widgets ) && $disable_sitewide_widgets === true )\n\t\t\tupdate_post_meta( $post_id, '_sp_custom_layout_disable_sitewide_widgets', 'on' );\n\t\telse\n\t\t\tupdate_post_meta( $post_id, '_sp_custom_layout_disable_sitewide_widgets', 'off' );\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// blog post featured video\n\t/////////////////////////////////////////////////////\n\tif ( ! empty( $_POST['_sp_post_featured_video_nonce'] ) && check_admin_referer( '_sp_post_featured_video', '_sp_post_featured_video_nonce' ) ) {\n\t\t$featured_video = isset( $_POST['post_featured_video'] ) ? sanitize_text_field( $_POST['post_featured_video'] ) : '';\n\n\t\t// update post meta\n\t\tupdate_post_meta( $post_id, '_sp_post_featured_video', $featured_video );\n\n\t\t$featured_video_poster = isset( $_POST['post_featured_video_poster'] ) ? sanitize_text_field( $_POST['post_featured_video_poster'] ) : '';\n\n\t\t// update post meta\n\t\tupdate_post_meta( $post_id, '_sp_post_featured_video_poster', $featured_video_poster );\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// excerpt truncate settings\n\t/////////////////////////////////////////////////////\t\n\tif ( ! empty( $_POST['_sp_meta_excerpt_truncate_nonce'] ) && check_admin_referer( '_sp_process_meta_excerpt_truncate', '_sp_meta_excerpt_truncate_nonce' ) ) {\n\t\t/////////////////////////////////////////////////////\n\t\t// excerpt truncate\n\t\t/////////////////////////////////////////////////////\t\t\n\t\t$excerpt_truncate = ( ( sanitize_text_field( $_POST['excerpt_truncate'] ) === 'on' ) ? true : false );\n\n\t\tif ( isset( $excerpt_truncate ) && $excerpt_truncate === true ) \n\t\t\tupdate_post_meta( $post_id, '_sp_excerpt_truncate', 'on' );\n\t\telse\n\t\t\tupdate_post_meta( $post_id, '_sp_excerpt_truncate', 'off' );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// excerpt truncate denote\n\t\t/////////////////////////////////////////////////////\n\t\t$truncate_denote = sanitize_text_field( $_POST['truncate_denote'] );\n\n\t\tif ( ! empty( $truncate_denote ) ) \n\t\t\tupdate_post_meta( $post_id, '_sp_truncate_denote', $truncate_denote );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// excerpt truncate count\n\t\t/////////////////////////////////////////////////////\n\t\t$truncate_count = absint( $_POST['truncate_count'] );\n\n\t\tif ( ! empty( $truncate_count ) ) \n\t\t\tupdate_post_meta( $post_id, '_sp_truncate_count', $truncate_count );\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// seo settings\n\t/////////////////////////////////////////////////////\n\tif ( ! empty( $_POST['_sp_meta_seo_settings_nonce'] ) && check_admin_referer( '_sp_process_meta_seo_settings', '_sp_meta_seo_settings_nonce' ) ) {\n\t\t/////////////////////////////////////////////////////\n\t\t// seo description\n\t\t/////////////////////////////////////////////////////\t\t\n\t\t$seo_description = sanitize_text_field( $_POST['seo_description'] );\n\t\t\n\t\tupdate_post_meta( $post_id, '_sp_page_seo_description', $seo_description );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// seo keywords\n\t\t/////////////////////////////////////////////////////\n\t\t$seo_keywords = stripslashes( strip_tags( $_POST['seo_keywords'] ) );\n\n\t\tupdate_post_meta( $post_id, '_sp_page_seo_keywords', $seo_keywords );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// seo title\n\t\t/////////////////////////////////////////////////////\n\t\t$seo_title = stripslashes( strip_tags( $_POST['seo_title'] ) );\n\n\t\tupdate_post_meta( $post_id, '_sp_page_seo_title', $seo_title );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// seo robot\n\t\t/////////////////////////////////////////////////////\n\t\t$seo_robot = stripslashes( strip_tags( $_POST['seo_robot'] ) );\n\n\t\tif ( isset( $seo_robot ) )\n\t\t\tupdate_post_meta( $post_id, '_sp_page_seo_robot', $seo_robot );\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// advanced page options\n\t/////////////////////////////////////////////////////\n\tif ( ! empty( $_POST['_sp_meta_advanced_page_options_nonce'] ) && check_admin_referer( '_sp_process_meta_advanced_page_options', '_sp_meta_advanced_page_options_nonce' ) ) {\n\n\t\t/////////////////////////////////////////////////////\n\t\t// page show title\n\t\t/////////////////////////////////////////////////////\n\t\t$page_show_title = sanitize_text_field( $_POST['page_show_title'] );\n\n\t\tif ( ! empty( $page_show_title ) )\n\t\t\tupdate_post_meta( $post_id, '_sp_page_show_title', $page_show_title );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// page show tagline\n\t\t/////////////////////////////////////////////////////\n\t\t$page_show_tagline = sanitize_text_field( $_POST['page_show_tagline'] );\n\n\t\tif ( ! empty( $page_show_tagline ) )\n\t\t\tupdate_post_meta( $post_id, '_sp_page_show_tagline', $page_show_tagline );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// page tagline text\n\t\t/////////////////////////////////////////////////////\n\t\t$page_tagline_text = sanitize_text_field( $_POST['page_tagline_text'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_page_tagline_text', $page_tagline_text );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// page show share\n\t\t/////////////////////////////////////////////////////\n\t\t$page_show_share = sanitize_text_field( $_POST['page_show_share'] );\n\n\t\tif ( ! empty( $page_show_share ) )\n\t\t\tupdate_post_meta( $post_id, '_sp_page_show_share', $page_show_share );\t\t\t\t\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// slider\n\t/////////////////////////////////////////////////////\n\tif ( get_post_type() === 'sp-slider' && ! empty( $_POST['_sp_meta_slider_settings_nonce'] ) && check_admin_referer( '_sp_process_meta_slider_settings', '_sp_meta_slider_settings_nonce' ) ) {\n\t\t/////////////////////////////////////////////////////\n\t\t// slider type\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_type = sanitize_text_field( $_POST['type'] );\n\n\t\tif ( $slider_type )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_type', $slider_type );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider mode\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_mode = sanitize_text_field( $_POST['mode'] );\n\n\t\tif ( $slider_mode )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_mode', $slider_mode );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider carousel item width\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_carousel_item_width = sanitize_text_field( $_POST['carousel_item_width'] );\n\n\t\tif ( $slider_carousel_item_width )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_carousel_item_width', $slider_carousel_item_width );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider carousel item height\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_carousel_item_height = sanitize_text_field( $_POST['carousel_item_height'] );\n\n\t\tif ( $slider_carousel_item_height )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_carousel_item_height', $slider_carousel_item_height );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider show title\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_show_title = sanitize_text_field( $_POST['show_title'] );\n\n\t\tif ( $slider_show_title )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_show_title', $slider_show_title );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider title text\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_title_text = sanitize_text_field( $_POST['title_text'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_slider_title_text', $slider_title_text );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider title font variant\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_title_font_variant = sanitize_text_field( $_POST['title_font_variant'] );\n\n\t\tif ( $slider_title_font_variant )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_title_font_variant', $slider_title_font_variant );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider title font subset\n\t\t/////////////////////////////////////////////////////\n\t\tif ( ! empty( $_POST['title_font_subset'] ) && is_array( $_POST['title_font_subset'] ) && isset( $_POST['title_font_subset'] ) ) {\n\t\t\t$slider_title_font_subset = $_POST['title_font_subset'];\n\n\t\t\t$slider_title_font_subset = array_map( 'sanitize_text_field', $slider_title_font_subset );\n\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_title_font_subset', $slider_title_font_subset );\t\t\t\n\t\t} else {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_title_font_subset', '' );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider title font\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_title_font = isset( $_POST['title_font'] ) ? sanitize_text_field( $_POST['title_font'] ) : false;\n\n\t\tif ( $slider_title_font ) {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_title_font', $slider_title_font );\t\n\n\t\t\tif ( ! isset( $slider_title_font_subset ) )\n\t\t\t\t$slider_title_font_subset = array();\n\n\t\t\t// save custom fonts into theme data\n\t\t\tsp_save_custom_font_data( array( 'selector' => '.sc-carousel h2.slider-title', 'font' => $slider_title_font, 'variant' => $slider_title_font_variant, 'subset' => $slider_title_font_subset ) );\t\t\n\t\t}\n\t\t\n\t\t/////////////////////////////////////////////////////\n\t\t// slider title color\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_title_color = sanitize_text_field( $_POST['title_color'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_slider_title_color', $slider_title_color );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider title size\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_title_size = str_replace( 'px', '', sanitize_text_field( $_POST['title_size'] ) );\n\n\t\tif ( $slider_title_size )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_title_size', $slider_title_size );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider background color\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_bg_color = sanitize_text_field( $_POST['slider_bg_color'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_slider_bg_color', $slider_bg_color );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider show text overlay\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_show_text_overlay = sanitize_text_field( $_POST['show_text_overlay'] );\n\n\t\tif ( $slider_show_text_overlay )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_show_text_overlay', $slider_show_text_overlay );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider overlay position\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_overlay_position = sanitize_text_field( $_POST['overlay_position'] );\n\n\t\tif ( $slider_overlay_position )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_overlay_position', $slider_overlay_position );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider overlay color\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_overlay_color = sanitize_text_field( $_POST['overlay_color'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_slider_overlay_color', $slider_overlay_color );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider overlay opacity\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_overlay_opacity = sanitize_text_field( $_POST['overlay_opacity'] );\n\n\t\tif ( $slider_overlay_opacity )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_overlay_opacity', $slider_overlay_opacity );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider easing\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_easing = sanitize_text_field( $_POST['easing'] );\n\n\t\tif ( $slider_easing )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_easing', $slider_easing );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider randomize\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_randomize = sanitize_text_field( $_POST['randomize'] );\n\n\t\tif ( $slider_randomize )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_randomize', $slider_randomize );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider autoscroll\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_autoscroll = sanitize_text_field( $_POST['autoscroll'] );\n\n\t\tif ( $slider_autoscroll )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_autoscroll', $slider_autoscroll );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider interval\n\t\t/////////////////////////////////////////////////////\t\t\n\t\t$slider_interval = sanitize_text_field( $_POST['interval'] );\n\n\t\tif ( $slider_interval )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_interval', $slider_interval );\t\t\t\t\t\t\t\t\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider circular\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_circular = sanitize_text_field( $_POST['circular'] );\n\n\t\tif ( $slider_circular )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_circular', $slider_circular );\t\t\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider nav\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_nav = sanitize_text_field( $_POST['nav'] );\n\n\t\tif ( $slider_nav )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_nav', $slider_nav );\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider dot nav\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_dot_nav = sanitize_text_field( $_POST['dot_nav'] );\n\n\t\tif ( $slider_dot_nav )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_dot_nav', $slider_dot_nav );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider pause on hover\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_pause_on_hover = sanitize_text_field( $_POST['pause_on_hover'] );\n\n\t\tif ( $slider_pause_on_hover )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_pause_on_hover', $slider_pause_on_hover );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider items per click\n\t\t/////////////////////////////////////////////////////\t\t\n\t\t$slider_items_per_click = sanitize_text_field( $_POST['items_per_click'] );\n\n\t\tif ( $slider_items_per_click )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_items_per_click', $slider_items_per_click );\t\t\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider transition speed\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_transition_speed = sanitize_text_field( $_POST['transition_speed'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_slider_transition_speed', $slider_transition_speed );\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider reverse direction\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_reverse_direction = sanitize_text_field( $_POST['reverse_direction'] );\n\n\t\tif ( $slider_reverse_direction )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_reverse_direction', $slider_reverse_direction );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider touch swipe\n\t\t/////////////////////////////////////////////////////\t\t\n\t\t$slider_touch_swipe = sanitize_text_field( $_POST['touch_swipe'] );\n\n\t\tif ( $slider_touch_swipe )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_touch_swipe', $slider_touch_swipe );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider items to show\n\t\t/////////////////////////////////////////////////////\t\t\n\t\t$slider_items_to_show = sanitize_text_field( $_POST['items_to_show'] );\n\n\t\tif ( $slider_items_to_show )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_items_to_show', $slider_items_to_show );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider slogan title font variant\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_slogan_title_font_variant = sanitize_text_field( $_POST['slogan_title_font_variant'] );\n\n\t\tif ( $slider_slogan_title_font_variant )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_slogan_title_font_variant', $slider_slogan_title_font_variant );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider slogan title font subset\n\t\t/////////////////////////////////////////////////////\n\t\tif ( ! empty( $_POST['slogan_title_font_subset'] ) && is_array( $_POST['slogan_title_font_subset'] ) && isset( $_POST['slogan_title_font_subset'] ) ) {\n\t\t\t$slider_slogan_title_font_subset = $_POST['slogan_title_font_subset'];\n\n\t\t\t$slider_slogan_title_font_subset = array_map( 'sanitize_text_field', $slider_slogan_title_font_subset );\n\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_slogan_title_font_subset', $slider_slogan_title_font_subset );\t\t\t\n\t\t} else {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_slogan_title_font_subset', '' );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider slogan title font\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_slogan_title_font = isset( $_POST['slogan_title_font'] ) ? sanitize_text_field( $_POST['slogan_title_font'] ) : false;\n\n\t\tif ( $slider_slogan_title_font ) {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_slogan_title_font', $slider_slogan_title_font );\t\n\n\t\t\tif ( ! isset( $slider_slogan_title_font_subset ) )\n\t\t\t\t$slider_slogan_title_font_subset = array();\n\n\t\t\t// save custom fonts into theme data\n\t\t\tsp_save_custom_font_data( array( 'selector' => '.sc-carousel h3.slogan-title', 'font' => $slider_slogan_title_font, 'variant' => $slider_slogan_title_font_variant, 'subset' => $slider_slogan_title_font_subset ) );\t\t\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider content font variant\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_content_font_variant = sanitize_text_field( $_POST['content_font_variant'] );\n\n\t\tif ( $slider_content_font_variant )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_content_font_variant', $slider_content_font_variant );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider slogan title font subset\n\t\t/////////////////////////////////////////////////////\n\t\tif ( ! empty( $_POST['content_font_subset'] ) && is_array( $_POST['content_font_subset'] ) && isset( $_POST['content_font_subset'] ) ) {\n\t\t\t$slider_content_font_subset = $_POST['content_font_subset'];\n\n\t\t\t$slider_content_font_subset = array_map( 'sanitize_text_field', $slider_content_font_subset );\n\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_content_font_subset', $slider_content_font_subset );\t\t\t\n\t\t} else {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_content_font_subset', '' );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider slogan title font\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_content_font = isset( $_POST['content_font'] ) ? sanitize_text_field( $_POST['content_font'] ) : false;\n\n\t\tif ( $slider_content_font ) {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_content_font', $slider_content_font );\n\n\t\t\tif ( ! isset( $slider_content_font_subset ) )\n\t\t\t\t$slider_content_font_subset = array();\n\n\t\t\t// save custom fonts into theme data\n\t\t\tsp_save_custom_font_data( array( 'selector' => '.sc-carousel .textblock p', 'font' => $slider_content_font, 'variant' => $slider_content_font_variant, 'subset' => $slider_content_font_subset ) );\t\t\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider link title font variant\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_link_title_font_variant = sanitize_text_field( $_POST['link_title_font_variant'] );\n\n\t\tif ( $slider_link_title_font_variant )\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_link_title_font_variant', $slider_link_title_font_variant );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider slogan title font subset\n\t\t/////////////////////////////////////////////////////\n\t\tif ( ! empty( $_POST['link_title_font_subset'] ) && is_array( $_POST['link_title_font_subset'] ) && isset( $_POST['link_title_font_subset'] ) ) {\n\t\t\t$slider_link_title_font_subset = $_POST['link_title_font_subset'];\n\n\t\t\t$slider_link_title_font_subset = array_map( 'sanitize_text_field', $slider_link_title_font_subset );\n\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_link_title_font_subset', $slider_link_title_font_subset );\t\t\t\n\t\t} else {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_link_title_font_subset', '' );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// slider slogan title font\n\t\t/////////////////////////////////////////////////////\n\t\t$slider_link_title_font = isset( $_POST['link_title_font'] ) ? sanitize_text_field( $_POST['link_title_font'] ) : false;\n\n\t\tif ( $slider_link_title_font ) {\n\t\t\tupdate_post_meta( $post_id, '_sp_slider_slide_link_title_font', $slider_link_title_font );\n\n\t\t\tif ( ! isset( $slider_link_title_font_subset ) )\n\t\t\t\t$slider_link_title_font_subset = array();\n\t\t\t\n\t\t\t// save custom fonts into theme data\n\t\t\tsp_save_custom_font_data( array( 'selector' => '.sc-carousel .slide a.link-out', 'font' => $slider_link_title_font, 'variant' => $slider_link_title_font_variant, 'subset' => $slider_link_title_font_subset ) );\t\t\n\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// portfolio\n\t/////////////////////////////////////////////////////\n\tif ( get_post_type() === 'sp-portfolio' ) {\n\t\t/////////////////////////////////////////////////////\n\t\t// portfolio sort position\n\t\t/////////////////////////////////////////////////////\n\t\tif ( ! empty( $_POST['_sp_meta_portfolio_sort_position_nonce'] ) && check_admin_referer( '_sp_process_meta_portfolio_sort_position', '_sp_meta_portfolio_sort_position_nonce' ) ) {\n\t\t\t$sort = sanitize_text_field( $_POST['portfolio_sort_position'] );\n\n\t\t\tif ( isset( $sort ) ) \n\t\t\t\tupdate_post_meta( $post_id, '_sp_portfolio_sort_position', $sort );\n\t\t}\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// testimonials\n\t/////////////////////////////////////////////////////\n\tif ( get_post_type() === 'sp-testimonial' && ! empty( $_POST['_sp_meta_testimonial_settings_nonce'] ) && check_admin_referer( '_sp_process_meta_testimonial_settings', '_sp_meta_testimonial_settings_nonce' ) ) {\n\t\t/////////////////////////////////////////////////////\n\t\t// testimonial name\n\t\t/////////////////////////////////////////////////////\n\t\t$testimonial_name = stripslashes( strip_tags( $_POST['testimonial_name'] ) );\n\n\t\tif ( $testimonial_name )\n\t\t\tupdate_post_meta( $post_id, '_sp_testimonial_submitter_name', $testimonial_name );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// testimonial email\n\t\t/////////////////////////////////////////////////////\n\t\t$testimonial_email = stripslashes( strip_tags( $_POST['testimonial_email'] ) );\n\n\t\tif ( $testimonial_email )\n\t\t\tupdate_post_meta( $post_id, '_sp_testimonial_submitter_email', $testimonial_email );\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// contact form settings\n\t/////////////////////////////////////////////////////\n\tif ( get_post_type( $post_id ) === 'sp-contact-form' && ! empty( $_POST['_sp_meta_contact_form_settings_nonce'] ) && check_admin_referer( '_sp_process_meta_contact_form_settings', '_sp_meta_contact_form_settings_nonce' ) ) {\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form email to\n\t\t/////////////////////////////////////////////////////\n\t\t$email_to = sanitize_text_field( $_POST['contact_form_email_to'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_email_to', $email_to );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form email subject\n\t\t/////////////////////////////////////////////////////\n\t\t$email_subject = sanitize_text_field( $_POST['contact_form_email_subject'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_email_subject', $email_subject );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form redirect\n\t\t/////////////////////////////////////////////////////\n\t\t$redirect = sanitize_text_field( $_POST['contact_form_redirect'] );\n\n\t\tif ( isset( $redirect ) ) \n\t\t\tupdate_post_meta( $post_id, '_sp_contact_form_redirect', $redirect );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form redirect url\n\t\t/////////////////////////////////////////////////////\n\t\t$redirect_url = sanitize_text_field( $_POST['contact_form_redirect_url'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_redirect_url', $redirect_url );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form show reset\n\t\t/////////////////////////////////////////////////////\n\t\t$show_reset = sanitize_text_field( $_POST['contact_form_show_reset'] );\n\n\t\tif ( isset( $show_reset ) ) \n\t\t\tupdate_post_meta( $post_id, '_sp_contact_form_show_reset', $show_reset );\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// contact form messages\n\t/////////////////////////////////////////////////////\n\tif ( get_post_type( $post_id ) === 'sp-contact-form' && ! empty( $_POST['_sp_meta_contact_form_messages_nonce'] ) && check_admin_referer( '_sp_process_meta_contact_form_messages', '_sp_meta_contact_form_messages_nonce' ) ) {\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form email header text\n\t\t/////////////////////////////////////////////////////\n\t\t$header_text = sanitize_text_field( $_POST['contact_form_header_text'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_header_text', $header_text );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form submit button text\n\t\t/////////////////////////////////////////////////////\n\t\t$submit_button_text = sanitize_text_field( $_POST['contact_form_submit_button_text'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_submit_button_text', $submit_button_text );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form reset button text\n\t\t/////////////////////////////////////////////////////\n\t\t$reset_button_text = sanitize_text_field( $_POST['contact_form_reset_button_text'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_reset_button_text', $reset_button_text );\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form success message\n\t\t/////////////////////////////////////////////////////\n\t\t$success_message = sanitize_text_field( $_POST['contact_form_success_message'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_success_message', $success_message );\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form failure message\n\t\t/////////////////////////////////////////////////////\n\t\t$failure_message = sanitize_text_field( $_POST['contact_form_failure_message'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_failure_message', $failure_message );\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form required field text\n\t\t/////////////////////////////////////////////////////\n\t\t$required_field_text = sanitize_text_field( $_POST['contact_form_required_field_text'] );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_required_field_text', $required_field_text );\t\t\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form email template\n\t\t/////////////////////////////////////////////////////\n\t\t$email_template = wp_kses_data( strip_tags( $_POST['contact_form_email_template'] ) );\n\n\t\tupdate_post_meta( $post_id, '_sp_contact_form_email_template', $email_template );\t\n\t}\n\n\t/////////////////////////////////////////////////////\n\t// contact form content\n\t/////////////////////////////////////////////////////\n\tif ( get_post_type( $post_id ) === 'sp-contact-form' && ! empty( $_POST['_sp_meta_contact_form_content_nonce'] ) && check_admin_referer( '_sp_process_meta_contact_form_content', '_sp_meta_contact_form_content_nonce' ) ) {\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form field type\n\t\t/////////////////////////////////////////////////////\n\t\t$field_type = $_POST['field_type'];\t\n\t\t\n\t\tarray_walk_recursive( $field_type, 'sp_clean_multi_array' );\n\t\t\n\t\tif ( is_array( $field_type ) && isset( $field_type ) ) {\n\t\t\t$rebuild_arr = array();\n\n\t\t\t$i = 1;\n\t\t\tforeach( $field_type as $type ) {\n\t\t\t\t$rebuild_arr['field_' . $i] = $type;\n\t\t\t\t$i++;\t\n\t\t\t}\t\n\n\t\t\tupdate_post_meta( $post_id, '_sp_contact_form_field_type', $rebuild_arr );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form field options\n\t\t/////////////////////////////////////////////////////\t\t\n\t\t$field_options = isset( $_POST['field_options'] ) ? $_POST['field_options'] : '';\t\n\n\t\tif ( is_array( $field_options ) && isset( $field_options ) ) {\n\t\t\tarray_walk_recursive( $field_options, 'sp_clean_multi_array' );\n\n\t\t\t// prepare the field options\n\t\t\t$merged = array();\n\t\t\t\n\t\t\t// todo: this is messy...gotta be a better way -- can't think right now!\n\t\t\tif ( is_array( $field_options ) ) {\n\t\t\t\tforeach ( $field_options as $a ) {\n\t\t\t\t\tif ( is_array( $a ) ) {\n\t\t\t\t\t\tforeach ( $a as $k => $v ) {\n\t\t\t\t\t\t\tif ( is_array( $v ) ) {\n\t\t\t\t\t\t\t\tforeach ( $v as $v2 ) {\n\t\t\t\t\t\t\t\t\t$merged[$k][] = $v2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$field_options = $merged;\t\t\t\n\t\t\tupdate_post_meta( $post_id, '_sp_contact_form_field_options', $field_options );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form field label\n\t\t/////////////////////////////////////////////////////\n\t\t$field_label = $_POST['field_label'];\t\n\t\t\n\t\tarray_walk_recursive( $field_label, 'sp_clean_multi_array' );\n\n\t\tif ( is_array( $field_label ) && isset( $field_label ) ) {\n\t\t\t$rebuild_arr = array();\n\n\t\t\t$i = 1;\n\t\t\tforeach( $field_label as $label ) {\n\t\t\t\t$rebuild_arr['field_' . $i] = $label;\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\tupdate_post_meta( $post_id, '_sp_contact_form_field_label', $rebuild_arr );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form required field\n\t\t/////////////////////////////////////////////////////\n\t\t$required_field = $_POST['required_field'];\t\n\n\t\tarray_walk_recursive( $required_field, 'sp_clean_multi_array' );\n\n\t\tif ( is_array( $required_field ) && isset( $required_field ) ) {\n\t\t\t$rebuild_arr = array();\n\n\t\t\t$i = 1;\n\t\t\tforeach( $required_field as $required ) {\n\t\t\t\t$rebuild_arr['field_' . $i] = $required;\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\tupdate_post_meta( $post_id, '_sp_contact_form_required_field', $rebuild_arr );\n\t\t}\n\n\t\t/////////////////////////////////////////////////////\n\t\t// contact form unique tag name\n\t\t/////////////////////////////////////////////////////\n\t\t$unique_tag_name = $_POST['unique_tag_name'];\t\n\n\t\tarray_walk_recursive( $unique_tag_name, 'sp_clean_multi_array' );\n\n\t\tif ( is_array( $unique_tag_name ) && isset( $unique_tag_name ) ) {\n\t\t\t$rebuild_arr = array();\n\n\t\t\t$i = 1;\n\t\t\tforeach( $unique_tag_name as $tag_name ) {\n\t\t\t\t$rebuild_arr['field_' . $i] = $tag_name;\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\tupdate_post_meta( $post_id, '_sp_contact_form_unique_tag_name', $rebuild_arr );\n\t\t}\n\t} // contact-form\n\n\t/////////////////////////////////////////////////////\n\t// page builder\n\t/////////////////////////////////////////////////////\n\tif ( isset( $_POST['page_builder_form'] ) && $_POST['page_builder_form'] === 'saving' ) {\n\n\t\t$pb_status = sanitize_text_field( $_POST['pb_status'] );\n\t\tupdate_post_meta( $post_id, '_sp_page_builder_status', $pb_status );\n\n\t\t//$pb_cache = sanitize_text_field( $_POST['pb_cache'] );\n\t\t//update_post_meta( $post_id, '_sp_page_builder_cache', $pb_cache );\n\n\t\t$pb_outer_container_style = sanitize_text_field( $_POST['pb_outer_container_style'] );\n\t\tupdate_post_meta( $post_id, '_sp_page_builder_outer_container_style', $pb_outer_container_style );\n\n\t\t$pb_modules = $_POST['pb'];\n\n\t\tif ( isset( $pb_modules ) ) {\n\t\t\t// clean the input\n\t\t\tarray_walk_recursive( $pb_modules, 'sp_clean_multi_array' );\n\t\t\tupdate_post_meta( $post_id, '_sp_page_builder_modules', base64_encode( maybe_serialize( $pb_modules ) ) );\n\t\t} else {\n\t\t\tupdate_post_meta( $post_id, '_sp_page_builder_modules', '' );\n\t\t}\n\n\t} // page builder\n\n\t/////////////////////////////////////////////////////\n\t// page editor type\n\t/////////////////////////////////////////////////////\n\tif ( isset( $_POST['sp_editor_type'] ) )\n\t\tupdate_post_meta( $post_id, '_sp_page_editor_type', sanitize_text_field( $_POST['sp_editor_type'] ) );\n\n\t/////////////////////////////////////////////////////\n\t// products\n\t/////////////////////////////////////////////////////\n\tif ( get_post_type( $post_id ) === 'product' ) {\n\t\tglobal $wpdb;\n\n\t\t// alternate images\n\t\t$alternate_product_image = isset( $_POST['alternate_product_image'] ) ? $_POST['alternate_product_image'] : '';\n\n\t\t// before update get the image id first\n\t\t$alternate_product_image_id = get_post_meta( $post_id, '_sp_alternate_product_image_id', true );\n\n\t\t// update post meta\n\t\tupdate_post_meta( $post_id, '_sp_alternate_product_image_id', absint( $alternate_product_image ) );\n\n\t\t// remove attachment post parent\n\t\tif ( ( ! isset( $alternate_product_image ) || empty( $alternate_product_image ) ) && isset( $alternate_product_image_id ) )\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET `post_parent` = %d WHERE `ID` = %d\", 0, absint( $alternate_product_image_id ) ) );\n\n\t\t$hover_status = isset( $_POST['alternate_image_hover_status'] ) ? $_POST['alternate_image_hover_status'] : '';\n\n\t\tupdate_post_meta( $post_id, '_sp_alternate_product_image_on_hover_status', $hover_status );\n\n\t\t// custom product tabs\n\t\tif ( ! empty( $_POST['_sp_product_tabs_nonce'] ) && check_admin_referer( '_sp_process_product_tabs', '_sp_product_tabs_nonce' ) ) {\n\t\t\tif ( isset( $_POST['sp_product_tab_name'] ) ) {\n\t\t\t\t$tab_names = $_POST['sp_product_tab_name'];\n\n\t\t\t\t// sanitize\n\t\t\t\tarray_walk_recursive( $tab_names, 'sp_clean_multi_array' );\n\t\t\t} else {\n\t\t\t\t$tab_names = '';\n\t\t\t}\n\n\t\t\tif ( isset( $_POST['sp_product_tinymce_textarea'] ) ) {\n\t\t\t\t$tab_content = $_POST['sp_product_tinymce_textarea'];\n\n\t\t\t\t// sanitize\n\t\t\t\tarray_walk_recursive( $tab_content, 'sp_clean_textarea_multi_array' );\n\t\t\t} else {\n\t\t\t\t$tab_content = '';\n\t\t\t}\n\n\t\t\t// update product meta\n\t\t\tupdate_post_meta( $post_id, '_sp_custom_product_tab_names', $tab_names );\n\t\t\tupdate_post_meta( $post_id, '_sp_custom_product_tab_content', $tab_content );\n\t\t}\n\n\t\t$show_product_description_tab = isset( $_POST['show_product_description_tab'] ) ? sanitize_text_field( $_POST['show_product_description_tab'] ) : '';\n\t\t$show_product_additional_info_tab = isset( $_POST['show_product_additional_info_tab'] ) ? sanitize_text_field( $_POST['show_product_additional_info_tab'] ) : '';\n\t\t$show_product_review_tab = isset( $_POST['show_product_review_tab'] ) ? sanitize_text_field( $_POST['show_product_review_tab'] ) : '';\n\n\t\tupdate_post_meta( $post_id, '_sp_product_description_tab', $show_product_description_tab );\n\t\tupdate_post_meta( $post_id, '_sp_product_additional_info_tab', $show_product_additional_info_tab );\n\t\tupdate_post_meta( $post_id, '_sp_product_review_tab', $show_product_review_tab );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// page show wishlist\n\t\t/////////////////////////////////////////////////////\n\t\t$page_show_wishlist = isset( $_POST['page_show_wishlist'] ) ? sanitize_text_field( $_POST['page_show_wishlist'] ) : null;\n\n\t\tif ( ! empty( $page_show_wishlist ) )\n\t\t\tupdate_post_meta( $post_id, '_sp_page_show_wishlist', $page_show_wishlist );\n\n\t\t/////////////////////////////////////////////////////\n\t\t// page show compare\n\t\t/////////////////////////////////////////////////////\n\t\t$page_show_compare = isset( $_POST['page_show_compare'] ) ? sanitize_text_field( $_POST['page_show_compare'] ) : null;\n\n\t\tif ( ! empty( $page_show_compare ) )\n\t\t\tupdate_post_meta( $post_id, '_sp_page_show_compare', $page_show_compare );\t\t\t\n\t} // products\n\n\t/////////////////////////////////////////////////////\n\t// faq sort order\n\t/////////////////////////////////////////////////////\n\tif ( ! empty( $_POST['_sp_post_faq_order_nonce'] ) && check_admin_referer( '_sp_post_faq_order', '_sp_post_faq_order_nonce' ) ) {\n\t\t$order = isset( $_POST['post_faq_order'] ) && ! empty( $_POST['post_faq_order'] ) ? sanitize_text_field( $_POST['post_faq_order'] ) : '0';\n\n\t\t// update post meta\n\t\tupdate_post_meta( $post_id, '_sp_post_faq_order', $order );\n\t}\n\n\treturn true;\n}",
"function wyz_ajax_business_sidebar_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_business_sidebar_order_data', $form_data ); \n\twp_die();\n}",
"function dynamik_theme_settings_save()\r\n{\r\n\tcheck_ajax_referer( 'theme-settings', 'security' );\r\n\t\r\n\t$update = $_POST['dynamik'];\r\n\tupdate_option( 'dynamik_gen_theme_settings', $update );\r\n\t\r\n\tdynamik_write_files( $css = true, $ez = false, $custom = false );\r\n\tdynamik_protect_folders();\r\n\t\r\n\techo 'Saved!';\r\n\texit();\r\n}",
"public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }",
"public function save_defaults() {\n\n $tmp_options = $this->options;\n\n foreach( $this->pre_fields as $field ) {\n if( ! empty( $field['id'] ) ) {\n $this->options[$field['id']] = $this->get_default( $field, $this->options );\n }\n }\n\n if( $this->args['save_defaults'] && empty( $tmp_options ) ) {\n $this->save_options( $this->options );\n }\n\n }",
"public function Save() {\n\t\t\n\t\tglobal $sql;\n\t\tforeach( $this->settings as $option => $value ) {\n\t\t\t\n\t\t\t$this->update_option( $option, $value, $this->username );\n\t\t}\n\t}",
"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 }",
"function widgetControlOutput( ) {\r\n\t\t\t$options = get_option( 'ILuvWalking.com Widget' );\r\n\t\t\tif( isset( $_POST[ \"iluvwalking-com-submit\" ] ) ) {\r\n\t\t\t\t$options[ 'title' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-title' ] ) );\r\n\t\t\t\t$options[ 'name' ] = strip_tags( stripslashes( $_POST[ 'iluvwalking-com-name' ] ) );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdate_option( 'ILuvWalking.com Widget', $options );\r\n\t\t\t\r\n\t\t\t$title = attribute_escape( $options[ 'title' ] );\r\n\t\t\t$name = attribute_escape( $options[ 'name' ] );\r\n\t\t\t\r\n\t\t\tinclude ( 'views/widget-control.php' );\r\n\t\t}",
"protected function _afterSave()\n {\n $this->getLinkInstance()->saveProductRelations($this);\n $this->getTypeInstance(true)->save($this);\n\n /**\n * Product Options\n */\n $this->getOptionInstance()->setProduct($this)\n ->saveOptions();\n\n return parent::_afterSave();\n }",
"protected function hook_afterSave(){}",
"function genesis_extender_custom_options()\n{\n\tglobal $message;\n\t$custom_functions = get_option( 'genesis_extender_custom_functions' );\n\t$custom_js = get_option( 'genesis_extender_custom_js' );\n\t$custom_templates = genesis_extender_get_templates();\n\t$custom_labels = genesis_extender_get_labels();\n\t$custom_conditionals = genesis_extender_get_conditionals();\n\t$custom_widgets = genesis_extender_get_widgets();\n\t$custom_hooks = genesis_extender_get_hooks();\n?>\n\t<div class=\"wrap\">\n\t\t\n\t\t<div id=\"genesis-extender-custom-saved\" class=\"genesis-extender-update-box\"></div>\n\n\t\t<?php\n\t\tif( !empty( $_POST['action'] ) && $_POST['action'] == 'reset' )\n\t\t{\n\t\t\tgenesis_extender_reset_delete_template();\n\t\t\tupdate_option( 'genesis_extender_custom_css', genesis_extender_custom_css_options_defaults() );\n\t\t\tupdate_option( 'genesis_extender_custom_functions', genesis_extender_custom_functions_options_defaults() );\n\t\t\tupdate_option( 'genesis_extender_custom_js', genesis_extender_custom_js_options_defaults() );\n\t\t\tupdate_option( 'genesis_extender_custom_templates', array() );\n\t\t\tupdate_option( 'genesis_extender_custom_labels', array() );\n\t\t\tupdate_option( 'genesis_extender_custom_conditionals', array() );\n\t\t\tupdate_option( 'genesis_extender_custom_widget_areas', array() );\n\t\t\tupdate_option( 'genesis_extender_custom_hook_boxes', array() );\n\n\t\t\tgenesis_extender_get_custom_css( null, $args = array( 'cached' => false, 'array' => false ) );\n\t\t\t$custom_functions = get_option( 'genesis_extender_custom_functions' );\n\t\t\t$custom_js = get_option( 'genesis_extender_custom_js' );\n\t\t\t$custom_templates = genesis_extender_get_templates();\n\t\t\t$custom_labels = genesis_extender_get_labels();\n\t\t\t$custom_conditionals = genesis_extender_get_conditionals();\n\t\t\t$custom_widgets = genesis_extender_get_widgets();\n\t\t\t$custom_hooks = genesis_extender_get_hooks();\n\n\t\t\tgenesis_extender_write_files( $css = true, $ez = false );\n\t\t?>\n\t\t\t<script type=\"text/javascript\">jQuery(document).ready(function($){ $('#genesis-extender-custom-saved').html('Custom Options Reset').css(\"position\", \"fixed\").fadeIn('slow');window.setTimeout(function(){$('#genesis-extender-custom-saved').fadeOut( 'slow' );}, 2222); });</script>\n\t\t<?php\n\t\t}\n\n\t\tif( !empty( $_GET['activetab'] ) )\n\t\t{ ?>\n\t\t\t<script type=\"text/javascript\">jQuery(document).ready(function($) { $('#<?php echo $_GET['activetab']; ?>').click(); });</script>\t\n\t\t<?php\n\t\t} ?>\n\t\t\n\t\t<div id=\"icon-options-general\" class=\"icon32\"></div>\n\t\t\n\t\t<h2 id=\"genesis-extender-admin-heading\"><?php _e( 'Extender - Custom Options', 'extender' ); ?></h2>\n\t\t\n\t\t<div class=\"genesis-extender-css-builder-button-wrap\">\n\t\t\t<span id=\"show-hide-custom-css-builder\" class=\"button\"><?php _e( 'CSS Builder', 'extender' ); ?></span>\n\t\t</div>\n\n\t\t<div class=\"genesis-extender-php-builder-button-wrap\">\n\t\t\t<span id=\"show-hide-custom-php-builder\" class=\"button\"><?php _e( 'PHP Builder', 'extender' ); ?></span>\n\t\t</div>\n\t\t\n\t\t<div id=\"genesis-extender-admin-wrap\">\n\t\t\n\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-css-builder.php' ); ?>\n\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-php-builder.php' ); ?>\n\t\t\t\n\t\t\t<form action=\"/\" id=\"custom-options-form\" name=\"custom-options-form\">\n\t\t\t\n\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"genesis_extender_custom_options_save\" />\n\t\t\t\t<input type=\"hidden\" name=\"security\" value=\"<?php echo wp_create_nonce( 'custom-options' ); ?>\" />\n\t\t\t\n\t\t\t\t<div id=\"genesis-extender-floating-save\">\n\t\t\t\t\t<input type=\"submit\" value=\"<?php _e( 'Save Changes', 'extender' ); ?>\" name=\"Submit\" alt=\"Save Changes\" class=\"genesis-extender-save-button button button-primary\"/>\n\t\t\t\t\t<img class=\"genesis-extender-ajax-save-spinner\" src=\"<?php echo site_url() . '/wp-admin/images/spinner-2x.gif'; ?>\" />\n\t\t\t\t\t<span class=\"genesis-extender-saved\"></span>\n\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t<div id=\"genesis-extender-custom-options-nav\" class=\"genesis-extender-admin-nav\">\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li id=\"genesis-extender-custom-options-nav-css\" class=\"genesis-extender-options-nav-all genesis-extender-options-nav-active\"><a href=\"#\">CSS</a></li><li id=\"genesis-extender-custom-options-nav-functions\" class=\"genesis-extender-options-nav-all\"><a href=\"#\">Functions</a></li><li id=\"genesis-extender-custom-options-nav-js\" class=\"genesis-extender-options-nav-all\"><a href=\"#\">JS</a></li><li id=\"genesis-extender-custom-options-nav-templates\" class=\"genesis-extender-options-nav-all\"><a href=\"#\">Templates</a></li><li id=\"genesis-extender-custom-options-nav-labels\" class=\"genesis-extender-options-nav-all\"><a href=\"#\">Labels</a></li><li id=\"genesis-extender-custom-options-nav-conditionals\" class=\"genesis-extender-options-nav-all\"><a href=\"#\">Conditionals</a></li><li id=\"genesis-extender-custom-options-nav-widget-areas\" class=\"genesis-extender-options-nav-all\"><a href=\"#\">Widget Areas</a></li><li id=\"genesis-extender-custom-options-nav-hook-boxes\" class=\"genesis-extender-options-nav-all\"><a href=\"#\">Hook Boxes</a></li><li id=\"genesis-extender-custom-options-nav-image-uploader\" class=\"genesis-extender-options-nav-all\"><a class=\"genesis-extender-options-nav-last\" href=\"#\">Images</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class=\"genesis-extender-custom-options-wrap\">\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-css.php' ); ?>\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-functions.php' ); ?>\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-js.php' ); ?>\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-templates.php' ); ?>\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-labels.php' ); ?>\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-conditionals.php' ); ?>\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-widget-areas.php' ); ?>\n\t\t\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-hook-boxes.php' ); ?>\n\t\t\t\t</div>\n\t\t\t\n\t\t\t</form>\n\n\t\t\t<?php require_once( GENEXT_PATH . 'lib/admin/boxes/custom-image-uploader.php' ); ?>\n\n\t\t\t<div id=\"genesis-extender-admin-footer\">\n\t\t\t\t<p>\n\t\t\t\t\t<a href=\"http://cobaltapps.com\" target=\"_blank\">CobaltApps.com</a> | <a href=\"http://extenderdocs.cobaltapps.com/\" target=\"_blank\">Docs</a> | <a href=\"http://cobaltapps.com/my-account/\" target=\"_blank\">My Account</a> | <a href=\"http://cobaltapps.com/forum/\" target=\"_blank\">Community Forum</a> | <a href=\"http://cobaltapps.com/affiliates/\" target=\"_blank\">Affiliates</a> ·\n\t\t\t\t\t<a><span id=\"show-options-reset\" class=\"genesis-extender-options-reset-button button\" style=\"margin:0; float:none !important;\"><?php _e( 'Custom Options Reset', 'extender' ); ?></span></a><a href=\"http://extenderdocs.cobaltapps.com/article/156-custom-options-reset\" class=\"tooltip-mark\" target=\"_blank\">[?]</a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div style=\"display:none; width:160px; border:none; background:none; margin:0 auto; padding:0; float:none; position:inherit;\" id=\"show-options-reset-box\" class=\"genesis-extender-custom-fonts-box\">\n\t\t\t\t<form style=\"float:left;\" id=\"genesis-extender-reset-custom-options\" method=\"post\">\n\t\t\t\t\t<input style=\"background:#D54E21; width:160px !important; color:#FFFFFF !important; -webkit-box-shadow:none; box-shadow:none;\" type=\"submit\" value=\"<?php _e( 'Reset Custom Options', 'extender' ); ?>\" class=\"genesis-extender-reset button\" name=\"Submit\" onClick='return confirm(\"<?php _e( 'Are you sure your want to reset your Genesis Extender Custom Options?', 'extender' ); ?>\")'/><input type=\"hidden\" name=\"action\" value=\"reset\" />\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t</div> <!-- Close Wrap -->\n<?php\n}",
"function rp_widget_Admin() {\r\n $rp_settings = get_option(\"rp_widget_option\");\r\n\t// check if options have been updated\r\n\tif (isset($_POST['update_rp_widget'])) {\r\n\t\t$rp_settings['rp_widget_title']= strip_tags(stripslashes($_POST['rp_widget_title']));\r\n $rp_settings['rp_number'] = strip_tags(stripslashes($_POST['rp_number']));\r\n //Rev 0.0.2 - Adding Random Feature\r\n $rp_settings['rp_randomize'] = strip_tags(stripslashes($_POST['rp_randomize']));\r\n $rp_settings['rp_browse_link'] = strip_tags(stripslashes($_POST['rp_browse_link']));\r\n $rp_settings['rp_thickbox'] = strip_tags(stripslashes($_POST['rp_thickbox']));\r\n $rp_settings['rp_thickbox_path'] = strip_tags(stripslashes($_POST['rp_thickbox_path']));\r\n $rp_settings['rp_custom_css'] = strip_tags(stripslashes($_POST['rp_custom_css']));\r\n $rp_settings['rp_css'] = strip_tags(stripslashes($_POST['rp_css']));\r\n\t\tupdate_option(\"rp_widget_option\",$rp_settings);\r\n\t}\r\n\techo '<p>\r\n\t <label for=\"rp_widget_title\"><strong>Title:</strong>\r\n <input id=\"rp_widget_title\" tabindex=\"1\" name=\"rp_widget_title\" type=\"text\" size=\"15\" value=\"'.$rp_settings['rp_widget_title'].'\" />\r\n </label><br />\r\n <label for=\"rp_number\"><strong>Number of Photos:</strong>\r\n <input id=\"rp_number\" name=\"rp_number\" type=\"text\" tabindex=\"2\" size=\"3\" value=\"'.$rp_settings['rp_number'].'\" />\r\n </label><br />\r\n <label for=\"rp_randomize\"><strong>Randomize:</strong>\r\n <input type=\"checkbox\" tabindex=\"3\" name=\"rp_randomize\" ';\r\n if ($rp_settings['rp_randomize'] == 'on') echo 'checked'; \r\n echo ' />\r\n </label><br />\r\n <label for=\"rp_browse_link\"><strong>Browse Photo Link:</strong><br />\r\n <input id=\"rp_browse_link\" name=\"rp_browse_link\" type=\"text\" tabindex=\"42\" class=\"widefat\" value=\"'.$rp_settings['rp_browse_link'].'\" />\r\n </label><br />\r\n <label for=\"rp_thickbox\"><strong>Use Thickbox:</strong>\r\n <input type=\"checkbox\" tabindex=\"5\" name=\"rp_thickbox\" ';\r\n if ($rp_settings['rp_thickbox'] == 'on') echo 'checked'; \r\n echo ' />\r\n </label><br />\r\n <label for=\"rp_thickbox_path\"><strong>Wordpress Path:</strong>\r\n <input id=\"rp_thickbox_path\" name=\"rp_thickbox_path\" type=\"text\" tabindex=\"6\" size=\"15\" value=\"'.$rp_settings['rp_thickbox_path'].'\" />\r\n <br />\r\n See <a target=\"_blank\" href=\"';\r\n echo WP_PLUGIN_URL;\r\n echo '/recent-photos/readme.txt\">Readme.txt</a> for Details.\r\n <br />\r\n </label><br />\r\n <label for=\"rp_custom_css\"><strong>Use Custom CSS:</strong>\r\n <input tabindex=\"7\" type=\"checkbox\" name=\"rp_custom_css\" ';\r\n if ($rp_settings['rp_custom_css'] == 'on') echo 'checked'; \r\n echo ' />\r\n </label><br />\r\n <label for=\"rp_css\"><strong>Custom CSS:</strong><br />\r\n <textarea name=\"rp_css\" rows=\"5\" cols=\"30\" tabindex=\"8\" >';\r\necho $rp_settings['rp_css'];\r\necho '</textarea>\r\n <br />\r\n See <a target=\"_blank\" href=\"';\r\n echo WP_PLUGIN_URL;\r\n echo '/recent-photos/readme.txt\">Readme.txt</a> for Details.\r\n <br />\r\n </label><br />\r\n </p>';\r\n\techo '<input type=\"hidden\" id=\"update_rp_widget\" name=\"update_rp_widget\" value=\"1\" />';\r\n}",
"protected function _saveOptions(): void\n {\n if ($this->_search->hasOption(Search::OPTION_SCROLL)) {\n $this->_options[0] = $this->_search->getOption(Search::OPTION_SCROLL);\n }\n\n if ($this->_search->hasOption(Search::OPTION_SCROLL_ID)) {\n $this->_options[1] = $this->_search->getOption(Search::OPTION_SCROLL_ID);\n }\n\n if ($this->_search->hasOption(Search::OPTION_SEARCH_IGNORE_UNAVAILABLE)) {\n $isNotInitial = (null !== $this->_options[2]);\n $this->_options[2] = $this->_search->getOption(Search::OPTION_SEARCH_IGNORE_UNAVAILABLE);\n\n // remove ignore_unavailable from options if not initial search\n if ($isNotInitial) {\n $searchOptions = $this->_search->getOptions();\n unset($searchOptions[Search::OPTION_SEARCH_IGNORE_UNAVAILABLE]);\n $this->_search->setOptions($searchOptions);\n }\n }\n }",
"public function action() {\r\n parent::action();\r\n\r\n\r\n switch (SQ_Tools::getValue('action')) {\r\n\r\n case 'sq_settings_update':\r\n if (SQ_Tools::getIsset('sq_post_types')) {\r\n SQ_Tools::$options['sq_post_types'] = array();\r\n foreach (SQ_Tools::getValue('sq_post_types') as $key) {\r\n array_push(SQ_Tools::$options['sq_post_types'], $key);\r\n }\r\n\r\n if (!in_array('product', get_post_types())) {\r\n array_push(SQ_Tools::$options['sq_post_types'], 'product');\r\n }\r\n }\r\n\r\n SQ_Tools::saveOptions('sq_google_country', SQ_Tools::getValue('sq_google_country'));\r\n SQ_Tools::saveOptions('sq_google_country_strict', SQ_Tools::getValue('sq_google_country_strict'));\r\n SQ_Tools::saveOptions('sq_google_ranksperhour', SQ_Tools::getValue('sq_google_ranksperhour'));\r\n\r\n SQ_Tools::saveOptions('sq_keyword_help', (int) SQ_Tools::getValue('sq_keyword_help'));\r\n SQ_Tools::saveOptions('sq_keyword_information', (int) SQ_Tools::getValue('sq_keyword_information'));\r\n SQ_Tools::saveOptions('sq_sla', (int) SQ_Tools::getValue('sq_sla'));\r\n SQ_Tools::saveOptions('sq_keywordtag', (int) SQ_Tools::getValue('sq_keywordtag'));\r\n SQ_Tools::saveOptions('sq_local_images', (int) SQ_Tools::getValue('sq_local_images'));\r\n\r\n\r\n SQ_Tools::saveOptions('sq_google_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkGoogleWTCode(SQ_Tools::getValue('sq_google_wt','',true)));\r\n SQ_Tools::saveOptions('sq_bing_wt', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_bing_wt','',true)));\r\n SQ_Tools::saveOptions('sq_alexa', SQ_ObjController::getModel('SQ_BlockSettingsSeo')->checkBingWTCode(SQ_Tools::getValue('sq_alexa','',true)));\r\n\r\n\r\n SQ_Action::apiCall('sq/user/settings', array('settings' => json_encode(SQ_Tools::getBriefOptions())), 10);\r\n SQ_Tools::emptyCache();\r\n break;\r\n }\r\n }",
"function cs_theme_option_save() {\n\tif ( isset($_POST['logo']) ) {\n\t\t$_POST = cs_stripslashes_htmlspecialchars($_POST);\n\t\tif ( $_SERVER[\"REQUEST_METHOD\"] == \"POST\" and isset($_POST['twitter_setting'])){\n\t\t\tupdate_option( \"cs_theme_option\", $_POST );\n\t\t\techo \"All Settings Saved\";\n\t\t\tcs_twitter_authenticate(true);\n\t\t}else{\n\t\t\tupdate_option( \"cs_theme_option\", $_POST );\n\t\t\techo \"All Settings Saved\";\n\t\t\t\n\t\t}\n\t\t// upating config file end\n\t\t\t\n\t}\n\telse {\n\t\t$target_path_mo = get_template_directory().\"/languages/\".$_FILES[\"mofile\"][\"name\"][0];\n\t\tif ( move_uploaded_file($_FILES[\"mofile\"][\"tmp_name\"][0], $target_path_mo) ) {\n\t\t\tchmod($target_path_mo,0777);\n\t\t}\n\t\techo \"New Language Uploaded Successfully\";\n\t}\n\tdie();\n}",
"protected function save()\n {\n $css = setcooki_path('plugin') . '/var/app.min.css';\n $json = setcooki_path('plugin'). '/var/options.json';\n $options = Option::get('wunderlist_todo_options', array());\n\n if(is_file($css))\n {\n @unlink($css);\n }\n if(is_file($json))\n {\n @chmod($json, 0755);\n }\n @file_put_contents($json, json_encode($options));\n }",
"public function options_update() {\n\t\tregister_setting( $this->plugin_name, $this->plugin_name, array($this, 'validate', 'default' => array( \"url_nerd_instance\" => \"\", \"category_weight\" => \"0.04\", \"entity_weight\" => \"0.7\" ) ) );\n\t}",
"protected function doPrePluginOptionsSave() {\n\t\t$oDp = $this->loadDP();\n\n\t\tif ( $this->getOpt( 'activated_at', 0 ) <= 0 ) {\n\t\t\t$this->setOpt( 'activated_at', $oDp->time() );\n\t\t}\n\t\tif ( $this->getOpt( 'installation_time', 0 ) <= 0 ) {\n\t\t\t$this->setOpt( 'installation_time', $oDp->time() );\n\t\t}\n\n\t\t$this->setOpt( 'installed_version', $this->getController()->getVersion() );\n\t}",
"public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}",
"public function save_settings() {\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-settings' !== $_GET['page'])\n return;\n\n if ('swpm_settings' !== $_REQUEST['action'])\n return;\n\n check_admin_referer('swpm-update-settings');\n\n $data = array();\n\n foreach ($_POST['swpm-settings'] as $key => $val) {\n $data[$key] = esc_html($val);\n }\n\n update_option('swpm-settings', $data);\n }",
"public static function Save()\r\n {\r\n return update_option(self::OPT_SETTINGS, self::$Data);\r\n }",
"function wpbm_extra_field_save( $post_id ){\n\n// Checks save status\n $is_autosave = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = ( isset( $_POST[ 'wpbm_blog_nonce' ] ) && wp_verify_nonce( $_POST[ 'wpbm_blog_nonce' ], basename( __FILE__ ) ) ) ? 'true' : 'false';\n// Exits script depending on save status\n if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {\n return;\n }\n if ( isset( $_POST[ 'wpbm_extra_option' ] ) ) {\n\n $wpbm_extra = ( array ) $_POST[ 'wpbm_extra_option' ];\n\n $extra_field = $this -> sanitize_array( $wpbm_extra );\n// save data\n update_post_meta( $post_id, 'wpbm_extra_option', $extra_field );\n }\n return;\n }",
"public function save_options_menu() {\n if ( !isset($_REQUEST['cs_nonce']) ) return;\n if ( !isset($_REQUEST['cs_options']) ) return;\n if ( !isset($_REQUEST['cs_page']) ) return;\n if ( !wp_verify_nonce( stripslashes($_REQUEST['cs_nonce']), 'save-caseswap-options') ) return;\n\n $section = stripslashes( $_REQUEST['cs_page'] );\n if ( !isset($this->option_pages[$section]) ) return;\n\n $options = $this->get_options();\n $submitted = $this->get_options( stripslashes_deep($_REQUEST['cs_options']) );\n\n // We only want to save the updated options for the page we clicked \"Save changes\" for.\n foreach( $this->option_pages[$section]['fields'] as $key ) {\n if ( isset($submitted[$key]) ) {\n $options[$key] = $submitted[$key];\n }else{\n $options[$key] = false;\n }\n }\n\n // Save the updated options\n update_option( 'caseswap-options', $options );\n\n $args = apply_filters( 'caseswap-options-saved-redirect-args', array('cs_page' => $section, 'cs_message' => 'options-saved'), $this );\n\n wp_redirect( add_query_arg( $args, $this->options_page_url) );\n exit;\n }",
"public function configure()\n {\n if (sfContext::getInstance()->getModuleName() == 'file') {\n unset($this['judge_id'], $this['result'], $this['instruction'], \n $this['user_file_id'], $this['court_note_id'], $this['coordinator_id'],\n $this['barrister_id'], $this['appearing_type_id']/*, $this['appearing_id']*/\n );\n \n $this->widgetSchema['appearing_id']->setOption('method', 'obtainFullName');\n $this->widgetSchema['appearing_id']->setOption('table_method', 'getSolicitorsCB');\n \n $this->widgetSchema['court_id']->setAttribute('style', 'width:200px');\n $this->widgetSchema['listing_id']->setAttribute('style', 'width:150px');\n }\n else {\n //unset($this['coordinator_id']);\n $this->widgetSchema['result']->setAttributes(array('cols' => '70', 'rows' => '12'));\n $this->widgetSchema['user_file_id']->setOption('method', 'getClientName');\n $this->widgetSchema['court_note_id']->setLabel('Note');\n \n $this->widgetSchema['instruction'] = new sfWidgetFormTextarea(array(), array('cols' => '70', 'rows' => '4'));\n \n $this->widgetSchema['judge_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => $this->getRelatedModelName('Judge'), \n 'form_module' => 'judge', \n 'add_empty' => true,\n 'method' => 'obtainFullName',\n 'table_method' => 'getJudgesCB'\n ));\n \n $this->widgetSchema['judge_id']->setLabel('Before');\n $this->validatorSchema['judge_id']->setOption('required', false);\n //$this->widgetSchema['judge_id']->setOption('method', 'obtainFullName');\n //$this->widgetSchema['judge_id']->setOption('table_method', 'getJudgesCB');\n \n $this->widgetSchema['appearing_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => $this->getRelatedModelName('Appearing'), \n 'form_module' => 'user?_frm=MyAccount', \n 'add_empty' => true,\n 'method' => 'obtainFullName',\n 'table_method' => 'getSolicitorsCB'\n ));\n \n // added by William, 26/05/2013: add barrister\n $this->widgetSchema['barrister_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => $this->getRelatedModelName('Barrister'), \n 'form_module' => 'user?_frm=MyAccount', \n 'add_empty' => true,\n 'method' => 'obtainFullName',\n 'table_method' => 'getBarristersCB'\n ));\n \n //$this->widgetSchema['appearing_id']->setOption('method', 'obtainFullName');\n //$this->widgetSchema['appearing_id']->setOption('table_method', 'getSolicitorsCB');\n \n // for the add/edit button widget\n if (!sfContext::getInstance()->getRequest()->getParameter('shbx') ) {\n $this->widgetSchema['court_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => 'Agency', \n 'form_module' => 'agency?code=COU', \n 'add_empty' => true,\n ));\n }\n \n // for the add/edit button widget\n //if (!sfContext::getInstance()->getRequest()->getParameter('shbx') ) {\n $this->widgetSchema['listing_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => 'Listing', \n 'form_module' => 'listing', \n 'add_empty' => true,\n 'order_by' => array('name', 'asc') \n ));\n \n $this->widgetSchema['court_note_id'] = new sfWidgetFormAjaxDoctrineChoice(array(\n 'model' => 'CourtNote', \n 'form_module' => 'courtNote', \n 'add_empty' => true,\n 'method' => 'getValue',\n 'order_by' => array('value', 'asc') \n ));\n //}\n \n $this->hideField('user_file_id');\n \n $this->addFee();\n $this->widgetSchema['Fee']->setLabel(false);\n }\n \n // add class to year to validate past dates\n $this->widgetSchema['date']->setAttribute('class', 'validateYear');\n\n // set method to load values to show\n $this->widgetSchema['court_id']->setOption('table_method', 'getCourtsCB');\n \n //$this->widgetSchema['coordinator_id']->setOption('method', 'obtainFullName');\n //$this->widgetSchema['coordinator_id']->setOption('table_method', 'getCoordinatorsCB');\n \n if (sfContext::getInstance()->getModuleName() == 'file') {\n // remove emptys\n $this->widgetSchema['court_id']->setOption('add_empty', false);\n }\n \n // sort some dropboxes\n $this->widgetSchema['listing_id']->addOption('order_by', array('name', 'asc'));\n \n // adding some extra validators\n //$this->widgetSchema['time'] = new sfWidgetFormTime();\n $this->widgetSchema['time'] = $this->formattedWidgetFormTime();\n $this->validatorSchema['time'] = new sfValidatorTime(array('required' => false));\n $this->validatorSchema['court_id']->setOption('required', true);\n \n /*$this->validatorSchema->setPostValidator(\n new sfValidatorCallback(array('callback' => array($this, 'setSpecialValues')))\n );*/\n $this->validatorSchema->setPostValidator(new sfValidatorAnd(array(\n new sfValidatorCallback(array('callback' => array($this, 'setSpecialValues'))),\n new sfValidatorCallback(array('callback' => array($this, 'setSpecialFeeValues')))\n )));\n \n // adding asterisk for required fields\n $this->setAsteriskForRequiredFields();\n \n // this formatting is applied only if form is called directly, without admin generator templates\n $first = ($this->getOption('first') !== null) ? $this->getOption('first') : false;\n $custom_decorator = new ExtendedFormSchemaFormatter($this->getWidgetSchema(), array('header' => $first));\n $this->widgetSchema->addFormFormatter('Myformatter', $custom_decorator);\n $this->widgetSchema->setFormFormatterName('Myformatter');\n }",
"public function saveSettingsAjax()\n {\n $formId = absint($_REQUEST['form_id']);\n\n $css = $_REQUEST['custom_css'];\n $js = $_REQUEST['custom_js'];\n $css = wp_strip_all_tags(wp_unslash($css));\n $js = wp_unslash($js);\n\n $this->store($formId, '_custom_form_css', $css);\n $this->store($formId, '_custom_form_js', $js);\n\n wp_send_json_success([\n 'message' => __('Custom CSS and JS successfully updated', 'fluentform')\n ], 200);\n }",
"public function save_settings_callback() {\r\n $setting_data = $this->ajax_data['setting_data'];\r\n\r\n labb_update_options($setting_data);\r\n\r\n $template = false;\r\n // get new restore global settings panel\r\n if ($this->ajax_data['reset']) {\r\n ob_start();\r\n require_once('views/settings.php');\r\n $template = ob_get_clean();\r\n }\r\n\r\n $response = $this->ajax_response(true, $this->ajax_data['reset'], $template);\r\n return $response;\r\n\r\n }",
"function WidgetMeteoControl() {\n\t\t\n\t\t\t$options = get_option('widget_trebimeteo');\n\t\t\tif ( !is_array($options) )\t{ $options = array('title' => 'Previsioni Meteo', 'trebiregione' => '1', 'trebilocalita' => '6', 'trebicuno' => 'ffffff','trebicdue' => 'ffffff', 'trebictre' => 'ffffff', 'trebibuno' => '93c1db', 'trebibdue' => '3a8ebd', 'trebibtre' => 'ffffff', 'trebilarghezza' => '190', 'trebialtezza' => '240', 'trebitipo' => 'xssmall'); }\n\n\t\t\tif ( $_POST['trebimeteo-submit'] )\n\t\t\t{\n\t\t\t\t// Remember to sanitize and format use input appropriately.\n\t\t\t\t$options['trebimeteotitle'] = strip_tags(stripslashes($_POST['trebimeteotitle']));\n\t\t\t\t$options['trebiregione'] = strip_tags(stripslashes($_POST['trebiregione']));\n\t\t\t\t$options['trebilocalita'] = strip_tags(stripslashes($_POST['trebilocalita']));\n\t\t\t\t$options['trebicuno'] = strip_tags(stripslashes($_POST['trebicuno']));\n\t\t\t\t$options['trebicdue'] = strip_tags(stripslashes($_POST['trebicdue']));\n\t\t\t\t$options['trebictre'] = strip_tags(stripslashes($_POST['trebictre']));\n\t\t\t\t$options['trebibuno'] = strip_tags(stripslashes($_POST['trebibuno']));\n\t\t\t\t$options['trebibdue'] = strip_tags(stripslashes($_POST['trebibdue']));\n\t\t\t\t$options['trebibtre'] = strip_tags(stripslashes($_POST['trebibtre']));\n\t\t\t\t$options['trebialtezza'] = strip_tags(stripslashes($_POST['trebialtezza']));\n\t\t\t\t$options['trebilarghezza'] = strip_tags(stripslashes($_POST['trebilarghezza']));\n\t\t\t\t$options['trebitipo'] = strip_tags(stripslashes($_POST['trebitipo']));\n\n\t\t\t\tupdate_option('widget_trebimeteo', $options);\n\t\t\t}\n\n\t\t\t$trebimeteotitle = htmlspecialchars($options['trebimeteotitle'], ENT_QUOTES);\n\t\t\t$trebiregione = htmlspecialchars($options['trebiregione'], ENT_QUOTES);\n\t\t\t$trebilocalita = htmlspecialchars($options['trebilocalita'], ENT_QUOTES);\n\t\t\t$trebicuno = htmlspecialchars($options['trebicuno'], ENT_QUOTES);\n\t\t\t$trebicdue = htmlspecialchars($options['trebicdue'], ENT_QUOTES);\n\t\t\t$trebictre = htmlspecialchars($options['trebictre'], ENT_QUOTES);\n\t\t\t$trebibuno = htmlspecialchars($options['trebibuno'], ENT_QUOTES);\n\t\t\t$trebibdue = htmlspecialchars($options['trebibdue'], ENT_QUOTES);\n\t\t\t$trebibtre = htmlspecialchars($options['trebibtre'], ENT_QUOTES);\n\t\t\t$trebialtezza = htmlspecialchars($options['trebialtezza'], ENT_QUOTES);\n\t\t\t$trebilarghezza = htmlspecialchars($options['trebilarghezza'], ENT_QUOTES);\n\t\t\t$trebitipo = htmlspecialchars($options['trebitipo'], ENT_QUOTES);\n\n\t\t\t$xpath = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),\"\",plugin_basename(__FILE__));\n\t\t\t\n\t\t\t?>\n \n\t<p style=\"text-align:right;\"><label for=\"trebimeteo-title\">Titolo <input id=\"trebimeteotitle\" name=\"trebimeteotitle\" type=\"text\" value=\"<?php echo $trebimeteotitle;?>\" /></label></p>\n <p style=\"text-align:right;\"><label for=\"trebiregione\">ID Regione (<a target=\"_blank\" href=\"<?php echo home_url().'/wp-admin/options-general.php?page=3bmeteo.php'; ?>\">?</a>) <input id=\"trebiregione\" name=\"trebiregione\" type=\"text\" value=\"<?php echo $trebiregione;?>\"/></label></p>\n\t<p style=\"text-align:right;\"><label for=\"trebilocalita\">ID Località (<a target=\"_blank\" href=\"<?php echo home_url().'/wp-admin/options-general.php?page=3bmeteo.php';?>\">?</a>) <input id=\"trebilocalita\" name=\"trebilocalita\" type=\"text\" value=\"<?php echo $trebilocalita;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebialtezza\">Altezza <input id=\"trebialtezza\" name=\"trebialtezza\" type=\"text\" value=\"<?php echo $trebialtezza;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebilarghezza\">Larghezza <input id=\"trebilarghezza\" name=\"trebilarghezza\" type=\"text\" value=\"<?php echo $trebilarghezza;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebibuno\">B1 <input id=\"trebibuno\" name=\"trebibuno\" type=\"text\" value=\"<?php echo $trebibuno;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebibdue\">B2 <input id=\"trebibdue\" name=\"trebibdue\" type=\"text\" value=\"<?php echo $trebibdue;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebibtre\">B3 <input id=\"trebibtre\" name=\"trebibtre\" type=\"text\" value=\"<?php echo $trebibtre;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebicuno\">C1 <input id=\"trebicuno\" name=\"trebicuno\" type=\"text\" value=\"<?php echo $trebicuno;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebicdue\">C2 <input id=\"trebicdue\" name=\"trebicdue\" type=\"text\" value=\"<?php echo $trebicdue;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebictre\">C3 <input id=\"trebictre\" name=\"trebictre\" type=\"text\" value=\"<?php echo $trebictre;?>\"/></label></p>\n <p style=\"text-align:right;\"><label for=\"trebitipo\">Tipo\n <select id=\"trebitipo\" name=\"trebitipo\"> \n\t\t<option label=\"Località Compatti 1 giorno\" value=\"xssmall\"<?php if ($trebitipo=='xssmall') echo ' selected=\"selected\"';?>>Località Compatti 1 giorno</option> \n\t\t<option label=\"Località Compatti 6 giorni\" value=\"lsmall\"<?php if ($trebitipo=='lsmall') echo ' selected=\"selected\"';?>>Località Compatti 6 giorni</option> \n\t\t<option label=\"Località Compatti 7 giorni\" value=\"lbigor\"<?php if ($trebitipo=='lbigor') echo ' selected=\"selected\"';?>>Località Compatti 7 giorni</option> \n\t\t<option label=\"Località Dati in Diretta\" value=\"treale\"<?php if ($trebitipo=='treale') echo ' selected=\"selected\"';?>>Località Dati in Diretta</option> \n\t\t<option label=\"Tutte le Località\" value=\"ssmall\"<?php if ($trebitipo=='ssmall') echo ' selected=\"selected\"';?>>Tutte le Località</option> \n\t\t<option label=\"Località estese 7 giorni\" value=\"lbig\"<?php if ($trebitipo=='lbig') echo ' selected=\"selected\"';?>>Località estese 7 giorni</option> \n\t\t<option label=\"Località estese orario\" value=\"oraxora\"<?php if ($trebitipo=='oraxora') echo ' selected=\"selected\"';?>>Località estese orario</option> \n\t\t<option label=\"Regionali compatto\" value=\"msmall\"<?php if ($trebitipo=='msmall') echo ' selected=\"selected\"';?>>Regionali compatto</option> \n\t\t<option label=\"Regionali 7 giorni\" value=\"msmacro\"<?php if ($trebitipo=='msmacro') echo ' selected=\"selected\"';?>>Regionali 7 giorni</option> \n\t\t<option label=\"Località Marine 1 giorno\" value=\"lsmari\"<?php if ($trebitipo=='lsmari') echo ' selected=\"selected\"';?>>Località Marine 1 giorno</option> \n\t\t<option label=\"Località Marine 7 giorno\" value=\"lmari\"<?php if ($trebitipo=='lmari') echo ' selected=\"selected\"';?>>Località Marine 7 giorno</option> \n\t\t<option label=\"Regionali Marine 7 giorni\" value=\"mmari\"<?php if ($trebitipo=='mmari') echo ' selected=\"selected\"';?>>Regionali Marine 7 giorni</option> \n\t\t<option label=\"Neve 1 giorno\" value=\"lsneve\"<?php if ($trebitipo=='lsneve') echo ' selected=\"selected\"';?>>Neve 1 giorno</option> \n\t\t<option label=\"Neve 7 giorni\" value=\"lneve\"<?php if ($trebitipo=='lneve') echo ' selected=\"selected\"';?>>Neve 7 giorni</option>\n\t</select>\n </label>\n\t</p>\n <!--<p style=\"text-align:right;\">\n <select id=\"trebimeteoregione\" name=\"trebimeteoregione\"> \n\t\t<option label=\"Abruzzo (idreg=1)\" value=\"1\">Abruzzo (idreg=1)</option> \n\t\t<option label=\"Basilicata (idreg=2)\" value=\"2\">Basilicata (idreg=2)</option> \n\t\t<option label=\"Calabria (idreg=3)\" value=\"3\">Calabria (idreg=3)</option> \n\t\t<option label=\"Campania (idreg=4)\" value=\"4\">Campania (idreg=4)</option> \n\t\t<option label=\"Emilia (idreg=5)\" value=\"5\">Emilia (idreg=5)</option> \n\t\t<option label=\"Friuli (idreg=6)\" value=\"6\">Friuli (idreg=6)</option> \n\t\t<option label=\"Lazio (idreg=7)\" value=\"7\">Lazio (idreg=7)</option> \n\t\t<option label=\"Liguria (idreg=8)\" value=\"8\">Liguria (idreg=8)</option> \n\t\t<option label=\"Lombardia (idreg=9)\" value=\"9\">Lombardia (idreg=9)</option> \n\t\t<option label=\"Marche (idreg=10)\" value=\"10\">Marche (idreg=10)</option> \n\t\t<option label=\"Molise (idreg=11)\" value=\"11\">Molise (idreg=11)</option> \n\t\t<option label=\"Piemonte (idreg=12)\" value=\"12\">Piemonte (idreg=12)</option> \n\t\t<option label=\"Puglia (idreg=13)\" value=\"13\">Puglia (idreg=13)</option> \n\t\t<option label=\"Sardegna (idreg=14)\" value=\"14\">Sardegna (idreg=14)</option> \n\t\t<option label=\"Sicilia (idreg=15)\" value=\"15\">Sicilia (idreg=15)</option> \n\t\t<option label=\"Toscana (idreg=16)\" value=\"16\">Toscana (idreg=16)</option> \n\t\t<option label=\"Trentino (idreg=17)\" value=\"17\">Trentino (idreg=17)</option> \n\t\t<option label=\"Umbria (idreg=18)\" value=\"18\">Umbria (idreg=18)</option> \n\t\t<option label=\"Valle aosta (idreg=19)\" value=\"19\">Valle d'aosta (idreg=19)</option> \n\t\t<option label=\"Veneto (idreg=20)\" value=\"20\">Veneto (idreg=20)</option> \n\t</select> \n\t</p>-->\n <!-- <p style=\"text-align:right;\"> \n\t<select name=\"trebimeteolocalita\" id=\"trebimeteolocalita\"> \n\t\t<option label=\"Seleziona Località\" value=\"01\">Seleziona Località</option> \n\t</select> \n <p style=\"text-align:right;\"><label for=\"trebiloc\">Località <input style=\"width: 200px;\" id=\"trebiloc\" name=\"trebiloc\" type=\"text\" value=\"<?php //echo $loc;?>\" /></label></p>-->\n <p><input type=\"hidden\" id=\"trebimeteo-submit\" name=\"trebimeteo-submit\" value=\"1\" /></p> \n<?php\n\t\t}",
"public function saveSettings()\n {\n $this->store->save($this->data);\n }",
"function saveSettings() {\n\t\t//# convert class variables into an array and save using\n\t\t//# Wordpress functions, \"update_option\" or \"add_option\"\n\t\t//#convert class into array...\n\t\t$settings_array = array();\n\t\t$obj = $this;\n\t\tforeach (array_keys(get_class_vars(get_class($obj))) as $k){\n\t\t\tif (is_array($obj->$k)) {\n\t\t\t\t//serialize any arrays within $obj\n\t\t\t\tif (count($obj->$k)>0) {\n\t\t\t\t\t$settings_array[$k] = esc_attr(serialize($obj->$k));\n\t\t\t\t} else {\n\t\t\t\t\t$settings_array[$k] = \"\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$settings_array[$k] = \"{$obj->$k}\";\n\t\t\t}\n\t\t}\n\t\t//#save array to options table...\n\t\t$options_check = get_option('wassup_settings');\n\t\tif (!empty($options_check)) {\n\t\t\tupdate_option('wassup_settings', $settings_array);\n\t\t} else {\n\t\t\tadd_option('wassup_settings', $settings_array, 'Options for WassUp');\n\t\t}\n\t\treturn true;\n\t}",
"function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}",
"function add_widget_specific_settings() {\n\t\treturn false;\n\t}",
"public function savePageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl, $ilSetting;\n\t\n\t\t$this->initPageEditorForm();\n\t\tif ($this->form->checkInput())\n\t\t{\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageEditorSettings.php\");\n\t\t\tinclude_once(\"./Services/COPage/classes/class.ilPageContentGUI.php\");\n\t\t\t$buttons = ilPageContentGUI::_getCommonBBButtons();\n\t\t\tforeach ($buttons as $b => $t)\n\t\t\t{\n\t\t\t\tilPageEditorSettings::writeSetting($_GET[\"grp\"], \"active_\".$b,\n\t\t\t\t\t$this->form->getInput(\"active_\".$b));\n\t\t\t}\n\t\t\t\n\t\t\tif ($_GET[\"grp\"] == \"test\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_tst_page_edit\", (int) $_POST[\"tst_page_edit\"]);\n\t\t\t}\n\t\t\telseif ($_GET[\"grp\"] == \"rep\")\n\t\t\t{\n\t\t\t\t$ilSetting->set(\"enable_cat_page_edit\", (int) $_POST[\"cat_page_edit\"]);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendInfo($lng->txt(\"msg_obj_modified\"), true);\n\t\t}\n\t\t\n\t\t$ilCtrl->setParameter($this, \"grp\", $_GET[\"grp\"]);\n\t\t$ilCtrl->redirect($this, \"showPageEditorSettings\");\n\t}",
"function widget_init() {\r\n if ( !function_exists('wp_register_sidebar_widget') || !function_exists('register_widget_control') ) return;\r\n function widget($args) {\r\n extract($args);\r\n $wpca_settings = get_option('wpcareers');\r\n echo $before_widget;\r\n echo $before_title . $wpca_settings['widget_title'] . $after_title;\r\n\r\n $fieldsPre=\"wpc_\";\r\n $before_tag=stripslashes(get_option($fieldsPre.'before_Tag'));\r\n $after_tag=stripslashes(get_option($fieldsPre.'after_Tag'));\r\n echo '<p><ul>' . widget_display($wpca_settings['widget_format']) . '</ul></p>'; \r\n }\r\n\r\n function widget_control() {\r\n $wpca_settings = $newoptions = get_option('wpcareers');\r\n if ( $_POST[\"wpCareers-submit\"] ) {\r\n $newoptions['widget_title'] = strip_tags(stripslashes($_POST['widget_title']));\r\n $newoptions['widget_format'] = $_POST['widget_format'];\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Classifieds Ads';\r\n }\r\n if ( $wpca_settings != $newoptions ) {\r\n $wpca_settings = $newoptions;\r\n update_option('wpcareers', $wpca_settings);\r\n }\r\n $title = htmlspecialchars($wpca_settings['widget_title'], ENT_QUOTES);\r\n if ( empty($newoptions['widget_title']) ) $newoptions['widget_title'] = 'Last Careers Posts';\r\n if ( empty($newoptions['widget_format']) ) $newoptions['widget_format'] = 'y';\r\n ?>\r\n <label for=\"wpCareers-widget_title\"><?php _e('Title:'); ?><input style=\"width: 200px;\" id=\"widget_title\" name=\"widget_title\" type=\"text\" value=\"<?php echo htmlspecialchars($wpca_settings['widget_title']); ?>\" /></label></p>\r\n <br />\r\n <label for=\"wpCareers-widget_format\">\r\n <input class=\"checkbox\" id=\"widget_format\" name=\"widget_format\" type=\"checkbox\" value=\"y\"<?php echo ($wpca_settings['widget_format']=='y')?\" checked\":\"\";?>>Small Format Output</label><br />\r\n <input type=\"hidden\" id=\"wpCareers-submit\" name=\"wpCareers-submit\" value=\"1\" />\r\n <?php\r\n }\r\n \r\n function widget_display() {\r\n $wpca_settings = get_option('wpcareers');\r\n //$out = wpcaLastPosts($wpca_settings['widget_format']);\r\n return $out;\r\n }\r\n \r\n wp_register_sidebar_widget('wpCareers', 'widget', null, 'wpCareers');\r\n register_widget_control('wpCareers', 'widget_control');\r\n }",
"static function save_custom_sidebar() {\r\n\r\n\t\t\t//theme options\r\n\t\t\tglobal $look_ruby_theme_options;\r\n\r\n\t\t\t$sidebar_data = array();\r\n\t\t\t$sidebar_data[] = array(\r\n\t\t\t\t'id' => 'look_ruby_sidebar_default',\r\n\t\t\t\t'name' => esc_html__( 'Default Sidebar', 'look' ),\r\n\t\t\t);\r\n\r\n\t\t\t//add to array data\r\n\t\t\tif ( ! empty( $look_ruby_theme_options['look_ruby_multi_sidebar'] ) && is_array( $look_ruby_theme_options['look_ruby_multi_sidebar'] ) ) {\r\n\t\t\t\tforeach ( $look_ruby_theme_options['look_ruby_multi_sidebar'] as $sidebar ) {\r\n\t\t\t\t\tarray_push( $sidebar_data, array(\r\n\t\t\t\t\t\t\t'id' => 'look_ruby_sidebar_multi_' . self::name_to_id( $sidebar ),\r\n\t\t\t\t\t\t\t'name' => esc_attr( strip_tags( $sidebar ) ),\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//save to database\r\n\t\t\t$multi_sidebar = get_option( 'look_ruby_custom_multi_sidebars', '' );\r\n\t\t\tif ( ! empty( $multi_sidebar ) ) {\r\n\t\t\t\tupdate_option( 'look_ruby_custom_multi_sidebars', $sidebar_data );\r\n\t\t\t} else {\r\n\t\t\t\tadd_option( 'look_ruby_custom_multi_sidebars', $sidebar_data );\r\n\t\t\t}\r\n\t\t}",
"function widget_supporters_control() {\r\n\t\tglobal $wpdb;\r\n\t\t$options = $newoptions = get_option('widget_supporters');\r\n\t\tif ( $_POST['supporters-submit'] ) {\r\n\t\t\t$newoptions['supporters-title'] = $_POST['supporters-title'];\r\n\t\t\t$newoptions['supporters-display'] = $_POST['supporters-display'];\r\n\t\t\t$newoptions['supporters-blog-name-characters'] = $_POST['supporters-blog-name-characters'];\r\n\t\t\t$newoptions['supporters-order'] = $_POST['supporters-order'];\r\n\t\t\t$newoptions['supporters-number'] = $_POST['supporters-number'];\r\n\t\t\t$newoptions['supporters-avatar-size'] = $_POST['supporters-avatar-size'];\r\n\t\t}\r\n\t\tif ( $options != $newoptions ) {\r\n\t\t\t$options = $newoptions;\r\n\t\t\tupdate_option('widget_supporters', $options);\r\n\t\t}\r\n\t?>\r\n\t\t\t\t<div style=\"text-align:left\">\r\n \r\n\t\t\t\t<label for=\"supporters-title\" style=\"line-height:35px;display:block;\"><?php _e('Title', 'widgets'); ?>:<br />\r\n <input class=\"widefat\" id=\"supporters-title\" name=\"supporters-title\" value=\"<?php echo $options['supporters-title']; ?>\" type=\"text\" style=\"width:95%;\">\r\n </select>\r\n </label>\r\n\t\t\t\t<label for=\"supporters-display\" style=\"line-height:35px;display:block;\"><?php _e('Display', 'widgets'); ?>:\r\n <select name=\"supporters-display\" id=\"supporters-display\" style=\"width:95%;\">\r\n <option value=\"avatar_blog_name\" <?php if ($options['supporters-display'] == 'avatar_blog_name'){ echo 'selected=\"selected\"'; } ?> ><?php _e('Avatar + Blog Name'); ?></option>\r\n <option value=\"avatar\" <?php if ($options['supporters-display'] == 'avatar'){ echo 'selected=\"selected\"'; } ?> ><?php _e('Avatar Only'); ?></option>\r\n <option value=\"blog_name\" <?php if ($options['supporters-display'] == 'blog_name'){ echo 'selected=\"selected\"'; } ?> ><?php _e('Blog Name Only'); ?></option>\r\n </select>\r\n </label>\r\n\t\t\t\t<label for=\"supporters-blog-name-characters\" style=\"line-height:35px;display:block;\"><?php _e('Blog Name Characters', 'widgets'); ?>:<br />\r\n <select name=\"supporters-blog-name-characters\" id=\"supporters-blog-name-characters\" style=\"width:95%;\">\r\n <?php\r\n\t\t\t\t\tif ( empty($options['supporters-blog-name-characters']) ) {\r\n\t\t\t\t\t\t$options['supporters-blog-name-characters'] = 30;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$counter = 0;\r\n\t\t\t\t\tfor ( $counter = 1; $counter <= 500; $counter += 1) {\r\n\t\t\t\t\t\t?>\r\n <option value=\"<?php echo $counter; ?>\" <?php if ($options['supporters-blog-name-characters'] == $counter){ echo 'selected=\"selected\"'; } ?> ><?php echo $counter; ?></option>\r\n <?php\r\n\t\t\t\t\t}\r\n ?>\r\n </select>\r\n </label>\r\n\t\t\t\t<label for=\"supporters-order\" style=\"line-height:35px;display:block;\"><?php _e('Order', 'widgets'); ?>:\r\n <select name=\"supporters-order\" id=\"supporters-order\" style=\"width:95%;\">\r\n <option value=\"most_recent\" <?php if ($options['supporters-order'] == 'most_recent'){ echo 'selected=\"selected\"'; } ?> ><?php _e('Most Recent'); ?></option>\r\n <option value=\"random\" <?php if ($options['supporters-order'] == 'random'){ echo 'selected=\"selected\"'; } ?> ><?php _e('Random'); ?></option>\r\n </select>\r\n </label>\r\n\t\t\t\t<label for=\"supporters-number\" style=\"line-height:35px;display:block;\"><?php _e('Number', 'widgets'); ?>:<br />\r\n <select name=\"supporters-number\" id=\"supporters-number\" style=\"width:95%;\">\r\n <?php\r\n\t\t\t\t\tif ( empty($options['supporters-number']) ) {\r\n\t\t\t\t\t\t$options['supporters-number'] = 10;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$counter = 0;\r\n\t\t\t\t\tfor ( $counter = 1; $counter <= 25; $counter += 1) {\r\n\t\t\t\t\t\t?>\r\n <option value=\"<?php echo $counter; ?>\" <?php if ($options['supporters-number'] == $counter){ echo 'selected=\"selected\"'; } ?> ><?php echo $counter; ?></option>\r\n <?php\r\n\t\t\t\t\t}\r\n ?>\r\n </select>\r\n </label>\r\n\t\t\t\t<label for=\"supporters-avatar-size\" style=\"line-height:35px;display:block;\"><?php _e('Avatar Size', 'widgets'); ?>:<br />\r\n <select name=\"supporters-avatar-size\" id=\"supporters-avatar-size\" style=\"width:95%;\">\r\n <option value=\"16\" <?php if ($options['supporters-avatar-size'] == '16'){ echo 'selected=\"selected\"'; } ?> ><?php _e('16px'); ?></option>\r\n <option value=\"32\" <?php if ($options['supporters-avatar-size'] == '32'){ echo 'selected=\"selected\"'; } ?> ><?php _e('32px'); ?></option>\r\n <option value=\"48\" <?php if ($options['supporters-avatar-size'] == '48'){ echo 'selected=\"selected\"'; } ?> ><?php _e('48px'); ?></option>\r\n <option value=\"96\" <?php if ($options['supporters-avatar-size'] == '96'){ echo 'selected=\"selected\"'; } ?> ><?php _e('96px'); ?></option>\r\n <option value=\"128\" <?php if ($options['supporters-avatar-size'] == '128'){ echo 'selected=\"selected\"'; } ?> ><?php _e('128px'); ?></option>\r\n </select>\r\n </label>\r\n\t\t\t\t<input type=\"hidden\" name=\"supporters-submit\" id=\"supporters-submit\" value=\"1\" />\r\n\t\t\t\t</div>\r\n\t<?php\r\n\t}",
"function wyz_ajax_business_form_builder_save_form() {\n\n\t$form_data = json_decode( stripslashes_deep( $_REQUEST['form_data'] ),true );\n\tif ( ! empty( $form_data ) && is_array( $form_data ) ) {\n\t\tforeach ( $form_data as $key => $value ) {\n\t\t\t$form_data[ $key ]['hidden'] = true;\n\t\t}\n\t}\n\tupdate_option( 'wyz_business_form_builder_data', $form_data );\n\twp_die();\n}",
"public function save_builder() {\n\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tforminator_validate_ajax( \"forminator_save_builder_fields\" );\n\n\t\t$submitted_data = $this->get_post_data();\n\t\t$form_data = $submitted_data['data'];\n\t\t$form_data = json_decode( stripslashes( $form_data ), true );\n\t\t$fields = array();\n\t\t$notifications = array();\n\t\t$id = isset( $submitted_data['form_id'] ) ? $submitted_data['form_id'] : null;\n\t\t$id = intval( $id );\n\t\t$title = sanitize_text_field( $submitted_data['formName'] );\n\t\t$status = isset( $submitted_data['status'] ) ? sanitize_text_field( $submitted_data['status'] ) : '';\n\t\t$version = isset( $submitted_data['version'] ) ? sanitize_text_field( $submitted_data['version'] ) : '1.0';\n\t\t$action = false;\n\n\t\tif ( is_null( $id ) || $id <= 0 ) {\n\t\t\t$form_model = new Forminator_Custom_Form_Model();\n\t\t\t$action = 'create';\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = Forminator_Custom_Form_Model::STATUS_PUBLISH;\n\t\t\t}\n\t\t} else {\n\t\t\t$form_model = Forminator_Custom_Form_Model::model()->load( $id );\n\t\t\t$action = 'update';\n\n\t\t\tif ( ! is_object( $form_model ) ) {\n\t\t\t\twp_send_json_error( __( \"Form model doesn't exist\", Forminator::DOMAIN ) );\n\t\t\t}\n\n\t\t\tif ( empty( $status ) ) {\n\t\t\t\t$status = $form_model->status;\n\t\t\t}\n\n\t\t\t//we need to empty fields cause we will send new data\n\t\t\t$form_model->clear_fields();\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data, 'forminator_sanitize_field' );\n\n\t\t// Build the fields\n\t\tif ( isset( $form_data ) ) {\n\t\t\t$fields = $form_data['wrappers'];\n\t\t\tunset( $form_data['wrappers'] );\n\t\t}\n\n\t\tforeach ( $fields as $row ) {\n\t\t\tforeach ( $row['fields'] as $f ) {\n\t\t\t\t$field = new Forminator_Form_Field_Model();\n\t\t\t\t$field->form_id = $row['wrapper_id'];\n\t\t\t\t$field->slug = $f['element_id'];\n\t\t\t\tunset( $f['element_id'] );\n\t\t\t\t$field->import( $f );\n\t\t\t\t$form_model->add_field( $field );\n\t\t\t}\n\t\t}\n\n\t\t// Sanitize settings\n\t\t$settings = forminator_sanitize_field( $form_data['settings'] );\n\n\t\t// Sanitize custom css\n\t\tif ( isset( $form_data['settings']['custom_css'] ) ) {\n\t\t\t$settings['custom_css'] = sanitize_textarea_field( $form_data['settings']['custom_css'] );\n\t\t}\n\n\t\t// Sanitize thank you message\n\t\tif ( isset( $form_data['settings']['thankyou-message'] ) ) {\n\t\t\t$settings['thankyou-message'] = $form_data['settings']['thankyou-message'];\n\t\t}\n\n\t\t// Sanitize user email message\n\t\tif ( isset( $form_data['settings']['user-email-editor'] ) ) {\n\t\t\t$settings['user-email-editor'] = $form_data['settings']['user-email-editor'];\n\t\t}\n\n\t\t// Sanitize admin email message\n\t\tif ( isset( $form_data['settings']['admin-email-editor'] ) ) {\n\t\t\t$settings['admin-email-editor'] = $form_data['settings']['admin-email-editor'];\n\t\t}\n\n\t\tif ( isset( $form_data['notifications'] ) ) {\n\t\t\t$notifications = forminator_sanitize_field( $form_data['notifications'] );\n\n\t\t\t$count = 0;\n\t\t\tforeach( $notifications as $notification ) {\n\t\t\t\tif( isset( $notification['email-editor'] ) ) {\n\t\t\t\t\t$notifications[ $count ]['email-editor'] = $form_data['notifications'][ $count ]['email-editor'];\n\t\t\t\t}\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$form_model->set_var_in_array( 'name', 'formName', $submitted_data );\n\n\t\t// Handle quiz questions\n\t\t$form_model->notifications = $notifications;\n\n\t\t$settings['formName'] = $title;\n\n\t\t$settings['version'] = $version;\n\t\t$form_model->settings = $settings;\n\n\t\t// status\n\t\t$form_model->status = $status;\n\n\t\t// Save data\n\t\t$id = $form_model->save();\n\n\t\t/**\n\t\t * Action called after form saved to database\n\t\t *\n\t\t * @since 1.11\n\t\t *\n\t\t * @param int $id - form id\n\t\t * @param string $title - form title\n\t\t * @param string $status - form status\n\t\t * @param array $fields - form fields\n\t\t * @param array $settings - form settings\n\t\t *\n\t\t */\n\t\tdo_action( 'forminator_custom_form_action_' . $action, $id, $title, $status, $fields, $settings );\n\n\t\t// add privacy settings to global option\n\t\t$override_privacy = false;\n\t\tif ( isset( $settings['enable-submissions-retention'] ) ) {\n\t\t\t$override_privacy = filter_var( $settings['enable-submissions-retention'], FILTER_VALIDATE_BOOLEAN );\n\t\t}\n\t\t$retention_number = null;\n\t\t$retention_unit = null;\n\t\tif ( $override_privacy ) {\n\t\t\t$retention_number = 0;\n\t\t\t$retention_unit = 'days';\n\t\t\tif ( isset( $settings['submissions-retention-number'] ) ) {\n\t\t\t\t$retention_number = (int) $settings['submissions-retention-number'];\n\t\t\t}\n\t\t\tif ( isset( $settings['submissions-retention-unit'] ) ) {\n\t\t\t\t$retention_unit = $settings['submissions-retention-unit'];\n\t\t\t}\n\t\t}\n\n\t\tforminator_update_form_submissions_retention( $id, $retention_number, $retention_unit );\n\n\t\twp_send_json_success( $id );\n\t}",
"public function form(){\n \t \tif($this->layoutWidgetInfo){\n \t\t$setting = json_decode($this->layoutWidgetInfo->setting, true);\n \t}\n\n \t//default option(type[text], cols[3-9], rows[1], label[$key], name[$key], value[$setting[$k]])\n \t//add option(class, id, stype, styleRow, required, placeholder, attr, [options, code])\n \t$settingForm = array(\n \t\t'layout_widget_id' \t=> array('type' => 'hidden', 'value' => $this->layoutWidgetInfo->layoutWidgetId),\n \t\t'widget_controller' => array('type' => 'hidden', 'value' => $this->widgetController),\n \t\t'header' \t=> array('type' => 'custom', 'value' => \"<h4 class='widget_header col-md-12'>{$this->widgetController}</h4>\", 'label' => ''),\n\n \t\t'title' => array(),\n \t\t'class'\t=> array(),\n 'bg_color'\t=> array('label' => 'Màu nền', 'class' => 'ColorPickerSliders',\n 'addElement' => '<a href=\"index.php?r=admin/help/view&helpId=4\" target=\"_blank\">Xem thêm</a>'),\n \t\t'category_id'\t=> array('type' => 'select_category', 'label' => 'Category', 'required' => true,\n \t\t\t\t'options' => CategoryExt::getCategoryList()),\n \t\t'style'\t=> array('type' => 'select', 'options' => $this->settingDefault['style']),\n \t\t'order_by' => array('type' => 'select', 'options' => $this->settingDefault['order_by']),\n \t\t'order_direction' => array('type' => 'select', 'options' => $this->settingDefault['order_direction']),\n \t);\n\n \t$settingAll = array(\n \t\t'cols' => '3-9'\n \t);\n\n \t//render setting from\n \tTemplateHelper::renderForm($settingForm, $setting, $settingAll);\n TemplateHelper::getTemplate('layout/_extra/add_setting.php', $setting);\n TemplateHelper::getTemplate('layout/_extra/color_picker.php');\n \t}",
"protected function applyCustomSettings()\n {\n $this->disable(array('read_counter', 'edit_counter', 'deleted_at', 'version', 'creator_user_id', 'created_at'));\n \n $this['updated_at']->setMetaWidgetClassName('ullMetaWidgetDate');\n \n //configure subject\n $this['subject']\n ->setLabel('Subject')\n ->setWidgetAttribute('size', 50)\n ->setMetaWidgetClassName('ullMetaWidgetLink');\n \n //configure body\n $this['body']\n ->setMetaWidgetClassName('ullMetaWidgetFCKEditor')\n ->setLabel('Text');\n \n // configure access level\n $this['ull_wiki_access_level_id']->setLabel(__('Access level', null, 'ullWikiMessages'));\n \n $this['is_outdated']->setLabel(__('Is outdated', null, 'ullWikiMessages'));\n \n // configure tags\n $this['duplicate_tags_for_search']\n ->setLabel('Tags')\n ->setMetaWidgetClassName('ullMetaWidgetTaggable');\n \n if ($this->isCreateOrEditAction())\n {\n $this->disable(array('id', 'updator_user_id', 'updated_at'));\n } \n\n if ($this->isListAction())\n {\n $this->disableAllExcept(array('id', 'subject'));\n $this->enable(array('updator_user_id', 'updated_at'));\n } \n }",
"function saveGeneralPageSettingsObject()\n\t{\n\t\tglobal $ilCtrl, $lng, $tpl;\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$aset = new ilSetting(\"adve\");\n\t\t\t$aset->set(\"use_physical\", $_POST[\"use_physical\"]);\n\t\t\tif ($_POST[\"block_mode_act\"])\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", (int) $_POST[\"block_mode_minutes\"]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$aset->set(\"block_mode_minutes\", 0);\n\t\t\t}\n\t\t\t\n\t\t\tilUtil::sendSuccess($lng->txt(\"msg_obj_modified\"), true);\n\t\t\t$ilCtrl->redirect($this, \"showGeneralPageEditorSettings\");\n\t\t}\n\t\t\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function save_settings_fields() {\n\n\t\t\tif ( isset( $_POST[ $this->setting_field_prefix ] ) ) {\n\t\t\t\tif ( ( isset( $_POST[ $this->setting_field_prefix ]['nonce'] ) ) && ( wp_verify_nonce( $_POST[ $this->setting_field_prefix ]['nonce'], 'learndash_permalinks_nonce' ) ) ) {\n\n\t\t\t\t\t$post_fields = $_POST[ $this->setting_field_prefix ];\n\n\t\t\t\t\tif ( ( isset( $post_fields['courses'] ) ) && ( ! empty( $post_fields['courses'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['courses'] = $this->esc_url( $post_fields['courses'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['lessons'] ) ) && ( ! empty( $post_fields['lessons'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['lessons'] = $this->esc_url( $post_fields['lessons'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['topics'] ) ) && ( ! empty( $post_fields['topics'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['topics'] = $this->esc_url( $post_fields['topics'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['quizzes'] ) ) && ( ! empty( $post_fields['quizzes'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['quizzes'] = $this->esc_url( $post_fields['quizzes'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ( isset( $post_fields['nested_urls'] ) ) && ( ! empty( $post_fields['nested_urls'] ) ) ) {\n\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = $this->esc_url( $post_fields['nested_urls'] );\n\n\t\t\t\t\t\tlearndash_setup_rewrite_flush();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// We check the Course Options > Course Builder setting. If this is set to 'yes' then we MUST keep the nested URLs set to true.\n\t\t\t\t\t\tif ( ! isset( $this->setting_option_values['nested_urls'] ) ) {\n\t\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = 'no';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( 'yes' !== $this->setting_option_values['nested_urls'] ) {\n\t\t\t\t\t\t\t$learndash_settings_courses_builder = get_option( 'learndash_settings_courses_management_display', array() );\n\t\t\t\t\t\t\tif ( ! isset( $learndash_settings_courses_builder['course_builder_shared_steps'] ) ) {\n\t\t\t\t\t\t\t\t$learndash_settings_courses_builder['course_builder_shared_steps'] = 'no';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( 'yes' === $learndash_settings_courses_builder['course_builder_shared_steps'] ) {\n\t\t\t\t\t\t\t\t$this->setting_option_values['nested_urls'] = 'yes';\n\n\t\t\t\t\t\t\t\tlearndash_setup_rewrite_flush();\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\tupdate_option( $this->settings_section_key, $this->setting_option_values );\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function formulize_save_postdata($post_id) {\n\t//verify if this is an auto save routine \n\t//If our form hasn't been submitted we don't want to do anything\n\t if (defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n return;\n\n // if our nonce isn't there, or we can't verify it, bail \n if (!isset($_POST['formulize_nonce']) \n \t|| !wp_verify_nonce($_POST['formulize_nonce'], 'my_formulize_nonce' )) return; \n \n // now we can actually save the data \n $allowed = array( \n 'a' => array( // on allow a tags \n 'href' => array() // and those anchors can only have href attribute \n ) \n ); \n \n if (isset( $_POST['formulize_select'])) \n update_post_meta($post_id, 'formulize_select', esc_attr( $_POST['formulize_select'])); \n}",
"protected function saving() {\n // This will get reimplemented by children when necessary\n }",
"public function saveWidgetList(){\n\t\t$widgets = ($this->input->post('widgets'))?$this->input->post('widgets'):array();\n\t\t$saveWidgets = $this->postUser('widgets', array(\n\t\t\t'user_id' => $this->self['id'],\n\t\t\t'widgets' => $widgets,\n\t\t));\n\t\tif($saveWidgets['status']=='TRUE'){\n\t\t\t$this->notify(1, 'Dashboard widgets saved');\n\t\t}else{\n\t\t\t$this->notify(0, $saveWidgets['message']);\n\t\t}\n\t\tredirect(base_url('dashboard/pharmacy/overview'));\n\t}",
"public function save()\n\t\t{\n#DS_Database_Archive::_log(__METHOD__.'()');\n\t\t\tif ( $this->_dirty ) {\n#DS_Database_Archive::_log(__METHOD__.'() data is dirty');\n\t\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t\tset_option( $this->option_name, $this->_options );\n\t\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t\t// save to filesystem\n#DS_Database_Archive::_log(__METHOD__.'() saving to file ' . $this->filename);\n\t\t\t\t\t$output = json_encode( $this->_options, JSON_PRETTY_PRINT );\n#DS_Database_Archive::_log(__METHOD__.'() contents: ' . $output);\n\t\t\t\t\tfile_put_contents( $this->filename, $output );\n\t\t\t\t}\n\t\t\t\t$this->_dirty = FALSE;\n\t\t\t}\n\t\t}",
"public function update( $new_instance, $old_instance ) {\n \t// processes widget options to be saved\n }",
"public function save()\n {\n $settings = Yii::$app->getModule('termsbox')->settings;\n $settings->set('title', $this->title);\n $settings->set('statement', $this->statement);\n $settings->set('content', $this->content);\n $settings->set('active', (boolean) $this->active);\n $settings->set('showAsModal', (boolean) $this->showAsModal);\n $settings->set('hideUnaccepted', (boolean) $this->hideUnaccepted);\n\n if ($setting = Setting::findByName('content')) {\n RichText::postProcess($this->content, $setting);\n }\n\n if ($this->reset) {\n User::updateAll(['termsbox_accepted' => false]);\n if (!Yii::$app->user->isGuest) {\n Yii::$app->user->getIdentity()->termsbox_accepted = false;\n }\n }\n\n return true;\n }",
"public function process_admin_options() {\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ) update_option( 'jigoshop_tgm_custom_gateway_enabled', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_enabled'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_enabled' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_title'] ) ) update_option( 'jigoshop_tgm_custom_gateway_title', jigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_title'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_title' );\n \t\t\tif( isset( $_POST['jigoshop_tgm_custom_gateway_description'] ) ) update_option( 'jigoshop_tgm_custom_gateway_description', \tjigowatt_clean( $_POST['jigoshop_tgm_custom_gateway_description'] ) ); else @delete_option( 'jigoshop_tgm_custom_gateway_description' );\n \t}"
] | [
"0.7273743",
"0.6993676",
"0.6899899",
"0.6891611",
"0.6851834",
"0.6835652",
"0.66703546",
"0.66661566",
"0.6583018",
"0.65817344",
"0.65798956",
"0.6526937",
"0.65107775",
"0.6481242",
"0.6473918",
"0.6467631",
"0.64426696",
"0.64127725",
"0.6412244",
"0.6380183",
"0.637891",
"0.6313734",
"0.63132393",
"0.63047034",
"0.63023424",
"0.6297758",
"0.62860453",
"0.6280737",
"0.6278791",
"0.626045",
"0.62566334",
"0.623539",
"0.6225387",
"0.62243587",
"0.6220882",
"0.62192476",
"0.6217348",
"0.62160623",
"0.62013376",
"0.6200869",
"0.620018",
"0.61985606",
"0.6192136",
"0.6191272",
"0.6185764",
"0.61836183",
"0.6170697",
"0.6169313",
"0.6169313",
"0.6151396",
"0.6147078",
"0.6145962",
"0.6116156",
"0.60870564",
"0.60662866",
"0.606577",
"0.60649794",
"0.6047856",
"0.60178274",
"0.60155493",
"0.601013",
"0.59978473",
"0.59855396",
"0.59752333",
"0.59665596",
"0.59626484",
"0.5954169",
"0.5940316",
"0.59371585",
"0.5917405",
"0.5907005",
"0.5901758",
"0.58702743",
"0.5868657",
"0.5865009",
"0.5860094",
"0.58596635",
"0.5858138",
"0.58529234",
"0.58479124",
"0.5846267",
"0.5842348",
"0.58409256",
"0.5837037",
"0.58332676",
"0.5832525",
"0.58289266",
"0.58233017",
"0.58109975",
"0.5799031",
"0.5790399",
"0.57862514",
"0.5784324",
"0.5781889",
"0.5780342",
"0.5779808",
"0.57619023",
"0.5761561",
"0.5760702",
"0.57575625",
"0.57562894"
] | 0.0 | -1 |
Save generated styles for the current user | public function saveStyles($playobj){
if(!$this->styles){
return false;
}
$existing_styles = json_decode($playobj->autogenerated_styles,true);
if(!is_array($existing_styles)){
$existing_styles = array();
}
$new_styles = (array)$this->styles;
if(md5(serialize($existing_styles)) != md5(serialize($new_styles))){
$this->playobj->autogenerated_styles = json_encode($new_styles);
$this->playobj->update();
$this->mobileobj->autogenerated_styles = json_encode($new_styles);
$this->mobileobj->update();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function saveCss()\n\t{\n\t\t$stylesheet = new \\File(str_replace(TL_ROOT . '/', '', $this->outputFolder . $this->cssFilename));\n\t\t$stylesheet->write($this->strStylesheet);\n\t\t$stylesheet->close();\n\t}",
"function gdl_generate_style_custom(){\n\n\t\tglobal $gdl_fh;\n\t\t\n\t\t$return_data = array('success'=>'-1', 'alert'=>'Cannot write style-custom.css file, you may try setting the style-custom.css file permission to 755 or 777 to solved this.');\n\t\t\n\t\t// initial the value of the style\n\t\t$file_path = SERVER_PATH . \"/style-custom.css\";\n\t\t$gdl_fh = @fopen($file_path, 'w');\n\t\t\n\t\tif( !$gdl_fh ){ die( json_encode($return_data) ); }\n\t\t\n\t\tgdl_get_style_custom_content();\n\t\t\n\t\t// close data\n\t\tfclose($gdl_fh);\t\n\t}",
"function webbusiness_save_css() {\n\t$save_custom_css = get_theme_mod('save-custom-css');\n\tif (get_theme_mod('save-custom-css') != \"\" && get_theme_mod('save-custom-css') < time()) {\n\t\t$data = webbusiness_load_custom_css();\n\t\tremove_theme_mod('save-custom-css');\n\t\t\n\t\t// write to file\n\t\t$uploads = wp_upload_dir();\n\t\t$uploads_dir = trailingslashit($uploads[\"basedir\"]);\n\t\t$img_path = get_template_directory_uri();\n\t\t$data = str_replace(\"../img/\", $img_path . \"/img/\", $data);\n\t\t\n\t\tfile_put_contents($uploads_dir . \"webbusiness.css\", $data);\n\t\tdelete_transient('webbusiness_custom_css');\n\t}\n}",
"public function saveForm() {\n\n\t\tforeach ( $this->getOptionsList() as $element ) {\n\t\t\t$element->save();\n\t\t}\n\t\t$this->setLastAction( self::ACTION_SAVE );\n\n\t\t$custom_style = new Custom_CSS_Style();\n\t\t$custom_style->reinit();\n\t}",
"function child_themer_style_editor_save() {\n\t\t\n\t\tcheck_ajax_referer( 'child-themer-style-editor', 'security' );\n\n\t\tif ( $_POST['code_state'] == 'Parse Error' ) {\n\t\t\t\n\t\t\techo 'Parse Error, Check Code.';\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tchild_themer_write_file( $path = get_stylesheet_directory() . '/style.css', $code = $_POST['child-themer-style-editor']['styles'] );\n\t\t\t\n\t\t\techo 'Stylesheet Updated';\n\t\t\t\n\t\t}\n\t\t\n\t\texit();\n\t\t\n\t}",
"protected function save()\n {\n $css = setcooki_path('plugin') . '/var/app.min.css';\n $json = setcooki_path('plugin'). '/var/options.json';\n $options = Option::get('wunderlist_todo_options', array());\n\n if(is_file($css))\n {\n @unlink($css);\n }\n if(is_file($json))\n {\n @chmod($json, 0755);\n }\n @file_put_contents($json, json_encode($options));\n }",
"function webbusiness_save_custom_css() {\n\tdelete_transient('webbusiness_custom_css');\n\twebbusiness_cache_custom_css();\n\tset_theme_mod('save-custom-css', time() + 3);\n}",
"function setStyle() {\n\t\tglobal $pun_user;\n\t\t\n\t\tif(isset($_COOKIE[$this->getConfig('sessionName').'_style']) && in_array($_COOKIE[$this->getConfig('sessionName').'_style'], $this->getConfig('styleAvailable')))\n\t\t\treturn;\n\t\t\n\t\t$styleName = $pun_user['style'];\n\t\t\n\t\tif(!in_array($styleName, $this->getConfig('styleAvailable'))) {\n\t\t\t$styleName = $this->getConfig('styleDefault');\n\t\t}\n\t\t\n\t\tsetcookie(\n\t\t\t$this->getConfig('sessionName').'_style',\n\t\t\t$styleName,\n\t\t\ttime()+60*60*24*$this->getConfig('sessionCookieLifeTime'),\n\t\t\t$this->getConfig('sessionCookiePath'),\n\t\t\t$this->getConfig('sessionCookieDomain'),\n\t\t\t$this->getConfig('sessionCookieSecure')\n\t\t);\n\t\treturn;\n\t}",
"public static function style_set() {\n\t\t global $I2_USER;\n\t\t if (self::$style == NULL) {\n\t\t\t if (isset($I2_USER)) {\n\t\t\t\t\t self::$style = ($I2_USER->style);\n\t\t\t }\n\t\t\t else {\n\t\t\t\t\t self::$style = 'default';\n\t\t\t }\n\t\t\t d('Style set to '.self::$style,7);\n\t\t }\n\t }",
"function gopathemes_save_custom_css(){\n \n if (!function_exists('ot_get_option')) {\n return;\n }\n \n /* CUSTOM COLOR STYLING */\n if (ot_get_option('haira_custom_styling', 'off') == 'on') {\n\n $primary_color = ot_get_option('haira_primary_color','#FFBA00');\n $secondary_color = ot_get_option( 'haira_secondary_color', '#333333' );\n $body_bg = ot_get_option( 'haira_body_background', '#f6f6f6' );\n \n $body_font = ot_get_option('haira_body_font', \n array(\n 'font-family' => \"source-sans-pro, sans-serif\", \n 'font-color' => '#8a8a8a', \n 'font-size' => '14px',\n 'line-height' => '24px',\n 'font-weight' => '400'\n ));\n \n $heading_font = ot_get_option('haira_heading_font', \n array(\n 'font-family' => \"source-sans-pro, sans-serif\", \n 'font-color' => '#333333', \n 'font-weight' => '700'\n ));\n \n $menu_typo = ot_get_option( 'haira_menu_typography',\n array(\n 'font-color' => '#FFFFFF', \n 'font-size' => '13px', \n 'font-weight' => '400', \n 'letter-spacing' => '0.03em', \n 'text-transform' => 'none'\n ));\n \n $submenu_typo = ot_get_option( 'haira_submenu_typography',\n array(\n 'font-color' => '#FFFFFF', \n 'font-size' => '12px', \n 'font-weight' => '400', \n 'line-height' => '45px', \n 'letter-spacing' => '0.03em', \n 'text-transform' => 'none'\n ));\n\n $variables = array(\n 'primary-color' => $primary_color,\n 'second-color' => $secondary_color,\n 'bg-color' => $body_bg,\n \n 'header-bg' => ot_get_option( 'haira_header_bg' ),\n 'header-height' => ot_get_option( 'haira_header_height' ),\n \n 'menu-fs' => $menu_typo['font-size'],\n 'menu-link-color' => $menu_typo['font-color'],\n 'menu-link-color-hover' => ot_get_option( 'haira_menu_link_color_hover' ),\n 'menu-link-bg-hover' => ot_get_option( 'haira_menu_link_bg_hover' ),\n 'menu-link-ls' => $menu_typo['letter-spacing'],\n 'menu-font-weight' => $menu_typo['font-weight'],\n 'menu-text-transform' => $menu_typo['text-transform'],\n \n 'submenu-bg' => ot_get_option( 'haira_submenu_bg' ),\n 'submenu-fs' => $submenu_typo['font-size'],\n 'submenu-link-color' => $submenu_typo['font-color'],\n 'submenu-link-color-hover' => ot_get_option( 'haira_submenu_link_color_on_hover' ),\n 'submenu-link-bg-hover' => ot_get_option( 'haira_submenu_link_bg_on_hover' ),\n 'submenu-link-ls' => $submenu_typo['letter-spacing'],\n 'submenu-font-weight' => $submenu_typo['font-weight'],\n 'submenu-text-transform' => $submenu_typo['text-transform'],\n 'submenu-lh' => $submenu_typo['line-height'],\n \n 'heading-color' => $heading_font['font-color'],\n 'heading-font' => $heading_font['font-family'],\n 'hweight' => $heading_font['font-weight'],\n \n 'text-color' => $body_font['font-color'],\n 'body-font' => $body_font['font-family'],\n 'fsize' => $body_font['font-size'],\n 'lheight' => $body_font['line-height'],\n 'bweight' => $body_font['font-weight']\n );\n\n\n $default_vars = file( get_template_directory().'/scss/_vars.scss' );\n \n gopathemes_compile_css( haira_setup_scss_vars($default_vars, $variables) );\n }\n \n}",
"public function createStylesJsonCache()\n {\n if (!file_exists($this->_styleJsonLocation) || filemtime($this->_styleJsonLocation) <= (time() - 60 * 60 * 24 * 15)) { // Recheck every 15 days\n function swimStroke($i)\n {\n if ($i == 0) return 'Wisselslag';\n elseif ($i == 1) return 'Vlinderslag';\n elseif ($i == 2) return 'Rugslag';\n elseif ($i == 3) return 'Schoolslag';\n elseif ($i == 4) return 'Vrije slag';\n }\n\n /* Get all the strokes */\n try {\n $this->api->setPath('styles/all');\n $data = $this->api->getData();\n $styles = array();\n foreach ($data as $k => $d) {\n @$styles[$d->swimid] = ($d->swimcount > 1 ? $d->swimcount . \" x \" : \"\") . $d->swimdistance . \"m \" . swimStroke($d->swimstroke);\n }\n file_put_contents($this->_styleJsonLocation, json_encode($styles, JSON_PRETTY_PRINT));\n } catch (Exception $e) {\n echo 'Error: ', $e->getMessage(), \"\\n\";\n exit;\n }\n }\n }",
"function ag_set_predefined_style() {\n\tif(!isset($_POST['lcwp_nonce']) || !wp_verify_nonce($_POST['lcwp_nonce'], 'lcwp_nonce')) {die('Cheating?');}\n\tif(!isset($_POST['style'])) {die('data is missing');}\n\n\trequire_once(AG_DIR .'/settings/preset_styles.php');\n\trequire_once(AG_DIR .'/functions.php');\n\t\n\t$style_data = ag_preset_styles_data($_POST['style']);\n\tif(empty($style_data)) {die('Style not found');}\n\t\n\t\n\t// override values\n\tforeach($style_data as $key => $val) {\n\t\tupdate_option($key, $val);\t\t\n\t}\n\n\n\t// if is not forcing inline CSS - create static file\n\tif(!get_option('mg_inline_css')) {\n\t\tag_create_frontend_css();\n\t}\n\t\n\tdie('success');\n}",
"public function regenerate_css_on_mec_settings_save() {\n\t\tpresscore_set_force_regenerate_css( true );\n\t}",
"public static function style_changed() {\n\t\tglobal $I2_USER;\n\t\tif (isset($I2_USER)) {\n\t\t\t$I2_USER->recache('style');\n\t\t\tself::$style = ($I2_USER->style);\n\t\t\tCSS::flush_cache($I2_USER);\n\t\t\tJS::flush_cache($I2_USER);\n\t\t}\n\t\telse {\n\t\t\tself::$style = 'default';\n\t\t}\n\t\td('Style changed, is now: '.self::$style,7);\n\t}",
"protected function generateCSS() {}",
"public function write_file() {\r\n\r\n\t\t$css = av5_styles( false );\r\n\r\n\t\t// If the folder doesn't exist, create it.\r\n\t\tif ( ! file_exists( $this->get_path( 'folder' ) ) ) {\r\n\t\t\twp_mkdir_p( $this->get_path( 'folder' ) );\r\n\t\t}\r\n\r\n\t\t$filesystem\t = $this->get_filesystem();\r\n\t\t$write_file\t = (bool) $filesystem->put_contents( $this->get_path( 'file' ), $css );\r\n\t\tif ( $write_file ) {\r\n\t\t\t$this->updated_file();\r\n\t\t}\r\n\t\treturn $write_file;\r\n\t}",
"function tm_redux_save(){\n\t\n\tglobal $howes;\n\t// Checking if the dynamic-style.php edit.. If yes than re-generate dynamic-style.css files.\n\t$dynamicFile = get_template_directory().'/css/dynamic-style.php';\n\t$styleFile = get_template_directory().'/css/dynamic-style.css';\n\t$styleMinFile = get_template_directory().'/css/dynamic-style.min.css';\n\t\n\t// Getting current file in MD5\n\t$dynamicFileMD5 = md5_file( $dynamicFile );\n\t\n\t// Getting value of MD5\n\t$dynamic_generated = get_option('tm_dynamicstyle_generated');\n\t\n\t// Getting Current theme version\n\t$my_theme = wp_get_theme( 'howes' );\n\t$currentThemeVersion = $my_theme->get( 'Version' );\n\t$storedThemeVersion = get_option('tm_howes_version');\n\t\n\t// Checking if theme updated\n\t$regenerateDynamicCSS = false;\n\tif($dynamic_generated!=$dynamicFileMD5){\n\t\t$regenerateDynamicCSS = true;\n\t}\n\t\n\t// Regenerating all CSS file as the theme version is updated\n\tif($currentThemeVersion!=$storedThemeVersion){\n\t\ttm_regenerate_all_css_js();\n\t}\n\t\n\t\n\tif( ($currentThemeVersion!=$storedThemeVersion) && is_array($howes) && count($howes)>0 ){\n\t\ttm_reset_tgm_infobox(); // Restting TGM notification box to show if user need to update VC or other plugin\n\t\t$regenerateDynamicCSS = true;\n\t\tupdate_option('tm_howes_version', $currentThemeVersion);\n\t}\n\t\n\n\t\n\t// checking and running the dynamic-style.css generator\n\tif( !file_exists( $styleFile ) || !file_exists( $styleFile ) || $regenerateDynamicCSS==true ){\n\t\ttm_regenerate_dynamic_css();\n\t}\n\t\n\t// Updating\n\tupdate_option('tm_dynamicstyle_generated', $dynamicFileMD5);\n\t\n}",
"public function write() {\n\t\tcopy($this->_path, str_replace('.css', getDatetime(time(), 'Y-m-d_H-i-s') . '.css', $this->_path));\n\t\t$cssData = preg_replace('/\\/\\*\\* @_START_@ \\*\\/(.*?)\\/\\*\\* @_END_@ \\*\\//s', '/** @_START_@ */\n' . $this->toString() . '\n/** @_END_@ */', $this->_fileContent);\n\t\tfile_put_contents($this->_path, $cssData);\n\t}",
"public function write_file() {\n\n\t\t$css = array();\n\t\t$configs = Kirki::$config;\n\t\tforeach ( $configs as $config_id => $args ) {\n\t\t\t// Get the CSS we want to write.\n\t\t\t$css[ $config_id ] = apply_filters( \"kirki/{$config_id}/dynamic_css\", Kirki_Modules_CSS::loop_controls( $config_id ) );\n\t\t}\n\t\t$css = implode( $css, '' );\n\n\t\t// Minimize the CSS a bit.\n\t\t$css = str_replace( array( \"\\n\", \"\\t\", \"\\r\\n\" ), '', $css );\n\t\t$css = str_replace( array( '{ ', '{ ', '{ ' ), '{', $css );\n\t\t$css = str_replace( ': ', ':', $css );\n\t\t$css = str_replace( array( '; ', '; ', '; ' ), ';', $css );\n\t\t$css = explode( '}', $css );\n\t\t$css = array_unique( $css );\n\t\t$css = implode( $css, '}' );\n\n\t\t// If the folder doesn't exist, create it.\n\t\tif ( ! file_exists( $this->get_path( 'folder' ) ) ) {\n\t\t\twp_mkdir_p( $this->get_path( 'folder' ) );\n\t\t}\n\n\t\t$filesystem = $this->get_filesystem();\n\t\t$write_file = (bool) $filesystem->put_contents( $this->get_path( 'file' ), $css );\n\t\tif ( ! $write_file ) {\n\t\t\t$this->fallback = true;\n\t\t\tset_transient( 'kirki_css_write_to_file_failed', true, HOUR_IN_SECONDS );\n\t\t}\n\t\treturn $write_file;\n\n\t}",
"function wp_ajax_save_user_color_scheme()\n {\n }",
"public function generateStylesheet(){\n\n $file= fopen($this->stylesheet_url, 'w');\n\n $stylesheet_attributes= collect($this->getAttributes())->except($this->excluded);\n\n $success=true;\n $stylesheet_attributes->each(function($item, $key) use ($file){\n if( fwrite($file, \"\\$\".$key.\": \".$item.\";\\n\") ===false){\n throw new Exception(\"Error writing 'assets/sass/_custom_variables.scss' stylesheet\", 1);\n }\n //echo '$'.$key.': '.$item.'\\n';\n });\n\n fclose($file);\n\n return true;\n }",
"function modStyle(){\n if(isset($_POST['style']))\n $_SESSION['style'] = $_POST['style'];\n }",
"public function write_styles()\n \t{\n\t\t$result=\"\";\n\t\t\n\t\tforeach($this->styles as $style)\n\t\t{\n\t\t\tif (strpos($style,'http://')!==0)\n\t\t\t\t$style='/css/'.$style.'.css';\n\n\t\t\t$result.=\"\\t\\t<link rel=\\\"stylesheet\\\" href=\\\"$style\\\" type=\\\"text/css\\\" />\\n\";\n\t\t}\n\t\t\t\n\t\treturn $result;\n \t}",
"function saveFont()\n\t\t{\n\t\t $saved = array();\n\t\t $saved[ 'family' ] = $this->FontFamily;\n\t\t $saved[ 'style' ] = $this->FontStyle;\n\t\t $saved[ 'sizePt' ] = $this->FontSizePt;\n\t\t $saved[ 'size' ] = $this->FontSize;\n\t\t $saved[ 'curr' ] =& $this->CurrentFont;\n\t\t $saved[ 'color' ] = $this->TextColor; //EDITEI\n\t\t $saved[ 'bgcolor' ] = $this->FillColor; //EDITEI\n\t\t $saved[ 'HREF' ] = $this->HREF; //EDITEI\n\t\t $saved[ 'underline' ] = $this->underline; //EDITEI\n\t\t $saved[ 'strike' ] = $this->strike; //EDITEI\n\t\t $saved[ 'SUP' ] = $this->SUP; //EDITEI\n\t\t $saved[ 'SUB' ] = $this->SUB; //EDITEI\n\t\t $saved[ 'linewidth' ] = $this->LineWidth; //EDITEI\n\t\t $saved[ 'drawcolor' ] = $this->DrawColor; //EDITEI\n\t\t $saved[ 'is_outline' ] = $this->outline_on; //EDITEI\n\n\t\t return $saved;\n\t\t}",
"public function configSave()\n\t{\n\t\t$section = Mage::app()->getRequest()->getParam('section');\n\t\tif ($section == 'mtghost_design')\n\t\t{\n\t\t\t$websiteCode = Mage::app()->getRequest()->getParam('website');\n\t\t\t$storeCode = Mage::app()->getRequest()->getParam('store');\n\t\t\t\n\t\t\tMage::getSingleton('mtghost/cssgen_generator')->generateCss('design', $websiteCode, $storeCode);\n\t\t}else if($section == 'mtghost'){\n $websiteCode = Mage::app()->getRequest()->getParam('website');\n $storeCode = Mage::app()->getRequest()->getParam('store');\n\n Mage::getSingleton('mtghost/cssgen_generator')->generateCss('layout', $websiteCode, $storeCode);\n }\n\t}",
"public static function output_global_styles()\n {\n }",
"function fn_adt_css_write($form_url)\n{\n global $wp_filesystem;\n\n check_admin_referer('adt_css_save_nonce');\n\n $csstext = esc_textarea($_POST['txt_adt_css']); //sanitize the input\n $form_fields = array('txt_adt_css'); //fields that should be preserved across screens\n $method = ''; //leave this empty to perform test for 'direct' writing\n\n $context = ADT_PLUGIN_DIR_PATH.'assets/css/'; //target folder\n\n $form_url = wp_nonce_url($form_url, 'adt_css_save_nonce'); //page url with nonce value\n\n if(!fn_adt_filesystem_init($form_url, $method, $context, $form_fields)) {\n return false; //stop further processign when request form is displaying\n }\n\n /*\n * now $wp_filesystem could be used\n * get correct target file first\n **/\n $target_dir = $wp_filesystem->find_folder($context);\n $target_file = trailingslashit($target_dir).'adt_custom_css.css';\n\n\n /* write into file */\n if(!$wp_filesystem->put_contents($target_file, $csstext, FS_CHMOD_FILE))\n\t{\n\t\treturn new WP_Error('writing_error', 'Error when writing file'); //return error object\n\t}\n\telse\n\t{\n\t\t//update css version\n\t\t$css_version=1;\n\t\t$adt_css_version=get_option('adt_css_version');\n\t\tif($adt_css_version==FALSE)\n\t\t{\n\n\t\t\t$deprecated = null;\n\t\t $autoload = 'no';\n\t\t add_option( 'adt_css_version', $css_version, $deprecated, $autoload );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$css_version=$adt_css_version+1;\n\t\t\tupdate_option( 'adt_css_version', $css_version );\n\t\t}\n\t}\n return $csstext;\n}",
"function register_style() {\n}",
"public function saveAction()\n {\n $result = false;\n \n $input = new Zend_Filter_Input(array(), array(), $_GET);\n $user = Ediary_User::find($this->_user->id);\n if ($user == null) {\n return;\n }\n \n if ($input->isValid()) {\n $user->theme = $input->theme;\n $result = $user->update();\n if ($result) { // 更换主题后需要刷新储存在session里的缓存值\n $this->_user->theme = $input->theme;\n Zend_Registry::set('user', $this->_user); \n }\n \n }\n $this->_helper->json( array('result' => $result) );\n }",
"function soliloquy_custom_css_save( $settings, $post_id ) {\n\n $settings['config']['custom_css'] = isset( $_POST['_soliloquy']['custom_css'] ) ? trim( esc_html( $_POST['_soliloquy']['custom_css'] ) ) : '';\n return $settings;\n\n}",
"function child_themer_style_editor_init() {\n\t\n\tif ( ! current_user_can( 'administrator' ) || ! is_child_theme() || ! child_themer_get_settings( 'enable_fe_style_editor' ) )\n\t\treturn;\n\t\n\tif ( ! is_admin() )\n\t\trequire_once( THMR_DIR . 'lib/functions/style-editor.php' );\t\t\n\t\n\tadd_action( 'wp_ajax_child_themer_style_editor_save', 'child_themer_style_editor_save' );\n\t/**\n\t * Use ajax to update the theme styles based on the posted values.\n\t *\n\t * @since 1.0.0\n\t */\n\tfunction child_themer_style_editor_save() {\n\t\t\n\t\tcheck_ajax_referer( 'child-themer-style-editor', 'security' );\n\n\t\tif ( $_POST['code_state'] == 'Parse Error' ) {\n\t\t\t\n\t\t\techo 'Parse Error, Check Code.';\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tchild_themer_write_file( $path = get_stylesheet_directory() . '/style.css', $code = $_POST['child-themer-style-editor']['styles'] );\n\t\t\t\n\t\t\techo 'Stylesheet Updated';\n\t\t\t\n\t\t}\n\t\t\n\t\texit();\n\t\t\n\t}\n\t\t\n}",
"function hook_image_style_save($style) {\n // If a module defines an image style and that style is renamed by the user\n // the module should update any references to that style.\n if (isset($style['old_name']) && $style['old_name'] == variable_get('mymodule_image_style', '')) {\n variable_set('mymodule_image_style', $style['name']);\n }\n}",
"function drum_beat_add_editor_styles() {\n add_editor_style( 'assets/stylesheets/wysiwyg-style.css' );\n}",
"public function store(CreateStylesRequest $request)\n\t{\n\t $request = $this->saveFiles($request);\n\t\tStyles::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.styles.index');\n\t}",
"function bsc_add_editor_styles() {\n\t\t\tadd_editor_style( get_stylesheet_uri() );\n\t\t}",
"function harvest_editor_styles(){\n\tadd_editor_style( str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=Lato:400,700' ) );\n\tadd_editor_style( str_replace( ',', '%2C', '//fonts.googleapis.com/css?family=Bitter:400,700' ) );\n\t\n\tadd_editor_style( 'editor-style.css' );\t\n}",
"abstract public function register_style();",
"protected function _afterSave()\n {\n if ($this->isValueChanged()) {\n Mage::getModel('core/design_package')->cleanMergedJsCss();\n }\n }",
"private function save() {\n global $config;\n\n //Save Config\n file_put_contents($config[\"usersFile\"],json_encode($this->users,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));\n }",
"function saveFont()\n\t{\n\n\t\t$saved = array();\n\n\t\t$saved[ 'family' ] = $this->FontFamily;\n\t\t$saved[ 'style' ] = $this->FontStyle;\n\t\t$saved[ 'sizePt' ] = $this->FontSizePt;\n\t\t$saved[ 'size' ] = $this->FontSize;\n\t\t$saved[ 'curr' ] =& $this->CurrentFont;\n\n\t\treturn $saved;\n\n\t}",
"public function saveFont() {\r\n\t\t$saved = array();\r\n\t\t\r\n\t\t$saved[ 'family' ] \t= $this->FontFamily;\r\n\t\t$saved[ 'style' ] \t= $this->FontStyle;\r\n\t\t$saved[ 'sizePt' ] \t= $this->FontSizePt;\r\n\t\t$saved[ 'size' ] \t= $this->FontSize;\r\n\t\t$saved[ 'curr' ] \t=& $this->CurrentFont;\r\n\t\t\r\n\t\treturn $saved;\r\n\t}",
"function tsk_editor_styles() {\n\t\tadd_editor_style( 'assets/css/editor-style.css' );\n\t}",
"function saveRulesToFile() {\n\t\tglobal $sugar_config;\n\n\t\t$file = $this->rulesCache.\"/{$this->user->id}.php\";\n\t\t$GLOBALS['log']->info(\"SUGARROUTING: Saving rules file [ {$file} ]\");\n\t\twrite_array_to_file('routingRules', $this->rules, $file);\n\t}",
"public function run()\n {\n Style::create([\n 'type' => 'Masculino',\n 'description' => 'Produto para homem',\n ]);\n Style::create([\n 'type' => 'Feminino',\n 'description' => 'Produto para mulher',\n ]);\n Style::create([\n 'type' => 'Unisex',\n 'description' => 'Produto para homem ou mulher',\n ]);\n }",
"public static function printStyle (){\n\t?>\n\t\t\t\t\n\t\t\t\t<!-- Stylesheet Settings -->\n\t\t\t\t<h3>Stylesheet Settings</h3>\n\t\t\t\t<table class='form-table'>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr valign='top'>\n\t\t\t\t\t\t\t<th scope='row'><label for='gdocs_style_dir'>Directory</label></th>\n\t\t\t\t\t\t\t<td><span class='description'><?php bloginfo ('wpurl')?>/</span><input type='text' size=\"30\" id=\"gdocs_style_dir\" name=\"gdocs_style_dir\" value=\"<?php echo get_option ('gdocs_style_dir'); ?>\" /><br /><span class='description'><strong>Specify the directory where you keep your CSS stylesheets in.</strong></span></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t\n\t<?php\n\t}",
"function drawStyle()\r\n\t{\r\n\t}",
"public function mm_default_css() {\n $default_css = CSS_DIR . DEFAULT_CSS;\n $new_css = CSS_DIR . CUSTOM_CSS;\n ob_start();\n @include( $default_css );\n $css = ob_get_contents();\n ob_end_clean();\n \n $css = stripslashes ( $css );\n \n update_option('mm_gallery_css', $css);\n file_put_contents($new_css, $css); \n }",
"function update_file() {\r\n\t\tset_transient( 'av5_css_file', true );\r\n\t}",
"function leafbase_add_editor_styles() {\n\n\tadd_editor_style( 'custom-editor-style.css');\n\n}",
"public function custom_colors_ajax_save() {\n\n\t\tglobal $wpdb;\n\n\t\t// Check that the user has the right permissions.\n\t\tif ( ! current_user_can( 'switch_themes' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! empty( $_POST['data'] ) && isset( $_POST['data']['values'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification\n\n\t\t\t$existing_colors = get_option( 'avada_custom_color_schemes', [] );\n\n\t\t\tif ( ! empty( $_POST['data']['type'] ) && 'import' !== $_POST['data']['type'] ) { // phpcs:ignore WordPress.Security.NonceVerification\n\t\t\t\t$scheme = [];\n\t\t\t\t$scheme_colors = wp_unslash( $_POST['data']['values'] ); // phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput\n\t\t\t\t$scheme_name = isset( $_POST['data']['name'] ) ? sanitize_text_field( wp_unslash( $_POST['data']['name'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification\n\n\t\t\t\tif ( defined( 'FUSION_BUILDER_PLUGIN_DIR' ) ) {\n\t\t\t\t\t$fb_options = get_option( 'fusion_options' );\n\t\t\t\t\tforeach ( $scheme_colors as $option => $value ) {\n\t\t\t\t\t\tif ( array_key_exists( $option, $fb_options ) ) {\n\t\t\t\t\t\t\t$scheme_colors[ $option ] = $fb_options[ $option ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$scheme[] = [\n\t\t\t\t\t'name' => $scheme_name,\n\t\t\t\t\t'values' => $scheme_colors,\n\t\t\t\t];\n\n\t\t\t\t// Check if scheme trying to be saved already exists, if so unset and merge.\n\t\t\t\tif ( isset( $_POST['data']['type'] ) && 'update' === $_POST['data']['type'] ) { // phpcs:ignore WordPress.Security.NonceVerification\n\t\t\t\t\t// Remove existing saved version and and merge in.\n\t\t\t\t\tforeach ( $existing_colors as $key => $existing_color ) {\n\t\t\t\t\t\tif ( $existing_color['name'] === $scheme_name ) {\n\t\t\t\t\t\t\tunset( $existing_colors[ $key ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$schemes = array_merge( $scheme, $existing_colors );\n\t\t\t\t} elseif ( is_array( $existing_colors ) ) {\n\t\t\t\t\t$schemes = array_merge( $scheme, $existing_colors );\n\t\t\t\t} else {\n\t\t\t\t\t$schemes = $scheme;\n\t\t\t\t}\n\n\t\t\t\t// Sanitize schemes.\n\t\t\t\t$schemes = $this->sanitize_color_schemes( $schemes );\n\n\t\t\t\tupdate_option( 'avada_custom_color_schemes', $schemes );\n\t\t\t\techo wp_json_encode(\n\t\t\t\t\t[\n\t\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t\t'action' => '',\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\t$schemes = stripslashes( stripcslashes( wp_unslash( $_POST['data']['values'] ) ) ); // phpcs:ignore WordPress.Security\n\t\t\t\t$schemes = json_decode( $schemes, true );\n\t\t\t\tif ( is_array( $existing_colors ) ) {\n\t\t\t\t\t// Add imported schemes to existing set.\n\t\t\t\t\t$schemes = array_merge( $schemes, $existing_colors );\n\t\t\t\t}\n\n\t\t\t\t// Sanitize schemes.\n\t\t\t\t$schemes = $this->sanitize_color_schemes( $schemes );\n\n\t\t\t\tupdate_option( 'avada_custom_color_schemes', $schemes );\n\n\t\t\t\techo wp_json_encode(\n\t\t\t\t\t[\n\t\t\t\t\t\t'status' => 'success',\n\t\t\t\t\t\t'action' => '',\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tdie();\n\t}",
"function add_editor_styles() {\n add_editor_style( '/admin/css/editor-styles.css' );\n}",
"public function store(CreateStyleRequest $request)\n { \n // dd($request->all());\n $style = Style::create([\n 'name' => $request->name,\n 'description' => $request->description,\n 'slug' => $request->slug,\n 'icon' => $request->icon,\n 'image' => $request->image,\n 'music' => $request->music,\n 'family' => $request->family,\n 'color' => $request->color,\n 'origin' => $request->origin, \n 'music' => $request->music,\n 'year' => $request->year,\n ]);\n\n if ($request->hasFile('image')) {\n $style->update(['image' => $request->image->store('styles') ]); \n }\n\n session()->flash('success', 'Style added successfully');\n\n return redirect(route('styles.index'));\n }",
"function dynamik_theme_settings_save()\r\n{\r\n\tcheck_ajax_referer( 'theme-settings', 'security' );\r\n\t\r\n\t$update = $_POST['dynamik'];\r\n\tupdate_option( 'dynamik_gen_theme_settings', $update );\r\n\t\r\n\tdynamik_write_files( $css = true, $ez = false, $custom = false );\r\n\tdynamik_protect_folders();\r\n\t\r\n\techo 'Saved!';\r\n\texit();\r\n}",
"function spip2odt_ajouter_styles_perso($fichier_perso, $fichier_oasis){\n\n\tlire_fichier($fichier_oasis, $styles);\n\t\n\t$f = find_in_path($fichier_perso);\n\tlire_fichier($f, $styles_defaut);\n\t$ajout_styles = \"\";\n\tif (preg_match_all(\",<((style:style|text:list-style|text:outline-style)\\s[^/>]*)(/>|>.*</(\\\\2)>),Uims\",$styles_defaut,$matches,PREG_SET_ORDER)){\n\t\tforeach($matches as $match){\n\t\t\tif (preg_match(\",style:name=([\\\"'])([^\\\\1]*)\\\\1,Ums\",$match[1],$regs)){\n\t\t\t\t$nom_style = $regs[2];\n\t\t\t\tif (!preg_match(\",style:name=(['\\\"])$nom_style\\\\1,\",$styles))\n\t\t\t\t\t$ajout_styles .= $match[0];\n\t\t\t}\n\t\t}\n\t}\n\t$styles = str_replace('</office:styles>',$ajout_styles.'</office:styles>',$styles);\t\n\tecrire_fichier($fichier_oasis, $styles);\n\n}",
"function genFormStyle(){\n $res = '<form action=\"preferences.php\" method=\"post\">';\n $res .= '<p>Selctionner un style</p>';\n $res .= '<select name=\"style\" id=\"style\">';\n if(isset($_SESSION['style'])){\n switch($_SESSION['style']){\n case \"blue.css\":\n $res .= '<option value=\"blue.css\" selected>Blue</option>';\n $res .= '<option value=\"italic.css\">Italic</option>';\n $res .= '<option value=\"vertetjaune.css\">V et J</option>';\n break;\n case \"italic.css\":\n $res .= '<option value=\"blue.css\">Blue</option>';\n $res .= '<option value=\"italic.css\" selected>Italic</option>';\n $res .= '<option value=\"vertetjaune.css\">V et J</option>';\n break;\n case \"vertetjaune.css\":\n $res .= '<option value=\"blue.css\">Blue</option>';\n $res .= '<option value=\"italic.css\">Italic</option>';\n $res .= '<option value=\"vertetjaune.css\" selected>V et J</option>';\n break;\n }\n }\n else{\n $res .= '<option value=\"blue.css\">Blue</option>';\n $res .= '<option value=\"italic.css\">Italic</option>';\n $res .= '<option value=\"vertetjaune.css\">V et J</option>';\n }\n $res .= '</select>';\n $res .= '<button value=\"submit\">Go !</button>';\n $res .= '</form>';\n echo $res;\n }",
"public function mm_update_css($css) {\n $file = CSS_DIR . CUSTOM_CSS;\n $css = stripslashes ( $css );\n file_put_contents($file, $css); \n }",
"private function _handleStyleBased()\n {\n if (Theme::getComponent()) {\n $css = $this->styleBasedCss[Theme::getComponent()->style];\n $this->css = ArrayHelper::merge($css, $this->css);\n }\n }",
"function make_css( $args, $assoc_args ) {\n if ( class_exists( 'TF_Styling_Control' ) ) {\n if ( TF_Model::create_stylesheets() ) {\n WP_CLI::success( \"Stylesheet succesfully created.\" );\n } else {\n WP_CLI::error( \"Could not create stylesheet.\" );\n }\n }\n }",
"function generate_options_css($newdata) { \n\n\tglobal $as_of;\n\t\n\t$as_of = $newdata;\n\t\t\n\t$uploads_dir = wp_upload_dir();\n\t\n\t$theme_data = wp_get_theme(); // get theme info\n\t$theme \t\t= sanitize_title( $theme_data ); // make ShowShop Fashion to be showshop-fashion\n\t\n\t\n\t$as_upload_folder\t\t= trailingslashit( $uploads_dir['basedir'] ) .$theme.'-options'; // \"wp-content/uploads\" folder\n\t$theme_options_folder\t= trailingslashit( get_stylesheet_directory() ) . 'admin_save_options/'; // theme folder\n\t\n\t\n\t// CREATE OPTIONS CSS\n\tob_start(); // Capture all output (output buffering)\n\trequire( $theme_options_folder . 'theme_options_styles.php' ); // Generate CSS\n\t$css = ob_get_clean(); // Get generated CSS (output buffering)\n\n\t// CREATE DYNAMIC JS\n\tob_start(); // Capture all output (output buffering)\n\trequire( $theme_options_folder . 'theme_options_js.php' ); // Generate JS\n\t$js = ob_get_clean(); // Get generated JS (output buffering)\n\n\n\t// CREATE ADMIN LOGIN CSS\n\tob_start(); // Capture all output (output buffering)\n\trequire( $theme_options_folder . 'custom_login_css.php' ); // Generate JS\n\t$cl_css = ob_get_clean(); // Get generated JS (output buffering)\n\n\t\n\t\n\t/** \n\t *\tCREATE FOLDER IN \"WP-CONTENT/UPLOADS\" TO WRITE \n\t *\tWrite to theme_options_styles.css and theme_options_js.js file\n\t *\n\t */ \n\t\n\tWP_Filesystem();\n\tglobal $wp_filesystem;\n\t\n\t// if no ShowShop theme options dir in \"uploads\" folder, create one\n\t$target_dir = $wp_filesystem->is_dir( $as_upload_folder );\n\tif( !$target_dir ) {\n\t\t\n\t\t$wp_filesystem->mkdir($as_upload_folder, FS_CHMOD_DIR);\n\n\t}\n\t\n\t\n\t$as_upload_dir_exists = is_dir( $as_upload_folder );\n\t\n\tif( $as_upload_dir_exists ) {\n\t\t// create files in wp-content/uploads dir\n\t\tif ( ! $wp_filesystem->put_contents( $as_upload_folder . '/theme_options_styles.css', $css, 0644 ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! $wp_filesystem->put_contents( $as_upload_folder . '/theme_options_js.js', $js, 0644 ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif ( ! $wp_filesystem->put_contents( $as_upload_folder . '/custom_login_css.css', $cl_css, 0644 ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}else{\n\t\t// create files in \"ADMIN_SAVE_OPTIONS\" theme dir\n\t\tif ( ! $wp_filesystem->put_contents( $theme_options_folder . '/theme_options_styles.css', $css, 0644 ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! $wp_filesystem->put_contents( $theme_options_folder . '/theme_options_js.js', $js, 0644 ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif ( ! $wp_filesystem->put_contents( $theme_options_folder . '/custom_login_css.css', $cl_css, 0644 ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}\n\t\n}",
"private function loadStyles() {\n\t\tif(isset($this->styles) && $this->styles != \"\") {\n\t\t\tforeach (explode(\",\", $this->styles) as $style) {\n\t\t\t\tOCP\\Util::addStyle('ocDashboard', 'widgets/'.$this->id.'/'.$style);\n\t\t\t}\n\t\t}\n\t}",
"function editor_styles() {\n\n\tadd_editor_style( 'assets/css/editor-style.css' );\n\n}",
"public function saveSettingsAjax()\n {\n $formId = absint($_REQUEST['form_id']);\n\n $css = $_REQUEST['custom_css'];\n $js = $_REQUEST['custom_js'];\n $css = wp_strip_all_tags(wp_unslash($css));\n $js = wp_unslash($js);\n\n $this->store($formId, '_custom_form_css', $css);\n $this->store($formId, '_custom_form_js', $js);\n\n wp_send_json_success([\n 'message' => __('Custom CSS and JS successfully updated', 'fluentform')\n ], 200);\n }",
"function getPrintStyles(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"print_styles\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['user_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getUserPrintStyles'], $aParams);\r\n\t\t$sListPrintStyleId = \"\";\r\n $aListPrintStyleId = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListPrintStyleId == \"\"){\r\n\t\t\t\t$sListPrintStyleId = $aLigne[\"printstyle_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListPrintStyleId .= \"|\".$aLigne[\"printstyle_id\"];\r\n\t\t\t}\r\n $aListPrintStyleId[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['print_styles'] = $sListPrintStyleId;\r\n $this->aFields['print_styles_label'] = implode(',', $aListPrintStyleId);\r\n }\r\n }",
"function shoestrap_customize_save() {\n set_theme_mod( 'shoestrap_customizer_preSave', get_theme_mods() );\n}",
"function save_css_revision( $css, $is_preview = false ) {\n\n\t\tif ( !$css_post = $this->get_css_post() ) {\n\t\t\t$post = array(\n\t\t\t\t'post_content' => $css,\n\t\t\t\t'post_status' => 'publish',\n\t\t\t\t'post_type' => 'safecss'\n\t\t\t);\n\n\t\t\t$post_id = wp_insert_post( $post );\n\n\t\t\treturn true;\n\t\t}\n\n\t\t$css_post['post_content'] = $css;\n\n\t\tif ( false === $is_preview )\n\t\t\treturn wp_update_post( $css_post );\n\t}",
"function nectar_generate_options_css() {\n\n\t$nectar_options = get_nectar_theme_options(); \n\n\tif( true === nectar_dynamic_css_dir_writable() ) {\n\n\t\t$css_dir = get_template_directory() . '/css/'; \n\t\tob_start(); \n\n\t\t// Include css.\n\t\tnectar_colors_css_output();\n\t\tnectar_custom_css_output();\n\t\tnectar_fonts_output();\n\n\t\t$css = ob_get_clean(); \n\t\t\n\t\t// Write css to file.\n\t\tglobal $wp_filesystem;\n\t\t\n\t\tif ( empty($wp_filesystem) ) {\t\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/file.php' );\n\t\t}\n\n\t\tWP_Filesystem();\n\t\t\n\t\t$file_chmod = ( defined('FS_CHMOD_FILE') ) ? FS_CHMOD_FILE : false;\n\t\t\n\t\tif ( is_multisite() ) {\n\t\t\tif( !$wp_filesystem->put_contents($css_dir . 'salient-dynamic-styles-multi-id-'. get_current_blog_id() .'.css', $css, $file_chmod)) { \n\t\t\t\t// Filesystem can not write.\n\t\t\t\tupdate_option('salient_dynamic_css_success', 'false');\n\t\t\t} else {\n\t\t\t\tupdate_option('salient_dynamic_css_success', 'true');\n\t\t\t}\n\t\t} else {\n\t\t\tif( !$wp_filesystem->put_contents($css_dir . 'salient-dynamic-styles.css', $css, $file_chmod)) {\n\t\t\t\t// Filesystem can not write.\n\t\t\t\tupdate_option('salient_dynamic_css_success', 'false');\n\t\t\t} else {\n\t\t\t\tupdate_option('salient_dynamic_css_success', 'true');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Update version number for cache busting.\n\t\t$random_number = rand( 0, 99999 );\n\t\tupdate_option('salient_dynamic_css_version', $random_number);\n\t\t\n\t} // endif CSS dir is writable.\n\telse {\n\t\t// Filesystem can not write.\n\t\tupdate_option('salient_dynamic_css_success', 'false');\n\t}\n\t\n}",
"function my_theme_add_editor_styles() {\n add_editor_style( 'editor-style.css' );\n}",
"function twentyfifteen_add_editor_styles() {\n add_editor_style( 'css/editor-style.css' );\n}",
"function add_style_definitions() {\n\t\t\t\t$options = $this->get_options();\n\t\t\t\tif( 'yes' === $options['add_styles_to_header'] ) {\n\t\t\t\t\techo \"<!-- Styles added by Cap & Run plugin -->\\n\";\n\t\t\t\t\techo \"<style type=\\\"text/css\\\">\\n\";\n\t\t\t\t\techo $options['styles_to_add'];\n\t\t\t\t\techo \"</style>\\n\";\n\t\t\t\t\techo \"<!-- End of Cap & Run style additions -->\\n\\n\";\n\t\t\t\t}\n\t\t\t}",
"function ra_builder_css()\n\t\t{\n\t\t\t$this->output('<meta name=\"generator\" content=\"rahularyan\">');\n\t\t\tif($this->template == 'user'){\n\t\t\t\tif(defined('QA_WORDPRESS_INTEGRATE_PATH')){\n\t\t\t\t\t$id = $this->content['raw']['userid'];\n\t\t\t\t\t$cover = get_user_meta( $id, 'cover' );\n\t\t\t\t\t$cover = $cover[0];\n\t\t\t\t}else{\n\t\t\t\t\t@$cover = ra_user_profile(@$this->content['raw']['account']['handle'], 'cover');\n\t\t\t\t}\n\t\t\t\tif($cover)\n\t\t\t\t\t$this->output('<style>#user .user-bar{background:url(\"'.qa_opt('site_url').'images/'.$cover.'\") no-repeat scroll 0 0 / cover;}</style>');\n\t\t\t\t\n\t\t\t}\n\t\t\tif(ra_is_home()){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_home').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'questions'){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_questions').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'unanswered'){\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_unanswered').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'tags'){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_tags').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'categories'){\t\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_categories').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'users'){\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_users').ra_db_builder('css_bottom').'</style>');\n\t\t\t}elseif($this->template == 'user'){\t\t\t\t\n\t\t\t\t$this->output('<style>'.ra_db_builder('css_user').ra_db_builder('css_bottom').'</style>');\n\t\t\t}\n\t\t}",
"function remove_editor_styles()\n {\n }",
"protected function regStyles() {\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/bbcode/bbcode.css');\n $this->modx->regClientCSS($this->config['cssUrl'] . 'web/styles.css');\n }",
"function saveSchemesList() {\n global $_wp_admin_css_colors;\n\n if (count($_wp_admin_css_colors) > 1 && has_action('admin_color_scheme_picker')) {\n update_option('wp_admin_color_schemes', $_wp_admin_css_colors);\n }\n }",
"function add_editor_style($stylesheet = 'editor-style.css')\n {\n }",
"public function register_styles() {\n\n\t\t\twp_register_style(\n\t\t\t\t\"$this->ID-style\",\n\t\t\t\tplugins_url( 'style.css', __FILE__ ),\n\t\t\t\tnull,\n\t\t\t\t$this->version\n\t\t\t);\n $file_tmpl = 'ui/timeago/locale/jquery.timeago.%s.js';\n wp_register_script( 'timeago-locale', WP_STREAM_URL . sprintf( $file_tmpl, 'en' ), array( 'timeago' ), '1' );\n wp_register_style( 'select2', WP_STREAM_URL . 'ui/select2/select2.css', array(), '3.5.1' );\n\t\t}",
"public function envato_setup_introduction_save() {\n\n\t\t\tcheck_admin_referer( 'envato-setup' );\n\n\t\t\tif ( ! empty( $_POST['reset-font-defaults'] ) && $_POST['reset-font-defaults'] == 'yes' ) {\n\n\t\t\t\t$file_name = get_template_directory() . '/style.custom.css';\n\t\t\t\tif ( file_exists( $file_name ) ) {\n\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/file.php' );\n\t\t\t\t\tWP_Filesystem();\n\t\t\t\t\tglobal $wp_filesystem;\n\t\t\t\t\t$wp_filesystem->put_contents( $file_name, '' );\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t<p>\n\t\t\t\t\t<strong><?php esc_html_e( 'Options have been reset. Please go to Appearance > Customize in the WordPress backend.', 'dfd-native' ); ?></strong>\n\t\t\t\t</p>\n\t\t\t\t<?php\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}",
"public function setStyle($style) {}",
"public function ec_customizer_styles() {\n\t\t?>\n\t\t<style>\n\t\t\tli#customize-control-tribe_customizer-month_week_view-highlight_color,\n\t\t\tli#customize-control-tribe_customizer-photo_view-bg_color,\n\t\t\tli#customize-control-tribe_customizer-single_event-post_title_color {\n\t\t\t\topacity: 0.2;\n\t\t\t\tpointer-events: none;\n\t\t\t\tcursor: not-allowed;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}",
"function wyde_add_body_style($handle, $src){\n global $wyde_body_stylesheets;\n if( !$wyde_body_stylesheets ){\n $wyde_body_stylesheets = array();\n }\n\n $wyde_body_stylesheets[$handle] = $src; \n}",
"function updateUserStyle($id, $style)\n {\n $connect = new Config();\n $sql = 'UPDATE user_db SET style = :style WHERE id = :id';\n $query = $connect->connectPDO()->prepare($sql);\n $query->bindParam(':style', $style, \\PDO::PARAM_INT);\n $query->bindParam(':id', $id, \\PDO::PARAM_INT);\n $query->execute();\n }",
"function compiler_action( $options, $css, $changed_values ) {\n echo '<h1>The compiler hook has run!</h1>';\n echo \"<pre>\";\n print_r( $changed_values ); // Values that have changed since the last save\n echo \"</pre>\";\n //print_r($options); //Option values\n //print_r($css); // Compiler selector CSS values compiler => array( CSS SELECTORS )\n\n /*\n // Demo of how to use the dynamic CSS and write your own static CSS file\n $filename = dirname(__FILE__) . '/style' . '.css';\n global $wp_filesystem;\n if( empty( $wp_filesystem ) ) {\n require_once( ABSPATH .'/wp-admin/includes/file.php' );\n WP_Filesystem();\n }\n\n if( $wp_filesystem ) {\n $wp_filesystem->put_contents(\n $filename,\n $css,\n FS_CHMOD_FILE // predefined mode settings for WP files\n );\n }\n */\n }",
"function tk_gutenberg_css() {\n \n add_theme_support( 'editor-styles' );\n\tadd_editor_style( 'style-editor.css' );\n \n}",
"function opanda_sr_get_css() {\n require_once OPANDA_SR_PLUGIN_DIR. '/includes/style-manager.class.php'; \n require_once OPANDA_SR_PLUGIN_DIR. '/includes/generator/css-generator.class.php';\n \n $themeId = isset( $_POST['onp_theme_id'] ) ? $_POST['onp_theme_id'] : null;\n $styleId = isset( $_POST['onp_style_id'] ) ? $_POST['onp_style_id'] : null;\n $usePost = isset( $_POST['onp_use_post'] );\n \n if ( !$themeId || !$styleId ) {\n echo json_encode( array('error' => '[Error] The theme id [onp_theme_id] or style id [onp_style_id] are not specified.') );\n exit;\n }\n\n // if the option \"onp_use_post\" set, then takes the data from POST,\n // else from the options stored in the database.\n \n if ( $usePost ) {\n \n $startCssGenerator = new OnpSL_CSSGenerator($themeId, $_POST);\n echo json_encode(array(\n 'css' => $startCssGenerator->getCSS( $styleId )\n ));\n \n } else {\n \n $style = OnpSL_StyleManager::getStyle($themeId, $styleId); \n $fonts = OnpSL_StyleManager::getGoogleFonts($themeId, $styleId); \n\n echo json_encode(array(\n 'css' => isset ( $style['style_cache'] ) ? $style['style_cache'] : '',\n 'fonts' => $fonts\n ));\n }\n \n exit(); \n}",
"function webbusiness_cache_custom_css() {\n\t$data = get_transient(\"webbusiness_custom_css\");\n\tif ($data === false || (get_theme_mod('save-custom-css') != \"\" && get_theme_mod('save-custom-css') < time())) {\n\t\t$data = webbusiness_load_custom_css();\n\t\tset_transient('webbusiness_custom_css', $data, 3600 * 24);\n\t}\n\treturn $data;\n}",
"function set_editor_profile() {\n\tif (!current_user_can('manage_options')) { ?>\n \t<style type=\"text/css\">\n \t\t.user-rich-editing-wrap, .user-comment-shortcuts-wrap, .show-admin-bar, .user-admin-bar-front-wrap,\n \t\t.user-nickname-wrap, .user-display-name-wrap, .user-url-wrap, .user-description-wrap, #profile-page h2 {\n\t\t\t\tdisplay:none !important;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}\n}",
"function beaver_extender_fe_style_editor_build_form() {\n\t\n?>\n\t\t<form action=\"/\" id=\"beaver-extender-fe-style-editor-form\" name=\"beaver-extender-fe-style-editor-form\">\n\t\t\t\n\t\t\t<input type=\"hidden\" name=\"action\" value=\"beaver_extender_fe_style_editor_save\" />\n\t\t\t<input type=\"hidden\" name=\"security\" value=\"<?php echo wp_create_nonce( 'beaver-extender-fe-style-editor' ); ?>\" />\n\t\t\n\t\t\t<div class=\"beaver-extender-fe-style-editor-nav\">\n\t\t\t\t<input id=\"beaver-extender-fe-style-editor-save-button\" type=\"submit\" value=\"<?php _e( 'Save Changes', 'extender' ); ?>\" name=\"Submit\" alt=\"Save Changes\" />\n\t\t\t\t<img class=\"beaver-extender-ajax-save-spinner\" src=\"<?php echo site_url() . '/wp-admin/images/spinner-2x.gif'; ?>\" />\n\t\t\t\t<span class=\"beaver-extender-saved\"></span>\n\t\n\t\t\t\t<span id=\"beaver-extender-fe-style-editor-contract-icon\" class=\"beaver-extender-fe-style-editor-icons dashicons dashicons-editor-contract\"></span>\n\t\t\t\t<span id=\"beaver-extender-fe-style-editor-css-builder-toggle-icon\" class=\"beaver-extender-fe-style-editor-icons dashicons dashicons-admin-customizer\"></span>\n\t\t\t\t<span id=\"beaver-extender-fe-style-editor-search-icon\" class=\"beaver-extender-fe-style-editor-icons dashicons dashicons-search\"></span>\n\t\t\t</div><!-- END .beaver-extender-fe-style-editor-nav -->\n\t\t\t\n\t\t\t<div id=\"beaver-extender-fe-style-editor-container\">\n\t\t\t\t\n\t\t\t\t<textarea data-editor=\"css\" style=\"display:none;\" wrap=\"off\" id=\"beaver-extender-fe-style-editor-output\" class=\"code-builder-output\" name=\"extender[custom_css]\"><?php echo beaver_extender_get_custom_css( 'custom_css' ); ?></textarea>\t\t\t\t\t\n\t\t\t\n\t\t\t</div><!-- END #beaver-extender-fe-style-editor-container -->\n\t\t\n\t\t</form><!-- END #beaver-extender-fe-style-editor-form -->\n<?php\n\t\n}",
"public function getGeneratedCSSPath()\r\n {\r\n return $this->css_path;\r\n }",
"function page_sitestyle() {\r\n\t\tglobal $internal_style, $extern_save, $extern_style;\r\n\t\t\r\n\t\t$out = \"<script type=\\\"text/javascript\\\" language=\\\"JavaScript\\\" src=\\\"./system/functions.js\\\"></script>\";\r\n\t\r\n\t\tif(!isset($extern_save))\r\n\t\t\t$extern_style = $internal_style;\r\n\t\r\n\t\tif(isset($extern_save)) {\r\n\t\t\tif(file_exists(\"./styles/$extern_style/mainpage.php\")) {\r\n\t\t\t\t$sql = \"UPDATE \" . DB_PREFIX . \"config\r\n\t\t\t\t\tSET config_value= '$extern_style'\r\n\t\t\t\t\tWHERE config_name='style'\";\r\n\t\t\t\tdb_result($sql);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\t$out .= \"<iframe id=\\\"previewiframe\\\" src=\\\"./index.php?style=\".$extern_style.\"\\\" class=\\\"stylepreview\\\"></iframe>\r\n\t\t<form action=\\\"admin.php\\\" method=\\\"get\\\">\r\n\t\t\t<input type=\\\"hidden\\\" name=\\\"page\\\" value=\\\"sitestyle\\\" />\r\n\t\t\t<label for=\\\"stylepreviewselect\\\">Style:\r\n\t\t\t\t<select id=\\\"stylepreviewselect\\\" name=\\\"style\\\" size=\\\"1\\\">\";\r\n\t\r\n\t\t$verz = dir(\"./styles/\");\r\n\t\t//\r\n\t\t// read the available styles\r\n\t\t//\r\n\t\twhile($entry = $verz->read()) {\r\n\t\t\t//\r\n\t\t\t// check if the style really exists\r\n\t\t\t//\r\n\t\t\tif($entry != \".\" && $entry != \"..\" && file_exists(\"./styles/\".$entry.\"/mainpage.php\")) {\r\n\t\t\t\t//\r\n\t\t\t\t// mark the selected style as selected in the list\r\n\t\t\t\t//\r\n\t\t\t\tif($entry == $extern_style)\r\n\t\t\t\t\t$out .= \"\\t\\t\\t\\t\\t<option value=\\\"\".$entry.\"\\\" selected=\\\"selected\\\">\".$entry.\"</option>\\r\\n\";\t\r\n\t\t\t\telse\r\n\t\t\t\t\t$out .= \"\\t\\t\\t\\t\\t<option value=\\\"\".$entry.\"\\\">\".$entry.\"</option>\\r\\n\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$verz->close();\r\n\t\r\n\t\t$out .= \"</select>\r\n\t\t\t</label>\r\n\r\n\t\t\t<input type=\\\"submit\\\" value=\\\"Vorschau\\\" onclick=\\\"preview_style();return false;\\\" name=\\\"preview\\\" />\r\n\t\t\t<input type=\\\"submit\\\" value=\\\"Speichern\\\" name=\\\"save\\\" />\r\n\r\n\t\t</form>\";\r\n\t\t\r\n\t\treturn $out;\r\n\t}",
"function wpdocs_theme_add_editor_styles() {\n add_editor_style( 'editor-style.css' );\n}",
"public function save($filename, $size=null, $margin=null, $foreground=null, $background=null){ }",
"function setCss($id) {\n\t\t\t$this->Cookie->delete('css_name');\n\t\t\tif($this->params['pass'][0]=='0'){\n\t\t\t $this->Cookie->write('css_name','theme',false);\n\t\t\t $this->redirect(array('action' => $this->params['pass'][1]));\n\t\t\t}else{\n\t\t\t $this->Cookie->write('css_name','theme'.$this->params['pass'][0],false);\n\t\t\t $this->redirect(array('action' => $this->params['pass'][1]));\n\t\t }\n\t}",
"function saveSettings()\n {\n\t if ( wfReadOnly() ) {\n\t\treturn;\n\t }\n\t if ( 0 == $this->mCedarId ) {\n\t\treturn;\n\t }\n\t \n\t $dbw =& wfGetDB( DB_MASTER );\n\t $dbw->update( 'cedar_user_info',\n\t\t array( /* SET */\n\t\t\t 'user_id' => $this->mId,\n\t\t\t 'organization' => $this->mOrg,\n\t\t\t 'address1' => $this->mAddress1,\n\t\t\t 'address2' => $this->mAddress2,\n\t\t\t 'city' => $this->mCity,\n\t\t\t 'state' => $this->mState,\n\t\t\t 'country' => $this->mCountry,\n\t\t\t 'postal_code' => $this->mPostalCode,\n\t\t\t 'phone' => $this->mPhone,\n\t\t\t 'mobile_phone' => $this->mMobilePhone,\n\t\t\t 'fax' => $this->mFax,\n\t\t\t 'supervisor_name' => $this->mSupervisorName,\n\t\t\t 'supervisor_email' => $this->mSupervisorEmail\n\t\t ), array( /* WHERE */\n\t\t\t 'user_info_id' => $this->mCedarId\n\t\t ), __METHOD__\n\t );\n\t $this->clearSharedCache();\n }",
"function get_editor_stylesheets()\n {\n }",
"function ntg_theme_settings_style_box() {\n $style = genesis_get_option('style_selection') ? genesis_get_option('style_selection') : 'style.css';\n?>\n\n <p><label><?php _e('Style Sheet', 'gsselect'); ?>: \n <select name=\"<?php echo GENESIS_SETTINGS_FIELD; ?>[style_selection]\">\n <?php\n foreach ( glob(CHILD_DIR . \"/*.css\") as $file ) {\n $file = str_replace( CHILD_DIR . '/', '', $file );\n \n if( ! genesis_style_check( $file, 'genesis' )){\n continue;\n }\n \n ?>\n \n <option style=\"padding-right:10px;\" value=\"<?php echo esc_attr( $file ); ?>\" <?php selected($file, $style); ?>><?php echo esc_html( $file ); ?></option>\n \n <?php } ?>\n </select>\n </label></p>\n <p><span class=\"description\">Please select your desired <b>Style Sheet</b> from the drop down list and save your settings.</span></p>\n <p><span class=\"description\"><b>Note:</b> Only Genesis style sheets in the Child theme directory will be included in the list.</span></p>\n<?php\n}",
"private function load_public_styles() {\n\n\t}",
"public function print_styles( ) { ?>\n\t\t<style type=\"text/css\">\n\t\t.edit-php .actions select[name=\"m\"] {\n\t\t\tdisplay: none;\n\t\t}\n\t\t</style>\n\t<?php }",
"function my_wp_default_styles($styles)\n{\n\tglobal $stylesVersion;\n\t//use release date for version\n\t\n\t$styles->default_version = $stylesVersion;\n}",
"function pudla_editor_styles() {\n add_editor_style( array('editor-style.css','css/fontawesome-all.css') );\n}",
"public function store(Request $request)\n {\n request()->validate([\n 'style_name' => 'required',\n 'categories_id' => 'required',\n 'user_id' => 'required',\n ]);\n $type = 'all';\n\n $style = Style::create($request->all());\n\n $user = User::where('id',$style->user_id)->first();\n\n // mailing to user who has created the style\n Mail::to($user->email)->send(\n new StyleCreated($style)\n );\n\n return redirect()->route('salons.show',['type',$request->salon_id])->with('success','Fashion style saved successfully! Now you can attach an image gallery on it.');\n }",
"protected function styles($style, $element) {\n\t\t$element->setAttribute('size', $style->getStyle('size'));\n\t\t$element->setAttribute('color', $style->getStyle('color'));\n\t}"
] | [
"0.6976288",
"0.69721454",
"0.6915231",
"0.68911207",
"0.6855836",
"0.66185284",
"0.6398407",
"0.63379616",
"0.6329151",
"0.6233719",
"0.6200062",
"0.6199599",
"0.618016",
"0.61277884",
"0.6053838",
"0.6053741",
"0.60299903",
"0.59967273",
"0.5917588",
"0.58782077",
"0.58269536",
"0.5775406",
"0.57647014",
"0.5715453",
"0.5666254",
"0.5654524",
"0.5650231",
"0.5635664",
"0.5633029",
"0.5627674",
"0.56144285",
"0.5603372",
"0.5553147",
"0.55490786",
"0.5538357",
"0.5497455",
"0.5490803",
"0.54654855",
"0.54545486",
"0.54413104",
"0.543338",
"0.54292434",
"0.5414793",
"0.5401702",
"0.5395828",
"0.53791964",
"0.53446025",
"0.5335311",
"0.5317034",
"0.52981716",
"0.5295223",
"0.5294359",
"0.5289048",
"0.52881247",
"0.5286622",
"0.52740854",
"0.5262014",
"0.52582175",
"0.5244134",
"0.5222753",
"0.5206664",
"0.52065563",
"0.52011496",
"0.51888305",
"0.51799786",
"0.5175407",
"0.5172068",
"0.5160041",
"0.51588815",
"0.51499206",
"0.51467776",
"0.51462924",
"0.5140832",
"0.5133701",
"0.5130765",
"0.5122571",
"0.51176834",
"0.5116352",
"0.51100737",
"0.50994",
"0.5097172",
"0.50891703",
"0.50855064",
"0.507593",
"0.50718594",
"0.5067359",
"0.50628597",
"0.50551087",
"0.50471103",
"0.5045569",
"0.5043865",
"0.50418395",
"0.504124",
"0.50388324",
"0.50312513",
"0.50311595",
"0.503018",
"0.5026732",
"0.50242597",
"0.50202364"
] | 0.59840447 | 18 |
Add new style to list | private function addNewStyle($md5,$stylecontent){
$this->styles[$md5] = $stylecontent;
return $md5;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addStyle($style) {\n if (!in_array($style, (array)$this->styles, true)) {\n $this->styles[] = $style;\n }\n }",
"public function add_withStyle_addsStyleToStyles ( )\n\t{\n\t\t$this->styles->add ( $this->style );\n\t\tassertThat ( $this->styles->has ( $this->style ), is ( identicalTo ( true ) ) );\n\t}",
"public function addStyle($file) {\n $this->styles[$file] = $file;\n }",
"public function add_style($style,$dynamic=false)\n \t{\n \t\t$this->styles[$style]=$style;\n \t}",
"public function push(interfaces\\output\\Style $style)\n\t\t{\n\t\t\t$this->styles[] = $style;\n\t\t}",
"abstract public function register_style();",
"public function addCustomStyle($file){\n array_push($this->_customStyles,$file);\n }",
"function SetStyle( $item, $value )\r\n {\r\n $this->_style[$item] = $value;\r\n }",
"public function setStyle($style) {}",
"private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }",
"function register_style() {\n}",
"public function add_style ($url) {\r\n\t\treturn $this->set(self::STYLES, $url);\r\n\t}",
"function prolingua_essential_grid_merge_styles($list) {\n\t\t$list[] = 'plugins/essential-grid/essential-grid.css';\n\t\treturn $list;\n\t}",
"function add_styles($todo)\n\t{\n\t\tglobal $wp_styles;\n\n\t\t// @since 1.3.0 add 'dashicons' to default ignore list\n\t\t$this->print_positions['style_allowed'] = apply_filters('bwp_minify_allowed_styles', 'all');\n\n\t\t// @since 1.3.1 add an internal list to control items that must be\n\t\t// handled by WordPress, this is reset every time this function runs\n\t\t$this->print_positions['_style_wp'] = array();\n\n\t\tforeach ($todo as $handle)\n\t\t{\n\t\t\t$style = $wp_styles->registered[$handle];\n\t\t\t$todo_style = $this->_init_todo_item($handle, 'style');\n\n\t\t\tif (empty($style->src))\n\t\t\t{\n\t\t\t\tif ($todo_styles['depend'])\n\t\t\t\t\t$this->todo_styles[$handle] = $todo_style;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$todo_style['media'] = 'all'; // can be 'all', 'print', etc.\n\t\t\t$todo_style['if'] = '';\n\t\t\t$todo_style['alt'] = '';\n\n\t\t\t// if this style has different media type, set it\n\t\t\tif (!empty($style->args) && 'all' != $style->args)\n\t\t\t\t$todo_style['media'] = trim($style->args);\n\n\t\t\t// if this style needs conditional statement (e.g. IE-specific\n\t\t\t// stylesheets)\n\t\t\tif (!empty($style->extra['conditional']))\n\t\t\t\t$todo_style['if'] = trim($style->extra['conditional']);\n\n\t\t\t// if this style is an alternate stylesheet (@link\n\t\t\t// http://www.w3.org/TR/REC-html40/present/styles.html#h-14.3.1)\n\t\t\tif (!empty($style->extra['alt']))\n\t\t\t{\n\t\t\t\t$todo_style['alt'] = isset($style->extra['title'])\n\t\t\t\t\t? trim($style->extra['title'])\n\t\t\t\t\t: '';\n\t\t\t}\n\n\t\t\t// if this style has a RTL version, and the current text direction\n\t\t\t// setting is RTL\n\t\t\tif ('rtl' === $wp_styles->text_direction\n\t\t\t\t&& !empty($style->extra['rtl'])\n\t\t\t) {\n\t\t\t\tif (is_bool($style->extra['rtl'])\n\t\t\t\t\t|| 'replace' === $style->extra['rtl']\n\t\t\t\t) {\n\t\t\t\t\t// replace the style's original src with RTL version\n\t\t\t\t\t$suffix = isset($style->extra['suffix'])\n\t\t\t\t\t\t? $style->extra['suffix']\n\t\t\t\t\t\t: '';\n\n\t\t\t\t\t$rtl_src = str_replace(\"{$suffix}.css\", \"-rtl{$suffix}.css\", $style->src);\n\n\t\t\t\t\t$todo_style['src'] = $rtl_src;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// add a new todo_rtl as a clone of current todo_style and\n\t\t\t\t\t// make todo_style its dependency\n\t\t\t\t\t$rtl_src = trim($style->extra['rtl']);\n\n\t\t\t\t\t$todo_rtl = $todo_style;\n\t\t\t\t\t$todo_rtl['src'] = $rtl_src;\n\t\t\t\t\t$todo_rtl['depend'] = array($handle);\n\t\t\t\t\t$todo_rtl['min'] = $this->is_source_static($rtl_src) && $this->is_local($rtl_src);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($todo_style['wp'] || $todo_style['forget'])\n\t\t\t{\n\t\t\t\t// this item is handled by WP or forgotten\n\t\t\t}\n\t\t\telseif (did_action('bwp_minify_after_header_styles'))\n\t\t\t{\n\t\t\t\t// if this style is registered after the styles are printed, it is\n\t\t\t\t// expected in footer\n\t\t\t\t$todo_style['position'] = did_action('bwp_minify_after_footer_styles')\n\t\t\t\t\t? 'footer' . $this->late_style_order\n\t\t\t\t\t: 'footer';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// this style belongs to header\n\t\t\t\t$todo_style['position'] = 'header';\n\t\t\t}\n\n\t\t\t$this->todo_styles[$handle] = $todo_style;\n\n\t\t\tif (!empty($todo_rtl['src']))\n\t\t\t{\n\t\t\t\t// this style needs a separate RTL stylesheet\n\t\t\t\t$this->todo_styles[$handle . '_rtl'] = $todo_rtl;\n\t\t\t\t$todo_rtl = false;\n\t\t\t}\n\t\t}\n\n\t\t// start minifying\n\t\t$this->minify($this->todo_styles, 'style');\n\n\t\t// if late styles are found, print them now\n\t\tif (!empty($this->todo_late_styles))\n\t\t{\n\t\t\t$this->print_styles($this->todo_late_styles);\n\t\t\t$this->todo_late_styles = '';\n\t\t\t$this->late_style_order++;\n\t\t}\n\n\t\treturn $this->_get_wp_todo($todo, 'style');\n\t}",
"function App_CSS_Add()\n {\n array_push($this->MyApp_Interface_Head_CSS_OnLine,\"CSS/sivent2.css\");\n }",
"function loadListColor()\n\t{\n\t\tif($this->new_size)\n\t\t\t$this->list_color = 'orange';\n\t}",
"public function addStyle($name, $value) {\n\t\t$this->attributes[\"style\"][$name] = $value;\n\t\treturn $this;\n\t}",
"protected function addStyle($styleFile = false){\n\t\tif($styleFile){\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'css' . DS . $styleFile . '.css';\n\t\t\t$styleFile = Safan::app()->resourceUrl . DS . 'css' . DS . $styleFile . '.css';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->styles[] = $styleFile;\n\t\t}\n\t\telse{\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'css' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.style.css';\n\t\t\t$moduleStyle = Safan::app()->resourceUrl . DS . 'css' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.style.css';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->styles[] = $moduleStyle;\n\t\t}\n\t}",
"function studeon_tribe_events_merge_styles($list) {\n\t\t$list[] = 'plugins/the-events-calendar/the-events-calendar.css';\n\t\t$list[] = 'css/the-events-calendar.css';\n\t\treturn $list;\n\t}",
"public function style($style)\n\t{\n\t\t$this->style = $style;\n\n\t\t// reload the available types for the style\n\t\t$this->types = $this->types();\n\t}",
"function drawStyle()\r\n\t{\r\n\t}",
"function windsor_hovers_merge_styles($list) {\n\t\t$list[] = 'includes/theme.hovers/theme.hovers.css';\n\t\treturn $list;\n\t}",
"public function addStyle(string $name, string $src, array $attributes = []);",
"function wp_add_inline_style($handle, $data)\n {\n }",
"protected function styles($style, $element) {\n\t\tparent::style($style, $element);\n\t\t$element->setAttribute('titlecolor', $style->getStyle('titlecolor'));\n\t}",
"function studeon_vc_merge_styles($list) {\n\t\t$list[] = 'plugins/js_composer/js_composer.css';\n\t\treturn $list;\n\t}",
"public function setStyle(string $name, $style);",
"function ft_hook_add_css() {}",
"public function addStyle($id, $url)\n {\n $this->styles[$id] = $url;\n }",
"function crypton_blog_cryptocurrency_merge_styles($list) {\n\t\t$list[] = 'plugins/cryptocurrency-prices/cryptocurrency-prices.css';\n\t\treturn $list;\n\t}",
"function add_style_definitions() {\n\t\t\t\t$options = $this->get_options();\n\t\t\t\tif( 'yes' === $options['add_styles_to_header'] ) {\n\t\t\t\t\techo \"<!-- Styles added by Cap & Run plugin -->\\n\";\n\t\t\t\t\techo \"<style type=\\\"text/css\\\">\\n\";\n\t\t\t\t\techo $options['styles_to_add'];\n\t\t\t\t\techo \"</style>\\n\";\n\t\t\t\t\techo \"<!-- End of Cap & Run style additions -->\\n\\n\";\n\t\t\t\t}\n\t\t\t}",
"function __construct($name) {\n\t\t$this->styleDocument = ODT::getInstance()->getStyleDocument();\n\t\t$this->name = $name;\n\t\t$this->styleElement = $this->styleDocument->createElement('text:list-style');\n\t\t$this->styleElement->setAttribute('style:name', $name);\n\t\t$this->styleElement->setAttribute('style:display-name', $name);\n\t\t$this->styleDocument->getElementsByTagName('office:styles')->item(0)->appendChild($this->styleElement);\n\t}",
"protected function _drawStyle($style) {}",
"public function addStyle($css, $cacheable = true) {\n if(is_null($this->Styles))\n $this->Styles = array();\n\n $this->Styles[] = array('file'=>$css, 'cache'=>$cacheable);\n }",
"function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}",
"public function orderedListItemsProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\ListItemStyle()]];\n }",
"public function orderedListItemsProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\ListItemStyle()]];\n }",
"protected function styles($style, $element) {\n\t\t$element->setAttribute('size', $style->getStyle('size'));\n\t\t$element->setAttribute('color', $style->getStyle('color'));\n\t}",
"public static function add_administration_styles()\n {\n static::add_media_listing_style();\n }",
"public function add_style($slug = null, $src = null, $deps = null) {\n\t\t$style = [];\n\t\t\n\t\t$style['slug'] = $slug;\n\t\t$style['src'] = $src;\n\t\t$style['deps'] = $deps;\n\t\t\n\t\tarray_push($this->styles, $style);\n\t}",
"public function createNewStyle($data) {\n\n $data = [\n 'id' => $this->generateUUID(),\n 'name' => $data['name'],\n 'line_id' => $data['lineId'],\n 'product_brief' => isset($data['productBrief']) ? json_encode($data['productBrief']) : null,\n 'customer_style_code' => isset($data['customerStyleCode']) ? $data['customerStyleCode'] : null,\n ];\n\n return $this->create($data);\n\t}",
"private function loadStyles() {\n\t\tif(isset($this->styles) && $this->styles != \"\") {\n\t\t\tforeach (explode(\",\", $this->styles) as $style) {\n\t\t\t\tOCP\\Util::addStyle('ocDashboard', 'widgets/'.$this->id.'/'.$style);\n\t\t\t}\n\t\t}\n\t}",
"function ag_set_predefined_style() {\n\tif(!isset($_POST['lcwp_nonce']) || !wp_verify_nonce($_POST['lcwp_nonce'], 'lcwp_nonce')) {die('Cheating?');}\n\tif(!isset($_POST['style'])) {die('data is missing');}\n\n\trequire_once(AG_DIR .'/settings/preset_styles.php');\n\trequire_once(AG_DIR .'/functions.php');\n\t\n\t$style_data = ag_preset_styles_data($_POST['style']);\n\tif(empty($style_data)) {die('Style not found');}\n\t\n\t\n\t// override values\n\tforeach($style_data as $key => $val) {\n\t\tupdate_option($key, $val);\t\t\n\t}\n\n\n\t// if is not forcing inline CSS - create static file\n\tif(!get_option('mg_inline_css')) {\n\t\tag_create_frontend_css();\n\t}\n\t\n\tdie('success');\n}",
"function chocorocco_mailchimp_merge_styles($list) {\n\t\t$list[] = 'plugins/mailchimp-for-wp/mailchimp-for-wp.css';\n\t\treturn $list;\n\t}",
"public function __construct($style)\n {\n $this->style = $style;\n $this->labelList = array();\n }",
"private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }",
"private function _handleStyleBased()\n {\n if (Theme::getComponent()) {\n $css = $this->styleBasedCss[Theme::getComponent()->style];\n $this->css = ArrayHelper::merge($css, $this->css);\n }\n }",
"public function setCss($list = array()) {\r\n $this->getView()->setViewObject('css', $list);\r\n }",
"public function createStyle(\n StyleEnum ...$styles\n ): StyleInterface;",
"public function createStyle(\n StyleEnum ...$styles\n ): StyleInterface;",
"public function addStyles($styles) {\n\t\t\n\t\t$styles = (array) $styles;\n\t\tif(!empty($styles)) {\n\t\t\tforeach ($styles as $style) {\n\t\t\t\t$filename = WEB_ROOT.'app/webroot/css/'.$style.'.css';\n\t\t\t\tif($this->isUrlFileExist($filename)) {\n\t\t\t\t\t$this->styles[] = $filename;\n\t\t\t\t} else throw new Exception('La feuille de style \"'.$style.'.css\" est introuvable', 1);\n\t\t\t}\n\t\t}\n\t}",
"public function setStyle(array $style = [], $update = true)\n {\n $this->style = $update\n ? array_merge($this->style, $style)\n : $style;\n\n return $this;\n }",
"public function addStyleDeclaration($content, $type = 'text/css')\n\t{\n\t\tif (!isset($this->_style[strtolower($type)]))\n\t\t{\n\t\t\t$this->_style[strtolower($type)] = $content;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_style[strtolower($type)] .= chr(13) . $content;\n\t\t}\n\n\t\treturn $this;\n\t}",
"function collection_css() {\n\tif ( is_singular( WPM_PREFIX . 'collection' ) ) {\n\t\t$display_options = get_customizer_settings()[ WPM_PREFIX . 'collection_style' ];\n\t\t$styles = [];\n\n\t\tif ( ! $display_options['list_color_1'] ) {\n\t\t\t$display_options['list_color_1'] = 'transparent';\n\t\t}\n\t\tif ( ! $display_options['list_color_2'] ) {\n\t\t\t$display_options['list_color_2'] = 'transparent';\n\t\t}\n\t\tif ( $display_options['alternate_list_color'] ) {\n\t\t\t$styles[ '.' . WPM_PREFIX . 'object-row:nth-child(odd)' ]['background-color'] = $display_options['list_color_1'];\n\t\t\t$styles[ '.' . WPM_PREFIX . 'object-row:nth-child(even)' ]['background-color'] = $display_options['list_color_2'];\n\t\t} else {\n\t\t\t$styles[ '.' . WPM_PREFIX . 'object-row' ]['background-color'] = $display_options['list_color_1'];\n\t\t}\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row a' ]['text-decoration'] = 'none !important';\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row a' ]['color'] = 'inherit !important';\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row-thumbnail' ]['float'] = $display_options['list_thumbnail_position'];\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row-thumbnail' ]['max-width'] = $display_options['list_image_max_width'] . 'px';\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row-thumbnail' ]['max-height'] = $display_options['list_image_max_height'] . 'px';\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row-thumbnail' ]['margin'] = '20px';\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row-textwrapper' ]\n\t\t\t\t[ 'margin-' . $display_options['list_thumbnail_position'] ] =\n\t\t\t\t\t( $display_options['list_image_max_width'] + 20 ) . 'px';\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row h4' ]['clear'] = 'none';\n\t\tif ( $display_options['excerpt_line_height'] ) {\n\t\t\t$styles[ '.' . WPM_PREFIX . 'object-row-excerpt' ]['line-height'] = $display_options['excerpt_line_height'] . 'em';\n\t\t}\n\t\tif ( $display_options['excerpt_font_size'] ) {\n\t\t\t$styles[ '.' . WPM_PREFIX . 'object-row-excerpt' ]['font-size'] = $display_options['excerpt_font_size'] . 'em';\n\t\t}\n\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row' ]['padding'] = '10px';\n\t\t$styles[ '.' . WPM_PREFIX . 'object-row' ]['min-height'] = ( $display_options['list_image_max_height'] + 40 ) . 'px';\n\n\t\techo '<style type=\"text/css\">';\n\t\techo esc_html( css_from_array( $styles ) );\n\t\techo '</style>';\n\t}\n}",
"public function addCellXf($style) {\n\t\t$this->cellXfCollection[] = $style;\n\t\t$style->setIndex(count($this->cellXfCollection) - 1);\n\t}",
"public function unorderedListItemsProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\ListItemStyle()]];\n }",
"public function unorderedListItemsProvider()\n {\n return [[new \\Urbania\\AppleNews\\Format\\ListItemStyle()]];\n }",
"public function addCascadingStyleSheet(&$toAdd) {\n\t\t$this->checkCurrent();\n\t\t$this->currentObjectWriter->addCascadingStyleSheet($toAdd);\n\t}",
"function add_css($acss=array()) {\n\t\tforeach ($acss as $css) {\n\t\t\tif (isset($css[\"path\"]) && $css[\"path\"]!=\"\") {\n\t\t\t\t$priority = 0;\n\t\t\t\tif (isset($css[\"priority\"])) {\n\t\t\t\t\t$priority = $css[\"priority\"];\n\t\t\t\t}\n\t\t\t\t$condition = \"\";\n\t\t\t\tif (isset($css[\"condition\"])) {\n\t\t\t\t\t$condition = $css[\"condition\"];\n\t\t\t\t}\n\t\t\t\t$is_local = true;\n\t\t\t\tif (isset($css[\"is_local\"])) {\n\t\t\t\t\t$is_local = $css[\"is_local\"];\n\t\t\t\t}\n\t\t\t\t$this->custom_css[] = array(\"css\" => $css[\"path\"], \"priority\" => $priority, \"condition\" => $condition, \"is_local\" => $is_local);\n\t\t\t}\n\t\t}\n\t}",
"protected function separateStyle()\n\t{\n\t\t$items = array();\n\t\tif ($this instanceof Layout) {\n\t\t\t$nodes = @$this->xpath->query(\"//body//link\");\n\t\t\tforeach ($nodes as $node) {\n\t\t\t\t$this->styles[] = $node;\n\t\t\t\t$items[] = $node;\n\t\t\t}\n\n\t\t\tforeach ($items as $node) {\n\t\t\t\t$parent = $node->parentNode;\n\t\t\t\t$parent->removeChild($node);\n\t\t\t}\n\t\t} else {\n\t\t\t$nodes = @$this->xpath->query(\"//head//link\");\n\t\t\tforeach ($nodes as $node) {\n\t\t\t\t$this->styles[] = $node;\n\t\t\t\t$items[] = $node;\n\t\t\t}\n\n\t\t\tforeach ($items as $node) {\n\t\t\t\t$parent = $node->parentNode;\n\t\t\t\t$parent->removeChild($node);\n\t\t\t}\n\n\t\t\t$items = array();\n\t\t\t$nodes = @$this->xpath->query(\"//body//link\");\n\t\t\tforeach ($nodes as $node) {\n\t\t\t\t$this->styles[] = $node;\n\t\t\t\t$items[] = $node;\n\t\t\t}\n\n\t\t\tforeach ($items as $node) {\n\t\t\t\t$parent = $node->parentNode;\n\t\t\t\t$parent->removeChild($node);\n\t\t\t}\n\t\t}\n\n\t\t$items = array();\n\t\t$nodes = @$this->xpath->query(\"//head//style\");\n\t\tforeach ($nodes as $node) {\n\t\t\t$this->styles[] = $node;\n\t\t\t$items[] = $node;\n\t\t}\n\n\t\tforeach ($items as $node) {\n\t\t\t$parent = $node->parentNode;\n\t\t\t$parent->removeChild($node);\n\t\t}\n\n\t\t$items = array();\n\t\t$nodes = @$this->xpath->query(\"//body//style\");\n\t\tforeach ($nodes as $node) {\n\t\t\t$this->styles[] = $node;\n\t\t\t$items[] = $node;\n\t\t}\n\n\t\tforeach ($items as $node) {\n\t\t\t$parent = $node->parentNode;\n\t\t\t$parent->removeChild($node);\n\t\t}\n\t}",
"public function add_css($css) {\n $current = $this->dwoo_data->css_files;\n $current[] = $css;\n $this->dwoo_data->css_files = $current;\n }",
"function manynewposts_style() {\n global $manynewposts_style,$templates;\n\n eval(\"\\$manynewposts_style = \\\"\".$templates->get(\"manynewposts_style\").\"\\\";\");\n}",
"public function add_inline_styles() {\n\n\t\t// echo '<div class=\"revsliderstyles\">';\n\t\techo '<style scoped>';\n\n\t\t$db = new UniteDBRev();\n\n\t\t$styles = $db->fetch( GlobalsRevSlider::$table_css );\n\t\tforeach ( $styles as $key => $style ) {\n\t\t\t$handle = str_replace( '.tp-caption', '', $style['handle'] );\n\t\t\tif ( ! isset( $this->class_include[ $handle ] ) ) { unset( $styles[ $key ] ); }\n\t\t}\n\n\t\t$styles = UniteCssParserRev::parseDbArrayToCss( $styles, \"\\n\" );\n\t\t$styles = UniteCssParserRev::compress_css( $styles );\n\t\techo $styles;\n\n\t\techo '</style>' . \"\\n\";\n\t\t// echo '</div>';\n\t}",
"function add_styles() {\n\t\tif ( is_active_widget( false, false, $this->id_base, true ) ) {\n\t\t\twp_enqueue_style( 'font-awesome' );\n\t\t\t\n\t\t\t//wp_enqueue_style( 'my-style', \\trends\\helper\\utils::get_widgets_uri( 'social_icons', '/assets/my-style.css') );\n\t\t\t\n\t\t}\n\t}",
"function add_new_class_list_categories($list) {\r\n $list = str_replace('cat-item', ' cat-item list-group-item', $list);\r\n return $list;\r\n}",
"public function addCellStyleXf($pStyle) {\n\t\t$this->cellStyleXfCollection[] = $pStyle;\n\t\t$pStyle->setIndex(count($this->cellStyleXfCollection) - 1);\n\t}",
"function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}",
"public function add_header_style ($url) {\r\n\t\treturn $this->set(self::HEADER_STYLES, $url);\r\n\t}",
"public function add_css($styles=null, $combine=null){\n $combine = is_null($combine) ? $this->combine : $combine;\n\n if (is_string($styles) && !empty($styles)){\n $this->styles[] = array($combine, $styles);\n }else if (is_array($styles) && count($styles) != 0){\n foreach ($styles as $style){\n $this->styles[] = array($combine, $style);\n }\n }\n\t}",
"public function colorList() {}",
"function eltdf_core_set_single_portfolio_style($style) {\n\t\t$id = mrseo_elated_get_page_id();\n\t\t$class_prefix = mrseo_elated_get_unique_page_class($id);\n\t\t\n\t\t$current_styles = '';\n\t\t$current_style = array();\n\t\t\n\t\t$current_selector = array(\n\t\t\t$class_prefix . ' .eltdf-portfolio-single-holder .eltdf-ps-info-holder'\n\t\t);\n\t\t\n\t\t$info_padding_top = get_post_meta($id, 'portfolio_info_top_padding', true);\n\t\t\n\t\tif(!empty($info_padding_top)) {\n\t\t\t$current_style['padding-top'] = mrseo_elated_filter_px($info_padding_top).'px';\n\t\t\t\n\t\t\t$current_styles .= mrseo_elated_dynamic_css($current_selector, $current_style);\n\t\t}\n\t\t\n\t\t$current_style = $current_styles . $style;\n\t\t\n\t\treturn $current_style;\n\t}",
"public function ec_customizer_styles() {\n\t\t?>\n\t\t<style>\n\t\t\tli#customize-control-tribe_customizer-month_week_view-highlight_color,\n\t\t\tli#customize-control-tribe_customizer-photo_view-bg_color,\n\t\t\tli#customize-control-tribe_customizer-single_event-post_title_color {\n\t\t\t\topacity: 0.2;\n\t\t\t\tpointer-events: none;\n\t\t\t\tcursor: not-allowed;\n\t\t\t}\n\t\t</style>\n\t\t<?php\n\t}",
"static public function addCSS($new_css) {\n\t\tif (is_array($new_css)) {\n\t\t\tself::$css = array_merge(self::$css, $new_css);\n\t\t\treturn null;\n\t\t}\n\t\tself::$css[] = (string)trim($new_css);\n\t}",
"public function addListItem($text, $depth = 0, $styleFont = null, $styleList = null, $styleParagraph = null) {\n\t\t$text = utf8_encode($text);\n\t\t$listItem = new PHPWord_Section_ListItem($text, $depth, $styleFont, $styleList, $styleParagraph);\n\t\t$this->_elementCollection[] = $listItem;\n\t\treturn $listItem;\n\t}",
"public function add_style( $selector, $style = array(), $media = array() ) {\n\n\t\t\tself::$grabbed_css[ $selector ] = array(\n\t\t\t\t'style' => $style,\n\t\t\t\t'media' => $media,\n\t\t\t);\n\n\t\t}",
"public static function setStyle ($style)\n {\n self::$_style = $style;\n }",
"public function setAddClassToListItem(bool $flag = true);",
"private function addToTheme()\n {\n static $addedResource = false;\n\n if ($this->activated && !$addedResource) {\n if (isset($GLOBALS['xoTheme'])) {\n /*\n $xoops = Xoops::getInstance();\n $head = '</style>' . $this->renderer->renderHead()\n . '<style>.icon-tags:before { content: \"\"; width: 16px; background-position: -25px -48px;}';\n $xoops->theme()->addStylesheet(null, null, $head);\n */\n $addedResource = true;\n }\n }\n }",
"function css_add(/*group, value, value, value = array()*/)\n{\n\t$CI = &get_instance();\n\t// get args\n\t$args = func_get_args();\n\t// assign args to class\n\t$CI->css->add($args);\n}",
"public function change_style( $old_id , $new_id ) {\n\t\t// TODO: add a 'save style' to allow users to revert\n\t\t$this->apply_style( $new_id );\n\t}",
"private function setStyle($style){\r\n //Checks if $style is a string, if not use default light as styling\r\n if(is_string($style)){\r\n $this->cssClass = $style;\r\n } else {\r\n $this->cssClass = 'light';\r\n }\r\n }",
"function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }",
"function studioyacine_styles_dropdown($settings)\n {\n $new_styles = array(\n array(\n 'title' => __('Custom Styles', 'studioyacine'),\n 'items' => array(\n array(\n 'title' => __('Button', 'studioyacine'),\n 'selector' => 'p',\n 'classes' => 'button'\n ),\n // array(\n // 'title' => __('Button Red', 'studioyacine'),\n // 'selector' => 'p',\n // 'classes' => 'button-red'\n // ),\n // array(\n // 'title' => __('Large', 'studioyacine'),\n // 'selector' => 'p',\n // 'classes' => 'text-large'\n // ),\n // array(\n // 'title' => __('Medium', 'studioyacine'),\n // 'selector' => 'p',\n // 'classes' => 'text-medium'\n // )\n ),\n ),\n );\n\n // Merge old & new styles\n $settings['style_formats_merge'] = true;\n\n // Add new styles\n $settings['style_formats'] = json_encode($new_styles);\n $settings['block_formats'] = 'Paragraph=p; Header 2=h2; Header 3=h3;';\n\n // Return New Settings\n return $settings;\n }",
"function wyde_add_body_style($handle, $src){\n global $wyde_body_stylesheets;\n if( !$wyde_body_stylesheets ){\n $wyde_body_stylesheets = array();\n }\n\n $wyde_body_stylesheets[$handle] = $src; \n}",
"function add_ordin_widget_style() {\n if( ! apply_filters( 'add_ordin_widget_style', true, $this->id_base ) )\n return;\n ?>\n <style type=\"text/css\">\n \n </style>\n <?php\n }",
"public function run()\n {\n Style::create([\n 'type' => 'Masculino',\n 'description' => 'Produto para homem',\n ]);\n Style::create([\n 'type' => 'Feminino',\n 'description' => 'Produto para mulher',\n ]);\n Style::create([\n 'type' => 'Unisex',\n 'description' => 'Produto para homem ou mulher',\n ]);\n }",
"function bsc_add_editor_styles() {\n\t\t\tadd_editor_style( get_stylesheet_uri() );\n\t\t}",
"function add_color(){\r\n echo '<style>\r\n\r\n #adminmenu,#adminmenu li,#adminmenu li ul,#adminmenu li ul li,#adminmenuwrap,#adminmenuback,.wp-submenu \r\n {background: gray !important}\r\n\r\n #wp-toolbar, .nojq \r\n {background: gray !important}\r\n\r\n\t\t</style>';\r\n\r\n}",
"private function styles_pointer() {\n\t\treturn array(\n\t\t\t'content' => '<h3>' . __( 'Styles', 'formidable' ) . '</h3>'\n\t\t\t . '<p>' . __( 'Want to make changes to the way your forms look? Make all the changes you would like right here, and watch the sample form change before your eyes.', 'formidable' ) . '</p>',\n\t\t\t'prev_page' => 'entries',\n\t\t\t'next_page' => 'import',\n\t\t\t'selector' => '.general-style',\n\t\t\t'position' => array( 'edge' => 'left', 'align' => 'right' ),\n\t\t);\n\t}",
"function add_editor_style($stylesheet = 'editor-style.css')\n {\n }",
"public function addCSS(array $attributes, $style = null, $order = null)\n {\n $id = isset($attributes['href']) ? $attributes['href'] : count($this->css);\n return $this->setCSS($id, $attributes, $style, $order);\n }",
"function register_block_style($block_name, $style_properties)\n {\n }",
"public function styleChanges($d,$speAvailArray,$blocked){\n if (in_array ( $d, $speAvailArray ) && ! in_array ( $d, $blocked )) {\n $style = \"style='background-color:#65AA5F;'\";\n } else {\n $style = \"style='background-color:#FFFF00;cursor:pointer;'\";\n }\n return $style;\n }",
"private function appendStyles(array $styles): void\n {\n if (empty($styles)) {\n return;\n }\n\n $string = '';\n $prependSemicolon = false;\n foreach ($styles as $key => $value) {\n if ($prependSemicolon) {\n $string .= '; ';\n }\n $prependSemicolon = true;\n $string .= $key . ': ' . $value;\n }\n\n $this->appendAttribute('style', $string);\n }",
"static function _style_on() {\n\t\treturn self::style( true );\n\t}",
"public function add_styles() {\n\n\t\t\t$current_page = isset( $_GET['page'] ) ? $_GET['page'] : null;\n\t\t\t$current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : null;\n\n\t\t\t$page_ID = $this->translate_name_to_id( $this->page );\n\t\t\t$tab_ID = $this->translate_name_to_id( $this->tab );\n\t\t\t$settings_tab_ID = $this->translate_name_to_id( $this->settings_tab );\n\n\t\t\t// Only add style if on extension tab or on extension settings tab\n\t\t\tif ( ( $current_page == $page_ID && $current_tab == $tab_ID )\n\t\t\t || ( $current_page == 'cd_settings' && $current_tab == $settings_tab_ID )\n\t\t\t || ( $current_page == 'cd_account' && $current_tab == 'activity' )\n\t\t\t) {\n // Add stylesheet from this plugin\n\t\t\t\twp_enqueue_style( \"$this->ID-style\" );\n\n // Add Stream stuff\n wp_enqueue_style( 'wp-stream-admin', WP_STREAM_URL . 'ui/css/admin.css', array(), WP_Stream::VERSION );\n wp_enqueue_script( 'select2' );\n wp_enqueue_style( 'select2' );\n\n wp_enqueue_script( 'timeago' );\n wp_enqueue_script( 'timeago-locale' );\n\n wp_enqueue_script( 'wp-stream-admin', WP_STREAM_URL . 'ui/js/admin.js', array( 'jquery', 'select2' ), WP_Stream::VERSION );\n wp_enqueue_script( 'wp-stream-live-updates', WP_STREAM_URL . 'ui/js/live-updates.js', array( 'jquery', 'heartbeat' ), WP_Stream::VERSION );\n wp_localize_script(\n 'wp-stream-admin',\n 'wp_stream',\n array(\n 'i18n' => array(\n 'confirm_defaults' => __( 'Are you sure you want to reset all site settings to default? This cannot be undone.', 'stream' ),\n ),\n 'gmt_offset' => get_option( 'gmt_offset' ),\n )\n );\n wp_localize_script(\n 'wp-stream-live-updates',\n 'wp_stream_live_updates',\n array(\n 'current_screen' => $current_page,\n 'current_page' => $current_page,\n 'current_order' => isset( $_GET['order'] ) ? esc_js( $_GET['order'] ) : 'desc',\n 'current_query' => json_encode( $_GET ),\n )\n );\n }\n\t\t}",
"function addThemeStyles() \n {\n global $blog_id;\n \n // need for wordpress MU and WP3\n if (!$blog_id) {\n $blog_id = 1;\n }\n\n // load style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/cache/style'.$blog_id.'.css')) {\n wp_enqueue_style('constructor-style', CONSTRUCTOR_DIRECTORY_URI .'/cache/style'.$blog_id.'.css');\n } else {\n wp_enqueue_style('constructor-style', get_option('home').'/?theme-constructor=css');\n }\n \n // load constructor subtheme style\n if (file_exists(CONSTRUCTOR_DIRECTORY .'/themes/'.$this->getTheme().'/style.css')) {\n wp_enqueue_style( 'constructor-theme', CONSTRUCTOR_DIRECTORY_URI.'/themes/'.$this->getTheme().'/style.css');\n }\n }",
"public function applyStyle(\n $style_name, $name, $value, OpenDocument_StyledElement $object\n ) {\n //check if other nodes have the same style name\n $nodes = $this->cursor->getElementsByTagName('*');\n $count = 0;\n foreach ($nodes as $node) {\n if ($node->hasAttributeNS(OpenDocument::NS_TEXT, 'style-name')\n && $node->getAttributeNS(OpenDocument::NS_TEXT, 'style-name') == $style_name\n ) {\n $count ++;\n if ($count > 1) {\n break;\n }\n }\n }\n\n $generate = false;\n\n //get style node\n if ($count > 1) {\n $style = $this->getStyleNode($style_name)->cloneNode(true);\n $this->styles->appendChild($style);\n $generate = true;\n $style_name = uniqid('tmp');//$object->generateStyleName();\n $style->setAttributeNS(OpenDocument::NS_STYLE, 'name', $style_name);\n $style->setAttributeNS(\n OpenDocument::NS_STYLE, 'family',\n constant(get_class($object) . '::styleFamily')\n );\n } else {\n $style = $this->getStyleNode($style_name);\n }\n\n if (empty($style)) {\n if (empty($style_name)) {\n $generate = true;\n $style_name = uniqid('tmp');\n }\n $style = $this->contentDOM->createElementNS(OpenDocument::NS_STYLE, 'style');\n $style->setAttributeNS(OpenDocument::NS_STYLE, 'name', $style_name);\n //workaround for php5_2\n $style->setAttributeNS(\n OpenDocument::NS_STYLE, 'family',\n constant(get_class($object) . '::styleFamily')\n );\n $style->setAttributeNS(OpenDocument::NS_STYLE, 'parent-style-name', 'Standard');\n $this->styles->appendChild($style);\n }\n\n $nodes = $style->getElementsByTagNameNS(OpenDocument::NS_STYLE, 'text-properties');\n if ($nodes->length) {\n $text_properties = $nodes->item(0);\n } else {\n $text_properties = $this->contentDOM->createElementNS(\n OpenDocument::NS_STYLE, 'text-properties'\n );\n $style->appendChild($text_properties);\n }\n $text_properties->setAttribute($name, $value);\n\n //find alike style\n $nodes = $this->styles->getElementsByTagNameNS(\n OpenDocument::NS_STYLE, 'style'\n );\n foreach ($nodes as $node) {\n if (!$style->isSameNode($node)\n && $this->compareChildNodes($style, $node)\n ) {\n $style->parentNode->removeChild($style);\n return $node->getAttributeNS(OpenDocument::NS_STYLE, 'name');\n }\n }\n \n if ($generate) {\n $style_name = $object->generateStyleName();\n $style->setAttributeNS(OpenDocument::NS_STYLE, 'name', $style_name);\n }\n return $style->getAttributeNS(OpenDocument::NS_STYLE, 'name');\n }",
"function qodef_core_set_clients_carousel_custom_style_for_vc_shortcodes( $style ) {\n\t\t$current_style = '.wpb_content_element.wpb_qodef_clients_carousel_item > .wpb_element_wrapper { \n\t\t\tbackground-color: #f4f4f4; \n\t\t}';\n\t\t\n\t\t$style .= $current_style;\n\t\t\n\t\treturn $style;\n\t}",
"function wpsp_list_tour_style( $icon_size = '' ) {\n\tglobal $post;\n\n\t$class = 'tour-style-icon';\n\tif ( $icon_size ) \n\t\t$class = 'tour-style-icon-' . $icon_size;\n\n\t//$args = array('orderby' => 'ID', 'order' => 'DESC', 'fields' => 'all');\n\t$tour_styles = wp_get_post_terms( $post->ID, 'tour_style' );\n\t$out = '<ul class=\"' . $class . '\">';\n\t$out .= '<li><span class=\"label\">' . esc_html__( 'Experiences: ', 'discovertravel' ) . '</span></li>';\n\tforeach ($tour_styles as $term) {\n\t\t//$out .= '<li><a href=\"' . get_term_link( $term ) . '\" title=\"' . $term->name . '\"><span class=\"sprite ' . get_option( 'tour_style_'.$term->term_id.'_icon', '' ) . '\"></span>' . $term->name . '</a></li>';\n\t\t$out .= '<li><span class=\"sprite ' . get_option( 'tour_style_'.$term->term_id.'_icon', '' ) . '\"></span></li>';\n\t}\n\t$out .= '</ul>';\n\techo $out;\n}"
] | [
"0.6829143",
"0.65700865",
"0.64092726",
"0.63970053",
"0.635849",
"0.63078773",
"0.62663525",
"0.62641484",
"0.61759895",
"0.61547875",
"0.6082885",
"0.6051473",
"0.60347366",
"0.60225666",
"0.6014915",
"0.5985546",
"0.59085315",
"0.58639145",
"0.585478",
"0.58472973",
"0.58380705",
"0.5834032",
"0.58137274",
"0.5783379",
"0.5767183",
"0.57408637",
"0.5731777",
"0.57280463",
"0.57191193",
"0.5707035",
"0.56801796",
"0.56541353",
"0.5652124",
"0.56441766",
"0.5633738",
"0.5593926",
"0.5593926",
"0.5578427",
"0.5560112",
"0.5530062",
"0.5496803",
"0.5493861",
"0.5472828",
"0.5463739",
"0.5439598",
"0.5422126",
"0.54120356",
"0.538416",
"0.53689325",
"0.53689325",
"0.5360958",
"0.5335246",
"0.5331503",
"0.53267914",
"0.5325936",
"0.5324564",
"0.5324564",
"0.53199446",
"0.530976",
"0.5306391",
"0.52985954",
"0.5290089",
"0.5275705",
"0.5272154",
"0.52705014",
"0.52690256",
"0.52506995",
"0.52485514",
"0.52436125",
"0.5241328",
"0.52313477",
"0.52178663",
"0.5217079",
"0.5212292",
"0.52029115",
"0.51966727",
"0.5193701",
"0.519304",
"0.51781577",
"0.516648",
"0.51627797",
"0.5141528",
"0.5135873",
"0.5134055",
"0.51088834",
"0.50896955",
"0.5089191",
"0.5086525",
"0.5080416",
"0.5079144",
"0.5074946",
"0.50691146",
"0.5068841",
"0.5062952",
"0.50577396",
"0.50573117",
"0.50490636",
"0.5040766",
"0.50335777",
"0.5032399"
] | 0.5740474 | 26 |
Create a new controller instance. | public function __construct()
{
$this->middleware('auth');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createController()\n {\n $this->createClass('controller');\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }",
"private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }",
"protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }",
"public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }",
"public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}",
"public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}",
"public function createController( ezcMvcRequest $request );",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }",
"public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}",
"private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }",
"public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}",
"public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}",
"private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }",
"public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }",
"public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se creó correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}",
"private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}",
"public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}",
"public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }",
"protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }",
"private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }",
"public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }",
"protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}",
"public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}",
"private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}",
"public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }",
"protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }",
"public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }",
"protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }",
"protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }",
"protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}",
"public function makeTestController(TestController $controller)\r\n\t{\r\n\t}",
"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 }",
"public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }",
"public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}",
"public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}",
"public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}",
"public function getController( );",
"public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }",
"static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }",
"public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }",
"private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }",
"function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }",
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }",
"protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }",
"public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }",
"protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }",
"public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }",
"public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }",
"public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }",
"protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }",
"private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }",
"public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}",
"public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }",
"public function controller()\n\t{\n\t\n\t}",
"protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }",
"function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}",
"protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }",
"public function __construct()\n {\n $this->controller = new DHTController();\n }",
"public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}",
"protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }",
"private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }",
"public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}",
"public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }",
"public static function createController( MShop_Context_Item_Interface $context, $name = null );",
"public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }",
"public function getController();",
"public function getController();",
"public function getController();",
"public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }",
"private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }",
"public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }",
"public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }",
"private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }",
"static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }",
"private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }",
"public function AController() {\r\n\t}",
"protected function initializeController() {}",
"public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }",
"public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }",
"private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }",
"function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }",
"public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}",
"public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }",
"private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}",
"public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }",
"protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }",
"public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }",
"public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}",
"protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }",
"public function create() {}",
"public function __construct()\n {\n $this->dataController = new DataController;\n }",
"function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}",
"public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }",
"private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }",
"public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }"
] | [
"0.82668066",
"0.8173394",
"0.78115296",
"0.77052677",
"0.7681875",
"0.7659338",
"0.74860525",
"0.74064577",
"0.7297601",
"0.7252339",
"0.7195181",
"0.7174191",
"0.70150065",
"0.6989306",
"0.69835985",
"0.69732994",
"0.6963521",
"0.6935819",
"0.68973273",
"0.68920785",
"0.6877748",
"0.68702674",
"0.68622285",
"0.6839049",
"0.6779292",
"0.6703522",
"0.66688496",
"0.66600126",
"0.6650373",
"0.66436416",
"0.6615505",
"0.66144013",
"0.6588728",
"0.64483404",
"0.64439476",
"0.6429303",
"0.6426485",
"0.6303757",
"0.6298291",
"0.6293319",
"0.62811387",
"0.6258778",
"0.62542456",
"0.616827",
"0.6162314",
"0.61610043",
"0.6139887",
"0.613725",
"0.61334985",
"0.6132223",
"0.6128982",
"0.61092585",
"0.6094611",
"0.60889256",
"0.6074893",
"0.60660255",
"0.6059098",
"0.60565156",
"0.6044235",
"0.60288006",
"0.6024102",
"0.60225666",
"0.6018304",
"0.60134345",
"0.60124683",
"0.6010913",
"0.6009284",
"0.6001683",
"0.5997471",
"0.5997012",
"0.59942573",
"0.5985074",
"0.5985074",
"0.5985074",
"0.5967613",
"0.5952533",
"0.5949068",
"0.5942203",
"0.5925731",
"0.5914304",
"0.5914013",
"0.59119135",
"0.5910308",
"0.5910285",
"0.59013796",
"0.59003943",
"0.5897524",
"0.58964556",
"0.58952993",
"0.58918965",
"0.5888943",
"0.5875413",
"0.5869938",
"0.58627135",
"0.58594996",
"0.5853714",
"0.5839484",
"0.5832913",
"0.582425",
"0.58161044",
"0.5815566"
] | 0.0 | -1 |
Show the application dashboard. | public function datapegawai($e){
// $data = DB::table('syn_m_karyawans')->where('syn_m_karyawans.id',$e)
// ->leftJoin('syn_m_titles','syn_m_titles.title_code','syn_m_karyawans.title')
//
//
//
//
// ->leftJoin('syn_m_grades','syn_m_grade.grades_code','syn_m_karyawans.grade')
// ->leftJoin('syn_m_levels','syn_m_level.levels_code','syn_m_karyawans.level')
// ->first();
$data = DB::table('syn_m_karyawans')->where('syn_m_karyawans.id',$e)
->leftJoin('syn_m_lokasis','syn_m_lokasis.loc_code','syn_m_karyawans.lokasi')
->leftJoin('syn_m_depts','syn_m_depts.dept_code','syn_m_karyawans.dept_id')
->leftJoin('syn_m_divisions','syn_m_divisions.div_code','syn_m_karyawans.div_id')
->leftJoin('syn_m_directorats','syn_m_directorats.dir_code','syn_m_karyawans.dir_id')
->first();
return view('backend.subdatakaryawan.datapegawai',compact('data'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }",
"function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}",
"public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }",
"public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }",
"public function dashboard()\n {\n return view('backend.dashboard.index');\n }",
"public function index() {\n return view(\"admin.dashboard\");\n }",
"public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }",
"public function dashboard(){\n return view('backend.admin.index');\n }",
"public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }",
"public function dashboard()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }",
"public function dashboard() \r\n {\r\n return view('admin.index');\r\n }",
"public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}",
"public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }",
"public function dashboard()\n {\n\n return view('admin.dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('adm.dashboard');\n }",
"public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }",
"public function show()\n {\n return view('dashboard');\n }",
"public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}",
"public function index() {\n return view('modules.home.dashboard');\n }",
"public function show()\n {\n return view('dashboard.dashboard');\n \n }",
"public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }",
"public function dashboard()\n { \n return view('jobposter.dashboard');\n }",
"public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}",
"public function index()\n {\n return view('pages.admin.dashboard');\n }",
"public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }",
"public function index()\n {\n //\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard.index');\n }",
"public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }",
"public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }",
"public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }",
"public function getDashboard() {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('smartcrud.auth.dashboard');\n }",
"public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }",
"public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }",
"public function index()\n {\n return view('board.pages.dashboard-board');\n }",
"public function index()\n {\n return view('admin::settings.development.dashboard');\n }",
"public function index()\n {\n return view('dashboard.dashboard');\n }",
"public function show()\n {\n return view('dashboard::show');\n }",
"public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }",
"public function dashboard()\n {\n return view('Admin.dashboard');\n }",
"public function show()\n {\n return view('admins\\auth\\dashboard');\n }",
"public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }",
"public function index()\n {\n return view('bitaac::account.dashboard');\n }",
"public function index()\n { \n return view('admin-views.dashboard');\n }",
"public function getDashboard()\n {\n return view('dashboard');\n }",
"function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }",
"public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }",
"public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }",
"public function index()\r\n {\r\n return view('user.dashboard');\r\n }",
"public function index() {\n return view('dashboard', []);\n }",
"public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }",
"public function index()\n {\n return view('back-end.dashboard.index');\n //\n }",
"public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}",
"public function index() {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('page.dashboard.index');\n }",
"public function index()\n {\n\n return view('dashboard');\n }",
"public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }",
"public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }",
"public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}",
"public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }",
"public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}",
"public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }",
"public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }",
"public function index()\n {\n return view('/dashboard');\n }",
"public function index()\n {\n \treturn view('dashboard');\n }",
"public function index()\n {\n return view('ketua.ketua-dashboard');\n }",
"public function index(){\n return View::make('admin.authenticated.dashboardview');\n }",
"public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }",
"public function index()\n {\n return view('adminpanel.home');\n }",
"public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}",
"public function index()\n {\n return view('dashboard.home');\n }",
"public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }",
"public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }",
"public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }",
"public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }",
"public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }",
"public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }",
"public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }",
"public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }"
] | [
"0.77850926",
"0.7760142",
"0.7561336",
"0.75147176",
"0.74653697",
"0.7464913",
"0.73652893",
"0.7351646",
"0.7346477",
"0.73420244",
"0.7326711",
"0.7316215",
"0.73072463",
"0.7287626",
"0.72826403",
"0.727347",
"0.727347",
"0.727347",
"0.727347",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7241342",
"0.7236133",
"0.7235562",
"0.7218318",
"0.71989936",
"0.7197427",
"0.71913266",
"0.71790016",
"0.71684825",
"0.71577966",
"0.7146797",
"0.7133428",
"0.7132746",
"0.71298903",
"0.71249074",
"0.71218014",
"0.71170413",
"0.7110151",
"0.7109032",
"0.7107029",
"0.70974076",
"0.708061",
"0.7075653",
"0.70751685",
"0.7064041",
"0.70550334",
"0.7053102",
"0.7051273",
"0.70484304",
"0.7043605",
"0.70393986",
"0.70197886",
"0.70185125",
"0.70139873",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.6992477",
"0.6979631",
"0.69741416",
"0.69741327",
"0.6968815",
"0.6968294",
"0.69677526",
"0.69652885",
"0.69586027",
"0.6944985",
"0.69432825",
"0.69419175",
"0.6941512",
"0.6941439",
"0.6938837",
"0.6937524",
"0.6937456",
"0.6937456",
"0.69276494",
"0.6921651",
"0.69074917",
"0.69020325",
"0.6882262",
"0.6869339",
"0.6867868",
"0.68557185",
"0.68479055",
"0.684518",
"0.68408877",
"0.6838798",
"0.6833479",
"0.6832326",
"0.68309164",
"0.6826798",
"0.6812457"
] | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$departamentos = Departamento::all();
return Inertia::render('Departamentos', ['departamentos' => $departamentos,
'user' => Auth::guard('tenant')->user()->name,
'prefix' => \Request::route('prefix')
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.6830523",
"0.6802689",
"0.6797",
"0.67957735",
"0.67871135",
"0.6760129",
"0.67427456",
"0.6730486",
"0.67272323",
"0.67255723",
"0.67255723",
"0.67255723",
"0.67177945",
"0.6707866",
"0.6706713",
"0.6704375",
"0.6664782",
"0.6662871",
"0.6660302",
"0.6659404",
"0.6656656",
"0.6653517",
"0.6647965",
"0.6620322",
"0.66185474",
"0.6618499",
"0.6606105",
"0.6600617",
"0.65996987",
"0.6594775",
"0.6587389",
"0.6585109",
"0.6581641",
"0.6581017",
"0.6577157",
"0.65747666",
"0.6572513",
"0.65721947",
"0.6570553",
"0.65646994",
"0.6563556",
"0.6554194",
"0.65529937",
"0.65460825",
"0.65368485",
"0.653429",
"0.65328294",
"0.6526759",
"0.6526695",
"0.6526284",
"0.65191334",
"0.65183175",
"0.65174305",
"0.651703",
"0.65141153",
"0.6507088",
"0.65061647",
"0.6504046",
"0.64942145",
"0.6491893",
"0.64883405",
"0.6486392",
"0.6485077",
"0.64846045",
"0.6478858",
"0.64756656",
"0.64726377",
"0.6471126",
"0.64701074",
"0.6467418",
"0.6462195",
"0.64618355",
"0.6459199",
"0.6457831",
"0.6454631",
"0.64533997",
"0.6451915",
"0.6450861",
"0.6449301",
"0.64492667",
"0.64469045"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
if(Departamento::create($request->all())) {
return $this->success('Departamento salvo com sucesso', 1200);
} else {
return $this->error('Ops! Algo não deu certo!');
}
} | {
"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(Departamento $departamento)
{
//
} | {
"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( Request $request )
{
$idDepartamento = pathinfo($request->path())['basename'];
$departamento = Departamento::where('id', $idDepartamento)->get()->first();
return Inertia::render('Departamentos/Create',
['departamento' => $departamento,
'user' => Auth::guard('tenant')->user()->name,
'prefix' => \Request::route('prefix')
]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }",
"public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}",
"public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }",
"public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }",
"public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }",
"function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}",
"public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"public function edit($id)\n {\n return $this->showForm($id);\n }",
"protected function _edit(){\n\t\treturn $this->_editForm();\n\t}",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }",
"public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}",
"public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}",
"public function edit($id)\n {\n return view('models::edit');\n }",
"public function edit()\n {\n return view('home::edit');\n }",
"public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }",
"public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit()\n {\n return view('user::edit');\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit()\n {\n return view('website::edit');\n }",
"public function edit()\n {\n return view('inventory::edit');\n }",
"public function edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}"
] | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.68336326",
"0.6811471",
"0.68060875",
"0.68047357",
"0.68018645",
"0.6795623",
"0.6791791",
"0.6791791",
"0.6787701",
"0.67837197",
"0.67791027",
"0.677645",
"0.6768301",
"0.6760122",
"0.67458534",
"0.67458534",
"0.67443407",
"0.67425704",
"0.6739898",
"0.6735328",
"0.6725465",
"0.6712817",
"0.6693891",
"0.6692419",
"0.6688581",
"0.66879624",
"0.6687282",
"0.6684741",
"0.6682786",
"0.6668777",
"0.6668427",
"0.6665287",
"0.6665287",
"0.66610634",
"0.6660843",
"0.66589665",
"0.66567147",
"0.66545695",
"0.66527975",
"0.6642529",
"0.6633056",
"0.6630304",
"0.6627662",
"0.6627662",
"0.66192114",
"0.6619003",
"0.66153085",
"0.6614968",
"0.6609744",
"0.66086483",
"0.66060555",
"0.6596137",
"0.65950733",
"0.6594648",
"0.65902114",
"0.6589043",
"0.6587102",
"0.65799844",
"0.65799403",
"0.65799177",
"0.657708",
"0.65760696",
"0.65739626",
"0.656931",
"0.6567826",
"0.65663105",
"0.65660435",
"0.65615267",
"0.6561447",
"0.6561447",
"0.65576506",
"0.655686",
"0.6556527",
"0.6555543",
"0.6555445",
"0.65552044",
"0.65543956",
"0.65543705",
"0.6548264",
"0.65475875",
"0.65447706"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request)
{
$id = pathinfo($request->path())['basename'];
if(Departamento::where('id', $id)->update($request->validate($this->rules))) {
return $this->success('Departamento alterado com sucesso');
} else {
return $this->error('Oops! Algo não deu certo!');
}
} | {
"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(Request $request)
{
$id = pathinfo($request->path())['basename'];
if (Departamento::where('id', $id)->delete()) {
return $this->success('Departamento excluído com sucesso');
} else {
return $this->error("Ooops! Algo não deu certo!");
}
} | {
"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 |
Desativa um passageiro no banco | public function Desativar(){
$idFrota = $_GET['id'];
$frota = new Frota();
$frota->id = $idFrota ;
$frota::Desativando($frota);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eliminarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function eliminarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function desativar()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"UPDATE EncontroComDeus SET \t ativo = 0\n WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n //var_dump($erro);\n //exit();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n }",
"function excluirPessoa(){\r\n $banco = conectarBanco();\r\n $sql = \"DELETE FROM pessoa WHERE id = '{$_POST[\"id\"]}'\";\r\n $banco->query($sql); // Passa a query fornecida em $sql para o banco de dados\r\n $banco->close(); // Fecha o banco de dados\r\n voltarMenu(); // Volta para a pagina inicial da agenda\r\n}",
"function deleteTurmaCatequese()\n {\n $sql = \"UPDATE TurmaCatequese SET status = 0 WHERE id=:id\";\n $query = $this->db->prepare($sql);\n $query->bindParam(\":id\",$this->id);\n $query->execute();\n echo json_encode(\"{'message': 'Turma apagada'}\");\n }",
"function Debloquer($utilisateur1,$utilisateur2){\r\n $conn = mysqli_connect(\"localhost\", \"root\", \"\", \"bddfinale\");\r\n $requete = \"SELECT Id_blocage FROM blocage WHERE (Bloqueur='$utilisateur1' AND Bloque='$utilisateur2')\";\r\n $ligne= mysqli_query($conn, $requete);\r\n $n = mysqli_num_rows($ligne);\r\n if ($n > 0) {\r\n //supprime la ligne correspondant à ce blocage dans le BDD \r\n $requete = \"DELETE FROM blocage WHERE (Bloqueur='$utilisateur1' AND Bloque='$utilisateur2')\";\r\n $ligne= mysqli_query($conn, $requete);\r\n } \r\n mysqli_close($conn);\r\n }",
"public function desenfocarCamaraPresidencia() {\n\n self::$presidencia->desenfocar();\n\n }",
"public function reativar($sObservacao = null) {\n\n if (empty($this->iCodigoBem)) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_existe_base_de_dados'));\n }\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.sem_transacao'));\n }\n\n if (!$this->isBaixado()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_esta_baixado'));\n }\n $oDaoBensBaixa = new cl_bensbaix();\n $oDaoBensBaixa->excluir($this->getCodigoBem());\n if ($oDaoBensBaixa->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.erro_reativar_bem', (object)array(\"erro_msg\" => $oDaoBensBaixa->erro_msg)));\n }\n\n $oDataAtual = new DBDate(date('Y-m-d', db_getsession(\"DB_datausu\")));\n $oInstit = new Instituicao(db_getsession(\"DB_instit\"));\n $lIntegracaoFinanceiro = ParametroIntegracaoPatrimonial::possuiIntegracaoPatrimonio($oDataAtual, $oInstit);\n\n $aNotas = $this->getNotasFiscais();\n\n $lRealizouLancamento = false;\n foreach ($aNotas as $oNota) {\n\n /**\n * realiza lancamentos contabens do bem\n * caso o desdobramento da nota do bem esteja no grupo 9 (bem permante)\n */\n if (!empty($oNota) && $this->verificaSituacaoNota() && $oNota->getValorLiquidado() == 0) {\n\n $oGrupo = GrupoContaOrcamento::getGrupoConta($oNota->getDesdobramento(), db_getsession(\"DB_anousu\"));\n if (!empty($oGrupo) && $oGrupo->getCodigo() == 9) {\n\n $sObs = \"Estorno do Lançamento em liquidação do tombamento do bem {$this->getCodigoBem()}.\";\n\n if ($lIntegracaoFinanceiro) {\n\n $nValor = $this->getValorAquisicao();\n if (count($aNotas) > 1) {\n $nValor = $this->getValorItemNota($oNota->getCodigoNota());\n }\n\n $oProcessarLancamento = new stdClass();\n $oProcessarLancamento->iCodigoDotacao = $oNota->getEmpenho()->getDotacao()->getCodigo();\n $oProcessarLancamento->iCodigoElemento = $oNota->getDesdobramento();\n $oProcessarLancamento->iCodigoNotaLiquidacao = $oNota->getCodigoNota();\n $oProcessarLancamento->iFavorecido = $oNota->getEmpenho()->getCgm()->getCodigo();\n $oProcessarLancamento->iNumeroEmpenho = $oNota->getEmpenho()->getNumero();\n $oProcessarLancamento->sObservacaoHistorico = $sObs;\n $oProcessarLancamento->nValorTotal = $nValor;\n $oProcessarLancamento->oClassificacao = $this->getClassificacao();\n $oProcessarLancamento->oGrupo = $oGrupo;\n\n LancamentoEmpenhoEmLiquidacao::processar($oProcessarLancamento);\n $lRealizouLancamento = true;\n }\n }\n }\n }\n\n if (USE_PCASP && !$lRealizouLancamento && $lIntegracaoFinanceiro ) {\n\n /**\n * Realiza acerto nas contas de depreciação e classificação, caso seja necessário\n */\n $oBemAcertoContaClassificacao = new BemAcertoContaClassificacao();\n $oDBData = new DBDate( date(\"d/m/Y\", db_getsession(\"DB_datausu\")) );\n\n $oBemDepreciacao = BemDepreciacao::getInstance($this);\n $nValorAtual = $this->nValorAquisicao;\n\n if (!empty($oBemDepreciacao)) {\n $nValorAtual = $oBemDepreciacao->getValorAtual();\n }\n\n if ($nValorAtual != 0) {\n $oLancamentoauxiliarBem = new LancamentoAuxiliarBem();\n $oLancamentoauxiliarBem->setValorTotal($nValorAtual);\n $oLancamentoauxiliarBem->setBem($this);\n $oLancamentoauxiliarBem->setObservacaoHistorico($sObservacao);\n $oLancamentoauxiliarBem->setEstorno(true);\n $oEventoContabil = new EventoContabil(702, db_getsession('DB_anousu'));\n $aLancamentos = $oEventoContabil->getEventoContabilLancamento();\n $oLancamentoauxiliarBem->setHistorico($aLancamentos[0]->getHistorico());\n $oEventoContabil->executaLancamento($oLancamentoauxiliarBem);\n }\n }\n }",
"public function desasociar($id_activo, $id_maleza){\n\n $activo = Activo::find($id_activo);\n $activo->malezas()->detach($id_maleza);\n\n Session::flash(\"mensaje\",[\"contenido\"=>\"Registro Correcto\", \"color\" => \"green\"]);\n return redirect()->back();\n\n\n }",
"function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t \t$sql = \"UPDATE proveedor SET status='0' WHERE id_prov='$this->cod_prov'\";\n\t\t\t$this->ejecuta($sql);\n\t}",
"function motivoDeAsignacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ASIGNACIÓN' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}",
"function deleteParoquia()\n {\n $sql = \"UPDATE Paroquia SET status = 0 WHERE id=:id\";\n $query = $this->db->prepare($sql);\n $query->bindParam(\":id\",$this->id);\n $query->execute();\n echo json_encode(\"{'message': 'Paroquia apagada'}\");\n }",
"public function destroy($id_ba)\n {\n $barrio =Barrio::where('id',$id_ba)->firstOrFail();\n $solicitantes = DB::table('Solicitantes')->pluck('idBarrio');\n\n\n $encontrado=false;\n\n $resultado= \"Es imposible destruir el registro puesto que el Identificador: \".\"($id_ba)\".\" perteneciente al Barrio \".$barrio->nombre.\" esta siendo referenciado en uno o mas Solicitantes\";\n \n foreach($solicitantes as $elemento){\n if ($elemento==$id_ba)\n $encontrado=true;\n }\n\n if ($encontrado){ \n return redirect()->route('superuser.barrio-index')->with('advertencia',$resultado);\n }else{\n $barrio->delete();\n return redirect()->route('superuser.barrio-index')\n ->with('danger','Barrio Eliminado Satisfactoriamente'); \n }\n }",
"public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM denuncia WHERE ID_DENUNCIA = '$this->idDenuncia'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar la denuncia\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Denuncia eliminada\";\n\t\t}",
"function borrarInscrito() {\n //Creamos la evaluacion\n leerClase('Evaluacion');\n leerClase('Estudiante');\n leerClase('Proyecto_dicta');\n $estudiante = new Estudiante($this->estudiante_id);\n $evaluacion = new Evaluacion($this->evaluacion_id);\n $protecto=$estudiante->getProyecto();\n $sql = \"select p.id as id from \" . $this->getTableName('Proyecto_dicta') . \" as p where p.proyecto_id = '$protecto->id' and p.dicta_id = '$this->dicta_id' \";\n $resultado = mysql_query($sql);\n\n $proyecto_array = mysql_fetch_array($resultado);\n $proyecto_dicta = new Proyecto_dicta($proyecto_array);\n $proyecto_dicta->delete();\n $evaluacion->delete();\n $this->delete();\n }",
"public function excluir(){\n\t\tglobal $tabela_links;\n\t\t$consulta = new conexao();\n\t\t$endereco = $consulta->sanitizaString($this->end_link);\n\t\t$funcionalidade_tipo = (int) $this->funcionalidade_tipo;\n\t\t$funcionalidade_id = (int) $this->funcionalidade_id;\n\t\t//echo(\"$endereco\t $funcionalidade_tipo\t$funcionalidade_id\");\n\t\t$consulta->connect();\n\t\t$consulta->solicitar(\"DELETE FROM $tabela_links \n\t\t\t\t\t\t\t\tWHERE endereco = '$endereco'\n\t\t\t\t\t\t\t\tAND funcionalidade_tipo\t= '$funcionalidade_tipo'\n\t\t\t\t\t\t\t\tAND funcionalidade_id\t= '$funcionalidade_id'\");\n\t\t\n\t\n\t}",
"function insertarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\n\n\t\t$this->setParametro('banco','banco','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function eliminar($bd);",
"public function ban();",
"function Eliminar()\n{\n /**\n * Se crea una instanica a Concesion\n */\n $Concesion = new Titulo();\n /**\n * Se coloca el Id del acuifero a eliminar por medio del metodo SET\n */\n $Concesion->setId_titulo(filter_input(INPUT_GET, \"ID\"));\n /**\n * Se manda a llamar a la funcion de eliminar.\n */\n echo $Concesion->delete();\n}",
"function DeleteParlamentarian($db){\n $sql = \"DELETE FROM \".self::$parlamentrianTb.\" WHERE email=:email\";\n $stmt = $db->Prepare($sql);\n $stmt->bindParam(':email', $this->email,\\PDO::PARAM_STR);\n \n try {\n $stmt->execute();\n } catch (\\Exception $ex) {\n echo nl2br('Error on DELETE\\r\\n'.$ex->getMessage());\n } \n }",
"function listarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_sel';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('id_cuenta_bancaria_boa','int4');\n\t\t$this->captura('banco','int4');\n\t\t$this->captura('cuenta','varchar');\n\t\t$this->captura('desc_cuenta','varchar');\n\t\t$this->captura('moneda','int4');\n\t\t$this->captura('tipo_cuenta','bpchar');\n\t\t$this->captura('estado_cuenta','bpchar');\n\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('desc_cuenta_banco','varchar');\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }",
"public function detalhe ()\n {\n try {\n // Define a ação de detalhe\n $acao = Orcamento_Business_Dados::ACTION_DETALHE;\n \n // Retorna parâmetros informados via get, após validações\n $parametros = $this->trataParametroGet ( 'cod' );\n \n // Busca os dados a exibir, após validações\n $registro = $this->trataRegistro ( $acao, $parametros );\n \n // Exibe o registro retornado\n $this->view->dados = $registro;\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }",
"public function examen(){\r\n\t\tparent::conectaBDMy();\t \r\n\t\t$this->idExamen=\"\";\t\t\r\n\t\t$this->tipoExamen=\"\";\t\r\n\t\t$this->descripcion=\"\";\r\n\t}",
"public function delete()\r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"DELETE FROM puesto WHERE idPue = {$this->idPue};\");\r\n }",
"public function removeBateau($id)\r\n {\r\n $this->_bdd->query(\"DELETE FROM `bateau` WHERE `id` ='$id'\");\r\n }",
"function Clean() // libera la consulta\n {oci_free_statement($this->consulta);}",
"public function liberar() {}",
"public function baja(){\n global $baseDatos;\n $id_c = $this->getIdC();\n $sql = \"DELETE FROM `conductores` WHERE `conductores`.`id_c` = '$id_c'\";\n $res = $baseDatos->query($sql);\n return $res;\n }",
"function del($param) {\n extract($param);\n $conexion->getPDO()->exec(\"DELETE FROM operario WHERE fk_usuario = '$id'; \n DELETE FROM usuario WHERE id_usuario='$id'\");\n echo $conexion->getEstado();\n }",
"function suppMembre($id)\n\t{\n\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete('membres');\n\t}",
"function getBloqueado() {\n return $this->bloqueado;\n }",
"public function clean(){\n\t\t$sql = 'DELETE FROM conta_a_pagar';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }",
"public function clean(){\n\t\t$sql = 'DELETE FROM ano_letivo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"private function objetoAbreConexao()\n\t{\n\t\t\n\t\t$_BANCO = new ConexaoBD();\n\t\t$_BANCO->conexaoBD();\n\t}",
"function\tunbuche() {\n\t\tFDbg::dumpL( 0x00000100, \"AbKorr.php::AbKorrPosten::unbuche(): begin\") ;\n\t\t$this->_buche( -1) ;\n\t\tFDbg::dumpL( 0x00000100, \"AbKorr.php::AbKorrPosten::unbuche(): end\") ;\n\t}",
"function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }",
"public function destroy($id,$tipo)\n {\n $ip = request()->server();\n $user =auth()->user();\n\n $venta = Venta::find($id);\n\n $mensaje = Venta::find($id);\n $darBaja =\"200\"; \n $darAlta =\"400\";\n $eliminado =\"600\";\n if($tipo === $darBaja){\n //si es 200 de da de baja\n $venta->estado = false;\n Log::info( 'IP DEL CLIENTE:'. $ip['REMOTE_ADDR'] . ' CLIENTE: '. $user->name . ' DESDE NAVEGADOR:'.$ip['HTTP_USER_AGENT'] . ' DESCRIPCIÓN: Venta dado de baja, id: ' .$mensaje->id . ', Nombre: ' . $mensaje->nombre . ' ' );\n \n $venta->save();\n\n return back()->with('info', 'Dado de baja correctamente');\n }\n if($tipo === $darAlta){\n //si es 400 dar Alta\n $venta->estado = true;\n Log::info( 'IP DEL CLIENTE:'. $ip['REMOTE_ADDR'] . ' CLIENTE: '. $user->name . ' DESDE NAVEGADOR:'.$ip['HTTP_USER_AGENT'] . ' DESCRIPCIÓN: Venta dado de alta, id: ' .$mensaje->id . ', Nombre: ' . $mensaje->nombre . ' ' );\n $venta->save();\n\n return back()->with('info', 'Dado de alta correctamente');\n }\n if($tipo === $eliminado){\n //si es 400 de cambia el eliminado\n $venta->eliminado = true;\n\n //Cambia el estado eliminado de las areas dependientes de este venta\n //DB::table('areas')->where('departamento_id',$venta->id)->update(['eliminado'=>true]);\n\n Log::info( 'IP DEL CLIENTE:'. $ip['REMOTE_ADDR'] . ' CLIENTE: '. $user->name . ' DESDE NAVEGADOR:'.$ip['HTTP_USER_AGENT'] . ' DESCRIPCIÓN: Venta eliminado, id: ' .$mensaje->id . ', Nombre: ' . $mensaje->nombre . ' ' );\n $venta->save();\n\n return back()->with('info', 'Eliminado correctamente');\n }\n \n }",
"public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"final public function delete() {\n global $config; \n # Borrar el elemento de la base de datos\n $this->db->query(\"DELETE FROM guarderia_2 WHERE id_guarderia = $this->id\");\n # Redireccionar a la página principal del controlador\n $this->functions->redir($config['site']['url'] . 'sedes/&success=true');\n }",
"function delete_produto_solicitacao_baixa_estoque($di)\n {\n $this->db->delete('produto_solicitacao_baixa_estoque',array('di'=>$di));\n }",
"public function get_Banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from banco;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }",
"public function EliminarMesas()\n\t{\n\n\t\t$sql = \" select codmesa from ventas where codmesa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from mesas where codmesa = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codmesa);\n\t\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: mesas?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: mesas?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}",
"public function eliminar($objeto){\r\n\t}",
"public static function destroyEstudiante($idEstu)\n{\n $estudiante = Estudiante::find($idEstu);\n $estudiante->delete();\n}",
"public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }",
"public function pasaje_abonado();",
"function eliminarItem($id, $confirmado) {\n global $textos, $sql;\n\n if(!is_numeric($id) || !$sql->existeItem('items_bb', 'id', $id)){\n $respuesta['error'] = true;\n $respuesta['mensaje'] = $textos->id('ERROR_DESCONOCIDO');\n Servidor::enviarJSON($respuesta);\n return NULL;\n }\n\n $objeto = new BulletinBoardItem($id);\n $destino = '/ajax'.$objeto->urlBase.'/delete';\n\n if (!$confirmado) {\n $titulo = HTML::frase($objeto->titulo, 'negrilla');\n $titulo = str_replace('%1', $titulo, $textos->id('CONFIRMAR_ELIMINACION'));\n $codigo = HTML::campoOculto('procesar', 'true');\n $codigo .= HTML::campoOculto('id', $id);\n $codigo .= HTML::parrafo($titulo);\n $codigo .= HTML::parrafo(HTML::boton('chequeo', $textos->id('ACEPTAR')), 'margenSuperior');\n $codigo = HTML::forma($destino, $codigo);\n\n $respuesta['generar'] = true;\n $respuesta['codigo'] = $codigo;\n $respuesta['destino'] = '#cuadroDialogo';\n $respuesta['titulo'] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id('ELIMINAR_ITEM'), 'letraNegra negrilla'), 'bloqueTitulo-IS'), 'encabezadoBloque-IS');\n $respuesta['ancho'] = 350;\n $respuesta['alto'] = 150;\n } else {\n\n\n if ($objeto->eliminar()) { \n $respuesta['error'] = false;\n $respuesta['accion'] = 'recargar';\n }else{ \n \n $respuesta['mensaje'] = $textos->id('ERROR_DESCONOCIDO');\n }\n\n }\n\n Servidor::enviarJSON($respuesta);\n\n}",
"public function eliminarusuario($codigo){\r\n\t//Preparamos la conexion a la bdd:\r\n\t$pdo=Database::connect();\r\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t$sql=\"delete from usuario where codigo=?\";\r\n\t$consulta=$pdo->prepare($sql);\r\n//Ejecutamos la sentencia incluyendo a los parametros:\r\n\t$consulta->execute(array($codigo));\r\n\tDatabase::disconnect();\r\n}",
"public function CerrarSesion(){\n $a=new ManejadorCassandra();\n $x=$a->Eliminar('sesion.'.$this-> ObtenerIp());\n return \"La sesion ha sido cerrada\";\n}",
"public function salvar() {\n\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.sem_transacao'));\n }\n\n /**\n * Realizamos algumas validações básicas\n */\n if ($this->oPlaca == null || !$this->oPlaca instanceof PlacaBem) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.placa_nao_definida'));\n }\n if (!$this->getFornecedor() instanceof CgmBase) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.informe_fornecedor'));\n }\n if (!$this->getClassificacao() instanceof BemClassificacao) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.informe_classificacao'));\n }\n /**\n * Dados da tabela bens\n */\n $oDaoBens = new cl_bens();\n $oDaoBens->t52_bensmarca = \"{$this->getMarca()}\";\n $oDaoBens->t52_bensmedida = \"{$this->getMedida()}\";\n $oDaoBens->t52_bensmodelo = \"{$this->getModelo()}\";\n $oDaoBens->t52_codcla = $this->getClassificacao()->getCodigo();\n $oDaoBens->t52_depart = $this->getDepartamento();\n $oDaoBens->t52_descr = $this->getDescricao();\n $oDaoBens->t52_dtaqu = $this->getDataAquisicao();\n $oDaoBens->t52_instit = $this->getInstituicao();\n $oDaoBens->t52_numcgm = $this->getFornecedor()->getCodigo();\n $oDaoBens->t52_obs = $this->getObservacao();\n $oDaoBens->t52_valaqu = \"{$this->getValorAquisicao()}\";\n\n /**\n * Inclusao - busca placa\n */\n if (empty($this->iCodigoBem)) {\n $oDaoBens->t52_ident = $this->getPlaca()->getNumeroPlaca();\n }\n\n $lIncorporacaoBem = false;\n if (!empty($this->iCodigoBem)) {\n\n $oDaoBens->t52_bem = $this->iCodigoBem;\n $oDaoBens->alterar($this->iCodigoBem);\n $sHistoricoBem = 'Alteração de dados do Bem';\n } else {\n\n $sHistoricoBem = 'Inclusão do Bem';\n $oDaoBens->incluir(null);\n $this->iCodigoBem = $oDaoBens->t52_bem;\n $lIncorporacaoBem = true;\n }\n\n if ($oDaoBens->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.erro_salvar', (object)array(\"erro_msg\" => $oDaoBens->erro_msg)));\n }\n\n $lRealizarEscrituracao = $this->criaVinculoBemNotas();\n\n $oDataAtual = new DBDate(date('Y-m-d', db_getsession(\"DB_datausu\")));\n $oInstit = new Instituicao(db_getsession(\"DB_instit\"));\n $lIntegracaoFinanceiro = ParametroIntegracaoPatrimonial::possuiIntegracaoPatrimonio($oDataAtual, $oInstit);\n\n $lRealizouLancamento = false;\n if ($lRealizarEscrituracao && $lIntegracaoFinanceiro && $lIncorporacaoBem) {\n $lRealizouLancamento = $this->processaLancamentoContabil();\n }\n\n /**\n * Salva os dados da depreciacao do bem\n */\n $this->salvarDepreciacao();\n\n $this->oPlaca->setCodigoBem($this->iCodigoBem);\n $this->oPlaca->salvar();\n\n /**\n * Salvamos o Historico do bem\n */\n $oHistoricoBem = new BemHistoricoMovimentacao();\n $oHistoricoBem->setData(date(\"Y-m-d\", db_getsession(\"DB_datausu\")));\n $oHistoricoBem->setDepartamento(db_getsession(\"DB_coddepto\"));\n $oHistoricoBem->setHistorico($sHistoricoBem);\n $oHistoricoBem->setCodigoSituacao($this->getSituacaoBem());\n $oHistoricoBem->salvar($this->iCodigoBem);\n\n $this->salvarDadosDivisao();\n $this->salvarDadosCedente();\n if ($this->getDadosImovel() instanceof BemDadosImovel) {\n\n $this->getDadosImovel()->setBem($this->iCodigoBem);\n $this->getDadosImovel()->salvar();\n }\n\n if ($this->getDadosCompra() instanceof BemDadosMaterial) {\n\n $this->getDadosCompra()->setBem($this->iCodigoBem);\n $this->getDadosCompra()->salvar();\n }\n\n if ($this->getTipoAquisicao() instanceof BemTipoAquisicao) {\n /**\n * Só executa se bem for uma inclusão manual ($lRealizouLancamento == false)\n */\n \tif ($lIncorporacaoBem == true && !$lRealizouLancamento && USE_PCASP && $lIntegracaoFinanceiro) {\n\n $oLancamentoauxiliarBem = new LancamentoAuxiliarBem();\n $oEventoContabil = new EventoContabil(700, db_getsession('DB_anousu'));\n $oLancamentoauxiliarBem->setValorTotal($this->getValorAquisicao());\n $oLancamentoauxiliarBem->setBem($this);\n $oLancamentoauxiliarBem->setObservacaoHistorico(\"{$this->getObservacao()} | Código do Bem: {$this->iCodigoBem}.\");\n\n $aLancamentos = $oEventoContabil->getEventoContabilLancamento();\n $oLancamentoauxiliarBem->setHistorico($aLancamentos[0]->getHistorico());\n $oEventoContabil->executaLancamento($oLancamentoauxiliarBem);\n \t}\n }\n }",
"public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EncontroComDeus WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }",
"public function eliminar($id) {\n $eliminarUsuario = new SqlQuery(); //creo instancia de la clase encargada de armar sentencias\n (string) $tabla = get_class($this); //adquiero el nombre de la clase para usar en la tabla\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienzo la transacción\n $this->refControladorPersistencia->ejecutarSentencia(\n $eliminarUsuario->eliminar($tabla, $id)); //Uso la funcion correspondiente de controlador pesistencia \n $this->refControladorPersistencia->get_conexion()->commit(); //ejecuto la acción para eliminar de forma lógica a los ususario\n } catch (PDOException $excepcionPDO) {//excepcion para controlar los errores\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n return [\"eliminado\"=>\"eliminado\"];\n }",
"function guardar($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$bebida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\n\t\t//COMPROBAR STOCK DE BEBIDA.\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new BebidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->bebida = $bebida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n\t\t$this->model->save();\n\t\t\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\t\t\n\t\t$bp = new BebidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->bebida = $bebida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}",
"public function delete(){\n $db = Database::getInstance() ;\n $db->query(\"DELETE FROM canciones WHERE idcancion=:idcan ;\",\n [\":idcan\"=>$this->idcancion]) ;\t\t\t\t \n }",
"public function destroy(Balita $balita)\n {\n dd($balita);\n }",
"function actualizarDeuda($acceso,$id_contrato){\n\treturn;\n\t/*\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"select sum(cant_serv * costo_cobro) as deuda from contrato_servicio_deuda where id_contrato='$id_contrato' and status_con_ser='DEUDA'\");\n\t\t\t\t\tif($fila=row($acceso)){\n\t\t\t\t\t\t$deuda = trim($fila['deuda']);\n\t\t\t\t\t\t//echo \"<br>Update contrato Set deuda='$deuda' Where id_contrato='$id_contrato'\";\n\t\t\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato Set deuda='$deuda' Where id_contrato='$id_contrato'\");\n\t\t\t\t\t}\n\t\t\t\t\t*/\n}",
"function EliminarConceptopago($id) {\n $sql = \"UPDATE `conceptopago` SET `estado` = 'INACTIVO' WHERE `id` = '$id'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n $num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($result) {\n\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Registro eliminado con éxito!\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"Ha ocurrido un error!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}",
"public function salvarDepreciacao() {\n\n $oDaoBensDepreciacao = new cl_bensdepreciacao();\n $oDaoBensDepreciacao->t44_benstipoaquisicao = $this->getTipoAquisicao()->getCodigo();\n $oDaoBensDepreciacao->t44_benstipodepreciacao = $this->getTipoDepreciacao()->getCodigo();\n $oDaoBensDepreciacao->t44_valoratual = \"{$this->getValorDepreciavel()}\";\n $oDaoBensDepreciacao->t44_valorresidual = \"{$this->getValorResidual()}\";\n $oDaoBensDepreciacao->t44_vidautil = \"{$this->getVidaUtil()}\";\n\n if (!empty($this->iCodigoBemDepreciacao)) {\n\n $oDaoBensDepreciacao->t44_sequencial = $this->iCodigoBemDepreciacao;\n $oDaoBensDepreciacao->alterar($this->iCodigoBemDepreciacao);\n\n } else {\n\n $oDaoBensDepreciacao->t44_ultimaavaliacao = date(\"Y-m-d\", db_getsession(\"DB_datausu\"));\n $oDaoBensDepreciacao->t44_bens = $this->iCodigoBem;\n $oDaoBensDepreciacao->incluir(null);\n $this->iCodigoBemDepreciacao = $oDaoBensDepreciacao->t44_sequencial;\n }\n\n if ($oDaoBensDepreciacao->erro_status == \"0\") {\n $sMsg = _M('patrimonial.patrimonio.Bem.erro_salvar_calculo', (object)array(\"erro_msg\" => $oDaoBensDepreciacao->erro_msg));\n throw new Exception($sMsg);\n }\n return true;\n }",
"public function removeNlAbo()\n\t{\n\t\t$t=array('email'=>$_POST['email']);\n\t\t$req= self::$bdd->prepare('DELETE FROM `AbonnementNlGW` WHERE email= (:email);');\n\t\t$req->execute($t);\n\t}",
"function listarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_sel';\n\t\t$this->transaccion='TES_CTABAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha_baja','date');\n\t\t$this->captura('nro_cuenta','varchar');\n\t\t$this->captura('fecha_alta','date');\n\t\t$this->captura('id_institucion','int4');\n\t\t$this->captura('nombre_institucion','varchar');\n\t\t$this->captura('doc_id','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_moneda','integer');\n\t\t$this->captura('codigo_moneda','varchar');\n\t\t$this->captura('denominacion','varchar');\n\t\t$this->captura('centro','varchar');\n\t\t\n\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public static function reject(){\n if(ModelBenevole::isOrga($_SESSION['login'], $_GET['IDFestival'])){\n ModelBenevole::reject($_GET['IDBenevole'], $_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'demandesorga';\n $pagetitle = 'Liste des demandes Organisateur';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }",
"function insertarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t$this->setParametro('id_depto_lb','id_depto_lb','int4');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\t\t\n\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function borrar(){\n\t\t\n\t\t$this->mysqli = conectarBD();\n\t\t\n\t\t$sql = \"UPDATE Linea_Factura SET Borrado='1' WHERE Id_Linea_Factura='\".$this->linea.\"';\";\n\t\t$this->mysqli->query($sql);\n\t\t$sql = \"SELECT Importe FROM Linea_Factura WHERE Id_Linea_Factura='\".$this->linea.\"';\";\n\t\t$resultado = $this->mysqli->query($sql);\n\t\t$row = $resultado->fetch_array();\n\t\t$sql = \"UPDATE Factura SET Total=Total-(\".$row['Importe'].\") WHERE Id_Factura='\".$this->factura.\"';\";\n\t\t$this->mysqli->query($sql);\n\t\t\n\t\treturn \"borrado exito\";\n\t}",
"public function destroy( $value)\n {\n\n\n try {\n\n DB::beginTransaction();\n $classe = Classe::find($value);\n\n\n foreach ($classe->eleves as $eleve) {\n $eleve->delete();\n }\n\n\n $classe->delete();\n\n DB::commit();\n\n\n\n } catch (\\Exception $e) {\n\n DB::rollback();\n Session::flash('error' , 'Erreur la suppression echoué');\n\n }\n\n\n return $this->index();\n}",
"public function desactivar($idtarifas){\n\n $sql=\" UPDATE tarifas SET estado='0' WHERE idtarifas='$idtarifas' \";\n return ejecutarConsulta($sql);\n\n\n }",
"public function destroy(berita $berita)\n {\n //\n }",
"function Clean() // libera la consulta\n {mysql_free_result($this->consulta);}",
"function deleteFee()\n {\n global $db;\n $requete = $db->prepare('DELETE FROM fees WHERE idF = ?');\n $requete->execute(array($this->idF));\n }",
"function modificarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('banco','banco','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t\t$sql=\"UPDATE motivo_movimiento SET status='0' WHERE id_motivo_mov='$this->id_motivo'\";\n\t\t\t$this->ejecuta($sql);\n\t\t//}\n\t}",
"public function desactivar()\n {\n $this->estatus = 0;\n $this->save();\n }",
"public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }",
"public function getBanco($verificacao = false);",
"public function clean(){\n\t\t$sql = 'DELETE FROM compra_coletiva';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function clean(){\n\t\t$sql = 'DELETE FROM negociacao_contas';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function eliminarVentas($id_unico){\n //echo($id_unico);\n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date(\"y-m-d H:i:s\");\n $datos['vent_prof_cab_usr_baja'] = $_SESSION['login'];\n $datos['vent_prof_cab_fech_hr_baja'] = $fecha_actual;\n $condicion = \"vent_prof_cab_cod_unico='\".$id_unico.\"'\";\n return $this->mysql->update('vent_prof_cab', $datos, $condicion);\n //$this->mysql->update('vent_prof_cab',$datos,'vent_prof_cab_cod_unico='.$id_unico.'');\n }",
"function refuserRecette($_idRecette){\n // Supprimer la recette de la table Moderations\n $connexion = my_connect();\n $requette_recettes = \"DELETE FROM Moderations where Idmoderation = $_idRecette\";\n $table_recettes_resultat = mysqli_query($connexion,$requette_recettes); \n if(!$table_recettes_resultat){ \n echo \"<p>Erreur dans l'exécution de la requette</p>\";\n echo \"message de mysqli:\".mysqli_error($connexion); \n echo $requette_recettes;\n }\n // Supression de la recette de la table recette\n supprimerRecette($_idRecette);\n mysqli_close($connexion);\n}",
"public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}",
"public function bloquear($id)\n {\n $unidad = Propiedad::find($id);\n $unidad->editable = 0;\n $unidad->save();\n return redirect('unidad/'.$unidad->id_des.'/edit');\n\n\n }",
"public function delete($codigo='') {\n\t\t$this->parametros = array($codigo);\n $this->sp = \"str_consultaBanco_del\";\n $this->executeSPAccion();\n if($this->filasAfectadas>0){\n $this->mensaje=\"Banco eliminado exitosamente\";\n }else{\n $this->mensaje=\"No se ha eliminado el Banco\";\n }\n }",
"function EliminarFormapago($id) {\n $sql = \"UPDATE `formapago` SET `estado` = 'INACTIVO' WHERE `id` = '$id'\";\n\n\t$db = new conexion();\n\t$result = $db->consulta($sql);\n $num = $db->encontradas($result);\n\n\t$respuesta->datos = [];\n\t$respuesta->mensaje = \"\";\n\t$respuesta->codigo = \"\";\n\n\tif ($result) {\n\n\t\tfor ($i=0; $i < $num; $i++) {\n\t\t\t$respuesta->datos[] = mysql_fetch_array($result);\n\t\t}\n\n\t\t$respuesta->mensaje = \"Registro eliminado con éxito!\";\n\t\t$respuesta->codigo = 1;\n\t} else {\n\t\t$respuesta->mensaje = \"Ha ocurrido un error!\";\n\t\t$respuesta->codigo = 0;\n\t}\n\n\treturn json_encode($respuesta);\n}",
"public function destroy(Bien $bien)\n {\n //\n }",
"function Del_Mess_Blacklist($name)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $nick = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n \n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n \n //Del\n //\t$cbox_url.'&sec=delban&n='.$Bot_Name.'&k='.$Bot_Key.'&del='.$id_user.'<br>';\n //\t_Get($cbox_url.'&sec=delban&n='.$Bot_Name.'&k='.$Bot_Key.'&del='.$id_user);\n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n}",
"public static function poblarBD($em){\n\t\t$com1 = new Competicion();\n\t\t$com1->setNombre(\"Competición 1\")\n\t\t->setTemp(2014)\n\t\t->setFecha(new \\DateTime(\"2015/08/22\"))\n\t\t->setEsVisible(true);\n\t\t$em->persist($com1);\n\t\t\n\t\t$com2 = new Competicion();\n\t\t$com2->setNombre(\"Competición 2\")\n\t\t->setTemp(2015)\n\t\t->setFecha(new \\DateTime(\"2015/11/07\"));\n\t\t$em->persist($com2);\n\t\t\n\t\t$com3 = new Competicion();\n\t\t$com3->setNombre(\"Competición 3\")\n\t\t->setTemp(2015)\n\t\t->setFecha(new \\DateTime(\"2015/12/12\"))\n\t\t->setEsVisible(true)\n\t\t->setEsFeder(true)\n\t\t->setEsOficial(true);\n\t\t$em->persist($com3);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"100 metros lisos\")\n\t\t->setUnidades(\"segundos\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Campo a través\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Campo a través\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"Salto de altura\")\n\t\t->setUnidades(\"metros\")\n\t\t->setNumInt(\"3\");\n\t\t$em->persist($tprf);\n\t\t\n\t\t$tprm3 = new TipoPruebaModalidad();\n\t\t$tprm3->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Cubierto\");\n\t\t$em->persist($tprm3);\n\t\t\n\t\t$tprm4 = new TipoPruebaModalidad();\n\t\t$tprm4->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Cubierto\");\n\t\t$em->persist($tprm4);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"Maratón\")\n\t\t->setUnidades(\"segundos\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"Prueba por puntos\")\n\t\t->setUnidades(\"puntosdesc\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(2)\n\t\t->setEntorno(\"Cubierto\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"200 metros lisos\")\n\t\t->setUnidades(\"segundos\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm1 = new TipoPruebaModalidad();\n\t\t$tprm1->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Aire libre\");\n\t\t$em->persist($tprm1);\n\t\t\n\t\t$tprm2 = new TipoPruebaModalidad();\n\t\t$tprm2->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Aire libre\");\n\t\t$em->persist($tprm2);\n\t\t$em->flush();\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Prebenjamín\")\n\t\t->setEdadMax(7)\n\t\t->setTIniVal(2012)\n\t\t->setTFinVal(2014);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Prebenjamín\")\n\t\t->setEdadMax(6)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Benjamín\")\n\t\t->setEdadMax(8)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Alevín\")\n\t\t->setEdadMax(10)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Infantil\")\n\t\t->setEdadMax(12)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Cadete\")\n\t\t->setEdadMax(14)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Juvenil\")\n\t\t->setEdadMax(16)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat1 = new Categoria();\n\t\t$cat1->setNombre(\"Junior\")\n\t\t->setEdadMax(18)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat1);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Promesa\")\n\t\t->setEdadMax(21)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Senior\")\n\t\t->setEdadMax(34)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Veteranos\")\n\t\t->setEdadMax(null)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t$em->flush();\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(1)\n\t\t->setSidCom($com1)\n\t\t->setCoste(\"4.95\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm1);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final A\");\n\t\t$em->persist($ron);\n\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final C\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(4)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final D\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(5)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(6)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(7)\n\t\t->setSidPru($pru)\n\t\t->setNum(3)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(2)\n\t\t->setSidCom($com1)\n\t\t->setCoste(\"3.95\")\n\t\t->setIdCat($cat1)\n\t\t->setSidTprm($tprm2);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(1)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm1);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(2)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm2);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(3)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm3);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(4)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm4);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron1 = new Ronda();\n\t\t$ron1->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron1);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$atl1 = new Atleta();\n\t\t$atl1->setNombre(\"Nombre1\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1990/07/22\"))\n\t\t->setNick(\"Nick1\")\n\t\t->setDni(\"12345678A\")\n\t\t->setLfga(\"AG-1234567\")\n\t\t->setLxogade(\"ABC123456\");\n\t\t$em->persist($atl1);\n\t\t\n\t\t$ins = new Inscripcion();\n\t\t$ins->setIdAtl($atl1)\n\t\t->setSidPru($pru)\n\t\t->setFecha(new \\DateTime)\n\t\t->setOrigen(\"test\")\n\t\t->setCoste(1.00)\n\t\t->setEstado(\"Pendiente\");\n\t\t$em->persist($ins);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre2\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1988/07/22\"))\n\t\t->setNick(\"Nick2\")\n\t\t->setDni(\"12345689B\")\n\t\t->setLfga(\"AG-1234568\")\n\t\t->setLxogade(\"ABC123457\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$ins = new Inscripcion();\n\t\t$ins->setIdAtl($atl)\n\t\t->setSidPru($pru)\n\t\t->setFecha(new \\DateTime)\n\t\t->setOrigen(\"test\")\n\t\t->setCoste(1.20)\n\t\t->setEstado(\"Pagado\")\n\t\t->setFechaPago(new \\DateTime());\n\t\t$em->persist($ins);\n\t\t\n\t\t$ins = new Inscripcion();\n\t\t$ins->setIdAtl($atl)\n\t\t->setSidPru($pru)\n\t\t->setFecha(new \\DateTime)\n\t\t->setOrigen(\"test\")\n\t\t->setCoste(4.00)\n\t\t->setEstado(\"Pagado\")\n\t\t->setFechaPago(new \\DateTime());\n\t\t$em->persist($ins);\n\t\t\n\t\t$par = new Participacion();\n\t\t$par->setIdAtl($atl)\n\t\t->setSidCom($pru->getSidCom())\n\t\t->setDorsal(1234)\n\t\t->setAsisten(true);\n\t\t$em->persist($par);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre3\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(true)\n\t\t->setFnac(new \\DateTime(\"1972/07/22\"))\n\t\t->setNick(\"Nick3\")\n\t\t->setDni(\"12345698C\")\n\t\t->setLfga(\"AG-1234569\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre4\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1994/07/22\"))\n\t\t->setNick(\"Nick4\")\n\t\t->setDni(\"12342424C\")\n\t\t->setLfga(\"AG-1233426\")\n\t\t->setLxogade(\"ABC123454\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre5\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(true)\n\t\t->setFnac(new \\DateTime(\"1996/07/22\"))\n\t\t->setNick(\"Nick5\")\n\t\t->setDni(\"12345600G\")\n\t\t->setLfga(\"AG-1764567\")\n\t\t->setLxogade(\"ABC124556\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl6 = new Atleta();\n\t\t$atl6->setNombre(\"Nombre6\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1976/12/01\"))\n\t\t->setNick(\"Nick6\")\n\t\t->setDni(\"52345675A\")\n\t\t->setLfga(\"AG-4234567\");\n\t\t$em->persist($atl6);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre7\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(true)\n\t\t->setFnac(new \\DateTime(\"2006/07/22\"))\n\t\t->setDni(\"92345678A\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre8\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"2012/07/22\"))\n\t\t->setDni(\"99999999Z\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl9 = new Atleta();\n\t\t$atl9->setNombre(\"Nombre9\")\n\t\t->setApellidos(\"Otros Apellidos\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1981/04/18\"))\n\t\t->setDni(\"63526420F\");\n\t\t$em->persist($atl9);\n\t\t\n\t\t$int = new Intento();\n\t\t$int->setIdAtl($atl1)\n\t\t->setSidRon($ron1)\n\t\t->setNum(1)\n\t\t->setValidez(false)\n\t\t->setOrigen(\"test\")\n\t\t->setMarca(3.40);\n\t\t$em->persist($int);\n\t\t\n\t\t$int = new Intento();\n\t\t$int->setIdAtl($atl1)\n\t\t->setSidRon($ron1)\n\t\t->setNum(2)\n\t\t->setValidez(true)\n\t\t->setOrigen(\"test\")\n\t\t->setMarca(3.40);\n\t\t$em->persist($int);\n\t\t\n\t\t$usu = new Usuario();\n\t\t$usu->setNombre(\"usuario6\")\n\t\t->setContra('$2a$04$H5G9G/lmx5QLL/Zm3fOyTu92bPmI4/RKnyZrWH48EXJRcA6qXh1yO')\n\t\t->setRol(\"socio\")\n\t\t->setIdAtl($atl6);\n\t\t$em->persist($usu);\n\t\t\n\t\t$usu = new Usuario();\n\t\t$usu->setNombre(\"user\")\n\t\t->setContra('$2a$04$WT1Ed.63TVkKNpPMQZivquS6e4NJlTTo9HRxbrYPYnCV/NqeVlQDa')\n\t\t->setRol(\"socio\")\n\t\t->setIdAtl(null);\n\t\t$em->persist($usu);\n\t\t\n\t\t$usu = new Usuario();\n\t\t$usu->setNombre(\"coordinador\")\n\t\t->setContra('$2a$04$2d5OXU3foU3HgpC70sLNjeubFQ6jy.OTsAjWl.UkdmHrN8VArbs2S')\n\t\t->setRol(\"coordinador\")\n\t\t->setIdAtl($atl9);\n\t\t$em->persist($usu);\n\t\t\n\t\t$em->flush();\n\t}",
"public function banUser(){\n if($this->adminVerify()){\n\n }else{\n echo \"Vous devez avoir les droits administrateur pour accéder à cette page\";\n }\n }",
"function cinotif_desabonner_auteur($objet, $id_objet='') {\n\t$return = '';\n\t$id_auteur = cinotif_id_auteur();\n\t$id_abonne = cinotif_id_abonne($id_auteur, '');\n\t\n\tif ($objet AND $id_abonne){\n\t\tif ($objet=='site') {\n\t\t\t$where = \"id_abonne=\".$id_abonne;\n\t\t} else {\n\t\t\t$tableau_id_evenement = cinotif_ids_evenement($objet, $id_objet);\t\t\t\t\n\t\t\t$in = sql_in('id_evenement',$tableau_id_evenement);\n\t\t\t$where = \"id_abonne=\".$id_abonne.\" AND \".$in;\n\t\t}\n\t\t\n\t\t$return = sql_delete(\"spip_cinotif_abonnements\", $where);\n\t\tcinotif_suppr_evenements_sans_abonnement();\t\t\n\t\tcinotif_suppr_abonnes_sans_abonnement();\n\t}\n\n\treturn $return;\n}",
"public function deleting(Seguimiento $Seguimiento){\n \n }",
"public function eliminarItemsVentas($id_unico){\n //echo($id_unico.\"---\");\n \n date_default_timezone_set('America/La_Paz');\n $fecha_actual = date(\"y-m-d H:i:s\");\n $datos['vent_prof_det_usr_baja'] = $_SESSION['login'];\n $datos['vent_prof_det_fech_hr_baja'] = $fecha_actual;\n $condicion = \"vent_prof_det_cod_unico='\".$id_unico.\"'\";\n return $this->mysql->update('vent_prof_det', $datos, $condicion);\n //$this->mysql->update('vent_prof_cab',$datos,'vent_prof_cab_cod_unico='.$id_unico.'');\n }",
"function fProcesaBanco(){\n global $db, $cla, $agPar, $igNumChq, $igSecue, $ogDet;\n $alDet = fIniDetalle();\n $alDet[\"det_codcuenta\"]\t= $cla->cla_ctaorigen; \n $alDet[\"det_glosa\"] \t= substr($agPar[\"com_Concepto\"],0, 50) . ' ' . substr($agPar[\"slBenef\"],0,20);\n $alDet['det_idauxiliar']= $agPar[\"com_Emisor\"];\n $alDet[\"det_numcheque\"]\t= $igNumChq;\t\t\t// es el numero de cheque\n $alDet[\"det_feccheque\"]\t= $agPar[\"com_FechCheq\"];\n $alDet['det_valdebito']\t= $agPar[\"flValor\"] * $cla->cla_indicador; // segun el signo del indicador, se aplica como DB/CR al grabar;\n $alDet['det_valcredito']\t= 0;\n $alDet['det_secuencia']\t= $igSecue;\n\tif(fGetParam(\"pAppDbg\",0)){\n\t\tprint_r($alDet);\n\t}\n\tfInsdetalleCont($db, $alDet);\n}",
"public function EliminarSalas()\n{\n\n\t$sql = \" select codsala from mesas where codsala = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codsala\"])) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\n\t\t$sql = \" delete from salas where codsala = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codsala);\n\t\t$codsala = base64_decode($_GET[\"codsala\"]);\n\t\t$stmt->execute();\n\n\t\theader(\"Location: salas?mesage=1\");\n\t\texit;\n\n\t}else {\n\n\t\theader(\"Location: salas?mesage=2\");\n\t\texit;\n\t}\n\n}",
"function deleteComentario($id_evento,$id_comentario){\n $mysqli = Conectar();\n seguridad($id_evento);\n seguridad($id_comentario);\n $mysqli->query(\"Delete From comentarios Where id_evento='$id_evento' and id_comentario='$id_comentario'\");\n }",
"public function Departamento()\n\t{\n\t\t$this->cn = new datos();\n\t\t$this->log = new Log();\n\t}",
"public function deleteContracteById($remove){\n $sql = \"DELETE FROM contract WHERE id = :id \";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':id', $remove);\n $result =$stmt->execute();\n if ($result) {\n $msg = '<div class=\"alert alert-success alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n <strong>Success !</strong> Contract șters cu succes!</div>';\n return $msg;\n }else{\n $msg = '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n <strong>Error !</strong> Contract nu a fost șters!</div>';\n return $msg;\n }\n }",
"function Del_Mess_One($name, $command)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $nick = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n \n if (count(explode($command, $mess)) > 1) {\n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n \n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n }\n}",
"function deleteUser(){\n $bdd = bdd();\n $bdd->prepare(\"DELETE from postSujet where propri=?\")->execute(array($_GET['del']));\n $bdd->prepare(\"DELETE from membres where id=?\")->execute(array($_GET['del']));\n}",
"function setDelete(){\n\t\t$msg\t= \"===========\\tELIMINADO LA CUENTA \" . $this->mNumeroCuenta . \"\\r\\n\";\n\t\t$cuenta\t= $this->mNumeroCuenta;\n\t\t$socio\t= $this->mSocioTitular;\n\t\t$xQL\t= new MQL();\n\t\t\t//Cuenta\n\t\t\t$SQLDCuenta \t= \"DELETE FROM captacion_cuentas WHERE numero_cuenta = $cuenta AND numero_socio = $socio \";\n\t\t\t$x = $xQL->setRawQuery($SQLDCuenta);\n\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t Eliminando la Cuenta (\" . $x[\"info\"] . \")\\r\\n\";\n\t\t\t}\n\t\t\t//Firma\n\t\t\t/*$SQLDFirma \t= \"DELETE FROM socios_firmas WHERE numero_de_cuenta = $cuenta \";\n\t\t\t$x = my_query($SQLDFirma);\n\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\tEliminando las Firmas (\" . $x[\"info\"] . \")\\r\\n\";\n\t\t\t}*/\n\t\t\t//sdpm\n\t\t\t$SQLD_SDPM \t= \"DELETE FROM captacion_sdpm_historico WHERE cuenta = $cuenta \";\n\t\t\t$x = $xQL->setRawQuery($SQLD_SDPM);\n\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t\" . $x[\"info\"] . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t//Movimientos\n\t\t\t$SQLDOpes\t= \"DELETE FROM operaciones_mvtos WHERE docto_afectado = $cuenta AND socio_afectado = $socio \";\n\t\t\t$x = $xQL->setRawQuery($SQLDOpes);\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t\" . $x[\"info\"] . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t$SQLDRecs\t= \"DELETE FROM operaciones_recibos WHERE docto_afectado = $cuenta AND numero_socio = $socio \";\n\t\t\t$x = $xQL->setRawQuery($SQLDRecs);\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t\" . $x[\"info\"] . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t//Actualizar el Credito Relacionado\n\t\t\t$SQLDCC\t= \"UPDATE creditos_solicitud\n\t\t\t\t\t\tSET contrato_corriente_relacionado = \" . CTA_GLOBAL_CORRIENTE . \"\n\t\t\t\t\t\tWHERE contrato_corriente_relacionado = $cuenta \";\n\t\t\t$x = $xQL->setRawQuery($SQLDCC);\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\tActualizando Creditos Relacionados (\" . $x[\"info\"] . \") \\r\\n\";\n\t\t\t}\n\t\treturn $msg;\n\t}",
"public function refund();"
] | [
"0.63552624",
"0.6182193",
"0.58573073",
"0.5840649",
"0.5691658",
"0.56800926",
"0.564429",
"0.5629344",
"0.5610765",
"0.56046474",
"0.5568557",
"0.5560936",
"0.55305785",
"0.5508061",
"0.55003405",
"0.54827464",
"0.548048",
"0.54795855",
"0.547954",
"0.5473122",
"0.546775",
"0.54650885",
"0.5458415",
"0.54580826",
"0.54337305",
"0.54328084",
"0.54315764",
"0.54301256",
"0.5426869",
"0.54251415",
"0.5415584",
"0.5414366",
"0.5414128",
"0.54061824",
"0.53890747",
"0.53875023",
"0.53826314",
"0.5382615",
"0.53687906",
"0.53628427",
"0.5354827",
"0.5353774",
"0.53521436",
"0.53323644",
"0.53322995",
"0.5330763",
"0.5325939",
"0.53171194",
"0.5316833",
"0.53137755",
"0.5309449",
"0.5302312",
"0.5301511",
"0.5300031",
"0.5294923",
"0.52931106",
"0.5286284",
"0.5282925",
"0.5280786",
"0.5280376",
"0.52796",
"0.5279322",
"0.52699965",
"0.525823",
"0.52574676",
"0.5253509",
"0.52516085",
"0.52445775",
"0.5239039",
"0.5234339",
"0.52331185",
"0.5230608",
"0.5228855",
"0.52284896",
"0.5226224",
"0.5225163",
"0.5220855",
"0.52191776",
"0.5218545",
"0.5218424",
"0.5217721",
"0.5217377",
"0.52168256",
"0.52141327",
"0.52123463",
"0.5212291",
"0.52111226",
"0.5208283",
"0.52052766",
"0.5194846",
"0.519195",
"0.5190487",
"0.5182657",
"0.51766515",
"0.5174626",
"0.5174432",
"0.516935",
"0.516625",
"0.51630723",
"0.51604605"
] | 0.56335914 | 7 |
Ativa um passageiro no banco | public function Ativar(){
$idFrota = $_GET['id'];
$frota = new Frota();
$frota->id = $idFrota ;
$frota::Ativando($frota);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pasaje_abonado();",
"function evt__enviar(){\n if($this->dep('datos')->tabla('mesa')->esta_cargada()){\n $m = $this->dep('datos')->tabla('mesa')->get();\n // print_r($m);\n $m['estado'] = 2;//Cambia el estado de la mesa a Enviado\n $this->dep('datos')->tabla('mesa')->set($m);\n // print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n // $this->dep('datos')->tabla('mesa')->resetear();\n \n $m = $this->dep('datos')->tabla('mesa')->get_listado($m['id_mesa']);\n if($m[0]['estado'] == 2){//Obtengo de la BD y verifico que hizo cambios en la BD\n //Se enviaron correctamente los datos\n toba::notificacion()->agregar(utf8_decode(\"Los datos fueron enviados con éxito\"),\"info\");\n }\n else{\n //Se generó algún error al guardar en la BD\n toba::notificacion()->agregar(utf8_decode(\"Error al enviar la información, verifique su conexión a internet\"),\"info\");\n }\n }\n \n }",
"function insertarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\n\n\t\t$this->setParametro('banco','banco','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\n\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function salvar() {\n\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.sem_transacao'));\n }\n\n /**\n * Realizamos algumas validações básicas\n */\n if ($this->oPlaca == null || !$this->oPlaca instanceof PlacaBem) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.placa_nao_definida'));\n }\n if (!$this->getFornecedor() instanceof CgmBase) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.informe_fornecedor'));\n }\n if (!$this->getClassificacao() instanceof BemClassificacao) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.informe_classificacao'));\n }\n /**\n * Dados da tabela bens\n */\n $oDaoBens = new cl_bens();\n $oDaoBens->t52_bensmarca = \"{$this->getMarca()}\";\n $oDaoBens->t52_bensmedida = \"{$this->getMedida()}\";\n $oDaoBens->t52_bensmodelo = \"{$this->getModelo()}\";\n $oDaoBens->t52_codcla = $this->getClassificacao()->getCodigo();\n $oDaoBens->t52_depart = $this->getDepartamento();\n $oDaoBens->t52_descr = $this->getDescricao();\n $oDaoBens->t52_dtaqu = $this->getDataAquisicao();\n $oDaoBens->t52_instit = $this->getInstituicao();\n $oDaoBens->t52_numcgm = $this->getFornecedor()->getCodigo();\n $oDaoBens->t52_obs = $this->getObservacao();\n $oDaoBens->t52_valaqu = \"{$this->getValorAquisicao()}\";\n\n /**\n * Inclusao - busca placa\n */\n if (empty($this->iCodigoBem)) {\n $oDaoBens->t52_ident = $this->getPlaca()->getNumeroPlaca();\n }\n\n $lIncorporacaoBem = false;\n if (!empty($this->iCodigoBem)) {\n\n $oDaoBens->t52_bem = $this->iCodigoBem;\n $oDaoBens->alterar($this->iCodigoBem);\n $sHistoricoBem = 'Alteração de dados do Bem';\n } else {\n\n $sHistoricoBem = 'Inclusão do Bem';\n $oDaoBens->incluir(null);\n $this->iCodigoBem = $oDaoBens->t52_bem;\n $lIncorporacaoBem = true;\n }\n\n if ($oDaoBens->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.erro_salvar', (object)array(\"erro_msg\" => $oDaoBens->erro_msg)));\n }\n\n $lRealizarEscrituracao = $this->criaVinculoBemNotas();\n\n $oDataAtual = new DBDate(date('Y-m-d', db_getsession(\"DB_datausu\")));\n $oInstit = new Instituicao(db_getsession(\"DB_instit\"));\n $lIntegracaoFinanceiro = ParametroIntegracaoPatrimonial::possuiIntegracaoPatrimonio($oDataAtual, $oInstit);\n\n $lRealizouLancamento = false;\n if ($lRealizarEscrituracao && $lIntegracaoFinanceiro && $lIncorporacaoBem) {\n $lRealizouLancamento = $this->processaLancamentoContabil();\n }\n\n /**\n * Salva os dados da depreciacao do bem\n */\n $this->salvarDepreciacao();\n\n $this->oPlaca->setCodigoBem($this->iCodigoBem);\n $this->oPlaca->salvar();\n\n /**\n * Salvamos o Historico do bem\n */\n $oHistoricoBem = new BemHistoricoMovimentacao();\n $oHistoricoBem->setData(date(\"Y-m-d\", db_getsession(\"DB_datausu\")));\n $oHistoricoBem->setDepartamento(db_getsession(\"DB_coddepto\"));\n $oHistoricoBem->setHistorico($sHistoricoBem);\n $oHistoricoBem->setCodigoSituacao($this->getSituacaoBem());\n $oHistoricoBem->salvar($this->iCodigoBem);\n\n $this->salvarDadosDivisao();\n $this->salvarDadosCedente();\n if ($this->getDadosImovel() instanceof BemDadosImovel) {\n\n $this->getDadosImovel()->setBem($this->iCodigoBem);\n $this->getDadosImovel()->salvar();\n }\n\n if ($this->getDadosCompra() instanceof BemDadosMaterial) {\n\n $this->getDadosCompra()->setBem($this->iCodigoBem);\n $this->getDadosCompra()->salvar();\n }\n\n if ($this->getTipoAquisicao() instanceof BemTipoAquisicao) {\n /**\n * Só executa se bem for uma inclusão manual ($lRealizouLancamento == false)\n */\n \tif ($lIncorporacaoBem == true && !$lRealizouLancamento && USE_PCASP && $lIntegracaoFinanceiro) {\n\n $oLancamentoauxiliarBem = new LancamentoAuxiliarBem();\n $oEventoContabil = new EventoContabil(700, db_getsession('DB_anousu'));\n $oLancamentoauxiliarBem->setValorTotal($this->getValorAquisicao());\n $oLancamentoauxiliarBem->setBem($this);\n $oLancamentoauxiliarBem->setObservacaoHistorico(\"{$this->getObservacao()} | Código do Bem: {$this->iCodigoBem}.\");\n\n $aLancamentos = $oEventoContabil->getEventoContabilLancamento();\n $oLancamentoauxiliarBem->setHistorico($aLancamentos[0]->getHistorico());\n $oEventoContabil->executaLancamento($oLancamentoauxiliarBem);\n \t}\n }\n }",
"public function reativar($sObservacao = null) {\n\n if (empty($this->iCodigoBem)) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_existe_base_de_dados'));\n }\n if (!db_utils::inTransaction()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.sem_transacao'));\n }\n\n if (!$this->isBaixado()) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.bem_nao_esta_baixado'));\n }\n $oDaoBensBaixa = new cl_bensbaix();\n $oDaoBensBaixa->excluir($this->getCodigoBem());\n if ($oDaoBensBaixa->erro_status == 0) {\n throw new Exception(_M('patrimonial.patrimonio.Bem.erro_reativar_bem', (object)array(\"erro_msg\" => $oDaoBensBaixa->erro_msg)));\n }\n\n $oDataAtual = new DBDate(date('Y-m-d', db_getsession(\"DB_datausu\")));\n $oInstit = new Instituicao(db_getsession(\"DB_instit\"));\n $lIntegracaoFinanceiro = ParametroIntegracaoPatrimonial::possuiIntegracaoPatrimonio($oDataAtual, $oInstit);\n\n $aNotas = $this->getNotasFiscais();\n\n $lRealizouLancamento = false;\n foreach ($aNotas as $oNota) {\n\n /**\n * realiza lancamentos contabens do bem\n * caso o desdobramento da nota do bem esteja no grupo 9 (bem permante)\n */\n if (!empty($oNota) && $this->verificaSituacaoNota() && $oNota->getValorLiquidado() == 0) {\n\n $oGrupo = GrupoContaOrcamento::getGrupoConta($oNota->getDesdobramento(), db_getsession(\"DB_anousu\"));\n if (!empty($oGrupo) && $oGrupo->getCodigo() == 9) {\n\n $sObs = \"Estorno do Lançamento em liquidação do tombamento do bem {$this->getCodigoBem()}.\";\n\n if ($lIntegracaoFinanceiro) {\n\n $nValor = $this->getValorAquisicao();\n if (count($aNotas) > 1) {\n $nValor = $this->getValorItemNota($oNota->getCodigoNota());\n }\n\n $oProcessarLancamento = new stdClass();\n $oProcessarLancamento->iCodigoDotacao = $oNota->getEmpenho()->getDotacao()->getCodigo();\n $oProcessarLancamento->iCodigoElemento = $oNota->getDesdobramento();\n $oProcessarLancamento->iCodigoNotaLiquidacao = $oNota->getCodigoNota();\n $oProcessarLancamento->iFavorecido = $oNota->getEmpenho()->getCgm()->getCodigo();\n $oProcessarLancamento->iNumeroEmpenho = $oNota->getEmpenho()->getNumero();\n $oProcessarLancamento->sObservacaoHistorico = $sObs;\n $oProcessarLancamento->nValorTotal = $nValor;\n $oProcessarLancamento->oClassificacao = $this->getClassificacao();\n $oProcessarLancamento->oGrupo = $oGrupo;\n\n LancamentoEmpenhoEmLiquidacao::processar($oProcessarLancamento);\n $lRealizouLancamento = true;\n }\n }\n }\n }\n\n if (USE_PCASP && !$lRealizouLancamento && $lIntegracaoFinanceiro ) {\n\n /**\n * Realiza acerto nas contas de depreciação e classificação, caso seja necessário\n */\n $oBemAcertoContaClassificacao = new BemAcertoContaClassificacao();\n $oDBData = new DBDate( date(\"d/m/Y\", db_getsession(\"DB_datausu\")) );\n\n $oBemDepreciacao = BemDepreciacao::getInstance($this);\n $nValorAtual = $this->nValorAquisicao;\n\n if (!empty($oBemDepreciacao)) {\n $nValorAtual = $oBemDepreciacao->getValorAtual();\n }\n\n if ($nValorAtual != 0) {\n $oLancamentoauxiliarBem = new LancamentoAuxiliarBem();\n $oLancamentoauxiliarBem->setValorTotal($nValorAtual);\n $oLancamentoauxiliarBem->setBem($this);\n $oLancamentoauxiliarBem->setObservacaoHistorico($sObservacao);\n $oLancamentoauxiliarBem->setEstorno(true);\n $oEventoContabil = new EventoContabil(702, db_getsession('DB_anousu'));\n $aLancamentos = $oEventoContabil->getEventoContabilLancamento();\n $oLancamentoauxiliarBem->setHistorico($aLancamentos[0]->getHistorico());\n $oEventoContabil->executaLancamento($oLancamentoauxiliarBem);\n }\n }\n }",
"public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\n }",
"function asignarAction() {\n\t\t\tif (BLOQUEAR == 1){\n\t\t\t\t$this->render('appBloqueada');\n\t\t\t} else if ($this->security(true) && $_SESSION['user']->rol>=50) {\n\t\t\t\t$error = '';\n\t\t\t\tif (isset($_POST['asignar'])){\n\t\t\t\t\tif(isset($_POST['campus']) && isset($_POST['edificio']) && isset($_POST['planta']) && isset($_POST['zona']) && isset($_POST['tipo']) && isset($_POST['user_id'])) {\n\t\t\t\t\t\t$busqueda = array('user_id' => $_POST['user_id'], 'estado' => 2);\n\t\t\t\t\t\t$taqDisponibles = Taquilla::findByAttributes($busqueda);\n\t\t\t\t\t\t//No hay reserva\n\t\t\t\t\t\tif(count($taqDisponibles) == 0) {\n\t\t\t\t\t\t\t$edificio = explode(' ', $_POST['edificio']);\n\t\t\t\t\t\t\t$busqueda = array(\n\t\t\t\t\t\t\t\t'campus' => $_POST['campus'],\n\t\t\t\t\t\t\t\t'edificio' => $edificio[0],\n\t\t\t\t\t\t\t\t'planta' => $_POST['planta'],\n\t\t\t\t\t\t\t\t'zona' => \"'\".$_POST['zona'].\"'\",\n\t\t\t\t\t\t\t\t'tipo' => \"'\".$_POST['tipo'].\"'\",\n\t\t\t\t\t\t\t\t'estado' => 1,\n\t\t\t\t\t\t\t\t'user_id' => NULL,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (!empty($_POST['num_taquilla'])){\n\t\t\t\t\t\t\t\t$busqueda['num_taquilla'] = $_POST['num_taquilla'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$taqDisponibles = Taquilla::findByAttributes($busqueda);\n\t\t\t\t\t\t\t//Encuentra taquillas libres\n\t\t\t\t\t\t\tif (!empty($taqDisponibles)) {\n\t\t\t\t\t\t\t\t//Si se ha buscado por id se le asigna\n\t\t\t\t\t\t\t\tif (!empty($_POST['num_taquilla'])) {\n\t\t\t\t\t\t\t\t\t$reserva = new Taquilla;\n\t\t\t\t\t\t\t\t\t$reserva = $taqDisponibles[0];\n\t\t\t\t\t\t\t\t\t$reserva->user_id = $_POST['user_id'];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//Si no se busca por id es aleatorio\n\t\t\t\t\t\t\t\t\t$aleatorio = rand (0,count($taqDisponibles)-1);\n\t\t\t\t\t\t\t\t\t$reserva = new Taquilla;\n\t\t\t\t\t\t\t\t\t$reserva = $taqDisponibles[$aleatorio];\n\t\t\t\t\t\t\t\t\t$reserva->user_id = $_POST['user_id'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$email = User::findByNIA($_POST['user_id'])->mail;\n\t\t\t\t\t\t\t\t$nombre = User::findByNIA($_POST['user_id'])->cn;\n\t\t\t\t\t\t\t\t$this->render('confirmarAsig',array('reserva'=>$reserva, 'email'=>$email, 'nombre'=>$nombre));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//No hay taquillas libres\n\t\t\t\t\t\t\t\t$error = 'No hay taquillas libres';\n\t\t\t\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Caso de que ya exista 1 o + reservas, se elige la 1º.\n\t\t\t\t\t\telse if ($taqDisponibles[0]->estado == 2) {\n\t\t\t\t\t\t\t$reserva = $taqDisponibles[0];\n\t\t\t\t\t\t\t$email = User::findByNIA($_POST['user_id'])->mail;\n\t\t\t\t\t\t\t$nombre = User::findByNIA($_POST['user_id'])->cn;\n\t\t\t\t\t\t\t$this->render('confirmarAsig',array('reserva'=>$reserva, 'email'=>$email, 'nombre'=>$nombre));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$error = 'Ha ocurrido un error';\n\t\t\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Algún campo vacío\n\t\t\t\t\t\t$error = 'Todos los campos son obligatorios';\n\t\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function agregar_banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n if(empty($_POST[\"pregunta\"])){\r\n header(\"Location:\".Conectar::ruta().\"admin/banco/crear.php?m=1\");\r\n exit();\r\n }\r\n $contra='activo';\r\n $conectar=parent::conexion();\r\n $sql=\"insert into banco values(null,?,?,?,now());\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->bindValue(1, $_POST[\"pregunta\"]);\r\n $sql->bindValue(2, $_SESSION[\"id\"]);\r\n $sql->bindValue(3, $contra);\r\n $sql->execute();\r\n $resultado=$sql->fetch(PDO::FETCH_ASSOC);\r\n \r\n header(\"Location:\".Conectar::ruta().\"admin/banco/index.php?m=2\");\r\n \r\n }",
"function insertarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t$this->setParametro('id_depto_lb','id_depto_lb','int4');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\t\t\n\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function saveAvaliacao($param) {\n \n $transaction = \\Yii::$app->db->beginTransaction();\n \n try {\n\n // CADASTRO --------------------------------------------------------\n if(!($CB19_ID = $param['CB19_ID'])) {\n \n // salva a avaliacao\n $CB19AVALIACAO = new CB19AVALIACAO();\n $CB19AVALIACAO->setAttribute('CB19_EMPRESA_ID', $this->user->id_company);\n $CB19AVALIACAO->setAttribute('CB19_NOME', $param['CB19_NOME']);\n $CB19AVALIACAO->setAttribute('CB19_STATUS', 1);\n $CB19AVALIACAO->save();\n $CB19_ID = $CB19AVALIACAO->CB19_ID;\n\n // salva os itens da avaliação - pode nao ter itens, só exibe um campo de texto para avaliar\n if (!empty($param['AVALIACAO-ITENS'])) {\n foreach ($param['AVALIACAO-ITENS'] as $item) {\n\n $CB20ITEMAVALIACAO = new CB20ITEMAVALIACAO();\n $CB20ITEMAVALIACAO->setAttribute('CB20_AVALIACAO_ID', $CB19_ID);\n $CB20ITEMAVALIACAO->setAttribute('CB20_TIPO_AVALICAO_ID', $item);\n $CB20ITEMAVALIACAO->setAttribute('CB20_STATUS', 1);\n $CB20ITEMAVALIACAO->save();\n\n }\n }\n\n // EDICAO ----------------------------------------------------------\n } else {\n \n // salva a avaliacao\n $CB19AVALIACAO = CB19AVALIACAO::findOne($CB19_ID);\n $CB19AVALIACAO->setAttribute('CB19_EMPRESA_ID', $this->user->id_company);\n $CB19AVALIACAO->setAttribute('CB19_NOME', $param['CB19_NOME']);\n $CB19AVALIACAO->setAttribute('CB19_STATUS', 1);\n $CB19AVALIACAO->save();\n \n // desativa todos os itens antes de add/ativar\n CB20ITEMAVALIACAO::updateAll(['CB20_STATUS' => 0], 'CB20_AVALIACAO_ID = ' . $CB19_ID);\n\n // salva os itens da avaliação - pode nao ter itens, só exibe um campo de texto para avaliar\n if (!empty($param['AVALIACAO-ITENS'])) {\n foreach ($param['AVALIACAO-ITENS'] as $item) {\n\n // verifica se o item existe desativado e ativa / se nao cria\n if(!$CB20ITEMAVALIACAO = CB20ITEMAVALIACAO::find()->where(\"CB20_AVALIACAO_ID = $CB19_ID AND CB20_TIPO_AVALICAO_ID = $item\")->one()) {\n $CB20ITEMAVALIACAO = new CB20ITEMAVALIACAO();\n $CB20ITEMAVALIACAO->setAttribute('CB20_AVALIACAO_ID', $CB19_ID);\n $CB20ITEMAVALIACAO->setAttribute('CB20_TIPO_AVALICAO_ID', $item);\n }\n \n $CB20ITEMAVALIACAO->setAttribute('CB20_STATUS', 1);\n $CB20ITEMAVALIACAO->save();\n\n }\n }\n \n }\n\n $transaction->commit();\n return json_encode(['status' => true]);\n\n } catch (\\Exception $exc) {\n $transaction->rollBack();\n return json_encode(['status' => false]);\n }\n \n }",
"function getBloqueado() {\n return $this->bloqueado;\n }",
"function guardar($arg) {\n\t\tSessionHandler()->check_session();\n\t\tdate_default_timezone_set('America/Argentina/La_Rioja');\n\n\t\t$ids = explode('@', $arg);\n\t\t$mesa = $ids[0];\n\t\t$bebida = $ids[1];\n\t\t$cantidad = $ids[2];\n\t\t$pedidoId = $ids[3];\n\n\t\t//COMPROBAR STOCK DE BEBIDA.\n\t\t\n\t\tif ($pedidoId != null || $pedidoId != 0 || $pedidoId != \"\") {\n\t\t\t$bp = new BebidaPedido();\n\t\t\t$bp->pedido = $pedidoId;\n\t\t\t$bp->bebida = $bebida;\n\t\t\t$bp->cantidad = $cantidad;\n\t\t\t$bp->save();\n\n\t\t\t$md = new Mesa();\n\t\t\t$md->mesa_id = $mesa;\n\t\t\t$md->get();\n\t\t\t$md->disponible = 2;\n\t\t\t$md->save();\n\t\t\tprint($pedidoId);exit;\n\t\t}\n\n\t\t$this->model->fecha = date('Y-m-d');\t\t\n\t\t$this->model->mesa = $mesa;\t\t\n\t\t$this->model->estado = 1;\t\t\n\t\t$this->model->save();\n\t\t\n\t\t$md = new Mesa();\n\t\t$md->mesa_id = $mesa;\n\t\t$md->get();\n\t\t$md->disponible = 2;\n\t\t$md->save();\n\t\t\n\t\t$pedido_id = $this->model->pedido_id;\n\t\t\n\t\t$bp = new BebidaPedido();\n\t\t$bp->pedido = $pedido_id;\n\t\t$bp->bebida = $bebida;\n\t\t$bp->cantidad = $cantidad;\n\t\t$bp->save();\n\t\tprint($pedido_id);exit;\n\n\t}",
"public function boleta()\n\t{\n\t\t//\n\t}",
"private function objetoAbreConexao()\n\t{\n\t\t\n\t\t$_BANCO = new ConexaoBD();\n\t\t$_BANCO->conexaoBD();\n\t}",
"function inserirAgencia(){\n\n $banco = abrirBanco();\n //declarando as variáveis usadas na inserção dos dados\n $nomeAgencia = $_POST[\"nomeAgencia\"];\n $cidadeAgencia = $_POST[\"cidadeAgencia\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndex();\n\n }",
"function evt__procesar(){\n $m = $this->dep('datos')->tabla('mesa')->get();\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Ingreso con perfil junta_electoral\n $m['estado'] = 3;//Cambia el estado de la mesa a Confirmado\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);\n if($p !== false){//Ingreso con perfil secretaria\n $m['estado'] = 4;//Cambia el estado de la mesa a Definitivo\n }\n else{\n $p = array_search('autoridad_mesa', $this->s__perfil); \n if($p !== false){//Ingreso con perfil autoridad de mesa\n $m['estado'] = 1;//Cambia el estado de la mesa a Cargado\n }\n }\n }\n $this->dep('datos')->tabla('mesa')->set($m);\n// print_r($m['id_mesa']);\n $this->dep('datos')->tabla('mesa')->sincronizar();\n $this->dep('datos')->tabla('mesa')->resetear();\n \n \n if(isset($this->s__retorno)){//debe retornar a confirmar\n if($this->s__retorno_estado=='')\n $dato = true;\n else\n $dato['f'] = $this->s__retorno_estado;\n toba::vinculador()->navegar_a(\"\",$this->s__retorno,$dato); \n $this->s__retorno = null; \n $this->s__id_mesa = null;\n $this->s__retorno_estado = null;\n }\n }",
"public function get_Banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n $sql=\"select * from banco;\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }",
"function listarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_sel';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('id_cuenta_bancaria_boa','int4');\n\t\t$this->captura('banco','int4');\n\t\t$this->captura('cuenta','varchar');\n\t\t$this->captura('desc_cuenta','varchar');\n\t\t$this->captura('moneda','int4');\n\t\t$this->captura('tipo_cuenta','bpchar');\n\t\t$this->captura('estado_cuenta','bpchar');\n\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('desc_cuenta_banco','varchar');\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function cadastrar()\n{\n //DEFINIR A DATA\n $this->data = date('Y-m-d H:i:s');\n\n //INSERIR A VAGA NO BANCO\n $obDatabase = new Database('vagas');\n $obDatabase->insert([\n 'titulo' => $this->titulo,\n 'descricao' => $this->descricao,\n 'ativo' => $this->ativo,\n 'data' => $this->data\n ]);\n //echo \"<pre>\"; print_r($obDatabase); echo \"</pre>\"; exit;\n\n\n //ATRIBUIR O ID DA VAGA NA INSTANCIA\n\n //RETORNAR SUCESSO\n}",
"function modificarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\t\t$this->setParametro('desc_cuenta','desc_cuenta','varchar');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\t\t$this->setParametro('tipo_cuenta','tipo_cuenta','bpchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado_cuenta','estado_cuenta','bpchar');\n\t\t$this->setParametro('banco','banco','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function saveBaixaCompra($param) { \n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS', 20);\n $CB16PEDIDO->save(); \n }\n }",
"function Bloquer($bloqueur,$bloque){\r\n\t\t$conn = mysqli_connect(\"localhost\", \"root\", \"\", \"bddfinale\");\r\n\t\t$requete = \"INSERT INTO blocage VALUES(NULL,'$bloqueur','$bloque')\";\r\n\t\t$ligne= mysqli_query($conn, $requete);\r\n\t\tmysqli_close($conn);\r\n\t\t}",
"public function obtenerViajesplusAbonados();",
"function commandes_trig_bank_reglement_en_attente($flux){\r\n\t// Si on est dans le bon cas d'un paiement de commande et qu'il y a un id_commande et que la commande existe toujours\r\n\tif ($id_transaction = $flux['args']['id_transaction']\r\n\t AND $transaction = sql_fetsel(\"*\",\"spip_transactions\",\"id_transaction=\".intval($id_transaction))\r\n\t\tAND $id_commande = $transaction['id_commande']\r\n\t\tAND $commande = sql_fetsel('id_commande, statut, id_auteur, mode', 'spip_commandes', 'id_commande='.intval($id_commande))){\r\n\r\n\t\t$statut_commande = $commande['statut'];\r\n\t\t$transaction_mode = $transaction['mode'];\r\n\t\t$commande_mode = $commande['mode'];\r\n\t\t$statut_nouveau = 'attente';\r\n\t\tif ($statut_nouveau !== $statut_commande OR $transaction_mode !==$commande_mode){\r\n\t\t\tspip_log(\"commandes_trig_bank_reglement_en_attente marquer la commande #$id_commande statut=$statut_nouveau mode=$transaction_mode\",'commandes');\r\n\t\t\t//on met a jour la commande\r\n\t\t\tinclude_spip(\"action/editer_commande\");\r\n\t\t\tcommande_modifier($id_commande,array('statut'=>$statut_nouveau,'mode'=>$transaction_mode));\r\n\t\t}\r\n\t}\r\n\r\n\treturn $flux;\r\n}",
"public function ban();",
"function siguienteEstadoBoleta(){\r\n $this->procedimiento='leg.ft_boleta_garantia_dev_ime';\r\n $this->transaccion='LG_POBODEV_IME';\r\n $this->tipo_procedimiento='IME';\r\n \r\n //Define los parametros para la funcion\r\n $this->setParametro('id_proceso_wf','id_proceso_wf','int4'); \r\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\r\n\t\t$this->setParametro('id_anexo','id_anexo','int4');\r\n\t\t\r\n\t\t\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }",
"protected function fijarSentenciaInsert(){}",
"public function ajoutBureau(int $bureau)\n {\n // On effectue une recherche de tous les immeubles contenus\n // dans le buerau demandée\n $sql = 'SELECT DISTINCT `id`\n FROM `people`\n WHERE `bureau` = :bureau';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':bureau', $bureau, PDO::PARAM_INT);\n $query->execute();\n\n // S'il y a des immeubles\n if ($query->rowCount()) {\n // On récupère la liste des identifiants\n $immeubles = $query->fetchAll(PDO::FETCH_NUM);\n\n // Si la mission est un porte à porte,\n // on cherche les électeurs concernés\n if ($this->_data['mission_type'] == 'porte') {\n // Pour chaque immeuble, on récupère les infos et\n // on créé une porte à boîter\n foreach ($immeubles as $immeuble) {\n $sql = 'SELECT `street`\n FROM `building`\n WHERE `id` = :id';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':id', $immeuble[0]);\n $query->execute();\n $info = $query->fetch(PDO::FETCH_NUM);\n\n $sql = 'SELECT `people` AS `id`\n FROM `address`\n WHERE `building` = :immeuble';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':immeuble', $immeuble[0], PDO::PARAM_INT);\n $query->execute();\n $contacts = $query->fetchAll(PDO::FETCH_NUM);\n\n // Pour chaque électeur, on créé une porte à frapper\n foreach ($contacts as $contact) {\n $sql = 'INSERT INTO `items` (`mission_id`,\n `rue_id`,\n `immeuble_id`,\n `contact_id`)\n VALUES (:mission,\n :rue,\n :immeuble,\n :contact)';\n $query = $this->_link->prepare($sql);\n $query->bindParam(\n ':mission',\n $this->_data['mission_id'],\n PDO::PARAM_INT\n );\n $query->bindParam(':rue', $info[0], PDO::PARAM_INT);\n $query->bindParam(\n ':immeuble',\n $immeuble[0],\n PDO::PARAM_INT\n );\n $query->bindParam(\n ':contact',\n $contact[0],\n PDO::PARAM_INT\n );\n $query->execute();\n }\n }\n } else {\n foreach ($immeubles as $immeuble) {\n $sql = 'SELECT `street`\n FROM `building`\n WHERE `id` = :id';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':id', $immeuble[0]);\n $query->execute();\n $info = $query->fetch(PDO::FETCH_NUM);\n\n $query = $this->_link->prepare($sql);\n $sql = 'INSERT INTO `items` (`mission_id`,\n `rue_id`,\n `immeuble_id`)\n VALUES (:mission,\n :rue,\n :immeuble)';\n $query->bindParam(\n ':mission',\n $this->_data['mission_id'],\n PDO::PARAM_INT\n );\n $query->bindParam(':rue', $info[0], PDO::PARAM_INT);\n $query->bindParam(':immeuble', $immeuble[0], PDO::PARAM_INT);\n $query->execute();\n }\n }\n } else {\n return false;\n }\n }",
"function transaccion(){\n\t\t\t$this->conexion = new conexion();\n\t\t\t$this->conn = $this->conexion->enlace();\n\t\t}",
"public function getBanco($verificacao = false);",
"public function attaquerAdversaire() {\n\n }",
"public function salvarDepreciacao() {\n\n $oDaoBensDepreciacao = new cl_bensdepreciacao();\n $oDaoBensDepreciacao->t44_benstipoaquisicao = $this->getTipoAquisicao()->getCodigo();\n $oDaoBensDepreciacao->t44_benstipodepreciacao = $this->getTipoDepreciacao()->getCodigo();\n $oDaoBensDepreciacao->t44_valoratual = \"{$this->getValorDepreciavel()}\";\n $oDaoBensDepreciacao->t44_valorresidual = \"{$this->getValorResidual()}\";\n $oDaoBensDepreciacao->t44_vidautil = \"{$this->getVidaUtil()}\";\n\n if (!empty($this->iCodigoBemDepreciacao)) {\n\n $oDaoBensDepreciacao->t44_sequencial = $this->iCodigoBemDepreciacao;\n $oDaoBensDepreciacao->alterar($this->iCodigoBemDepreciacao);\n\n } else {\n\n $oDaoBensDepreciacao->t44_ultimaavaliacao = date(\"Y-m-d\", db_getsession(\"DB_datausu\"));\n $oDaoBensDepreciacao->t44_bens = $this->iCodigoBem;\n $oDaoBensDepreciacao->incluir(null);\n $this->iCodigoBemDepreciacao = $oDaoBensDepreciacao->t44_sequencial;\n }\n\n if ($oDaoBensDepreciacao->erro_status == \"0\") {\n $sMsg = _M('patrimonial.patrimonio.Bem.erro_salvar_calculo', (object)array(\"erro_msg\" => $oDaoBensDepreciacao->erro_msg));\n throw new Exception($sMsg);\n }\n return true;\n }",
"public function examen(){\r\n\t\tparent::conectaBDMy();\t \r\n\t\t$this->idExamen=\"\";\t\t\r\n\t\t$this->tipoExamen=\"\";\t\r\n\t\t$this->descripcion=\"\";\r\n\t}",
"public function guardar(){\n \n $_vectorpost=$this->_vcapitulo;\n $_programadas=[1,3,4,5,6,7,8,2,11,15,26];\n \n if(!empty($this->_relaciones)){\n \n $_vpasspregunta=explode(\"%%\",$this->_relaciones);\n \n /*Iniciando Transaccion*/\n $_transaction = Yii::$app->db->beginTransaction();\n try {\n foreach($_vpasspregunta as $_clguardar){\n\n /*Aqui se debe ir la funcion segun el tipo de pregunta\n * la variable $_clguardar es un string que trae\n * name_input ::: id_pregunta ::: id_tpregunta ::: id_respuesta\n * cada funcion de guardar por tipo se denomina gr_tipo...\n */\n\n $_ldata=explode(\":::\",$_clguardar);\n\n //Recogiendo codigos SQL\n //Se envia a la funcion de acuerdo al tipo\n // @name_input \"0\"\n // @id_pregunta \n // @id_tpregunta\n // @id_respuesta ==========================//\n \n /*Asociando Respuesta*/\n $_nameq = 'rpta'.$_ldata[0];\n \n \n \n if(!empty($_ldata[2]) and in_array($_ldata[2], $_programadas) === TRUE and isset($_vectorpost['Detcapitulo'][$_nameq])){\n \n \n //Yii::trace(\"Llegan tipos de preguntas \".$_ldata[2].\" Para idpregunta \".$_ldata[1],\"DEBUG\");\n /*Recogiendo Id_respuesta si existe*/ \n $_idrespuesta=(!empty($_ldata[3]))? $_ldata[3]:'';\n $id_pregunta= $_ldata[1];\n $this->_idcapitulo = $_ldata[4];\n \n \n /*Armando Trama SQL segun el tipo de pregunta*/\n $_valor = $_vectorpost['Detcapitulo'][$_nameq];\n \n //Yii::trace(\"que respuestas llegan \".$_valor,\"DEBUG\");\n \n if(isset($this->_agrupadas[$id_pregunta])){\n \n /*1) Buscando si existe una respuesta asociada a la agrupacion*/\n $idrpta_2a = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta\n LEFT JOIN fd_pregunta ON fd_pregunta.id_pregunta = fd_respuesta.id_pregunta\n WHERE fd_pregunta.id_agrupacion= :agrupacion \n and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion ')\n ->bindValues([\n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ':agrupacion' =>$this->_agrupadas[$id_pregunta],\n ])->queryOne();\n \n $_idrespuesta = $idrpta_2a['id_respuesta'];\n \n /*2) Si existe respuesta asociada se envia como _idrespuesta*/\n \n $v_rpta= $this->{\"gr_tipo2a\"}($_idrespuesta,$_valor,$id_pregunta); //Preguntas tipo 2 agrupadas\n $_ldata[1]= $v_rpta[2];\n \n }else{\n \n //Averiguando si la pregunta es tipo multiple y si la respuesta es null si es asi \n //Salta a la siguiente pregunta\n if(!empty($this->multiples[$id_pregunta]) and empty($_valor)){\n continue;\n }else if(!empty($this->multiples[$id_pregunta]) and !is_null($_valor)){\n $_idrespuesta=''; \n } \n \n /*Si la pregunta es tipo 3 se averigua si la respuesta es tipo especifique*/\n $_otros=null;\n if($_ldata[2]=='3' and isset($_vectorpost['Detcapitulo']['otros_'.$_ldata[0]])){\n \n $_otros = $_vectorpost['Detcapitulo']['otros_'.$_ldata[0]];\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros);\n \n }else{\n \n if($_ldata[2]==11 and isset($this->_tipo11[$_nameq])){\n $_valor=count($this->_tipo11[$_nameq]);\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor);\n }else if ($_ldata[2]!=11 and !isset($this->_tipo11[$_nameq])){\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros,$id_pregunta);\n }else{\n continue;\n } \n }\n } \n \n /*Asignando valor == null*/\n $v_rpta[1]=(!isset($v_rpta[1]))? NULL:$v_rpta[1];\n \n \n /*Generado comando SQL*/\n if(!empty($v_rpta[0])){\n \n if(empty($this->_idjunta))$this->_idjunta=0;\n if(is_null($_otros)){ \n \n if (strpos($v_rpta[0], ';') !== false) {\n $sep_qu = explode(\";\", $v_rpta[0]);\n \n Yii::$app->db->createCommand($sep_qu[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n \n Yii::$app->db->createCommand($sep_qu[1])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ])->execute();\n \n \n }\n else\n {\n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n }\n \n \n }else{ \n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ':otros' =>$_otros, \n ])->execute();\n }\n\n /*Se averigua con que id quedo guardada la respuesta si es tipo 11 -> guarda en SOP SOPORTE*/\n if($_ldata[2]=='11' and !empty($this->_tipo11[$_nameq])){\n\n $id_rpta = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta '\n . 'WHERE id_pregunta = :_prta'\n . ' and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion' )\n ->bindValues([\n ':_prta' => $_ldata[1], \n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ])->queryOne();\n\n\n foreach($this->_tipo11[$_nameq] as $_cltp11){\n\n $_vctp11=explode(\":::\",$_cltp11);\n $_namefile = $_vctp11[0].\".\".$_vctp11[2];\n\n $_sqlSOP=\"INSERT INTO sop_soportes ([[ruta_soporte]],[[titulo_soporte]],[[tamanio_soportes]],[[id_respuesta]]) VALUES (:ruta, :titulo, :tamanio, :_idrpta)\";\n\n Yii::$app->db->createCommand($_sqlSOP)\n ->bindValues([\n ':ruta' => $_vctp11[1],\n ':titulo' => $_namefile,\n ':tamanio' => $_vctp11[3],\n ':_idrpta' => $id_rpta[\"id_respuesta\"],\n ])->execute();\n\n }\n \n }\n /*Fin guardando en SOP_SOPORTES para tipo 11*/\n \n } \n }\n\n }\n \n \n \n $_transaction->commit();\n \n }catch (\\Exception $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } catch (\\Throwable $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } \n \n }\n return TRUE;\n }",
"public function show($id_punto)\n {\n $table = DB::table('credito')\n ->where('id_punto_agua','=',$id_punto)\n ->select('*')->get();\n dd();\n\n $id_credito = $table[0]->id;\n\n $credito = Credito::find($id_credito);\n $credito->estado = 2;\n $credito->save();\n \n return redirect()->back();\n }",
"public function GuardarEstado()\n\t{\n\t\t$query=\"INSERT INTO estado (idpais,estado,descripcion) VALUES ($this->id_pais,'$this->estado','$this->descripcion')\";\n\t\t$resp=$this->db->consulta($query);\n\t\t$this->id_estado = $this->db->id_ultimo();\n\t\t\n\t\t\n\t\t\n\t}",
"function modificarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_ime';\n\t\t$this->transaccion='TES_CTABAN_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha_baja','fecha_baja','date');\n\t\t$this->setParametro('nro_cuenta','nro_cuenta','varchar');\n\t\t$this->setParametro('fecha_alta','fecha_alta','date');\n\t\t$this->setParametro('id_institucion','id_institucion','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('denominacion','denominacion','varchar');\n\t\t$this->setParametro('centro','centro','varchar');\n\t\t\n\t\t$this->setParametro('id_finalidads','id_finalidads','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function setForAuteur()\n {\n //met à jour les proposition qui n'ont pas de base contrat et qui ne sont pas null\n /*PLUS BESOIN DE BASE CONTRAT\n \t\t$dbP = new Model_DbTable_Iste_proposition();\n \t\t$dbP->update(array(\"base_contrat\"=>null), \"base_contrat=''\");\n */\n\t \t//récupère les vente qui n'ont pas de royalty\n\t \t$sql = \"SELECT \n ac.id_auteurxcontrat, ac.id_livre\n , ac.id_isbn, ac.pc_papier, ac.pc_ebook\n , a.prenom, a.nom, c.type, IFNULL(a.taxe_uk,'oui') taxe_uk\n ,i.num\n , v.id_vente, v.date_vente, v.montant_livre, v.id_boutique, v.type typeVente\n , i.id_editeur, i.type typeISBN\n , impF.conversion_livre_euro\n FROM iste_vente v\n INNER JOIN iste_isbn i ON v.id_isbn = i.id_isbn \n INNER JOIN iste_importdata impD ON impD.id_importdata = v.id_importdata\n INNER JOIN iste_importfic impF ON impF.id_importfic = impD.id_importfic\n INNER JOIN iste_auteurxcontrat ac ON ac.id_isbn = v.id_isbn\n INNER JOIN iste_contrat c ON c.id_contrat = ac.id_contrat\n INNER JOIN iste_auteur a ON a.id_auteur = ac.id_auteur\n INNER JOIN iste_livre l ON l.id_livre = i.id_livre \n LEFT JOIN iste_royalty r ON r.id_vente = v.id_vente AND r.id_auteurxcontrat = ac.id_auteurxcontrat\n WHERE pc_papier is not null AND pc_ebook is not null AND pc_papier != 0 AND pc_ebook != 0\n AND r.id_royalty is null \";\n\n $stmt = $this->_db->query($sql);\n \n \t\t$rs = $stmt->fetchAll(); \n \t\t$arrResult = array();\n \t\tforeach ($rs as $r) {\n\t\t\t//calcule les royalties\n \t\t\t//$mtE = floatval($r[\"montant_euro\"]) / intval($r[\"nbA\"]);\n \t\t\t//$mtE *= floatval($r[\"pc_papier\"])/100;\n \t\t\tif($r[\"typeVente\"]==\"ebook\")$pc = $r[\"pc_ebook\"];\n \t\t\telse $pc = $r[\"pc_papier\"];\n $mtL = floatval($r[\"montant_livre\"])*floatval($pc)/100;\n //ATTENTION le taux de conversion est passé en paramètre à l'import et le montant des ventes est calculé à ce moment\n \t\t\t//$mtD = $mtL*floatval($r[\"taux_livre_dollar\"]);\n \t\t\t$mtE = $mtL*floatval($r['conversion_livre_euro']);\n //ajoute les royalties pour l'auteur et la vente\n //ATTENTION les taxes de déduction sont calculer lors de l'édition avec le taux de l'année en cours\n $dt = array(\"pourcentage\"=>$pc,\"id_vente\"=>$r[\"id_vente\"]\n ,\"id_auteurxcontrat\"=>$r[\"id_auteurxcontrat\"],\"montant_euro\"=>$mtE,\"montant_livre\"=>$mtL\n ,\"conversion_livre_euro\"=>$r['conversion_livre_euro']);\n\t \t\t$arrResult[]= $this->ajouter($dt\n ,true,true);\n //print_r($dt);\n \t\t}\n \t\t\n \t\treturn $arrResult;\n }",
"public function Anular()\n\t{\n\t\tif($this->TieneCobranzasVigentes())\n\t\t\tthrow new Exception('No se puede anular una factura que tiene cobranzas');\n\t\t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t\n\t\t\t//echo 'ejecutar como trans';\n\t\t\t$this->FechaAnulacion = date('Y-m-d');\n\t\t\t\n\t\t\t$q =\tDoctrine_Query::create()\n\t\t\t\t\t\t->from('OrdenDeTrabajo ot')\n ->Update()\n ->Set('FacturaId', 'NULL')\n ->andWhere('ot.ClienteId = ?', $this->ClienteId)\n ->andWhere('ot.FacturaId = ?', $this->Id);\n \n\t\t\t$conn->beginTransaction();\n\t\t\t\n\t\t\t$this->save();\n\t\t\t//actualizar ordenes asociadas la factura\n\t\t\t$q->execute();\n\t\t\t\n\t\t\t$conn->commit();\n\t\t\n\t}",
"public function cadadastrarMembroDao(objetoMembro $ace){\r\n \r\n $pesquisaNome=$ace->getNome();\r\n require_once (\"conexao.php\");\r\n \r\n $obj = Connection::getInstance();\r\n $ret=3;\r\n \r\n $busca = mysql_query(\"Select Nome from membros where Nome like '%$pesquisaNome%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $reg = mysql_fetch_assoc($busca);\r\n \r\n\tif($reg != \"\"){\r\n $ret = 1;\r\n }\r\n else{\r\n $ace->setStatus(\"ATIVO\");\r\n \t$matricula = $ace->getMatricula(); $nome = $ace->getNome(); $sexo=$ace->getSexo(); $data=$ace->getData(); $rg=$ace->getRg(); $cpf=$ace->getCpf(); $estadocivil=$ace->getEstadocivil();\r\n\t\t$natural=$ace->getNatural(); $profissao=$ace->getProfissao(); $escola=$ace->getEscola(); $pai=$ace->getPai(); $mae=$ace->getMae(); $necessidade=$ace->getNecessidade();\r\n\t\t$fone=$ace->getFone(); $filho=$ace->getFilho(); $formacao=$ace->getFormacao(); $membrasia=$ace->getMembrasia(); $funcao=$ace->getFuncao(); $participou=$ace->getParticipou();\r\n\t\t$trabalhando=$ace->getTrabalhando(); $viajando=$ace->getViajando(); $congrega=$ace->getCongrega(); $rua=$ace->getRua(); $bairro=$ace->getBairro(); $casa=$ace->getCasa(); $status=$ace->getStatus(); $email=$ace->getEmail();\r\n $lider=$ace->getLider();\r\n $data1 = date($data);\r\n\r\n\t\t$inse = \"INSERT INTO membros (Matricula,Nome,Sexo,DataNascimento1,Naturalidade,Escolaridade,Profissao,Rg,Cpf,EstadoCivil,Pai,Mae,NecessidadeEspeciais,Filho,fone,formacaoEclesiatica,IntegracaoMembrasia,Funcao,JaParticipou,EstadoAtual,Trabalhando,Congrega,Rua,Casa,Bairro,Status,tx_email,LiderCelula )VALUES('','$nome','$sexo','$data1','$natural','$escola','$profissao','$rg','$cpf','$estadocivil','$pai','$mae','$necessidade','$filho','$fone','$formacao','$membrasia','$funcao','$participou','$viajando','$trabalhando','$congrega','$rua','$casa','$bairro','$status','$email','$lider')\";\r\n\r\n $result = mysql_query($inse) or die (\"Falha na insercao do membro\".mysql_error());\r\n\r\n if ($result)\r\n {\r\n $ret = 0;\r\n \r\n }else{\r\n\r\n $ret = 2;\r\n }\r\n }\r\n \r\n mysql_free_result($busca);\r\n $obj->freebanco();\r\n \r\n return $ret;\r\n }",
"function fProcesaBanco(){\n global $db, $cla, $agPar, $igNumChq, $igSecue, $ogDet;\n $alDet = fIniDetalle();\n $alDet[\"det_codcuenta\"]\t= $cla->cla_ctaorigen; \n $alDet[\"det_glosa\"] \t= substr($agPar[\"com_Concepto\"],0, 50) . ' ' . substr($agPar[\"slBenef\"],0,20);\n $alDet['det_idauxiliar']= $agPar[\"com_Emisor\"];\n $alDet[\"det_numcheque\"]\t= $igNumChq;\t\t\t// es el numero de cheque\n $alDet[\"det_feccheque\"]\t= $agPar[\"com_FechCheq\"];\n $alDet['det_valdebito']\t= $agPar[\"flValor\"] * $cla->cla_indicador; // segun el signo del indicador, se aplica como DB/CR al grabar;\n $alDet['det_valcredito']\t= 0;\n $alDet['det_secuencia']\t= $igSecue;\n\tif(fGetParam(\"pAppDbg\",0)){\n\t\tprint_r($alDet);\n\t}\n\tfInsdetalleCont($db, $alDet);\n}",
"public function inserir_anuncio(){\n if(!isset($_SESSION))session_start();\n\n $cliente = unserialize($_SESSION['cliente']);\n\n $id_veiculo = $_POST['cb_veiculos'];\n $data_inicial = $_POST['data_inicial'];\n $data_final = $_POST['data_final'];\n $hora_inicial = $_POST['hora_inicial'];\n $hora_final = $_POST['hora_final'];\n $descricao = $_POST['descricao'];\n $valor_hora = $_POST['valor_hora'];\n $id_cliente = $cliente->getId();\n\n $anuncio = new Anuncio();\n $anuncio->setDescricao($descricao)\n ->setIdClienteLocador($id_cliente)\n ->setIdVeiculo($id_veiculo)\n ->setHorarioInicio($hora_inicial)\n ->setHorarioTermino($hora_final)\n ->setDataInicial($data_inicial)\n ->setDataFinal($data_final)\n ->setValor($valor_hora);\n\n\n $this->anunciosDAO->insert($anuncio);\n\n }",
"public function getId_Boisson()\n{\nreturn $this->Id_Boisson;\n}",
"public static function poblarBD($em){\n\t\t$com1 = new Competicion();\n\t\t$com1->setNombre(\"Competición 1\")\n\t\t->setTemp(2014)\n\t\t->setFecha(new \\DateTime(\"2015/08/22\"))\n\t\t->setEsVisible(true);\n\t\t$em->persist($com1);\n\t\t\n\t\t$com2 = new Competicion();\n\t\t$com2->setNombre(\"Competición 2\")\n\t\t->setTemp(2015)\n\t\t->setFecha(new \\DateTime(\"2015/11/07\"));\n\t\t$em->persist($com2);\n\t\t\n\t\t$com3 = new Competicion();\n\t\t$com3->setNombre(\"Competición 3\")\n\t\t->setTemp(2015)\n\t\t->setFecha(new \\DateTime(\"2015/12/12\"))\n\t\t->setEsVisible(true)\n\t\t->setEsFeder(true)\n\t\t->setEsOficial(true);\n\t\t$em->persist($com3);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"100 metros lisos\")\n\t\t->setUnidades(\"segundos\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Campo a través\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Campo a través\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"Salto de altura\")\n\t\t->setUnidades(\"metros\")\n\t\t->setNumInt(\"3\");\n\t\t$em->persist($tprf);\n\t\t\n\t\t$tprm3 = new TipoPruebaModalidad();\n\t\t$tprm3->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Cubierto\");\n\t\t$em->persist($tprm3);\n\t\t\n\t\t$tprm4 = new TipoPruebaModalidad();\n\t\t$tprm4->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Cubierto\");\n\t\t$em->persist($tprm4);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"Maratón\")\n\t\t->setUnidades(\"segundos\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Ruta\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"Prueba por puntos\")\n\t\t->setUnidades(\"puntosdesc\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm = new TipoPruebaModalidad();\n\t\t$tprm->setSidTprf($tprf)\n\t\t->setSexo(2)\n\t\t->setEntorno(\"Cubierto\");\n\t\t$em->persist($tprm);\n\t\t\n\t\t$tprf = new TipoPruebaFormato();\n\t\t$tprf->setNombre(\"200 metros lisos\")\n\t\t->setUnidades(\"segundos\")\n\t\t->setNumInt(1);\n\t\t$em->persist($tprf);\n\t\t$em->flush();\n\t\t\n\t\t$tprm1 = new TipoPruebaModalidad();\n\t\t$tprm1->setSidTprf($tprf)\n\t\t->setSexo(0)\n\t\t->setEntorno(\"Aire libre\");\n\t\t$em->persist($tprm1);\n\t\t\n\t\t$tprm2 = new TipoPruebaModalidad();\n\t\t$tprm2->setSidTprf($tprf)\n\t\t->setSexo(1)\n\t\t->setEntorno(\"Aire libre\");\n\t\t$em->persist($tprm2);\n\t\t$em->flush();\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Prebenjamín\")\n\t\t->setEdadMax(7)\n\t\t->setTIniVal(2012)\n\t\t->setTFinVal(2014);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Prebenjamín\")\n\t\t->setEdadMax(6)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Benjamín\")\n\t\t->setEdadMax(8)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Alevín\")\n\t\t->setEdadMax(10)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Infantil\")\n\t\t->setEdadMax(12)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Cadete\")\n\t\t->setEdadMax(14)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Juvenil\")\n\t\t->setEdadMax(16)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat1 = new Categoria();\n\t\t$cat1->setNombre(\"Junior\")\n\t\t->setEdadMax(18)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat1);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Promesa\")\n\t\t->setEdadMax(21)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Senior\")\n\t\t->setEdadMax(34)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t\n\t\t$cat = new Categoria();\n\t\t$cat->setNombre(\"Veteranos\")\n\t\t->setEdadMax(null)\n\t\t->setTIniVal(2015)\n\t\t->setTFinVal(null);\n\t\t$em->persist($cat);\n\t\t$em->flush();\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(1)\n\t\t->setSidCom($com1)\n\t\t->setCoste(\"4.95\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm1);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final A\");\n\t\t$em->persist($ron);\n\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final C\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(4)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Cuartos de final D\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(5)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(6)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(7)\n\t\t->setSidPru($pru)\n\t\t->setNum(3)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(2)\n\t\t->setSidCom($com1)\n\t\t->setCoste(\"3.95\")\n\t\t->setIdCat($cat1)\n\t\t->setSidTprm($tprm2);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(1)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm1);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(2)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm2);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(3)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm3);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$pru = new Prueba();\n\t\t$pru->setId(4)\n\t\t->setSidCom($com2)\n\t\t->setCoste(\"2.45\")\n\t\t->setIdCat($cat)\n\t\t->setSidTprm($tprm4);\n\t\t$em->persist($pru);\n\t\t$em->flush();\n\t\t\n\t\t$ron1 = new Ronda();\n\t\t$ron1->setId(1)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal A\");\n\t\t$em->persist($ron1);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(2)\n\t\t->setSidPru($pru)\n\t\t->setNum(1)\n\t\t->setNombre(\"Semifinal B\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$ron = new Ronda();\n\t\t$ron->setId(3)\n\t\t->setSidPru($pru)\n\t\t->setNum(2)\n\t\t->setNombre(\"Final\");\n\t\t$em->persist($ron);\n\t\t\n\t\t$atl1 = new Atleta();\n\t\t$atl1->setNombre(\"Nombre1\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1990/07/22\"))\n\t\t->setNick(\"Nick1\")\n\t\t->setDni(\"12345678A\")\n\t\t->setLfga(\"AG-1234567\")\n\t\t->setLxogade(\"ABC123456\");\n\t\t$em->persist($atl1);\n\t\t\n\t\t$ins = new Inscripcion();\n\t\t$ins->setIdAtl($atl1)\n\t\t->setSidPru($pru)\n\t\t->setFecha(new \\DateTime)\n\t\t->setOrigen(\"test\")\n\t\t->setCoste(1.00)\n\t\t->setEstado(\"Pendiente\");\n\t\t$em->persist($ins);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre2\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1988/07/22\"))\n\t\t->setNick(\"Nick2\")\n\t\t->setDni(\"12345689B\")\n\t\t->setLfga(\"AG-1234568\")\n\t\t->setLxogade(\"ABC123457\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$ins = new Inscripcion();\n\t\t$ins->setIdAtl($atl)\n\t\t->setSidPru($pru)\n\t\t->setFecha(new \\DateTime)\n\t\t->setOrigen(\"test\")\n\t\t->setCoste(1.20)\n\t\t->setEstado(\"Pagado\")\n\t\t->setFechaPago(new \\DateTime());\n\t\t$em->persist($ins);\n\t\t\n\t\t$ins = new Inscripcion();\n\t\t$ins->setIdAtl($atl)\n\t\t->setSidPru($pru)\n\t\t->setFecha(new \\DateTime)\n\t\t->setOrigen(\"test\")\n\t\t->setCoste(4.00)\n\t\t->setEstado(\"Pagado\")\n\t\t->setFechaPago(new \\DateTime());\n\t\t$em->persist($ins);\n\t\t\n\t\t$par = new Participacion();\n\t\t$par->setIdAtl($atl)\n\t\t->setSidCom($pru->getSidCom())\n\t\t->setDorsal(1234)\n\t\t->setAsisten(true);\n\t\t$em->persist($par);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre3\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(true)\n\t\t->setFnac(new \\DateTime(\"1972/07/22\"))\n\t\t->setNick(\"Nick3\")\n\t\t->setDni(\"12345698C\")\n\t\t->setLfga(\"AG-1234569\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre4\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1994/07/22\"))\n\t\t->setNick(\"Nick4\")\n\t\t->setDni(\"12342424C\")\n\t\t->setLfga(\"AG-1233426\")\n\t\t->setLxogade(\"ABC123454\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre5\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(true)\n\t\t->setFnac(new \\DateTime(\"1996/07/22\"))\n\t\t->setNick(\"Nick5\")\n\t\t->setDni(\"12345600G\")\n\t\t->setLfga(\"AG-1764567\")\n\t\t->setLxogade(\"ABC124556\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl6 = new Atleta();\n\t\t$atl6->setNombre(\"Nombre6\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1976/12/01\"))\n\t\t->setNick(\"Nick6\")\n\t\t->setDni(\"52345675A\")\n\t\t->setLfga(\"AG-4234567\");\n\t\t$em->persist($atl6);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre7\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(true)\n\t\t->setFnac(new \\DateTime(\"2006/07/22\"))\n\t\t->setDni(\"92345678A\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl = new Atleta();\n\t\t$atl->setNombre(\"Nombre8\")\n\t\t->setApellidos(\"ApellidoA ApellidoB\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"2012/07/22\"))\n\t\t->setDni(\"99999999Z\");\n\t\t$em->persist($atl);\n\t\t\n\t\t$atl9 = new Atleta();\n\t\t$atl9->setNombre(\"Nombre9\")\n\t\t->setApellidos(\"Otros Apellidos\")\n\t\t->setSexo(false)\n\t\t->setFnac(new \\DateTime(\"1981/04/18\"))\n\t\t->setDni(\"63526420F\");\n\t\t$em->persist($atl9);\n\t\t\n\t\t$int = new Intento();\n\t\t$int->setIdAtl($atl1)\n\t\t->setSidRon($ron1)\n\t\t->setNum(1)\n\t\t->setValidez(false)\n\t\t->setOrigen(\"test\")\n\t\t->setMarca(3.40);\n\t\t$em->persist($int);\n\t\t\n\t\t$int = new Intento();\n\t\t$int->setIdAtl($atl1)\n\t\t->setSidRon($ron1)\n\t\t->setNum(2)\n\t\t->setValidez(true)\n\t\t->setOrigen(\"test\")\n\t\t->setMarca(3.40);\n\t\t$em->persist($int);\n\t\t\n\t\t$usu = new Usuario();\n\t\t$usu->setNombre(\"usuario6\")\n\t\t->setContra('$2a$04$H5G9G/lmx5QLL/Zm3fOyTu92bPmI4/RKnyZrWH48EXJRcA6qXh1yO')\n\t\t->setRol(\"socio\")\n\t\t->setIdAtl($atl6);\n\t\t$em->persist($usu);\n\t\t\n\t\t$usu = new Usuario();\n\t\t$usu->setNombre(\"user\")\n\t\t->setContra('$2a$04$WT1Ed.63TVkKNpPMQZivquS6e4NJlTTo9HRxbrYPYnCV/NqeVlQDa')\n\t\t->setRol(\"socio\")\n\t\t->setIdAtl(null);\n\t\t$em->persist($usu);\n\t\t\n\t\t$usu = new Usuario();\n\t\t$usu->setNombre(\"coordinador\")\n\t\t->setContra('$2a$04$2d5OXU3foU3HgpC70sLNjeubFQ6jy.OTsAjWl.UkdmHrN8VArbs2S')\n\t\t->setRol(\"coordinador\")\n\t\t->setIdAtl($atl9);\n\t\t$em->persist($usu);\n\t\t\n\t\t$em->flush();\n\t}",
"function listarCuentaBancaria(){\n\t\t$this->procedimiento='tes.f_cuenta_bancaria_sel';\n\t\t$this->transaccion='TES_CTABAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('fecha_baja','date');\n\t\t$this->captura('nro_cuenta','varchar');\n\t\t$this->captura('fecha_alta','date');\n\t\t$this->captura('id_institucion','int4');\n\t\t$this->captura('nombre_institucion','varchar');\n\t\t$this->captura('doc_id','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_moneda','integer');\n\t\t$this->captura('codigo_moneda','varchar');\n\t\t$this->captura('denominacion','varchar');\n\t\t$this->captura('centro','varchar');\n\t\t\n\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function crear_banco(){\n $data = array(\n 'nombre_cuenta' => $this->input->post('nombre_cuenta'),\n 'numero_cuenta' => $this->input->post('numero_cuenta'),\n 'descripcion' => $this->input->post('descripcion'),\n 'saldo_inicial' => $this->input->post('saldo_inicial'),\n 'fecha_creacion' => date('Y-m-d'),\n 'fecha_actualizacion' => date('Y-m-d'),\n 'id_almacen' => $this->input->post('almacen'),\n 'id_usuario' => $this->session->userdata('user_id')\n );\n\n $this->connection->insert(\"bancos\",$data);\n }",
"public function BuscaAbonosCreditos() \n{\n\tself::SetNames();\n $sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, ventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.codventa as codigo, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (clientes INNER JOIN ventas ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa WHERE clientes.cedcliente = ? AND ventas.codventa = ? AND ventas.tipopagove ='CREDITO'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(base64_decode($_GET['cedcliente'])));\n\t$stmt->bindValue(2, trim(base64_decode($_GET['codventa'])));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}",
"public function banco()\n {\n return $this->belongsTo(BancoEncuestas::class, 'FK_ECT_Banco_Encuestas', 'PK_BEC_Id');\n }",
"public function bloquear($id)\n {\n $unidad = Propiedad::find($id);\n $unidad->editable = 0;\n $unidad->save();\n return redirect('unidad/'.$unidad->id_des.'/edit');\n\n\n }",
"function bloqueosCambiar(){\n global $tsCore, $tsUser;\n //\n $auser = $tsCore->setSecure($_POST['user']);\n $bloquear = empty($_POST['bloquear']) ? 0 : 1;\n // EXISTE?\n $exists = $tsUser->getUserName($auser);\n // SI EXISTE Y NO SOY YO\n if($exists && $tsUser->uid != $auser){\n if($bloquear == 1){\n // YA BLOQUEADO?\n $query = $this->select(\"u_bloqueos\",\"bid\",\"b_user = {$tsUser->uid} AND b_auser = {$auser}\",\"\",1);\n $noexists = $this->num_rows($query);\n $this->free($query);\n // NO HA SIDO BLOQUEADO\n if(empty($noexists)) {\n if($this->insert(\"u_bloqueos\",\"b_user, b_auser\",\"{$tsUser->uid}, {$auser}\"))\n return \"1: El usuario fue bloqueado satisfactoriamente.\"; \n } else return '0: Ya has bloqueado a este usuario.';\n // \n } else{\n if($this->delete(\"u_bloqueos\",\"b_user = {$tsUser->uid} AND b_auser = {$auser}\"))\n return \"1: El usuario fue desbloqueado satisfactoriamente.\";\n } \n } else return '0: El usuario seleccionado no existe.';\n }",
"function opcion__migrar_toba()\n\t{\n\t\t$proyecto = $this->get_proyecto();\n\t\t//--- Parametros\n\t\t$param = $this->get_parametros();\n\t\t$desde = isset($param['-d']) ? new toba_version($param['-d']) : $proyecto->get_version_actual();\n\t\t$hasta = isset($param['-h']) ? new toba_version($param['-h']) : toba_modelo_instalacion::get_version_actual();\n\n\t\t$desde_texto = $desde->__toString();\n\t\t$hasta_texto = $hasta->__toString();\n\t\t$this->consola->titulo(\"Migración el proyecto '{$proyecto->get_id()}'\".\" desde la versión $desde_texto hacia la $hasta_texto.\");\n\n\t\tif (! isset($param['-m'])) {\n\t\t\t$versiones = $desde->get_secuencia_migraciones($hasta);\n\t\t\tif (empty($versiones)) {\n\t\t\t\t$this->consola->mensaje(\"No es necesario ejecutar una migración entre estas versiones para el proyecto '{$proyecto->get_id()}'\");\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t$proyecto->migrar_rango_versiones($desde, $hasta, false);\n\t\t} else {\n\t\t\t//Se pidio un método puntual\n\t\t\t$proyecto->ejecutar_migracion_particular($hasta, trim($param['-m']));\n\t\t}\n\t}",
"static public function addNotasDebitoModel(\n $descripcionDebito,\n $cantidadDebito,\n $importeDebito,\n $nroCheque,\n $idCliente,\n $fechaDebito,\n $tabla){\n $totalDebito = $cantidadDebito * $importeDebito;\n\n $sql13 = Conexion::conectar()->prepare(\"SELECT nroCheque FROM pagos\n WHERE idCliente = :idCliente AND nroCheque=:nroCheque AND cheque=:totalDebito\");\n $sql13->bindParam(':idCliente', $idCliente);\n $sql13->bindParam(':nroCheque', $nroCheque);\n $sql13->bindParam(':totalDebito', $totalDebito);\n $sql13->execute();\n $resu= $sql13->fetch();\n $saldo = $resu['nroCheque'];\n\n $sql131 = Conexion::conectar()->prepare(\"SELECT nroCheque FROM notadebito\n WHERE idCliente = :idCliente AND nroCheque=:nroCheque \");\n $sql131->bindParam(':idCliente', $idCliente);\n $sql131->bindParam(':nroCheque', $nroCheque);\n $sql131->execute();\n $resu1= $sql131->fetch();\n $saldo1 = $resu1['nroCheque'];\n\n\n\n if($saldo <=0){\n return 'noSaldo';\n }if ($saldo1) {\n return 'noSaldo';\n }\n else{\n\n\n $sql = Conexion::conectar()->prepare(\"INSERT INTO $tabla (descripcionDebito, cantidadDebito, importeDebito, totalDebito ,nroCheque, idCliente , fechaDebito)\n VALUES(:descripcionDebito, :cantidadDebito , :importeDebito,:totalDebito,:nroCheque , :idCliente, :fechaDebito)\");\n $sql->bindParam(':descripcionDebito', $descripcionDebito);\n $sql->bindParam(':cantidadDebito', $cantidadDebito);\n $sql->bindParam(':importeDebito', $importeDebito);\n $sql->bindParam(':totalDebito', $totalDebito);\n $sql->bindParam(':nroCheque', $nroCheque);\n $sql->bindParam(':idCliente', $idCliente);\n $sql->bindParam(':fechaDebito', $fechaDebito);\n\n if ($sql->execute()) {\n\n $sql3 = Conexion::conectar()->prepare(\"UPDATE saldos SET saldoActual= saldoActual+ $totalDebito, saldoFinal= saldoFinal+ $totalDebito WHERE idCliente = :idCliente\");\n $sql3->bindParam(':idCliente', $idCliente);\n $sql3->execute();\n\n\n\n\n $sql41 = Conexion::conectar()->prepare(\"INSERT INTO cuentacorriente(comprobante,\n entrada, idCliente, fecha)\n VALUES(:comprobante, :entrada , :idCliente,:fecha)\");\n $hoy = $fechaDebito;\n $comprobante = 1;\n $sql41->bindParam(':comprobante', $comprobante );\n $sql41->bindParam(':entrada', $totalDebito);\n $sql41->bindParam(':idCliente', $idCliente);\n $sql41->bindParam(':fecha', $hoy);\n $sql41->execute();\n\n\n $sql13 = Conexion::conectar()->prepare(\"SELECT MAX(idCuentaCorriente)AS id FROM cuentacorriente\n WHERE idCliente = :idCliente\");\n $sql13->bindParam(':idCliente', $idCliente);\n $sql13->execute();\n $resu= $sql13->fetch();\n $id = $resu['id'];\n\n\n $sql11 = Conexion::conectar()->prepare(\"UPDATE cuentacorriente\n SET saldo= (SELECT saldoFinal FROM saldos WHERE idCliente=$idCliente)\n WHERE idCliente=:idCliente AND idCuentaCorriente = :id\" );\n $sql11->bindParam(':idCliente', $idCliente);\n $sql11->bindParam(':id', $id);\n $sql11->execute();\n\n $sql131 = Conexion::conectar()->prepare(\"SELECT MAX(idNotaDebito)AS idNotaDebito FROM notadebito\n WHERE idCliente = :idCliente\");\n $sql131->bindParam(':idCliente', $idCliente);\n $sql131->execute();\n $resu1= $sql131->fetch();\n $idNotaDebito = 'Nota de Débito' . ' ' . $resu1['idNotaDebito'];\n $nroNotaDebito=$resu1['idNotaDebito'];\n $sql111 = Conexion::conectar()->prepare(\"UPDATE cuentacorriente\n SET comprobante= :idNotaDebito , nroNotaDebito=:nroNotaDebito\n WHERE idCliente=:idCliente AND idCuentaCorriente = :id\");\n $sql111->bindParam(':idCliente', $idCliente);\n $sql111->bindParam(':idNotaDebito', $idNotaDebito);\n $sql111->bindParam(':nroNotaDebito', $nroNotaDebito);\n $sql111->bindParam(':id', $id);\n $sql111->execute();\n\n return 'success';\n }else{\n return 'errorers';\n }\n $sql->close();\n\n }\n\n }",
"public function obtenerSaldo();",
"public function guardar($datosCampos) {\n $guardar = new SqlQuery(); //instancio objeto de la clase sqlQuery\n (string) $tabla = get_class($this); //obtengo el nombre de la clase para poder realizar la consulta\n switch ($datosCampos[\"acceso\"]) {\n case \"total\":\n $datosCampos[\"acceso\"] = 1;\n break;\n case \"restringido\":\n $datosCampos[\"acceso\"] = 2;\n break;\n default:\n $datosCampos[\"acceso\"] = 0;\n break;\n }\n $datosCampos[\"pass\"] = sha1(\"123\"); //agrego la contraseña en sha1 para que solicite el cambio cada vez que se cree un usuario\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza transaccion\n $rtaVerifUser = $this->refControladorPersistencia->ejecutarSentencia(\n $guardar->verificarExistenciaUsuario($tabla, $datosCampos[\"usuario\"])); //verifico si ya hay un usuario con ese nombre \n $existeUser = $rtaVerifUser->fetch(); //paso a un array\n $this->refControladorPersistencia->get_conexion()->commit(); //cierro\n if ($existeUser[0] == '0') {//solamente si el usuario no existe se comienza con la carga a la BD\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción\n $arrayCabecera = $guardar->meta($tabla); //armo la cabecera del array con los datos de la tabla de BD\n $sentencia = $guardar->armarSentencia($arrayCabecera, $tabla); //armo la sentencia\n $array = $guardar->armarArray($arrayCabecera, $datosCampos); //armo el array con los datos de la vista y los datos que obtuve de la BD \n array_shift($array); //remuevo el primer elemento id si es nuevo se genera automaticamente en la BD\n $this->refControladorPersistencia->ejecutarSentencia($sentencia, $array); //genero la consulta\n $this->refControladorPersistencia->get_conexion()->commit();\n $this->refControladorPersistencia->get_conexion()->beginTransaction();\n $ultimo = $guardar->buscarUltimo($tabla);\n $idUser = $this->refControladorPersistencia->ejecutarSentencia($ultimo); //busco el ultimo usuario para mostrarlo en la vista \n $id = $idUser->fetchColumn(); //array \n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit\n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n $respuesta = $this->getUsuario($id); //busco el usuario\n return $respuesta; //regreso\n } else {\n return $id = [\"incorrecto\" => \"incorrecto\"]; //si hubo un error volvemos a vista y corregimos\n }\n }",
"public function getContrasenia():string{return $this->contrasenia;}",
"public function SelecionaBanco()\r\n\t\t{\r\n\t\t\tmysql_select_db($this->banco);\r\n\t\t}",
"public function buscaCvePas(){\n /* Consulta usando ELOQUENT -> Trae al usuario si lo encuentra en la tabla usuarios */\n $usuario = Usuario::where([\n ['cuentaUsuario', $this->cuentaUsuario],\n ['contrasenia', $this->contrasenia]\n ])->first();\n return $usuario;\n }",
"public function bloquear(Request $request){\n\n \t$id_sesion=$request->id_sesion;\n \t$fila=$request->fila;\n \t$columna=$request->columna;\n \t$butacas_reservadas=$request->reservadas;\n\n \t$reservada=\"true\";\n \t//butacas bloqueadas\n \t$butaca=Butaca::where(\"sesion_id\",$id_sesion)->where(\"fila\",$fila)->where(\"sesion_id\",$columna)->first();\n\n \tif(!$butaca){\n\t \t//butacas reservadas:\n\t\t\t$butaca=Butaca::whereHas('sesion', function ($query) use ($id_sesion,$fila,$columna) {\n\t \t\t$query->where('sesion_id', $id_sesion);\n\t \t\t$query->where('fila', $fila);\n\t \t\t$query->where('columna', $columna);\n\t\t\t})->first();\n\n\t\t\tif($butaca){\n\n\t\t\t\tif($this->compruebaSiLaReservoYo($fila,$columna,$butacas_reservadas)){\n\t\t\t\t\t$butaca->delete();\t\t\t\t\t\n\t\t\t\t\t$reservada=\"desmarca\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$reservada=\"false\";\t\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else{\n\t\t\t\t$butaca=new Butaca([\n 'sesion_id' => $id_sesion,\n 'fila' => $fila,\n 'columna' => $columna,\n\t\t ]);\n\t\t $butaca->save();\n\n\t\t\t}\n\n \t}else{\n \t\tif($this->compruebaSiLaReservoYo($fila,$columna,$butacas_reservadas)){\n\t\t\t\t$butaca->delete();\t\t\n\t\t\t\t$reservada=\"desmarca\";\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$reservada=\"false\";\t\n\t\t\t}\n \t}\n \treturn $reservada;\n\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 criarBloco_1_Vazio()\n {\n $this->Sped->criarLinha('1', '1001', \"|1001|0|\");\n $this->Sped->criarLinha('1', '1010', \"|1010|N|N|N|N|N|N|N|N|N|N|N|N|N|\");\n $this->Sped->criarEncerramentoBloco('1', '1990', \"1990\");\n }",
"function synchronizeCuentaBancaria(){\n $this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n $this->transaccion='SIGEP_CUEN_BAN_SYNC';\n $this->tipo_procedimiento='IME';\n\n /************************************************ token ************************************************/\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://sigep.sigma.gob.bo/rsseguridad/apiseg/token?grant_type=refresh_token&client_id=0&redirect_uri=%2Fmodulo%2Fapiseg%2Fredirect&client_secret=0&refresh_token=FEA520426600:Wk5yBGCh5TeT8jUG5lPkwIT25Jmlwav5XqtxhCrmgr5Yc0iaAMPZgLILZZPC7mjxk5tUgVusBs0RXlSDkIuWq2qNat2KsUM3E4q7\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => array(\n \"cache-control: no-cache\",\n \"content-type: application/x-www-form-urlencoded\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $token_response = json_decode($response);\n $access_token = $token_response->{'access_token'};\n /************************************************ token ************************************************/\n\n /************************************************ perfil ************************************************/\n //$jsonConverter = new StandardConverter();\n $param_p = array(\"gestion\" => \"2022\", \"perfil\" => \"915\");\n //$param_p = $jsonConverter->encode($param_p);\n $param_p = json_encode($param_p);\n $curl_p = curl_init();\n\n $curl_array_p = array(\n CURLOPT_URL => 'https://sigep.sigma.gob.bo/rsbeneficiarios/api/cambiaperfil',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'PUT',\n CURLOPT_HTTPHEADER => array(\n \"Authorization: bearer \" . $access_token,\n \"Cache-Control: no-cache\",\n \"Content-Type: application/json\"\n ),\n CURLOPT_POSTFIELDS => $param_p\n );\n\n curl_setopt_array($curl_p,$curl_array_p);\n $response_p = curl_exec($curl_p);\n $err_p = curl_error($curl_p);\n $http_code_p = curl_getinfo( $curl_p, CURLINFO_HTTP_CODE );\n curl_close($curl_p);\n /************************************************ perfil ************************************************/\n\n /************************************************ cuentas ************************************************/\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://sigep.sigma.gob.bo/rsclasificadores/api/v1/cuentasbancarias/cuentabancaria?idEntidad=494&fechaConsulta=04-07-2022\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Authorization: bearer \" . $access_token,\n \"Cache-Control: no-cache\",\n \"Postman-Token: 011d15eb-f4ff-48db-85a6-1b380958342b\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n //var_dump('$response',/*curl_getinfo($curl),*/ json_decode($response)->data);exit;\n /************************************************ cuentas ************************************************/\n //$this->objParam->addParametro('jsonData', json_decode($response)->data);\n $this->arreglo['jsonData'] = json_encode(json_decode($response)->data);\n //Define los parametros para la funcion\n $this->setParametro('jsonData','jsonData','jsonb');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //echo ($this->consulta);exit;\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }",
"function eliminarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria_boa','id_cuenta_bancaria_boa','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function alterarPessoa(){\r\n $banco = conectarBanco();\r\n $sql = \"UPDATE pessoa SET\"\r\n .\" nome='{$_POST[\"nome\"]}', \"\r\n .\" nascimento='{$_POST[\"nascimento\"]}', \"\r\n .\" endereco='{$_POST[\"endereco\"]}', \"\r\n .\" telefone='{$_POST[\"telefone\"]}'\"\r\n .\" WHERE id='{$_POST[\"id\"]}'\";\r\n $banco->query($sql); // Passa a query fornecida em $sql para o banco de dados\r\n $banco->close(); // Fecha o banco de dados\r\n voltarMenu(); // Volta para a pagina inicial da agenda\r\n}",
"function alta_transferencia(){\n\t\t$u= new Cl_pedido();\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$u->cclientes_id=$GLOBALS['empresa_id'];\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t//Sincronizar con fecha de salida&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->ccl_estatus_pedido_id=2;\n\t\t$u->corigen_pedido_id=3;\n\t\t$u->ccl_tipo_pedido_id=2;\n\t\t// save with the related objects\n\t\tif($_POST['id']>0){\n\t\t\t$u->get_by_id($_POST['id']);\n\t\t\t$insert_traspaso_salida=0;\n\t\t} else {\n\t\t\t$insert_traspaso_salida=1;\n\t\t}\n\t\t$u->trans_begin();\n\t\tif($u->save()) {\n\t\t\t$cl_pedido_id=$u->id;\n\t\t\tif($insert_traspaso_salida==1) {\n\t\t\t\t//Dar de alta el traspaso\n\t\t\t\t$t= new Traspaso();\n\t\t\t\t$t->cl_pedido_id=$cl_pedido_id;\n\t\t\t\t$t->traspaso_estatus=1;\n\t\t\t\t$t->ubicacion_entrada_id=$_POST['ubicacion_entrada_id'];\n\t\t\t\t$t->ubicacion_salida_id=$_POST['ubicacion_salida_id'];\n\t\t\t\t$t->trans_begin();\n\t\t\t\t$t->save();\n\t\t\t\tif ($t->trans_status() === FALSE) {\n\t\t\t\t\t// Transaction failed, rollback\n\t\t\t\t\t$t->trans_rollback();\n\t\t\t\t\t$u->trans_rollback();\n\t\t\t\t\t// Add error message\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<button type=\"submit\" style=\"display:none;\" id=\"boton1\">Intentar de nuevo</button><br/>';\n\t\t\t\t\techo \"El alta del traspaso no pudo registrarse, intente de nuevo\";\n\t\t\t\t} else {\n\t\t\t\t\t// Transaction successful, commit\n\t\t\t\t\t$u->trans_commit();\n\t\t\t\t\t$t->trans_commit();\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//Actualisar unicamente la tabla de los detalles\n\t\t\t\t$u->trans_commit();\n\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t}\n\t\t} else {\n\t\t\t$u->trans_rollback();\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}",
"function bancos($periodo,$ejer,$moneda){\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,sum(m.Importe) importe,m.TipoMovto,c.description,p.relacionExt,p.concepto\n\t\t\tfrom cont_movimientos m,cont_polizas p,cont_accounts c,cont_config conf\n\t\t\twhere m.cuenta=c.account_id and c.currency_id=\".$moneda.\" and p.idejercicio=\".$ejer.\" and c.`main_father`=conf.CuentaBancos and p.idtipopoliza!=3\n\t\t\tand m.IdPoliza=p.id and p.idperiodo in (\".$periodo.\",\".($periodo-=1).\") and p.activo=1 and m.Activo=1\n\t\t\tgroup by m.Cuenta,m.TipoMovto\");\n\t\t\treturn $sql;\n\t\t}",
"public function buscar() {\n $buscarUsuario = new SqlQuery(); //instancio la clase\n (string) $tabla = get_class($this); //uso el nombre de la clase que debe coincidir con la BD \n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción\n $statement = $this->refControladorPersistencia->ejecutarSentencia(\n $buscarUsuario->buscar($tabla)); //senencia armada desde la clase SqlQuery sirve para comenzar la busqueda\n $arrayUsuario = $statement->fetchAll(PDO::FETCH_ASSOC); //retorna un array asociativo para no duplicar datos\n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit\n return $arrayUsuario; //regreso el array para poder mostrar los datos en la vista... con Ajax... y dataTable de JavaScript\n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n }\n }",
"public function bayar_akad()\n {\n $type = request('type');\n $input = $this->request->except('_token');\n\n $dataAkad = $this->akad->where('id_akad', request('id_akad'))->first();\n $updateAkad = $this->akad->where('id_akad', request('id_akad'));\n $dataNasabah= $this->nasabah->where('key_nasabah', $dataAkad->key_nasabah)->first();\n\n if(request('from') == request('until')){\n $keterangan = 'KE '.request('from');\n $this->request['bt_yang_dibayar'] = request('from');\n }else{\n $keterangan = 'KE '.request('from').'-'.request('until');\n $this->request['bt_yang_dibayar'] = request('from');\n }\n\n if($type == 'lelang'){\n //'memperbaharui biaya admin dengan biaya admin lelang'\n $updateAkad->update([\n 'biaya_admin' => request('admin_lelang'),\n ]); \n\n $jumlah = request('nilai_pengembalian');\n $uraian = 'Pembayaran Lelang';\n $id_cabang = $dataAkad->id_cabang;\n\n $data = (object) compact('jumlah', 'uraian', 'id_cabang');\n\n $this->insert_refund($data);\n $this->insert_kas_cabang($dataAkad, 'create');\n $this->insert_log_kas_cabang($dataAkad, $dataNasabah, 'create');\n }\n\n if($type == 'pelunasan' || $type == 'lelang'){\n // 'status akad menjadi lunas jika dari tombol pelunasan'\n $updateAkad->update([\n 'status' => 'Lunas'\n ]);\n\n $id_cabang = $dataAkad->id_cabang;\n $nilai_pencairan = request('nilai_pencairan');\n\n $data = (object) compact('id_cabang', 'nilai_pencairan');\n\n $this->insert_saldo_cabang($data, 'tambah', 'create');\n $this->insert_log_saldo_cabang($dataAkad, $dataNasabah, 'create');\n }\n\n if($type == 'perpanjangan'){\n $tanggal_jatuh_tempo = Carbon::parse($dataAkad->tanggal_jatuh_tempo)->addDays(7)->format('Y-m-d');\n $updateAkad->update([\n 'tanggal_jatuh_tempo' => $tanggal_jatuh_tempo,\n ]);\n }\n \n $this->insert_bea_titip($dataAkad, $keterangan, 'create');\n }",
"public function simpanPembelian()\n {\n $this->scenario = 'simpanPembelian';\n $transaction = $this->dbConnection->beginTransaction();\n\n /* Untuk jumlah pembelian yang sangat banyak, misal: init data */\n if ($this->profil_id == 1) {\n ini_set('memory_limit', '-1');\n set_time_limit(0);\n }\n\n try {\n if ($this->save()) {\n /*\n * Ambil data barang, dan data inventory terakhir/terbaru nya\n * Jika inventory tidak ada, maka ib.* nilainya null\n */\n $details = PembelianDetail::model()->findAll('pembelian_id=:pembelianId', array(':pembelianId' => $this->id));\n foreach ($details as $detail) {\n /* Untuk setiap barang yang dibeli */\n\n /* Sesuaikan inventory */\n $inventoryBalance = new InventoryBalance();\n $inventoryBalance->beli(InventoryBalance::ASAL_PEMBELIAN, $this->nomor, $detail->id, $detail->barang_id, $detail->harga_beli, $detail->qty);\n\n /*\n * Update harga jual\n */\n if (!HargaJual::model()->updateHarga($detail->barang_id, $detail->harga_jual)) {\n throw new Exception(\"Gagal Update Harga Jual\");\n }\n /*\n * Update Rrp\n */\n if (!HargaJualRekomendasi::model()->updateHarga($detail->barang_id, $detail->harga_jual_rekomendasi)) {\n throw new Exception(\"Gagal Update RRP\");\n }\n\n /* Tambahkan supplier ke barang ini, jika belum ada */\n $supplierBarangAda = SupplierBarang::model()->find(\"supplier_id={$this->profil_id} and barang_id = {$detail->barang_id}\");\n if (is_null($supplierBarangAda)) {\n $supplierBarang = new SupplierBarang;\n $supplierBarang->barang_id = $detail->barang_id;\n $supplierBarang->supplier_id = $this->profil_id;\n if (!$supplierBarang->save()) {\n throw new Exception(\"Gagal simpan supplier barang\");\n }\n }\n\n /* Set Barang menjadi aktif */\n Barang::model()->updateByPk($detail->barang_id, ['status'=>Barang::STATUS_AKTIF]);\n }\n\n // Total dari pembelian barang\n // Jika nanti ada item lain, misal: Transport, pajak, dll\n // ditambahkan di sini\n $jumlahPembelian = $this->ambilTotal();\n /*\n * Create (hutang)\n */\n $hutang = new HutangPiutang;\n $hutang->profil_id = $this->profil_id;\n $hutang->jumlah = $jumlahPembelian;\n $hutang->tipe = HutangPiutang::TIPE_HUTANG;\n $hutang->asal = HutangPiutang::DARI_PEMBELIAN;\n $hutang->nomor_dokumen_asal = $this->nomor;\n if (!$hutang->save()) {\n throw new Exception(\"Gagal simpan hutang\");\n }\n\n /*\n * Hutang Detail\n */\n $hutangDetail = new HutangPiutangDetail;\n $hutangDetail->hutang_piutang_id = $hutang->id;\n $hutangDetail->keterangan = 'Pembelian: ' . $this->nomor;\n $hutangDetail->jumlah = $jumlahPembelian;\n if (!$hutangDetail->save()) {\n throw new Exception(\"Gagal simpan hutang detail\");\n }\n\n /*\n * Simpan hutang_id ke pembelian\n */\n if (!Pembelian::model()->updateByPk($this->id, array('hutang_piutang_id' => $hutang->id)) > 1) {\n throw new Exception(\"Gagal simpan hutang_id\");\n }\n\n $transaction->commit();\n return array('sukses' => true);\n } else {\n throw new Exception(\"Gagal Simpan Pembelian\");\n }\n } catch (Exception $ex) {\n $transaction->rollback();\n // throw $up;\n\n return array(\n 'sukses' => false,\n 'error' => array(\n 'msg' => $ex->getMessage(),\n 'code' => $ex->getCode(),\n ));\n }\n }",
"public function persist (){\n \n $this->query = \"INSERT INTO libros(titulo,autor,editorial) VALUES (:titulo, :autor, :editorial)\";\n\n // $this->parametros['id']=$user_data[\"id\"];\n $this->parametros['titulo']=$this->titulo;\n $this->parametros['autor']=$this->autor;\n $this->parametros['editorial']=$this->editorial;\n \n $this->get_results_from_query();\n\n\n $this->mensaje = \"Libro agregado exitosamente\";\n \n }",
"public function enfocarCamaraPresidencia() {\n\n self::$presidencia->enfocar();\n\n }",
"public function asociar($id_activo, $id_maleza){\n\n $activo = Activo::find($id_activo);\n $activo->malezas()->attach($id_maleza);\n\n Session::flash(\"mensaje\",[\"contenido\"=>\"Registro Correcto\", \"color\" => \"green\"]);\n return redirect()->back();\n\n\n }",
"public function AdmEstudianteBloquearUsuario($id_usuario)\n {\n $usuario=User::find($id_usuario);\n $usuario->estado =0;\n $usuario->save();\n return redirect()->back();\n }",
"public function _enviar(){\n $id = $this->obj_m->_salvar();\n \n # Enviar o e-mail\n $obj_e = new \\Email();\n $obj_e->_enviar(\"{$this->obj_m->orcamento_info_email};[email protected]\", '['. \\DL::$ap_nome .'] Orcamento on-line', $this->_emailhtml($id));\n $obj_e->_gravarlog(__CLASS__, $this->obj_m->bd_tabela, $this->obj_m->orcamento_id);\n \n return \\Funcoes::_retornar(SUCESSO_ORCAMENTO_ENVIAR, 'sucesso');\n }",
"public function anamneseAction(){\n $id = (int) $this->getRequest()->getParam('id');\n $request = $this->getRequest();\n $anamnese = $this->_anamnese->fetchRow(\"cli_codigo_fk='$id' \", null);\n $dados = $this->getRequest()->getParams();\n \n if(isset($anamnese)){\n\n\n try {\n\n\n $anamnese->ana_queixa_principal=$dados[\"ana_queixa_principal\"];\n $anamnese->ana_diagnostico_clinico=$dados[\"ana_diagnostico_clinico\"];\n $anamnese->ana_diagnostico_cinetico_funcional=$dados[\"ana_diagnostico_cinetico_funcional\"];\n $anamnese->ana_hda=$dados[\"ana_hda\"];\n $anamnese->ana_medico_responsavel=$dados[\"ana_medico_responsavel\"];\n $anamnese->ana_peso=$dados[\"ana_peso\"];\n $anamnese->ana_consideracoes=$dados[\"ana_consideracoes\"];\n \n $anamnese->save();\n \n \n $this->_helper->flashMessenger('<div class=\"alert alert-info fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Anamnese editada!</strong>\n Anamnese editada com sucesso!\n </div>');\n \n $this->_redirect('/cliente/ficha/id/' .$id);\n \n\n } catch (Zend_Db_Exception $e) {\n \n // echo $e->getMessage();\n // exit;\n \n $this->_dbAdapter->rollBack();\n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">x</button>\n <strong>Ocorreu um erro!</strong>\n Se o erro persistir entre em contato com o suporte!\n </div>');\n\n $this->_redirect('/cliente/ficha/id/' .$id);\n }\n\n\n \n }else{\n\n if ($request->isPost()) {\n\n $this->_dbAdapter->beginTransaction();\n\n $anamnese=array(\n \"ana_queixa_principal\"=>$dados[\"ana_queixa_principal\"],\n \"ana_diagnostico_clinico\"=>$dados[\"ana_diagnostico_clinico\"],\n \"ana_diagnostico_cinetico_funcional\"=>$dados[\"ana_diagnostico_cinetico_funcional\"],\n \"ana_hda\"=>$dados[\"ana_hda\"],\n \"ana_hf\"=>$dados[\"ana_hf\"],\n \"ana_medico_responsavel\"=>$dados[\"ana_medico_responsavel\"],\n \"ana_peso\"=>$dados[\"ana_peso\"],\n \"ana_consideracoes\"=>$dados[\"ana_consideracoes\"],\n \"cli_codigo_fk\"=>$id,\n );\n\n try {\n \n \n $lastId = $this->_anamnese->insert($anamnese);\n\n $this->_dbAdapter->commit();\n \n \n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert alert-info fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Anamnese adicionada!</strong>\n Anamnese adicionada com sucesso!\n </div>');\n \n $this->_redirect('/cliente/ficha/id/' . $id);\n exit;\n \n } catch (Zend_Db_Exception $e) {\n \n // echo $e->getMessage();\n // exit;\n \n $this->_dbAdapter->rollBack();\n $flashMessenger = $this->_helper->FlashMessenger;\n $flashMessenger->addMessage('<div class=\"alert fade in\">\n <button class=\"close\" data-dismiss=\"alert\" type=\"button\">x</button>\n <strong>Ocorreu um erro!</strong>\n Se o erro persistir entre em contato com o suporte!\n </div>');\n\n $this->_helper->redirector('index');\n }\n\n }\n\n }\n\n\n }",
"public function banco()\n {\n return $this->HasOne('\\App\\Banco', 'id', 'fk_banco_id');\n }",
"function insertAbonne($code,$nom,$prenom,$rue,$codepostal,$ville,$batiment=null,$etage=null,$digicode=null,$tel=null,$mail=null,$banque,$guichet,$compte){\n\t\tglobal $serv;\n\t\t$req = \"INSERT INTO abonnes VALUES('$code','$nom','$prenom','$rue','$codepostal','$ville','$batiment','$etage','$digicode','$tel','$mail',$banque,$guichet,'$compte',0);\";\n\t\t$res = db_execSQL($req,$serv);\n\t}",
"public function getBanco() {\n return $this->banco;\n }",
"public function getBancoUrl()\t{\n\t\treturn 'https://geraboleto.sicoobnet.com.br/geradorBoleto/GerarBoleto.do';\n\t}",
"public function savePoblacion(){\n \n $data_insert = [\n 'poblacion' =>$this->_poblacion,\n'provincia' =>$this->_provincia,\n'ccaa' =>$this->_ccaa,\n'cod_provincia' =>$this->_cod_provincia,\n'cod_ccaa' =>$this->_cod_ccaa,\n \n ];\n return parent::save($data_insert);\n \n }",
"public function cadastrar(){\r\n //DEFINIR A DATA DE CADASTRO\r\n $this->cadastro = date('Y-m-d H:i:s');\r\n\r\n $db = new Database('cartao');\r\n $this->id = $db->insert([\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n\r\n }",
"public function atualizaBD($Tabela,$Set,$Condicao,$Parametros){\n $this->prepareStatments(\"UPDATE {$Tabela} SET {$Set} WHERE {$Condicao}\", $Parametros);\n return $this->crud;\n }",
"public function modelDoAdd(){\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"insert into phongban set tenphongban=:ten\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban));\n\t\t}",
"function InscricaoAvaliacao($codAtividade, $codAluno){\n\n }",
"public function achat($id_perso,$id_objet) :void {\n $req = $this->pdo->prepare(\"INSERT INTO inventaire (id_perso, id_objet) \n VALUES (:id_perso, :id_objet)\n \");\n $req->execute([\n \":id_perso\"=>$id_perso,\n \":id_objet\"=>$id_objet\n ]);\n $req2 = $this->pdo->prepare(\"UPDATE personnage \n INNER JOIN inventaire on personnage.id_perso = inventaire.id_perso\n INNER JOIN objet on inventaire.id_objet = objet.id_objet\n SET po = (po - objet.pa)\n WHERE objet.id_objet = :id_objet\");\n $req2->execute([\n \":id_objet\" => $id_objet\n ]);\n }",
"function insertarBuques($nombre) {\r\n$sql = \"insert into tbbuques(idbuque,nombre)\r\nvalues ('','\".($nombre).\"')\";\r\n$res = $this->query($sql,1);\r\nreturn $res;\r\n}",
"public function __construct() {\n//fonction de connexion a ma base de donnéer \n //ordi formation\n $this->pdo = dataBase::getIntance();\n\n\n // Sinon on affiche un message d'erreur\n //il les faut pour faire les transaction (3 prochaine methode)\n }",
"function commandes_bank_traiter_reglement($flux){\r\n\t// Si on est dans le bon cas d'un paiement de commande et qu'il y a un id_commande et que la commande existe toujours\r\n\tif (\r\n\t\t$id_transaction = $flux['args']['id_transaction']\r\n\t\tand $transaction = sql_fetsel(\"*\",\"spip_transactions\",\"id_transaction=\".intval($id_transaction))\r\n\t\tand $id_commande = $transaction['id_commande']\r\n\t\tand $commande = sql_fetsel('id_commande, statut, id_auteur, echeances, reference', 'spip_commandes', 'id_commande='.intval($id_commande))\r\n\t){\r\n\t\t$statut_commande = $commande['statut'];\r\n\t\t$montant_regle = $transaction['montant_regle'];\r\n\t\t$transaction_mode = $transaction['mode'];\r\n\t\t$statut_nouveau = 'paye';\r\n\r\n\r\n\t\t// Si la commande n'a pas d'échéance, le montant attendu est celui du prix de la commande\r\n\t\tinclude_spip('inc/commandes_echeances');\r\n\t\tif (!$commande['echeances']\r\n\t\t\tor !$echeances = unserialize($commande['echeances'])\r\n\t\t or !$desc = commandes_trouver_prochaine_echeance_desc($id_commande, $echeances, true)\r\n\t\t or !isset($desc['montant'])) {\r\n\t\t\t$fonction_prix = charger_fonction('prix', 'inc/');\r\n\t\t\t$montant_attendu = $fonction_prix('commande', $id_commande);\r\n\t\t}\r\n\t\t// Sinon le montant attendu est celui de la prochaine échéance (en ignorant la dernière transaction OK que justement on cherche à tester)\r\n\t\telse {\r\n\t\t\t$montant_attendu = $desc['montant'];\r\n\t\t}\r\n\t\tspip_log(\"commande #$id_commande attendu:$montant_attendu regle:$montant_regle\", 'commandes');\r\n\r\n\t\t// Si le plugin n'était pas déjà en payé et qu'on a pas assez payé\r\n\t\t// (si le plugin était déjà en payé, ce sont possiblement des renouvellements)\r\n\t\tif (\r\n\t\t\t$statut_commande != 'paye'\r\n\t\t\tand (floatval($montant_attendu) - floatval($montant_regle)) >= 0.01\r\n\t\t){\r\n\t\t\t$statut_nouveau = 'partiel';\r\n\t\t}\r\n\t\t\r\n\t\t// S'il y a bien un statut à changer\r\n\t\tif ($statut_nouveau !== $statut_commande){\r\n\t\t\tspip_log(\"commandes_bank_traiter_reglement marquer la commande #$id_commande statut: $statut_commande -> $statut_nouveau mode=$transaction_mode\",'commandes');\r\n\t\t\t// On met a jour la commande\r\n\t\t\tinclude_spip(\"action/editer_commande\");\r\n\t\t\tcommande_modifier($id_commande, array('statut'=>$statut_nouveau, 'mode'=>$transaction_mode));\r\n\t\t}\r\n\r\n\t\t// un message gentil pour l'utilisateur qui vient de payer, on lui rappelle son numero de commande\r\n\t\t$flux['data'] .= \"<br />\"._T('commandes:merci_de_votre_commande_paiement',array('reference'=>$commande['reference']));\r\n\t}\r\n\r\n\treturn $flux;\r\n}",
"public function addberita()\n\t{\n\t\t# code...\n\t\t$data_sender = $this->input->post('data_sender');\n//\t\tprint_r($data_sender);die();\t\t\n\t\t$this->Allcrud->addData('berita',$data_sender);\n\t}",
"public function CreditosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.tipopagove, ventas.formapagove, ventas.fechaventa, ventas.fechavencecredito, ventas.statusventa, usuarios.nombres, cajas.nrocaja, abonoscreditos.codventa as cod, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (ventas LEFT JOIN clientes ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE ventas.codventa =? GROUP BY cod\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}",
"public function bloquearUsuario() {\n\t\t$this->id_status = self::STATUS_BLOCKED;\n\t\treturn $this->save () ? $this : null;\n\t}",
"public function insert($mambot);",
"public function bloquear(Request $request, $id)// validando os valores e pegando o ID\n\t{\n\t\tWP_Users::where('ID', $id)->update(array('user_status' => 1, 'updated_at' => date(\"Y-m-d H:i:s\")));\n\t\t\n\t\t//registrando a ocorrencia na tabela acao:\n\t\t$acao = new Acoes;\n\t\t$acao->id_usuario = \\Request::session()->get('id_usuario');\n\t\t$acao->acao = 'Bloqueio de Usuário';\n\t\t$acao->link = 'medicos/detalhes/'.$id;\n\t\t$acao->save();\n\t\t//redirecionando de acordo com o resultado do update\n\t\treturn redirect('/medicos/cadastrados'); //redireciona para a listagem\n }",
"public function atualizar(){\r\n return (new Database('cartao'))->update(' id = '.$this->id, [\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n }",
"public function editar()\n {\n if ($this->session->userdata['usuariologado']['permissoes']['e_bancos'] != 1) {\n redirect('erro/negado');\n }\n /*Fim do bloqueio de acesso*/\n\n $id_encript = $this->uri->segment(3);\n $id = $this->encript->decriptar($id_encript);\n\n if ($id) {\n\n $dados['msg'] = '';\n if (isset($_POST['btn_salvar'])) {\n\n $this->banco_model->setId($id);\n $this->banco_model->setNome($this->funcoes->validar_input($this->input->post(\"nome\")));\n //$this->banco_model->setIdEmpresa($this->session->userdata['usuariologado']['empresa']);\n $this->banco_model->setIdAlteracao($this->session->userdata['usuariologado']['id']);\n date_default_timezone_set('America/Bahia');\n $this->banco_model->setDataAlteracao(date('Y-m-d H:i:s'));\n\n $result = $this->banco_model->editar();\n\n if ($result) {\n\n $this->session->set_flashdata('msg_alerta', 2);\n\n $this->log_model->setIdUsuario($this->session->userdata['usuariologado']['id']);\n date_default_timezone_set('America/Bahia');\n $this->log_model->setDataHoraAcao(date('Y-m-d H:i:s'));\n $this->log_model->setAcaoExecutada(\"Editou Banco\");\n $ip_do_usuario = $this->funcoes->getUserIP();\n $this->log_model->setIpAcesso($ip_do_usuario);\n $result = $this->log_model->acao();\n\n redirect('bancos/editar/' . $id_encript);\n } else {\n\n $this->session->set_flashdata('msg_titulo', 'ERRO!');\n $this->session->set_flashdata('msg_conteudo', 'Não foi possível editar.');\n $this->session->set_flashdata('msg_tipo', 'danger');\n }\n\n redirect('bancos');\n } else {\n\n $this->log_model->setIdUsuario($this->session->userdata['usuariologado']['id']);\n date_default_timezone_set('America/Bahia');\n $this->log_model->setDataHoraAcao(date('Y-m-d H:i:s'));\n $this->log_model->setAcaoExecutada(\"Tela de Editar Banco\");\n $ip_do_usuario = $this->funcoes->getUserIP();\n $this->log_model->setIpAcesso($ip_do_usuario);\n $result = $this->log_model->acao();\n }\n\n\n $this->banco_model->setId($id);\n $dados['banco'] = $this->banco_model->pesquisar_banco_id();\n $dados['id'] = $id_encript;\n\n $this->exibir('banco_editar', $dados);\n } else {\n redirect('bancos');\n } //fim if else verificacao id\n }",
"public function createIntern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => 'required|regex:/^THW[0-9]{6}DZD$/|exists:accounts,number',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo more validation\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n //create the transfer\n $commission = config('commission.COUR_COUR') * $amount;\n $now = \\Carbon\\Carbon::now();\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,//todo put it negative !!\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //receiver history\n BalanceHistory::create([\n 'id' => $nb + 2,\n 'amount' => $amount,\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'in',\n 'account_id' => $request->input('receiver.account'),\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n //change the amount of the destination client just in case of < 200 000 else till validation\n $receiverAccount = Account::find($request->input('receiver.account'));\n $receiverAccount->balance = $receiverAccount->balance + $amount;\n $receiverAccount->save();\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n\n InternTransfer::create([\n 'code' => $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi'),\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'transfers_type' => 'vir_client',\n 'commission' => $commission,\n 'source_id' => $senderAccount->number,\n 'destination_id' => $request->input('receiver.account'),\n ]);\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }",
"public function modificar($datosCampos) {\n $guardar = new SqlQuery(); //instancio objeto de la clase sqlQuery\n (string) $tabla = get_class($this); //obtengo el nombre de la clase para poder realizar la consulta\n $id = $datosCampos[\"id\"];\n switch ($datosCampos[\"acceso\"]) //cambio los dato que vienen de la vista\n {\n case \"total\":\n $datosCampos[\"acceso\"] = 1;\n break;\n case \"restringido\":\n $datosCampos[\"acceso\"] = 2;\n break;\n default:\n $datosCampos[\"acceso\"] = 0;\n break;\n }\n try {\n $this->refControladorPersistencia->get_conexion()->beginTransaction(); //comienza la transacción \n $arrayCabecera = $guardar->meta($tabla);//armo el array con la cabecera de los datos\n $sentencia = $guardar->armarSentenciaModificar($arrayCabecera, $tabla);//genero sentencia\n $array = $guardar->armarArray($arrayCabecera, $datosCampos);//Armo el array con los datos que vienen de la vista y la cabecera de la BD\n array_shift($array);//elimino primer elemento del array que es el id\n array_push($array, $id);//agrego el id al final del array para realizar la consulta\n $this->refControladorPersistencia->ejecutarSentencia($sentencia, $array);//genero la consulta a la BD \n $this->refControladorPersistencia->get_conexion()->commit(); //si todo salió bien hace el commit \n } catch (PDOException $excepcionPDO) {\n echo \"<br>Error PDO: \" . $excepcionPDO->getTraceAsString() . '<br>';\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si salio mal hace un rollback\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->refControladorPersistencia->get_conexion()->rollBack(); //si hay algún error hace rollback\n }\n $respuesta = $this->getUsuario($id);\n return $respuesta;\n }",
"function formidablepaiement_bank_traiter_reglement($flux){\n\n\t// si c'est une transaction associee a un form\n\tif ($id_transaction = $flux['args']['id_transaction']\n\t AND preg_match(\",form\\d+:,\",$flux['args']['avant']['parrain'])\n\t AND $id_formulaires_reponse = $flux['args']['avant']['tracking_id']){\n\n\t\t$reponse = sql_fetsel('*','spip_formulaires_reponses','id_formulaires_reponse='.intval($id_formulaires_reponse));\n\t\t$formulaire = sql_fetsel('*','spip_formulaires','id_formulaire='.intval($reponse['id_formulaire']));\n\n\t\t$traitements = unserialize($formulaire['traitements']);\n\t\tif ($message = trim($traitements['paiement']['message'])){\n\t\t\tinclude_spip(\"inc/texte\");\n\t\t\t$flux['data'] .= propre($message);\n\t\t}\n\t}\n\n\treturn $flux;\n}",
"public function contrato()\r\n\t{\r\n\t}",
"function criarMovimentacao() {\n $movimentacao = new Movimentacoes();\n $movimentacao->valor = $this->valor;\n $movimentacao->tipo = 'E';\n $movimentacao->faturas_id = $this->id;\n $movimentacao->contas_bancarias_id = $this->contas_bancarias_id;\n $movimentacao->save();\n }",
"function invocar($local, $id, $modo, $dono, $tipo, $gatilho = 'ataque_monstro') {\n \tparent::invocar($local, $id, MODOS::ATAQUE_BAIXO, $dono, $tipo, 'ataque_monstro');\n }",
"public function pesquisarMembroDao($obj){\r\n \r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objConexao = Connection::getInstance();\r\n $objMembro = new objetoMembro();\r\n \r\n $busca = mysql_query(\"Select * from membros where Nome like '%$obj%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $reg = mysql_fetch_assoc($busca);\r\n \r\n\tif($reg != \"\"){\r\n\r\n $objMembro->setMatricula($reg['Matricula']); $objMembro->setNome($reg['Nome']);\r\n $objMembro->setSexo($reg['Sexo']); $objMembro->setData($reg['DataNascimento1']); $objMembro->setRg($reg['Rg']);\r\n $objMembro->setCpf($reg['Cpf']); $objMembro->setEstadocivil($reg['EstadoCivil']);\r\n $objMembro->setNatural($reg['Naturalidade']); $objMembro->setProfissao($reg['Profissao']); $objMembro->setEscola($reg['Escolaridade']); \r\n $objMembro->setPai($reg['Pai']); $objMembro->setMae($reg['Mae']); $objMembro->setNecessidade($reg['NecessidadeEspeciais']);\r\n\t $objMembro->setFone($reg['Fone']); $objMembro->setFilho($reg['Filho']); $objMembro->setFormacao($reg['FormacaoEclesiatica']);\r\n $objMembro->setMembrasia($reg['IntegracaoMembrasia']); $objMembro->setFuncao($reg['Funcao']); $objMembro->setParticipou($reg['JaParticipou']);\r\n\t $objMembro->setTrabalhando($reg['Trabalhando']); $objMembro->setViajando($reg['EstadoAtual']); $objMembro->setCongrega($reg['Congrega']); \r\n $objMembro->setRua($reg['Rua']); $objMembro->setBairro($reg['Bairro']); $objMembro->setCasa($reg['Casa']); $objMembro->setStatus($reg['Status']);\r\n $objMembro->setEmail($reg['tx_email']);\r\n $objMembro->setLider($reg['LiderCelula']);\r\n\r\n return $objMembro;\r\n }\r\n else{\r\n \r\n }\r\n \r\n mysql_free_result($busca); //limpa o resultado da pesquisa libera a memoria ocupado\r\n $objConexao->freebanco(); // fecha a conec��o com o banco\r\n\r\n }"
] | [
"0.630084",
"0.6191172",
"0.61383504",
"0.6042201",
"0.60011816",
"0.59744155",
"0.59534425",
"0.58861715",
"0.5880872",
"0.5880231",
"0.5832405",
"0.58148044",
"0.57617664",
"0.5758386",
"0.57289135",
"0.5688265",
"0.5670893",
"0.5623024",
"0.5613273",
"0.5588331",
"0.5569288",
"0.553272",
"0.5524056",
"0.5513027",
"0.547612",
"0.5473477",
"0.5473257",
"0.5472855",
"0.5472301",
"0.54522395",
"0.54508245",
"0.54505",
"0.54400295",
"0.5433507",
"0.5432541",
"0.5427431",
"0.54137564",
"0.54093355",
"0.5399654",
"0.5396256",
"0.5388834",
"0.53870755",
"0.53787845",
"0.53755426",
"0.5373976",
"0.5373622",
"0.53471696",
"0.5336718",
"0.5334001",
"0.5327722",
"0.53243536",
"0.5320092",
"0.53190213",
"0.5318123",
"0.5304536",
"0.5304387",
"0.53032756",
"0.5301779",
"0.5292519",
"0.52922225",
"0.52911586",
"0.52881646",
"0.5286908",
"0.52854985",
"0.52820957",
"0.52772653",
"0.52732515",
"0.5271297",
"0.5269535",
"0.52676654",
"0.52593243",
"0.5254553",
"0.5249509",
"0.52453446",
"0.5244884",
"0.52446145",
"0.52437115",
"0.5241481",
"0.52407444",
"0.5234328",
"0.52332145",
"0.5232241",
"0.52289087",
"0.5224065",
"0.52218634",
"0.52156454",
"0.5213266",
"0.5212678",
"0.5212568",
"0.5207662",
"0.5205671",
"0.5205065",
"0.52030957",
"0.52030647",
"0.5197666",
"0.5194451",
"0.51918894",
"0.5190932",
"0.5189771",
"0.5189039",
"0.5188781"
] | 0.0 | -1 |
Deleta um registro existente. | public function Deletar(){
$idFrota = $_GET['id'];
$frota = new Frota();
$frota->id = $idFrota ;
$frota::Delete($frota);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }",
"private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}",
"public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }",
"public function delete() {\n\t\ttry {\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$sql = 'DELETE FROM ' . self::sanitize($this->_table->getProperty('name')) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t\t\\Bedrock\\Common\\Logger::info('Deleting record with query: ' . $sql); echo $sql;\n\t\t\t\t$this->_connection->exec($sql);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_CHANGED) {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Unsaved changes found, cannot delete record.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Record not found in database.');\n\t\t\t}\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('A database error was encountered, the record could not be deleted.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The record could not be deleted.');\n\t\t}\n\t}",
"public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }",
"public function delete()\n {\n $result = true;\n // Внимание, если запись новая,\n // то НЕ БУДЕТ вызвано исключение\n if (!$this->isNewRecord) {\n $this->setDeletedRedis();\n $result = parent::delete();\n }\n $this->deleteRedis();\n if (!$this->isNewRecord) {\n $this->unsetDeletedRedis();\n }\n\n return $result;\n }",
"public function delete()\n {\n // If deposit is existing, will get database ID removed.\n $this->dbID = $this->db->deleteDeposit($this);\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"public function delete(){\n\t\t$sql = new Sql();\n\t\t$sql->query(\"DELETE FROM TB_USUARIOS WHERE idusuario=:ID\", array(\n\t\t\t':ID'=>$this->getIdusuario()\n\t\t));\n\n\t\t$this->setIdusuario(null);\n\t\t$this->setDeslogin(null);\n\t\t$this->setDessenha(null);\n\t\t$this->setDtcadastro(new DateTime());\n\t}",
"public function excluir(){\r\n return (new Database('atividades'))->delete('id = '.$this->id);\r\n }",
"function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}",
"public function delete() {\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\tif (! isset ( $this->id )) {\r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$dsh_id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with primary key of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE dsh_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\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 delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }",
"public function delete()\r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"DELETE FROM puesto WHERE idPue = {$this->idPue};\");\r\n }",
"public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }",
"public function delete()\n {\n $this->repository->delete($this->id);\n }",
"public function deleteEntidad(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_entidades WHERE entidad_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }",
"public function excluir(){\r\n return (new Database('cartao'))->delete('id = '.$this->id);\r\n }",
"public function delete() {\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\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$sql = \"DELETE FROM $this->sqlTable \";\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $this->id );\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: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql );\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\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}",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }",
"public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }",
"public function delete(){\n\t\t\t$sql = new sql();\n\n\t\t\t$sql->query(\"DELETE FROM tb_usuarios WHERE idusuario= :ID\", array(\n\t\t\t\t\":ID\"=>$this->getIdusuario()\n\t\t\t));\n\n\t\t\t$this->setIdusuario(0);\n\t\t\t$this->setDeslogim(\"\");\n\t\t\t$this->setDessenha(\"\");\n\t\t\t$this->setDtcadastro(new DateTime());\n\t\t}",
"public function delete(){\n \t\ttry{\n \t\t\t$db = DB::get();\n \t\t\t$sql = \"UPDATE t_\" . self::$Table . \" \n \t\t\t\t\tSET \" . self::$Table . \"_supprime='1' \n \t\t\t\t\tWHERE \" . self::$Table . \"_id = '\".$this->Id.\"' \";\n \t\t\n \t\t\t$result = $db->query($sql);\n \t\t}\n \t\tcatch(Exception $e){\n \t\t\tvar_dump($e->getMessage());\n \t\t}\n }",
"public function eliminar() {\n $fecha = $this->fecha;\n return ($fecha) ? Funciones::gEjecutarSQL(\"DELETE FROM ASISTENTES WHERE FECHA='$fecha'\") : FALSE;\n }",
"public function delete()\n {\n DB::transaction(function () {\n $this->devedores()->delete();\n parent::delete();\n });\n }",
"public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }",
"function delete() {\n $this->that->delete($this->id, $this->name);\n $this->put_id();\n }",
"public function delete(){\n return (new Database('cliente'))->delete('id = '.$this->id);\n }",
"function Delete(){\n if(isset($this->legajo)){\n $this->DeleteBy([\"legajo = \".$this->legajo]);\n return true;\n }\n return false;\n }",
"public function delete()\n {\n if(is_null($this->student)){\n $this->employee()->delete();\n }else{\n $this->student()->delete();\n }\n return parent::delete();\n }",
"public function excluir()\n {\n return (new Database('vagas'))->delete('id = '.$this->id);\n }",
"public function delete()\n {\n $this->_validateModifiable();\n\n $this->_getDataSource()->delete($this);\n }",
"public function testResetOfExistsOnCreate() {\n\t\t$this->loadFixtures('Article');\n\t\t$Article = new Article();\n\t\t$Article->id = 1;\n\t\t$Article->saveField('title', 'Reset me');\n\t\t$Article->delete();\n\t\t$Article->id = 1;\n\t\t$this->assertFalse($Article->exists());\n\n\t\t$Article->create();\n\t\t$this->assertFalse($Article->exists());\n\t\t$Article->id = 2;\n\t\t$Article->saveField('title', 'Staying alive');\n\t\t$result = $Article->read(null, 2);\n\t\t$this->assertEquals('Staying alive', $result['Article']['title']);\n\t}",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }",
"final public function delete() {\n global $config; \n # Borrar el elemento de la base de datos\n $this->db->query(\"DELETE FROM guarderia_2 WHERE id_guarderia = $this->id\");\n # Redireccionar a la página principal del controlador\n $this->functions->redir($config['site']['url'] . 'sedes/&success=true');\n }",
"public function delete()\n {\n // TODO: Implement delete() method.\n }",
"function remove_existing(){\n $db = DB::connect(DB_CONNECTION_STRING);\n \n $sql = \"delete from user \n where postcode = \" . $db->quote($this->postcode) . \"\n and email = \" . $db->quote($this->email) .\"\n and user_id <> \" . $db->quote($this->user_id);\n $db->query($sql); \n }",
"public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }",
"function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}",
"public function delete()\n {\n if ($this->id() != 1) {\n return parent::delete();\n }\n\n return false;\n }",
"public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }",
"public function excluiraluno() {\n\t\t//Recupera id do aluno\n\t\tif(!$this->uri->segment(\"3\"))\n\t\t\tredirect('/administracao/painel');\n\t\telse \n\t\t\t$intID =$this->uri->segment(\"3\");\n\n\t\t/* Carrega o modelo */\n\t\t$this->load->model('alunos_model');\n\n\t\t/* Chama a função update do modelo */\n\t\tif ($this->alunos_model->delete($intID)) {\n\t\t\tlog_message('success', 'Aluno editado com sucesso!');\n\t\t\tredirect('/administracao/listaalunos');\n\t\t} else {\n\t\t\tlog_message('error', 'Erro ao inserir o aluno!');\n\t\t}\n\t}",
"function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }",
"public function testDeleteMethodRemovesRowFromDatabase()\n {\n $transaction = factory(Transaction::class)->states('with_account')->create();\n\n $this->repository->delete($transaction->id);\n\n $this->assertDatabaseMissing('transactions', [\n 'id' => $transaction->id\n ]);\n }",
"function testResetOfExistsOnCreate() {\n\t\t$this->loadFixtures('Article');\n\t\t$Article =& new Article();\n\t\t$Article->id = 1;\n\t\t$Article->saveField('title', 'Reset me');\n\t\t$Article->delete();\n\t\t$Article->id = 1;\n\t\t$this->assertFalse($Article->exists());\n\n\t\t$Article->create();\n\t\t$this->assertFalse($Article->exists());\n\t\t$Article->id = 2;\n\t\t$Article->saveField('title', 'Staying alive');\n\t\t$result = $Article->read(null, 2);\n\t\t$this->assertEqual($result['Article']['title'], 'Staying alive');\n\t}",
"public function excluir()\n {\n $pdo = new \\PDO(DSN, USER, PASSWD);\n //cria sql\n $sql = \"DELETE FROM EncontroComDeus WHERE id = ?\n \";\n\n //prepara sql\n $stm = $pdo->prepare($sql);\n //trocar valores\n $stm->bindParam(1, $this->id );\n\n $resposta = $stm->execute();\n\n $erro = $stm->errorInfo();\n\n //fechar conexão\n $pdo = null ;\n\n return $resposta;\n\n }",
"public function destroy($id)\n {\n $empleado = Empleados::find($id);\n $empleado->eliminado = true;\n $empleado->save();\n }",
"public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }",
"function delete() {\n\t\tif ( $this->getID() > 0 ) {\n\t\t\t$this->setActive(self::PROFILE_DISABLED);\n\t\t\treturn $this->save();\n\t\t}\n\t\treturn false;\n\t}",
"public function index_delete()\n {\n $id = (int) $this->delete('id');\n\n //Obtenemos el registro\n $row = $this->Rest_model->get(array('id' => $id));\n \n //Validamos que exista\n if(!empty($this->delete('id')) && empty($row))\n {\n //Devolvemos un error en caso de que no exista\n $this->response([\n 'status' => FALSE,\n 'message' => 'El registro no existe'\n ], REST_Controller::HTTP_BAD_REQUEST);\n }\n \n //Borramos el registro\n $result = $this->Rest_model->delete($id);\n\n if($result >= 1)\n {\n $this->response([\n 'status' => TRUE,\n 'message' => 'Registro eliminado con éxito'\n ], REST_Controller::HTTP_OK);\n }\n\n $this->response([\n 'status' => FALSE,\n 'message' => 'Ocurrió un error'\n ], REST_Controller::HTTP_BAD_REQUEST);\n }",
"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 delete(){\n //Préparation de la requête\n $sql = \"DELETE FROM atelier WHERE idAtelier = ?\";\n $requete = $this->connectBdd->prepare($sql);\n\n //Execution de la requete\n $requete->execute([$this->getIdAtelier()]);\n\n //Fermeture de la requete\n $requete->closeCursor();// requête delete \n }",
"function removeRegistro($id) {\n GLOBAL $con;\n\n //busca info\n $querybusca = \"select * from kardexs where id='\" . $id . \"'\";\n $qry = mysql_query($querybusca);\n $linha = mysql_fetch_assoc($qry);\n\n //Apagua\n $query = \"delete from kardexs where id='\" . $id . \"'\";\n mysql_query($query, $con) or die(mysql_error());\n\n if (saldoExiste($linha['produto_id'], $linha['estoque_id'])) {\n //atualiza retirando saldo\n $saldoAtual = saldoByEstoque($linha['produto_id'], $linha['estoque_id']);\n if ($linha['sinal'] == '+') {\n $saldoAtual_acerto = $saldoAtual - $linha['qtd'];\n } else {\n $saldoAtual_acerto = $saldoAtual + $linha['qtd'];\n }\n\n\n saldo_atualiza($linha['produto_id'], $linha['estoque_id'], $saldoAtual_acerto);\n }\n}",
"public function delete() {\n\t\t$this->getConnection()->delete( $this );\n\t\t$this->clear();\n\t}",
"public function destroy(Registro $registro)\n {\n //\n }",
"public function destroy(Registro $registro)\n {\n //\n }",
"public function delete($semillero){\n $id=$semillero->getId();\n\n try {\n $sql =\"DELETE FROM `semillero` WHERE `id`='$id'\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }",
"function delete() {\n db_begin_work();\n $delete = parent::delete();\n if($delete && !is_error($delete)) {\n unlink($this->getAvatarPath());\n \tunlink($this->getAvatarPath(true));\n\n ProjectUsers::deleteByUser($this);\n Assignments::deleteByUser($this);\n Subscriptions::deleteByUser($this);\n StarredObjects::deleteByUser($this);\n PinnedProjects::deleteByUser($this);\n UserConfigOptions::deleteByUser($this);\n Reminders::deleteByUser($this);\n\n search_index_remove($this->getId(), 'User');\n\n $cleanup = array();\n event_trigger('on_user_cleanup', array(&$cleanup));\n\n if(is_foreachable($cleanup)) {\n foreach($cleanup as $table_name => $fields) {\n foreach($fields as $field) {\n $condition = '';\n if(is_array($field)) {\n $id_field = array_var($field, 'id');\n $name_field = array_var($field, 'name');\n $email_field = array_var($field, 'email');\n $condition = array_var($field, 'condition');\n } else {\n $id_field = $field . '_id';\n $name_field = $field . '_name';\n $email_field = $field . '_email';\n } // if\n\n if($condition) {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ? AND $condition\", $this->getName(), $this->getEmail(), $this->getId());\n } else {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ?\", $this->getName(), $this->getEmail(), $this->getId());\n } // if\n } // foreach\n } // foreach\n } // if\n\n db_commit();\n return true;\n } else {\n db_rollback();\n return $delete;\n } // if\n }",
"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}",
"public function delete()\n {\n try {\n parent::delete(null, $this->data['id']);\n } catch (Exception $e) {\n die('ERROR');\n }\n }",
"function delete() {\n\t\treturn $this->destroy();\n\n\t}",
"function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }",
"public function delete() {\n\t\tif ($this->exists) {\n\t\t\t$this->fire_event('deleting');\n\n\t\t\t$result = $this->query()->where(static::$key, '=', $this->get_key())->delete();\n\n\t\t\t$this->fire_event('deleted');\n\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function clean(){\n\t\t$sql = 'DELETE FROM aluno';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function delete()\n {\n return;\n }",
"function delete()\n {\n }",
"function del($id) {\r\n\t\t\t\t\t$this->save(array('id'=>$id,'deleted'=>1));\r\n\t\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}",
"function delete()\n {\n $this->object->select();\n $this->object->_query_args['is_select'] = FALSE;\n $this->object->_query_args['is_delete'] = TRUE;\n return $this->object;\n }",
"public final function delete() {\n }",
"public function delete() {\r\n\r\n\t\t// Does the Genre object have an ID?\r\n\t\tif ( is_null( $this->id ) ) trigger_error ( \"Genre::delete(): Attempt to delete an Genre object that does not have its ID property set.\", E_USER_ERROR );\r\n\r\n\t\t// Delete the Article\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$st = $conn->prepare ( \"DELETE FROM :table WHERE id = :id LIMIT 1\" );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->execute();\r\n\t\t$conn = null;\r\n\t}",
"public function delete(){\n\t if(!isset($this->attributes['id'])) \n\t\t\tthrow new Exception(\"Cannot delete new objects\");\n\t\t$this->do_callback(\"before_delete\");\n\t\treturn self::do_query(\"DELETE FROM \".self::table_for(get_class($this)).\n\t\t \" WHERE id=\".self::make_value($this->attributes['id']));\t\n\t}",
"public function DeleteSeccion() {\n\t\t\t$this->objSeccion->Delete();\n\t\t}",
"public function destroy() {\n if ($this->isNew()) {\n return false;\n }\n\n $this->beforeDestroy();\n\n self::$db->delete(static::$table, array('id' => $this->id));\n\n $this->id = 0;\n\n return true;\n }",
"public function excluir()\n {\n //Recupera os dados do formulário\n $empresa = $this->input->post();\n $id = $empresa['id_empresa'];\n\n //Executa a exclusão e obtem o status da operação\n $status = $this->EmpresasModel->excluir($id); \n \n //Checa o status da operação\n //Se bem sucedida, informa ao usuário e carrega a tela da lista de empresas\n //Caso contrário, também informa e carrega a tela de excluir empresa\n\t\tif($status){ \n $resultado = $this->EmpresasModel->getAll();\n $dados['empresas'] = $resultado;\n $dados['success'] = 'Empresa excluída com sucesso.';\n $this->load->view(\"Empresas/lista\", $dados);\n\t\t}else{ \n $this->session->set_flashdata('error', 'Não foi possível excluir a empresa.');\n $dados['empresaid'] = $this->EmpresasModel->getById($id);\n $this->load->view(\"Empresas/deleta\", $dados); \n }\n\t}",
"function delete()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores WHERE id = {$this->getId()};\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands WHERE store_id = {$this->getId()};\");\n }",
"public function delete()\n\t{\n\t\t$this->hard_delete();\n\t}",
"public function delete()\n {\n return $this->dao->delete([\"idProducto\" => $this->idProduct]);\n }",
"protected function delete() {\n\t}",
"function eliminaRuta()\r\n\t{\r\n\t\t$query = \"DELETE FROM \" . self::TABLA . \" WHERE IdRuta = \".$this->IdRuta.\";\";\r\n\t\treturn parent::eliminaRegistro( $query);\r\n\t}",
"public function trash() {\n $now = date('Y-m-d H:i:s');\n $this->cancellato = true;\n $this->data_cancellazione = $now;\n $this->save();\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 delete()\n {\n if ($id = $this->getData('id')) {\n if ($this->getDB()->delete($this->table, array('id' => $id))) {\n $this->data = [];\n return true;\n }\n }\n\n return false;\n }",
"function deletePreDetalle2()\n {\n $sql='DELETE FROM predetalle WHERE idPreDetalle = ?';\n $params=array($this->idPre);\n return Database::executeRow($sql, $params);\n }"
] | [
"0.64487684",
"0.62455493",
"0.62395793",
"0.6169662",
"0.6098007",
"0.6065696",
"0.6028605",
"0.60168946",
"0.59710926",
"0.5966195",
"0.5964589",
"0.59379363",
"0.5915546",
"0.5913913",
"0.5910372",
"0.5891412",
"0.5887097",
"0.58521676",
"0.5842511",
"0.5834207",
"0.5824333",
"0.58197594",
"0.5811117",
"0.58030784",
"0.5797925",
"0.5792419",
"0.5788109",
"0.5783865",
"0.5782036",
"0.57766694",
"0.57738966",
"0.57694453",
"0.576837",
"0.57527244",
"0.5749741",
"0.57334036",
"0.57296926",
"0.5721898",
"0.57125866",
"0.57086074",
"0.56863993",
"0.5683252",
"0.5682045",
"0.5676364",
"0.5675873",
"0.5672029",
"0.5666361",
"0.56512403",
"0.56460255",
"0.56425387",
"0.5641068",
"0.5639892",
"0.561991",
"0.5618307",
"0.56169534",
"0.5607167",
"0.56053644",
"0.56039447",
"0.5602286",
"0.5602286",
"0.5600759",
"0.5597785",
"0.559654",
"0.55914176",
"0.5590943",
"0.55872536",
"0.55872166",
"0.55862254",
"0.5578331",
"0.5576043",
"0.5573654",
"0.5573474",
"0.55702084",
"0.5562296",
"0.55576813",
"0.5547761",
"0.55466187",
"0.554584",
"0.5544231",
"0.55398893",
"0.5535849",
"0.5527197",
"0.55231816",
"0.5521794",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.5520009",
"0.55140394",
"0.551397"
] | 0.0 | -1 |
Atualiza um registro existente. | public function Editar(){
$id = $_GET['id'];
$imagem = $_GET['imagem'];
if(!empty($_FILES['btnImagem']['name'])){
// Caminho da pasta onde as imagens serão armazenadas.
$upload_dir = "imagens/";
// Para manipular arquivos, deve ser usado "$_FILES"!!!
// Armazenando o nome e a extensão do arquivo que foi selecionado.
$nome_arq = basename($_FILES['btnImagem']['name']);
// Verifica o tipo de extensão permitida para o upload do arquivo,
// usamos o comando "strstr()" para localizar a sequência de caracteres.
if(strstr($nome_arq,'.jpg') || strstr($nome_arq,'.png') || strstr($nome_arq,'.gif')){
$upload_file = $upload_dir . $nome_arq;
if(move_uploaded_file($_FILES['btnImagem']['tmp_name'], $upload_file)){
$frota = new Frota();
$frota->id = $id;
// $frota->titulo_frota = $_POST['titulo_frota'];
$frota->imagem = $upload_file;
$frota->descricao = $_POST['txt_sobre'];
$frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];
$frota::Update($frota);
// var_dump($frota);
}else{
echo("Falha ao mover o arquivo!");
}
}
}else{
$idFrota = $_GET['id'];
$frota = new Frota();
$frota->id = $idFrota;
// $frota->titulo_frota = $_POST['titulo_frota'];
$frota->imagem = $imagem;
$frota->descricao = $_POST['txt_sobre'];
$frota->idTipoOnibus = $_POST['cbx_tipoOnibus'];
$frota::Update($frota);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Save(){\n // If id is set, update the current register in database\n if(isset($this->idAval)){\n // Makes the update in the database\n return $this->UpdateSQL([\"ID_AVAL = \".$this->idAval]) > 0;\n }else{\n // If id is not set, insert a new row in database\n $this->fecha = date_format(new \\DateTime('now', new \\DateTimeZone('America/Argentina/Buenos_Aires')), 'Y-m-d H:i:s');\n if($this->InsertSQL()>0){\n // Refresh get the inserted id and refresh the object values\n return $this->Refresh();\n }\n }\n return false;\n }",
"public function save()\n {\n if (self::isExistent($this->guid))\n {\n return $this->update();\n }\n else\n {\n return $this->insert();\n }\n }",
"public function save()\n {\n if ($this->id === null) {\n $this->insert();\n } else {\n $this->update();\n }\n }",
"public function save()\n\t{\n\t\tif( $this->isExist )\n\t\t{\n\t\t\treturn $this->update();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->insert();\n\t\t}\n\t}",
"public function save() : bool {\n\t\t// Check if record is new\n\t\t$isNew = isset($this->{$this->primaryKey}) && $this->{$this->primaryKey} ? false : true;\n\n\t\tif ($isNew) {\n\t\t\t// Insert\n\t\t\t$this->database->query('INSERT INTO ' . $this->tableNamePrefixed, $this->getValuesForDatabase());\n\t\t\tif ($this->database->getInsertId()) {\n\t\t\t\t$this->{$this->primaryKey} = $this->database->getInsertId();\n\t\t\t}\n\t\t} else {\n\t\t\t// Update\n\t\t\t$this->database->query(\n\t\t\t\t'UPDATE ' . $this->tableNamePrefixed . ' SET',\n\t\t\t\t$this->getValuesForDatabase(),\n\t\t\t\t'WHERE ' . $this->primaryKey . ' = ?', $this->{$this->primaryKey}\n\t\t\t);\n\t\t}\n\n\t\treturn true;\n\t}",
"public function save() {\n return $this->{static::$primaryKey} === null? $this->create() : $this->update();\n }",
"public function save()\n {\n if ($this->id) {\n $this->update();\n } else {\n $this->id = $this->insert();\n }\n }",
"public function save() {\n $query = \"\";\n\n // Se for um novo registro, cria uma query INSERT INTO\n if($this->new_register) {\n $columns = array();\n $values = array();\n\n foreach($this->get_columns_information() as $column) {\n if(('id' == $column['column_name'] && $this->get_column_value($column['column_name']) > 0) || 'id' != $column['column_name']) {\n $columns[] = $column['column_name'];\n $values[] = $this->get_column_value($column['column_name']);\n }\n }\n\n $query = \"INSERT INTO {$this->get_table_name()}(\" . implode(', ', $columns) . \") VALUES(\" . implode(', ', $values) . \");\";\n\n unset($columns, $values);\n\n // Se o registro ja existe e foi alterado, cria uma query UPDATE\n } else {\n $sets = array();\n $conds = array();\n\n $changed = false;\n\n // Cria o trecho da query com os valores para SET e as condicoes para WHERE\n foreach($this->get_columns_information() as $column) {\n $value = $this->get_column_value($column['column_name']);\n $old_value = $this->get_column_value($column['column_name'], true);\n\n // Verifica se algum campo foi modificado\n if($value !== $old_value)\n $changed = true;\n\n $sets[] = \"{$column['column_name']} = {$value}\";\n $conds[] = ($old_value != 'NULL') ? (\"{$column['column_name']} = {$old_value}\")\n : (\"({$column['column_name']} IS NULL OR {$column['column_name']} = '')\");\n }\n\n // Cria query de atualizacao apenas se houve alguma modificacao\n if($changed)\n $query = \"UPDATE {$this->get_table_name()}\n SET \" . implode(', ', $sets) . \"\n WHERE \" . implode(' AND ', $conds) . \";\";\n\n unset($sets, $conds);\n }\n\n // Tenta salvar o registro\n // Se salvar corretamente, atualiza os dados do objeto para que da proxima vez ele seja atualizado, caso seja um registro novo\n if(DB::execute($query)) {\n $this->new_register = false;\n $data = array();\n\n foreach($this->get_columns_information() as $column) {\n $this->{'_' . $column['column_name']} = $this->$column['column_name'];\n $data[$column['column_name']] = $this->$column['column_name'];\n }\n\n return true;\n }\n\n return false;\n }",
"public function save()\n {\n $primary = $this->primary_key;\n $id = null;\n\n try {\n \n /** Verifica os campos obrigatórios */\n if ( !$this->required() ) {\n throw new \\Exception('Preencha os campos necessários.');\n }\n\n $date_now = (new \\DateTime())->format('Y-m-d H:i:s');\n\n /** Se for um update */\n if ( !empty($this->data->$primary) ) {\n $this->data->updated_at = $date_now;\n $id = $this->data->$primary;\n $this->update($this->safe(), [\"{$this->primary_key}=\" => $id]);\n }\n\n /** Se for um create */\n if ( empty($this->data->$primary) ) {\n $this->data->created_at = $date_now;\n $this->data->updated_at = $date_now;\n $id = $this->create($this->safe());\n }\n\n if ( !$id ) {\n return false;\n }\n\n $this->data = $this->findByPrimaryKey($id);\n return true;\n\n } catch(\\Exception $exception) {\n $this->fail = $exception;\n return false;\n }\n }",
"public function save(){\r\n\t \t\treturn isset($this->id) ? $this->update() : $this->create();\r\n\t\t}",
"public function save(){\n if($this->id == 0) {\n // Object is new and needs to be created\n return $this->insert();\n }\n }",
"public function save(){\n return isset($this->id) ? $this->update() : $this->create();\n \n }",
"public function save(){\r\n\t\tif(empty($this->idPrestamoEjemplar)){\t\t\t\r\n\t\t\t$this->idPrestamoEjemplar = $this->con->autoInsert(array(\r\n\t\t\t\"Prestamo_idPrestamo\" => $this->prestamoIdPrestamo,\r\n\t\t\t\"Ejemplar_idEjemplar\" => $this->ejemplarIdEjemplar,\r\n\t\t\t),\"prestamo_has_ejemplar\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\treturn $this->con->autoUpdate(array(\r\n\t\t\t\"Prestamo_idPrestamo\" => $this->prestamoIdPrestamo,\r\n\t\t\t\"Ejemplar_idEjemplar\" => $this->ejemplarIdEjemplar,\r\n\t\t\t),\"prestamo_has_ejemplar\",\"idPrestamo_Ejemplar=\".$this->getId());\r\n\t}",
"public function save() {\r\n $dateNow = date('Y-m-d H:i:s', time());\r\n $this->id = (int) $this->id;\r\n \r\n if (!empty($this->id)) {\r\n //update case\r\n if ($this->_update()) {\r\n return true;\r\n }\r\n }\r\n else {\r\n //Insert case\r\n if ($this->_insert()) {\r\n return true;\r\n }\r\n }\r\n }",
"public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }",
"public function save(){\r\n return isset($this->id) ? $this->update() : $this->create();\r\n }",
"public function atualizar()\r\n {\r\n return (new Database('instituicao'))->update('id=' . $this->id, [\r\n 'nome' => $this->nome,\r\n 'datacriacao' => $this->datacriacao,\r\n 'tipo' => $this->tipo\r\n\r\n ]);\r\n }",
"function save() {\n\n\t\tif ( $this->exists ) {\n\t\t\t// update changed fields\n\t\t\t$changed_data = array_intersect_key( $this->data, array_flip( $this->changed_fields ) );\n\n\t\t\t// serialize\n\t\t\t$changed_data = array_map( 'maybe_serialize', $changed_data );\n\n\t\t\tif ( empty( $changed_data ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$queue_id = $this->get_id();\n\n\t\t\t$updated = $this->update( $queue_id, $changed_data );\n\n\t\t\tif ( false === $updated ) {\n\t\t\t\t// Return here to prevent cache updates on error\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tdo_action( 'ig_es_object_update', $this ); // cleans object cache\n\t\t} else {\n\t\t\t$this->set_created_at( new DateTime() );\n\t\t\t$this->data = array_map( 'maybe_serialize', $this->data );\n\t\t\t\n\t\t\t// insert row\n\t\t\t$queue_id = $this->insert( $this->data );\n\n\t\t\tif ( $queue_id ) {\n\t\t\t\t$this->exists = true;\n\t\t\t\t$this->id = $queue_id;\n\t\t\t} else {\n\n\t\t\t\tES()->logger->error( sprintf( __( 'Could not insert into \\'%1$s\\' table. \\'%1$s\\' may not be present in the database.', 'email-subscribers' ), $this->table_name ), $this->logger_context );\n\n\t\t\t\t// Return here to prevent cache updates on error\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// reset changed data\n\t\t// important to reset after cache hooks\n\t\t$this->changed_fields = [];\n\t\t$this->original_data = $this->data;\n\n\t\treturn true;\n\t}",
"public function save()\n {\n $ins = $this->valores();\n unset($ins[\"idInscription\"]);\n\n $ins['idUser'] = $this->userO->idUser;\n unset($ins[\"userO\"]);\n\n $ins['idProject'] = $this->project->idProject;\n unset($ins[\"project\"]);\n\n if (empty($this->idInscription)) {\n $this->insert($ins);\n $this->idInscription = self::$conn->lastInsertId();\n } else {\n $this->update($this->idInscription, $ins);\n }\n }",
"public function save()\n {\n $this->_validateModifiable();\n\n if($this->isNew())\n {\n $this->_getDataSource()->create($this);\n }\n else\n {\n $this->_getDataSource()->update($this);\n }\n\n $this->_saveRelations();\n $this->_setNew(false);\n }",
"function create_or_update($name,$data) {\n return $this->save($name,$data);\n }",
"public function save(){\n\t\treturn isset($this->id)?$this->update():$this->create();\t\n\t}",
"public function save()\n {\n $this->hasTableName();\n $pk = $this->pk;\n $condition = \"\";\n if ($this->isNew) {\n $sql = \"INSERT INTO \" . $this->table_name . \" SET \";\n $update = '';\n } else {\n if (!isset($this->$pk))\n throw new Exception('Update em objeto sem chave definida', 403);\n\n $sql = \"UPDATE \" . $this->table_name . \" SET \";\n $update = \" WHERE `\" . $this->pk . \"` = '\" . $this->$pk . \"'\";\n }\n foreach ($this->rules() as $key => $validation) {\n if ($this->validateField($key, $validation) && isset($this->$key) && $this->$key != \"\") {\n $sql .= \" `\" . $key . \"` = '\" . $this->$key . \"',\";\n $condition .= \" `\" . $key . \"` = '\" . $this->$key . \"' AND\";\n }\n }\n if (!$this->getErrors()) {\n $sql = substr($sql, 0, -1) . $update;\n if (Database::dbactionf($sql)) {\n if ($this->isNew) {\n $this->$pk = Database::lastID();\n $this->persisted();\n }\n return true;\n }\n }\n return false;\n }",
"public function save(){\n\t\t\n\t\tif(!isset($this->data[$this->primary_key])){\n\t\t\t$success = $this->db\n\t\t\t\t->set($this->data)\n\t\t\t\t->insert($this->table);\n\n\t\t\t$this->data[$this->primary_key] = $this->db->last_insert_id;\n\t\t}else{\n\t\t\t$success = $this->db\n\t\t\t\t->set($this->data)\n\t\t\t\t->where($this->primary_key, $this->data[$this->primary_key])\n\t\t\t\t->update($this->table);\n\t\t}\n\n\t\treturn $success;\n\t}",
"public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }",
"public function save(){\n // if(isset($this->id)){$this->update();} else {$this->create();}\n return isset($this->id)? $this->update(): $this->create() ;\n\n }",
"public function save() {\n return isset($this->id) ? $this->update() : $this->create();\n }",
"protected function performInsert()\n {\n $attributes = $this->getAttributes();\n $updatedField = $this->getApi()->{'create'.ucfirst($this->getEntity())}($attributes);\n $this->fill($updatedField);\n $this->exists = true;\n $this->wasRecentlyCreated = true;\n\n return true;\n }",
"public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}",
"public function save() {\n\t\treturn isset($this->id) ? $this->update() : $this->create();\n\t}",
"public function save() \n\t{\n\t\tif (isset($this->id)) {\t\n\t\t\n\t\t\t// Return update when id exists\n\t\t\treturn $this->update();\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\t// Return insert when id does not exists\n\t\t\treturn $this->insert();\n\t\t}\n\t}",
"public function save() {\n\n return isset($this->id) ? $this->update() : $this->create();\n }",
"public function saveEntidad(){\n\t\t$conexion = new Database();\n if ($this->codigo){\n $query = sprintf('UPDATE agenda_entidades SET entidad = \"%s\" WHERE entidad_id = %d',\n $this->entidad,\n $this->codigo);\n $rows = $conexion->exec( $query );\n }\n else{\n $query = sprintf('INSERT INTO agenda_entidades(entidad) VALUES (\"%s\")',\n $this->usuario);\n\t\t\t$rows = $conexion->exec( $query );\n $this->codigo = $conexion->lastInsertId();\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 save(){\n if( !$this->validate() ){\n return false;\n }\n \n if($this->id){\n return $this->update();\n } else {\n return $this->create();\n }\n }",
"public function save(){\n\n\t\t$this->_connect();\n\t\t$exists = $this->_exists();\n\n\t\tif($exists==false){\n\t\t\t$this->_operationMade = self::OP_CREATE;\n\t\t} else {\n\t\t\t$this->_operationMade = self::OP_UPDATE;\n\t\t}\n\n\t\t// Run Validation Callbacks Before\n\t\t$this->_errorMessages = array();\n\t\tif(self::$_disableEvents==false){\n\t\t\tif($this->_callEvent('beforeValidation')===false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif(!$exists){\n\t\t\t\tif($this->_callEvent('beforeValidationOnCreate')===false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($this->_callEvent('beforeValidationOnUpdate')===false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//Generadores\n\t\t$className = get_class($this);\n\t\t$generator = null;\n\t\tif(EntityManager::hasGenerator($className)){\n\t\t\t$generator = EntityManager::getEntityGenerator($className);\n\t\t\t$generator->setIdentifier($this);\n\t\t}\n\n\t\t//LLaves foráneas virtuales\n\t\tif(EntityManager::hasForeignKeys($className)){\n\t\t\t$foreignKeys = EntityManager::getForeignKeys($className);\n\t\t\t$error = false;\n\t\t\tforeach($foreignKeys as $indexKey => $keyDescription){\n\t\t\t\t$entity = EntityManager::getEntityInstance($indexKey, false);\n\t\t\t\t$field = $keyDescription['fi'];\n\t\t\t\tif($this->$field==''){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions = $keyDescription['rf'].' = \\''.$this->$field.'\\'';\n\t\t\t\tif(isset($keyDescription['op']['conditions'])){\n\t\t\t\t\t$conditions.= ' AND '.$keyDescription['op']['conditions'];\n\t\t\t\t}\n\t\t\t\t$rowcount = $entity->count($conditions);\n\t\t\t\tif($rowcount==0){\n\t\t\t\t\tif(isset($keyDescription['op']['message'])){\n\t\t\t\t\t\t$userMessage = $keyDescription['op']['message'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$userMessage = 'El valor de \"'.$keyDescription['fi'].'\" no existe en la tabla referencia';\n\t\t\t\t\t}\n\t\t\t\t\t$message = new ActiveRecordMessage($userMessage, $keyDescription['fi'], 'ConstraintViolation');\n\t\t\t\t\t$this->appendMessage($message);\n\t\t\t\t\t$error = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($error==true){\n\t\t\t\t$this->_callEvent('onValidationFails');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$notNull = $this->_getNotNullAttributes();\n\t\t$at = $this->_getDatesAtAttributes();\n\t\t$in = $this->_getDatesInAttributes();\n\t\tif(is_array($notNull)){\n\t\t\t$error = false;\n\t\t\t$numFields = count($notNull);\n\t\t\tfor($i=0;$i<$numFields;++$i){\n\t\t\t\t$field = $notNull[$i];\n\t\t\t\tif($this->$field===null||$this->$field===''){\n\t\t\t\t\tif(!$exists&&$field=='id'){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif(!$exists){\n\t\t\t\t\t\tif(isset($at[$field])){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(isset($in[$field])){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$field = str_replace('_id', '', $field);\n\t\t\t\t\t$message = new ActiveRecordMessage(\"El campo $field no puede ser nulo ''\", $field, 'PresenceOf');\n\t\t\t\t\t$this->appendMessage($message);\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($error==true){\n\t\t\t\t$this->_callEvent('onValidationFails');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Run Validation\n\t\tif($this->_callEvent('validation')===false){\n\t\t\t$this->_callEvent('onValidationFails');\n\t\t\treturn false;\n\t\t}\n\n\t\tif(self::$_disableEvents==false){\n\t\t\t// Run Validation Callbacks After\n\t\t\tif(!$exists){\n\t\t\t\tif($this->_callEvent('afterValidationOnCreate')===false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($this->_callEvent('afterValidationOnUpdate')===false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($this->_callEvent('afterValidation')===false){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Run Before Callbacks\n\t\t\tif($this->_callEvent('beforeSave')===false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif($exists){\n\t\t\t\tif($this->_callEvent('beforeUpdate')===false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($this->_callEvent('beforeCreate')===false){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($this->_schema){\n\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$table = $this->_source;\n\t\t}\n\n\t\t$magicQuotesRuntime = get_magic_quotes_runtime();\n\t\t$dataType = $this->_getDataTypes();\n\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t$dataTypeNumeric = $this->_getDataTypesNumeric();\n\t\tif($exists){\n\t\t\tif(self::$_dynamicUpdate==false){\n\t\t\t\t$fields = array();\n\t\t\t\t$values = array();\n\t\t\t\t$nonPrimary = $this->_getNonPrimaryKeyAttributes();\n\t\t\t\tforeach($nonPrimary as $np){\n\t\t\t\t\tif(isset($in[$np])){\n\t\t\t\t\t\t$this->$np = Date::now();\n\t\t\t\t\t}\n\t\t\t\t\t$fields[] = $np;\n\t\t\t\t\tif(is_object($this->$np)&&($this->$np instanceof DbRawValue)){\n\t\t\t\t\t\t$values[] = $this->$np->getValue();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($this->$np===''||$this->$np===null){\n\t\t\t\t\t\t\t$values[] = 'NULL';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(!isset($dataTypeNumeric[$np])){\n\t\t\t\t\t\t\t\tif($dataType[$np]=='date'){\n\t\t\t\t\t\t\t\t\t$values[] = $this->_db->getDateUsingFormat($this->$np);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$values[] = '\\''.addslashes($this->$np).'\\'';\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\t$values[] = '\\''.addslashes($this->$np).'\\'';\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} else {\n\t\t\t\t$conditions = array();\n\t\t\t\tforeach($primaryKeys as $field){\n\t\t\t\t\t$conditions[] = $field.' = \\''.$this->field.'\\'';\n\t\t\t\t}\n\t\t\t\t$pkCondition = join(' AND ', $conditions);\n\t\t\t\t$existRecord = clone $this;\n\t\t\t\t$record = $existRecord->findFirst($pkCondition);\n\t\t\t\t$fields = array();\n\t\t\t\t$values = array();\n\t\t\t\t$nonPrimary = $this->_getNonPrimaryKeyAttributes();\n\t\t\t\tforeach($nonPrimary as $np){\n\t\t\t\t\tif(isset($in[$np])){\n\t\t\t\t\t\t$this->$np = $this->_db->getCurrentDate();\n\t\t\t\t\t}\n\t\t\t\t\tif(is_object($this->$np)){\n\t\t\t\t\t\tif($this->$np instanceof DbRawValue){\n\t\t\t\t\t\t\t$value = $this->$np->getValue();\n\t\t\t\t\t\t\tif($record->$np!=$value){\n\t\t\t\t\t\t\t\t$fields[] = $np;\n\t\t\t\t\t\t\t\t$values[] = $values;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new ActiveRecordException('El objeto instancia de \"'.get_class($this->$field).'\" en el campo \"'.$field.'\" es muy complejo, debe realizarle un \"cast\" a un tipo de dato escalar antes de almacenarlo');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif($this->$np===''||$this->$np===null){\n\t\t\t\t\t\t\tif($record->$np!==''&&$record->$np!==null){\n\t\t\t\t\t\t\t\t$fields[] = $np;\n\t\t\t\t\t\t\t\t$values[] = 'NULL';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(!isset($dataTypeNumeric[$np])){\n\t\t\t\t\t\t\t\tif($dataType[$np]=='date'){\n\t\t\t\t\t\t\t\t\t$value = $this->_db->getDateUsingFormat($this->$np);\n\t\t\t\t\t\t\t\t\tif($record->$np!=$value){\n\t\t\t\t\t\t\t\t\t\t$fields[] = $np;\n\t\t\t\t\t\t\t\t\t\t$values[] = $value;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif($record->$np!=$this->$np){\n\t\t\t\t\t\t\t\t\t\t$fields[] = $np;\n\t\t\t\t\t\t\t\t\t\t$values[] = \"'\".addslashes($this->$np).\"'\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$success = $this->_db->update($table, $fields, $values, $this->_wherePk);\n\t\t} else {\n\t\t\t$fields = array();\n\t\t\t$values = array();\n\t\t\t$attributes = $this->getAttributes();\n\t\t\tforeach($attributes as $field){\n\t\t\t\tif($field!='id'){\n\t\t\t\t\tif(isset($at[$field])){\n\t\t\t\t\t\tif($this->$field==null||$this->$field===\"\"){\n\t\t\t\t\t\t\t$this->$field = $this->_db->getCurrentDate();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(isset($in[$field])){\n\t\t\t\t\t\t\t$this->$field = new DbRawValue('NULL');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$fields[] = $field;\n\t\t\t\t\tif(is_object($this->$field)){\n\t\t\t\t\t\tif($this->$field instanceof DbRawValue){\n\t\t\t\t\t\t\t$values[] = $this->$field->getValue();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new ActiveRecordException('El objeto instancia de \"'.get_class($this->$field).'\" en el campo \"'.$field.'\" es muy complejo, debe realizarle un \"cast\" a un tipo de dato escalar antes de almacenarlo');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(isset($dataTypeNumeric[$field])||$this->$field=='NULL'){\n\t\t\t\t\t\t\tif($this->$field===''||$this->$field===null){\n\t\t\t\t\t\t\t\t$values[] = 'NULL';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$values[] = addslashes($this->$field);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif($dataType[$field]=='date'){\n\t\t\t\t\t\t\t\tif($this->$field===null||$this->$field===''){\n\t\t\t\t\t\t\t\t\t$values[] = 'NULL';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$values[] = $this->_db->getDateUsingFormat(addslashes($this->$field));\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\tif($this->$field===null||$this->$field===''){\n\t\t\t\t\t\t\t\t\t$values[] = 'NULL';\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tif($magicQuotesRuntime==true){\n\t\t\t\t\t\t\t\t\t\t$values[] = \"'\".$this->$field.\"'\";\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$values[] = \"'\".addslashes($this->$field).\"'\";\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sequenceName = '';\n\t\t\tif($generator===null){\n\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t// Hay que buscar la columna identidad aqui!\n\t\t\t\t\tif(!isset($this->id)||!$this->id){\n\t\t\t\t\t\tif(method_exists($this, 'sequenceName')){\n\t\t\t\t\t\t\t$sequenceName = $this->sequenceName();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$identityValue = $this->_db->getRequiredSequence($this->_source, $primaryKeys[0], $sequenceName);\n\t\t\t\t\t\tif($identityValue!==false){\n\t\t\t\t\t\t\t$fields[] = 'id';\n\t\t\t\t\t\t\t$values[] = $identityValue;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif(isset($this->id)){\n\t\t\t\t\t\t\t$fields[] = 'id';\n\t\t\t\t\t\t\t$values[] = $this->id;\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$success = $this->_db->insert($table, $values, $fields);\n\t\t}\n\t\tif($this->_db->isUnderTransaction()==false){\n\t\t\tif($this->_db->getHaveAutoCommit()==true){\n\t\t\t\t$this->_db->commit();\n\t\t\t}\n\t\t}\n\t\tif($success){\n\t\t\tif($exists==true){\n\t\t\t\t$this->_callEvent('afterUpdate');\n\t\t\t} else {\n\t\t\t\tif($generator===null){\n\t\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t\tif(isset($dataTypeNumeric[$primaryKeys[0]])){\n\t\t\t\t\t\t $lastId = $this->_db->lastInsertId($table, $primaryKeys[0], $sequenceName);\n\t\t\t\t\t\t if($lastId>0){\n\t\t\t\t\t\t\t $this->{$primaryKeys[0]} = $lastId;\n\t\t\t\t\t\t\t\t$this->findFirst($lastId);\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//Actualiza el consecutivo para algunos generadores\n\t\t\t\t\t$generator->updateConsecutive($this);\n\t\t\t\t}\n\t\t\t\t$this->_callEvent('afterCreate');\n\t\t\t}\n\t\t\t$this->_callEvent('afterSave');\n\t\t\treturn $success;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function save()\n\t\t{\n\t\treturn isset($this->userguid) ? $this->update() : $this->create();\n\t\t}",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function guardar()\n\t{\n\t\t// Crear una instancia de la conexion\n\t\t$conexion = new Conexion;\n\n\t\t// Comprobar si es un registro nuevo o uno ya existente\n\t\tif ($this->update) {\n\n\t\t\t// Preparar la sentencia para actualizar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"UPDATE \". static::$tablaConsulta . \" SET medio= ? WHERE id= ?\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t'si',\n\t\t\t\t\t$this->medio,\n\t\t\t\t\t$this->id\n\t\t\t);\n\n\t\t} else {\n\n\t\t\t// Preparar la sentencia para isertar el tipo de rol en la bd\n\t\t\t$sentencia = $conexion->conn->prepare(\"INSERT INTO \". static::$tablaConsulta . \" VALUES (null, ?)\");\n\n\t\t\t// Pasar los campos del objecto a la sentencia\n\t\t\t$sentencia->bind_param(\n\t\t\t\t\t's',\n\t\t\t\t\t$this->medio\n\t\t\t);\n\t\t}\n\n\n // Ejecutar la sentencia\n\t\tif ( $sentencia->execute() ) {\n\n\t\t\t// Devolver un uno si fue un exito\n\t\t\treturn 1;\n\t\t} else {\n\n\t\t\t// Devolver un 0 si ocurrio un error\n\t\t\treturn 0;\n\t\t}\n\t}",
"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 save () {\n // Atualiza\n // @ verifico se o atributo \"id_emprestimo\" existe neste objeto.\n // lembrando que este atributo é apagado se criamos um novo emprestimo.\n if ( isset($this->id_emprestimo) ) {\n $this->db->update('emprestimos', $this, array('id_emprestimo' => $this->id_emprestimo));\n }\n\n // Salva\n else {\n $this->db->insert('emprestimos', $this);\n }\n }",
"public function actualizaEstado(){\n $this->estado = 'Completo';\n // $this->cotiza = $this->generarCustomID();\n $this->save();\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 save()\n {\n // datos obligatorios para la insercion/modificacion\n $data = [\n \"propietario\" => $this->owner,\n \"estado\" => $this->state,\n \"nombre\" => $this->name\n ];\n\n // datos opcionales, que pueden no estar establecidos para la \n // insercion/modificacion\n if (isset($this->description)) $data[\"descripcion\"] = $this->description;\n\n // si idProduct no es null, entonces es un update\n if (isset($this->idProduct))\n return $this->dao->update($data, [\"idProducto\" => $this->idProduct]);\n\n // sino, es un insert\n return $this->dao->insert($data);\n }",
"public function save() {\n if(!isset($this->id)) {\n $this->insert();\n } else {\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n $qb = $this::set($data);\n $qb->where(['id' => $this->id])->make();\n return true;\n }\n }",
"public function save()\r\n {\r\n if( empty($this->dirty) ) return true;\r\n \r\n $pkName = $this->pkName();\r\n //is it an update?\r\n if( isset($this->data[$pkName]) ){\r\n $this->table->update($this->dirty, \"{$pkName}=?\", array($this->data[$pkName]) );\r\n $merged_data[$pkName] = $this->data[$pkName];\r\n } else {\r\n //it's an insert\r\n $merged_data = array_merge(\r\n $this->array_diff_schema($this->dirty),\r\n $this->array_diff_schema($this->data)\r\n );\r\n $this->table->insert($merged_data);\r\n $pk = $this->pkName();\r\n if( !isset($merged_data[$pk]) )\r\n $merged_data[$pk] = $this->table->lastInsertId();\r\n }\r\n $this->reset($merged_data);\r\n return true;\r\n }",
"public function save(){\r\n\t\tif ($this->new){\r\n\t\t\treturn $this->insert();\r\n\t\t} else {\r\n\t\t\treturn $this->update();\r\n\t\t}\r\n\t}",
"public function save() {\n if ($this->loaded) {\n return $this->update();\n }else{\n return $this->create();\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}",
"public function save()\n {\n $project = $this->valores();\n unset($project['idProject']);\n\n $project['idUser'] = $this->userO->idUser;\n unset($project['userO']);\n\n if (empty($this->idProject)) {\n $this->insert($project);\n $this->idProject = self::$conn->lastInsertId();\n } else {\n $this->update($this->idProject, $project);\n }\n }",
"public static function save()\n\t{\n//\t\t{\n//\t\t\techo static::$error;\n//\t\t\treturn false;\n//\t\t}\n\n\t\t$instance = static::$_instance[static::_getTable()];\n\t\t$columns = DB::getColumnListing(static::$_table);\n\n\t\tif (@$instance->id)\n\t\t{\n\t\t\tDB::where($instance->id);\n\n\t\t\tif (in_array('updated', $columns))\n\t\t\t\t$instance->updated = date('Y-m-d H:i:s');\n\n\t\t\tif (in_array('updater', $columns))\n\t\t\t\t$instance->updater = (int)Auth::identity()->id;\n\n\t\t\tDB::table(static::$_table)->update($instance);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (in_array('ordering', $columns))\n\t\t\t\t$instance->ordering = DB::table(static::$_table)->getNewOrdering();\n\n\t\t\tif (in_array('created', $columns))\n\t\t\t\t$instance->created = date('Y-m-d H:i:s');\n\n\t\t\tif (in_array('creator', $columns))\n\t\t\t\t$instance->creator = (int)Auth::identity()->id;\n\n\t\t\tDB::table(static::$_table)->insert($instance);\n\t\t\t$instance->id = DB::getLastInsertId();\n\t\t}\n\n\t\treturn true;\n\t}",
"public function atualizar(){\r\n return (new Database('atividades'))->update('id = '.$this->id,[\r\n 'titulo' => $this->titulo,\r\n 'descricao' => $this->descricao,\r\n 'ativo' => $this->ativo,\r\n 'data' => $this->data\r\n ]);\r\n }",
"public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }",
"public function save()\n { \n return $this->checkForRows() ? $this->updateRow() : $this->insertRow();\n }",
"public function save()\n\t{\n\t\t$status = $this->validated ? TRUE : $this->valid();\n\n\t\tif ($status === TRUE)\n\t\t{\n\t\t\tif ($this->data['id']) // Do an update\n\t\t\t\treturn count($this->db->update($this->table_name, $this->data, array('id' => $this->data['id'])));\n\t\t\telse // Do an insert\n\t\t\t{\n\t\t\t\t$id = $this->db->insert($this->table_name, $this->data)->insert_id();\n\t\t\t\treturn ($this->data['id'] = $id);\n\t\t\t}\n\t\t}\n\n\t\tthrow new Kohana_User_Exception('auto_modeler.validation_error', $status);\n\t}",
"public function save()\n {\n $this->setData(array(\n 'modified' => time(),\n 'modifiedReadable' => Zend_Date::now()->get(Zend_Date::ISO_8601)\n ));\n \n $unmappedData = $this->getBean()->asDeepArray(true);\n if(key_exists('_id', $unmappedData)) {\n unset($unmappedData['_id']);\n }\n\n if (!($id = $this->_save($unmappedData, $this->getId()))) {\n return false;\n }\n\n $this->_setId($id);\n \n return true;\n }",
"public function save() {\r\n\t return isset($this->userid) ? $this->update() : $this->create();\r\n\t}",
"public function add_or_update()\n {\n $this->on_duplicate_key('foo = foo + 1');\n $this->insert('table', array('foo' => 'bar'));\n }",
"public function markAsPersisted(): void;",
"public function return_existing_if_exists()\n {\n $author = factory( Author::class )->create();\n $data = array_add( $this->authorDataFormat, 'data.id', $author->id );\n\n $newAuthor = $this->dispatch( new StoreAuthor( $data ) );\n\n $this->assertEquals( $author->id, $newAuthor->id );\n }",
"public function save() {\n if ($this->id) {\n return $this->update();\n } else {\n return $this->insert();\n }\n }",
"public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }",
"public function save()\n {\n $pdo = $this->getDbConnection();\n $valuesRow = $this->prepareValuesRow();\n\n $pdo->exec(\"REPLACE INTO {$this->dbTable} (`key`, `value`) VALUES {$valuesRow}\");\n }",
"public function atualizar()\n {\n return (new Database('vagas'))->update('id = '.$this->id, [\n 'titulo' => $this->titulo,\n 'descricao' => $this->descricao,\n 'ativo' => $this->ativo,\n 'data' => $this->data \n ]);\n }",
"public function save(){\n\n if (!$this->preSave()) {\n return FALSE;\n }\n\n $reference = $this->_getReference();\n $pk = $this->_getPK();\n\n $data = get_object_vars($this);\n\n if (empty($pk) && $pk !== NULL) {\n throw new \\Exception('Model PK is empty!');\n }\n\n if (is_array($pk)) {\n $pkv = [];\n $_pkv = [];\n $insert = TRUE;\n foreach ($pk as $c) {\n if (!empty($data[$c])) {\n $pkv[] = $data[$c];\n $_pkv[$c] = $data[$c];\n // unset($data[$c]);\n $insert = FALSE;\n }\n }\n\n if (!$insert) {\n $insert = is_null(self::getWhere($_pkv));\n }\n\n\n } else {\n $pkv = !empty($data[$pk]) ? $data[$pk] : NULL;\n $_pkv = [$pk => $pkv];\n\n // Se for AUTO INCREMENT remove dos campos a serem INSERIDOS/ALTERADOS\n if (self::_isPkAi())\n unset($data[$pk]);\n\n $insert = empty($pkv);\n }\n\n unset($data['__error']);\n\n foreach ($data as $key => $value) {\n if (strpos($key, '_') === 0)\n unset($data[$key]);\n }\n\n if ($insert) {\n\n if (array_key_exists('created', $data))\n $data['created'] = Date('Y-m-d H:i:s');\n\n if (array_key_exists('updated', $data))\n unset($data['updated']);\n\n\n $res = self::$connection->insert($reference, $data)->execute();\n\n if ($res && $pk !== NULL && !is_array($pk))\n $this->{'set'.$pk}(self::$connection->lastInsertId());\n\n } else {\n\n if (array_key_exists('updated', $data))\n $data['updated'] = Date('Y-m-d H:i:s');\n\n if (array_key_exists('created', $data))\n unset($data['created']);\n\n $res = self::$connection->update($reference, $data, $_pkv)->execute();\n\n }\n\n if ($res)\n $this->refresh();\n\n $this->afterSave($res);\n\n return $res;\n\n }",
"protected function _postSave($success, $exists) {}",
"public function save() {\n\t return isset($this->product_id) ? $this->update() : $this->create();\n\t}",
"public function save(): bool\n {\n return $this->id > 0\n ? $this->actionHandler->update()\n : $this->actionHandler->insert();\n }",
"public function save()\n {\n $temp = [];\n foreach ($this as $prop => $value) {\n $temp[$prop] = $value;\n }\n\n self::update($temp);\n if (isset($temp[(new static)->key])) {\n self::where((new static)->key, '=', $temp[(new static)->key]);\n }\n if (self::execute()->errno == 0) {\n return true;\n }\n return false;\n }",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"public function save() {\n\t\tif (!$this->created)\n\t\t\t$this->created = date('Y-m-d H:i:s');\n\t\treturn parent::save();\n\t}",
"public function store(Request $request)\n {\n Remitente::updateOrCreate(['id' => $request->remitente_id],\n ['nombre' => $request->nombre,'cel' => $request->cel,'email' => $request->email,'telefono' => $request->telefono,'direccion' => $request->direccion,'distrito_id' => $request->distrito_id]);\n return response()->json(['success'=>'remitente guardado satisfactoriamente.']);\n }",
"public function testResetOfExistsOnCreate() {\n\t\t$this->loadFixtures('Article');\n\t\t$Article = new Article();\n\t\t$Article->id = 1;\n\t\t$Article->saveField('title', 'Reset me');\n\t\t$Article->delete();\n\t\t$Article->id = 1;\n\t\t$this->assertFalse($Article->exists());\n\n\t\t$Article->create();\n\t\t$this->assertFalse($Article->exists());\n\t\t$Article->id = 2;\n\t\t$Article->saveField('title', 'Staying alive');\n\t\t$result = $Article->read(null, 2);\n\t\t$this->assertEquals('Staying alive', $result['Article']['title']);\n\t}",
"public function save() \n {\n\t\t$this->setLastUpdateTime(date(MYSQL_DATETIME_FORMAT));\n\n\t\tif($this->getId() ) {\n\t\t\treturn $this->_update();\n\t\t} else {\n\t\t\treturn $this->_insert();\n\t\t}\n\t}",
"public function save() {\n\t\t\n\t\treturn isset($this->members_id) ? $this->update() : $this->create(); //and this one??\n\t\t\n\t}",
"public function save() {\n return $this->entity->save();\n }",
"public function save() {\n\t\tif ( ! $this->dirty()) return true;\n\n\t\tif (static::$timestamps) {\n\t\t\t$this->timestamp();\n\t\t}\n\n\t\t$this->fire_event('saving');\n\n\t\t// If the model exists, we only need to update it in the database, and the update\n\t\t// will be considered successful if there is one affected row returned from the\n\t\t// fluent query instance. We'll set the where condition automatically.\n\t\tif ($this->exists) {\n\t\t\t$query = $this->query()->where(static::$key, '=', $this->get_key());\n\n\t\t\t$result = $query->update($this->get_dirty()) === 1;\n\n\t\t\tif ($result) $this->fire_event('updated');\n\t\t}\n\n\t\t// If the model does not exist, we will insert the record and retrieve the last\n\t\t// insert ID that is associated with the model. If the ID returned is numeric\n\t\t// then we can consider the insert successful.\n\t\telse {\n\t\t\t$id = $this->query()->insert_get_id($this->attributes, $this->key());\n\n\t\t\t$this->set_key($id);\n\n\t\t\t$this->exists = $result = is_numeric($this->get_key());\n\n\t\t\tif ($result) $this->fire_event('created');\n\t\t}\n\n\t\t// After the model has been \"saved\", we will set the original attributes to\n\t\t// match the current attributes so the model will not be viewed as being\n\t\t// dirty and subsequent calls won't hit the database.\n\t\t$this->original = $this->attributes;\n\n\t\tif ($result) {\n\t\t\t$this->fire_event('saved');\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function save()\n {\n $rc = true;\n $ak = array_keys($this->_objData);\n if (isset($this->_objData[$ak[0]][$this->_objField]) && $this->_objData[$ak[0]][$this->_objField]) {\n $rc = $this->update();\n } else {\n $rc = $this->insert();\n }\n return $rc;\n }",
"public function persist() {}",
"public function atualizar(){\r\n return (new Database('cartao'))->update(' id = '.$this->id, [\r\n 'bandeira' => $this->bandeira,\r\n 'numero' => $this->numero,\r\n 'doador' => $this->doador,\r\n ]);\r\n }",
"public function save()\n {\n return $this->address_srl ? $this->repo->update($this) : $this->repo->insert($this);\n }",
"public function store()\n {\n //MEMBUAT VALIDASI\n $this->validate([\n 'name' => 'required|string',\n 'username' => 'required|string',\n 'email' => 'required|string'\n ]);\n $pass = $this->password;\n //QUERY UNTUK MENYIMPAN / MEMPERBAHARUI DATA MENGGUNAKAN UPDATEORCREATE\n //DIMANA ID MENJADI UNIQUE ID, JIKA IDNYA TERSEDIA, MAKA UPDATE DATANYA\n //JIKA TIDAK, MAKA TAMBAHKAN DATA BARU\n User::updateOrCreate(['id' => $this->idz], [\n 'name' => $this->name,\n 'username' => $this->username,\n 'email' => $this->email,\n 'password' => $pass,\n ]);\n\n //BUAT FLASH SESSION UNTUK MENAMPILKAN ALERT NOTIFIKASI\n session()->flash('message', $this->id ? $this->name . ' Diperbaharui': $this->name . ' Ditambahkan');\n $this->closeUser(); //TUTUP User\n $this->resetFields(); //DAN BERSIHKAN FIELD\n }",
"public function registrar_registro()\n \n {\n /** \n * @brief : Metodos para ingresar registro en la base de datos.\n * @return :Vista donde nos mostrara todos lo registro.\n */\n \n $data =Request()->all();\n registro::create($data);\n\n }",
"public function store()\n {\n $this->validate([\n 'nom' => 'required',\n 'departements_id' => 'required',\n ]);\n \n Arrondissement::updateOrCreate(['id' => $this->arrondissement_id], [\n 'nom' => $this->nom,\n 'departements_id' => $this->departements_id\n ]);\n \n \n session()->flash('message', \n $this->arrondissement_id ? 'arrondissement Updated Successfully.' : 'arrondissement Created Successfully.');\n \n $this->closeModal();\n $this->resetInputFields();\n }",
"public function save()\n {\n }",
"public function commit() {\n\t$idAvailable = \\is_numeric($this->getId());\n\t//We're checking if the id is available and it's marked for delete. If not, we need to check if the id is available.\n\t//Finally, we need to make sure it hasn't been marked for delete. if it has and there's no id, nothing needs to be\n\t//done.\n\tif ($idAvailable && $this->_markForDelete) {\n\t $this->delete();\n\t}\n\telse if ($idAvailable) {\n\t $this->update();\n\t}\n\telse if (!$this->_markForDelete) {\n\t $this->insert();\n\t}\n }",
"public function persist();",
"function forceInsert() {\n\t\t\n\t\t\t$this->_isUpdate = false;\n\t\t\t\n\t\t}",
"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 testUpdate()\n {\n $id = $this->tester->grabRecord('common\\models\\Comentario', ['id_receita' => 2]);\n $receita = Comentario::findOne($id);\n $receita->descricao = 'novo Comentario';\n $receita->update();\n $this->tester->seeRecord('common\\models\\Comentario', ['descricao' => 'novo Comentario']);\n }",
"public function save()\r\n {\r\n \r\n }",
"public function save(): bool\n {\n $status = false;\n if ($this->new === false) {\n if ($this->deletionFlag === true) {\n $status = $this->delete();\n } elseif (\\count($this->modified) > 0) {\n $updateQuery = new Update($this->getDatabaseName());\n $updateQuery->update($this->getTableName());\n\n $where = array();\n foreach ($this->getPrimary() as $primary) {\n $field = $this->{'field' . \\ucfirst($primary)};\n $realName = (string) \\constant(static::class . '::FIELD_' . \\strtoupper(Helper::codifyName($primary)));\n $where[$realName] = ':primary' . \\ucfirst($primary);\n $updateQuery->bind('primary' . \\ucfirst($primary), $field['value']);\n }\n $updateQuery->where($where);\n\n $set = array();\n foreach ($this->modified as $key => $value) {\n if ($value === true) {\n $field = $this->{'field' . \\ucfirst($key)};\n $realName = (string) \\constant(static::class . '::FIELD_' . \\strtoupper(Helper::codifyName($key)));\n $set[$realName] = ':field' . \\ucfirst($key);\n $updateQuery->bind(':field' . \\ucfirst($key), $field['value']);\n }\n }\n $updateQuery->set($set);\n\n $this->modified = array();\n\n $status = $updateQuery->execute();\n }\n } else {\n if ($this->deletionFlag === false) {\n $insertQuery = new Insert($this->getDatabaseName());\n $insertQuery->into($this->getTableName());\n\n $returning = array();\n foreach ($this->getPrimary() as $primary) {\n $field = $this->{'field' . \\ucfirst($primary)};\n $realName = \\constant(static::class . '::FIELD_' . \\strtoupper(Helper::codifyName($primary)));\n $returning[] = $realName;\n }\n $insertQuery->returning($returning);\n\n $values = array();\n foreach ($this->getAllFieldsAliases() as $name) {\n $field = $this->{'field' . \\ucfirst($name)};\n if (isset($field['value']) === true) {\n $realName = \\constant(static::class . '::FIELD_' . \\strtoupper(Helper::codifyName($name)));\n $values[$realName] = ':field' . \\ucfirst($name);\n $insertQuery->bind('field' . \\ucfirst($name), $field['value']);\n }\n }\n $insertQuery->values($values);\n\n $status = $insertQuery->execute();\n\n if ($status === true) {\n $this->modified = array();\n $statement = $insertQuery->getStatement();\n if (!$statement) {\n throw new AppException('Database/Postgres/Model.save: insert query statement is null');\n }\n $rows = $statement->fetch(\\PDO::FETCH_ASSOC);\n $imax = \\count($rows);\n for ($i = 0; $i < $imax; $i++) {\n $field = &$this->{'field' . \\ucfirst($this->getPrimary()[$i])};\n $realName = \\constant(static::class . '::FIELD_' . \\strtoupper(Helper::codifyName($this->getPrimary()[$i])));\n $realName = \\substr($realName, \\stripos($realName, '.') + 1);\n $field['value'] = $rows[$realName];\n }\n $this->new = false;\n }\n }\n }\n\n return $status;\n }",
"function save() {\n\t\t// Error-checking should already be complete\n\t\tif(person::exists($this->id)) {\n\t\t\t// UPDATE an existing database entry\n\t\t\t$query = \"UPDATE people set \"\n\t\t\t\t\t.\"firstname = \".$this->firstname.\", \"\n\t\t\t\t\t.\"lastname = \".$this->lastname.\", \"\n\t\t\t\t\t.\"address_home_street_1 = \".$this->address_home_street_1.\", \"\n\t\t\t\t\t.\"address_home_street_2 = \".$this->address_home_street_2.\", \"\n\t\t\t\t\t.\"address_home_city = \".$this->address_home_city.\", \"\n\t\t\t\t\t.\"address_home_state = \".$this->address_home_state.\", \"\n\t\t\t\t\t.\"address_home_zip = \".$this->address_home_zip.\", \"\n\t\t\t\t\t.\"address_work_street_1 = \".$this->address_work_street_1.\", \"\n\t\t\t\t\t.\"address_work_street_2 = \".$this->address_work_street_2.\", \"\n\t\t\t\t\t.\"address_work_city = \".$this->address_work_city.\", \"\n\t\t\t\t\t.\"address_work_state = \".$this->address_work_state.\", \"\n\t\t\t\t\t.\"address_work_zip = \".$this->address_work_zip.\", \"\n\t\t\t\t\t.\"email = \".$this->email.\", \"\n\t\t\t\t\t.\"phone_personal_cell = \".$this->phone_personal_cell.\", \"\n\t\t\t\t\t.\"phone_work = \".$this->phone_work.\", \"\n\t\t\t\t\t.\"phone_work_cell = \".$this->phone_work_cell.\", \"\n\t\t\t\t\t.\"phone_home = \".$this->phone_home.\", \"\n\t\t\t\t\t.\"fax = \".$this->fax.\", \"\n\t\t\t\t\t.\"gender = \".$this->gender.\", \"\n\t\t\t\t\t.\"birthdate = \".$this->birthdate.\", \"\n\t\t\t\t\t.\"facebook_username = \".$this->facebook_username.\", \"\n\t\t\t\t\t.\"username = \".$this->username.\", \"\n\t\t\t\t\t.\"headshot_filename = \".$this->headshot_filename\n\t\t\t\t\t.\" WHERE id = \".$this->id;\n\t\t\t\t\t\n\t\t\t$result = mydb::cxn()->query($query);\n\t\t\tif(mydb::cxn()->error != '') throw new Exception('There was a problem updating '.$this->firstname.' '.$this->lastname.'\\'s database entry.');\n\t\t}\n\t\telse {\n\t\t\t// INSERT a new database entry\n\t\t\t$query = \"INSERT INTO people (\"\n\t\t\t\t\t.\"firstname, \"\n\t\t\t\t\t.\"lastname, \"\n\t\t\t\t\t.\"address_home_street_1, \"\n\t\t\t\t\t.\"address_home_street_2, \"\n\t\t\t\t\t.\"address_home_city, \"\n\t\t\t\t\t.\"address_home_state, \"\n\t\t\t\t\t.\"address_home_zip, \"\n\t\t\t\t\t.\"address_work_street_1, \"\n\t\t\t\t\t.\"address_work_street_2, \"\n\t\t\t\t\t.\"address_work_city, \"\n\t\t\t\t\t.\"address_work_state, \"\n\t\t\t\t\t.\"address_work_zip, \"\n\t\t\t\t\t.\"email, \"\n\t\t\t\t\t.\"phone_personal_cell, \"\n\t\t\t\t\t.\"phone_home, \"\n\t\t\t\t\t.\"phone_work, \"\n\t\t\t\t\t.\"phone_work_cell, \"\n\t\t\t\t\t.\"fax, \"\n\t\t\t\t\t.\"gender, \"\n\t\t\t\t\t.\"birthdate, \"\n\t\t\t\t\t.\"facebook_username, \"\n\t\t\t\t\t.\"username, \"\n\t\t\t\t\t.\"headshot_filename) \"\n\t\t\t\t\t.\"VALUES (\"\n\t\t\t\t\t.\"'\".$this->firstname.\"', \"\n\t\t\t\t\t.\"'\".$this->lastname.\"', \"\n\t\t\t\t\t.\"'\".$this->address_home_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_home_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_home_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_home_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_home_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_work_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_work_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_work_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_work_.\"', \"\n\t\t\t\t\t.\"'\".$this->address_work_.\"', \"\n\t\t\t\t\t.\"'\".$this->email.\"', \"\n\t\t\t\t\t.\"'\".$this->phone_personal_cell.\"', \"\n\t\t\t\t\t.\"'\".$this->phone_home.\"', \"\n\t\t\t\t\t.\"'\".$this->phone_work.\"', \"\n\t\t\t\t\t.\"'\".$this->phone_work_cell.\"', \"\n\t\t\t\t\t.\"'\".$this->fax.\"', \"\n\t\t\t\t\t.\"'\".$this->gender.\"', \"\n\t\t\t\t\t.\"'\".$this->birthdate->format('Y-m-d').\"', \"\n\t\t\t\t\t.\"'\".$this->facebook_username.\"', \"\n\t\t\t\t\t.\"'\".$this->username.\"', \"\n\t\t\t\t\t.\"'\".$this->headshot_filename.\"')\";\n\t\t\t$result = mydb::cxn()->query($query);\n\t\t\tif(mydb::cxn()->error != '') throw new Exception('There was a problem inserting '.$this->firstname.' '.$this->lastname.'\\'s database entry.');\n\t\t}\n\t\t\n\t}",
"public function save() {\r\n\t return isset($this->clientid) ? $this->update() : $this->create();\r\n\t}",
"public function save() {\r\n\t return isset($this->clientid) ? $this->update() : $this->create();\r\n\t}",
"public function persist()\n {\n //\n }",
"public function save()\n {\n $data = $this->getSaveData();\n $errorString = '<h5 class=\"alert-heading\">Can\\'t save ' . $this->entityName . ' because of the following problems:</h5>';\n\n $errors = $this->checkRequiredColumns( $data );\n if ( !empty( $errors ) ) {\n return $this->addError( $errorString . HTMLTags::getListGroup( $errors ) );\n }\n\n if ( defined( 'DEBUG' ) && DEBUG === true ) {\n $dataToSave = !empty( $data ) ? $this->getDataHTMLTable( $data ) : 'None';\n $this->messages->add(\n 'Entity - ' . $this->entityName\n . '<br>Changed - ' . print_r( $this->changed, true )\n . '<br>Data to save - ' . $dataToSave\n . '<br>All column properties - ' . $dataToSave,\n 'info'\n );\n }\n $errors = $this->healthCheck();\n if ( !empty( $errors ) ) {\n return $this->addError( $errorString . HTMLTags::getListGroup( $errors ) );\n }\n if ( $this->exists ) {\n return $this->updateDBRow( $data );\n }\n $addRow = $this->addDBRow( $data );\n if ( is_int( $addRow ) ) {\n $this->id = $addRow;\n $this->exists = true;\n }\n return $addRow;\n }",
"public function save()\n {\n $this->validate();\n if (!empty($this->_errors)) {\n return false;\n }\n\n if ($this->beforeSave() == false) {\n return false;\n }\n\n $schema = static::getSchema();\n $saveValues = array();\n foreach ($this as $col => $val) {\n if ($schema[$col]['type'] == 'datetime' && $this->$col !== null) {\n $val = $this->$col->setTimezone('UTC')->toDateTimeString();\n }\n\n if ($col == 'created' || $col == 'modified') {\n continue;\n }\n\n if (array_key_exists($col, $schema)) {\n $saveValues[$col] = $val;\n }\n }\n\n // If ID is not null, then UPDATE row in the database, else INSERT new row\n if ($this->{\"{$this->_idField}\"}) {\n // Update query\n if (array_key_exists('modified', static::getSchema())) {\n $this->modified = Carbon::now();\n $saveValues['modified'] = $this->modified->setTimezone('UTC')->toDateTimeString();\n }\n\n $success = static::queryBuilder()->update($saveValues)->where(array('id' => $this->{$this->_idField}))->execute();\n }\n else {\n // Insert query\n if (array_key_exists('created', static::getSchema())) {\n $this->created = Carbon::now();\n $saveValues['created'] = $this->created->setTimezone('UTC')->toDateTimeString();\n }\n\n $success = static::queryBuilder()->insert($saveValues)->execute();\n\n $this->{\"{$this->_idField}\"} = self::$_db->lastInsertId();\n }\n\n if ($this->afterSave() == false) {\n return false;\n }\n\n return $success;\n }",
"protected function _preSave(MetadataInterface $metaData, $exists, $identityField) {}"
] | [
"0.6760465",
"0.6688536",
"0.6451068",
"0.6444336",
"0.6422547",
"0.6414302",
"0.64114773",
"0.6371498",
"0.63624746",
"0.63462025",
"0.6336358",
"0.6328846",
"0.6301798",
"0.62957925",
"0.62911606",
"0.6268983",
"0.6267945",
"0.6266729",
"0.62522477",
"0.6242123",
"0.6225248",
"0.6220733",
"0.62196517",
"0.61999625",
"0.6169319",
"0.61622626",
"0.61413217",
"0.6124964",
"0.611918",
"0.611918",
"0.6101025",
"0.6085497",
"0.6082575",
"0.60672957",
"0.6052551",
"0.60437423",
"0.6031393",
"0.601124",
"0.601084",
"0.60071456",
"0.600501",
"0.6004165",
"0.6001743",
"0.59960264",
"0.5986079",
"0.5980266",
"0.5967966",
"0.59441173",
"0.5943253",
"0.5921479",
"0.5906326",
"0.5892848",
"0.5889349",
"0.5887989",
"0.5868911",
"0.5866389",
"0.5864595",
"0.5861484",
"0.58488005",
"0.5844933",
"0.58447206",
"0.5838332",
"0.5813627",
"0.5811299",
"0.58003885",
"0.5765754",
"0.57535493",
"0.5753348",
"0.57469565",
"0.5730475",
"0.57291335",
"0.57291335",
"0.5724455",
"0.57174236",
"0.57129997",
"0.57068896",
"0.57018983",
"0.5697904",
"0.56920767",
"0.56885815",
"0.5677643",
"0.5659324",
"0.56575924",
"0.5652962",
"0.56514746",
"0.5647717",
"0.564756",
"0.5645862",
"0.5635051",
"0.56340146",
"0.56297797",
"0.56217176",
"0.5621548",
"0.5621218",
"0.56182057",
"0.56160975",
"0.56160975",
"0.561517",
"0.5602058",
"0.55987287",
"0.5595538"
] | 0.0 | -1 |
generate search url command | public function doListingsSearch()
{
$searchUrl = $this->dispatchNow(new GenerateSearchUrl(Input::all()));
return redirect()->route('browselistings.index', $searchUrl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getSearchURI()\n {\n $q = $this->getInput('q');\n $hide_expired = $this->getInput('hide_expired');\n $hide_local = $this->getInput('hide_local');\n $priceFrom = $this->getInput('priceFrom');\n $priceTo = $this->getInput('priceTo');\n $url = $this->i8n('bridge-uri')\n . 'search/advanced?q='\n . urlencode($q)\n . '&hide_expired=' . $hide_expired\n . '&hide_local=' . $hide_local\n . '&priceFrom=' . $priceFrom\n . '&priceTo=' . $priceTo\n /* Some default parameters\n * search_fields : Search in Titres & Descriptions & Codes\n * sort_by : Sort the search by new deals\n * time_frame : Search will not be on a limited timeframe\n */\n . '&search_fields[]=1&search_fields[]=2&search_fields[]=3&sort_by=new&time_frame=0';\n return $url;\n }",
"function make_urls() {\n $url = '/search/' . $this->id . '/';\n $this->append_urls('self', $url);\n }",
"function get_search_link($query = '')\n {\n }",
"private function buildSearchURL($q){\n\t\t$this->searchURL = $this->baseURL;\n\t\t$this->searchURL .= \"?version=\".$this->version;\n\t\t$this->searchURL .= \"&recordSchema=\".$this->recordSchema;\n\t\t$this->searchURL .= \"&query=\".$q;\n\t\t$this->searchURL .= \"&operation=searchRetrieve\";\n\t\t// optinal parameters\n\t\tif(isset($this->recordPacking)) $this->searchURL .= \"&recordPacking=\".$this->recordPacking;\n\t\tif(isset($this->startRecord)) $this->searchURL .= \"&startRecord=\".$this->startRecord;\n\t\tif(isset($this->maximumRecords)) $this->searchURL .= \"&maximumRecords=\".$this->maximumRecords;\n\t}",
"public function search()\n {\n $query = Purifier::clean(Input::get('q'));\n return Redirect::away('https://www.google.com/search?q=site:www.apcow.com' . $query, 301);\n }",
"protected function getSearchFormActionURL() {}",
"private static function getSearchUrl()\n {\n return @self::CLIENT_URL_SEARCH . 'amazon/search';\n }",
"public function admin_search() {\n $url['action'] = 'index';\n \n // build a URL will all the search elements in it\n // the resulting URL will be\n // example.com/cake/posts/index/Search.keywords:mykeyword/Search.tag_id:3\n foreach ($this->data as $k=>$v){\n foreach ($v as $kk=>$vv){\n $url[$k.'.'.$kk]=$vv;\n }\n }\n \n // redirect the user to the url\n $this->redirect($url, null, true);\n }",
"public function search(){}",
"function sopac_savesearch_link() {\n $search_link = l(t('Save this search'), str_replace('/search/', '/savesearch/', $_GET['q']),\n array('query' => sopac_make_pagevars(sopac_parse_get_vars())));\n return $search_link;\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 static function search() {\r\n $result = lC_Default::find($_GET['q']);\r\n\r\n echo $result;\r\n }",
"public function search();",
"public function search();",
"function dl_custom_search_url() {\n\n\tif ( is_search() && ! empty( $_GET['s'] ) ) {\n\t\twp_redirect( home_url( \"/search/\" ) . urlencode( get_query_var( 's' ) ) );\n\t\texit();\n\t}\n\n}",
"function search() {}",
"function make_search($page)\n{\n\tglobal $script;\n\n\t$s_page = htmlspecialchars($page);\n\t$r_page = rawurlencode($page);\n\n\t// modified for Magic3 by naoki on 2008/10/6\n/*\treturn '<a href=\"' . $script . '?plugin=related&page=' . $r_page .\n\t\t'\">' . $s_page . '</a> ';*/\n\treturn '<a href=\"' . $script . WikiParam::convQuery(\"?plugin=related&page=$r_page\") . '\">' . $s_page . '</a> ';\n}",
"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}",
"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 }",
"function searchURI()\t{\n return $this->getRandomString(mt_rand(0,100));\n\t}",
"public function getSearch();",
"function get_search_feed_link($search_query = '', $feed = '')\n {\n }",
"private function getSearchUrl($search)\n {\n $categories = '';\n\n foreach (array_keys($this->categories) as $categoryId) {\n $categories .= '&c'.$categoryId.'=1';\n }\n\n return (string) 'https://sceneaccess.eu/all?search='.urlencode($search).'&method=2'.$categories;\n }",
"public function updateUrl($keyword, $start, $motor){\n $this->start=$this->start+$start; \n $keyword=trim($keyword);\n $keyword=urlencode($keyword);\n return $motor.\"/search?start=\".$this->start.\"&q=$keyword\"; \n }",
"public function actionSearch()\n {\n }",
"private function setSearchstring(){\n $search_req = $this->main->getArrayFromSearchString($_GET['content_search']);\n\n $searchstring = '';\n\n foreach($search_req as $key => $val){\n if(strlen($val) > 0){\n $searchstring .= \"`name` LIKE '%\".DB::quote($val).\"%' OR \";\n };\n };\n\n $searchstring .= \"`name` LIKE '%\".DB::quote($_GET['content_search']).\"%'\";\n\n return $searchstring;\n }",
"public function productByUrlAction()\n {\n $search = \"http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]\";\n $words = explode('/', $search);\n $lastWord = array_pop($words);\n $vars['products'] = $this->model->getProductsBySearch($lastWord);\n $this->view->render('Riding Gear', $vars);\n }",
"public static function commandURI($mnt,$command)\n{\nreturn self::uri($mnt,'?'.$command);\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}",
"public function search($search);",
"public function makeSearch($callback)\n {\n $searchAction = $callback(new SearchAction);\n\n return (new UrlGenerator($searchAction))->generate();\n }",
"public function searchAction(){\n $string = filter_input(INPUT_GET, 'string', FILTER_SANITIZE_STRING);\n $word = new Word();\n if(!empty($string)){\n print json_encode($word->search($string));\n }else{\n print json_encode($word->limitWords(20));\n }\n }",
"function search()\n\t{}",
"function search()\n\t{}",
"public function actionSearch()\n {\n $this->render(\"Search\");\n }",
"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}",
"function searchBox() {\n\t\tglobal $wgUseTwoButtonsSearchForm; ?>\n\t\t<form action=\"<?php $this->text('wgScript'); ?>\" class=\"searchform\">\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchInput(array('id' => 'searchInput', 'class' => 'form-control')); ?>\n\t\t\t</div>\n\t\t\t<div class=\"form-group\"><?php\n\t\t\t\techo $this->makeSearchButton('go', array( 'class' => 'btn btn-primary' )); ?>\n\t\t\t</div>\n\t\t</form><?php\n\t}",
"public function search()\n {\n $vereinRepository = new VereinRepository();\n $searchTerm = $_GET['searchTerm'];\n $view = new View('verein_index');\n $view->heading = 'Suchbegriff: '. $searchTerm;\n $view->title = 'Vereine';\n $view->vereine = $vereinRepository->search($searchTerm);\n\n $view->display();\n }",
"function _getCommand($name, $url)\n {\n if (substr($url, 0, 4) !== 'http') {\n $url = JURI::base().$url;\n }\n\n return $url;\n }",
"public function search()\n {\n auth_admin();\n $s_news = myUrlEncode(trim($this->input->post('s_news')));\n redirect($this->path . '/main/a' . $s_news);\n }",
"public function search()\n\t{\n\t\t\n\t}",
"function link_to_item_search($text = null, $props = array(), $uri = null)\n{\n if (!$text) {\n $text = __('Search Items');\n }\n if (!$uri) {\n $uri = apply_filters('items_search_default_url', url('items/search'));\n }\n $props['href'] = $uri . (!empty($_SERVER['QUERY_STRING']) ? '?' . $_SERVER['QUERY_STRING'] : '');\n return '<a ' . tag_attributes($props) . '>' . $text . '</a>';\n}",
"function wpb_change_search_url() {\n if ( is_search() && ! empty( $_GET['s'] ) ) {\n wp_redirect( home_url( \"/search/\" ) . urlencode( get_query_var( 's' ) ) . \"/\");\n exit();\n }\n}",
"private function _synth_start_url($query){\n\t\t$REQ = json_decode($query['ep'],true);\n\t\t$this->dockey = (trim(@$REQ['key']))?:'services';\n\t\t$this->terms = (trim(@$REQ['terms']))?:'';\n\t\t$this->location = (trim(@$REQ['location']))?:'';\n\n\t\t$encq = urlencode(sprintf('%s NEAR:%s',$this->terms,$this->location));\n\t\t$this->url = sprintf('%s?q=%s&ie=utf-8&oe=utf-8',$this->base,$encq);\n\t}",
"public function getAmazonSearchLink() {\n\t\t$baseUrl = \"https://www.amazon.com/s/?url=search-alias%3Dstripbooks&field-keywords=\";\n\t\treturn $baseUrl . urlencode($this->wordMark);\n\t}",
"public function queryString();",
"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}",
"public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }",
"function getsearch($site,$n,$from,$auth) {\n $this->auth=$auth;\n $this->sitenumber=$site;\n $this->n=$n;\n $this->home=getenv(\"DOCUMENT_ROOT\");\n $this->from=$from;\n $this->path=substr($this->from,1,4);\n if ($this->sitenumber==1) {$this->path='';}\n if ($this->sitenumber==2) {$this->path='eng/';}\n if ($this->sitenumber==3) {$this->path='cons/';}\n if ($this->sitenumber==4) {$this->path='cons/eng/';}\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 function search()\r\n {\r\n $this->setTpl('search.htm');\r\n $this->setControllerTitle('Apollo');\r\n $this->setCurrentControllerName('Rechecher une condition');\r\n }",
"function edan_search_object_shortcode($atts)\n {\n $edanURL = NULL;\n $nosearch = False;\n\n if($atts)\n {\n if(array_key_exists('url', $atts))\n {\n $edanURL = $atts['url'];\n $nosearch = True;\n }\n }\n\n $call = new edan_object_call();\n $object = new edan_object_view($call->get($edanURL), $nosearch);\n\n return $object->get_content();\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 }",
"Function make_link($str_keyword, \r\n $str_prodbrand, \r\n $str_prodcategory, \r\n $resultsearch, \r\n $str_fieldname, \r\n $str_orderby)\r\n{\r\n $str_link = \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?keyword=\".$str_keyword.\"&prodbrand=\".$str_prodbrand.\"&prodcategory=\".$str_prodcategory.\"&sortfield=\".$str_fieldname.\"&orderby=\".$str_orderby.\"\\\" ALT=\\\"Sorteren op: \".$str_fieldname.\"\\\">\";\r\n return $str_link;\r\n}",
"public function executeSearch(sfWebRequest $request) {\n \t// look into PHP buffering to facilitate with GATC setting before redirecting to exact match\n \t$this->getResponse()->setSlot('body_class','search');\n \t$this->query = trim($request->getParameter('q'));\n \tif(!in_array($this->query, sfConfig::get('app_search_default_queries'))) {\n \t\t$SA = new SearchAgent($this->query);\n \t\t// if exact match is found redirect to the part's route\n \t\tif($route = $SA->search()) $this->redirect($route);\n \t\telse { // otherwise, see if similar parts exist for the user's query\n \t\t\tif($this->similar_parts = $SA->getSimilarParts()) {\n\t \t\t\t$this->count = $this->similar_parts[0]['count'];\n\t \t\t\t$this->search_routes = $SA->getSearchRoutes();\n\t \t\t\t$this->search_routes_class = $this->getSearchRoutesClass(count($this->search_routes));\n\t \t\t\t$this->num_serps = $this->count <= sfConfig::get('app_search_pagination_max_items') ? 1 : ceil($this->count / sfConfig::get('app_search_pagination_max_items'));\n\t \t\t\t$item_count = count($this->similar_parts);\n\t \t\t\t$rem = $item_count % 2 == 0 ? 2 : 1;\n\t \t\t\t$this->bottom_idx = $item_count - $rem;\n\t \t\t\t$this->getResponse()->setTitle(\"Product Search: '{$this->query}'\");\n\t \t\t\treturn sfView::SUCCESS;\n \t\t\t} else {\n \t\t\t\t// there is nothing in the database like the user's query\n \t\t\t\t$this->getResponse()->setTitle(\"Product Search: '{$this->query}'\");\n \t\t\t\treturn sfView::ALERT;\n \t\t\t}\n \t\t}\n \t} else {\n \t\t// user didn't enter anything into search box\n \t\t$this->getResponse()->setTitle('Product Search: Missing Query Parameter');\n \t\treturn sfView::ALERT;\n \t}\n }",
"function search() {\n // ...\n }",
"public function searchAction() {\n parent::searchAction();\n }",
"function buildSearchDetail(array $params = array()) {\n return url(\"tim-kiem\") . (count($params) > 0 ? '?' . http_build_query($params) : '');\n }",
"function cosmos_search_redirect() {\n\n\tglobal $wp_rewrite;\n\n\tif ( $wp_rewrite->using_permalinks() && is_search() && !empty($_GET['s']) ) {\n\n\t\twp_redirect(home_url('/search/' . str_replace(array(' ', '%20'), array('+', '+'), urlencode(get_query_var('s')))), 301);\n\t\texit();\n\t}\n}",
"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 get_command_url() {\r\n\t\t$language = ($this->has_language() ? $this->language : cur_lang());\r\n\t\t$controller = ($this->controller == 'home' && $this->action == 'index' && !$this->has_parameters() ? '' : $this->controller);\r\n\t\t$action = ($this->action == 'index' && !$this->has_parameters() ? '' : $this->action);\r\n\t\t$controller_parameters = ($this->has_parameters() ? implode('/', $this->parameters) : '/');\r\n\t\t$get_parameters = ($this->has_url_get_parameters() ? '?'.$this->url_get_parameters : '');\t\r\n\t\t\r\n\t\treturn DIRECTORY_ROOT.$language.($controller == '' ? '' : '/'.$controller).($action == '' ? '' : '/'.$action).($controller_parameters == '/' ? '' : '/'.$controller_parameters).$get_parameters;\r\n\t}",
"function suggestion_link($locum_result) {\n $url_prefix = variable_get('sopac_url_prefix', 'cat/seek');\n $sugg_link = l($locum_result['suggestion'], $url_prefix . '/search/' . $locum_result['type'] . '/' . $locum_result['suggestion'],\n array('query' => sopac_make_pagevars(sopac_parse_get_vars())));\n return $sugg_link;\n}",
"function url($url){\n $url=ereg_replace(\"[&?]+$\", \"\", $url);\n \n $url .= ( strpos($url, \"?\") != false ? \"&\" : \"?\" ).urlencode($this->name).\"=\".$this->id;\n \n return $url;\n }",
"public function actionSearch()\n {\n $currentPage = Yii::$app->request->get('page') ? Yii::$app->request->get('page') : 1;\n $query = Yii::$app->request->get('search');\n\n $repos = GitHubApi::findRepo($query, $currentPage);\n $pages = new Pagination(['totalCount' => $repos['total_count'], 'pageSize' => 20]);\n $pages->pageSizeParam = false;\n\n return $this->render('search', [\n 'repos' => $repos,\n 'pages' => $pages,\n ]);\n }",
"protected function get_searchurl( $searchtype, $searchinput ) {\n\n\t\tif( $searchtype == 'owner'){\n\t\t\t// fetch based on access token\n\t\t\treturn sprintf( 'https://api.instagram.com/v1/users/self/media/recent?access_token=%s&count=%s%s', $this->access_token, $this->count, $this->pagination );\n\t\t}\n\t\telseif ( $searchtype == 'users' && isset($_POST['checktype']) && $_POST['checktype'] == 'users' ) {\n\t\t\t// searching usernames\n\t\t\treturn sprintf( 'https://api.instagram.com/v1/%s/%s/media/recent/?access_token=%s&count=%s', $searchtype, $searchinput, $this->access_token, $this->count );\n\n\t\t} else {\n\t\t\t// search hastags, selected users or locations\n\t\t\treturn sprintf( 'https://api.instagram.com/v1/%s/%s/media/recent?access_token=%s&count=%s%s', $searchtype, $searchinput, $this->access_token, $this->count, $this->pagination );\n\t\t}\n\n\t}",
"public function buildQueryString();",
"function searchs()\n\t{\n\t $url1 = explode('/',$_GET['url']);\t\n\t\t$this->view->title = 'Search seance hemodialyse';\n\t $this->view->userListviewo = $_GET['o']; //criter de choix\n\t $this->view->userListviewq = $_GET['q']; //key word \n\t\t$this->view->userListviewp =$url1[2]; // parametre 2 page limit 2,3\n\t\t$this->view->userListviewl =10; // parametre 3 nombre de ligne par page limit 2,3 \n\t\t$this->view->userListviewb =20; // parametre nombre de chiffre dan la barre navigation\n\t\t$this->view->userListview = $this->model->userSearchs($this->view->userListviewo,$this->view->userListviewq,$this->view->userListviewp,$this->view->userListviewl);\n\t\t$this->view->userListview1= $this->model->userSearchs1($this->view->userListviewo,$this->view->userListviewq); // compte total pour bare de navigation\n\t\t$this->view->render($this->route.'/seance');\n\t}",
"function getGeoSearchUrl($ar){\n $p = new XParam($ar, array());\n $table = $p->get('table');\n $fieldname = $p->get('fieldname');\n $moid = $this->_moid;\n $templates = 'googlesearch.html';\n return $GLOBALS['TZR_SESSION_MANAGER']::complete_self(true, true).\"skip=1&&moid={$moid}&class=XModMap&table={$table}&field={$fieldname}&provider=google&function=geoSearch&template=xmodmap/geosearch.html&tplentry=br\";\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 function generateURLListFile() {\n\t\t$content = '';\n\t\t$allowedURLs = $this->indexer->getAllowedURLs();\n\t\t$recordSet = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,tx_mnogosearch_url',\n\t\t\t'tx_mnogosearch_urllog', '');\n\t\t$GLOBALS['TYPO3_DB']->sql_query('START TRANSACTION');\n\t\twhile (false !== ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($recordSet))) {\n\t\t\t$addUrl = false;\n\t\t\tforeach ($allowedURLs as $allowedURL) {\n\t\t\t\tif (substr($allowedURL, 0, 6) == 'htdb:/') {\n\t\t\t\t\t$addUrl = ($allowedURL == dirname($row['tx_mnogosearch_url']));\n\t\t\t\t}\n\t\t\t\telseif (substr($row['tx_mnogosearch_url'], 0, 6) != 'htdb:/') {\n\t\t\t\t\tif ($allowedURL{0} == '/') {\n\t\t\t\t\t\t// regexp\n\t\t\t\t\t\t$addUrl = preg_match($allowedURL, $row['tx_mnogosearch_url']);\n\t\t\t\t\t}\n\t\t\t\t\telseif (strpos($allowedURL, '*')) {\n\t\t\t\t\t\t// wildcard\n\t\t\t\t\t\t$regexp = str_replace('/', '\\/', str_replace('*', '.*', $allowedURL));\n\t\t\t\t\t\t$addUrl = preg_match('/' . $regexp . '/', $row['tx_mnogosearch_url']);\n\t\t\t\t\t}\n\t\t\t\t\telseif (strpos($row['tx_mnogosearch_url'], $allowedURL) === 0) {\n\t\t\t\t\t\t// normal string\n\t\t\t\t\t\t$addUrl = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($addUrl) {\n\t\t\t\t\t$content .= $row['tx_mnogosearch_url'] . chr(10);\n\t\t\t\t\t$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_mnogosearch_urllog', 'uid=' . $row['uid']);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_free_result($recordSet);\n\t\t$name = '';\n\t\tif ($content) {\n\t\t\t$name = tempnam(sys_get_temp_dir(), 'mnogo-');\n\t\t\tif (!@file_put_contents($name, $content)) {\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_query('ROLLBACK');\n\t\t\t\tthrow new Exception(sprintf('Unable to create URL list file \"%s\"', $name));\n\t\t\t}\n\t\t}\n\t\t$GLOBALS['TYPO3_DB']->sql_query('COMMIT');\n\n\t\treturn $name;\n\t}",
"public function getSearch($parameters = array());",
"public function indexAction()\n {\n $query = !empty(trim($_GET['s'])) ? trim($_GET['s']) : null;\n if($query)\n {\n $products = \\R::find('product', \"title LIKE ? AND status = '1'\", [\"%{$query}%\"]);\n }\n $this->setMeta('Поиск по: ' . h($query));\n $this->set(compact('products', 'query'));\n }",
"function get_search_query($escaped = \\true)\n {\n }",
"public function searchAction(){\r\n \t$request = $this->getRequest();\r\n \t$q = $request->query->get('q');\r\n \tif(trim($q) == null || trim($q) == \"Encontre cupons de compra coletiva\"){\r\n \t\treturn $this->redirectFlash($this->generateUrl('aggregator_aggregator_index'), 'Digite um termo para a busca', 'error');\r\n \t}\r\n \t$ret['q'] = $q;\r\n \t$ret['breadcrumbs'][]['title'] = 'Resultado da busca por \"'.$q.'\" em '.$this->get('session')->get('reurbano.user.cityName');\r\n \treturn $ret;\r\n }",
"public function get()\n {\n return \"/V1/search\";\n }",
"public function search($query);",
"function fabric_nice_search_redirect() {\n global $wp_rewrite;\n if (!isset($wp_rewrite) || !is_object($wp_rewrite) || !$wp_rewrite->using_permalinks()) {\n return;\n }\n\n $search_base = $wp_rewrite->search_base;\n if (is_search() && !is_admin() && strpos($_SERVER['REQUEST_URI'], \"/{$search_base}/\") === false) {\n wp_redirect(home_url(\"/{$search_base}/\" . urlencode(get_query_var('s'))));\n exit();\n }\n}",
"function publishs_url()\r\n {\r\n \t$query = '';\r\n \t$page = 'partlist.php';\r\n if(isset($_GET[\"key\"])){\r\n \t \t$value = trim($_GET[\"key\"]);\r\n \t \tif($value != \"\"){\r\n\t \t $query = '?key='.$value ; \t \t \t\r\n \t \t}\r\n \t}\r\n\t$url = $page.$query;\r\n\techo $url;\r\n }",
"public function actionIndex(){ \n echo 'REST API';\n //echo \\admin\\components\\GoogleURLShortner::widget([\"url\" => \"http://www.google.com\"]);\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}",
"function items_output_url($output, $otherParams = array())\n{\n $queryParams = array();\n\n // Provide additional query parameters if the current page is items/browse.\n $request = Zend_Controller_Front::getInstance()->getRequest();\n if ('items' == $request->getControllerName()\n && 'browse' == $request->getActionName()\n && 'default' == $request->getModuleName()\n ) {\n $queryParams = $_GET;\n unset($queryParams['submit_search']);\n unset($queryParams['page']);\n }\n $queryParams = array_merge($queryParams, $otherParams);\n $queryParams['output'] = $output;\n\n return url(array('controller' => 'items', 'action' => 'browse'), 'default', $queryParams);\n}",
"public function index()\n\t{\n\t\t$this->error('usage: ... search builder <build|trim>');\n\t}",
"public function search()\n {\n\n }",
"public function search()\n {\n\n }",
"private function getQueryString()\n {\n return \\apply_filters('swiftype_search_query_string', stripslashes(\\get_search_query(false)));;\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 }",
"function _admin_search_query()\n {\n }",
"public function ov_search($name, $value = ''){\n $args = func_get_args(); array_shift($args); array_shift($args);\n return $this->generate_input('search', $name, $value, true, $args);\n }",
"public function actionSearch($info){\n $cl = new SphinxClient();\n $cl->SetServer ( '127.0.0.1', 9312);\n//$cl->SetServer ( '10.6.0.6', 9312);\n//$cl->SetServer ( '10.6.0.22', 9312);\n//$cl->SetServer ( '10.8.8.2', 9312);\n $cl->SetConnectTimeout ( 10 );\n $cl->SetArrayResult ( true );\n// $cl->SetMatchMode ( SPH_MATCH_ANY);\n $cl->SetMatchMode ( SPH_MATCH_EXTENDED2);\n $cl->SetLimits(0, 1000);\n// $info = '戴尔';\n $res = $cl->Query($info, 'goods');//shopstore_search\n//print_r($cl);\n// print_r($res);\n// var_dump($res);exit;\n if (isset($res)){\n $ids=[];\n foreach ($res['matches'] as $r){\n $ids[] = $r['id'];\n }\n $pager = new Pagination();\n $pager->totalCount = Goods::find()->where(['in','id',$ids])->count();\n $pager->defaultPageSize = 4;\n $goods = Goods::find()->where(['in','id',$ids])->andWhere(['status'=>1])->offset($pager->offset)->limit($pager->limit)->all();\n //实例化表单模型\n// var_dump($ids);exit;\n// $goods = Goods::find()->where(['goods_category_id'=>$parent_id])->andWhere(['status'=>1])->all();\n// var_dump($pager);exit;\n return $this->render('/list/index',['goods'=>$goods,'pager'=>$pager]);\n\n\n }else{\n\n }\n }",
"public function search($params = []);",
"function getsearch_get(){\n $keyword = $this->get('keyword');\n $result = $this->lecturers_model->getsearch_all($keyword);\n $this->response($result); \n\n }",
"public function generate_url()\n {\n }",
"protected function quicksearch()\n {\n $words = $this->getWords();\n $logged_in = APP_User::isBWLoggedIn('NeedMore,Pending');\n if (!$logged_in) {\n $request = PRequest::get()->request;\n if (!isset($request[0])) {\n $login_url = 'login';\n } else switch ($request[0]) {\n case 'login':\n case 'main':\n case 'start':\n $login_url = 'login';\n break;\n default:\n $login_url = 'login/'.htmlspecialchars(implode('/', $request), ENT_QUOTES);\n }\n } else {\n $username = isset($_SESSION['Username']) ? $_SESSION['Username'] : '';\n }\n\n if (class_exists('MOD_online')) {\n $who_is_online_count = MOD_online::get()->howManyMembersOnline();\n } else {\n // echo 'MOD_online not active';\n if (isset($_SESSION['WhoIsOnlineCount'])) {\n $who_is_online_count = $_SESSION['WhoIsOnlineCount']; // MOD_whoisonline::get()->whoIsOnlineCount();\n } else {\n $who_is_online_count = 0;\n }\n }\n PPostHandler::setCallback('quicksearch_callbackId', 'SearchmembersController', 'index');\n\n require TEMPLATE_DIR . 'shared/roxpage/quicksearch.php';\n }",
"public function urlTo(string $cql, int $start = 1, int $count = 10, array $extraParams = []): string\n {\n $qs = array(\n 'operation' => 'searchRetrieve',\n 'version' => $this->version,\n 'recordSchema' => $this->schema,\n 'maximumRecords' => $count,\n 'query' => $cql\n );\n\n if ($start != 1) {\n // At least the BIBSYS SRU service, specifying startRecord results in\n // a less clear error message when there's no results\n $qs['startRecord'] = $start;\n }\n\n foreach ($extraParams as $key => $value) {\n $qs[$key] = $value;\n }\n\n return $this->url . '?' . http_build_query($qs);\n }",
"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 }",
"public function index()\n { \n echo \"Ejecute in BASH (Custom for bash)\\n\";\n echo \"\\n\";\n sleep(3);\n echo \"=======================================\\n\";\n echo \"Search Data in www.subingles.com\\n\";\n echo \"=======================================\\n\";\n // paginador init \n $offset = 0;\n $limit = 100;\n $this->db->from($this->tb_video);\n $count = $this->db->count_all_results();\n\n $total_pages = ($count > 0) ? ceil($count/$limit) : 1; //echo $total_pages; exit;\n\n for ($page = 1; $page <= $total_pages; $page++) {\n $offset = ($limit * $page) - $limit;\n $queryLimit = \" LIMIT $offset,$limit \";\n $query = \"SELECT id, title FROM {$this->tb_video} \" . $queryLimit;\n $stm = $this->db->query($query);\n $result = $stm->result_array();\n\n foreach ($result as $key => $value) {\n $part = explode('-', $result[$key]['title']);\n $song = $part[0];\n $artist = $part[1]; \n \n $id = $result[$key]['id']; \n $this->searchAndUpdate($id, $artist .' '. $song);\n echo \" [{$id}] = \" . $artist . ' ' . $song .\"\\n\"; \n }\n echo \"break (stop request for 5'')\\n\";\n sleep(5); // sleep for heavy load in server\n }\n // paginador end\n\n \n \n }",
"public function execute_search()\n {\n\n $search_term = $this->input->post('search');\n\n $v_data = array(\"results\" => $this->Manage_roles_model->get_role($search_term));\n\n $data = array(\n \"title\" => $this->site_model->display_page_title(),\n \"content\" => $this->load->view(\"backoffice/execute_search\", $v_data, true),\n );\n $this->load->view(\"site/layouts/layout\", $data);\n\n }",
"abstract public function adminUrl($query = '', $xhtml = true);",
"private function generate_email_search_link( $email ) {\n\n\t\tif ( empty( $email ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'search' => array(\n\t\t\t\t\t'place' => 'people',\n\t\t\t\t\t'term' => rawurlencode( $email ),\n\t\t\t\t),\n\t\t\t),\n\t\t\twp_mail_smtp()->get_admin()->get_admin_page_url( Area::SLUG . '-logs' )\n\t\t);\n\n\t\treturn '<a href=\"' . esc_url( $url ) . '\">' . esc_html( $email ) . '</a>';\n\t}",
"public function getSearch(): string\n {\n return $this->search;\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}"
] | [
"0.7015534",
"0.6540452",
"0.6464724",
"0.64248204",
"0.6107757",
"0.6085005",
"0.60819316",
"0.6077649",
"0.6058583",
"0.6042421",
"0.60402256",
"0.60303915",
"0.6026868",
"0.6026868",
"0.6026284",
"0.59832156",
"0.596534",
"0.59492844",
"0.5883256",
"0.588316",
"0.5879867",
"0.5862759",
"0.5861641",
"0.5846103",
"0.5844336",
"0.5825241",
"0.5821638",
"0.58181316",
"0.58068997",
"0.5787578",
"0.5769489",
"0.57381964",
"0.57213336",
"0.57213336",
"0.5694934",
"0.5687367",
"0.56651217",
"0.565994",
"0.5614181",
"0.56128424",
"0.56096303",
"0.5605393",
"0.55997974",
"0.55927074",
"0.5583567",
"0.5582101",
"0.557162",
"0.5570999",
"0.5567254",
"0.55634665",
"0.55427986",
"0.5534379",
"0.5529881",
"0.5526575",
"0.5522368",
"0.55158794",
"0.55136263",
"0.5508866",
"0.5504366",
"0.5498007",
"0.5495634",
"0.548982",
"0.5477408",
"0.547288",
"0.54613245",
"0.54611456",
"0.545686",
"0.54553473",
"0.5454114",
"0.5448768",
"0.5445325",
"0.5430342",
"0.54163516",
"0.5411849",
"0.5410754",
"0.5405161",
"0.53969467",
"0.53858745",
"0.5384506",
"0.53746635",
"0.53681016",
"0.53645074",
"0.5364074",
"0.5364074",
"0.5358361",
"0.5357031",
"0.53514695",
"0.53385043",
"0.5326712",
"0.5321433",
"0.53213423",
"0.5321154",
"0.5318533",
"0.53141445",
"0.5300536",
"0.5297694",
"0.5297322",
"0.52884805",
"0.52859306",
"0.5278462",
"0.5265496"
] | 0.0 | -1 |
Run the database seeds. | public function run()
{
$data = [
1 => [2 => ['nilai' => 450000], 8 => ['nilai' => 65000000], 11 => ['nilai' => 5], 17 => ['nilai' => 10000000], 22 => ['nilai' => 10], ],
2 => [2 => ['nilai' => 400000], 8 => ['nilai' => 65000000], 11 => ['nilai' => 6], 17 => ['nilai' => 10000000], 22 => ['nilai' => 10], ],
3 => [2 => ['nilai' => 700000], 8 => ['nilai' => 70000000], 11 => ['nilai' => 7], 17 => ['nilai' => 10000000], 22 => ['nilai' => 10], ],
4 => [2 => ['nilai' => 650000], 8 => ['nilai' => 80000000], 12 => ['nilai' => 10], 18 => ['nilai' => 20000000], 23 => ['nilai' => 20], ],
5 => [2 => ['nilai' => 500000], 8 => ['nilai' => 80000000], 12 => ['nilai' => 10], 17 => ['nilai' => 10000000], 23 => ['nilai' => 20], ],
6 => [2 => ['nilai' => 400000], 8 => ['nilai' => 80000000], 13 => ['nilai' => 15], 17 => ['nilai' => 10000000], 22 => ['nilai' => 10], ],
7 => [2 => ['nilai' => 500000], 9 => ['nilai' => 100000000], 13 => ['nilai' => 20], 17 => ['nilai' => 10000000], 24 => ['nilai' => 25], ],
8 => [2 => ['nilai' => 500000], 8 => ['nilai' => 95000000], 13 => ['nilai' => 20], 18 => ['nilai' => 20000000], 22 => ['nilai' => 10], ],
9 => [2 => ['nilai' => 400000], 8 => ['nilai' => 65000000], 12 => ['nilai' => 10], 18 => ['nilai' => 20000000], 22 => ['nilai' => 10], ],
10 => [2 => ['nilai' => 550000], 8 => ['nilai' => 80000000], 11 => ['nilai' => 5], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
11 => [2 => ['nilai' => 450000], 8 => ['nilai' => 90000000], 11 => ['nilai' => 5], 18 => ['nilai' => 20000000], 22 => ['nilai' => 10], ],
12 => [3 => ['nilai' => 750000], 8 => ['nilai' => 95000000], 11 => ['nilai' => 5], 18 => ['nilai' => 20000000], 23 => ['nilai' => 20], ],
13 => [2 => ['nilai' => 400000], 7 => ['nilai' => 10000000], 11 => ['nilai' => 7], 17 => ['nilai' => 10000000], 23 => ['nilai' => 15], ],
14 => [2 => ['nilai' => 400000], 8 => ['nilai' => 65000000], 11 => ['nilai' => 8], 18 => ['nilai' => 20000000], 23 => ['nilai' => 15], ],
15 => [2 => ['nilai' => 600000], 8 => ['nilai' => 75000000], 11 => ['nilai' => 9], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
16 => [2 => ['nilai' => 500000], 8 => ['nilai' => 68000000], 13 => ['nilai' => 15], 17 => ['nilai' => 15000000], 22 => ['nilai' => 10], ],
17 => [2 => ['nilai' => 400000], 8 => ['nilai' => 80000000], 13 => ['nilai' => 15], 17 => ['nilai' => 15000000], 22 => ['nilai' => 10], ],
18 => [2 => ['nilai' => 400000], 6 => ['nilai' => 9500000], 12 => ['nilai' => 10], 17 => ['nilai' => 15000000], 22 => ['nilai' => 10], ],
19 => [2 => ['nilai' => 400000], 8 => ['nilai' => 70000000], 12 => ['nilai' => 10], 18 => ['nilai' => 20000000], 22 => ['nilai' => 10], ],
20 => [3 => ['nilai' => 750000], 8 => ['nilai' => 80000000], 12 => ['nilai' => 10], 18 => ['nilai' => 20000000], 23 => ['nilai' => 15], ],
21 => [3 => ['nilai' => 750000], 8 => ['nilai' => 90000000], 12 => ['nilai' => 10], 17 => ['nilai' => 10000000], 23 => ['nilai' => 15], ],
22 => [2 => ['nilai' => 450000], 8 => ['nilai' => 95000000], 12 => ['nilai' => 10], 18 => ['nilai' => 20000000], 23 => ['nilai' => 20], ],
23 => [2 => ['nilai' => 400000], 7 => ['nilai' => 10000000], 12 => ['nilai' => 10], 18 => ['nilai' => 20000000], 23 => ['nilai' => 20], ],
24 => [2 => ['nilai' => 500000], 7 => ['nilai' => 10000000], 13 => ['nilai' => 15], 17 => ['nilai' => 15000000], 23 => ['nilai' => 20], ],
25 => [2 => ['nilai' => 400000], 8 => ['nilai' => 65000000], 13 => ['nilai' => 15], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
26 => [2 => ['nilai' => 400000], 8 => ['nilai' => 75000000], 13 => ['nilai' => 20], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
27 => [2 => ['nilai' => 500000], 7 => ['nilai' => 10000000], 13 => ['nilai' => 20], 17 => ['nilai' => 15000000], 22 => ['nilai' => 10], ],
28 => [2 => ['nilai' => 600000], 8 => ['nilai' => 80000000], 13 => ['nilai' => 15], 18 => ['nilai' => 20000000], 23 => ['nilai' => 15], ],
29 => [2 => ['nilai' => 400000], 8 => ['nilai' => 95000000], 13 => ['nilai' => 15], 18 => ['nilai' => 20000000], 23 => ['nilai' => 15], ],
30 => [2 => ['nilai' => 450000], 8 => ['nilai' => 65000000], 12 => ['nilai' => 10], 17 => ['nilai' => 10000000], 22 => ['nilai' => 10], ],
31 => [2 => ['nilai' => 450000], 8 => ['nilai' => 80000000], 13 => ['nilai' => 15], 18 => ['nilai' => 20000000], 23 => ['nilai' => 15], ],
32 => [2 => ['nilai' => 400000], 8 => ['nilai' => 90000000], 13 => ['nilai' => 15], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
33 => [2 => ['nilai' => 400000], 8 => ['nilai' => 75000000], 12 => ['nilai' => 10], 17 => ['nilai' => 15000000], 23 => ['nilai' => 20], ],
34 => [2 => ['nilai' => 400000], 8 => ['nilai' => 68000000], 13 => ['nilai' => 15], 18 => ['nilai' => 20000000], 23 => ['nilai' => 20], ],
35 => [2 => ['nilai' => 450000], 8 => ['nilai' => 80000000], 12 => ['nilai' => 12], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
36 => [3 => ['nilai' => 750000], 9 => ['nilai' => 100000000], 12 => ['nilai' => 10], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
37 => [3 => ['nilai' => 750000], 8 => ['nilai' => 65000000], 12 => ['nilai' => 10], 17 => ['nilai' => 15000000], 22 => ['nilai' => 10], ],
38 => [3 => ['nilai' => 750000], 8 => ['nilai' => 75000000], 12 => ['nilai' => 10], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
39 => [1 => ['nilai' => 350000], 8 => ['nilai' => 68000000], 12 => ['nilai' => 10], 18 => ['nilai' => 20000000], 23 => ['nilai' => 15], ],
40 => [1 => ['nilai' => 250000], 8 => ['nilai' => 80000000], 13 => ['nilai' => 20], 18 => ['nilai' => 20000000], 22 => ['nilai' => 10], ],
41 => [2 => ['nilai' => 650000], 8 => ['nilai' => 95000000], 13 => ['nilai' => 20], 18 => ['nilai' => 20000000], 22 => ['nilai' => 10], ],
42 => [3 => ['nilai' => 850000], 8 => ['nilai' => 65000000], 13 => ['nilai' => 20], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
43 => [2 => ['nilai' => 400000], 8 => ['nilai' => 80000000], 11 => ['nilai' => 5], 17 => ['nilai' => 15000000], 23 => ['nilai' => 15], ],
];
for ($i=1; $i < 44; $i++) {
$p = Produk::findOrFail($i);
$p->ranges()->attach($data[$i]);
}
} | {
"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 value of data | public function getData()
{
return $this->data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValue() {\n\t\treturn $this->data[\"value\"];\n\t}",
"public function getValue()\n\t{\n\t\treturn $this->data['value'];\n\t}",
"public function getValue(){\n return $this->getData();\n }",
"public function getData()\n\t{\n\t\treturn $this->value ? $this->value : $this->input;\n\t}",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue()\n {\n return $this->getOriginData('value');\n }",
"public function getValue(){\n \treturn $this->value;\n }",
"public function getData()\n {\n $rtn = $this->data['data'];\n\n return $rtn;\n }",
"public function get_value()\n {\n }",
"public function get_value()\n {\n }",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue()\n {\n\treturn $this->value;\n }",
"public function getData(){\n\t\treturn $this->data;\n\t}",
"public function getData(){\n\t\treturn $this->data;\n\t}",
"public function getData(){\n\t\treturn $this->data;\n\t}",
"public function getValue()\n {\n\t\treturn $this->value;\n\t}",
"public function getData() {\r\n\t\treturn $this->_data;\r\n\t}",
"public function &getValue();",
"function getValue(){\r\n\t\treturn $this->value;\r\n\t}",
"function getData() {\n\t\treturn $this->data;\n\t}",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->m_data->getData();\n\t}",
"public function getData() {\n\t\treturn $this->data;\n\t}",
"public function getData() {\n\t\treturn $this->data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getValue()\n {\n return $this->get(self::_VALUE);\n }",
"public function getValue()\n {\n return $this->get(self::_VALUE);\n }",
"public function getData()\n\t{\n\t\treturn $this->_data;\n\t}",
"public function getValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue()\n {\n return $this->get(self::VALUE);\n }",
"public function getValue()\n {\n return $this->get(self::VALUE);\n }",
"public function getValue()\r\n {\r\n return $this->value;\r\n }",
"public function getValue() {\n\t\treturn $this -> value;\n\t}",
"public function getData()\r\n {\r\n return $this->data;\r\n }",
"public final function getData(){\n return $this->data;\n }",
"public function getData() {\n\t\treturn $this->Data;\n\t}",
"public static function getData() {}",
"public function getData()\n\t\t{\n\t\t\treturn $this->_data;\n\t\t}",
"public function getValue(){\n return $this->value;\n }",
"public function getValue(){\n return $this->value;\n }",
"public function getData() \n\t{\n return $this->data;\n }",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function getValue(){\n return $this->_value;\n }",
"public function get_data() {\n\t\treturn $this->data;\n\t}",
"protected function getValue() {\r\n return $this->_value;\r\n }",
"public function getValue()\n {\n return $this->value;\n }",
"public function getValue()\n {\n return $this->value;\n }"
] | [
"0.8184383",
"0.8111842",
"0.80909264",
"0.776158",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.76295686",
"0.7532714",
"0.74714357",
"0.74672854",
"0.7456461",
"0.7456461",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7449895",
"0.7448192",
"0.7448192",
"0.7448192",
"0.7448192",
"0.7448192",
"0.7446157",
"0.7403126",
"0.7403126",
"0.7403126",
"0.73972636",
"0.739656",
"0.7394979",
"0.7341132",
"0.7333342",
"0.7326639",
"0.7326639",
"0.7325065",
"0.7325065",
"0.7325065",
"0.7325065",
"0.7310808",
"0.73105717",
"0.73105717",
"0.73101735",
"0.73101735",
"0.73101735",
"0.73101735",
"0.73101735",
"0.7308139",
"0.7308139",
"0.73033327",
"0.7298489",
"0.72963965",
"0.72963965",
"0.72963965",
"0.72963965",
"0.72963965",
"0.72963965",
"0.72937644",
"0.72937644",
"0.7282048",
"0.72679496",
"0.7266599",
"0.7265903",
"0.72645426",
"0.72636056",
"0.72634405",
"0.7263226",
"0.7263226",
"0.72613996",
"0.725231",
"0.725231",
"0.7245068",
"0.72432154",
"0.72342145",
"0.72257257",
"0.72257257"
] | 0.0 | -1 |
Set the value of data | public function setData($data)
{
$this->data = $data;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function setData($data) {}",
"public function set($data);",
"public function setData($data)\n {\n $this->_data = $data;\n }",
"private function setData($data)\n {\n \t$this->data = $data;\n }",
"public function set_data($data)\n {\n }",
"public function set_data($data)\n {\n }",
"public function setData($data)\r\n {\r\n }",
"public function setData($data)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t}",
"public function setData($data) \n\t{\n $this->data = $data;\n }",
"public function setData( $data )\n {\n $this->data = $data;\n }",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"public function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"public function setData($data) {\n $this->data = $data;\n }",
"public function setData($data)\n {\n $this->data = $data;\n }",
"public function setData($data)\n {\n $this->data = $data;\n }",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function set_data($data)\n {\n $this->data = $data;\n }",
"function setData($data)\n {\n $this->data = $data;\n }",
"final public function setData($data) {\n $this->data = $data;\n }",
"public function setData($data) { \n $this->data = $data; \n }",
"public function setData($data){\n\t\t$this->_storage = $data;\n\t\t\n\t\t// set update flag\n\t\t$this->_isModified = true;\n\t\t\n\t\t// new data available\n\t\t$this->_dataAvailable = true;\n\t}",
"public function setData($_data)\n {\n $this->_data = $_data;\n }",
"public function setData($data): void\n {\n $this->data = $data;\n }",
"function set_data($name, $value) {\n $this->data[$name] = $value;\n }",
"public function setData($data) {\n $this->data = (string) $data;\n }",
"public function setData(array $data) {\n\t\t$this->_data = $data;\n\t}",
"public function setData( $data ) {\n\t\t$this->data = $data;\n\t\t$this->addField( new ACHRecordField([4,83], $data) );\n\t}",
"public function setData (array $data) : void {\n\t\t$this->data = $data;\n\t}",
"public function setData($data)\n {\n return $this->set('data', $data);\n }",
"function setData($data)\n {\n $this->date=$data;\n }",
"function set_data($name, $value)\n {\n }",
"public static function setData($data)\n {\n self::$rawData = $data;\n }",
"public function setData()\n {\n }",
"public function setData()\n {\n }",
"public function setData()\n {\n }",
"public function setData($data = array())\n {\n $this->data = (string) $data;\n\n $this->update();\n }",
"public function setData($value)\n {\n $this->validateString('Data', $value);\n $this->validateNotNull('Data', $value);\n\n if ($this->data['data'] === $value) {\n return;\n }\n\n $this->data['data'] = $value;\n $this->setModified('data');\n }",
"function setData ($data) {\n if ($data !== ($oldData = $this->data)) {\n $this->data = $data;\n if ($this->resetCacheOnDataChange($oldData, $data)) \n $this->resetCache();\n }\n }",
"public static function setData(Data $data)\n {\n self::$data = $data;\n }",
"public function setData($data, $key = null);",
"protected function setData($data) {\n $this->data = collect($data);\n }",
"public function setData() \n {\n // Empty, to be overridden \n }",
"protected function setData($data)\n {\n $this->sha1 = null;\n $this->data = $data;\n }",
"public function setData($key, $value);",
"public function setData($key, $value);",
"protected function setData(string $data):void {\n $this->data = $data;\n }",
"public function setData(array $data);",
"public function setData(array $data);",
"public function setData(array $data);",
"public function setData($data)\n\t{\n\t\t$this->_data = unserialize($data);\n\t\t$this->_hashFunc = $this->_data['hashFunc'];\n\t}",
"public static function set($data, $value = null)\n {\n static::getInstance()->set($data, $value);\n }",
"private function setData($data) {\r\n\t\t$this->set_cd_jogo($data[\"cd_jogo\"]);\r\n\t\t$this->set_nm_jogo($data[\"nm_jogo\"]);\r\n\t\t$this->set_vl_jogo($data[\"vl_jogo\"]);\r\n\t\t$this->set_ds_sinopse(utf8_decode($data[\"ds_sinopse\"]));\r\n\t\t$this->set_dt_lancamento($data[\"dt_lancamento_jogo\"]);\r\n\t\t$this->set_ds_requisito_minimo($data[\"ds_requesito_minimo\"]);\r\n\t\t$this->set_ds_requisito_sugerido($data[\"ds_requesito_sugerido\"]);\r\n\t}",
"public function setData($Data) {\n\t\t$this->Data=$Data;\n\t}",
"public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}",
"public function set()\n {\n $args = func_get_args();\n $num = func_num_args();\n if ($num == 2) {\n self::$data[$args[0]] = $args[1];\n } else {\n if (is_array($args[0])) {\n foreach ($args[0] as $k => $v) {\n self::$data[$k] = $v;\n }\n }\n }\n }",
"public function setData($data)\n\t{\n\t\t$this->_pageData['data'] = $data;\n\t}",
"public function setData($data)\n {\n// -- `idVeiculo` INT(11) NOT NULL,\n// -- `idMotorista` INT(11) NOT NULL,\n// -- `idTiposFretes` INT(11) NOT NULL,\n// -- `Observacoes` VARCHAR(255) NULL DEFAULT NULL,\n// -- `ValorPedagios` DECIMAL(10,2) NOT NULL,\n// -- `Distancia` DECIMAL(10,3) NOT NULL,\n// -- `DataEntrega` DATE NULL DEFAULT NULL,\n// -- `ValorFrete` DECIMAL(10,2) NOT NULL,\n $this->SetIdNotaTransporte($data['IdNotaTransporte']);\n $this->SetIdVeiculo($data['idVeiculo']);\n $this->SetIdMotoriste($data['idMotorista']);\n $this->SetIdTipoFrete($data['idTipoFretes']);\n $this->SetDistancia($data['Distancia']); \n $this->SetValorFrete($data['ValorFrete']);\n $this->SetDataEmissao($data['DataEntrega']);\n }",
"public function setData(array $data)\n {\n $this->data = $data;\n }",
"public function setData(array $data)\n {\n $this->data = $data;\n }",
"public function setData(array $data)\n {\n $this->data = $data;\n }",
"public function setData(array $data)\n {\n $this->data = $data;\n }",
"public function set_data($key, $data)\n\t{\n\t\t$this->_data[$key] = $data;\n\t}",
"public function setData($data)\n {\n $this->data = $data;\n $this->normalizedData = $this->normalize($data);\n $this->transformedData = $this->transform($this->normalizedData);\n }",
"public function setDataAttribute($value)\n {\n $this->attributes['data'] = json_encode($value);\n }",
"function setData($data){\n\t\tif(!is_array($data)){\n\t\t\tvar_dump($data);\n\t\t\texit;\n\t\t}\n\t\tforeach($data as $key => $value){\n\t\t\tif(isset(static::$fields[$key]) && static::$fields[$key]['type']=='enum'){\n\t\t\t\tif($value){\n\t\t\t\t\tif(!in_array(strtoupper($value), static::$fields[$key]['values'])){\n\t\t\t\t\t\treturn RetErrorWithMessage('INCORRECT_VALUE', preg_replace('/.+\\\\\\/si', '', get_called_class()).': Wrong field value('.$value.'), field \"'.$key.'\" can be one of: '.print_r(static::$fields[$key]['values'], true));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$value = strtoupper($value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->{$key} = $value;\n\t\t}\n\t\tforeach(static::$fields as $field_name => $option){\n\t\t\tif(!isset($this->{$field_name})){\n\t\t\t\tif($option['default']){\n\t\t\t\t\t$this->{$field_name} = $option['default'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n $this->instance_generated = true;\n\t\treturn null;\n\t}",
"public function setData() {\n\t\t$this->import($this->get());\n\t}",
"public function set_raw_data($data)\n {\n }",
"function set(array $data) {\n\t\tforeach ($data as $key => $value) {\n\t\t\t$this->$key = $value;\n\t\t}\n\t}",
"protected function setData( $name, $value ) {\n $this->data[$name] = $value;\n }",
"public function setData($data) {\n if (empty($data)) {\n return;\n }\n if (is_object($data) || is_array($data)) {\n foreach ($this->_data as $field => $value) {\n if (array_key_exists($field, $data)) {\n $temp_val = $data[$field];\n } else {\n $temp_val = $value;\n }\n $this->__set($field, $temp_val);\n }\n } else {\n throw new Exception('The entity \"' . get_class($this) .\n '\" must be created by an array or object.');\n }\n }",
"public function setData(Array $data);",
"public function set($key, $data);",
"function setAllData(&$data) {\n\t\t$this->_data =& $data;\n\t}",
"public function setData($data)\n {\n $resultData = $this->hydrateIfJsonToArray($data);\n if (!empty($resultData)) {\n $this->data = $resultData;\n }\n else {\n $this->data = [];\n }\n }",
"function set($type,$data){\n\t// PARAM $type : type of data, as above\n\t// $data : data to set\n\n\t\tif (!is_array($this->$type)) { die(\"Not a valid data type\"); }\n\t\t$this->$type = $data;\n\t}",
"private function setData($data){\n\t\n\t\t$this->setIdusuario($data['idusuario']);\n\t\t$this->setDeslogin($data['deslogin']);\n\t\t$this->setDessenha($data['dessenha']);\n\t\t$this->setDtcadastro(new DateTime($data['dtcadastro']));\t\t\n\t}",
"protected function setData(array $data)\n\t{\n\t\t$this->json_data = $data;\n\t}",
"protected function setDataAttribute($value)\n\t{\n\t\t$this->attributes['data'] = is_array($value) ? json_encode($value):$value;\n\t}",
"public function setData( ) {\r\n\t\t\tself::callEvent('response.setData', $this, func_get_args());\r\n\t\t}",
"public function setData($key, $value = null);",
"public function set(string $key, $data);",
"public function setData(array $data = []);",
"function setData($key,$value) {\n\t\t\n\t\tif($key == \"start\" && method_exists($this,'setStart') ) {\n\t\t\t$this->setStart($value);\n\t\t\t//$this->_start = $value;\n\t\t}\n\n\t\telse if($key == \"end\" && method_exists($this,'setEnd')) {\n\t\t\t$this->setEnd($value);\n\t\t\t//$this->_end = $value;\n\t\t}\n\t\telse{\n\t\t\t$this->_dataValues[$key] = $value;\n\t\t\t$this->_data[$key]['value'] = $value;\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function setViewData($data)\n {\n $this->__viewData = $data;\n }",
"protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}",
"function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}",
"public function setData()\n {\n $this->data=new \\DateTime('now');\n\n }",
"public function __set($name, $value) {\n\t\t $this->data[$name] = $value; \n\t }",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}"
] | [
"0.8153852",
"0.8135851",
"0.79610777",
"0.79551375",
"0.792897",
"0.79274344",
"0.7924687",
"0.79129875",
"0.7904953",
"0.7871317",
"0.7869057",
"0.7869057",
"0.7869057",
"0.78626895",
"0.7798992",
"0.77800614",
"0.77800614",
"0.7774783",
"0.7774783",
"0.7774783",
"0.7774783",
"0.7774783",
"0.7770964",
"0.77654433",
"0.776386",
"0.7755969",
"0.77130896",
"0.76194876",
"0.75857234",
"0.7540279",
"0.7458022",
"0.7352877",
"0.73181945",
"0.7314664",
"0.7306541",
"0.7304713",
"0.7281047",
"0.7276822",
"0.7267566",
"0.7267566",
"0.7267566",
"0.72617763",
"0.72281724",
"0.7213084",
"0.7191201",
"0.7172881",
"0.71681637",
"0.7152562",
"0.7138091",
"0.7129426",
"0.7129426",
"0.7123696",
"0.7123632",
"0.7123632",
"0.7123632",
"0.71176434",
"0.711455",
"0.70667803",
"0.7063527",
"0.70615447",
"0.70283926",
"0.7023019",
"0.69796747",
"0.69776154",
"0.69776154",
"0.69776154",
"0.69776154",
"0.69670343",
"0.69634295",
"0.6959428",
"0.6944034",
"0.6906957",
"0.69025034",
"0.6891792",
"0.68616885",
"0.68587583",
"0.68444806",
"0.68371713",
"0.6820097",
"0.68182266",
"0.6803612",
"0.68019223",
"0.67876023",
"0.67875993",
"0.6787513",
"0.6781274",
"0.6770929",
"0.6767154",
"0.67518014",
"0.6749807",
"0.6736175",
"0.67240524",
"0.6721746",
"0.6691277",
"0.66828716",
"0.66828716",
"0.6681852",
"0.6681852",
"0.6681852",
"0.6681852",
"0.6681852"
] | 0.0 | -1 |
Get the value of user | public function getUser()
{
return $this->user;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function r_user(){\n\t\tif (!empty($this -> user)) {\n\t\t\techo 'value = \"'.$this -> user.'\"';\n\t\t}\n\t}",
"function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }",
"function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }",
"function get_user () {\n\t\treturn $this->user_id;\n\t}",
"public function getUserId()\n {\n return parent::getValue('user_id');\n }",
"public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUserfield();",
"public static function getUser();",
"public function getUser(){\n\t\treturn $this->user;\n\t}",
"static public function GetGETUser() {\n if (isset(self::$getUser))\n return self::$getUser;\n else\n return self::UNKNOWN;\n }",
"public static function user ()\n {\n return self::$user;\n }",
"function getUser() \n {\n\t\t\treturn $this->user;\n\t\t}",
"public function getUserId()\n {\n return $this->getValue('nb_user_id');\n }",
"function getUserId() {\n\t\treturn $this->getData('userId');\n\t}",
"public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}",
"public function getValue()\n {\n return new TDProject_Core_Common_ValueObjects_System_UserValue($this);\n }",
"function getUser() {\n return user_load($this->uid);\n }",
"public function user()\n {\n return call_user_func($this->getUserResolver());\n }",
"public function get_user() {\n\t\treturn $this->user;\n\t}",
"public function getUser() {}",
"public function getUser()\n {\n $this->getParam('user');\n }",
"public function getUserId ()\n {\n return $this->storage->get(self::$prefix . 'userId');\n }",
"private function GetUser()\r\n\t\t{\r\n\t\t\tif (!empty($_POST['customer_id']))\r\n\t\t\t\treturn $_POST['customer_id'];\r\n\t\t\t\r\n\t\t\tif (!empty($_GET['customer_id']))\r\n\t\t\t\treturn $_GET['customer_id'];\r\n\t\t}",
"public function getId_user(){\n return $this->id_user;\n }",
"public function retrieve($key)\n {\n list($name, $userId) = explode('/user-', $key);\n\n $userMeta = $this->getModel()->search($name, $userId)->first();\n\n if (! is_null($userMeta)) {\n if (! $value = @unserialize($userMeta->value)) {\n $value = $userMeta->value;\n }\n\n $this->addKey($key, array(\n 'id' => $userMeta->id,\n 'value' => $value,\n ));\n\n return $value;\n }\n\n return null;\n }",
"public function getUser() {\r\n return $this->user;\r\n }",
"public function getUserId(): string;",
"public function user()\n {\n return $this->luser;\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getValue ()\n {\n if ($this->isNullValue())\n {\n return null;\n }\n\n if (!isset($this->column_value))\n {\n $this->column_value = new PulseUser($this->jsonResponse[\"value\"][\"id\"]);\n }\n\n return $this->column_value;\n }",
"public function get_user_id();",
"public function getUser()\r\n {\r\n return $this->user;\r\n }",
"function get_user_id(){\n return $this->user_id;\n }",
"function get_userid() {\n return $this->userid;\n }",
"public function returnUser() {\n return $this->user_id;\n }",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function getUserId()\n {\n return $this->get(self::_USER_ID);\n }",
"public function user() { return $this->user; }",
"public function user()\n {\n if ( ! $this->bean->user) $this->bean->user = R::dispense('user');\n return $this->bean->user;\n }",
"public static function getUser()\n {\n return self::getInstance()->_getUser();\n }",
"public function user() {\n\t\tif ( ! is_null($this->user)) return $this->user;\n\t\treturn $this->user = $this->retrieve($this->token);\n\t}",
"public function user()\n {\n return $this->user;\n }",
"public function user()\n {\n return $this->user;\n }",
"protected function _user() {\n return $this->_adapter_user->user();\n }",
"public function get_user() {\r\n return $this->util_model->get_data(\r\n 'schools', \r\n array('unitname') \r\n );\r\n }",
"public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }",
"public function getUserCheck()\n {\n return $this->get(self::_USER_CHECK);\n }",
"public function getUser() {\n\t\treturn $this->user;\n\t}",
"public function getUser() {\n\t\treturn $this->user;\n\t}",
"public function getUser( ) {\n\t\treturn $this->user;\n\t}",
"public function getUser( ) {\n\t\treturn $this->user;\n\t}",
"public function getUserId(){\n return $this->UserId;\n }",
"public function getUser(){\n if (Auth::user()) { \n $user = Auth::user();\n } else {\n $user = 'guest';\n }\n return $user;\n }",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserId();",
"public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }",
"public function get_user()\n {\n Session::_start();\n return (object) Session::_get(\"user\");\n\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->_user;\n }",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public static function getUser() \n {\n return $_SESSION['username'];\n }",
"public function getUserId()\n {\n $this->checkIfKeyExistsAndIsInteger('user_id');\n\n return $this->data['user_id'];\n }"
] | [
"0.7433997",
"0.7373631",
"0.7373631",
"0.736107",
"0.7248152",
"0.7192962",
"0.7172049",
"0.7172049",
"0.7172049",
"0.7172049",
"0.7172049",
"0.7172049",
"0.7172049",
"0.7072147",
"0.7064653",
"0.70310634",
"0.7020756",
"0.6971704",
"0.6902396",
"0.690122",
"0.687948",
"0.68786716",
"0.68702406",
"0.6861504",
"0.68573266",
"0.68527156",
"0.6833639",
"0.6822202",
"0.6784895",
"0.67790496",
"0.6776213",
"0.67756826",
"0.6773112",
"0.67667246",
"0.6755731",
"0.67494595",
"0.67494595",
"0.67494595",
"0.67494595",
"0.6734441",
"0.6732341",
"0.67299193",
"0.67172074",
"0.6715441",
"0.6711506",
"0.6705865",
"0.67056894",
"0.67056894",
"0.67056894",
"0.6692186",
"0.6690076",
"0.66793823",
"0.6678006",
"0.66751295",
"0.66751295",
"0.6673719",
"0.6664232",
"0.66579986",
"0.6657964",
"0.6657215",
"0.6657215",
"0.6648236",
"0.6648236",
"0.6643091",
"0.6642813",
"0.66421264",
"0.66421264",
"0.66421264",
"0.66421264",
"0.66421264",
"0.66421264",
"0.66421264",
"0.66421264",
"0.66421264",
"0.66364384",
"0.66358787",
"0.6631532",
"0.6631532",
"0.6631532",
"0.66291994",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.66071784",
"0.6606486",
"0.6606486",
"0.6606486",
"0.6606486",
"0.6606486",
"0.6604523",
"0.6603434"
] | 0.0 | -1 |
Set the value of user | public function setUser($user)
{
$this->user = $user;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setUser($value)\n {\n return $this->set('User', $value);\n }",
"public function setIduser($value)\n {\n $this->iduser = $value;\n }",
"public function setUser($p_mVal) { $this->m_mUser = $p_mVal; }",
"public function setUser($value)\n {\n if ($value !== null) {\n $this->_user = $value;\n } else {\n $this->_user = Zend_Gdata_Photos::DEFAULT_USER;\n }\n }",
"function set_user($user)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER, $user);\r\n }",
"function set_user($user)\r\n {\r\n $this->set_default_property(self :: PROPERTY_USER, $user);\r\n }",
"public function set_id_user($value = \"\")\n {\n $this->_id_user = \\helpers\\Validator::valInt('f_id_user', $value, TRUE);\n }",
"public function setUser1($value)\n {\n return $this->set('User1', $value);\n }",
"public function setUser1($value)\n {\n return $this->set('User1', $value);\n }",
"function set_user($user)\n\t{\n\t\t$this->user=$user;\n\t}",
"function set_user_setting( $user, $key, $value )\n {\n //Unimplemented\n }",
"public function setUserId(?string $value): void {\n $this->getBackingStore()->set('userId', $value);\n }",
"public function setUserId(?string $value): void {\n $this->getBackingStore()->set('userId', $value);\n }",
"public function setUserId(?string $value): void {\n $this->getBackingStore()->set('userId', $value);\n }",
"public function set_user($user) {\n $this->user = $user;\n }",
"public function r_user(){\n\t\tif (!empty($this -> user)) {\n\t\t\techo 'value = \"'.$this -> user.'\"';\n\t\t}\n\t}",
"public function setUserID($value) {\n\t\t$this->_user_id = $value;\n\t}",
"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}",
"function setUser( $user )\r\n {\r\n if ( is_a( $user, \"eZUser\" ) )\r\n {\r\n $userID = $user->id();\r\n\r\n $this->UserID = $userID;\r\n }\r\n }",
"public function setUserfield($value);",
"function setRequestUser($value)\n {\n $this->_props['RequestUser'] = $value;\n }",
"function setUserAdmin( $value )\n {\n $this->UserAdmin = $value;\n }",
"public function setUserName($value) { $this->setState('__username',$value); }",
"function SetUser(&$user)\n\t{\n\t\t$this->userId = $user->userId;\n\t}",
"public function setUser( $user )\r\n {\r\n $this->_user = $user;\r\n }",
"public function setCurrentUser($user){\n $this->user = $user;\n }",
"public function set_user_id( $value ) {\n\t\t$this->set_prop( 'user_id', absint( $value ) ) ;\n\t}",
"public function setUser($user){\n\t\t$this->user = $user;\n\t}",
"public function setUser($user = null) {\n\t\t$this->_user = $user;\n\t\tif( ! empty($this->_user->screenname) ) {\n\t\t\t$this->getElement('name')->setValue($this->_user->screenname)->setAttribs(array('readonly' => 'readonly', 'class' => 'text text-med disabled'));\n\t\t}\n\t}",
"public function set($user, array $input);",
"public function setUser($user) {\n\n $this->user = $user;\n }",
"function setUser($user) {\n $this->userObject = $user;\n }",
"public function setUser($user) {\r\n\t\t$this->user = $user;\r\n\t}",
"public function set_user($var_user) {\r\n\t\t$this->id = $var_user;\r\n\t}",
"public function setUser($user)\n {\n $this->_user = $user;\n }",
"public function setUserId() {\n $this->user_id = $user_id;\n }",
"public function _setAttribute($user) {\n $this->user_id = $user->id;\n $this->auth_key = \\Yii::$app->security->generateRandomString(); \n $this->status = self::STATUS_LOGIN;\n }",
"public function setUserid($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_90'));\n\t\tif(!Validator::AccountId($value)) throw new Exception(lang('error_90'));\n\t\t\n\t\t$this->_userid = $value;\n\t}",
"public function setUser($user)\n {\n $this->_user = $user;\n }",
"public function setUser($user) {\n\t\t$this->user = mb_strtolower($user);\n\t}",
"public function setUserId($value)\n {\n return $this->set(self::user_id, $value);\n }",
"function set_user_setting($name, $value)\n {\n }",
"public function setUsername($value)\n {\n $this->_username = $value;\n }",
"public function setUserId($value)\n {\n return $this->set(self::_USER_ID, $value);\n }",
"public function setUserId($value)\n {\n return $this->set(self::_USER_ID, $value);\n }",
"public function setUserId($value)\n {\n return $this->set(self::_USER_ID, $value);\n }",
"public function setUserId($value)\n {\n return $this->set(self::_USER_ID, $value);\n }",
"public function setUserid($value)\n {\n return $this->set(self::_USERID, $value);\n }",
"public function setUserid($value)\n {\n return $this->set(self::_USERID, $value);\n }",
"public function setUserid($value)\n {\n return $this->set(self::_USERID, $value);\n }",
"public function set_user_info($data){\n\t\t\treturn $result=$this->save($data);\n\t\t}",
"public function setCurrentUser($user){\n $_SESSION['user'] = $user;\n }",
"public function setUser( User $user ) {\n\t\t$this->user = $user;\n\t}",
"public static function setUser($user){\n $_SESSION[\"user\"] = $user;\n }",
"public function user($value): self\n {\n $this->user = $value;\n \n return $this;\n }",
"public function setUser(User $user){\n\t\t$this->user = $user;\n\t\t$this->datahandler->set(self::FIELD_USER, $user->getID());\n\t\treturn true;\n\t}",
"public function setUserName(?string $value): void {\n $this->getBackingStore()->set('userName', $value);\n }",
"public function setUserName(?string $value): void {\n $this->getBackingStore()->set('userName', $value);\n }",
"public function setUser($info)\n {\n self::set('_user', $info);\n }",
"public function setUser($aUser){\n $this->user = $aUser;\n }",
"public function setUsername($value)\r\n\t{\r\n\t\t$this->username = $value;\r\n\t}",
"public function setUserAnswer($value) {\n $this->_userAnswer = $value;\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}",
"public function setUserName($value) {\r\n if ($value === null) $value = \"User\";\r\n $this->userName = $value;\r\n }",
"public function setCreatedByUserId(?string $value): void {\n $this->getBackingStore()->set('createdByUserId', $value);\n }",
"function setUser($usr) \n {\n\t\t\t$this->user = ((empty($usr)) ? \"root\" : $usr);\n\t\t}",
"public function setUser2($value)\n {\n return $this->set('User2', $value);\n }",
"public function setUser2($value)\n {\n return $this->set('User2', $value);\n }",
"public function testUpdateUser()\n {\n }",
"public function setUser($user = null)\n {\n $this->user = $user;\n }",
"private function __setAuthUser()\n {\n $authUser = $this->request->session()->read('Auth');\n\n $accountType = 'FREE';\n if (!empty($authUser)) {\n $accountType = $authUser['User']['account_type'];\n }\n\n $this->set(compact('authUser', 'accountType'));\n }",
"public function setUser($user)\n {\n $this->user = Auth::user();\n }",
"public function setUserID($user_id){\n\t\t$this->user_id = $user_id;\n\t}",
"public static function setUsername($val) \n { \n emailSettings::$username = $val; \n }",
"public function modify_user($user);",
"public function SetUserdata($id = 0, $name = \"\")\r\n {\r\n $this->user = $id;\r\n $this->username = $name;\r\n $_SESSION[TSession::$USERID] = $this->user;\r\n $_SESSION[TSession::$USERNAME] = $this->username;\r\n }",
"public function set_users_id($value) {\r\n $this->users_id = $value;\r\n data::add(\"users_id\", $this->users_id == \"\" ? session::get(CURRENT_USER_SESSION_NAME) : $this->users_id, $this->table_fields);\r\n }"
] | [
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.7637578",
"0.76187533",
"0.75931364",
"0.74981624",
"0.7474162",
"0.7474162",
"0.7443495",
"0.73361915",
"0.73348516",
"0.73268074",
"0.7306938",
"0.72972405",
"0.72972405",
"0.72972405",
"0.7282988",
"0.7280022",
"0.7255968",
"0.72169393",
"0.72018945",
"0.71955556",
"0.71780473",
"0.71683455",
"0.7165513",
"0.71467644",
"0.7124642",
"0.71237105",
"0.709944",
"0.708627",
"0.70641524",
"0.70289487",
"0.7025684",
"0.6981531",
"0.6976457",
"0.69596285",
"0.6952378",
"0.694109",
"0.693107",
"0.6921958",
"0.6860366",
"0.6840449",
"0.683151",
"0.6821158",
"0.6819589",
"0.67983055",
"0.67983055",
"0.67983055",
"0.67983055",
"0.6798143",
"0.6798143",
"0.6798143",
"0.67921615",
"0.67890054",
"0.67798126",
"0.6768303",
"0.6767177",
"0.67608976",
"0.67509466",
"0.67509466",
"0.6747158",
"0.67410624",
"0.67329955",
"0.67197716",
"0.66888106",
"0.6688785",
"0.6664041",
"0.6662531",
"0.6660205",
"0.66567534",
"0.6620863",
"0.6618522",
"0.6614441",
"0.66090685",
"0.6596227",
"0.658573",
"0.6580061",
"0.6543918",
"0.6522828"
] | 0.0 | -1 |
Get the value of admin | public function getAdmin()
{
return $this->admin;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAdminId()\n {\n return $this->data['fields']['admin_id'];\n }",
"public function getAdmin() {\n \n return $this->admin;\n }",
"function get_admin_name() {\n return $this->admin_name;\n }",
"public function getAdmin() {\n $sql = \"SELECT *\n FROM {$this->tablename} p\n WHERE p.status='admin'\";\n return $this->db->query($sql)->single($this->entity);\n }",
"function userAdmin( )\n {\n return $this->UserAdmin ;\n }",
"public function getAdminId()\n {\n return $this->admin_id;\n }",
"public function getAdminId()\n {\n return $this->admin_id;\n }",
"public function getAdminId()\n {\n return $this->admin_id;\n }",
"public function getAdminName()\n {\n return $this->admin_name;\n }",
"public function getAdminName()\n {\n return $this->admin_name;\n }",
"public static function admin() {\n\t\t\treturn self::$admin;\n\t\t}",
"public function getIdAdmin() {\n\t\treturn $this->id_admin;\n\t}",
"public function getNomAdmin() {\n\t\treturn $this->nom_admin;\n\t}",
"public function getAdminId(){\n return $this->a_id;\n }",
"public function getInAdmin() {\n\t\treturn $this->in_admin;\n\t}",
"public function getSenhaAdmin(){\n\t\t\treturn $this-> senha_admin;\n\t\t}",
"public function getIdentifiantAdmin() {\n\t\treturn $this->identifiant_admin;\n\t}",
"public function GetAdmin ();",
"public function getOGAdminID();",
"public function getAdminAttribute()\n {\n return User::whereId($this->accountId)->first();\n }",
"function current_admin()\n {\n return admin_auth()->user();\n }",
"public function getAdminUser()\n {\n return $this->registry->registry('current_admin_user');\n }",
"public function getAdminName() {\n return $this->scopeConfig->getValue ( static::XML_ADMIN_NAME, ScopeInterface::SCOPE_STORE );\n }",
"abstract public function getAdminType();",
"function AdminType()\n\t{\n\t\treturn $this->isAdmin()\n\t\t ? 'a'\n\t\t : 'c';\n\t}",
"function getAdminName() {\r\n\t\t\t$query = $this->pdo->prepare('select admin_name from admin_account');\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}",
"function get_value_edit()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getAdminLabel()\n {\n return (strlen($this->_adminLabel)) ? $this->_adminLabel : $this->getLabel();\n }",
"public function getAdmin()\n {\n $database = new Database();\n $loggedIn = $database->getAdminByUsername($_SESSION['user']);\n $admin = new Admin($loggedIn['adminId'], $loggedIn['username'], $loggedIn['adminLevel'], $loggedIn['active']);\n if(isset($_SESSION['user']) === true) {\n $this->_f3->set('admin', $admin);\n }\n }",
"public function admin($bValue = NULL) {\t\t\tif (!is_null($bValue)) $this->bAdmin = $bValue; \n\t\t\treturn $this->bAdmin; \n\t\t}",
"public function get_is_admin() \n {\n return $this->is_admin;\n }",
"public function getContactAdmin() {\n return $this->scopeConfig->getValue ( static::XML_CONTACT_ADMIN, ScopeInterface::SCOPE_STORE );\n }",
"public function getAdminLevel(){\n \n $userId = Auth::user()->id;\n // admin or not\n $level = 99;\n $user = DB::table('admins')->where('uid', $userId)->first();\n if ($user !== null) {\n $level = $user->level;\n }\n\n return $level;\n }",
"public function getAdministrator() {}",
"function getHouseholdAdmin(){\n\t\t$members = $this->getMembers();\n\t\tforeach ($members as $member) {\n\t\t\t$level = $member->getUserLevel();\n\t\t\tif($level == 'admin'){\n\t\t\t\t$admin = $member;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $admin;\n\t}",
"function get_admin_email() {\n return $this->admin_email;\n }",
"public function get_list_admin()\n {\n $this->db->where('type', 1);\n $query = $this->db->get('user');\n return $query->result();\n }",
"public function getAdminFlag(){\n\t\t/* return company code */\n\t\treturn $this->_intAdminCode;\n\t}",
"public function getPrenomAdmin() {\n\t\treturn $this->prenom_admin;\n\t}",
"public function getAdmin($id = false){\n \n $userId = $id;\n // admin or not\n $admin = 0;\n $user = DB::table('admins')->where('uid', $userId)->first();\n if (!empty($user)) {\n $admin = 1;\n }\n\n return $admin;\n }",
"function get_admin()\n {\n return DB::table(\"admin_tbl\")->get();\n }",
"public function get_admin_instance() {\n\t\treturn $this->admin;\n\t}",
"public function get_admin_instance() {\n\t\treturn $this->admin;\n\t}",
"public static function adminUserId()\n {\n $getUserId = User::where('TenantId', Auth::user()->TenantId)->where('IsAdmin', 1)->first();\n return $getUserId->id;\n }",
"public function getValue($field)\n {\n $adminSettings = DB::table('settings')->where('field_name', $field)->first();\n if ($adminSettings) {\n return $adminSettings->value;\n }\n \n }",
"public function getIsAdmin()\n {\n return $this->is_admin;\n }",
"public function getAdminLevel()\n {\n $userId = Auth::user()->id;\n // admin or not\n $level = 99;\n $user = DB::table('admins')->where('uid', $userId)->first();\n if ($user !== null) {\n $level = $user->level;\n }\n\n return $level;\n }",
"function phoneTypeAdmin( )\n {\n return $this->PhoneTypeAdmin;\n }",
"public function getMdpAdmin() {\n\t\treturn $this->mdp_admin;\n\t}",
"function getAdmin() {\n return mysqli_query($this->link, \"SELECT * from account where position = 0\");\n }",
"public static function getUser() {\n return self::$ADMIN_USER;\n }",
"public function get_admin_instance() {\n\n\t\treturn $this->admin;\n\t}",
"function get_is_admin ()\r\n {\r\n return $_SESSION[\"is_admin\"];\r\n }",
"public function getIsAdmin()\n\t{\n\t\treturn $this->is_admin;\n\t}",
"function userGroupAdmin( )\n {\n return $this->UserGroupAdmin;\n }",
"public function displayInAdmin()\n {\n return self::_enabled();\n }",
"public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }",
"public static function getAdmin(){\n $db = DBInit::getInstance();\n $funkcija = \"administrator\";\n $statement = $db->prepare(\"SELECT email FROM zaposleni WHERE funkcija = :funkcija\");\n $statement->bindParam(\":funkcija\", $funkcija);\n $statement->execute();\n\n return $statement->fetch();\n \n }",
"public function getValue($field)\n {\n $adminSettings = DB::table('settings')->where('field_name', $field)->first();\n if ($adminSettings) {\n return $adminSettings->value;\n }\n }",
"function admin_user_id()\n {\n return Admin::app()->auth()->id();\n }",
"public function getRoleAdmin() {\n $rolesyangberhak = DB::table('roles')->where('id','=','2')->first()->namaRule;\n return $rolesyangberhak;\n }",
"public function getAdminView(): ?string;",
"function getAdminDetails($id) {\r\n $query = $this -> db -> get_where('nc_choosencharge', array('id' => $id));\r\n\r\n if ($query -> num_rows() == 0) {\r\n return 0;\r\n } else {\r\n return $query -> row();\r\n }\r\n }",
"function getAdminDetails($id) {\r\n $query = $this->db->get_where('nc_poll_detail', array('id' => $id));\r\n\r\n if ($query->num_rows() == 0) {\r\n return 0;\r\n } else {\r\n return $query->row();\r\n }\r\n }",
"public function getAdminpage() {\n\t\t // $result = mysqli_query($this->connect(), $sql);\n\t\t\t// return $result;\n\t\t}",
"public static function getAdminID()\n {\n $AdminUserID = self::getInstance()->getConfig()->Admin->UserID;\n if (!$AdminUserID) {\n $AdminRoleID = self::getAdminRoleID();\n $tableUser = new User_Table();\n $objectUser = $tableUser->findByRole($AdminRoleID);\n $AdminUserID = is_object($objectUser) ? $objectUser->ID : 1;\n }\n return $AdminUserID;\n }",
"function companyTypeAdmin( )\n {\n return $this->CompanyTypeAdmin;\n }",
"public function getAdminById($id)\n\t{\n\t\treturn $this->db->get_where($this->admin, ['ID_Admin' => $id])->row();\n\t}",
"public function getAdminRole()\n {\n return $this->adminRole;\n }",
"static function getInfoAdminById($idAdmin)\n {\n\n $con=Database::getConnection();\n $req=$con->prepare('SELECT * FROM admin WHERE _idAdmin=?');\n $req->execute(array($idAdmin));\n return $req->fetch();\n }",
"public function adminInfo($id){\n $info = DB::table('admins')->where('uid', $id)->first();\n return $info;\n }",
"public function stateAdminName()\n {\n return $this->getActiveState()->adminName();\n }",
"public function getUsername()\r\n\t{\r\n\t\treturn $this->admin['user'];\r\n\t}",
"public function getAdminPath()\n {\n return $this->adminPath;\n }",
"public function getIsAdmin();",
"public function getIsAdmin();",
"public function _getUpdatedByAdmin() {\n\t\treturn $this->_updatedByAdmin;\n\t}",
"function EV_admin() {\n\treturn EV_Admin::get_instance();\n}",
"public static function es_admin_option() {\n\t}",
"public function getAdmin($id)\n {\n return $this->user->where('salon_id',$id)->first();\n }",
"public function isAdmin()\n {\n return $this->is_admin;\n }",
"public function get($option){\n return $this->db->get_where(\"admin\", $option)->row();\n }",
"public function _getUpdatedOnAdmin() {\n\t\treturn $this->_updatedOnAdmin;\n\t}",
"function m_GetAdminEmail()\n\t{\t\t\t\t\t\t\n\t\t$stQuery = \"SELECT vEmail FROM tb_admin WHERE iId = 1\";\t\n\t\t$rsResult = $this->obDbase->Execute($stQuery);\n\t\tif (!$rsResult)\n\t\t{ \t\t\t\t\t\t\t\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $rsResult->fields['vEmail'];\t\t\t \n\t\t}\t\t\t\t\n\t}",
"public function checkIsAdmin()\n {\n return $this->user_admin;\n }",
"public function getAdminEmail();",
"public function admin() {\n return $this->teachers()->where('role', '=', User::SCHOOL_ADMIN)->first();\n }",
"public function getIsAdmin()\n {\n return $this->isAdmin;\n }",
"public function value()\n {\n return $this->app->input->get('option');\n }",
"public function admin()\r\t{\r\t\t$id = NULL;\r\t\t$id || $id = $this->session->userdata('a_id');\r\t\t$this->db->limit(1);\r\t\t$query = $this->db->select('*')\r\t\t ->where('a_id', $id)\r\t\t ->get('admin');\r\t\treturn $query->row_array();\r\t}",
"function GetAdminSection()\n {\n return 'content';\n }",
"public function getActSchoolAdminPerson() {\n return $this->dataBase->getEntry('person',\"role like '%admin%' and classID=\".$this->getStafClassBySchoolId(getActSchoolId())[\"id\"]);\n }",
"public function getIsAdminAttribute(){\n\n\t return $this->attributes['admin'] == 1;\n\t}",
"public function getAdminData($name)\n {\n $this->db->where('admin_name', $name);\n \n $query = $this->db->get('admin');\n \n return $query->row();\n \n }",
"public function getIsAdmin()\n {\n return $this->isAdmin;\n }",
"public function getIsAdmin()\n {\n return $this->isAdmin;\n }",
"public function getListAdminType()\n\t{\n\t return $this->isAdmin() || $this->isListAdmin()\n\t\t ? 'a'\n\t\t : 'c';\n\t}",
"public function getAdmin($id = false)\n {\n $userId = $id;\n // admin or not\n $admin = 0;\n $user = DB::table('admins')->where('uid', $userId)->first();\n if (!empty($user)) {\n $admin = 1;\n }\n\n return $admin;\n }",
"function personTypeAdmin( )\n {\n return $this->PersonTypeAdmin;\n }",
"public function show(Admin $admin)\n {\n return $admin;\n }"
] | [
"0.7655957",
"0.75225335",
"0.75152075",
"0.75036067",
"0.7360108",
"0.73347753",
"0.73347753",
"0.73347753",
"0.7312479",
"0.7312479",
"0.7278925",
"0.71919763",
"0.7129663",
"0.7109811",
"0.70641136",
"0.7057862",
"0.7021233",
"0.69675887",
"0.6905841",
"0.681004",
"0.6781938",
"0.67761874",
"0.6769195",
"0.67368114",
"0.6728291",
"0.67207557",
"0.6713408",
"0.67108387",
"0.6689978",
"0.66783583",
"0.66712385",
"0.6642379",
"0.66382366",
"0.66246635",
"0.6622546",
"0.6605128",
"0.6592882",
"0.6572093",
"0.6562191",
"0.65583074",
"0.6557308",
"0.65559876",
"0.65559876",
"0.65495205",
"0.6500026",
"0.6489214",
"0.64857614",
"0.6476621",
"0.64714366",
"0.6446746",
"0.64454556",
"0.64379054",
"0.6422472",
"0.6422056",
"0.64175963",
"0.64132655",
"0.64121914",
"0.64095885",
"0.63867986",
"0.63854074",
"0.6375423",
"0.6369256",
"0.63523126",
"0.63498086",
"0.63475496",
"0.634427",
"0.6343827",
"0.63372695",
"0.63332915",
"0.63269174",
"0.6311175",
"0.63090444",
"0.63014686",
"0.6294864",
"0.6289936",
"0.6289936",
"0.628837",
"0.6278493",
"0.62715083",
"0.6265403",
"0.626095",
"0.62583107",
"0.6249103",
"0.6239946",
"0.6236926",
"0.6227662",
"0.6222308",
"0.6217667",
"0.62163574",
"0.6214323",
"0.6209791",
"0.62074864",
"0.6190044",
"0.61896807",
"0.6180829",
"0.6180829",
"0.6163821",
"0.6160948",
"0.6157739",
"0.6154852"
] | 0.7666034 | 0 |
Set the value of admin | public function setAdmin($admin)
{
$this->admin = $admin;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setUserAdmin( $value )\n {\n $this->UserAdmin = $value;\n }",
"public function SetAdmin ($admin = TRUE);",
"public function setAdminId($value)\n {\n if (!array_key_exists('admin_id', $this->fieldsModified)) {\n $this->fieldsModified['admin_id'] = $this->data['fields']['admin_id'];\n } elseif ($value === $this->fieldsModified['admin_id']) {\n unset($this->fieldsModified['admin_id']);\n }\n\n $this->data['fields']['admin_id'] = $value;\n }",
"public function setIsAdmin ($value)\r\n\t{\r\n\t\t$this->isAdmin = $value;\r\n\t}",
"function setPhoneTypeAdmin( $value )\n {\n $this->PhoneTypeAdmin = $value;\n }",
"function setUserGroupAdmin( $value )\n {\n $this->UserGroupAdmin = $value;\n }",
"public function setIsAdmin($value);",
"public function setAdmin($admin) {\n \n if($admin == 1) { $this->username = 1; }\n \n else { $this->username = 0; }\n }",
"function setPersonTypeAdmin( $value )\n {\n $this->PersonTypeAdmin = $value;\n }",
"function setCompanyTypeAdmin( $value )\n {\n $this->CompanyTypeAdmin = $value;\n }",
"public function setAdmin($is_admin = false) {\n\t\t\n\t\tif($is_admin) {\n\t\t\t\n\t\t\t$this->is_admin=true;\n\t\t\t$this->Session->write(\"is_admin\",true);\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$this->is_admin=false;\n\t\t\tif($this->Session->check(\"is_admin\") && $this->Session->read(\"is_admin\")==1) {\n\t\t\t\t\n\t\t\t\t$this->Session->write(\"is_admin\",false);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t}",
"public function setAdmin($admin)\n {\n $this->admin = $admin;\n }",
"function setAdmin() {\n\t\t$this->_extension_high = \"\";\n\t\t$this->_extension_low = \"\";\n\t\t$this->_deptname = \"\";\n\t\t$this->_sections = array(\"*\");\n\t}",
"function setAddressTypeAdmin( $value )\n {\n $this->AddressTypeAdmin = $value;\n }",
"function setAdminID( $admin_ID )\n {\n $this->setValueByFieldName( 'admin_id', $admin_ID );\n }",
"function set_admin_name($name) {\n $this->admin_name = $name;\n }",
"public function admin($bValue = NULL) {\t\t\tif (!is_null($bValue)) $this->bAdmin = $bValue; \n\t\t\treturn $this->bAdmin; \n\t\t}",
"public function setSuperAdmin($details);",
"public function editIs_admin($admin)\n\t\t{\n\t\t\tglobal $is_admin;\n\t\t\tglobal $user_id;\n\t\t\n\t\t\t$admin = addslashes($admin);\n\n\t\t\tif($admin = 0 || $admin = 1)\n\t\t\t{\n\t\t\t$qry = 'UPDATE manager SET is_admin = \"' . $admin . '\" WHERE user_id = '. $user_id;\n\t\t\t$result = mysql_query($qry, $GLOBALS['connection']);\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\techo('Invalid input, manager will not be set as an admin');\n\t\t\t}\n\t\t\n\t\t\t$password = $admin;\n\t\t}",
"public function update($raporAdminSetting);",
"public function setDescriptionForAdmins(?string $value): void {\n $this->getBackingStore()->set('descriptionForAdmins', $value);\n }",
"public function setAsAdmin()\n {\n if (!in_array('admin', $this->roles)) {\n $this->roles[] = 'admin';\n }\n }",
"public function setAdmin(bool $admin): void\n {\n $this->_admin = $admin;\n }",
"public static function es_admin_option() {\n\t}",
"public function setMdp_admin($_mdp_admin){\n if(!is_string($_mdp_admin)){\n //on redirige\n header(\"Location:../vu/formulaire_connexion_admin.php\");\n return;\n }\n //on declare de la variable mdp_admin puis on appelle la varibale prive mdp_admin\n $this->_mdp_admin = $_mdp_admin;\n }",
"function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}",
"public function setAdminLabel($adminLabel)\n {\n $this->_adminLabel = $adminLabel;\n }",
"public function change()\n {\n $AdminTable = TableRegistry::get('Bakkerij/CakeAdmin.Administrators');\n $user = $AdminTable->newEntity([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => 'test',\n 'active' => 1\n ]);\n $AdminTable->save($user);\n }",
"public function edit(Admin $admin) {\n\t\t//\n\t}",
"public function setValue($value){\n $this->_value = $value;\n }",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"function setValue($value) {\n $this->value = $value;\n }",
"protected function set_default_value(){\n $this->set_view('sarung/admin/index');\n $this->set_min_power( 100 );\n\t\t$this->set_title('Session');\n\t\t$this->set_body_attribute( \" class='admin admin_sarung_body' \" );\n $this->set_table_name('session');\n \n $this->set_perkiraan_santri_name( 'perkiraan_santri' );\n $this->set_session_name ( 'session_name');\n $this->set_awal_name ( 'awal_name');\n $this->set_akhir_name ( 'akhir_name' );\n $this->set_nilai_name ( 'nilai_name') ;\n $this->set_model_name ( 'model_name');\n \n }",
"public function setAdminReview(?SubmissionAdminReview $value): void {\n $this->getBackingStore()->set('adminReview', $value);\n }",
"function upm_edit_admin_bar($id, $property, $value) {\r\n global $wp_admin_bar;\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')) {\r\n if(!is_array($id)) {\r\n $id = [$id];\r\n }\r\n $all_nodes = $wp_admin_bar->get_nodes();\r\n\r\n foreach($all_nodes as $key => $val) {\r\n $current_node = $all_nodes[$key];\r\n $wp_admin_bar->remove_node($key);\r\n\r\n if(in_array($key, $id)) {\r\n $current_node->$property = $value;\r\n }\r\n $wp_admin_bar->add_node($current_node);\r\n }\r\n }\r\n }\r\n}",
"public function edit(admin $admin)\n {\n //\n }",
"public function edit(admin $admin)\n {\n //\n }",
"public function edit(admin $admin)\n {\n //\n }",
"public function setIsAdmin($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->is_admin !== $v || $v === 0) {\n\t\t\t$this->is_admin = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::IS_ADMIN;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function in_admin($admin = \\null)\n {\n }",
"function setValue ($value) {\n\t\t$this->_value = $value;\n\t}",
"public function admin_init() {\n\t\tregister_setting( $this->options_key, $this->options_key, array( $this, 'save_settings' ) );\n\t}",
"function userAdmin( )\n {\n return $this->UserAdmin ;\n }",
"public function setAdmin($admin)\n {\n if($admin && !$this->hasRole(\"ROLE_ADMIN\"))\n {\n $this->addRole(\"ROLE_ADMIN\");\n } else {\n $this->removeRole(\"ROLE_ADMIN\");\n }\n }",
"public function setIsAdmin($isAdmin) {\n\t\t$this->isAdmin = $isAdmin;\n\t}",
"function SetAdminConfiguration() {\n\t\t\tadd_options_page(\"3B Meteo\", \"3B Meteo\", 8, basename(__FILE__), array(\"TreBiMeteo\",'DesignAdminPage'));\n\t\t}",
"function set_admin_email($email) {\n $this->admin_email = $email;\n }",
"public function test_edit_settings_send_as_admin()\n {\n $admin = User::find(1);\n\n $this->actingAs($admin)\n ->post('/settings/save', $this->settings_list())\n ->assertStatus(302)\n ->assertSessionHas('success');\n }",
"public function setEditable($value);",
"function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}",
"function olc_set_admin_access($fieldname, $status, $cID) {\n\treturn olc_db_query(SQL_UPDATE . TABLE_ADMIN_ACCESS . \" set \" . $fieldname . \" = '\".$status.\"'\n\twhere customers_id = '\" . $cID . APOS);\n}",
"public function edit(Admin $admin)\n {\n //\n }",
"public function edit(Admin $admin)\n {\n //\n }",
"public function edit(Admin $admin)\n {\n //\n }",
"public function edit(Admin $admin)\n {\n //\n }",
"public function edit(Admin $admin)\n {\n //\n }",
"public function edit(Admin $admin)\n {\n //\n }",
"public function admin_init() {}",
"public function admin_init(){\n\n\t}",
"function save_admin_options()\n {\n return update_option($this->options_name, $this->options);\n }",
"function editAdminHandler() {\n global $inputs;\n\n updateDb('admin',[\n 'name' => $inputs['admin_username'],\n 'password' => $inputs['admin_password'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n updateDb('admin_building',[\n 'building_id' => $inputs['admin_building'],\n ], [\n 'admin_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}",
"public function set_admin($user_id, $status)\n {\n $val = '0';\n if ($status === true) {\n $val = '1';\n }\n return $this->db\n ->set('user_type', $val)\n ->where('user_id', $user_id)\n ->update('users');\n }",
"public function setValue($value)\n\t{\n\t\t$this->setViewState('Value',$value,'');\n\t}",
"function add_data_admin($data_admin)\n\t\t{\n\t\t\t$this->db->insert('admin', $data_admin);\n\t\t}",
"function setSitePriv()\n {\n\t $sitePriv = RowManager_AdminManager::PRIVILEDGE_SITE;\n $this->setValueByFieldName( 'priv_id', $sitePriv );\n }",
"public function setAdminParams() {\n\t\tif( $this->_user->role != Core_Acl_Roles::ADMINS ) {\n\t\t\t$this->removeElement('group_id');\n\t\t\t$this->removeElement('active');\n\t\t}\n\t}",
"public function setValue($v){\n $this->value = $v;\n }",
"public function setValue($value)\n {\n if ($value === 'on') {\n $this->_value = 1;\n }\n $this->_value = trim($this->_db->prepareString($value));\n }",
"public function setValue( $value ) { \n $this->inputValue = $value; \n $this->value = $value;\n }",
"public function admin_init() {\n\n\t\t// set the settings\n\n\t\t$this->setting_api->set_sections( $this->get_settings_sections());\n\t\t$this->setting_api->set_fields( $this->get_settings_fields() );\n\n\t\t// initialize settings\n\t\t$this->setting_api->admin_init();\n\t}",
"function get_admin_name() {\n return $this->admin_name;\n }",
"protected function setupAdminUser()\n {\n $GLOBALS['current_user'] = \\BeanFactory::getBean('Users')->getSystemUser();\n }",
"public function setValue($value = true)\n {\n $this->value = $value;\n }",
"public function setValue( $value )\r\n\t{\r\n\t\t$this->value = $value;\r\n\t}",
"public function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value) {\n $this->value = $value;\n }",
"public function admin( bool $admin = true ): self {\n\t\t$this->admin = $admin;\n\t\treturn $this;\n\t}"
] | [
"0.8409223",
"0.7493217",
"0.73828626",
"0.7381825",
"0.7320138",
"0.7283983",
"0.7258937",
"0.71851826",
"0.7140116",
"0.71385425",
"0.70104355",
"0.69837004",
"0.69772136",
"0.6913287",
"0.68957376",
"0.68076634",
"0.67415994",
"0.6686758",
"0.6674533",
"0.66501796",
"0.66328645",
"0.65593493",
"0.6523955",
"0.6382612",
"0.6342907",
"0.62991405",
"0.6273741",
"0.62138444",
"0.62092596",
"0.61923915",
"0.6167753",
"0.6167753",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.6167721",
"0.61500454",
"0.61500454",
"0.61500454",
"0.61500454",
"0.61500454",
"0.61500454",
"0.61500454",
"0.61500454",
"0.61500454",
"0.61500454",
"0.614196",
"0.61224115",
"0.6099737",
"0.60969305",
"0.6089721",
"0.6089721",
"0.6089721",
"0.6070982",
"0.60648304",
"0.60637426",
"0.60611695",
"0.60508144",
"0.6037114",
"0.6013845",
"0.5965071",
"0.5959374",
"0.5956697",
"0.5946401",
"0.59398764",
"0.5937992",
"0.5920218",
"0.5920218",
"0.5920218",
"0.5920218",
"0.5920218",
"0.5920218",
"0.5892529",
"0.58784777",
"0.5863663",
"0.58464694",
"0.5843597",
"0.58428967",
"0.5837343",
"0.58280843",
"0.5821554",
"0.58116096",
"0.58084744",
"0.578628",
"0.5780274",
"0.57726634",
"0.57686245",
"0.5765249",
"0.57618034",
"0.5756206",
"0.5756206",
"0.5756206",
"0.5756206",
"0.5752613"
] | 0.0 | -1 |
Ensures singleton pattern is observed, loads the default expiry | public function __construct(array $config)
{
// We need the redis extension in order to work further so we check this first
if (!extension_loaded('redis'))
{
throw new Exception('Redis PHP extension not loaded but required to use Redis cache class!');
}
parent::__construct($config);
// Get Configured Servers
$servers = Arr::get($this->_config, 'servers', NULL);
if (empty($servers))
{
throw new Exception('No Redis servers defined in configuration. Please define at least one.');
}
// Now instance the redis server and configure it
$this->_redis = new \Redis();
// Global cache prefix so the keys in redis is organized
$cache_prefix = Arr::get($this->_config, 'cache_prefix', NULL);
$this->_tag_prefix = Arr::get($this->_config, 'tag_prefix', $this->_tag_prefix). ':';
foreach($servers as $server)
{
// Determine Connection method and connect
$method = Arr::get($server, 'persistent', FALSE) ? 'pconnect': 'connect';
$this->_redis->{$method}($server['host'], $server['port'], 1);
// See if there is a password
$password = Arr::get($server, 'password', NULL);
if (!empty($password))
{
$this->_redis->auth($password);
}
// Prefix a name space
$prefix = Arr::get($server, 'prefix', NULL);
if (!empty($prefix))
{
if (!empty($cache_prefix))
{
$prefix .= ':'.$cache_prefix;
}
$prefix .= ':';
$this->_redis->setOption(\Redis::OPT_PREFIX, $prefix);
}
}
// Tell redis to serialize using php serializer
$this->_redis->setOption(\Redis::OPT_SERIALIZER, \Redis::SERIALIZER_PHP);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function setDefaultExpiry()\n {\n if (config('laravelinvites.expiry.type') === 'none') {\n return null;\n }\n \n if (config('laravelinvites.expiry.type') === 'hours') {\n return now()->addHours(config('laravelinvites.expiry.value'));\n } elseif (config('laravelinvites.expiry.type') === \"days\") {\n return now()->addDays(config('laravelinvites.expiry.days'));\n }\n }",
"public function standardSingletonIsRegistered() {}",
"function &getInstance(){\n \n static $instance;\n \n if (!isset($instance)) {\n $c = __CLASS__;\n $instance = new $c;\n $instance->cache_dir = 'var/cache/';\n $instance->set_keys = array();\n $instance->fetched_keys = array();\n }\n return $instance;\n }",
"public function getExpiration();",
"public function singleton() {\n return $this->scope( 'singleton' );\n }",
"public function getExpiration()\n {\n }",
"public function getMembershipDefaultExpiration()\n {\n return (new \\DateTime('now'))->modify('+1 year');\n }",
"public function withExpired()\n {\n return $this->withoutGlobalScope(ExpirationScope::class);\n }",
"public function __construct()\n\t{\n\t\t$this->cache_ttl = intval(ee()->TMPL->fetch_param('ttl'));\n\t\t// For speed and API purposes, limit the cache to 30sec minimum\n\t\tif ($this->cache_ttl < 30)\n\t\t{\n\t\t\t$this->cache_ttl = 30;\n\t\t}\n\t}",
"private function __construct() { // singleton\n }",
"public static function getInstance()\n\t {\n\t \tif (self::$initialized) return;\n\t \tself::$initialized = true;\n\t }",
"public function getExpired() {\n\t\t\n\t}",
"public function setAutoExpirationTime() {\n $this->shareData[\"expire\"] = $this->getAutoExpirationTime();\n return $this;\n }",
"public function getDefaultLifetime(): int\n {\n return $this->defaultLifetime;\n }",
"public function __sleep()\n\t{\n\t\tthrow new DomainException('No serializing of singleton');\n\t}",
"public static function getInstance() {\nstatic $instance;\n// Second call to this function will not get into the if-statement,\n// Because an instance of Singleton is now stored in the $instance\n// variable and is persisted through multiple calls\nif (!$instance) {\n// First call to this function will reach this line,\n// because the $instance has only been declared, not initialized\n$instance = new Singleton();\n} \nreturn $instance;\n}",
"public function getExpired();",
"public function expire();",
"public function __construct()\n {\n $this->ttl = env('TTL');\n }",
"public static function forge()\n\t{\n\t\tif (empty(static::$instance)) {\n\t\t\tstatic::$instance = new static;\n\t\t}\n\t\t\n\t\treturn static::$instance;\n\t}",
"public function getIsSingleton() {}",
"public function _loadRealInstance() {}",
"public function getCacheLifetime()\n {\n return self::DEFAULT_CACHE_LIFETIME;\n }",
"function schedule_expiry() {\n\t\tif ( ! wp_next_scheduled( 'github_embed_cron' ) ) {\n\t\t\t$frequency = apply_filters( 'github_embed_cache_frequency', 'daily' );\n\t\t\twp_schedule_event( time(), $frequency, 'github_embed_cron' );\n\t\t}\n\t}",
"public static function init() {\n\n\t\t\tif(self::$single) return self::$single;\n\t\t\telse return self::$single = new static;\n\n\t\t}",
"public function testSingletonReturnsSameInstanceEverytime()\n {\n $c = new Container;\n\n $c->singleton('League\\Container\\Test\\Asset\\Baz');\n\n $this->assertTrue($c->isSingleton('League\\Container\\Test\\Asset\\Baz'));\n\n $baz1 = $c->get('League\\Container\\Test\\Asset\\Baz');\n $baz2 = $c->get('League\\Container\\Test\\Asset\\Baz');\n\n $this->assertTrue($c->isSingleton('League\\Container\\Test\\Asset\\Baz'));\n $this->assertSame($baz1, $baz2);\n }",
"protected function getCache() {\n\t\t$factory = $this->policy('rate_factoryname');\n\t\t$lifetime = $this->policy('rate_lock_timeout') + 60; // As long as it's longer than the actual timeout\n\t\t$cache = SS_Cache::factory($factory);\n\t\t$cache->setOption('automatic_serialization', true);\n\t\t$cache->setOption('lifetime', $lifetime);\n\t\treturn $cache;\n\t}",
"function test_expires_in()\n {\n # Only Memcache & Redis support expires_in.\n if (get_class($this) == 'Test_ActiveSupport_Cache_MemcacheStore'\n or get_class($this) == 'Test_ActiveSupport_Cache_RedisStore')\n {\n # caching second var (with ttl)\n $this->cache->write('other_var', '23', array('expires_in' => 2));\n $this->assert_equal($this->cache->read('other_var'), '23');\n sleep(3);\n $this->assert_false($this->cache->read('other_var'));\n $this->assert_equal($this->cache->read('var'), 'value');\n }\n }",
"public function __construct()\n {\n parent::__construct();\n $this->randTimeService = new RandTimeHadistService();\n }",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"private function __wakeup() { /* ... @return Singleton */ }",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"public static function getInstance() {}",
"function wp_cache_init()\n{\n global $wp_object_cache;\n\n if (! ($wp_object_cache instanceof WP_Object_Cache)) {\n $fail_gracefully = ! defined('WP_REDIS_GRACEFUL') || WP_REDIS_GRACEFUL;\n\n $wp_object_cache = new WP_Object_Cache($fail_gracefully);\n }\n}",
"public static function getInstance()\n {\n return self::$instance ?? self::getNewInstance();\n }",
"public function getInstance(): mixed;",
"public static function getInstance() {\r\n if (!Website_Service_Cache::$instance instanceof self) {\r\n Website_Service_Cache::$instance = new self();\r\n }\r\n return Website_Service_Cache::$instance;\r\n }",
"protected static function __instance()\n {\n return DiPool::getinstance()->getSingleton(static::class);\n }",
"public function __construct()\n {\n //$this->middleware('auth');\n $this->expiresAt = Carbon::now()->addDay(15);\n }",
"final public static function i() {\r\n return isset(static::$instance) ? static::$instance : static::$instance = new static;\r\n }",
"public function setExpiry( $expiry );",
"public static function init() {\n return isset(static::$instance) ? static::$instance : (static::$instance = new static);\n }",
"public function ensureToken()\n {\n if ($this->tokenExpiry === null) {\n $this->regenerateToken();\n }\n }",
"function __construct() {\n $this->_cache = [];\n }",
"public static function reinit() {\n\t\tself::$instance = NULL;\n\t\tself::init();\n\t}",
"abstract protected function isExpired();",
"public function getExpiration()\n {\n // expire now\n return new \\DateTime();\n }",
"public static function instance() {\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self;\n\t\t\tself::$instance->do_hooks();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public function be_instantiatable() {\n\t\t$this->assertInstanceOf( Cache::class, $this->make_instance() );\n\t}",
"public function __construct($id = NULL)\n\t{\n\t\tparent::__construct($id);\n\n\t\tif (mt_rand(1, 100) === 1)\n\t\t{\n\t\t\t// Do garbage collection\n\t\t\t$this->delete_expired();\n\t\t}\n\n\t\tif ($this->expires < time() AND $this->loaded())\n\t\t{\n\t\t\t// This object has expired\n\t\t\t$this->delete();\n\t\t}\n\t}",
"public static function init() {\n\t\treturn self::$instance = new self();\n\t}",
"function acquire($key, $ttl);",
"private function __construct(){\r\n $this->ttl_by_type = array(\r\n 'short' => 300 , // 5 minutes\r\n 'default' => 7200, // 2 hours\r\n 'halfday' => 43200, // 12 hours\r\n 'day' => 86400, // 24 hours\r\n 'week' => 604800, // 7 days\r\n 'month' => 2592000, // 30 days (1 month)\r\n 'longterm' => 15811200 // 183 days (6 months)\r\n );\r\n }",
"public function __construct(){\n\t\tsession_start();\n\t\tif(!self::$_singleton instanceof self){\n\t\t\t$this->setInstance();\n\t\t}\n\t}",
"public function onlyEternal()\n {\n return $this->withoutGlobalScope(ExpirationScope::class)\n ->whereNull($this->model->getExpirationAttribute());\n }",
"public static function initialize(){\n self::getInstance();\n }",
"static function init(){\n\t\tif( ! self::$backend instanceof self::$useBackend){\n\t\t\t$backend = new self::$useBackend();\n\t\t\tself::setBackend($backend);\n\t\t\tif(! $backend instanceof cacheBackend)\n\t\t\t\tthrow new RuntimeException(__class__.'::init() invalid cacheBackend');\n\t\t\tif( self::$autoClear )\n\t\t\t\tself::clear(self::$ttl);\n\t\t}\n\t}",
"public function makeEternal()\n {\n return $this->update([\n $this->model->getExpirationAttribute() => null\n ]);\n }",
"public function getDefaultLifetime() : ?int\n {\n return $this->default_lifetime;\n }",
"public static function init(): void {\r\n self::getInstance();\r\n }",
"public function isSingleton() {\n return true;\n }",
"private function _acquireOnce(): self {\n\t\treturn $this->_acquire_where([\n\t\t\t'pid' => null,\n\t\t]);\n\t}",
"public function init()\n\t{\n\t\t$this->_app = classes_like_registry::getApp();\n\t\t$this->_area = classes_like_registry::getArea();\n\t\t\n\t\tif ( empty( $this->_app ) OR empty( $this->_area ) )\n\t\t{\n\t\t\ttrigger_error( \"Missing area or app variable in \" . __CLASS__ . '::' . __FUNCTION__, E_USER_WARNING );\n\t\t}\n\t\t\n\t\t/* Fetch cache class */\n\t\t$this->likeCache = classes_like_cache::getInstance();\n\t\t\n\t\t/* Set a default cache expiration of 24 hours */\n\t\t$this->likeCache->setExpiration( 86400 );\n\t}",
"public function __construct($id = null)\n {\n parent::__construct($id);\n\n // Set the now, we use this a lot\n $this->now = time();\n\n if (mt_rand(1, 100) === 1) {\n // Do garbage collection\n $this->delete_expired();\n }\n\n if ($this->expires < $this->now) {\n // This object has expired\n $this->delete();\n }\n }",
"public static function instance() {\n if( is_null( ExpTimeMon::$instance )) ExpTimeMon::$instance =\n new ExpTimeMon (\n EXPTIMEMON_DEFAULT_HOST,\n EXPTIMEMON_DEFAULT_USER,\n EXPTIMEMON_DEFAULT_PASSWORD,\n EXPTIMEMON_DEFAULT_DATABASE );\n return ExpTimeMon::$instance;\n }",
"public function __construct($defaultTimeToLive = CacheInterface::MAX_TTL)\n {\n $this->setDefaultTTL($defaultTimeToLive);\n $this->cache = [];\n }",
"private static function cookieLifetime()\n {\n return time() + (self::ACCESS_TOKEN_EXPIRES_DAYS * 24 * 60 * 60);\n }",
"public function expiryDate();",
"private function __construct()\n\t{\n\t\t$this->_loadCacheObj();\n\t\treturn;\n\t}",
"public function getInstance(): object;",
"static public function getInstance()\n {\n if (!isset(self::$instance))\n {\n self::$instance = new Autoload();\n }\n\n return self::$instance;\n }",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t$this->unactivatedPostsExpiration = (int)config('settings.cron.unactivated_posts_expiration', $this->unactivatedPostsExpiration);\n\t\t$this->activatedPostsExpiration = (int)config('settings.cron.activated_posts_expiration', $this->activatedPostsExpiration);\n\t\t$this->archivedPostsExpiration = (int)config('settings.cron.archived_posts_expiration', $this->archivedPostsExpiration);\n\t}",
"public function isExpired() {}",
"function isSingleton(){\n return true;\n }",
"public function initialize() {\n\t\tself::$instance = $this;\n\t}",
"protected function regenerateTokenIfNotNew()\n {\n if ($this->tokenExpiry !== null) {\n $this->regenerateToken();\n }\n }",
"private static function singleton() \n\t{\n\t\tif (! isset ( self::$_instance )) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\t\n\t\treturn self::$_instance;\n\t}",
"protected function resetSingletons() {}",
"function &getInstance() {\r\n\t\tstatic $singleton;\r\n\r\n\t\tif (!$singleton)\r\n\t\t\t$singleton = new Database();\r\n\t\treturn $singleton;\r\n\t}",
"public function testAssertTTL() {\n\n\t\t\t$lockName = uniqid();\n\n\t\t\tSharedLock::lock($lockName, 0, 10);\n\n\t\t\tSharedLock::assertTTL($lockName, 5);\n\t\t}",
"public static function getInstance(){\r\n\r\n\t\t// This method is overriden from the singleton one simply to get correct\r\n\t\t// autocomplete annotations when returning the instance\r\n\t\t$instance = parent::getInstance();\r\n\r\n\t\treturn $instance;\r\n\t}",
"protected function getCacheLifetime(): ?int\n {\n return 86400;\n }",
"public function cacheFor()\n {\n // return now()->addMinutes(5);\n }",
"function cache() {\n\n if ( func_num_args() == 0 ) {\n return $this->expireTime;\n } elseif ( func_num_args() == 1 ) {\n if ( is_bool(($arg = func_get_arg(0))) ) {\n if ( $arg ) {\n $this->expireTime = 3600;\n } else {\n $this->expireTime = 0;\n }\n } elseif ( is_numeric($arg) ) {\n $this->expireTime = $arg;\n } else {\n return isset($this->cache_expires[$arg])?$this->cache_expires[$arg]:0;\n }\n } elseif ( func_num_args() == 2 ) {\n if ( is_numeric(($arg=func_get_arg(1))) ) {\n $this->cache_expires[func_get_arg(0)] = $arg;\n } elseif ( is_bool($arg) ) {\n if ( $arg ) {\n $this->cache_expires[func_get_arg(0)] = 3600;\n } else {\n $this->cache_expires[func_get_arg(0)] = 0;\n }\n }\n }\n }",
"public static function getInstance() : Forge\n {\n return static::$instance = static::$instance ?: new static();\n }",
"public function clearExpiry();",
"public static function getInstance(): self;",
"public static function getInstance()\n {\n if (static::$instance !== null) {\n return static::$instance;\n }\n\n static::$instance = new static;\n static::$instance->onCreateInstance();\n return static::$instance;\n }",
"static public function getInstance() {\n\t\t\tif (!self::$objInstance) {\n\t\t\t\tself::$objInstance = new Date();\n\t\t\t}\n\t\t\treturn self::$objInstance;\n\t\t}",
"function object_cache_init() {\n\tif (!isset($GLOBALS['ts_object_cache']))\n\t\t$GLOBALS['ts_object_cache'] = service('ObjectCache');\n}",
"public function testDefaultSecondsWithDateInterval(): void\n {\n $interval = new \\DateInterval('P3DT4H');\n $this->testNotStrict->setDefaultSeconds($interval);\n $expected = 273600;\n $key = 'Setting Default';\n $value = 'Pie in the Sky';\n $this->testNotStrict->set($key, $value);\n $realKey = $this->testNotStrict->getRealKey($key);\n $cacheTTL = $this->redis->ttl($realKey);\n $race = abs($cacheTTL - $expected);\n $this->assertLessThan(3, $race);\n }",
"public static function singleton(){\n\t\tif (!isset(self::$instance)) {\n\t\t\t$miclase = __CLASS__;\n\t\t\tself::$instance = new $miclase;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public function forgetInstances();",
"private function __construct()\n {\n $this->time = time();\n }"
] | [
"0.57489955",
"0.5647818",
"0.5629954",
"0.5608851",
"0.5576122",
"0.5547908",
"0.54867476",
"0.5482403",
"0.5480323",
"0.54746324",
"0.54682684",
"0.5425716",
"0.53860027",
"0.5376155",
"0.53660756",
"0.5357576",
"0.5348062",
"0.53420204",
"0.5336933",
"0.5320542",
"0.53060144",
"0.52962404",
"0.52940685",
"0.5282186",
"0.52790964",
"0.52772653",
"0.52565426",
"0.52546567",
"0.52481407",
"0.5221987",
"0.5221987",
"0.5221987",
"0.5221987",
"0.52219385",
"0.5221303",
"0.5221303",
"0.5221303",
"0.5220309",
"0.5220309",
"0.5220309",
"0.52150923",
"0.5208158",
"0.52046585",
"0.51928455",
"0.51831734",
"0.5173298",
"0.51696813",
"0.516855",
"0.5163531",
"0.515248",
"0.51475686",
"0.51342505",
"0.51235193",
"0.5123243",
"0.511512",
"0.51079935",
"0.51037997",
"0.50826854",
"0.50778764",
"0.50711936",
"0.50711256",
"0.506983",
"0.5064421",
"0.5064062",
"0.5060245",
"0.50533193",
"0.50506043",
"0.50495595",
"0.5048636",
"0.50452477",
"0.5042985",
"0.5039853",
"0.50277394",
"0.5024485",
"0.5023718",
"0.5018412",
"0.5018364",
"0.5016499",
"0.50162923",
"0.5007084",
"0.50066084",
"0.50062615",
"0.49994364",
"0.49980378",
"0.49953058",
"0.49946976",
"0.49927235",
"0.49867025",
"0.49718207",
"0.4965548",
"0.49602482",
"0.4957274",
"0.49496257",
"0.49474633",
"0.4945311",
"0.49435633",
"0.4943019",
"0.4937824",
"0.49356887",
"0.49294987",
"0.4929266"
] | 0.0 | -1 |
/__construct() property is invoked with: new Genus() in superseded method newAction() OR the now used LoadFixtures.php/ | public function __construct()
{
/*initialize the notes property to a new ArrayCollection*/
$this->notes = new ArrayCollection();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _construct() {\n $this->_init('supermenu/supermenu', 'supermenu_id');\n }",
"public function __construct() {\n\t\t// creating a collection for storing menus\n\t\t$this->collection = new Collection ();\n\t}",
"public function _construct()\n {\n $this->_init('megamenu/megamenu', 'adminmenutop_id');\n }",
"public function __construct()\n\t{\n\t\t$this->menus = array();\n\t}",
"public function _construct()\r\r\n {\r\r\n $this->_init('megamenu/menuitems', 'id');\r\r\n }",
"public function __construct()\n\t{\n\t\t// creating a collection for storing menus\n\t\t$this->collection = new Collection();\n\t}",
"function __construct() {\n add_action( 'admin_menu', [$this, 'register_menu'] );\n }",
"public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}",
"public function __construct()\n\t{\n\t\tadd_action( 'after_setup_theme', array(&$this, 'menus') );\n\t}",
"function __construct() {\n\t\t\tadd_action( 'admin_menu', array( $this, 'add_menu_item' ) );\n\t\t\tadd_action( 'croco_spb_save_options', array( $this, 'save_settings' ) );\n\t\t}",
"function __construct()\n {\n $CI =& get_instance();\n log_message('debug', 'Loaded Menu');\n }",
"public function __construct() {\r\n\t\t\t// Register actions.\r\n\t\t\t\tadd_action( 'admin_init', array( &$this, 'admin_init' ) );\r\n\t\t\tadd_action( 'admin_menu', array( &$this, 'add_menu' ) );\r\n\t\t}",
"function __construct() {\n\t\t$menus = wp_get_nav_menus();\n\t\t$choices = array();\n\t\tforeach ( $menus as $menu ) {\n\t\t\tif ( ! is_wp_error( $menu ) && ! array_key_exists( 'invalid_taxonomy', $menu ) && ! empty( $menu ) ) {\n\t\t\t\t$choices[] = array( 'value' => $menu->slug, 'name' => $menu->name );\n\t\t\t}\n\t\t}\n\t\t$new_name_param = Arrays::from( $this->params )\n\t\t->find( function( $x ) { return 'name' === $x['id']; } )\n\t\t->set( 'type', 'dropdown' )\n\t\t->set( 'choices', $choices )\n\t\t->obtain();\n\t\t$other_params = Arrays::from( $this->params )\n\t\t->filter( function( $x ) { return 'name' !== $x['id']; } )\n\t\t->obtain();\n\t\t$this->params = array_merge( array( $new_name_param ), $other_params );\n\t}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t$this->load->model('mdl_menuitem', 'menuitem');\n\n\t\tlog_message('debug', \"Class Name Controller Initialized\");\n\t}",
"public function __construct() {\n\n\t\t$this->actions = [];\n\t\t$this->filters = [];\n\t\t\n\t\t# Components\n\t\t$this->nav = new Nav ();\n\t\t$this->api = new API ();\n\t\t$this->admin = new Admin ();\n\t\t\n\t\t# Define hooks\n\t\t$this->enqueue ();\n\t\t$this->admin_hooks ();\n\t\t$this->admin_ajax_routing ();\n\t\t$this->public_hooks ();\n\t}",
"function __construct() {\n\t\t\t// Hooks\n\t\t\tadd_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 9999 ); // Admin Bar Menu (late)\n\t\t}",
"public static function init() {\n\t\tself::setup_actions();\n\t}",
"public function __construct() {\n\t\t$this->help_base = POWER_VIEWS_DIR . '/help/getting-started-';\n\n\t\t$page_id = 'power-getting-started';\n\n\t\t$menu_ops = [\n\t\t\t'submenu' => [\n\t\t\t\t'parent_slug' => 'power',\n\t\t\t\t'page_title' => __( 'Power - Getting Started', 'power' ),\n\t\t\t\t'menu_title' => __( 'Child Theme Setup', 'power' ),\n\t\t\t],\n\t\t];\n\n\t\t$this->create( $page_id, $menu_ops );\n\t}",
"public function __construct()\n {\n $men= \\App\\Menu::all();\n $this->menus = $men;\n }",
"public function __construct() {\n\t\tnew PageHooks();\n\t\tif ( is_admin() ) {\n\t\t\tnew LeadinAdmin();\n\t\t}\n\t}",
"function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}",
"public function __construct()\n {\n parent::__construct();\n\n menu_apa();\n }",
"function __construct() {\n\n // add custom menu fields to menu\n add_filter( 'wp_setup_nav_menu_item', array( $this, 'aderna_megamenu_add_custom_nav_fields' ) );\n // save menu custom fields\n add_action( 'wp_update_nav_menu_item', array( $this, 'aderna_megamenu_update_custom_nav_fields'), 10, 3 );\n // edit menu walker\n add_filter( 'wp_edit_nav_menu_walker', array( $this, 'aderna_megamenu_edit_walker'), 10, 3 );\n\n\n }",
"function __construct() {\n\t\t$request = Request::getInstance();\n\t\t$plugin = Plugin::getInstance();\n\t\t$plugin->triggerEvents('load' . $request->getController());\n\t}",
"public function __construct() {\n\t\t$args = array(\n\t\t\t'name' => esc_html__( 'Bauhaus Menu', 'bauhaus' ),\n\t\t\t'description' => esc_html__( 'It displays Menu', 'bauhaus' ),\n\t\t\t'classname' => 'bauhaus_Menu'\n\t\t);\n\t\tparent::__construct( 'nav_menu', esc_html__( 'Bauhaus Menu', 'bauhaus' ), $args );\n\n\n\t}",
"public function __construct() {\n parent::__construct();\n $this->load->model('super-admin/m_menu');\n $this->load->model('super-admin/usertypes_model');\n }",
"protected function initAction()\n {\n }",
"function __construct() {\n\t\tadd_action( 'oxygen_enqueue_scripts', \tarray( $this, 'enqueue_script' ) );\n\t\tadd_action( 'admin_menu', \t\t\t\tarray( $this, 'add_typekit_page' ) );\n\t\tadd_action( 'ct_builder_ng_init', \t\tarray( $this, 'init_typekit' ) );\n\t}",
"public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }",
"private function __construct() {\r\n $this->initHooks();\r\n }",
"public function __construct()\n\t\t{\n\t\t\t// Call all standard addon functions\n\t\t\t$this->SetId(strtolower(__CLASS__));\n\t\t\t$this->LoadLanguageFile();\n\t\t\t$this->SetName(GetLang('EmailChangeName'));\n\t\t\t$this->SetImage('logo.gif');\n\n\t\t\tif ($this->HasPermission()) {\n\t\t\t\t$this->RegisterMenuItem(\n\t\t\t\t\tarray(\n\t\t\t\t\t'location'\t\t=> 'mnuCustomers',\n\t\t\t\t\t'text'\t\t\t=> GetLang('EmailChangeMenuText'),\n\t\t\t\t\t'icon'\t\t\t=> 'email_edit.gif',\n\t\t\t\t\t'description'\t=> GetLang('EmailChangeMenuDesc'),\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}",
"function __construct()\r\n\t{\r\n\r\n\t\tadd_action('admin_init', array(&$this, 'options_init') );\r\n\t\tadd_action('admin_menu', array(&$this, 'add_menu_items'));\r\n\t}",
"public function __construct() {\r\n // Pre svega - .env podesiti parametre za pristup bazi\r\n \r\n $menu = new Menu();\r\n $this->data['menus'] = $menu->getAll();\r\n \r\n // var_dump($this->data['menus']);\r\n }",
"function __construct() {\n\t\tadd_action('admin_menu', array( &$this,'scd_register_menu') );\n\t\tadd_action('load-index.php', array( &$this,'scd_redirect_dashboard') );\n\t}",
"function __construct() \n {\n // CODE\n parent::__construct( XMLObject_Menu::ROOT_NODE_MENU );\n \n }",
"protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}",
"function __construct() {\n add_filter( 'wp_edit_nav_menu_walker', array(&$this,'modify_backend_walker') , 100);\n\n // Modify arguments for frontend mega menu\n add_filter('wp_nav_menu_args', array(&$this,'modify_nav_arguments'), 100);\n\n // Save menu\n add_action( 'wp_update_nav_menu_item', array(&$this,'update_menu'), 100, 2);\n\n }",
"public function __construct()\n {\n $this->paths('app/Actions');\n $this->loadedActions = collect();\n }",
"function __construct() {\n $this->reg = Core_Registery::singleton();\n $this->reg->controller = $this;\n $this->view = $this->reg->view;\n\n //Actie aanroepen. Dus: als www.skynet.nl/test dan TestAction();\n if(isset($_GET['page']))\n {\n //remove install/ from begin of string and change / to \"_\"\n $action = str_replace(\"/\",\"_\",$_GET['page']);\n //substr last char since that is always a /\n $action = strtolower(substr($action,0,-1)).'Action';\n if(method_exists($this, $action))\n {\n call_user_func(array($this,$action));\n }\n else\n {\n $this->indexAction();\n }\n }\n else\n {\n $this->indexAction();\n }\n }",
"protected function __construct() {\n\t\t//Generated by ManagerGenerator::generateConstruct()\n\t}",
"function __construct() {\n\n\t\t\tadd_action( 'admin_menu', array( $this, 'add_menu_page' ), 20 );\n\t\t\tadd_action( 'init', array( $this, 'register_instances' ), 11 );\n\n\t\t\t$this->init_data();\n\n\t\t\tadd_action( 'jet-engine/rest-api/init-endpoints', array( $this, 'init_rest' ) );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'relations_box_assets' ), 10 );\n\n\t\t\trequire_once $this->component_path( 'hierarchy.php' );\n\t\t\t$this->hierarchy = new Jet_Engine_Relations_Hierarchy();\n\n\t\t\tif ( ! $this->is_cpt_page() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_action( 'admin_init', array( $this, 'register_pages' ) );\n\t\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ), 0 );\n\t\t\tadd_action( 'admin_init', array( $this, 'handle_actions' ) );\n\n\t\t}",
"public function __construct()\n {\n add_action('admin_menu', array($this, 'add_sub_menu'));\n // load front-end javascript\n add_action('admin_enqueue_scripts', array($this, 'queue_browser_scripts'));\n }",
"function __construct(){\n //Actions\n add_action('init', array($this, 'init'), 1);\n \n }",
"public function init() {\n\t\t$this->load_actions();\n\t}",
"function __construct() {\n\t\t\n\t\t// Add hooks.\n\t\tadd_action( 'admin_menu', \t\t\t\tarray( $this, 'admin_menu' ) );\n\t\tadd_action( 'admin_enqueue_scripts',\tarray( $this, 'admin_enqueue_scripts' ) );\n\t\tadd_action( 'admin_body_class', \t\tarray( $this, 'admin_body_class' ) );\n\t}",
"public function __construct()\n {\n parent::__construct();\n\n $this->data['currentAdminMenu'] = 'catalog';\n $this->data['currentAdminSubMenu'] = 'product';\n }",
"protected function initializeAction() {}",
"public function __construct()\n {\n add_action( 'admin_menu', array( $this, 'register' ), $this->priority );\n }",
"protected function initializeAction() {}",
"protected function initializeAction() {}",
"public function __construct() {\n\t\t\t// register actions\n\t\t\tadd_action( 'admin_menu', array( $this, 'add_menu' ) );\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'load_front_resources' ) );\n\t\t}",
"public function __construct()\n\t{\n\t\t$this->filter('before', 'orchestra::manage');\n\t\t\n\t\tparent::__construct();\n\t}",
"protected function __construct() {\n $this->load_data();\n add_action( 'init', array( $this, 'init' ), 0 );\n }",
"public function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'description' => __( 'Add a custom menu to your sidebar.', 'jobcareer'),\n\t\t\t'customize_selective_refresh' => true,\n\t\t);\n\t\tparent::__construct( 'nav_menu_chimp', __('CS: Custom Menu', 'jobcareer'), $widget_ops );\n\t}",
"public function initializeAction() {\n\n\t}",
"protected function makeActionMenu() {}",
"public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"private function __construct(){ \r\n $this->includes();\r\n $this->hooks();\r\n }",
"function _construct() {\n\t\tparent::_construct();\n\t}",
"function __construct() {\n\t\tparent::__construct();\n\t\t$this->init();\n\t}",
"public function __construct() {\n\t\tadd_action( 'init', array(&$this, 'register') );\n\t}",
"protected function __construct()\n\t{\n\t\t// Register admin menu\n\t\tadd_action('admin_bar_menu', array($this, '_adminbar'), 110);\n\t}",
"public function __construct() \n\t{\n\t\tadd_action( 'admin_menu', array( $this, 'create_thirty8_simple_map_settings_pages' ) );\n\t\t\t\t\t\t\n\t}",
"function __construct()\n\t{\n\t\t$this->load = new Load();\n\t\t$this->model = new Model();\n\n\t\t$this->home();\n\t}",
"public static function init() {\n\t\t\tadd_action( 'admin_menu', __CLASS__ . '::simple_recipes_create_menu' );\n\t\t\n\t\t}",
"public function __construct() {\n\t\tadd_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) );\n\t}",
"public function __construct() {\n\n\t\t// Add submenu page\n\t\t// add_action( 'admin_menu', function() {\n\t\t// \tadd_submenu_page(\n\t\t// \t\t'edit.php?post_type=' . $this->post_type,\n\t\t// \t\t'Test API',\n\t\t// \t\t'Test API',\n\t\t// \t\t'manage_options',\n\t\t// \t\t'rj_ml_test',\n\t\t// \t\tarray( $this, 'content' )\n\t\t// \t);\n\t\t// } );\n\n\t\t// Get current values\n\t\t$this->options = $this->get_options();\n\n\t\t// Check if options were submitted\n\t\tif ( isset( $_POST['rj_ml_run_test'] ) ) {\n\t\t\t$result = $this->test_api();\n\t\t\tif ( !$result['success'] ) {\n\t\t\t\t$this->add_notice( 'error', $result['message'] );\n\t\t\t} else {\n\t\t\t\t$this->add_notice( 'updated', $result['message'] );\n\t\t\t}\n\t\t}\n\n\t}",
"function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}",
"public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }",
"function __construct() {\n\t\tparent::__construct(\n\t\t\t'UWO_Top_Menu', // Base ID\n\t\t\t__('UWO Top Menu', 'text_domain'), // Name\n\t\t\tarray( 'description' => __( 'This widgets allows easy placement for the UWO Top Menu.', 'text_domain' ), ) // Args\n\t\t);\n\t}",
"public function __construct() {\n // Initialisation du mappage du site\n if ($this->router === false) {\n $router = new Router();\n $router->map();\n $this->router = true;\n }\n // On récupère l'URL et on la traite\n $this->request = new Request();\n $this->request = new Router($this->request->url);\n $this->request = $this->request->request;\n // On appelle soit le controlleur soit une page d'erreur\n $controller = $this->loadController();\n $action = $this->request['action']; \n if (class_exists($controller) && in_array($action, get_class_methods($controller))) {\n call_user_func_array(array(new $controller, $action), $this->request['params']);\n } else {\n Router::error(); \n } \n }",
"function __construct() {\n\t\n\t\tadd_action('admin_menu', array( &$this,'rc_scd_register_menu') );\n\t\tadd_action('load-index.php', array( &$this,'rc_scd_redirect_dashboard') );\n \n\t}",
"public function __init(){}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"function __construct(){\n\t\t// nowt much...\n\t}",
"function __construct()\n {\n $this->childController = strtolower(get_called_class());\n $this->openDatabaseConnection();\n $this->loadModel();\n $this->loadView();\n }",
"public function action_init()\n\t{\n\t\t$this->add_template( 'menus_admin', dirname( __FILE__ ) . '/menus_admin.php' );\n\t\t$this->add_template( 'menu_iframe', dirname( __FILE__ ) . '/menu_iframe.php' );\n\t\t$this->add_template( 'block.menu', dirname( __FILE__ ) . '/block.menu.php' );\n\n\t\t// formcontrol for tokens\n\t\t$this->add_template( 'text_tokens', dirname( __FILE__ ) . '/formcontrol_tokens.php' );\n\t}",
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"protected function __construct() {\n\n // Cargamos Clases.\n $this -> setup_hooks();\n }",
"protected function __construct() {\n\n // Cargamos Clases.\n $this -> setup_hooks();\n }",
"public function __construct() {\n\t\tadd_action( 'init', array( $this, 'people' ) );\n\t}",
"public function __construct()\n {\n $this->options = array(\n 'l' => 'List all members',\n 'L' => 'List all members (long)',\n 'r' => 'Register new member',\n 'e' => 'Edit member',\n 'd' => 'Delete member',\n 's' => 'Select single member',\n 'b' => 'Handle boats',\n 'q' => 'Exit application'\n );\n\n $db = new PDO(DB_CONNECTION_STRING);\n $this->serviceModel = new ServiceModel($db);\n\n $this->memberController = new MemberController($this->serviceModel);\n $this->boatController = new BoatController($this->serviceModel);\n\n $this->view = new MenuView($this->options, \"-----------\\n Main menu \\n-----------\");\n }",
"protected function _construct()\n\t{\n\t\t$this->_init('aurednik/cms_home_entity_store');\n\t}",
"private function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'textdomain' ) );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_files' ) );\n\t}",
"public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __construct() {\n\t\tadd_action( 'admin_notices', array( $this, 'admin_notices' ) );\n\t\tadd_action( 'add_meta_boxes', array( $this, 'add_order_meta_box' ) );\n\t\tadd_action( 'admin_init', array( $this, 'add_sections' ) );\n\t\tadd_action( 'admin_menu', array( $this, 'add_plugin_settings_page' ) );\n\t\tadd_action( 'edit_user_profile', array( $this, 'user_profile_pictures' ) );\n\t}",
"private function __construct() {\n\t\tadd_action( 'plugins_loaded', array( $this, 'textdomain' ) );\n\t\tadd_action( 'plugins_loaded', array( $this, 'load_files' ) );\n\t}",
"function __construct()\n {\n parent::__construct();\n $this->init();\n }",
"public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __construct() {\n \tadd_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) );\n }",
"public function setUpMenuItems()\n {\n $Menu = new DModuleMenu();\n $Menu -> setIcon( '<i class=\"fa fa-money\"></i>' );\n $MenuItem = new DModuleMenuItem( \"show\" , \"Monedas\" );\n $MenuItem -> setIcon( '<i class=\"fa fa-money\"></i>' );\n $Menu -> addItemObject( $MenuItem );\n $this -> setMenu( $Menu );\n }",
"function __Construct()\n {\n parent::__Construct();\n }",
"public function __construct()\r\n {\r\n $this->includes();\r\n $this->setup();\r\n $this->hooks();\r\n }",
"public function __construct()\n {\n parent::__construct();\n\n Breadcrumbs::add('Glossaries', URL::admin('glossaries'));\n }",
"function __construct() {\r\n parent ::__construct();\r\n }",
"public function __construct()\n\t{\n\t\t$this->load->library('administrator');\n\n\t\t$this->itemMatches = array(\"spells/*\", \"items/*\", \"search/*\");\n\t\t$this->websiteMatches = array(\"*.cache\");\n\t\t$this->messageMatches = array(\"messages/*\");\n\n\t\tparent::__construct();\n\n\t\trequirePermission(\"viewCache\");\n\t}"
] | [
"0.7505201",
"0.7235007",
"0.7223316",
"0.717678",
"0.717206",
"0.71629184",
"0.7140486",
"0.71268636",
"0.711841",
"0.70806295",
"0.7065866",
"0.7038216",
"0.7034214",
"0.70265025",
"0.70242906",
"0.7019981",
"0.6997071",
"0.698319",
"0.696378",
"0.69504505",
"0.69175243",
"0.69083136",
"0.68311703",
"0.6828213",
"0.68282044",
"0.68179345",
"0.6808425",
"0.67974055",
"0.67881393",
"0.67881227",
"0.6783923",
"0.6762631",
"0.67606837",
"0.6758564",
"0.675686",
"0.6744845",
"0.6738398",
"0.67229444",
"0.6721357",
"0.6708546",
"0.6708365",
"0.6699796",
"0.6699576",
"0.66961163",
"0.66880137",
"0.6681952",
"0.6674381",
"0.66731596",
"0.6672853",
"0.6672853",
"0.66724634",
"0.6671828",
"0.66613567",
"0.66591996",
"0.6630263",
"0.6629778",
"0.66287756",
"0.6626415",
"0.66234595",
"0.6617711",
"0.6617606",
"0.66158074",
"0.6615777",
"0.66097564",
"0.65945625",
"0.6593008",
"0.65885144",
"0.6588507",
"0.65851563",
"0.65835315",
"0.6579536",
"0.65777975",
"0.65726453",
"0.65705043",
"0.65705043",
"0.65705043",
"0.65705043",
"0.65705043",
"0.6563085",
"0.65551823",
"0.6547425",
"0.6540004",
"0.6537563",
"0.6537563",
"0.6531641",
"0.65304065",
"0.65212435",
"0.6519244",
"0.65158534",
"0.65158534",
"0.65104973",
"0.65103763",
"0.65066195",
"0.6504083",
"0.6501997",
"0.6485995",
"0.6484904",
"0.64838874",
"0.6480499",
"0.6480154",
"0.6479368"
] | 0.0 | -1 |
return 'TEST ' .$this>funFact; | public function getFunFact() {
return $this->funFact;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function falar(){\n\t\treturn \"Som\";\n\t}",
"function testFuncton($first, $second) {\n //echo \"hello\". $first . $second;\n return $first;\n}",
"function toTest($test){\n\treturn \"el test es \".$test;\n}",
"public function practice1()\n {\n return (\"practice 1\");\n }",
"function test17() {\n return '1';\n}",
"function testf1($aa)\n{\n return \"ee\";\n}",
"public function f01()\n {\n }",
"function well()\n{\n return \"foxphp\";\n}",
"function test19() {\n return '1';\n}",
"public function getFunction(): string;",
"public function f02()\n {\n }",
"function test18() {\n return '1';\n}",
"public function getTest()\n {\n return 55;\n }",
"function Hola(){\n return 'Hola Darwin'; \n}",
"public function __toString()\n\t{\n\t\treturn \"This is the function that is called when you try to use print or echo or a variable that holds an instance of this class.\";\n\t}",
"function test () {}",
"protected function func() { return $this->f; }",
"private function getFuction() {\n return $this->_function;\n }",
"public function displayTest( ) {\n }",
"public function test()\n {\n return $this->test1();\n }",
"public static function test()\n\t{\n\t\treturn \"Hello World from \".get_class();\n\t}",
"public function usefulFunctionB(): string\n {\n return \"The result of the product B2.\";\n }",
"public static function testReturn(): string\n {\n return 'im a test';\n }",
"function &refPrac(string $status): string {\n global $n;\n $cep = \"[ bar_$status ]\";\n echo \"$n refPrac() cep = $cep $n\";\n return $cep;\n}",
"public function aaa() {\n\t}",
"function test()\n {\n }",
"public function __toString()\n {\n return $this->run( );\n }",
"function test28() {\n $profile = 'x';\n return $profile;\n}",
"function fromexp(){return \"`{$this->entity->name}`\"; }",
"function test_func1($arg1, $arg2)\n{\n return sprintf(\"this is test_func1: arg1=%s, arg2=%s\", (string)$arg1, (string)$arg2);\n}",
"function test29() {\n $profile = 'x';\n return $profile;\n}",
"public function f()\n {\n }",
"function toString(){\r\n\r\n\t}",
"public function method1()\n {\n $str = $this->attribut;\n $str .= 'Je suis la class maman';\n return $str;\n }",
"function test26($var) {\n return '';\n}",
"public function message()\n {\n return \"Funcion: {$this->name}<br/>{$this->message}\";\n }",
"function stringMethod()\n {\n// return 1;\n }",
"function test_helper(){\n return \"OK\";\n}",
"public function method1()\n {\n $str = $this->attribut;\n $str .= 'Je suis la class maman 2';\n return $str;\n }",
"function test11() {\n\n}",
"public function __toString()\n\t{\n\t\treturn sprintf(\n\t\t\t\"%sFunction [ <user> function %s%s ] {\\n @@ %s %d - %d\\n}\\n\",\n\t\t\t$this->getDocComment() ? $this->getDocComment() . \"\\n\" : '',\n\t\t\t$this->returnsReference() ? '&' : '',\n\t\t\t$this->getName(),\n\t\t\t$this->getFileName(),\n\t\t\t$this->getStartLine(),\n\t\t\t$this->getEndLine()\n\t\t);\n\t}",
"public function __invoke()\n {\n return ('Nim :1931710175 Nama : Umbu Michael Fernando Andumanang');\n }",
"function demo()\r\n{\r\n myecho(mystrlen(\"Hello PHP\"));\r\n echo MYCONST;\r\n echo MYCONST2;\r\n echo (new SampleClass)->foo();\r\n}",
"public function randomFunc() {\n return \"RANDOM\";\n }",
"public function getF() {}",
"abstract protected function mini(): string;",
"function eat()\r\n {\r\n echo \"$this->_name is eating <br>\";\r\n }",
"public function __toString() {\n return (string)$this->run();\n }",
"function t ()\n{\n echo TPL;\n}",
"function test1() {\n\n}",
"function test()\n{\n var_dump($nom);\n}",
"function test2() {\n\n}",
"abstract protected function displayString(): string;",
"public function name()\n\t{\n\t\treturn $this->something;\n\t}",
"function __construct()\n {\n //echo self::class;\n echo $this->test;\n }",
"function test()\n {\n echo \"The fuction name is: \".__FUNCTION__.\"<br><br>\";\n }",
"public function f() {}",
"public function hello() \n {\n return sprintf(\"Hello %s %s\", $this->name, $this->surname);\n }",
"public function display(){\n return $this->string;\n }",
"public function foo() {\n echo \"FOO\";\n }",
"function test15(Test $foo) {\n\n}",
"function toString() {\n\t}",
"final public function moreTesting() {\n echo \"BaseClass::moreTesting() called\\n\";\n }",
"final public function moreTesting() {\n echo \"BaseClass::moreTesting() called\\n\";\n }",
"public function man(): string;",
"protected function codeToModify()\n {\n return '\n if (is_callable(array($this->metaclass, func_get_arg(0)))) {\n try {\n return call_user_func_array(array($this->metaclass, ' .\n 'func_get_arg(0)), func_get_arg(1));\n } catch (BadMethodCallException $e) {\n %s\n }\n }\n ';\n }",
"public function getFunction ()\n\t{\n\t\treturn $this->_strFunction;\n\t}",
"public function someStuff()\n {\n \n }",
"function test7() {\n}",
"public function __string()\n {\n return $this->_result;\n }",
"public function test() {\n\n\t}",
"public function aa()\n {\n }",
"function myExample()\n{\n return 'Good practice';\n}",
"public function helper()\n\t{\n\t\n\t}",
"abstract protected function getFunctionName(): string;",
"public function getFunctionName()\n {\n return 'SUBSTRING';\n }",
"static function str_name () {\n echo \"This is a static methoc message\";\n }",
"public function getFate()\n {\n return \"spock\";\n }",
"public function toString()\n {\n $func = 'build'.ucfirst(strtolower($this->operation));\n return $this->$func();\n }",
"function abc(){\n return __FUNCTION__;\n}",
"public static function getPubFuncRScode(){\n\n $resultString = \"\";\n $resultString.='public static function functionName(){'.\"\\n\";\n $resultString.=' '.\"\\n\";\n $resultString.=' $resultString = \"\";'.\"\\n\";\n $resultString.=' '.\"\\n\";\n $resultString.=' return $resultString;'.\"\\n\";\n $resultString.='}'.\"\\n\";\n\n return $resultString;\n }",
"function test3() {\n\n}",
"public function callableMethod()\n {\n return 'value';\n }",
"function this(): TestCase\n{\n return TestSuite::getInstance()->test;\n}",
"public function show(){\n return 'hola desde la funcion show';\n }",
"function test ( $str1, $str2, $str3, $num1, $num2 )\n {\n $mystring = $str1.\" \".$str2.\" \".$str3;\n echo \"\\t\\t\\t\".$mystring.\"<br />\"; \n return $num1 * $num2; \n }",
"function test4() {\n\n}",
"function test(){\n echo 'sadasdasd';\n}",
"protected function test9() {\n\n }",
"abstract public function test();",
"abstract public function test();",
"public function some()\n {\n }",
"function fun($var)\n{\n\techo \"$var\\n\";\n\treturn $var;\n}",
"function buildOne($x)\n{\n return \"$x 1\";\n}",
"public function gett()\n {\n return \"hello from gett\";\n }",
"function fun1()\n {\n }",
"function funct($number1,$number2,$bool=true,$msg=\"\"){\n\n $result = $number1 + $number2;\n if($bool == false){\n $result = $number1 - $number2;\n }\n\n if($msg == 'showMessage'){\n $result = 'Hi, the output is : '.$result;\n\n }\n echo $result;\n}",
"public function teste()\n {\n\n }",
"public function __toString() {\n\t\treturn self::$before . $this->render() . self::$after;\n\t}",
"public function test();"
] | [
"0.6520039",
"0.6432595",
"0.61747",
"0.6139426",
"0.61113447",
"0.60968274",
"0.6034351",
"0.6015974",
"0.59304404",
"0.59204006",
"0.5918777",
"0.5899894",
"0.5854913",
"0.5779444",
"0.5774063",
"0.57363987",
"0.5731219",
"0.56985104",
"0.5698343",
"0.56927764",
"0.56895316",
"0.56788677",
"0.5664183",
"0.5650725",
"0.5645141",
"0.56318295",
"0.56201744",
"0.5593571",
"0.5592244",
"0.55858696",
"0.5584039",
"0.5575046",
"0.55679893",
"0.55572313",
"0.55409485",
"0.5521901",
"0.55207616",
"0.5517979",
"0.5517434",
"0.5511894",
"0.5495172",
"0.54766923",
"0.5467395",
"0.545832",
"0.5455484",
"0.5424354",
"0.5420157",
"0.5403649",
"0.5400376",
"0.5381533",
"0.53723544",
"0.5363081",
"0.53610396",
"0.53396505",
"0.5337806",
"0.5337338",
"0.5334513",
"0.5320403",
"0.53195626",
"0.53173923",
"0.53151363",
"0.53098184",
"0.5306165",
"0.5306165",
"0.53056914",
"0.5304437",
"0.5304014",
"0.53015995",
"0.5300364",
"0.5294743",
"0.5289948",
"0.528937",
"0.5285289",
"0.52800924",
"0.5275803",
"0.5268778",
"0.52620804",
"0.5261691",
"0.5261549",
"0.52536863",
"0.5244276",
"0.52424586",
"0.52350134",
"0.5232953",
"0.52322656",
"0.52245855",
"0.5224291",
"0.5216204",
"0.52082545",
"0.5200341",
"0.5200341",
"0.5199081",
"0.5191353",
"0.5186011",
"0.5185903",
"0.51859",
"0.5182853",
"0.5182222",
"0.5181954",
"0.5181111"
] | 0.5783324 | 13 |
The groups that this asset is managed by them | public function groups()
{
return $this->belongsToMany(Group::class, 'assets_groups_pivot');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGroups() {}",
"public function getGroups()\n {\n return $this->groups;\n }",
"public function getGroups() {\n return $this->groups;\n }",
"public function getGroups()\n\t{\n\t\treturn $this->groups;\n\t}",
"public function groups() : array\n {\n return $this->groups;\n }",
"public function groups() : array\n {\n return $this->groups;\n }",
"public function getGroups();",
"public function getGroups();",
"public function getGroups() {\n return parent::getGroups();\n }",
"public function getGroups(): array;",
"public static function getGroups(): array\n {\n return [\"group2\"];\n }",
"public function getGroups() {\n\t\treturn $this->util->getDirectoriesInDirectory($this->cacheDir);\n\t}",
"public function groups();",
"public function groups();",
"public function groups()\n {\n return $this->groupModel\n ->orderBy('name', 'asc')\n ->findAll();\n }",
"public function getGroups()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getGroups() : array();\r\n }",
"function getGroups() {\n $groups = $this->groups;\n if (is_string($groups)) {\n $groups = explode(',', $groups);\n }\n return $groups;\n }",
"public function groups()\n {\n return $this->morphToMany('App\\Group', 'groupOwnable', 'HoldMyBeer_GroupOwnable', 'groupOwnableId', 'groupId');\n }",
"public function getGroupsList(){\n return $this->_get(1);\n }",
"public function getGroupsList(){\n return $this->_get(3);\n }",
"public function getGroups() {\n return $this->getGuardUser() ? $this->getGuardUser()->getGroups() : array();\n }",
"public function groups()\n {\n $return = ['everyone'];\n\n $groups = GroupMember::where('user_id', $this->id())\n ->sort('`group` ASC')\n ->all();\n\n foreach ($groups as $group) {\n $return[] = $group->group;\n }\n\n return $return;\n }",
"public function getGroupsList(){\n return $this->_get(4);\n }",
"public function getGroupsList(){\n return $this->_get(4);\n }",
"public function getAllGroups();",
"public function groups()\n {\n return $this->morphToMany(Group::class, 'group_able');\n }",
"public function groups()\n {\n $response = $this->request->post($this->requestUrl('get_groups'), $this->params);\n\n return $response->groups;\n }",
"public function groups() {\n\t\tif (empty($this->_compiledGroupNames)) {\n\t\t\tforeach ($this->settings['groups'] as $group) {\n\t\t\t\t$this->_compiledGroupNames[] = $this->settings['prefix'] . $group;\n\t\t\t}\n\t\t}\n\n\t\t$groups = $this->_Memcached->getMulti($this->_compiledGroupNames);\n\t\tif (count($groups) !== count($this->settings['groups'])) {\n\t\t\tforeach ($this->_compiledGroupNames as $group) {\n\t\t\t\tif (!isset($groups[$group])) {\n\t\t\t\t\t$this->_Memcached->set($group, 1, 0);\n\t\t\t\t\t$groups[$group] = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tksort($groups);\n\t\t}\n\n\t\t$result = array();\n\t\t$groups = array_values($groups);\n\t\tforeach ($this->settings['groups'] as $i => $group) {\n\t\t\t$result[] = $group . $groups[$i];\n\t\t}\n\n\t\treturn $result;\n\t}",
"protected function getGroups()\n\t{\n\t\tif (isset($this->element['groups']))\n\t\t{\n\t\t\treturn explode(',', $this->element['groups']);\n\t\t}\n\n\t\treturn;\n\t}",
"public function groups()\n {\n return $this->morphedByMany(Group::class, 'device_tokenable')->withTimestamps();\n }",
"public function getEavGroup() {\n return $this->objectManager->get ( 'Magento\\Eav\\Model\\Entity\\Attribute\\Group' )->getCollection ();\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 getAllGroups() {\n\t\t$groups = $this->group->getAll();\n\t\treturn $groups;\n\t}",
"public function findGroups() {\n\t\t\n\t}",
"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 static function getGroups(): array\r\n {\r\n return [\r\n 'dev',\r\n 'pre',\r\n ];\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 static function getGroups(): array\r\n {\r\n // TODO: Implement getGroups() method.\r\n return [\r\n 'test',\r\n 'dev',\r\n ];\r\n }",
"public static function getAllGroups()\n {\n return ValveGroup::all();\n }",
"public function getAccessGroups()\n\t{\n\t\t//create QueryBuilder\n\t\t$queryBuilder = $this->entityManager->createQueryBuilder();\n\n\t\t//create query\n\t\t$queryBuilder->select(\"g\");\n\t\t$queryBuilder->from(\"yourCMDB:CmdbAccessGroup\", \"g\");\n\n\t\t//get results\n\t\t$query = $queryBuilder->getQuery();\n\t\t$groups = $query->getResult();\n\n\t\t//return\n\t\treturn $groups;\n\t}",
"public function groupIds(): array {\n return $this->groupList ?? [];\n }",
"public function getAuthorizables()\n {\n return $this->groups;\n }",
"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 get_groups()\n\t{\n\t\tif (empty($this->user))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn array(array('UniGroup', $this->user[static::_column('group')]));\n\t}",
"public static function getGroups(): array\n {\n return ['user'];\n }",
"public function listGroups()\n {\n $groups = [];\n \n foreach ($this as $property)\n {\n if ( (null !== $property->getGroup())\n && (!(in_array($property->getGroup(), $groups))) )\n {\n $groups[] = $property->getGroup();\n }\n }\n \n return $groups;\n }",
"public function getAclGroups()\n {\n $aclGroupsConfig = include(__DIR__ . '/Acl/AclGroupsConfig.php');\n return $aclGroupsConfig;\n }",
"public function retrieveGroups()\n {\n return $this->start()->uri(\"/api/group\")\n ->get()\n ->go();\n }",
"public function getGroups() {\n\t\treturn array(\n\t\t\t'user_meta' => array(\n\t\t\t\t'type' => 'error',\n\t\t\t\t'message' => 'Usage of users/usermeta tables is highly discouraged in VIP context, For storing user additional user metadata, you should look at User Attributes.',\n\t\t\t\t'object_vars' => array(\n\t\t\t\t\t'$wpdb->users',\n\t\t\t\t\t'$wpdb->usermeta',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'cache_constraints' => array(\n\t\t\t\t'type' => 'warning',\n\t\t\t\t'message' => 'Due to using Batcache, server side based client related logic will not work, use JS instead.',\n\t\t\t\t'variables' => array(\n\t\t\t\t\t'$_COOKIE',\n\t\t\t\t\t),\n\t\t\t\t'array_members' => array(\n\t\t\t\t\t'$_SERVER[\\'HTTP_USER_AGENT\\']',\n\t\t\t\t\t'$_SERVER[\\'REMOTE_ADDR\\']',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}",
"protected function getGroups()\n\t{\n\t\t$groups = array();\n\n\t\t$groups[''] = array();\n\t\t$groups[''][] = JHtml::_('select.option', $this->value, $this->value, 'value', 'text');\n\n\t\t$this->addGroup($groups, 'User', \t\t$this->getUserFields());\n\t\t$this->addGroup($groups, 'Order', \t\t$this->getOrderFields());\n\t\t$this->addGroup($groups, 'Shipping', \t$this->getAddressFields('shipping'));\n\t\t$this->addGroup($groups, 'Billing',\t$this->getAddressFields('billing'));\n\t\t$this->addGroup($groups, 'Item',\t\t$this->getItemFields());\n\n\t\treset($groups);\n\n\t\treturn $groups;\n\t}",
"public function groups()\n {\n return $this->hasMany(get_class(new KpiGroup()));\n }",
"function getGroups()\n {\n//\t\t$this->_groups = array();\n if ( empty( $this->_groups ) ) {\n $member_handler = &zarilia_gethandler( 'member' );\n if ( $this->getVar( 'uid' ) ) {\n $this->_groups = $member_handler->getGroupsByUser( $this->getVar( 'uid' ) );\t\t\t\t\n } else {\n $this->_groups = array( 0 => ZAR_GROUP_ANONYMOUS );\n }\n }\t\t\n return $this->_groups;\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 getRawGroups()\n {\n if (!empty($this->rawGroups)) {\n return $this->rawGroups;\n }\n if ($this->enableCache && isset($this->cache)) {\n if (($data = $this->cache->get(static::className())) !== false) {\n list($rawGroups, $aliases) = $data;\n Alias::setAliases($this->prepareAliases($aliases), false);\n $rawGroups = $this->calculateCacheGroups($rawGroups, $this->groups);\n return $this->rawGroups = $rawGroups;\n }\n }\n list($rawGroups, $aliases) = $this->normalizeGroups($this->groups);\n if ($this->enableCache && isset($this->cache)) {\n $this->cache->set(static::className(), [$this->normalizeCacheGroups($rawGroups), $aliases]);\n }\n return $this->rawGroups = $rawGroups;\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 }",
"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\t{\n\t\treturn $this->belongsToMany('Group');\n\t}",
"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 getDashboardGroups(): array;",
"protected function getGroups()\n {\n $groups = parent::getGroups();\n\n // If an ID is already selected, we don't want the auto-generate option:\n if (!empty($this->value)) {\n unset($groups[0][1]);\n }\n\n return $groups;\n }",
"public function getAuthorizationGroups(): array;",
"public function groups()\n {\n return $this->hasMany(static::class, 'parent_id');\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 groupList(){\n\t\techo json_encode($this->read_database->get_groups());\n\t}",
"public function getAttributeGroupsProperty()\n {\n return AttributeGroup::whereAttributableType($this->typeClass)\n ->orderBy('position')->get();\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 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 getSubGroups() {}",
"private function getGroupsIds() : array {\n\t\treturn array_map(static function($a) {\n\t\t\treturn $a->getId();\n\t\t}, $this->groups);\n\t}",
"protected function getGroups() {\n return DB::table('translation_identifiers')->select('group')->groupBy(['group'])->get()->pluck('group');\n }",
"public function groups()\n {\n return $this->hasMany('App\\ERP\\SItemGroup');\n }",
"static function getUserGroups(){\n \n }",
"public function groups()\n {\n return $this->hasMany(Group::class);\n }",
"public function getGroups() {\r\n // Array to hold the group objects\r\n $groups = [];\r\n // Loop through each of the groups the user belongs to\r\n foreach ($this->groups as $group) {\r\n // Get the group from the database\r\n $grp = UserGroup::getByName($group);\r\n // If the group has a valid ID (not 0 or less)\r\n if ($grp->id != 0) {\r\n // Add the group to the array\r\n $groups[] = $grp;\r\n }\r\n }\r\n // Return the groups array\r\n return $groups;\r\n }",
"public static function getGroups(): array\n {\n return ['test'];\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 groups()\n {\n return $this->belongsToMany(Group::class);\n }",
"public function getGroupSequence()\n {\n $groups = [self::class];\n\n if ($this->request === null) {\n $groups = ['Strict'];\n }\n\n return $groups;\n }",
"public function findServiceGroups(): array;",
"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 {\n if ($this->_oGroups == null && $sOxid = $this->getId()) {\n // usergroups\n $this->_oGroups = oxNew('oxlist', 'oxgroups');\n $sViewName = getViewName(\"oxgroups\", $this->getLanguage());\n $sSelect = \"select {$sViewName}.* from {$sViewName}, oxobject2group \";\n $sSelect .= \"where oxobject2group.oxobjectid='$sOxid' \";\n $sSelect .= \"and oxobject2group.oxgroupsid={$sViewName}.oxid \";\n $this->_oGroups->selectString($sSelect);\n }\n\n return $this->_oGroups;\n }",
"public function getGroups()\n {\n if (is_null($this->groups)) {\n /** @psalm-var ?list<mixed> $data */\n $data = $this->raw(self::FIELD_GROUPS);\n if (is_null($data)) {\n return null;\n }\n $this->groups = $data;\n }\n\n return $this->groups;\n }",
"public function groups()\n {\n return $this->hasMany('Group');\n }",
"public function listAllGroups(): array\n {\n // call data service method to get groups\n $raw = AdminGroupsDataAccessService::read();\n\n // convert to array : GroupModel\n $groups = array();\n $i = 0;\n foreach ($raw as $row) {\n $groups[$i++] = new GroupModel($row[\"ID\"], $row[\"TITLE\"], $row[\"DESCRIPTION\"], $row[\"SUMMARY\"]);\n }\n\n // return array of GroupModel\n return $groups;\n }",
"public function get_recursive_groups()\n {\n return $this->_recursive_groups;\n }",
"public function getApplicableGroups()\n {\n if( isset( $this->getProperty()->applicableGroups ) )\n return $this->getProperty()->applicableGroups;\n return NULL;\n }",
"public function getApplicableGroups()\n {\n if( isset( $this->getProperty()->applicableGroups ) )\n return $this->getProperty()->applicableGroups;\n return NULL;\n }",
"public function getGroupsParrain()\n {\n $sql = 'SELECT `id_group`, `name`, `id_employee` FROM `' . _DB_PREFIX_ . 'group_lang` WHERE `id_lang` = \"'\n . (int)$this->lang . '\"';\n $groups = Db::getInstance()->executeS($sql);\n\n return $groups;\n }",
"public function getGrouped()\n {\n if ( ! $this->prepared) {\n $this->prepareForPresentation();\n }\n\n return $this->permissionGroups;\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 getGroupsAttribute(){\n // ------------------------------------------------------------------\n $groups = array();\n $types = config('const.COMPANY_TYPES');\n // ------------------------------------------------------------------\n\n // ------------------------------------------------------------------\n // Get company types\n // ------------------------------------------------------------------\n if( !empty( $types )) foreach( $types as $name => $type ){\n if( !empty( $this->{ $type })) $groups[] = __( 'label.$company.type.'. $name );\n }\n // ------------------------------------------------------------------\n return join( ', ', $groups );\n // ------------------------------------------------------------------\n }",
"public function groups()\n {\n return $this->belongsToMany(Models\\AccountGroup::class, 'account_group_members', 'account_id', 'account_group_id');\n }",
"public function getGrupos()\n {\n return $this->grupos;\n }",
"public function getWalletGroups()\n {\n return $this->wallet_groups;\n }",
"public function groups() {\n return $this->hasMany(Group::class, 'category_id');\n }",
"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}",
"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 admin_groups() {\n\t\treturn array_keys(array_filter(static::config()->get('admin_groups')));\n\t}",
"public function getContentTypeGroups()\n {\n return $this->innerContentType->getContentTypeGroups();\n }",
"public function getAssignedGroups()\n {\n $_currentProduct = $this->getProduct();\n $_customerGroups = $_currentProduct->getCustomergroup();\n if($_customerGroups) {\n return implode(',' , $_customerGroups);\n } else {\n return false;\n }\n }"
] | [
"0.7643579",
"0.7637912",
"0.76123106",
"0.7574931",
"0.7522991",
"0.7522991",
"0.7456879",
"0.7456879",
"0.7345563",
"0.72911775",
"0.71905684",
"0.7136076",
"0.70896757",
"0.70896757",
"0.7036027",
"0.69648576",
"0.6962816",
"0.6922775",
"0.6911166",
"0.6909512",
"0.68979204",
"0.6894043",
"0.68924284",
"0.68924284",
"0.68636835",
"0.6859405",
"0.68504685",
"0.68084246",
"0.67930216",
"0.6774838",
"0.67718875",
"0.6753517",
"0.6752561",
"0.67304015",
"0.66881853",
"0.6676008",
"0.6658864",
"0.6656773",
"0.66382164",
"0.6628904",
"0.66239834",
"0.6602679",
"0.6584995",
"0.65814817",
"0.65737396",
"0.6528141",
"0.6524402",
"0.65205383",
"0.6507054",
"0.6506848",
"0.65039235",
"0.6497443",
"0.6466578",
"0.6465062",
"0.64638376",
"0.6451582",
"0.64488846",
"0.64443105",
"0.6441203",
"0.6439767",
"0.6437955",
"0.6433841",
"0.6423036",
"0.6415812",
"0.6414242",
"0.6409184",
"0.6396069",
"0.6392876",
"0.63904846",
"0.63885176",
"0.63732105",
"0.6368423",
"0.6365151",
"0.63590235",
"0.6357846",
"0.63552713",
"0.63476247",
"0.633496",
"0.632893",
"0.63134456",
"0.6309561",
"0.63001096",
"0.6294412",
"0.62929344",
"0.62842846",
"0.6279571",
"0.6279571",
"0.6278726",
"0.6278716",
"0.6266916",
"0.6261372",
"0.6260295",
"0.6254646",
"0.62490755",
"0.6246619",
"0.62455827",
"0.62428665",
"0.6233823",
"0.6233612",
"0.62328804"
] | 0.6942336 | 17 |
Create a new controller instance. | public function __construct()
{
$this->middleware('auth');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createController()\n {\n $this->createClass('controller');\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }",
"private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }",
"protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }",
"public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }",
"public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}",
"public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}",
"public function createController( ezcMvcRequest $request );",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }",
"public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}",
"private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }",
"public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}",
"public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}",
"private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }",
"public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }",
"public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se creó correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}",
"private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}",
"public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}",
"public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }",
"protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }",
"private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }",
"public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }",
"protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}",
"public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}",
"private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}",
"public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }",
"protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }",
"public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }",
"protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }",
"protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }",
"protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}",
"public function makeTestController(TestController $controller)\r\n\t{\r\n\t}",
"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 }",
"public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }",
"public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}",
"public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}",
"public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}",
"public function getController( );",
"public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }",
"static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }",
"public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }",
"private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }",
"function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }",
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }",
"protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }",
"public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }",
"protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }",
"public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }",
"public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }",
"public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }",
"protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }",
"private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }",
"public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}",
"public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }",
"public function controller()\n\t{\n\t\n\t}",
"protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }",
"function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}",
"protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }",
"public function __construct()\n {\n $this->controller = new DHTController();\n }",
"public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}",
"protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }",
"private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }",
"public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}",
"public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }",
"public static function createController( MShop_Context_Item_Interface $context, $name = null );",
"public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }",
"public function getController();",
"public function getController();",
"public function getController();",
"public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }",
"private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }",
"public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }",
"public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }",
"private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }",
"static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }",
"private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }",
"public function AController() {\r\n\t}",
"protected function initializeController() {}",
"public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }",
"public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }",
"private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }",
"function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }",
"public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}",
"public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }",
"private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}",
"public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }",
"protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }",
"public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }",
"public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}",
"protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }",
"public function create() {}",
"public function __construct()\n {\n $this->dataController = new DataController;\n }",
"function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}",
"public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }",
"private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }",
"public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }"
] | [
"0.82668066",
"0.8173394",
"0.78115296",
"0.77052677",
"0.7681875",
"0.7659338",
"0.74860525",
"0.74064577",
"0.7297601",
"0.7252339",
"0.7195181",
"0.7174191",
"0.70150065",
"0.6989306",
"0.69835985",
"0.69732994",
"0.6963521",
"0.6935819",
"0.68973273",
"0.68920785",
"0.6877748",
"0.68702674",
"0.68622285",
"0.6839049",
"0.6779292",
"0.6703522",
"0.66688496",
"0.66600126",
"0.6650373",
"0.66436416",
"0.6615505",
"0.66144013",
"0.6588728",
"0.64483404",
"0.64439476",
"0.6429303",
"0.6426485",
"0.6303757",
"0.6298291",
"0.6293319",
"0.62811387",
"0.6258778",
"0.62542456",
"0.616827",
"0.6162314",
"0.61610043",
"0.6139887",
"0.613725",
"0.61334985",
"0.6132223",
"0.6128982",
"0.61092585",
"0.6094611",
"0.60889256",
"0.6074893",
"0.60660255",
"0.6059098",
"0.60565156",
"0.6044235",
"0.60288006",
"0.6024102",
"0.60225666",
"0.6018304",
"0.60134345",
"0.60124683",
"0.6010913",
"0.6009284",
"0.6001683",
"0.5997471",
"0.5997012",
"0.59942573",
"0.5985074",
"0.5985074",
"0.5985074",
"0.5967613",
"0.5952533",
"0.5949068",
"0.5942203",
"0.5925731",
"0.5914304",
"0.5914013",
"0.59119135",
"0.5910308",
"0.5910285",
"0.59013796",
"0.59003943",
"0.5897524",
"0.58964556",
"0.58952993",
"0.58918965",
"0.5888943",
"0.5875413",
"0.5869938",
"0.58627135",
"0.58594996",
"0.5853714",
"0.5839484",
"0.5832913",
"0.582425",
"0.58161044",
"0.5815566"
] | 0.0 | -1 |
Show the application dashboard. | public function index(Request $request)
{
$notification = Notification::latest()->where('is_read', '0')->first();
$settings = Admin::first();
$amount = Transaction::where('status', 'COMPLETED')->where('user_id', Auth::user()->id)->sum('coins');
$referral_settings = DB::table('referral_settings')->first();
$referer_earning_amount= ReferralsModel::where('status', 'COMPLETED')->where('referrer', Auth::user()->id)->sum('referer_earning_amount');
$today_date=date('Y-m-d');
$date=DB::select(DB::raw('SELECT * FROM progress_bar WHERE progress_bar_date <= "'.$today_date.'" and coin_price IS NOT NULL and is_completed = 0'));
$check_notify=DB::select(DB::raw('SELECT * FROM progress_bar WHERE progress_bar_date >= "'.$today_date.'" and coin_price IS NOT NULL and is_completed = 0'));
if(count($check_notify)>0){
$date_minus=$check_notify[0]->notify_before;
$start_date= $check_notify[0]->progress_bar_date;
$alert_date_str=mktime(0,0,0,date('m',strtotime($start_date)),date('d',strtotime($start_date))-$date_minus,date('Y',strtotime($start_date)));
$alert_date= date('Y-m-d',$alert_date_str);
$minus_date=strtotime($start_date)-strtotime($today_date);
$diff=date_diff(date_create($start_date),date_create($today_date));
$date_diff=$diff->format("%R%a Days");
$notify=$request->session()->get('show_notify');
// print_r($start_date);
// echo "<br>";
// print_r($alert_date);exit;
if($notify==""){
$request->session()->forget('notify_message');
$request->session()->forget('upcomming_coin_price');
$request->session()->forget('upcomming_date');
if((strtotime($alert_date)<strtotime($start_date) || strtotime($alert_date)>=strtotime($today_date )) && strtotime($start_date)!=strtotime($today_date)){
$request->session()->put('notify_message','The price will increases in '.abs($date_diff).' Days
');
$request->session()->put('upcomming_coin_price',$check_notify[0]->coin_price);
$request->session()->put('upcomming_date',$check_notify[0]->progress_bar_date);
}elseif (strtotime($start_date)==strtotime($today_date)) {
$request->session()->put('notify_message','Price has increase today!.');
$request->session()->put('upcomming_coin_price',$check_notify[0]->coin_price);
$request->session()->put('upcomming_date',$check_notify[0]->progress_bar_date);
}
}
}
if(count($date)>0){
$settings->coin_value= $date[0]->coin_price;
}else{
$settings->coin_value=$settings->default_token_price;// default price..
}
$settings->save();
$stripe=DB::table('settings')->where('param','stripe_pk_key')->first();
$stripe_key=$stripe->value;;
$semi=0;
$automatic=0;
$types=explode(',',$settings->payments_types);
if(isset($types[0])){
if($types[0]==1){
$semi=1;
}elseif ($types[0]==2) {
$automatic=1;
}
}
if(isset($types[1])){
if($types[1]==2){
$automatic=1;
}elseif ($types[1]==1) {
$semi=1;
}
}
$join_data=DB::table('survey_list')
->leftjoin('survey_notify','survey_notify.survey_id','survey_list.id')->where('survey_list.status','live')->
select('survey_notify.status as Stat')->get();
$count=0;
foreach ($join_data as $key => $value) {
if($value->Stat==""){
$count +=1;
}
}
$request->session()->put('survey_notify_count',$count);
$AdminBankDetails = AdminBankDetails::where('default_flag','1')
->join('bank_code_master','bank_code_master.id','=','admin_bank_details.bank_code')
->get();
return view('home', compact('notification', 'settings','amount','referer_earning_amount','referral_settings','semi','automatic','stripe_key','AdminBankDetails'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }",
"function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}",
"public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }",
"public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }",
"public function dashboard()\n {\n return view('backend.dashboard.index');\n }",
"public function index() {\n return view(\"admin.dashboard\");\n }",
"public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }",
"public function dashboard(){\n return view('backend.admin.index');\n }",
"public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }",
"public function dashboard()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }",
"public function dashboard() \r\n {\r\n return view('admin.index');\r\n }",
"public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}",
"public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }",
"public function dashboard()\n {\n\n return view('admin.dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('adm.dashboard');\n }",
"public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }",
"public function show()\n {\n return view('dashboard');\n }",
"public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}",
"public function index() {\n return view('modules.home.dashboard');\n }",
"public function show()\n {\n return view('dashboard.dashboard');\n \n }",
"public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }",
"public function dashboard()\n { \n return view('jobposter.dashboard');\n }",
"public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}",
"public function index()\n {\n return view('pages.admin.dashboard');\n }",
"public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }",
"public function index()\n {\n //\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard.index');\n }",
"public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }",
"public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }",
"public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }",
"public function getDashboard() {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('smartcrud.auth.dashboard');\n }",
"public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }",
"public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }",
"public function index()\n {\n return view('board.pages.dashboard-board');\n }",
"public function index()\n {\n return view('admin::settings.development.dashboard');\n }",
"public function index()\n {\n return view('dashboard.dashboard');\n }",
"public function show()\n {\n return view('dashboard::show');\n }",
"public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }",
"public function dashboard()\n {\n return view('Admin.dashboard');\n }",
"public function show()\n {\n return view('admins\\auth\\dashboard');\n }",
"public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }",
"public function index()\n {\n return view('bitaac::account.dashboard');\n }",
"public function index()\n { \n return view('admin-views.dashboard');\n }",
"public function getDashboard()\n {\n return view('dashboard');\n }",
"function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }",
"public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }",
"public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }",
"public function index()\r\n {\r\n return view('user.dashboard');\r\n }",
"public function index() {\n return view('dashboard', []);\n }",
"public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }",
"public function index()\n {\n return view('back-end.dashboard.index');\n //\n }",
"public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}",
"public function index() {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('page.dashboard.index');\n }",
"public function index()\n {\n\n return view('dashboard');\n }",
"public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }",
"public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }",
"public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}",
"public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }",
"public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}",
"public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }",
"public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }",
"public function index()\n {\n return view('/dashboard');\n }",
"public function index()\n {\n \treturn view('dashboard');\n }",
"public function index()\n {\n return view('ketua.ketua-dashboard');\n }",
"public function index(){\n return View::make('admin.authenticated.dashboardview');\n }",
"public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }",
"public function index()\n {\n return view('adminpanel.home');\n }",
"public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}",
"public function index()\n {\n return view('dashboard.home');\n }",
"public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }",
"public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }",
"public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }",
"public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }",
"public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }",
"public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }",
"public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }",
"public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }"
] | [
"0.77850926",
"0.7760142",
"0.7561336",
"0.75147176",
"0.74653697",
"0.7464913",
"0.73652893",
"0.7351646",
"0.7346477",
"0.73420244",
"0.7326711",
"0.7316215",
"0.73072463",
"0.7287626",
"0.72826403",
"0.727347",
"0.727347",
"0.727347",
"0.727347",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7241342",
"0.7236133",
"0.7235562",
"0.7218318",
"0.71989936",
"0.7197427",
"0.71913266",
"0.71790016",
"0.71684825",
"0.71577966",
"0.7146797",
"0.7133428",
"0.7132746",
"0.71298903",
"0.71249074",
"0.71218014",
"0.71170413",
"0.7110151",
"0.7109032",
"0.7107029",
"0.70974076",
"0.708061",
"0.7075653",
"0.70751685",
"0.7064041",
"0.70550334",
"0.7053102",
"0.7051273",
"0.70484304",
"0.7043605",
"0.70393986",
"0.70197886",
"0.70185125",
"0.70139873",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.6992477",
"0.6979631",
"0.69741416",
"0.69741327",
"0.6968815",
"0.6968294",
"0.69677526",
"0.69652885",
"0.69586027",
"0.6944985",
"0.69432825",
"0.69419175",
"0.6941512",
"0.6941439",
"0.6938837",
"0.6937524",
"0.6937456",
"0.6937456",
"0.69276494",
"0.6921651",
"0.69074917",
"0.69020325",
"0.6882262",
"0.6869339",
"0.6867868",
"0.68557185",
"0.68479055",
"0.684518",
"0.68408877",
"0.6838798",
"0.6833479",
"0.6832326",
"0.68309164",
"0.6826798",
"0.6812457"
] | 0.0 | -1 |
Show the application dashboard. | public function expense(Request $request)
{
$d=DB::table('expense'); // define for filter
$from_date=""; $to_date="";
if($request->from_date!=""){
// $Fdate=str_replace("/","-",$request->from_date);
$from_date =Date('Y-m-d',strtotime($request->from_date));
}
if($request->to_date !=""){
// $Tdate=str_replace("/","-",$request->to_date);
$to_date =Date('Y-m-d',strtotime($request->to_date));
}
if($from_date!="" && $to_date!=""){
$d->whereBetween('date',[$from_date,$to_date]);
}
$type=0;
if($request->type!=""){
$d->where('type',$request->type);
$type=$request->type;
}
$category="";
if($request->category!=""){
$d->where('category',$request->category);
$category=$request->category;
}
$month_array=array('1'=>'Jan','2'=>'Feb','3'=>'Mar','4'=>'Apr','5'=>'May','6'=>'Jun','7'=>'Jul','8'=>'Aug','9'=>'Sep','10'=>'Oct','11'=>'Nov','12'=>'Dec');
$incomes=DB::table('expense')
->where('type',1)
->where('customer_name',request()->user()->name)
->select(DB::raw('sum(total_amount) as total_amount'), DB::raw('MONTH(created_at) as month'))
->groupBy('month')
->get()
->keyBy('month');
$expenses=DB::table('expense')
->where('type',2)
->where('customer_name',request()->user()->name)
->select(DB::raw('sum(total_amount) as total_amount'), DB::raw('MONTH(created_at) as month'))
->groupBy('month')
->get()
->keyBy('month');
$incomeexp_percent=DB::table('expense')
->where('customer_name',request()->user()->name)
->select(DB::raw('count(*) as total'), DB::raw('category as category'), DB::raw('MONTH(created_at) as month'))
->groupBy('category','month')
->get();
$total_amount_income=[];
$total_amount_income1=[];
$total_amount_expense=[];
$total_amount_expense1=[];
foreach ($incomes as $key => $income) {
$total_amount_income[$key] = $income->total_amount;
}
foreach ($expenses as $key => $expense) {
$total_amount_expense[$key] = $expense->total_amount;
}
for($i = 1; $i <= 12; $i++)
{
$month[$i]=$month_array[$i];
if(!empty($total_amount_income[$i])){
$total_amount_income1[$i] = $total_amount_income[$i];
}else{
$total_amount_income1[$i] = 0;
}
if(!empty($total_amount_expense[$i])){
$total_amount_expense1[$i] = $total_amount_expense[$i];
}else{
$total_amount_expense1[$i] = 0;
}
}
$sum=[];
foreach($incomeexp_percent as $key=>$percent) {
$sum[$key]=$percent->total;
}
$total_category=array_sum($sum);
$data=$d->orderBy('id','desc')->get();
$autocomplete=Expense::distinct('category')->select('category')->get();
return view('user_expense_report',['data'=>$data,'from_date'=>$from_date,'to_date'=>$to_date,'type'=>$type,'autocomplete'=>$autocomplete,'category'=>$category,'month'=>$month,'total_amount_income1'=>$total_amount_income1,'total_amount_expense1'=>$total_amount_expense1,'incomeexp_percent'=>$incomeexp_percent,'total_category'=>$total_category]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }",
"function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}",
"public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }",
"public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }",
"public function dashboard()\n {\n return view('backend.dashboard.index');\n }",
"public function index() {\n return view(\"admin.dashboard\");\n }",
"public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }",
"public function dashboard(){\n return view('backend.admin.index');\n }",
"public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }",
"public function dashboard()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }",
"public function dashboard() \r\n {\r\n return view('admin.index');\r\n }",
"public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}",
"public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }",
"public function dashboard()\n {\n\n return view('admin.dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('adm.dashboard');\n }",
"public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }",
"public function show()\n {\n return view('dashboard');\n }",
"public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}",
"public function index() {\n return view('modules.home.dashboard');\n }",
"public function show()\n {\n return view('dashboard.dashboard');\n \n }",
"public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }",
"public function dashboard()\n { \n return view('jobposter.dashboard');\n }",
"public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}",
"public function index()\n {\n return view('pages.admin.dashboard');\n }",
"public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }",
"public function index()\n {\n //\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard.index');\n }",
"public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }",
"public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }",
"public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }",
"public function getDashboard() {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('smartcrud.auth.dashboard');\n }",
"public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }",
"public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }",
"public function index()\n {\n return view('board.pages.dashboard-board');\n }",
"public function index()\n {\n return view('admin::settings.development.dashboard');\n }",
"public function index()\n {\n return view('dashboard.dashboard');\n }",
"public function show()\n {\n return view('dashboard::show');\n }",
"public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }",
"public function dashboard()\n {\n return view('Admin.dashboard');\n }",
"public function show()\n {\n return view('admins\\auth\\dashboard');\n }",
"public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }",
"public function index()\n {\n return view('bitaac::account.dashboard');\n }",
"public function index()\n { \n return view('admin-views.dashboard');\n }",
"public function getDashboard()\n {\n return view('dashboard');\n }",
"function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }",
"public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }",
"public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }",
"public function index()\r\n {\r\n return view('user.dashboard');\r\n }",
"public function index() {\n return view('dashboard', []);\n }",
"public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }",
"public function index()\n {\n return view('back-end.dashboard.index');\n //\n }",
"public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}",
"public function index() {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('page.dashboard.index');\n }",
"public function index()\n {\n\n return view('dashboard');\n }",
"public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }",
"public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }",
"public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}",
"public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }",
"public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}",
"public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }",
"public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }",
"public function index()\n {\n return view('/dashboard');\n }",
"public function index()\n {\n \treturn view('dashboard');\n }",
"public function index()\n {\n return view('ketua.ketua-dashboard');\n }",
"public function index(){\n return View::make('admin.authenticated.dashboardview');\n }",
"public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }",
"public function index()\n {\n return view('adminpanel.home');\n }",
"public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}",
"public function index()\n {\n return view('dashboard.home');\n }",
"public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }",
"public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }",
"public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }",
"public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }",
"public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }",
"public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }",
"public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }",
"public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }"
] | [
"0.77850926",
"0.7760142",
"0.7561336",
"0.75147176",
"0.74653697",
"0.7464913",
"0.73652893",
"0.7351646",
"0.7346477",
"0.73420244",
"0.7326711",
"0.7316215",
"0.73072463",
"0.7287626",
"0.72826403",
"0.727347",
"0.727347",
"0.727347",
"0.727347",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7241342",
"0.7236133",
"0.7235562",
"0.7218318",
"0.71989936",
"0.7197427",
"0.71913266",
"0.71790016",
"0.71684825",
"0.71577966",
"0.7146797",
"0.7133428",
"0.7132746",
"0.71298903",
"0.71249074",
"0.71218014",
"0.71170413",
"0.7110151",
"0.7109032",
"0.7107029",
"0.70974076",
"0.708061",
"0.7075653",
"0.70751685",
"0.7064041",
"0.70550334",
"0.7053102",
"0.7051273",
"0.70484304",
"0.7043605",
"0.70393986",
"0.70197886",
"0.70185125",
"0.70139873",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.6992477",
"0.6979631",
"0.69741416",
"0.69741327",
"0.6968815",
"0.6968294",
"0.69677526",
"0.69652885",
"0.69586027",
"0.6944985",
"0.69432825",
"0.69419175",
"0.6941512",
"0.6941439",
"0.6938837",
"0.6937524",
"0.6937456",
"0.6937456",
"0.69276494",
"0.6921651",
"0.69074917",
"0.69020325",
"0.6882262",
"0.6869339",
"0.6867868",
"0.68557185",
"0.68479055",
"0.684518",
"0.68408877",
"0.6838798",
"0.6833479",
"0.6832326",
"0.68309164",
"0.6826798",
"0.6812457"
] | 0.0 | -1 |
Show the application dashboard. | public function account_update()
{
$user = Auth::user();
$input = request()->validate([
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users,email,' . request()->user()->id,
'phone' => 'required|string|max:255|unique:users,phone,' . request()->user()->id,
'password' => 'nullable|string|min:6|confirmed',
'password_old' => 'nullable|string|min:6',
'profile_picture' => 'nullable|image'
]);
// var_dump($input['profile_picture'] );exit;
if(request()->profile_picture) {
$input['profile_picture'] = $this->image_upload(request(),'profile_picture');//request()->profile_picture->store('profile_pictures');
// $input->profile_picture = $picture;
}
if (empty($input['password'])) {
unset($input['password']);
} else {
if (Hash::check(request()->password_old, request()->user()->password)) {
$input['password'] = bcrypt($input['password']);
}
}
request()->user()->update($input);
return back();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }",
"function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}",
"public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }",
"public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }",
"public function dashboard()\n {\n return view('backend.dashboard.index');\n }",
"public function index() {\n return view(\"admin.dashboard\");\n }",
"public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }",
"public function dashboard(){\n return view('backend.admin.index');\n }",
"public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }",
"public function dashboard()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }",
"public function dashboard() \r\n {\r\n return view('admin.index');\r\n }",
"public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}",
"public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }",
"public function dashboard()\n {\n\n return view('admin.dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('adm.dashboard');\n }",
"public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }",
"public function show()\n {\n return view('dashboard');\n }",
"public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}",
"public function index() {\n return view('modules.home.dashboard');\n }",
"public function show()\n {\n return view('dashboard.dashboard');\n \n }",
"public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }",
"public function dashboard()\n { \n return view('jobposter.dashboard');\n }",
"public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}",
"public function index()\n {\n return view('pages.admin.dashboard');\n }",
"public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }",
"public function index()\n {\n //\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard.index');\n }",
"public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }",
"public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }",
"public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }",
"public function getDashboard() {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('smartcrud.auth.dashboard');\n }",
"public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }",
"public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }",
"public function index()\n {\n return view('board.pages.dashboard-board');\n }",
"public function index()\n {\n return view('admin::settings.development.dashboard');\n }",
"public function index()\n {\n return view('dashboard.dashboard');\n }",
"public function show()\n {\n return view('dashboard::show');\n }",
"public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }",
"public function dashboard()\n {\n return view('Admin.dashboard');\n }",
"public function show()\n {\n return view('admins\\auth\\dashboard');\n }",
"public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }",
"public function index()\n {\n return view('bitaac::account.dashboard');\n }",
"public function index()\n { \n return view('admin-views.dashboard');\n }",
"public function getDashboard()\n {\n return view('dashboard');\n }",
"function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }",
"public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }",
"public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }",
"public function index()\r\n {\r\n return view('user.dashboard');\r\n }",
"public function index() {\n return view('dashboard', []);\n }",
"public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }",
"public function index()\n {\n return view('back-end.dashboard.index');\n //\n }",
"public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}",
"public function index() {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('page.dashboard.index');\n }",
"public function index()\n {\n\n return view('dashboard');\n }",
"public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }",
"public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }",
"public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}",
"public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }",
"public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}",
"public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }",
"public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }",
"public function index()\n {\n return view('/dashboard');\n }",
"public function index()\n {\n \treturn view('dashboard');\n }",
"public function index()\n {\n return view('ketua.ketua-dashboard');\n }",
"public function index(){\n return View::make('admin.authenticated.dashboardview');\n }",
"public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }",
"public function index()\n {\n return view('adminpanel.home');\n }",
"public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}",
"public function index()\n {\n return view('dashboard.home');\n }",
"public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }",
"public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }",
"public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }",
"public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }",
"public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }",
"public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }",
"public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }",
"public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }"
] | [
"0.77850926",
"0.7760142",
"0.7561336",
"0.75147176",
"0.74653697",
"0.7464913",
"0.73652893",
"0.7351646",
"0.7346477",
"0.73420244",
"0.7326711",
"0.7316215",
"0.73072463",
"0.7287626",
"0.72826403",
"0.727347",
"0.727347",
"0.727347",
"0.727347",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7241342",
"0.7236133",
"0.7235562",
"0.7218318",
"0.71989936",
"0.7197427",
"0.71913266",
"0.71790016",
"0.71684825",
"0.71577966",
"0.7146797",
"0.7133428",
"0.7132746",
"0.71298903",
"0.71249074",
"0.71218014",
"0.71170413",
"0.7110151",
"0.7109032",
"0.7107029",
"0.70974076",
"0.708061",
"0.7075653",
"0.70751685",
"0.7064041",
"0.70550334",
"0.7053102",
"0.7051273",
"0.70484304",
"0.7043605",
"0.70393986",
"0.70197886",
"0.70185125",
"0.70139873",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.6992477",
"0.6979631",
"0.69741416",
"0.69741327",
"0.6968815",
"0.6968294",
"0.69677526",
"0.69652885",
"0.69586027",
"0.6944985",
"0.69432825",
"0.69419175",
"0.6941512",
"0.6941439",
"0.6938837",
"0.6937524",
"0.6937456",
"0.6937456",
"0.69276494",
"0.6921651",
"0.69074917",
"0.69020325",
"0.6882262",
"0.6869339",
"0.6867868",
"0.68557185",
"0.68479055",
"0.684518",
"0.68408877",
"0.6838798",
"0.6833479",
"0.6832326",
"0.68309164",
"0.6826798",
"0.6812457"
] | 0.0 | -1 |
/ Called when a group is attempting to be deleted Check if there are subgroups and sort out what happens them and content | function au_subgroups_delete_group($hook, $type, $return, $params) {
$guid = get_input('guid');
if (!$guid) {
$guid = get_input('group_guid');
}
$group = get_entity($guid);
if (elgg_instanceof($group, 'group')) {
// determine if the group has any child groups
$child = au_subgroups_get_subgroups($group, 1);
$parent = au_subgroups_get_parent_group($group);
if ($child || $parent) {
// here we are, we're deleting something with subgroups or a parent
// if we've already sorted out what happens to content
// we'll have a special input
$content_policy = get_input('au_subgroups_content_policy', false);
if (!$content_policy) {
forward(elgg_get_site_url() . "groups/subgroups/delete/{$group->guid}");
}
// this is the top level to delete, so if transferring content to parent, it's the parent of this
// apply content policy recursively, then delete all subgroups recursively
// this could take a while...
set_time_limit(0);
$guids = au_subgroups_get_all_children_guids($group);
if (is_array($guids) && count($guids)) {
if ($content_policy != 'delete' && is_array($guids) && count($guids)) {
$options = array(
'container_guids' => $guids,
'au_subgroups_content_policy' => $content_policy,
'au_subgroups_parent_guid' => $parent->guid,
'limit' => 0
);
$batch = new ElggBatch('elgg_get_entities', $options, 'au_subgroups_move_content', 25);
}
// now delete the groups themselves
$options = array(
'guids' => $guids,
'types' => array('group'),
'limit' => 0
);
$batch = new ElggBatch('elgg_get_entities', $options, 'au_subgroups_delete_entities', 25, false);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDeleteGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function _deleteGroup()\n\t{\n\t\t// Get the informations\n\t\t$group = kform::getInput('group');\n\t\tlist($drawId, $groupname) = explode(';', $group);\n\n\t\t// Delete the draws\n\t\t$oGroup = new objgroup();\n\t\t$oGroup->deleteGroup($drawId, $groupname);\n\t\t$page = new utPage('none');\n\t\t$page->close(true, 'draws', DRAW_DISPLAY , $drawId);\n\t\texit();\n\t}",
"public function testDeleteRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"private function deleteGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if( !isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg(\"group id not provided\");\n \n if( !is_numeric($request['group_id']) )\n throw_error_msg(\"invalid group id\");\n\n $id = (int)$request['group_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n global $cbgroup;\n\n $cbgroup->delete_group($id);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group deleted successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function delete() {\n\t\t// Delete passwords and all ssl data of this group\n\t\t$passwordList = $this->getPasswordList();\n\t\t$passwordList->deleteListItems();\n\n\t\t// Delete members from group\n\t\t$memberList = $this->getMemberList();\n\t\t$memberList->deleteListItems();\n\n\t\t// Delete group\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'], 'tx_passwordmgr_group')\n\t\t);\n\t\t$this->checkAffectedRows('deleteGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'deleteGroup', 'Removed group '.$this['uid']);\n\t}",
"function delete_group() {\n $this->acl->validate_update();\n\n $where = array(\n 'user_id' => $this->input->post('user_id'),\n 'group_id' => $this->input->post('group_id')\n );\n list($flag, $msg) = $this->m_general->delete('users_group', $where);\n\n return JSONRES($flag, $msg);\n }",
"public function admin_delete(){\n \n // Load the group in question\n $group = $this->Group->find('first', array('conditions' => array('Group.id' => $this->params->id)));\n if($group){\n // Delete the group\n $delete_attempt = $this->Group->delete($this->params->id);\n if ($delete_attempt){\n $this->Session->setFlash('Group \\''.$group['Group']['name'].'\\' successfully deleted.', 'default', array('class' => 'alert alert-success'));\n CakeLog::write('admin', '[success] Group \\''.$group['Group']['name'].'\\' deleted.');\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n } else {\n $this->Session->setFlash('There was an error deleting the \\''.$group['Group']['name'].'\\' group.', 'default', array('class' => 'alert alert-error'));\n CakeLog::write('admin', '[error] Group \\''.$group['Group']['name'].'\\' could not be deleted.');\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n } else {\n $this->Session->setFlash('That group could not be found.', 'default', array('class' => 'alert alert-error'));\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n }",
"function delGroupHandler() {\n global $inputs;\n\n $sql = \"delete from `group` where id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}",
"public function processGroupBeforeDelete($event)\n {\n $group_id = isset($event->data['aGroup']['Group']['id']) ? $event->data['aGroup']['Group']['id'] : '';\n if (!empty($group_id)) {\n $activityModel = MooCore::getInstance()->getModel('Activity');\n $this->Photo = ClassRegistry::init('Photo.Photo');\n $photos = $this->Photo->getPhotos('Group_Group', $group_id, null, null);\n foreach ($photos as $p) {\n $this->Photo->delete($p['Photo']['id']);\n\n // delete activity comment_add_photo\n $activityModel->deleteAll(array('Activity.item_type' => 'Photo_Photo', 'Activity.action' => 'comment_add_photo', 'Activity.item_id' => $p['Photo']['id']));\n\n // delete activity photos_tag\n $activityModel->deleteAll(array('Activity.item_type' => 'Photo_Photo', 'Activity.action' => 'photos_tag', 'Activity.items' => $p['Photo']['id']));\n }\n }\n }",
"function delete() {\n\t\t$sql = \"DELETE FROM umgroup\n\t\t\t\tWHERE GpID=?\";\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpID));\n\n\t}",
"public function deleteGroup() {\n $errors = $this->checkIsValidForDelete();\n if($errors === false){\n $sql = \"DELETE FROM `SM_GROUP` WHERE sm_idGroup ='$this->idGroup'\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n return true;\n }\n }else{\n return $errors;\n }\n }",
"function groups_delete_group($grouporid) {\n global $CFG;\n require_once($CFG->libdir.'/gdlib.php');\n\n if (is_object($grouporid)) {\n $groupid = $grouporid->id;\n $group = $grouporid;\n } else {\n $groupid = $grouporid;\n if (!$group = get_record('groups', 'id', $groupid)) {\n return false;\n }\n }\n\n // delete group calendar events\n delete_records('event', 'groupid', $groupid);\n //first delete usage in groupings_groups\n delete_records('groupings_groups', 'groupid', $groupid);\n //delete members\n delete_records('groups_members', 'groupid', $groupid);\n //then imge\n delete_profile_image($groupid, 'groups');\n //group itself last\n $result = delete_records('groups', 'id', $groupid);\n\n if ($result) {\n //trigger groups events\n events_trigger('groups_group_deleted', $group);\n }\n\n return $result;\n}",
"public function deletegroupAction()\n {\n \t$this->_helper->viewRenderer->setNoRender();\n \t\n \t$group = GroupNamespace::getCurrentGroup();\n \tif (isset($group))\n \t{\n \t\tGroupDAO::getGroupDAO()->deleteGroup($group);\n \t}\n \tGroupNamespace::clearCurrentGroup();\n \t$this->_helper->redirector('index', 'user');\n }",
"public function deleteGroup($id){\n\t\t//The downside to this approach is that in case you inherit the groups from another admin, you will not be able to delete them unless you are logged in with his or her credentials\n\t\t//Yet the upside is that you cannot delete groups created by other admin accounts\n\t\t$userGroup = DB::select(DB::raw(\n\t\t\t\t\t\t\t\t\t\"select user_groups.id from user_groups where user_groups.id = :groupId and user_groups.created_by = :createdBy\"),\n\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id,\"createdBy\"=>Auth::User()->id));\n\t\t//Check that there surveys in this group\n\t\t$surveysInGroup = DB::select(DB::raw(\n\t\t\t\t\t\t\t\t\t\"select surveys.id, surveys.type_id from surveys where surveys.user_group_id = :groupId\"),\n\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t if(!empty($userGroup)){//Means the group exists\n\t\t\t\t\t DB::beginTransaction();\n\t\t\t\t\t try{\n\t\t\t\t\t if(!empty($surveysInGroup)){//Means there are surveys in the group\n\t\t\t\t\t\t foreach($surveysInGroup as $survey){//Iterate over each survey in the group and delete it\n\t\t\t\t\t\t\t if ($survey->type_id == 1) {\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from results where results.survey_id = :surveyId and results.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from participants where participants.survey_id = :surveyId and participants.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from surveys where surveys.id = :surveyId\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($survey->type_id == 2) {\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from peer_results where peer_results.peer_survey_id = :surveyId and peer_results.peer_survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from peer_surveys where peer_surveys.survey_id = :surveyId and peer_surveys.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from participants where participants.survey_id = :surveyId and participants.survey_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"delete from surveys where surveys.id = :surveyId\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"surveyId\"=>$survey->id));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Now that you have removed the surveys you can delete the users in this group\n\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\"delete from user_in_groups where user_in_groups.user_group_id = :groupId and user_in_groups.user_group_id is not null\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id));\n\t\t\t\t\t\t//At this point it should be safe to delete the group\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tDB::delete(DB::raw(\n\t\t\t\t\t\t\t\t\t\t\"delete from user_groups where user_groups.id = :groupId\"),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tarray(\"groupId\"=>$id));\n\t\t\t\t\t\t\n\t\t\t\t\t\tDB::commit();\n\t\t\t\t\t\treturn Redirect::to('admin/usergroup')->with('success','A user group has been deleted successfully.');\n\t\t\t\t\t\t}catch(\\Exception $e){\n\t\t\t\t\t\t\tDB::rollback();\n\t\t\t\t\t\t\treturn \"An error occured; your request could not be completed \".$e->getMessage();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn Redirect::to('admin/usergroup')->with('warning','A user group could not be deleted: check if you are the one who created the group.');\n \t\n }",
"function CleanUp () {\n global $zOLDAPPLE;\n\n $criteria = array (\"groupInformation_tID\" => $this->tID,\n \"Body\" => DELETED_GROUP_ENTRY);\n $this->groupContent->SelectByMultiple ($criteria);\n\n // Break out if no deleted posts left. \n if ($this->groupContent->CountResult() == 0) return (TRUE);\n\n while ($this->groupContent->FetchArray ()) {\n $CHILDREN = new cGROUPCONTENT ();\n $childcriteria = array (\"parent_tID\" => $this->groupContent->tID,\n \"groupInformation_tID\" => $this->tID,\n \"Context\" => $zOLDAPPLE->Context);\n $CHILDREN->SelectByMultiple ($childcriteria);\n\n // If no children, delete.\n if ($CHILDREN->CountResult () == 0) {\n $this->groupContent->Delete ();\n $this->CleanUp ();\n } // if\n unset ($CHILDREN);\n } // while\n }",
"public function phrase_delete_group()\n {\n $group_id = ee()->input->get('phrase_group_id', TRUE);\n $groups = array('' => '- Select -');\n\n foreach (ee()->publisher_phrase->get_groups() as $id => $group)\n {\n if ($group_id != $id)\n {\n $groups[$id] = $group->group_label;\n }\n }\n\n $vars = array(\n 'group_name' => ee()->publisher_phrase->get_group($group_id)->group_label,\n 'groups' => $groups,\n 'hidden' => array('group_id' => $group_id),\n 'delete_url' => ee()->publisher_helper_cp->mod_link('phrase_delete_group_execute', array(), TRUE),\n );\n\n return ee()->load->view('phrase/delete_group', $vars, TRUE);\n }",
"public function delete()\n {\n // Do not delete children, because they are fake objects\n if (false === $this->parent_target_group && $this->target_group_id > 0) {\n $result = rex_sql::factory();\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n $return = ($result->hasError() ? false : true);\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n // reset priorities\n $this->setPriority(true);\n\n // Don't forget to regenerate URL cache\n d2u_addon_backend_helper::generateUrlCache('target_group_id');\n d2u_addon_backend_helper::generateUrlCache('target_group_child_id');\n\n return $return;\n }\n\n return false;\n\n }",
"function dbDeleteGroup($group_id){\n try {\n\n $db = pdoConnect();\n global $db_table_prefix;\n\n $groupDetails = fetchGroupDetails($group_id);\n\n if ($groupDetails['can_delete'] == '0'){\n addAlert(\"danger\", lang(\"CANNOT_DELETE_PERMISSION_GROUP\", array($groupDetails['name'])));\n return false;\n }\n\n $stmt = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"groups\n WHERE id = :group_id\");\n\n $stmt2 = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"user_group_matches\n WHERE group_id = :group_id\");\n\n $stmt3 = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"group_page_matches\n WHERE group_id = :group_id\");\n\n $stmt4 = $db->prepare(\"DELETE FROM \".$db_table_prefix.\"group_action_permits\n WHERE group_id = :group_id\");\n\n $sqlVars = array(\":group_id\" => $group_id);\n\n $stmt->execute($sqlVars);\n\n if ($stmt->rowCount() > 0) {\n // Delete user and page matches for this group.\n $stmt2->execute($sqlVars);\n $stmt3->execute($sqlVars);\n $stmt4->execute($sqlVars);\n return $groupDetails['name'];\n } else {\n addAlert(\"danger\", \"The specified group does not exist.\");\n return false;\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 delete_member_group_conf()\n {\n // ------------------------------------\n // Only super admins can delete member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1)\n {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n\n if ( ! $group_id = Request::input('group_id'))\n {\n return false;\n }\n\n // You can't delete these groups\n\n if (in_array($group_id, $this->no_delete))\n {\n return Cp::unauthorizedAccess();\n }\n\n // Are there any members that are assigned to this group?\n $count = DB::table('members')\n ->where('group_id', $group_id)\n ->count();\n\n $members_exist = (!empty($count)) ? true : false;\n\n $group_name = DB::table('member_groups')\n ->where('group_id', $group_id)\n ->value('group_name');\n\n Cp::$title = __('members.delete_member_group');\n\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem(Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=group_manager', __('admin.member_groups'))).\n Cp::breadcrumbItem(__('members.delete_member_group'));\n\n\n Cp::$body = Cp::formOpen(array('action' => 'C=Administration'.AMP.'M=members'.AMP.'P=delete_mbr_group'.AMP.'group_id='.$group_id))\n .Cp::input_hidden('group_id', $group_id);\n\n Cp::$body .= ($members_exist === TRUE) ? Cp::input_hidden('reassign', 'y') : Cp::input_hidden('reassign', 'n');\n\n\n Cp::$body .= Cp::heading(Cp::quickSpan('alert', __('members.delete_member_group')))\n .Cp::div('box')\n .Cp::quickDiv('littlePadding', '<b>'.__('members.delete_member_group_confirm').'</b>')\n .Cp::quickDiv('littlePadding', '<i>'.$group_name.'</i>')\n .Cp::quickDiv('alert', BR.__('members.cp.action_can_not_be_undone').BR.BR);\n\n if ($members_exist === TRUE)\n {\n Cp::$body .= Cp::quickDiv('defaultBold', str_replace('%x', $count, __('members.member_assignment_warning')));\n\n Cp::$body .= Cp::div('littlePadding');\n Cp::$body .= Cp::input_select_header('new_group_id');\n\n $query = DB::table('member_groups')\n ->select('group_name', 'group_id')\n ->orderBy('group_name')\n ->get();\n\n foreach ($query as $row)\n {\n Cp::$body .= Cp::input_select_option($row->group_id, $row->group_name, '');\n }\n\n Cp::$body .= Cp::input_select_footer();\n Cp::$body .= '</div>'.PHP_EOL;\n }\n\n Cp::$body .= Cp::quickDiv('littlePadding', Cp::input_submit(__('cp.delete')))\n .'</div>'.PHP_EOL\n .'</form>'.PHP_EOL;\n }",
"public function delete(){\n\t\treturn $this->api->deleteGroup($this->getID());\n\t}",
"function groups_delete_groupings_groups($courseid, $showfeedback=false) {\n global $CFG;\n\n $groupssql = \"SELECT id FROM {$CFG->prefix}groups g WHERE g.courseid = $courseid\";\n delete_records_select('groupings_groups', \"groupid IN ($groupssql)\");\n\n //trigger groups events\n events_trigger('groups_groupings_groups_removed', $courseid);\n\n if ($showfeedback) {\n notify(get_string('deleted').' groupings_groups');\n }\n\n return true;\n}",
"public function testRemoveGroup(){\n self::$grpId4 = jAcl2DbUserGroup::createGroup('group4');\n $records2 = self::$groups;\n $records2[] = array('id_aclgrp'=>self::$grpId4,\n 'name'=>'group4',\n 'grouptype'=>0,\n 'ownerlogin'=>null);\n $this->assertTableContainsRecords('jacl2_group', $records2);\n\n // destruction d'un groupe (ici qui n'a pas de user)\n jAcl2DbUserGroup::removeGroup(self::$grpId4);\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n }",
"protected function bp_gtm_delete_g_data($data) {\n global $bp, $wpdb;\n\n if (!check_admin_referer('bp_gtm_delete'))\n return false;\n $paths = $wpdb->get_results($wpdb->prepare(\"SELECT path FROM {$bp->gtm->table_files} WHERE `group_id` = %d\", $_POST['cur_group']));\n foreach ($paths as $path) {\n if (file_exists(bp_gtm_file_dir($path->path)))\n unlink(bp_gtm_file_dir($path->path));\n }\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_files} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_projects} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_tasks} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_taxon} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_terms} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_resps} WHERE `group_id` = %d\", $_POST['cur_group']));\n $wpdb->query($wpdb->prepare(\"DELETE FROM {$bp->gtm->table_discuss} WHERE `group_id` = %d\", $_POST['cur_group']));\n\n bp_core_add_message(__('Everything was deleted successfully.', 'bp_gtm'));\n\n do_action('bp_gtm_delete_g_data', $bp->groups->current_group->id);\n bp_core_redirect(bp_get_group_permalink($bp->groups->current_group) . $bp->gtm->slug . '/delete/');\n }",
"public function delete() {\r\n\r\n // Does the Group object have an ID?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::delete(): Attempt to delete a Group object that does not have it's ID property set.\", E_USER_ERROR );\r\n\r\n // Delete the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $st = $conn->prepare ( \"DELETE FROM \" . DB_PREFIX . \"groups WHERE id = :id LIMIT 1\" );\r\n \r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n }",
"public function deleteGroup()\n {\n // If the group has system attributes, we can't delete it.\n if ($this->groupProtected) {\n $this->notify(\n __('adminhub::notifications.attribute-groups.delete_protected')\n );\n\n return;\n }\n DB::transaction(function () {\n DB::table(config('getcandy.database.table_prefix').'attributables')\n ->whereIn(\n 'attribute_id',\n $this->attributeGroupToDelete->attributes()->pluck('id')->toArray()\n )->delete();\n $this->attributeGroupToDelete->attributes()->delete();\n $this->attributeGroupToDelete->delete();\n });\n $this->deleteGroupId = null;\n $this->refreshGroups();\n\n $this->notify(\n __('adminhub::notifications.attribute-groups.deleted')\n );\n }",
"function db_delete_group($gid)\n{\n\tglobal $db_errno;\n\tglobal $db_errmsg;\n\n\tif ($gid == -1)\n\t{\n\t\t// Can't delete \"All\".\n\t\t$db_errno = 0;\t# XXX - Is this kosher?\n\t\t$db_errmsg = \"Can't delete group \\\"All\\\".\";\n\t\treturn FALSE;\n\t}\n\n\t$dbh = db_connect();\n\n\t/* Get info about existing feed */\n\t$old = db_get_group($gid);\n\tif ($old === NULL)\n\t\t// No such feed. I guess we can go home early.\n\t\treturn TRUE;\n\n\t// Move any members of this group to its parent.\n\t// \"IGNORE\" says to ignore records where the operation would\n\t// fail. Thus, if we have\n\t//\t\"New York Times\" in group \"News\"\n\t//\t\"New York Times\" in group \"Politics\"\n\t// \tgroup \"Politics\" in group \"News\"\n\t// we have a feed (New York Times) in both a group (Politics)\n\t// and its parent (News).\n\t//\n\t// If we now delete \"Politics\", we want to move all members of\n\t// Politics up one level. So normally we'd wind up with two\n\t// instances of \"New York Times in News\". \"IGNORE\" says to\n\t// skip those cases. We'll handle them separately, next.\n\t$query = sprintf(\"UPDATE IGNORE `group_members` SET parent=%d WHERE parent=%d\",\n\t\t\t $old['parent'],\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t/* Delete any duplicates */\n\t$query = sprintf(\"DELETE FROM `group_members` WHERE parent=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t/* If this group has any child groups, move them up one level\n\t * as well, into the parent of $gid.\n\t */\n\t$query = sprintf(\"UPDATE `groups` SET parent=%d WHERE parent=%d\",\n\t\t\t $old['parent'],\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t/* Delete this group from `groups` */\n\t$query = sprintf(\"DELETE FROM `groups` WHERE id=%d\",\n\t\t\t $gid);\n\t$result = $dbh->query($query);\n\tif (!$result)\n\t{\n\t\t$db_errno = $dbh->errno;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\treturn TRUE;\t\t// Success\n}",
"function delete_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->delete($id);\n\t}",
"function timeconditions_timegroups_del_group($timegroup) {\n\tglobal $db;\n\n\t$sql = \"delete from timegroups_details where timegroupid = $timegroup\";\n\t$db->query($sql);\n\t$sql = \"delete from timegroups_groups where id = $timegroup\";\n\t$db->query($sql);\n\tneedreload();\n}",
"function system_delete_group($paramv)\n{\n}",
"function delete_group($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_delete_this_grp\"));\n else {\n //Deleting Everything Related To This Group\n $this->delete_group_topics($gid);\n $this->delete_group_videos($gid);\n $this->delete_group_members($gid);\n $db->delete(tbl($this->gp_tbl), array(\"group_id\"), array($gid));\n $this->update_user_total_groups($group['userid']);\n e(lang(\"grp_deleted\"), \"m\");\n }\n }",
"public function delete()\n\t{\n\t\t// make sure a user id is set\n\t\tif (empty($this->group['id']))\n\t\t{\n\t\t\tthrow new SentryGroupException(__('sentry::sentry.no_group_selected'));\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tDB::connection(static::$db_instance)->pdo->beginTransaction();\n\n\t\t\t// delete users groups\n\t\t\t$delete_user_groups = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$join_table)\n\t\t\t\t->where(static::$group_identifier, '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\t// delete GROUP\n\t\t\t$delete_user = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$table)\n\t\t\t\t->where('id', '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\tDB::connection(static::$db_instance)->pdo->commit();\n\t\t}\n\t\tcatch(\\Database_Exception $e) {\n\n\t\t\tDB::connection(static::$db_instance)->pdo->rollBack();\n\t\t\treturn false;\n\t\t}\n\n\t\t// update user to null\n\t\t$this->group = array();\n\t\treturn true;\n\n\t}",
"public function delete()\n {\n // Delete the group\n $result = parent::delete();\n\n return $result;\n }",
"public function deletegroupAction()\n\t{\n\t\t$model = $this->byId(null, 'UserGroup');\n\t\tif ($model != null) {\n\t\t\ttry {\n\t\t\t\t$this->groupService->deleteGroup($model);\n\t\t\t} catch (NonEmptyGroupException $neg) {\n\t\t\t\t$this->flash(\"Group is not empty and cannot be deleted\");\n\t\t\t}\n\t\t}\n\n\t\t$this->redirect('admin', 'grouplist');\n\t}",
"protected function DeleteGroup($groupid, $deletegrouptoo=true) { \n if (!$groupid = $this->CorrectSymplyString($groupid)) { return false; }\n $list = $this->control->db->mPost(\n \"select iditem from {$this->control->tables_list['tplitemsl']} \".$this->GetWhereForPagesList($groupid)\n );\n require_once W_LIBPATH.'/sp.page.lib.php';\n require_once W_LIBPATH.'/files.lib.php';\n while ($row = $this->control->db->GetLineArray($list)) { \n w_sp_page_object::DeletePage($this->control, $row['iditem']);\n w_dw_files_object::RemoveAllObjectFiles(2, $row['iditem'], $this->control); \n } \n if ($deletegrouptoo) {\n $this->control->db->Delete($this->control->tables_list['glbsectlst'], \"iditem='$groupid'\", '1');\n $this->result['gcount'] = $this->GetGroupsCount();\n }\n return true; \n }",
"public function testCanRemoveGroup() {\n $this->assertFalse($this->adapter->deleteResourceGroup('g1'));\n\n $this->assertTrue($this->adapter->addResourceGroup('g1', ['images.get', 'images.head']));\n $this->assertSame(['images.get', 'images.head'], $this->adapter->getGroup('g1'));\n $this->assertTrue($this->adapter->deleteResourceGroup('g1'));\n $this->assertSame(false, $this->adapter->getGroup('g1'));\n }",
"function delete_group_topics($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_delete_grp_topics\"));\n else {\n $topics = $this->get_topics(array('group' => $gid));\n if (is_array($topics))\n foreach ($topics as $topic)\n $this->delete_topic($topic['topic_id']);\n e(lang(\"deleted\"), \"m\");\n }\n }",
"public function testDeleteExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 3,\n ]);\n $response->assertSessionHasNoErrors();\n }",
"public function delete_field_group($field_group)\n {\n }",
"function deleteGroup($gID) {\n\t\t$data['oldGroupData'] = $this->group_model->get_group_by_id($gID);\n\t\t$this->removeImage($data['oldGroupData']['org_picture']);\n\t\t//Delete from the database using the org_ID\n\t\t$this->group_model->delete_group($gID);\n\t\tredirect('myGroups/index');\n\t}",
"function delMemberGroupHandle() {\n global $inputs;\n\n $sql = \"DELETE FROM `member_group` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}",
"function acf_delete_field_group($id = 0)\n{\n}",
"function groups_delete_groups($courseid, $showfeedback=false) {\n global $CFG;\n require_once($CFG->libdir.'/gdlib.php');\n\n $groupssql = \"SELECT id FROM {$CFG->prefix}groups g WHERE g.courseid = $courseid\";\n\n // delete any uses of groups\n groups_delete_groupings_groups($courseid, $showfeedback);\n groups_delete_group_members($courseid, 0, $showfeedback);\n\n // delete group pictures\n if ($groups = get_records('groups', 'courseid', $courseid)) {\n foreach($groups as $group) {\n delete_profile_image($group->id, 'groups');\n }\n }\n\n // delete group calendar events\n delete_records_select('event', \"groupid IN ($groupssql)\");\n\n delete_records('groups', 'courseid', $courseid);\n\n //trigger groups events\n events_trigger('groups_groups_deleted', $courseid);\n\n if ($showfeedback) {\n notify(get_string('deleted').' groups');\n }\n\n return true;\n}",
"function withdrawGroupHandler() {\n global $inputs;\n\n $sql = \"DELETE FROM `member_group` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}",
"public function admin_remove(){\n \n $this->set(\"title_for_layout\",\"Remove a Group\");\n \n // Load the group in question\n $group = $this->Group->find('first', array('conditions' => array('Group.id' => $this->params->id)));\n if($group){\n $this->set('group', $group);\n } else {\n $this->Session->setFlash('That group could not be found.', 'default', array('class' => 'alert alert-error'));\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n }",
"public function delete_group($content_type_id, $group_id)\r\n {\r\n $message = 'Function delete_group not optimized and should not be called directly in ' .\r\n vB_Types::instance()->getContentTypeTitle($fields['contenttypeid']) .\r\n ' index controller. See vBSphinxSearch_Search_IndexController_Post for example.';\r\n vBSphinxSearch_Core::log_errors($message);\r\n\r\n $this->_content_type_id = $content_type_id;\r\n if ($this->_fetch_object_id_list($group_id))\r\n {\r\n return $this->_write_to_queue();\r\n }\r\n return false;\r\n }",
"public function testDeleteNonExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 5694,\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"public function testDeleteGroupMember()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"function ajaxDeleteFGroup( $key = false )\n\t{\n\t\tglobal $_response, $lang;\n\n\t\tif ( !$key )\n\t\t\treturn false;\n\t\t\n\t\t$lang_keys[] = array(\n\t\t\t'Key' => 'listing_groups+name+' . $key,\n\t\t);\n\n\t\t// delete group field relations\n\t\tif ( !$GLOBALS['config']['trash'] )\n\t\t{\n\t\t\t$this -> deleteGroupRelations( $key );\n\t\t}\n\t\t\n\t\t$this -> rlActions -> delete( array( 'Key' => $key ), array('listing_groups', 'lang_keys'), null, 1, $key, $lang_keys );\n\t\t$del_mode = $this -> rlActions -> action;\n\t\t\n\t\t$_response -> script(\"\n\t\t\tlistingGroupsGrid.reload();\n\t\t\tprintMessage('notice', '{$lang['group_' . $del_mode]}');\n\t\t\");\n\t\t\n\t\treturn $_response;\n\t}",
"public function delete() {\r\n\t\tif (isset($_POST['id'])) {\r\n\t\t\t$id = (int)$_POST['id'];\r\n\t\t\tif ($id == 1) {\r\n\t\t\t\t$response['success'] = false;\r\n\t\t\t\t$response['msg'] = Yii::t(\"app\",'Cannot delete Group ID = 1');\r\n\t\t\t} else {\r\n\t\t\t\t$sql = sprintf('DELETE FROM %s WHERE %s = %s', MENUGROUP_TABLE, MENUGROUP_ID, $id);\r\n\t\t\t\t$delete = $this->db->Execute($sql);\r\n\t\t\t\tif ($delete) {\r\n\t\t\t\t\t$sql = sprintf('DELETE FROM %s WHERE %s IN (%s)', MENU_TABLE, MENU_GROUP, $id);\r\n\t\t\t\t\t$this->db->Execute($sql);\r\n\t\t\t\t\t$response['success'] = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$response['success'] = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\theader('Content-type: application/json');\r\n\t\t\techo json_encode($response);\r\n\t\t}\r\n\t}",
"public function deleteAction(){\n $this->title = 'Delete user group';\n \n $form = new DeleteForm();\n $groupModel = new Group();\n \n if ($this->getRequest()->isPost()) {\n if($form->isValid($this->getRequest()->getPost())) {\n $groupModel->deleteById($form->getValue('id'));\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => 'The group was successfully deleted.',\n )\n );\n \n $this->_redirect('/groups/');\n }\n }else{\n $id = $this->_getParam('id');\n $row = $groupModel->findById($id);\n \n $identity=Zend_Auth::getInstance()->getIdentity();\n \t $userGroupModel = new AdminUserGroup();\n $userGroupId = $userGroupModel->findByUserId($identity->id);\n \n if ($id == $userGroupId[0]['group_id']) {\n $this->_helper->FlashMessenger(\n array(\n 'msg-error' => 'You can\\'t delete the group you are a member of.',\n )\n );\n \n $this->_redirect('/groups/');\n }\n if(in_array($id,array(1,2,3,4))){\n $this->_helper->FlashMessenger(\n array(\n 'msg-error' => 'You can not delete default user groups',\n )\n );\n \n $this->_redirect('/groups/');\n }\n if (empty($row)) {\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => sprintf('We cannot find group with id %s', $id),\n )\n );\n $this->_redirect('/groups/');\n }\n \n $form->populate($row);\n $this->view->item = $row;\n }\n \n $this->view->form = $form;\n }",
"public function deleteGroup($data)\n {\n foreach ($data as $instance) {\n if (!is_array($data)) {\n $instance = $data;\n $end = true;\n }\n if (!Check::id($instance)) {\n $error = true;\n }\n if (self::$group->countMembers($instance) !== 0) {\n Debug::info('Group is not empty.');\n return false;\n }\n if ($instance == Config::get('group/defaultGroup')) {\n Debug::info('Cannot delete the default group.');\n return false;\n }\n self::$db->delete('groups', ['ID', '=', $instance]);\n self::$log->admin(\"Deleted group: $instance\");\n Debug::info(\"Group deleted: $instance\");\n if (!empty($end)) {\n break;\n }\n }\n if (!empty($error)) {\n Debug::info('One or more invalid ID\\'s.');\n return false;\n }\n return true;\n }",
"public function testRemoveUsedGroup(){\n // on ajoute d'abord un user dans un groupe\n jAcl2DbUserGroup::addUserToGroup('max', self::$grpId3);\n\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'max', 'id_aclgrp'=> self::$grpId3),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n\n // ok maintenant on supprime le groupe\n\n jAcl2DbUserGroup::removeGroup(self::$grpId3);\n self::$usergroups=array(\n array('login'=>'laurent', 'id_aclgrp'=>self::$grpId5),\n array('login'=>'max', 'id_aclgrp'=>self::$grpId6),\n array('login'=>'max', 'id_aclgrp'=>self::$defaultGroupId),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n unset(self::$groups[2]);\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n\n\n }",
"public function deleteGroup($in)\n {\n $em = $this->doctrine->getEntityManager();\n $group = $em->getRepository('CmarMeetingBundle:Group')->findOneBy(array('key' => $in->{'key'}));\n $meeting = $em->getRepository('CmarMeetingBundle:Meeting')->findOneByStatesAndTitle(array(Meeting::STATE_NOW, Meeting::STATE_NEW, Meeting::STATE_LOCKED), $in->{'name'});\n\n\n if ($group == NULL) {\n $this->logger->info(\"Group does not exist\"); \n throw new \\LogicException(\"Group does not exist\");\n } else {\n //$this->mapGroup($group, $in);\n $id_group = $this->adoAdmin->principalFindByName($group->getName());\n $xml = $this->adoAdmin->principalDelete($id_group);\n \n if ($group->getType() != 'personal'){//Es necesario que el grupo enviado por D+ contenga el Tipo de grupo en la acción borrar\n $xml = $this->meetingService->stop($meeting);\n $em->remove($meeting);\n }\n $em->remove($group);\n\n try {\n $em->flush();\n } catch (\\Exception $e) {\n $this->logger->info(\"DDBB Exception\"); \n throw new \\LogicException(\"DDBB Exception\", -1);\n }\n }\n }",
"public function deleteGroup($id){\n /// Compruebo que no pertenesca a NoGroup (id = 2)\n if($id!=2){\n #Actualizar Paginas a valor 0 = no pertenece a un grupo/\n $result_Domain= DB::table('w59_page')\n ->select('w59_page.id')\n ->join('w59_groudpage', 'w59_groudpage.id', '=', 'w59_page.IDgroudpage')\n ->where('w59_groudpage.IDgroup','=',$id)\n ->get(); \n if(count($result_Domain) > 0){\n foreach($result_Domain as $IDPage){\n DB::table('w59_page')\n ->where('id', $IDPage->id)\n ->update(['IDgroudpage' => '0']);\n }\n }\n\n ////verificar si el grupo es nivel 2.\n $get_Type= DB::table('w59_group')->select('type')->where('id','=',$id)->first();\n if($get_Type->type==2){\n $ArrayDomain= DB::table('w59_dominio')\n ->select('url')->get(); \n $hey = $ArrayDomain;\n }else{\n $ArrayDomain= DB::table('w59_dominio')\n ->select('url')->where('IDgroup', '=', $id)->get(); \n $hey = $ArrayDomain;\n }\n \n #Actualizar Dominio a NoGroup con ID 2 como Predeterminado.\n DB::table('w59_dominio')->where('IDgroup','=', $id)->update(['IDgroup' => '2']);\n #Eliminar Grupos de pagina\n DB::table('w59_groudpage')->where('IDgroup', '=', $id)->delete();\n #Borrar Grupos\n DB::table('w59_group')->where('id', '=', $id)->delete();\n\n foreach($hey as $po){\n $url =\"https://www.\".$po->url.\"/wp-json/kb/v2/worked/14/\";\n $this->curl_load($url);\n }\n return back()->withInput();\n \n }\n }",
"public function removeAllSubGroups() {}",
"public function delGroupA($values){\n\t\tif(!empty($values)){\n\t\t\t$LoginID = $values['LoginID'];\n\t\t\tinclude($_SERVER['DOCUMENT_ROOT'].'/_php/config.php');\n\t\t\t// -- Check that user is faculty\n\t\t\t$checkrole = \"SELECT Role From login WHERE LoginID = '$LoginID'\";\t\t\t\n\t\t\t$getRole = mysqli_query($con, $checkrole);\n\t\t\tif (mysqli_num_rows($getRole) > 0){\n\t\t\t\twhile($row = mysqli_fetch_array($getRole)){\n\t\t\t\t\t$myRole = $row['Role'];\n\t\t\t\t\tif ($myRole == 'Faculty'){\n\t\t\t\t\t\t// -- Delete Class\n\t\t\t\t\t\t$sql = \"DELETE FROM group_assign WHERE GroupID = ? && LoginID = ?;\";\n\t\t\t\t\t\t\t$stmt = $con->prepare($sql);\n\t\t\t\t\t\t\t$stmt->bind_param(\"ii\", $values['GroupID'], $values['Subj']);\n\t\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t\t\t\t$stmt->close();\n\t\t\t\t\t}\n\t\t\t\t\telse{ \n\t\t\t\t\t\techo \"There was an error.\";\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{ \n\t\t\techo \"Only faculty can delete people from groups. <br/> Please Login.\"; \n\t\t}\n\t}",
"function delete($group_id) {\n\t\tglobal $fmdb, $__FM_CONFIG;\n\t\t\n\t\t/** Does the group_id exist for this account? */\n\t\tbasicGet('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', $group_id, 'group_', 'group_id');\n\t\tif ($fmdb->num_rows) {\n\t\t\t/** Is the group_id present in a policy? */\n\t\t\tif (isItemInPolicy($group_id, 'group')) return _('This group could not be deleted because it is associated with one or more policies.');\n\t\t\t\n\t\t\t/** Delete group */\n\t\t\t$tmp_name = getNameFromID($group_id, 'fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', 'group_', 'group_id', 'group_name');\n\t\t\tif (updateStatus('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', $group_id, 'group_', 'deleted', 'group_id')) {\n\t\t\t\taddLogEntry(\"Deleted group '$tmp_name'.\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn formatError(_('This group could not be deleted.'), 'sql');\n\t}",
"public function groupDelete(Request $request){\n try{\n $id = Crypt::decryptString($request->group_id);\n } catch (DecryptException $e) {\n return 'DD-E0001';\n }\n\n $logs = New LogsGroupUpdate;\n $logs->action = 1;\n $logs->user_id = auth()->user()->id;\n $logs->group_id = $id;\n $logs->save();\n\n $group = Group::find($id);\n $group->status = Carbon::now();\n $group->update();\n \n return redirect()->route('welcome');\n }",
"public static function deleteGroup($id) {\n global $lC_Database;\n\n $lC_Database->startTransaction();\n\n $Qdel = $lC_Database->query('delete from :table_administrators_access where administrators_groups_id = :administrators_groups_id');\n $Qdel->bindTable(':table_administrators_access', TABLE_ADMINISTRATORS_ACCESS);\n $Qdel->bindInt(':administrators_groups_id', $id);\n $Qdel->setLogging($_SESSION['module'], $id);\n $Qdel->execute();\n\n if ( !$lC_Database->isError() ) {\n $Qdel = $lC_Database->query('delete from :table_administrators_groups where id = :id');\n $Qdel->bindTable(':table_administrators_groups', TABLE_ADMINISTRATORS_GROUPS);\n $Qdel->bindInt(':id', $id);\n $Qdel->setLogging($_SESSION['module'], $id);\n $Qdel->execute();\n\n if ( !$lC_Database->isError() ) {\n $lC_Database->commitTransaction();\n\n return true;\n }\n }\n\n $lC_Database->rollbackTransaction();\n\n return false;\n }",
"function groups_delete_groupings($courseid, $showfeedback=false) {\n global $CFG;\n\n // delete any uses of groupings\n $sql = \"DELETE FROM {$CFG->prefix}groupings_groups\n WHERE groupingid in (SELECT id FROM {$CFG->prefix}groupings g WHERE g.courseid = $courseid)\";\n execute_sql($sql, false);\n\n // remove the default groupingid from course\n set_field('course', 'defaultgroupingid', 0, 'id', $courseid);\n // remove the groupingid from all course modules\n set_field('course_modules', 'groupingid', 0, 'course', $courseid);\n\n delete_records('groupings', 'courseid', $courseid);\n\n //trigger groups events\n events_trigger('groups_groupings_deleted', $courseid);\n\n if ($showfeedback) {\n notify(get_string('deleted').' groupings');\n }\n\n return true;\n}",
"public function actionDeletemembergroup() {\n $json = array();\n if (isset(\\Yii::$app->request->post()['id'])) {\n if (\\Yii::$app->request->post()['id'] == 0) {\n $json['success'] = 'no';\n $json['message'] = Yii::t('BbiiModule.bbii', 'The default member group cannot be removed.');\n } else {\n BbiiMembergroup::find(\\Yii::$app->request->post()['id'])->delete();\n $json['success'] = 'yes';\n }\n }\n echo json_encode($json);\n \\Yii::$app->end();\n }",
"function acf_delete_field_group( $id = 0 ) {\n\treturn acf_delete_internal_post_type( $id, 'acf-field-group' );\n}",
"function delete_complete_research_group($main_object,$value){\n //delete 1\n //from log in table\n $main_object->research_group=$value;\n $query_make = new Query_Make();\n $attribute = array(\"research_group\");\n $value = array($main_object->research_group);\n $sql = $query_make->delete_query($query_make,\"LogInTable\",$attribute,$value);\n $result = $main_object->exeute_query($main_object,$sql);\n if($result) {\n echo \"delete 1 done \";\n //from supervisor Table \n $attribute = array(\"research_group\");\n $value = array($main_object->research_group);\n $sql = $query_make->delete_query($query_make,\"Supervisor\",$attribute,$value);\n $result = $main_object->exeute_query($main_object,$sql);\n if($result) {\n echo \"delete 2 done \";\n //Thesis Group Info Table \n $attribute = array(\"research_group\");\n $value = array($main_object->research_group);\n $sql = $query_make->delete_query($query_make,\"ThesisGroupInfo\",$attribute,$value);\n $result = $main_object->exeute_query($main_object,$sql);\n if($result) {\n echo \"delete 3 done \";\n //StudentInformation Table \n $attribute = array(\"research_group\");\n $value = array($main_object->research_group);\n $sql = $query_make->delete_query($query_make,\"StudentInformation\",$attribute,$value);\n $result = $main_object->exeute_query($main_object,$sql);\n if($result) {\n echo \"delete 4 done\";\n //ReseachGroupInfo Table \n $attribute = array(\"name\");\n $value = array($main_object->research_group);\n $sql = $query_make->delete_query($query_make,\"ResearchGroupInfo\",$attribute,$value);\n $result = $main_object->exeute_query($main_object,$sql);\n\n if($result) {\n echo \"successful\";\n }\n else {\n echo \"not successful\"; \n }\n }\n else {\n echo \"unsuccessful\";\n }\n\n }\n else {\n echo \"unsuccessful\";\n }\n\n }\n\n }\n else {\n echo \"unsuccessful\"; \n }\n }",
"function delete_group_members($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_del_grp_mems\"));\n else {\n $db->delete(tbl($this->gp_mem_tbl), array(\"group_id\"), array($gid));\n e(lang(\"mems_deleted\"), \"m\");\n }\n }",
"public function delete_group($session_key, $sid, $gid)\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t\t$sid = sanitize_int($sid);\n\t\t\t$gid = sanitize_int($gid);\n\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\n\t\t\tif (!isset($surveyidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\n \t\t \n\t\t\t$groupidExists = Groups::model()->findByAttributes(array('gid' => $gid));\n\t\t\tif (!isset($groupidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid groupid', 22);\n\t\t \n\t\t\tif($surveyidExists['active']=='Y')\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Survey is active and not editable', 35);\n\n if (hasSurveyPermission($sid, 'surveycontent', 'delete'))\n {\n\t\t\t\t//Check what dependencies exist for current group\n\t\t\t\t//$dependencies=getGroupDepsForConditions($current_group->sid,\"all\",$gid,\"by-targgid\");\n\n\t\t\t\tLimeExpressionManager::RevertUpgradeConditionsToRelevance($sid);\n\t\t\t\t$iGroupsDeleted = Groups::deleteWithDependency($gid, $sid);\n\t\t\t\t\n\t\t\t\tif ($iGroupsDeleted === 1)\n\t\t\t\t\tfixSortOrderGroups($sid);\n\t\t\t\t\t\n\t\t\t\tLimeExpressionManager::UpgradeConditionsToRelevance($sid);\n\n\t\t\t\tif ($iGroupsDeleted === 1)\n\t\t\t\t{\n\t\t\t\t\treturn $gid;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Group deletion failed', 37);\n }\n else\n throw new Zend_XmlRpc_Server_Exception('No permission', 2);\n }\t\t\n\t}",
"public function delete($id = 0)\r\n\t{\r\n\t\tif ($id == 1 || $id == 2 || $id == 3)\r\n\t\t{\r\n\t\t\t$this->session->set_flashdata('messages', 'Trying to delete base groups!');\r\n\t\t\tredirect('admin/groups');\r\n\t\t}\r\n\t\t$this->groups_m->delete($id);\r\n\t\tredirect('admin/groups');\r\n\t}",
"public function removefromgroupAction()\n {\n \t//Don't display a new view\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t\n\t\t$itemid = $this->getRequest()->getParam('itemID');\n\t\t\n\t\t$group = GroupNamespace::getCurrentGroup();\n\t\tif (isset($itemid) && isset($group))\n\t\t{\n\t\t\t$item = $group->removeRecord($itemid);\n\t\t\t$item->setGroupID(NULL);\n\t\t\tItemDAO::getItemDAO()->saveItemIdentification($item, $item);\n\t\t}\n }",
"public function testDeleteUnassignedGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 1,\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"public function delete($id)\n\t{ \n\t\t$where_array=array(\n\t\t\t'id' =>$id\n\t\t);\n\t\t\n $delete=$this->mcommon->common_delete('groups',$where_array);\n\t\tif($delete)\n\t\t{\n\t\t\t$this->session->set_flashdata('res', lang('common_message_delete'));\n\t\t\t$this->session->set_flashdata('res_type', 'danger');\n\t\t\tredirect(base_url().'admin/RoleModule');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->index($data);\n\t\t}\n\t}",
"public function delete_group($id){\n $this->db->where('group_id', $id);\n $this->db->delete('member_group');\n }",
"private function deleteGroupTopic()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['topic_id']) || $request['topic_id']==\"\" )\n throw_error_msg('provide topic id');\n else if(!is_numeric($request['topic_id'])) \n throw_error_msg('invalid topic id'); \n else\n $tid = (int)$request['topic_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->delete_topic($tid);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic deleted', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"protected function DeleteGroup($groupid, $deletegrouptoo=true) { \n if (!$groupid = $this->CorrectSymplyString($groupid)) { return false; } \n //remove all bunners\n require_once W_LIBPATH.'/bunners.lib.php';\n w_adv_bunners_object::RemoveAllBanners($groupid, $this->control);\n //remove group \n if ($deletegrouptoo) {\n $this->control->db->Delete($this->control->tables_list['bunnerssec'], \"iditem='$groupid'\", '1');\n $this->result['gcount'] = $this->GetGroupsCount();\n }\n return true; \n }",
"private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}",
"public function remove($group)\n {\n }",
"function admin_delete($id=null){\n\t $id = base64_decode($id);\n\t $this->UserGroup->id = $id;\n $this->UserGroup->delete($id);\n $this->Session->setFlash('User Group deleted sucessfully.','message/green');\n $this->redirect(array('action' => 'index'));\n }",
"function acf_delete_json_field_group($key)\n{\n}",
"function feed_group_delete($feed_group, DatabaseTransaction $transaction = NULL) {\r\n if (!$transaction) {\r\n $transaction = db_transaction();\r\n }\r\n\r\n try {\r\n if (isset($feed_group->fgid)) {\r\n db_delete('feed_user_group')\r\n ->condition('fgid', $feed_group->fgid)\r\n ->execute();\r\n \r\n db_delete('feed_group')\r\n ->condition('fgid', $feed_group->fgid)\r\n ->execute();\r\n }\r\n return TRUE;\r\n }\r\n catch (Exception $e) {\r\n $transaction->rollback();\r\n watchdog_exception('feed', $e);\r\n return FALSE;\r\n }\r\n}",
"public function testDeleteGroupWithoutId()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => '',\n ]);\n $response->assertSessionHasErrors(['group_id']);\n }",
"public function deleteGroup($id = null){\n\t\tif($id == null){\n\t\t\treturn $this->redirect(['controller' => 'Users', 'action' => 'panel']);\n\t\t}\n\t\t$this->request->allowMethod(['post', 'delete']);\n $group = $this->Modules->Groups->get($id);\n if ($this->Modules->Groups->delete($group)) {\n $this->Flash->success('Le groupe a bien été supprimé.');\n } else {\n $this->Flash->error('Le groupe ne peut pas être supprimé, merci de réessayer plus tard.');\n }\n\t\t$this->redirect($this->referer());\n\t}",
"function remove($group_id)\n {\n $group = $this->Group_model->get_group($group_id);\n\n // check if the group exists before trying to delete it\n if(isset($group['group_id']))\n {\n $this->Group_model->delete_group($group_id);\n $this->session->set_flashdata('msg', 'The group is deleted');\n redirect('group/index');\n }\n else\n show_error('The group you are trying to delete does not exist.');\n }",
"public function deleteTemplateGroup()\n\t{\n\t\tforeach( \\IPS\\cms\\Templates::$databaseDefaults as $field => $template )\n\t\t{\n\t\t\t\\IPS\\Db::i()->update( 'cms_databases', array( 'database_template_' . $field => $template ), array( 'database_template_' . $field . ' =?', \\IPS\\Request::i()->group ) );\n\t\t}\n\t\n\t\t\\IPS\\Db::i()->delete( 'cms_templates', array( 'template_location=? and template_group=?', 'database', \\IPS\\Request::i()->group ) );\n\t\t\n\t\tunset( \\IPS\\Data\\Store::i()->cms_databases );\n\t\t\n\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( 'app=cms&module=pages&controller=templates' . ( isset( \\IPS\\Request::i()->t_location ) ? '&t_location=' . \\IPS\\Request::i()->t_location : '' ) ), 'deleted' );\n\t}",
"public function live_groups_delete(Request $request) {\n\n try {\n\n $validator = Validator::make($request->all(),\n array(\n 'live_group_id' => 'required|integer|exists:live_groups,id,user_id,'.$request->id,\n ),\n array(\n 'exists' => Helper::error_message(908)\n )\n );\n\n if ($validator->fails()) {\n\n $error = implode(',', $validator->messages()->all());\n\n throw new Exception($error, 101);\n \n } else { \n\n $group_details = LiveGroup::where('id',$request->live_group_id)->first();\n\n if(!$group_details) {\n\n throw new Exception(Helper::error_message(908), 908);\n \n }\n\n if($group_details->user_id != $request->id) {\n throw new Exception(Helper::error_message(909), 909);\n }\n\n if($group_details->delete()) {\n\n $response_array = ['success' => true , 'message' => Helper::get_message(132) , 'code' => 132];\n\n } else {\n\n throw new Exception(Helper::error_message(907), 907);\n }\n\n }\n\n return response()->json($response_array,200);\n\n } catch(Exception $e) {\n\n $error_message = $e->getMessage();\n\n $error_code = $e->getCode();\n\n $response_array = ['success'=>false, 'error'=> $error_message , 'error_messages' => $error_message, 'error_code' => $error_code];\n\n return response()->json($response_array);\n\n }\n\n }",
"function _displayFormConfirmGroup($err='')\n\t{\n\t\t$dt = $this->_dt;\n\n\t\t$utpage = new utPage('draws');\n\t\t$content =& $utpage->getPage();\n\t\t$form =& $content->addForm('tDelGroups', 'draws', DRAW_GROUP_DELETE);\n\n\t\t// Initialize the field\n\t\t$group = kform::getData();\n\t\tif (empty($ids)) $ids[] = kform::getData();\n\t\tif ($err =='' && !empty($group))\n\t\t{\n\t\t\t$form->addHide(\"group\", $group);\n\t\t\t$form->addMsg('msgConfirmDelGroup');\n\t\t\t$form->addBtn('btnDelete', KAF_SUBMIT);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($err!='') $form->addWng($err);\n\t\t\telse $form->addWng('msgNeedGroups');\n\t\t}\n\t\t$form->addBtn('btnCancel');\n\t\t$elts = array('btnDelete', 'btnCancel');\n\t\t$form->addBlock('blkBtn', $elts);\n\n\t\t//Display the page\n\t\t$utpage->display();\n\t\texit;\n\t}",
"public static function onGroupDelete($id)\n {\n static::deleteCacheByTag(static::getCacheTag());\n }",
"public static function onGroupDelete($id)\n {\n static::deleteCacheByTag(static::getCacheTag());\n }",
"public function removeTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken();\n\n\t\t// Incoming\n\t\t$ids = Request::getArray('cid', array());\n\t\t$ids = (!is_array($ids) ? array($ids) : $ids);\n\n\t\t$i = 0;\n\n\t\t// Do we have any IDs?\n\t\tif (!empty($ids))\n\t\t{\n\t\t\t$groups = Access::getGroupsByUser(User::get('id'));\n\n\t\t\t// Check if I am a Super Admin\n\t\t\t$iAmSuperAdmin = User::authorise('core.admin');\n\n\t\t\t// Loop through each ID and delete the necessary items\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$id = intval($id);\n\n\t\t\t\t// do not allow to delete groups to which the current user belongs\n\t\t\t\tif (in_array($id, $groups))\n\t\t\t\t{\n\t\t\t\t\tNotify::warning(Lang::txt('COM_MEMBERS_DELETE_ERROR_INVALID_GROUP'));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Access checks.\n\t\t\t\t$allow = User::authorise('core.edit.state', 'com_members');\n\n\t\t\t\t// Don't allow non-super-admin to delete a super admin\n\t\t\t\t$allow = (!$iAmSuperAdmin && Access::checkGroup($id, 'core.admin')) ? false : $allow;\n\n\t\t\t\tif (!$allow)\n\t\t\t\t{\n\t\t\t\t\tNotify::warning(Lang::txt('JERROR_CORE_DELETE_NOT_PERMITTED'));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$row = Accessgroup::oneOrFail($id);\n\n\t\t\t\t$data = $row->toArray();\n\n\t\t\t\t// Fire the onUserBeforeDeleteGroup event.\n\t\t\t\tEvent::trigger('user.onUserBeforeDeleteGroup', array($data));\n\n\t\t\t\t// Remove the record\n\t\t\t\tif (!$row->destroy())\n\t\t\t\t{\n\t\t\t\t\tNotify::error($row->getError());\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Trigger the onUserAfterDeleteGroup event.\n\t\t\t\tEvent::trigger('user.onUserAfterDeleteGroup', array($data, true, $this->getError()));\n\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\telse // no rows were selected\n\t\t{\n\t\t\tNotify::warning(Lang::txt('COM_MEMBERS_ACCESSGROUP_DELETE_NO_ROW_SELECTED'));\n\t\t}\n\n\t\t// Output messsage and redirect\n\t\tif ($i)\n\t\t{\n\t\t\tNotify::success(Lang::txt('COM_MEMBERS_ACCESSGROUP_DELETE_SUCCESS'));\n\t\t}\n\n\t\t$this->cancelTask();\n\t}",
"function delete($id) {\n $this->Group->delete($id);\n $this->Session->setFlash('The group has been deleted.');\n $this->redirect('/groups/edit');\n }",
"function superadmin_delete($id=NULL) {\n\t $this->id = (int)$id;\n\t if($this->id==1) {\n\t $this->Session->setFlash('You can\\'t delete this User Group.'); \n\t $this->redirect(array('controller'=>'roles','action' => \"index\"));\n\t }\n\t if(!$this->id) {\n\t\t \t$this->Session->setFlash('Invalid User Group delete id');\n\t\t $this->redirect(array('controller'=>'roles','action'=>'index'));\n\t }\n\t //Get admins which are belongs to this role\n\t $this->loadModel('Adminuser');\n\t if($this->Adminuser->find('count',array('conditions'=>array('Adminuser.role_id'=>$this->id)))) {\n\t \t\t$this->Session->setFlash('Please first delete Users Profiles which are using this role.');\n\t\t $this->redirect(array('controller'=>'roles','action'=>'index'));\n\t }\n\t if($this->Role->delete($this->id,false)) { //second param for casecade delete\n\t $this->Session->write('popup','User Group has been deleted successfully.');\n\t\t\t$this->Session->setFlash('User Group has been deleted successfully.'); \n\t\t\t$this->redirect(array('controller'=>'roles','action' => \"index/message:success\")); \n\t\t}\n\t else {\n\t \t\t$this->Session->setFlash('Deletion problem, Please try again.'); \n\t \t$this->redirect(array('controller'=>'roles','action' => \"index\"));\n\t \t}\t\n\t }",
"public function testProfilePrototypeDeleteGroups()\n {\n\n }",
"public function deleteAction()\n\t{\t\n\n\t\t$cid = \\Input::get('cid');\n\n\t\t$affectedRows = \\DB::table('groups')->whereIn('id', $cid)->delete();\n\n\t\tif( \\Request::ajax() )\n\t\t{\n\t\t\n\t\t\techo json_encode(array('status' => $affectedRows));\n\t\t\texit;\n\t\t}\n\t}",
"function deleteEntry() \n { \n \n // before removing entry, make sure associated linkGroups & linkViewers\n // are removed as well\n $linkID = $this->getID();\n \n $linkMgr = new RowManager_NavLinkAccessGroupManager();\n $linkMgr->setLinkID( $linkID );\n $list = $linkMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n $linkViewerMgr = new RowManager_NavLinkViewerManager();\n $linkViewerMgr->setLinkID( $linkID );\n $list = $linkViewerMgr->getListIterator();\n \n $list->setFirst();\n while( $entry = $list->getNext() ) {\n $entry->deleteEntry();\n }\n \n parent::deleteEntry();\n \n }",
"public static function deleteGroup() {\n $result = array();\n $deleted = lC_Product_variants_Admin::delete($_GET['pvid']);\n if ($deleted) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }",
"protected function deleteChildren() {}",
"function delete_group_videos($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_del_grp_vdos\"));\n else {\n $db->delete(tbl($this->gp_vdo_tbl), array(\"group_id\"), array($gid));\n e(lang(\"vdo_multi_del_erro\"), \"m\");\n }\n }",
"function group_del_group($parent,$child){\n\n //find the parent dn\n $parent_group=$this->group_info($parent,array(\"cn\"));\n if ($parent_group[0][\"dn\"]==NULL){ return (false); }\n $parent_dn=$parent_group[0][\"dn\"];\n \n //find the child dn\n $child_group=$this->group_info($child,array(\"cn\"));\n if ($child_group[0][\"dn\"]==NULL){ return (false); }\n $child_dn=$child_group[0][\"dn\"];\n \n $del=array();\n $del[\"member\"] = $child_dn;\n \n $result=@ldap_mod_del($this->_conn,$parent_dn,$del);\n if ($result==false){ return (false); }\n return (true);\n }",
"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 actionLeft_from_group() {\n if (isset($_REQUEST['groupId']) && isset($_REQUEST['userToRemove'])) {\n $group = Group::findGroup(intval($_REQUEST['groupId']));\n $thisUser = Yii::$app->user->identity;\n $userId = intval($_REQUEST['userToRemove']);\n $userToRemove = User::findIdentity($userId);\n\n if( $thisUser->id == $group->owner) {\n Group::removeGroupById($group->id);\n return json_encode(['success'=>true]);\n }\n elseif($thisUser->id == $userId){\n if($userToRemove != null){\n $group->removeUserFromGroupById($userId);\n return json_encode(['success'=>true]);\n }\n }\n }\n return json_encode(['success'=>false]);\n }",
"public function destroy($id)\n\t{\n\t\t// get the group and the userid\n\t\t$group = Group::find($id);\n\t\t$userid = Auth::id();\n\n\t\t// log the request\n\t\tLog::info('Group deletion attempt', array(\n\t\t\t'userid' => $userid,\n\t\t\t'groupid' => $id\n\t\t));\n\n\t\t// check the user is the owner\n\t\tif (!$group -> isOwner($userid)) {\n\t\t\tLog::info('Authenticated user is not owner');\n\t\t\tReturn Response::json(array(\n\t\t\t\t'failure' => 'Authenticated user is not owner'\n\t\t\t), 401);\n\t\t} \n\t\t\n\t\t// check there are no documents in the group\n\t\telse if ($group -> numberOfDocuments() != 0) {\n\t\t\tLog::info('Number of documents not zero');\n\t\t\tReturn Response::json(array(\n\t\t\t\t'failure' => 'Number of documents not zero'\n\t\t\t), 400);\n\t\t} \n\n\t\t// the user is the owner and the group is empty, remove all \n\t\t// users and delete the group\n\t\telse {\n\t\t\tLog::info('Group ' . $id . ' deleted');\n\t\t\t$group -> delete();\n\t\t}\n\t}",
"public function delete()\r\n\t{\r\n\t\t$this->auth->restrict('Banner.Content.Delete');\r\n\r\n\t\t$id = $this->uri->segment(6);\r\n\r\n\t\tif (!empty($id))\r\n\t\t{\r\n\r\n\t\t\tif ($this->banner_group_model->delete($id))\r\n\t\t\t{\r\n\t\t\t\t// Log the activity\r\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('banner_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'banner');\r\n \r\n // Delete all banner in the group\r\n\t\t\t\t$this->banner_model->delete_where(array('banner.group_id' => $id));\r\n \r\n\t\t\t\tTemplate::set_message(lang('banner_delete_success'), 'success');\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tTemplate::set_message(lang('banner_delete_failure') . $this->banner_group_model->error, 'error');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tredirect(SITE_AREA .'/content/banner/groups');\r\n\t}",
"protected function validateDelete() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canDeleteUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups(array_keys($this->objects));\r\n\t}"
] | [
"0.7309016",
"0.7189372",
"0.7019656",
"0.7003522",
"0.6992807",
"0.6908704",
"0.69075",
"0.6874594",
"0.6864696",
"0.6840422",
"0.6818331",
"0.6803001",
"0.6788614",
"0.6788448",
"0.67875534",
"0.67852354",
"0.67308295",
"0.67292714",
"0.6700311",
"0.66999066",
"0.66378796",
"0.6614447",
"0.66097724",
"0.65994745",
"0.659782",
"0.65694475",
"0.6523548",
"0.6518544",
"0.6510263",
"0.6508262",
"0.6504734",
"0.6501164",
"0.6498554",
"0.649071",
"0.6485707",
"0.6444617",
"0.6420998",
"0.63939965",
"0.6390631",
"0.6385696",
"0.6381351",
"0.6369295",
"0.63653684",
"0.6354189",
"0.6344098",
"0.63432205",
"0.63401514",
"0.6330781",
"0.6328901",
"0.63195926",
"0.63084286",
"0.63064647",
"0.6296485",
"0.62939024",
"0.62908936",
"0.62779146",
"0.6234547",
"0.6222",
"0.62192214",
"0.6200746",
"0.6199857",
"0.6194211",
"0.6183544",
"0.61773664",
"0.6162604",
"0.61547613",
"0.61520445",
"0.6144058",
"0.6137512",
"0.6134113",
"0.61252075",
"0.61172837",
"0.60952586",
"0.6092473",
"0.6070089",
"0.6064407",
"0.6063853",
"0.60383976",
"0.60303855",
"0.60277504",
"0.6025421",
"0.6017626",
"0.60121506",
"0.6010331",
"0.6010331",
"0.6005656",
"0.6003439",
"0.59902614",
"0.5980729",
"0.59803045",
"0.5959961",
"0.59569114",
"0.5956144",
"0.59559286",
"0.59487146",
"0.59481883",
"0.5947986",
"0.5946897",
"0.5940929",
"0.5940538"
] | 0.7353069 | 0 |
prevent users from being invited to subgroups they can't join | function au_subgroups_group_invite($hook, $type, $return, $params) {
$user_guid = get_input('user_guid');
$group_guid = get_input('group_guid');
$group = get_entity($group_guid);
$parent = au_subgroups_get_parent_group($group);
// if $parent, then this is a subgroup they're being invited to
// make sure they're a member of the parent
if ($parent) {
if (!is_array($user_guid)) {
$user_guid = array($user_guid);
}
$invalid_users = array();
foreach($user_guid as $guid) {
$user = get_user($guid);
if ($user && !$parent->isMember($user)) {
$invalid_users[] = $user;
}
}
if (count($invalid_users)) {
$error_suffix = "<ul>";
foreach($invalid_users as $user) {
$error_suffix .= "<li>{$user->name}</li>";
}
$error_suffix .= "</ul>";
register_error(elgg_echo('au_subgroups:error:invite') . $error_suffix);
return false;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function usergroupConditionDoesNotMatchDefaulUserGroupIds() {}",
"public function UserIsMemberOfGroupAdminOrDie() {\n\t\t\n\t\t// User must be member of group adm or die\n\t\tif($_SESSION['groupMemberUser'] != 'adm') \n\t\t\tdie('You do not have the authourity to access this page');\n\t}",
"function del_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tremove_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}",
"function lobby_membersapi_reject($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\t$group = $args['group'];\r\n\t$gid = (int)$group['id'];\r\n\tif (!($uid > 1) || !($gid > 0)) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_REJECT_MEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// get Group\r\n\t \t$table \t\t= pnDBGetTables();\r\n\t \t$column\t\t= $table['lobby_members_pending_column'];\r\n\t \t$where\t\t= $column['uid'].\" = \".$uid.\" AND \".$column['gid'].\" = \".$gid;\r\n\t\t$result\t\t= DBUtil::selectObjectArray('lobby_members_pending',$where);\r\n\t\t$obj = $result[0];\r\n\t\t$result = DBUtil::deleteObject($obj,'lobby_members_pending');\r\n\t\tif ($result) {\r\n\t\t\tLogUtil::registerStatus(_LOBBY_MEMBERSHIP_REQUEST_REJECTED);\r\n\t\t\t// send Mail\r\n\t\t\tLoader::includeOnce('modules/lobby/includes/common_email.php');\r\n\t\t\tlobby_notify_rejectmembershiprequest($group,$uid);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t \tLogUtil::registerError(_LOBBY_MEMBERSHIP_REJECT_ERROR);\r\n\t\t \treturn false;\r\n\t\t}\r\n\t}\r\n}",
"public function abort()\n {\n $user = Auth::user();\n\n // Check if has not group throw forbidden\n if ($user->role_id != 1) \n return App::abort(403);\n\n }",
"public function elevatePremissions() {\n\t\tif($user->group == 'USR'){\n\t\t\t$user->group = \"ROOT\";\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('This user group cannot elevate permissions');\n\t\t}\n\t}",
"public function enableUserAndGroupSupport(){\n\t\treturn false;\n\t}",
"function checkIfDesacivable($memberOf, $refusedGroup=\"\"){\n $blacklisted = FALSE;\n foreach ($memberOf as $group) {\n if ($group == $refusedGroup){\n $blacklisted = TRUE;\n }\n }\n return $blacklisted;\n}",
"public function adminUserConditionDoesNotMatchRegularUser() {}",
"function getUsersNotInGroup() {\n\n\tglobal $db;\n\treturn $db->getUsersNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"function add_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tadd_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}",
"public function allowedToSubmitSubordinateOvertime()\n { return (($this->esgrp != 'ES') && ($this->esgrp != 'EF') && ($this->esgrp != 'F')) ? true : false;\n }",
"function stop_members_from_renewing($okay)\n{\n global $current_user;\n // If something else isn't okay, stop from running this code further.\n if (!$okay) {\n return $okay;\n }\n // If the user doesn't have a membership level carry on with checkout.\n if (!pmpro_hasMembershipLevel()) {\n return true;\n }\n // Check if the user's current membership level is the same for checking out.\n if (pmpro_hasMembershipLevel($_REQUEST['level'])) { // Change level ID to a different level.\n pmpro_setMessage('This is your current membership level. Please select a different membership level.', 'pmpro_error');\n return false;\n }\n if (PMPro_Alveoles::has_commitment_level()) {\n $user_id = $current_user->ID;\n $membership_levels = pmpro_getMembershipLevelsForUser( $user_id );\n /** @var PMPro_Membership_Level $level */\n foreach ($membership_levels as $l) {\n if (PMPro_Alveoles::is_with_commitment($l->ID)) {\n if ($date = PMPro_Alveoles::contracted($l->ID)) { //still engaged\n pmpro_setMessage(PMPro_Alveoles::getContractedMessage($date,$l->ID), 'pmpro_error');\n return false;\n }\n }\n }\n }\n return true;\n}",
"function inviteGroup($group_id)\n\t\t{\n\t\t\tglobal $ilAccess;\n\t\t\t$invited = 0;\n\t\t\tinclude_once \"./Modules/Group/classes/class.ilObjGroup.php\";\n\t\t\t$group = new ilObjGroup($group_id);\n\t\t\t$members = $group->getGroupMemberIds();\n\t\t\tforeach ($members as $user_id)\n\t\t\t{\n\t\t\t\tif ($ilAccess->checkAccessOfUser($user_id, \"read\", \"\", $this->getRefId(), \"svy\", $this->getId()))\n\t\t\t\t{\n\t\t\t\t\t$this->inviteUser($user_id);\n\t\t\t\t\tif ($this->getInvitation() == self::INVITATION_ON)\n\t\t\t\t\t{\n\t\t\t\t\t\tinclude_once './Services/User/classes/class.ilObjUser.php';\n\t\t\t\t\t\tilObjUser::_addDesktopItem($user_id, $this->getRefId(), \"svy\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $invited;\n\t\t}",
"function email_choose_users_to_send($courseid, $roleid, $currentgroup) {\n\n\tglobal $CFG, $USER;\n\n\tif (! $course = get_record('course', 'id', $courseid) ) {\n print_error('invalidcourseid', 'block_email_list');\n }\n\n\t// Prepare users to choose us\n\tif ( $courseid ) {\n\n\t\tif ($course->id == SITEID) {\n\t $context = get_context_instance(CONTEXT_SYSTEM, SITEID); // SYSTEM context\n\t } else {\n\t $context = get_context_instance(CONTEXT_COURSE, $course->id); // Course context\n\t }\n\n\t\t// Security issue\n\t $sitecontext = get_context_instance(CONTEXT_SYSTEM);\n\t $frontpagectx = get_context_instance(CONTEXT_COURSE, SITEID);\n\n\t if ($context->id != $frontpagectx->id) {\n\t require_capability('moodle/course:viewparticipants', $context);\n\t } else {\n\t require_capability('moodle/site:viewparticipants', $sitecontext);\n\t }\n\n\t\t$rolesnames = array();\n \t$avoidroles = array();\n\n\t if ($roles = get_roles_used_in_context($context, true)) {\n\t $canviewroles = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context);\n\t $doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext);\n\n\t if ( ! $CFG->email_add_admins ) {\n\t \t$adminsroles = get_roles_with_capability('moodle/legacy:admin', CAP_ALLOW, $sitecontext);\n\t }\n\n\t foreach ($roles as $role) {\n\t if (!isset($canviewroles[$role->id])) { // Avoid this role (eg course creator)\n\t $avoidroles[] = $role->id;\n\t unset($roles[$role->id]);\n\t continue;\n\t }\n\t if (isset($doanythingroles[$role->id])) { // Avoid this role (ie admin)\n\t $avoidroles[] = $role->id;\n\t unset($roles[$role->id]);\n\t continue;\n\t }\n\n\t if ( ! $CFG->email_add_admins ) {\n\t \tif (isset($adminsroles[$role->id])) { // Avoid this role (ie admin)\n\t\t $avoidroles[] = $role->id;\n\t\t unset($roles[$role->id]);\n\t\t continue;\n\t\t }\n\t }\n\n\t // Prevent - CONTRIB-609\n\t \tif ( function_exists('role_get_name') ) {\n\t \t\t$rolenames[$role->id] = strip_tags(role_get_name($role, $context)); // Used in menus etc later on\n\t \t} else {\n\t \t\t$rolenames[$role->id] = strip_tags(format_string($role->name)); // Used in menus etc later on\n\t \t}\n\n\t }\n\t }\n\n\t // we are looking for all users with this role assigned in this context or higher\n\t if ($usercontexts = get_parent_contexts($context)) {\n\t $listofcontexts = '('.implode(',', $usercontexts).')';\n\t } else {\n\t $listofcontexts = '('.$sitecontext->id.')'; // must be site\n\t }\n\t if ($roleid) {\n\t $selectrole = \" AND r.roleid = $roleid \";\n\t } else {\n\t $selectrole = \" \";\n\t }\n\n\t if ($context->id != $frontpagectx->id) {\n\t $select = 'SELECT DISTINCT u.id, u.username, u.firstname, u.lastname ';\n\t } else {\n\t $select = 'SELECT u.id, u.username, u.firstname, u.lastname ';\n\t }\n\n\t if ($context->id != $frontpagectx->id) {\n\t $from = \"FROM {$CFG->prefix}user u\n\t LEFT OUTER JOIN {$CFG->prefix}context ctx\n\t ON (u.id=ctx.instanceid AND ctx.contextlevel = \".CONTEXT_USER.\")\n\t JOIN {$CFG->prefix}role_assignments r\n\t ON u.id=r.userid\n\t LEFT OUTER JOIN {$CFG->prefix}user_lastaccess ul\n\t ON (r.userid=ul.userid and ul.courseid = $course->id) \";\n\t } else {\n\t $from = \"FROM {$CFG->prefix}user u\n\t LEFT OUTER JOIN {$CFG->prefix}context ctx\n\t ON (u.id=ctx.instanceid AND ctx.contextlevel = \".CONTEXT_USER.\") \";\n\n\t }\n\n\t\t$hiddensql = has_capability('moodle/role:viewhiddenassigns', $context)? '':' AND r.hidden = 0 ';\n\n\t // exclude users with roles we are avoiding\n\t if ($avoidroles) {\n\t $adminroles = 'AND r.roleid NOT IN (';\n\t $adminroles .= implode(',', $avoidroles);\n\t $adminroles .= ')';\n\t } else {\n\t $adminroles = '';\n\t }\n\n\t // join on 2 conditions\n\t // otherwise we run into the problem of having records in ul table, but not relevant course\n\t // and user record is not pulled out\n\n\t if ($context->id != $frontpagectx->id) {\n\t $where = \"WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts)\n\t AND u.deleted = 0 $selectrole\n\t AND (ul.courseid = $course->id OR ul.courseid IS NULL)\n\t AND u.username != 'guest'\n\t $adminroles\n\t $hiddensql \";\n\t } else {\n\t $where = \"WHERE u.deleted = 0\n\t AND u.username != 'guest'\";\n\t }\n\n\t if ($currentgroup and $course->groupmode != 0) { // Displaying a group by choice\n\t $from .= 'LEFT JOIN '.$CFG->prefix.'groups_members gm ON u.id = gm.userid ';\n\n\t // $currentgroup can be an array of groups id\n\t if (is_array($currentgroup)) {\n\t $where .= ' AND gm.groupid IN ('.implode(',', $currentgroup).') ';\n\t } else {\n\t if ($currentgroup == 0) {\n\t if (!has_capability('block/email_list:viewallgroups', $context) && $COURSE->groupmode == 1) {\n\t $groupids = groups_get_groups_for_user($USER->id, $COURSE->id);\n\t $where .= 'AND gm.groupid IN ('.implode(',', $groupids).')';\n\t }\n\t } else {\n\t $where .= 'AND gm.groupid = '.$currentgroup;\n\t }\n\t }\n\n\t $where .= ' AND gm.groupid = '.$currentgroup;\n\t }\n\n\t $sort = ' ORDER BY u.firstname, u.lastname';\n\n\t\t$userlist = get_records_sql($select.$from.$where.$sort);\n\n\n\t if ( $userlist ) {\n\t\t\tforeach ($userlist as $user) {\n\t \t$unselectedusers[$user->id] = addslashes(fullname($user, has_capability('moodle/site:viewfullnames', $context)));\n\t }\n\t }\n\n\t /// If there are multiple Roles in the course, then show a drop down menu for switching\n\t if (count($rolenames) > 1) {\n\t echo '<div class=\"rolesform\">';\n\t echo get_string('currentrole', 'role').': ';\n\t $rolenames = array(0 => get_string('all')) + $rolenames;\n\t popup_form(\"$CFG->wwwroot/blocks/email_list/email/participants.php?id=$courseid&group=$currentgroup&contextid=$context->id&roleid=\", $rolenames,\n\t 'rolesform', $roleid, '');\n\t echo '</div>';\n\t }\n\n\t // Prints group selector for users with a viewallgroups capability if course groupmode is separate\n\t echo '<br />';\n\t\tgroups_print_course_menu($course, $CFG->wwwroot.'/blocks/email_list/email/participants.php?id='.$course->id);\n\t\techo '<br /><br />';\n\t}\n\n // Prepare tags\n $straddusersto = get_string('addusersto', 'block_email_list');\n $stradduserscc = get_string('cc', 'block_email_list');\n $straddusersbcc = get_string('bcc', 'block_email_list');\n $stradd = get_string('ok');\n $strto = get_string('to', 'block_email_list');\n $strcc = get_string('cc', 'block_email_list');\n $strbcc = get_string('bcc', 'block_email_list');\n $strselectedusersremove = get_string('selectedusersremove', 'block_email_list');\n $straction = get_string('selectaction', 'block_email_list');\n $strcancel = get_string('cancel');\n\n\t// Create an object for define parametrer\n\t$options = new stdClass();\n\t$options->id = $courseid;\n\t// Prepare url\n\t$toform = email_build_url($options, true);-\n\n\t$url = $CFG->wwwroot.'/blocks/email_list/email/sendmail.php';\n\n\tif ( $options ) {\n\t\t$urlhtml = email_build_url($options);\n\t}\n\n include_once('participants.html');\n\n}",
"function groups_get_users_not_in_group_by_role($courseid, $groupid, $searchtext='', $sort = 'u.lastname ASC') {\n\n global $CFG;\n $context = get_context_instance(CONTEXT_COURSE, $courseid);\n\n if ($searchtext !== '') { // Search for a subset of remaining users\n $LIKE = sql_ilike();\n $FULLNAME = sql_fullname();\n $wheresearch = \" AND u.id IN (SELECT id FROM {$CFG->prefix}user WHERE $FULLNAME $LIKE '%$searchtext%' OR email $LIKE '%$searchtext%' )\";\n } else {\n $wheresearch = '';\n }\n\n/// Get list of allowed roles \n if(!($validroleids=groups_get_possible_roles($context))) {\n return;\n }\n \n $roleids = '('.implode(',', $validroleids).')';\n\n/// Construct the main SQL\n $select = \" SELECT r.id AS roleid,r.shortname AS roleshortname,r.name AS rolename,\n u.id AS userid, u.firstname, u.lastname\";\n $from = \" FROM {$CFG->prefix}user u\n INNER JOIN {$CFG->prefix}role_assignments ra ON ra.userid = u.id\n INNER JOIN {$CFG->prefix}role r ON r.id = ra.roleid\";\n\n $where = \" WHERE ra.contextid \".get_related_contexts_string($context).\"\n AND u.deleted = 0\n AND ra.roleid in $roleids\n AND u.id NOT IN (SELECT userid\n FROM {$CFG->prefix}groups_members\n WHERE groupid = $groupid)\n $wheresearch\";\n $orderby = \" ORDER BY $sort\";\n\n return groups_calculate_role_people(get_recordset_sql(\n $select.$from.$where.$orderby),$context);\n}",
"private static function accept($args, $invite, $auth) {\n // insert a groups_users record\n $values = array(\n 'group_id'=>$invite['group_id'],\n 'user_id'=>hostsite_get_user_field('indicia_user_id'),\n 'administrator' => 'f'\n );\n $auth['write_tokens']['persist_auth']=true;\n $s = submission_builder::build_submission($values, array('model' => 'groups_user'));\n $r = data_entry_helper::forward_post_to('groups_user', $s, $auth['write_tokens']);\n // either a success, or already a member (2004=unique key violation)\n if (!isset($r['success']) && (!isset($r['code']) || $r['code']!==2004)) {\n // @todo Unique constraint needs to be added to groups_users\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to accept an invite: '.print_r($r, true));\n return self::fail_message('An internal error occurred whilst trying to accept the invite', $args);\n } elseif (isset($r['code']) && $r['code']===2004) {\n hostsite_show_message(lang::get(\n 'There is no need to accept this invitation as you are already a member of {1}.', $invite['group_title']));\n hostsite_goto_page($args['groups_page_path']);\n } else {\n // delete the invitation\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n $group = data_entry_helper::get_population_data(array(\n 'table' => 'group',\n 'extraParams' => $auth['read'] + array('id'=>$invite['group_id'])\n ));\n if (!isset($r['success'])) {\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to delete an accepted invite: '.print_r($r, true));\n // probably no point telling the user, as the invite accept worked OK\n }\n hostsite_goto_page($args['group_home_path'], array('group_id'=>$invite['group_id']));\n module_load_include('inc', 'iform', 'iform.groups');\n return iform_show_group_join_success($group[0], $auth, true, $args['group_home_path'], $args['group_page_path']);\n }\n return '';\n }",
"function check_and_add_to_group($userid, $group_id)\r\n{\r\n if ( !BP_Groups_Member::check_is_member( $userid, $group_id ) ) {\r\n // make sure the user isn't banned from the group!\r\n if ( !groups_is_user_banned( $userid, $group_id ) ) {\r\n // add the group already!\r\n $user_id = $userid;\r\n\r\n if ( groups_check_user_has_invite( $user_id, $group_id ) ) {\r\n groups_delete_invite( $user_id, $group_id );\r\n }\r\n\r\n $new_member = new bp_groups_member;\r\n $new_member->group_id = $group_id;\r\n $new_member->inviter_id = 0;\r\n $new_member->user_id = $user_id;\r\n $new_member->is_admin = 0;\r\n $new_member->user_title = '';\r\n $new_member->date_modified = time();\r\n $new_member->is_confirmed = 1;\r\n\r\n if ( !$new_member->save() ) {\r\n return false;\r\n }\r\n\r\n // Should I add this to the activity stream? left off for now\r\n\r\n /* Modify group meta */\r\n groups_update_groupmeta( $group_id, 'total_member_count', (int) groups_get_groupmeta( $group_id, 'total_member_count') + 1 );\r\n groups_update_groupmeta( $group_id, 'last_activity', time() );\r\n }\r\n }\r\n\r\n return false;\r\n}",
"private function _invited()\n {\n // Check we're not over-joined\n if (count($this->_currentChannels) < $this->_maxChannels)\n {\n $this->setChannels($this->_data->message);\n $this->_irc->join($this->_data->message);\n }\n else {\n $this->_privmessage(\n 'Sorry, I\\'m already in too many channels.', \n $this->_data->nick\n );\n }\n }",
"function invite_member($user, $gid, $owner = NULL) {\n global $cbemail, $db, $userquery;\n $group = $this->get_group_details($gid);\n\n if (!$owner)\n $owner = userid();\n\n $sender = $userquery->get_user_details($owner);\n $reciever = $userquery->get_user_details($user);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (!$sender)\n e(lang(\"unknown_sender\"));\n elseif (!$reciever)\n e(lang(\"unknown_reciever\"));\n elseif ($this->is_member($user, $gid))\n e(lang(\"user_already_group_mem\"));\n elseif ($owner != $group['userid'])\n e(lang(\"grp_owner_err1\"));\n else {\n //Inserting Invitation Code in database\n $db->insert(tbl($this->gp_invite_tbl), array('group_id', 'userid', 'invited', 'date_added'), array($gid, $owner, $reciever['userid'], now()));\n e(lang(\"grp_inv_msg\"), \"m\");\n\n //Now Sending Email To User\n $tpl = $cbemail->get_template('group_invitation');\n\n $more_var = array\n (\n '{reciever}' => $reciever['username'],\n '{sender}' => $sender['username'],\n '{group_url}' => group_link(array('details' => $group)),\n '{group_name}' => $group['group_name'],\n '{group_description}' => $group['group_description']\n );\n\n if (!is_array($var))\n $var = array();\n $var = array_merge($more_var, $var);\n $subj = $cbemail->replace($tpl['email_template_subject'], $var);\n $msg = nl2br($cbemail->replace($tpl['email_template'], $var));\n //Now Finally Sending Email\n cbmail(array('to' => $reciever['email'], 'from' => WEBSITE_EMAIL, 'subject' => $subj, 'content' => $msg));\n }\n }",
"public function restrict_joining_group( $button ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $button;\n\n\t\t\t// Check if user has enough to join group\n\t\t\t$cost = abs( $this->prefs['join']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $button;\n\n\t\t}",
"function ProcessInvites () {\n global $zLOCALUSER;\n\n global $gINVITES, $gSITEDOMAIN;\n global $gINVITINGUSER, $gGROUPFULLNAME, $gGROUPURL;\n global $gGROUPINVITEACTION, $gGROUPINVITEUSERNAME, $gGROUPINVITEDOMAIN;\n\n // Loop through the action list.\n foreach ($gGROUPINVITEACTION as $count => $action) {\n $username = $gGROUPINVITEUSERNAME[$count];\n $domain = $gGROUPINVITEDOMAIN[$count];\n switch ($action) {\n case GROUP_ACTION_REMOVE:\n $USER = new cOLDUSER ();\n $USER->Select (\"Username\", $username);\n $USER->FetchArray ();\n if ($USER->uID != $this->userAuth_uID) {\n //$this->Leave ($username, $domain);\n } // if\n unset ($USER);\n break;\n } // switch\n } // foreach\n\n $gINVITINGUSER = $zLOCALUSER->userProfile->GetAlias ();\n $gGROUPFULLNAME = $this->Fullname;\n $groupaddress = $this->Name . '@' . $gSITEDOMAIN;\n $gGROUPURL = \"!##asd group='$groupaddress' /##!\";\n\n $invitelist = explode (',', $gINVITES);\n foreach ($invitelist as $id => $address) {\n list ($username, $domain) = explode ('@', $address);\n\n $checkcriteria = array (\"groupInformation_tID\" => $this->tID,\n \"Username\" => $username,\n \"Domain\" => $domain);\n $this->groupMembers->SelectByMultiple ($checkcriteria);\n if ($this->groupMembers->CountResult () > 0) {\n // User is already in the list. Continue.\n continue;\n } // if\n $this->groupMembers->Username = $username;\n $this->groupMembers->Domain = $domain;\n $this->groupMembers->groupInformation_tID = $this->tID;\n $this->groupMembers->Verification = GROUP_VERIFICATION_INVITED;\n $this->groupMembers->Stamp = SQL_NOW;\n $this->groupMembers->Add ();\n \n // NOTE: Message shouldn't use globals for recipients.\n $MESSAGE = new cMESSAGE ();\n\n global $gRECIPIENTNAME, $gRECIPIENTDOMAIN, $gRECIPIENTADDRESS;\n $gRECIPIENTNAME = $username;\n $gRECIPIENTDOMAIN = $domain;\n $gRECIPIENTADDRESS = $gRECIPIENTNAME . '@' . $gRECIPIENTDOMAIN;\n \n global $gSUBJECT, $gBODY;\n $gBODY = __(\"Group Invite Body\", array ( \"name\" => $gRECIPIENTNAME, \"domain\" => $gRECIPIENTDOMAIN, \"address\" => $gRECIPIENTADDRESS ) );\n $gBODY = str_replace (\"!##\", \"<\", $gBODY);\n $gBODY = str_replace (\"##!\", \">\", $gBODY);\n $gSUBJET = __(\"Group Invite Subject\", array ( \"name\" => $gRECIPIENTNAME) );\n $MESSAGE->Send ($zLOCALUSER->Username);\n unset ($MESSAGE);\n } // foreach\n\n $this->Message = __(\"User Invited To Group\");\n $this->Error = 0;\n\n return (TRUE);\n\n }",
"public static function acceptMembershipRequests(\\Elgg\\Event $event): void {\n\t\t$entity = $event->getObject();\n\t\tif (!$entity instanceof \\ElggGroup || !$entity->canEdit()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (elgg_get_plugin_setting('auto_accept_membership_requests', 'group_tools') !== 'yes') {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!$entity->isPublicMembership()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// just in case\n\t\tset_time_limit(0);\n\t\t\n\t\t// get pending requests\n\t\t/* @var $pending_requests \\ElggBatch */\n\t\t$pending_requests = $entity->getEntitiesFromRelationship([\n\t\t\t'type' => 'user',\n\t\t\t'relationship' => 'membership_request',\n\t\t\t'inverse_relationship' => true,\n\t\t\t'limit' => false,\n\t\t\t'batch' => true,\n\t\t\t'batch_inc_offset' => false,\n\t\t]);\n\t\t/* @var $requesting_user \\ElggUser */\n\t\tforeach ($pending_requests as $requesting_user) {\n\t\t\t// join the group\n\t\t\tif (!$entity->join($requesting_user)) {\n\t\t\t\t$pending_requests->reportFailure();\n\t\t\t}\n\t\t}\n\t}",
"function isGroupAdmin($authorisers)\r\n{\r\n if ($authorisers == 999 || $authorisers == 0)\r\n return false;\r\n\r\n\treturn in_array($authorisers, $GLOBALS['group_membership']) \r\n\t\t\t|| \r\n\t\t\t\tin_array(2, $GLOBALS['group_membership']);\r\n}",
"final public function addItemGroupWithoutSupervisor() {\n\n if (!empty($this->target_object)) {\n foreach ($this->target_object as $val) {\n if ($val->fields['groups_id'] > 0) {\n $this->addForGroup(2, $val->fields['groups_id']);\n }\n }\n }\n }",
"public function validateAdminUserAction()\n {\n $id = $this->_request->getParam('user_id');\n if ($id) {\n $limited = $this->_collectionsFactory->create()->getUsersOutsideLimitedScope(\n $this->_role->getIsAll(),\n $this->_role->getWebsiteIds(),\n $this->_role->getStoreGroupIds()\n );\n\n if (in_array($id, $limited)) {\n $this->_forward();\n return false;\n }\n }\n return true;\n }",
"function updateMemberGroup()\n {\n // ------------------------------------\n // Only super admins can administrate member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1) {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n $edit = (bool) Request::has('group_id');\n\n $group_id = Request::input('group_id');\n $clone_id = Request::input('clone_id');\n\n unset($_POST['group_id']);\n unset($_POST['clone_id']);\n\n // No group name\n if ( ! Request::input('group_name')) {\n return Cp::errorMessage(__('members.missing_group_name'));\n }\n\n $return = (Request::has('return'));\n\n $site_ids = [];\n $plugin_ids = [];\n $weblog_ids = [];\n $template_ids = [];\n\n // ------------------------------------\n // Remove and Store Weblog and Template Permissions\n // ------------------------------------\n\n $data = [\n 'group_name' => Request::input('group_name'),\n 'group_description' => Request::input('group_description'),\n ];\n\n $duplicate = DB::table('member_groups')\n ->where('group_name', $data['group_name']);\n\n if (!empty($group_id)) {\n $duplicate->where('group_id', '!=', $group_id);\n }\n\n if($duplicate->count() > 0) {\n return Cp::errorMessage(__('members.duplicate_group_name'));\n }\n\n // ------------------------------------\n // Preferences\n // ------------------------------------\n\n $preferences['group_id'] = $group_id;\n $preferences['is_locked'] = Request::input('is_locked');\n\n foreach(static::$group_preferences as $group => $prefs) {\n foreach((array) $prefs as $key => $default) {\n if (Request::has($key)) {\n $preferences[$key] = Request::get($key);\n }\n }\n }\n\n foreach (Request::all() as $key => $val)\n {\n if (substr($key, 0, strlen('weblog_id_')) == 'weblog_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('plugin_name_')) == 'plugin_name_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_offline_site_id_')) == 'can_access_offline_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_cp_site_id_')) == 'can_access_cp_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } else {\n continue;\n }\n }\n\n if ($edit === false)\n {\n $group_id = DB::table('member_groups')->insertGetId($data);\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $uploads = DB::table('upload_prefs')\n ->select('id')\n ->get();\n\n foreach($uploads as $yeeha)\n {\n DB::table('upload_no_access')\n ->insert(\n [\n 'upload_id' => $yeeha->id,\n 'upload_loc' => 'cp',\n 'member_group' => $group_id\n ]);\n }\n\n $message = __('members.member_group_created').' '.$_POST['group_name'];\n }\n else\n {\n DB::table('member_groups')\n ->where('group_id', $data['group_id'])\n ->update($data);\n\n DB::table('member_group_preferences')\n ->where('group_id', $data['group_id'])\n ->delete();\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $message = __('members.member_group_updated').' '.$_POST['group_name'];\n }\n\n // Update CP log\n Cp::log($message);\n\n $this->clearMemberGroupCache($data['group_id']);\n\n if ($return == true) {\n return $this->member_group_manager($message);\n }\n\n return $this->editMemberGroup($message, $group_id);\n }",
"function allowed() {\n $this->model('invitation');\n \n if ($_SESSION['user']->guest) {\n $sql = \"SELECT * FROM invitations WHERE id = {$_SESSION['user']->id}\";\n $invite = $this->invitation->one($sql);\n if (!$invite) {\n $this->message('Ungültige Einladung');\n unset($_SESSION['user']);\n $this->redirect('/');\n }\n \n if ($_SESSION['user']->object_type == 'topic') { \n if (count($this->path) < 3) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n $photo_id = $this->path[2];\n \n $sql = \"SELECT * FROM photos WHERE id = {$photo_id} LIMIT 1\";\n $photo = $this->photo->one($sql);\n if (!$photo) {\n $this->message('FALSCHE URL');\n return FALSE;\n }\n \n if ($photo->topic_id != $_SESSION['user']->object_id) {\n $this->message('Sie haben kein Zugriff auf diese Inhalte');\n return FALSE;\n }\n \n return TRUE;\n }\n }\n return parent::allowed();\n }",
"function projectsNotInGroup() {\n\n\tglobal $db;\n\treturn $db->projectsNotInGroup ( $GLOBALS [\"targetId\"] );\n\n}",
"public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}",
"function userIsInGroup($user, $gid, $subgroups = true)\n {\n return false;\n }",
"private function __allowSuperAdminOnly() {\n\t\t$isSuperAdmin = $this->_isSuperAdmin();\n\t\tif ($isSuperAdmin === false) {\n\t\t\t$this->redirect('/admin/users/accessDenied');\n\t\t}\n\t}",
"function hook_roomify_rights_group_alter(&$permissions) {\n // Remove permission 'add member' for group_manager users.\n unset($permissions['group_manager']['add member']);\n}",
"public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"public function test_get_messages_all_with_group_restriction_support() {\n global $COURSE, $SESSION;\n\n $this->setUser($this->user->id);\n $COURSE->id = $this->course->id;\n\n // Create the generator object.\n $generator = $this->getDataGenerator()->get_plugin_generator('block_news');\n\n // Create news blocks.\n $nblock = $generator->create_instance(array(), array('courseid' => $this->course->id));\n\n // Create 2 news messages in news blocks. Add message to group.\n $message1 = new stdClass();\n $message1id = $generator->create_block_new_message($nblock, $message1, [$this->group1->id]);\n $message2 = new stdClass();\n $message2id = $generator->create_block_new_message($nblock, $message2, [$this->group2->id]);\n\n // Enable group support and call get_messages_all function.\n $bns = system::get_block_settings($nblock->id);\n $bns->set_groupingsupport(2);\n $msgs = $bns->get_messages_all(1);\n\n // When group restriction support is enabled. Return 1 the messages with correct groupid.\n $this->assertEquals(1, count($msgs));\n $this->assertTrue(in_array($this->group1->id, $msgs[0]->get_groupids()));\n\n // When user is removed from groups check restriction works.\n groups_remove_member($this->group1, $this->user);\n groups_remove_member($this->group2, $this->user);\n unset($SESSION->block_news_user_groups);\n $msgs = $bns->get_messages_all(1);\n $this->assertEmpty($msgs);\n }",
"public function test_get_messages_limited_with_group_restriction_support() {\n global $COURSE, $SESSION;\n\n $this->setUser($this->user->id);\n $COURSE->id = $this->course->id;\n // Create the generator object.\n $generator = $this->getDataGenerator()->get_plugin_generator('block_news');\n\n // Create news blocks.\n $nblock = $generator->create_instance(array(), array('courseid' => $this->course->id));\n\n // Create 2 news messages in news blocks. Add message to group.\n $message1 = new stdClass();\n $message1id = $generator->create_block_new_message($nblock, $message1, [$this->group1->id]);\n $message2 = new stdClass();\n $message2id = $generator->create_block_new_message($nblock, $message2, [$this->group2->id]);\n\n // Enable group support and call get_messages_limited function.\n $bns = system::get_block_settings($nblock->id);\n $bns->set_groupingsupport(2);\n $msgs = $bns->get_messages_limited(3);\n\n // When group restriction support is enabled. Return 1 the messages with correct groupid.\n $this->assertEquals(1, count($msgs));\n $this->assertTrue(in_array($this->group1->id, $msgs[0]->get_groupids()));\n\n // When user is removed from groups check restriction works.\n groups_remove_member($this->group1, $this->user);\n groups_remove_member($this->group2, $this->user);\n unset($SESSION->block_news_user_groups);\n $msgs = $bns->get_messages_limited(3);\n $this->assertEmpty($msgs);\n }",
"private static function reject($args, $invite, $auth) {\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n hostsite_show_message(lang::get(\"OK, thanks anyway. We've removed your invitation to join this group.\"));\n hostsite_goto_page($args['groups_page_path']);\n return '';\n }",
"public function accept_join_req($grp_id, $uid, $id)\n\t{\n\t $isLimitExceed = $this->prayer_group_model->checkGroupMaxLimit($this->max_prayer_group, $uid, 'created');\n\t if(!$isLimitExceed){\n\t\t\t $arr = array();\n\t\t\t $where = array('i_prayer_group_id' => $grp_id,\n\t\t\t\t\t\t\t 'i_user_id' => $uid\n\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t \n\t\t\t $arr['s_status']\t = 'accepted';\n\t\t\t $arr['dt_joined_on']\t= get_db_datetime();\n\t\t\t $msgarr\t= array();\n\t\t\t $sender_id = intval(decrypt($this->session->userdata('user_id')));\n\t \n\t\t\t $receiver_id = $uid;\n\t\t\t $msgarr\t= array('s_type'=>'prayer_group_joining', 'i_referred_media_id'=>$grp_id,'i_receiver_id'=>$sender_id);\n\t\t\t \n\t\t\t \n\t\t\t\t ## check if opted for this notification or not ##\n\t\t\t\t\t$notificaion_opt = $this->user_alert_model->check_option_user_id(decrypt($this->session->userdata('user_id')));\t\n\t\t\t\t ## insert noifications ####\n\t\t\t\t if($notificaion_opt['e_prayer_grp_request_accepted'] == 'Y'){\n\t\t\t\t\t $notification_arr['i_requester_id'] = decrypt($this->session->userdata('user_id'));\n\t\t\t\t\t $notification_arr['i_accepter_id'] = $uid;\n\t\t\t\t\t $notification_arr['s_type'] = 'prayer_group_accept_join_request';\n\t\t\t\t\t $notification_arr['dt_created_on'] = get_db_datetime();\n\t\t\t\t\t $ret = $this->user_notifications_model->insert($notification_arr);\t\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t \n\t\t\t $res = $this->prayer_group_model->accept_invitation($where,$arr,$msgarr);\n\t\t\t \n\t\t\t parent::social_notifications_message($sender_id, $uid, 'prayer_group_join_request_accepted_by_owner', $grp_id) ;\n\t\t\t $email_opt = $this->user_alert_model->check_option_email_user_id($uid);\n\t\t\t\t\t\tif($email_opt['e_prayer_grp_request_accepted'] == 'Y' ){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$mail_arr['i_requester_id'] =get_username_by_id(decrypt($this->session->userdata('user_id')));\n\t\t\t\t\t\t$mail_arr['i_accepter_id'] = get_username_by_id($uid);\n\t\t\t\t\t\t$mail_arr['s_type'] = 'e_prayer_grp_request_accepted';\n\t\t\t\t\t\t$mail_arr['group_name']=get_prayer_name_group_by_id($grp_id);\n\t\t\t\t\t\t$mail_id=get_useremail_by_id($uid);\n\t\t\t\t\t\t $this->load->library('email');\n\t\t\t\t\t\t $this->load->helper('html');\n\t\t\t\t\t\t //echo $mail_id;exit;\n\t\t\t\t\t$email_setting = array('mailtype'=>'html','charset' => 'utf-8',\n 'priority' => '1');\n\t\t\t\t\t $body=$this->load->view('logged/my-mail-template.phtml',$mail_arr,TRUE);\n\t\t\t\t\t\t$this->email->initialize($email_setting);\n\t\t\t\t\t\t$this->email->from('[email protected]', 'Team Cogtime');\n\t\t\t\t\t$this->email->to(\"$mail_id\");\n\t\t\t\t\t\t//$this->email->bcc(\"$mailids\");\n\t\t\t\t//$this->email->cc('[email protected]');\n\t\t\t\t\t//$this->email->bcc('[email protected]');\n\t\t\t\t\t$this->email->subject($mail_arr[\"i_requester_id\"].' has accepted your prayer group joining request.');\n\t\t\t\t\t$this->email->message(\"$body\");\n\n\t\t\t\t\t$this->email->send();\n\t\t\t\t\t}\n\t\t\t \n\t\t\t ### adding to prayer group notifiaction table:\n\t\t\t $grp_notification_arr = array();\n\t\t\t \n\t\t\t $grp_notification_arr['i_user_id'] = $uid;\n\t\t\t $grp_notification_arr['i_prayer_group_id'] = $grp_id;\n\t\t\t $grp_notification_arr['s_type'] = 'join';\n\t\t\t $grp_notification_arr['dt_created_on'] = get_db_datetime();\n\t\t\t \n\t\t\t $this->prayer_group_model->insert_group_notifications($grp_notification_arr);\n\t\t\t ### adding to prayer group notifiaction table: \n\t\t\t \n\t\t\t echo json_encode(array('msg'=>'The Prayer group joining request has been accepted successfully.','uid'=>$sender_id));\n\t\t\t exit;\n\t }\n\t\telse{\n\t\t\t $arr = array();\n\t\t\t $where = array('i_prayer_group_id' => $grp_id,\n\t\t\t\t\t\t\t 'i_user_id' => $uid\n\t\t\t\t\t\t\t );\n\t\t\t\t\t\t\t \n\t\t\t $arr['s_status']\t = 'rejected';\n\t\t\t $arr['dt_joined_on']\t= get_db_datetime();\n\t\t\t $msgarr\t= array();\n\t\t\t $sender_id = intval(decrypt($this->session->userdata('user_id')));\n\t \n\t\t\t $receiver_id = $uid;\n\t\t\t $msgarr\t= array('s_type'=>'prayer_group_joining', 'i_referred_media_id'=>$grp_id,'i_receiver_id'=>$sender_id);\n\t\t\t $res = $this->prayer_group_model->accept_invitation($where,$arr,$msgarr);\n\t\t\techo json_encode(array('msg'=>'User have already joined maximum permitted numbers of prayer groups.','uid'=>$sender_id));\n\t\t\texit;\n\t\t}\n\t}",
"public function test_user_cant_decline_not_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $invite = Invite::create([\n 'email' => \"[email protected]\",\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.decline', $invite));\n\n $response->assertStatus(302);\n\n $invites = $user->invites();\n\n $this->assertEquals(3, $invites->count());\n\n }",
"public function testAddGroupUserFailsIfLackingUsers(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group_user();\n }",
"public function enroll_user_to_group(){\n\t\t $users = array();\n\t\t\t$all_checked_request = $_REQUEST['request_id'];\n\t\t\t$group_id = $_REQUEST['group_id'];\n\t\t\t$group_user_limit = get_post_meta($group_id, 'wdm_group_users_limit_'.$group_id, true);\n\t\t\tif($group_user_limit > 0){\n\t\t\t\tforeach($all_checked_request as $request_id){\n\t\t\t\t\t$request_id = (int)$request_id;\n\t\t\t\t\t$request_info = $this->course_request_by_id($request_id);\n\t\t\t\t\t$user_id = (int)$request_info[0]->user_id;\n\t\t\t\t\tld_update_group_access($user_id, $group_id);\n\t\t\t\t\tupdate_user_meta( $user_id, 'learndash_group_users_'.$group_id.'', $group_id );\n\t\t\t\t\t$this->update_course_request($request_id);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function reject_invite($user_id, $group_id)\n {\n\n if (!ctype_digit($group_id)) {\n abort(404);\n }\n if (!ctype_digit($user_id)) {\n abort(404);\n }\n $group = Group::find($group_id);\n $user = User::find($user_id);\n\n $this->authorize('reject_invite', [$group, $user]);\n\n $group->members()->updateExistingPivot($user_id, [\n 'membership_state' => 'rejected',\n ]);\n\n $notification = User::find($user_id)->notifications()->where('group_id', $group_id);\n $notification->delete();\n\n return back();\n }",
"protected function removeGroupMemberships(ElggUser $user) {\n\t\t\n\t\tif (!($user instanceof ElggUser)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$params = array(\n\t\t\t'user' => $user,\n\t\t\t'site' => $this,\n\t\t);\n\t\t$continue = (bool) elgg_trigger_plugin_hook('leave:group_membership', 'site', $params, true);\n\t\tif (!$continue) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$options = array(\n\t\t\t\"relationship\" => \"member\",\n\t\t\t\"relationship_guid\" => $user->getGUID(),\n\t\t\t\"type\" => \"group\",\n\t\t\t\"limit\" => false,\n\t\t\t\"site_guid\" => $this->getGUID()\n\t\t);\n\n\t\t// exclude invited groups\n\t\tglobal $SUBSITE_MANAGER_INVITED_GROUPS;\n\t\tif (!empty($SUBSITE_MANAGER_INVITED_GROUPS)) {\n\t\t\t$options[\"wheres\"] = array(\"e.guid NOT IN (\" . implode(\",\", $SUBSITE_MANAGER_INVITED_GROUPS) . \")\");\n\t\t}\n\n\t\tif ($groups = elgg_get_entities_from_relationship($options)) {\n\t\t\tforeach ($groups as $group) {\n\t\t\t\t$group->leave($user);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function testRemoveGroupUserFailsIfLackingUsers(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_remove_group_user();\n }",
"public function live_groups_members_remove(Request $request) {\n\n Log::info(\"live_groups_members_remove\".print_r($request->all() , true));\n\n try {\n\n $validator = Validator::make($request->all(),\n array(\n 'live_group_id' => 'required|integer|exists:live_groups,id',\n 'member_id' => 'required|integer|exists:users,id',\n ),\n array(\n 'live_group_id.exists' => Helper::error_message(908),\n 'users.exists' => Helper::error_message(910)\n )\n );\n\n if ($validator->fails()) {\n\n $error = implode(',', $validator->messages()->all());\n\n throw new Exception($error, 101);\n \n } else { \n\n $group_details = LiveGroup::where('id',$request->live_group_id)->first();\n\n if(!$group_details) {\n\n throw new Exception(Helper::error_message(908), 908);\n \n }\n\n /**\n | CASE 1: Owner can't remove by their own \n |\n | Case 2: Owner only can remove members to the group and the member themself left from the group\n |\n */\n\n // CASE 1: Owner can't remove by their own \n\n if($request->id == $group_details->user_id && $request->member_id == $group_details->user_id) {\n\n throw new Exception(Helper::error_message(914), 914);\n \n }\n\n // Case 2: Owner only can remove members to the group and the member themself left from the group\n\n if($request->id != $group_details->user_id && $request->id != $request->member_id) {\n\n throw new Exception(Helper::error_message(916), 916);\n \n }\n\n $member_details = User::find($request->member_id);\n\n // Check the member added in the selected group\n\n $group_member_details = LiveGroupMember::where('member_id' , $request->member_id)->where('live_group_id' , $request->live_group_id)->first();\n\n if(!$group_member_details) {\n\n throw new Exception(Helper::error_message(913), 913);\n\n }\n\n if($group_member_details->delete()) {\n\n $response_array = ['success' => true , 'message' => Helper::get_message(134 , $member_details->username ? $member_details->username : \"user\") , 'code' => 134];\n\n } else {\n\n throw new Exception(Helper::error_message(907), 907);\n }\n\n }\n\n return response()->json($response_array,200);\n\n } catch(Exception $e) {\n\n $error_message = $e->getMessage();\n\n $error_code = $e->getCode();\n\n $response_array = ['success'=>false, 'error'=> $error_message , 'error_messages' => $error_message , 'error_code' => $error_code];\n\n return response()->json($response_array);\n\n }\n\n }",
"public function actionLeft_from_group() {\n if (isset($_REQUEST['groupId']) && isset($_REQUEST['userToRemove'])) {\n $group = Group::findGroup(intval($_REQUEST['groupId']));\n $thisUser = Yii::$app->user->identity;\n $userId = intval($_REQUEST['userToRemove']);\n $userToRemove = User::findIdentity($userId);\n\n if( $thisUser->id == $group->owner) {\n Group::removeGroupById($group->id);\n return json_encode(['success'=>true]);\n }\n elseif($thisUser->id == $userId){\n if($userToRemove != null){\n $group->removeUserFromGroupById($userId);\n return json_encode(['success'=>true]);\n }\n }\n }\n return json_encode(['success'=>false]);\n }",
"function userCanChangeEmails( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}",
"public function test_user_cant_accept_not_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $invite = Invite::create([\n 'email' => \"[email protected]\",\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.accept', $invite));\n\n $response->assertStatus(302);\n\n $invites = $user->invites();\n\n $this->assertEquals(3, $invites->count());\n\n }",
"public function checkUserAccess() {\n $conversation = Conversation::find($this->conversation_id);\n if (!$conversation->isConversationMember($this->user_id)) {\n $this->addError('user_id', 'User can\\'t send messages to this conversation.');\n }\n }",
"public function sendGroupInvite(){\n //Gets the other users id\n $otherUserId = $_POST[\"otherUserId\"];\n //Gets the other users information\n $userInfo = $this->individualGroupModel->getUserInfo($otherUserId);\n //Gets the group information\n $groupInfo = $this->individualGroupModel->getGroupInformation($_SESSION['current_group']); \n //Sets the group name\n $groupName = $groupInfo->Group_Name;\n //creates the group request in the table\n $this->individualGroupModel->SendGroupInviteRecord($otherUserId, $userInfo, $groupName);\n\n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n\n }",
"function after_user_activate( $user_id, $user_data, $signup_meta ) {\n $group_id = !empty($_GET['group_id']) ? $_GET['group_id'] : $_POST['group_id'];\n \n if( absint( $group_id ) == $group_id ) {\n ld_update_group_access( $user_id, $group_id );\n }\n}",
"public function isAdmin()\n {\n return $this->group_id === 1;\n }",
"protected function ensureAdminRoleIfRequested() {}",
"function getAdminGroupIds($user_account_team_ids, $permissions){\n\t\n\t$team_ids = [];\n\t\n\tif (auth()->user()->hasRole('superadministrator')){\n\n\t\t$team_ids = $user_account_team_ids;\n\n\t} else {\n\t\t\n\t\tforeach ($user_account_team_ids as $team_id) {\n\t //if permissions is an array\n\t if (is_array($permissions)) {\n\t\t if (auth()->user()->can($permissions, $team_id, true)){\n\t\t\t $team_ids[] = $team_id;\n\t\t\t }\n\t\t\t} else {\n\t\t\t\t//check single permission\n\t\t\t\tif (auth()->user()->can($permissions, $team_id)){\n\t\t\t $team_ids[] = $team_id;\n\t\t\t }\n\t\t\t}\n\t }\n\n\t} \n\n return $team_ids;\n\n}",
"function delete_member_group_conf()\n {\n // ------------------------------------\n // Only super admins can delete member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1)\n {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n\n if ( ! $group_id = Request::input('group_id'))\n {\n return false;\n }\n\n // You can't delete these groups\n\n if (in_array($group_id, $this->no_delete))\n {\n return Cp::unauthorizedAccess();\n }\n\n // Are there any members that are assigned to this group?\n $count = DB::table('members')\n ->where('group_id', $group_id)\n ->count();\n\n $members_exist = (!empty($count)) ? true : false;\n\n $group_name = DB::table('member_groups')\n ->where('group_id', $group_id)\n ->value('group_name');\n\n Cp::$title = __('members.delete_member_group');\n\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem(Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=group_manager', __('admin.member_groups'))).\n Cp::breadcrumbItem(__('members.delete_member_group'));\n\n\n Cp::$body = Cp::formOpen(array('action' => 'C=Administration'.AMP.'M=members'.AMP.'P=delete_mbr_group'.AMP.'group_id='.$group_id))\n .Cp::input_hidden('group_id', $group_id);\n\n Cp::$body .= ($members_exist === TRUE) ? Cp::input_hidden('reassign', 'y') : Cp::input_hidden('reassign', 'n');\n\n\n Cp::$body .= Cp::heading(Cp::quickSpan('alert', __('members.delete_member_group')))\n .Cp::div('box')\n .Cp::quickDiv('littlePadding', '<b>'.__('members.delete_member_group_confirm').'</b>')\n .Cp::quickDiv('littlePadding', '<i>'.$group_name.'</i>')\n .Cp::quickDiv('alert', BR.__('members.cp.action_can_not_be_undone').BR.BR);\n\n if ($members_exist === TRUE)\n {\n Cp::$body .= Cp::quickDiv('defaultBold', str_replace('%x', $count, __('members.member_assignment_warning')));\n\n Cp::$body .= Cp::div('littlePadding');\n Cp::$body .= Cp::input_select_header('new_group_id');\n\n $query = DB::table('member_groups')\n ->select('group_name', 'group_id')\n ->orderBy('group_name')\n ->get();\n\n foreach ($query as $row)\n {\n Cp::$body .= Cp::input_select_option($row->group_id, $row->group_name, '');\n }\n\n Cp::$body .= Cp::input_select_footer();\n Cp::$body .= '</div>'.PHP_EOL;\n }\n\n Cp::$body .= Cp::quickDiv('littlePadding', Cp::input_submit(__('cp.delete')))\n .'</div>'.PHP_EOL\n .'</form>'.PHP_EOL;\n }",
"function noSubsAdminBar()\n{\n $currentUser = wp_get_current_user();\n if (count($currentUser->roles) <= 2 and ($currentUser->roles[0] == 'subscriber' or $currentUser->roles[1] == 'beginner' or $currentUser->roles[1] == 'intermediate' or $currentUser->roles[1] == 'advanced' or $currentUser->roles[1] == 'pro')) {\n show_admin_bar(false);\n }\n}",
"public function canModifyVisibilityOfUsers();",
"private function grouping_group_assigned($event) {\n global $DB;\n $groupid = $event->other['groupid'];\n $members = groups_get_members($groupid, 'userid');\n $group = groups_get_group($groupid, 'courseid');\n $courseid = $group->courseid;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n\n $insertcalls = array();\n $deletecalls = array();\n\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n foreach ($members as $member) {\n $gmail = $this->get_google_authenticated_users_gmail($member->userid);\n if (has_capability('moodle/course:view', $coursecontext, $member->userid)) {\n // Manager; do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $member->userid)) {\n // Teacher (enrolled) (active); do nothing.\n } elseif (is_enrolled($coursecontext, $member->userid, null, true)) {\n // Student (enrolled) (active); continue checks.\n if ($course->visible == 1) {\n // Course is visible, continue checks.\n rebuild_course_cache($courseid, true);\n $modinfo = get_fast_modinfo($courseid, $member->userid);\n $cminfo = $modinfo->get_cm($cmid);\n $sectionnumber = $this->get_cm_sectionnum($cmid);\n $secinfo = $modinfo->get_section_info($sectionnumber);\n if ($cminfo->uservisible && $secinfo->available && is_enrolled($coursecontext, $member->userid, '', true)) {\n // Course module and section are visible and available.\n // Insert reader permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'reader';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } else {\n // User cannot access course module; delete permission.\n try {\n $permissionid = $this->service->permissions->getIdForEmail($gmail);\n $permission = $this->service->permissions->get($fileid, $permissionid->id);\n if ($permission->role != 'owner') {\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->permissionid = $permissionid->id;\n $deletecalls[] = $call;\n if (count($deletecalls) == 1000) {\n $this->batch_delete_permissions($deletecalls);\n $deletecalls = array();\n }\n }\n } catch (Exception $e) {\n debugging($e);\n }\n }\n }\n // Course is not visible; do nothing.\n }\n // User is not enrolled in course; do nothing.\n }\n }\n }\n }\n\n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n\n if (count($deletecalls) > 0) {\n $this->batch_delete_permissions($deletecalls);\n }\n }",
"function mysteam_filter_groups($user)\n{\n\tglobal $mybb;\n\tstatic $gids;\n\n\t// Return true if no usergroups to filter from.\n\tif (!$mybb->settings['mysteam_limitbygroup'])\n\t{\n\t\treturn true;\n\t}\n\t\n\t// Check if the user is in an authorized usergroup.\n\tif (empty($gids))\n\t{\n\t\t$gids = explode(',', $mybb->settings['mysteam_limitbygroup']);\n\t\t\t\n\t\tif (is_array($gids))\n\t\t{\n\t\t\t$gids = array_map('intval', $gids);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$gids = (int) $mybb->settings['mysteam_limitbygroup'];\n\t\t}\n\t}\n\t\t\n\t$usergroups = explode(',', $user['additionalgroups']);\n\t$usergroups[] = $user['usergroup'];\n\t\n\tif (!is_array($usergroups))\n\t{\n\t\t$usergroups = array($usergroups);\n\t}\n\t\n\tif (array_intersect($usergroups, $gids))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}",
"public function invite_members(){\n \tif( !isset( $_REQUEST['pmstkn'] ) || !wp_verify_nonce( $_REQUEST['pmstkn'], 'pms_invite_members_form_nonce' ) )\n \t\treturn;\n\n \tif( empty( $_POST['pms_subscription_id'] ) || empty( $_POST['pms_emails_to_invite'] ) )\n \t\treturn;\n\n if( !pms_get_page( 'register', true ) ){\n pms_errors()->add( 'invite_members', esc_html__( 'Registration page not selected. Contact administrator.', 'paid-member-subscriptions' ) );\n\n return;\n }\n\n \t$subscription = pms_get_member_subscription( sanitize_text_field( $_POST['pms_subscription_id'] ) );\n\n if( !pms_gm_is_group_owner( $subscription->id ) )\n return;\n\n \t//try to split the string by comma\n \t$emails = explode( ',', $_POST['pms_emails_to_invite'] );\n\n \t//check if the first entry contains the end of line character and if so, split by EOL\n \t//having more than 1 entry means that the above split worked\n \tif( isset( $emails[0] ) && count( $emails ) == 1 && strstr( $emails[0], PHP_EOL ) )\n \t\t$emails = explode( PHP_EOL, $_POST['pms_emails_to_invite'] );\n\n $invited_members = 0;\n $invited_emails = pms_get_member_subscription_meta( $subscription->id, 'pms_gm_invited_emails' );\n\n \tforeach( $emails as $email ){\n $email = str_replace( array( \"\\r\", \"\\n\", \"\\t\"), '', $email );\n\n if( !$this->members_can_be_invited( $subscription ) )\n return;\n\n if( in_array( $email, $invited_emails ) )\n continue;\n\n // check if user already invited or registered with subscription\n $email = sanitize_text_field( $email );\n\n if( !filter_var( $email, FILTER_VALIDATE_EMAIL ) )\n continue;\n\n $invited_emails[] = $email;\n\n // If a user with this email is already registered, add him to the subscription\n $user = get_user_by( 'email', $email );\n\n if( !empty( $user ) ) {\n\n $existing_subscription = pms_get_member_subscriptions( array( 'user_id' => $user->ID, 'subscription_plan_id' => $subscription->subscription_plan_id ) );\n\n if( !empty( $existing_subscription ) )\n continue;\n\n $subscription_data = array(\n 'user_id' => $user->ID,\n 'subscription_plan_id' => $subscription->subscription_plan_id,\n 'start_date' => $subscription->start_date,\n 'expiration_date' => $subscription->expiration_date,\n 'status' => 'active',\n );\n\n $new_subscription = new PMS_Member_Subscription();\n $new_subscription->insert( $subscription_data );\n\n pms_add_member_subscription_meta( $new_subscription->id, 'pms_group_subscription_owner', $subscription->id );\n pms_add_member_subscription_meta( $subscription->id, 'pms_group_subscription_member', $new_subscription->id );\n\n if( function_exists( 'pms_add_member_subscription_log' ) )\n pms_add_member_subscription_log( $new_subscription->id, 'group_user_subscription_added' );\n\n $invited_members++;\n\n continue;\n }\n\n // Invite user\n //save email as subscription meta\n $meta_id = pms_add_member_subscription_meta( $subscription->id, 'pms_gm_invited_emails', $email );\n\n //generate and save invite key\n $invite_key = $this->generate_invite_key( $meta_id, $email, $subscription->id );\n\n //send email\n if( $invite_key !== false )\n do_action( 'pms_gm_send_invitation_email', $email, $subscription, $invite_key );\n \t}\n\n $invited_members += (int)did_action( 'pms_gm_send_invitation_email' );\n\n if( $invited_members >= 1 )\n pms_success()->add( 'invite_members', sprintf( _n( '%d member invited successfully !', '%d members invited successfully !', $invited_members, 'paid-member-subscriptions' ), $invited_members ) );\n else\n pms_errors()->add( 'invite_members', esc_html__( 'Something went wrong. Please try again.', 'paid-member-subscriptions' ) );\n\n }",
"function checkEventSuperAdmin($eid, $email, $db){\n\tif(mysqli_num_rows($db->query(\"SELECT * FROM university_event_list WHERE (eid) = '\" . $eid . \"'\")) != 0){\n\n\t\t//return a list of rsos that the user is a member of and this event is part of\n\t\t$temp = $db->query(\"SELECT * FROM university_event_list \n\t\t\tLEFT JOIN university_member_list ON university_event_list.uid = university_member_list.uid\n\t\t\tWHERE (university_event_list.eid) = '\" . $eid . \"' && (university_member_list.email) = '\" . $email . \"'\");\n\t\t$user = $temp->fetch_all(MYSQLI_ASSOC);\n\n\t\t//check to see if the user is an admin of any of these Universities\n\t\tforeach($user AS $u){\n\t\t\tif($u['super_admin']){\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t}\n\n\t} else {\n\t\t//get list of all rsos linked to this event\n\t\t$temp = $db->query(\"SELECT * FROM rso_event_list WHERE (eid) = '\" . $eid . \"'\");\n\t\t$rso = $temp->fetch_all(MYSQLI_ASSOC);\n\n\t\t//check each rso for a university link in which this user is a super admin\n\t\tforeach($rso AS $r){\n\t\t\tif($db->query(\"SELECT * FROM university_rso_link WHERE \n\t\t\t\t(rid) = '\" . $r['rid'] . \"' && (uid) IN \n\t\t\t\t\t(SELECT uid FROM university_member_list \n\t\t\t\t\tWHERE (email) = '\" . $email . \"' && (super_admin) = b'1')\")) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}",
"private function validateGroup(){\n\n\t global $db;\n\t \n\t #see if this is a guest, if so, do some hard-coded checks.\n\t\tif($this->user == \"guest\"){\n\t\t if(($this->user == \"guest\") and ($this->gid == 0)){\n\t\t return(true);\n\t\t }else{\n\t\t return(false);\n\t\t }\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT id FROM ebb_groups WHERE id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$validateGroup = $db->affectedRows();\n\n\t\t\tif($validateGroup == 1){\n\t\t\t return (true);\n\t\t\t}else{\n\t\t\t return(false);\n\t\t\t}\n\t\t}\n\t}",
"public function check_group_intact($user_group, $layer_id)\t\t\n\t{\n\t\t//external users to subscribe also\n\t\t$in_db = array();\n\t\n\t\t$sql = \"SELECT * FROM tbl_layer_subscription l WHERE int_layer_id = \" . $layer_id;\n\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\n\t\twhile($row = mysql_fetch_array($result)) {\n\t\t\t$in_db[] = $row['int_user_id'];\n\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t//For each item in the correct group\n\t\tforeach($user_group as $correct_user => $correct_sms) {\n\t\t\tif(in_array($correct_user, $in_db)) {\n\t\t\t\t//In the group - keep in\n\n\t\t\t\t//Update the sms status - note possibly too many update queries here\n\t\t\t\t$sql = \"UPDATE tbl_layer_subscription SET enm_sms = '\" . $correct_sms . \"', enm_active = 'active' WHERE int_user_id = \" . $correct_user . \" AND int_layer_id = \" . $layer_id;\n\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t//Add into the db\n\t\t\t\t$sql = \"INSERT INTO tbl_layer_subscription (int_layer_id, int_user_id, enm_active, enm_sms) VALUES ( $layer_id, \" . $correct_user . \", 'active', '\" . $correct_sms . \"')\";\n\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t//Now see if anyone is in the group who shouldn't be in there - deactivate\n\t\tforeach($in_db as $user_in) {\n\t\t\tif(isset($user_group[$user_in])) {\n\t\t\t\n\t\t\t\t//Already in db, and in webmaster's version\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Always update the sms status with latest - note this could result in too many queries?\n\t\t\t\t$sql = \"UPDATE tbl_layer_subscription SET enm_sms = '\" . $user_group[$user_in] . \"' WHERE int_user_id = \" . $user_in . \" AND int_layer_id = \" . $layer_id;\n\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\t\t} else {\n\t\t\t\t//Remove from the db\n\t\t\t\t$sql = \"UPDATE tbl_layer_subscription SET enm_active = 'inactive' WHERE int_layer_id = $layer_id AND int_user_id = \" . $user_in;\n\t\t\t\t$result = mysql_query($sql) or die(\"Unable to execute query $sql \" . mysql_error());\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\t\n\t\t\t\n\t\treturn $str;\n\t\t\n\t\n\t}",
"function make_all_group_leaders_in_a_group () {\n if ( current_user_can ( 'group_leader' ) ) {\n $user_ID = get_current_user_id ();\n update_user_meta ( $user_ID, 'learndash_group_users_2186', '2186' );\n }\n}",
"function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }",
"function group_membership_group_admin_permissions($hook, $type, $return, $params) {\n\n\t$entity = elgg_extract('entity', $params);\n\t$user = elgg_extract('user', $params);\n\n\tif (!$entity instanceof ElggGroup || !$user instanceof ElggUser || !$entity->isMember($user)) {\n\t\treturn;\n\t}\n\n\tif (check_entity_relationship($user->guid, 'group_admin', $entity->guid)) {\n\t\treturn true;\n\t}\n}",
"public function testIfUserCantAccessTeamWhichHeDoesNotOwn()\n {\n /** @var User $admin */\n $admin = $this->getRepo('AttendeeApiBundle:User')->find(1);\n /** @var User $user */\n $user = $this->getRepo('AttendeeApiBundle:User')->find(2);\n\n $team = new Team();\n $team\n ->setName('team name');\n\n $manager = new TeamManager();\n $manager\n ->setUser($admin)\n ->setTeam($team);\n\n $this->em()->persist($team);\n $this->em()->persist($manager);\n $this->em()->flush();\n\n $userClient = $this->createAuthorizedClient($user);\n $userClient->request('GET', $this->url(\"api_teams_show\", array('id' => $team->getId())));\n $this->assertEquals(403, $userClient->getResponse()->getStatusCode(), 'User should not have permission to this team.');\n\n $adminClient = $this->createAuthorizedClient($admin);\n $adminClient->request('GET', $this->url(\"api_teams_show\", array('id' => $team->getId())));\n $this->assertEquals(200, $adminClient->getResponse()->getStatusCode(), 'Admin should have permission for this team.');\n }",
"public function beforeFilter() {\n parent::beforeFilter();\n $this->set('group', 'compounds');\n //$this->Auth->deny('addCompound', 'editCompound'); //deny access from addCompound and editCompound by default\n }",
"function isAdminOfThisGroup($groupId)\n{\n\t$_c_user_id = (isset($_COOKIE[$GLOBALS['c_id']]) ? $_COOKIE[$GLOBALS['c_id']] : 0);\n\n\tif ($_c_user_id != 0 && isUserLoggedIn($user_id)) {\n \n\t\t$db = new db_util();\n\n\t $sql = \"SELECT * \n\t FROM vm_group \n\t WHERE v_group_leader_id='$_c_user_id' \n\t AND v_group_id = '$groupId'\";\n\n\t $result = $db->query($sql);\n\n\t if ($result !== false) {\n\t // if there any error in sql then it will false\n\t if ($result->num_rows > 0) {\n\t // if the sql execute successful then it give \n\t \n\t return true;\n\t }\n\t }\n }\n \n return false;\n}",
"public function checkRoles() {\n global $wp_roles;\n $settings = $this->getSettings();\n $rolesNew = explode(',', $settings->rolesAllowed);\n foreach ($wp_roles->roles as $key => $role) {\n if (strtolower($role['name']) != 'administrator') {\n $name = strtolower($role['name']);\n $name = str_replace(\" \", \"_\", $name);\n if (in_array($key, $rolesNew) || $role['name'] == \"Chat Operator\") {\n $wp_roles->add_cap($key, 'visual_chat');\n } else {\n $wp_roles->remove_cap($key, 'visual_chat');\n }\n }\n }\n }",
"function return_bulk_remove_permission( $attach_rel_ids=array() )\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\t\t\n\t\t$ok_to_remove = FALSE;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Allowed to remove?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->member['group_access_cp'] )\n\t\t{\n\t\t\t$ok_to_remove = TRUE;\n\t\t}\n\t\t\n\t\treturn $ok_to_remove;\n\t}",
"public function testReportConcurrentAdminsToNewRelicUserIsNotLoggedIn()\n {\n /** @var \\Magento\\Framework\\Event\\Observer|\\PHPUnit_Framework_MockObject_MockObject $eventObserver */\n $eventObserver = $this->getMockBuilder(\\Magento\\Framework\\Event\\Observer::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->config->expects($this->once())\n ->method('isNewRelicEnabled')\n ->willReturn(true);\n $this->backendAuthSession->expects($this->once())\n ->method('isLoggedIn')\n ->willReturn(false);\n\n $this->model->execute($eventObserver);\n }",
"function groups_get_potential_members($courseid, $roleid = null, $orderby = 'lastname,firstname') {\n global $CFG;\n\n $context = get_context_instance(CONTEXT_COURSE, $courseid);\n $sitecontext = get_context_instance(CONTEXT_SYSTEM);\n $rolenames = array();\n $avoidroles = array();\n\n if ($roles = get_roles_used_in_context($context, true)) {\n\n $canviewroles = get_roles_with_capability('moodle/course:view', CAP_ALLOW, $context);\n $doanythingroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $sitecontext);\n\n foreach ($roles as $role) {\n if (!isset($canviewroles[$role->id])) { // Avoid this role (eg course creator)\n $avoidroles[] = $role->id;\n unset($roles[$role->id]);\n continue;\n }\n if (isset($doanythingroles[$role->id])) { // Avoid this role (ie admin)\n $avoidroles[] = $role->id;\n unset($roles[$role->id]);\n continue;\n }\n $rolenames[$role->id] = strip_tags(role_get_name($role, $context)); // Used in menus etc later on\n }\n }\n\n $select = 'SELECT u.id, u.username, u.firstname, u.lastname, u.idnumber ';\n $from = \"FROM {$CFG->prefix}user u INNER JOIN\n {$CFG->prefix}role_assignments r on u.id=r.userid \";\n\n if ($avoidroles) {\n $adminroles = 'AND r.roleid NOT IN (';\n $adminroles .= implode(',', $avoidroles);\n $adminroles .= ')';\n } else {\n $adminroles = '';\n }\n\n // we are looking for all users with this role assigned in this context or higher\n if ($usercontexts = get_parent_contexts($context)) {\n $listofcontexts = '('.implode(',', $usercontexts).')';\n } else {\n $listofcontexts = '('.$sitecontext->id.')'; // must be site\n }\n\n if ($roleid) {\n $selectrole = \" AND r.roleid = $roleid \";\n } else {\n $selectrole = \" \";\n }\n\n $where = \"WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts)\n AND u.deleted = 0 $selectrole\n AND u.username != 'guest'\n $adminroles \";\n $order = \"ORDER BY $orderby \";\n\n return(get_records_sql($select.$from.$where.$order));\n\n}",
"public function deny_permissions($resource, $resource_owner)\n\t{\n\t\t/**\n\t\t * Rights by field active\n\t\t * \n\t\t * @see the table\n\t\t */\n\t\tif ($resource->active == TRUE)\n\t\t{\n\t\t\t//join is waiting for consideration so sent again is not allowed\n\t\t\t$this->deny($resource_owner->username, 'send_join');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//join was considered now manager can do modifications\n\t\t\t$this->deny($resource_owner->username, 'join');\n\t\t}\n\t\t\n\t\t/**\n\t\t * if resource owner has a team deny join or cancel join\n\t\t */\n\t\tif ($resource_owner->team->loaded())\n\t\t{\n\t\t\t$this->deny($resource_owner->username, 'join');\n\t\t\t\n\t\t\t/**\n\t\t\t * If resource owner has difference team than resource so deny consideration:\n\t\t\t * it means manager is member of difference team than request was sent\n\t\t\t */\n\t\t\tif ($resource_owner->team->id !== $resource->team_id)\n\t\t\t{\n\t\t\t\t$this->deny($resource_owner->username, 'consideration');\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * If join is considered it can be deleted only by moderator\n\t\t */\n\t\tif ($this->is_allowed($resource_owner->username, 'consideration') AND $resource->active == FALSE)\n\t\t{\n\t\t\t$this->deny($resource_owner->username, 'consideration');\n\t\t\t$this->allow($resource_owner->username, 'delete_join');\n\t\t}\n\t\t/**\n\t\t * If no resource deny consideration but can join\n\t\t */\n\t\tif ( ! $resource->loaded())\n\t\t{\n\t\t\t$this->deny('player', array('consideration', 'join'));\n\t\t\t$this->allow('player', array('send_join'));\n\t\t}\n\t\treturn $this;\n\t}",
"public function live_groups_members_add(Request $request) {\n\n \\Log::info(\"live_groups_members_add\".print_r($request->all() , true));\n\n try {\n\n $validator = Validator::make($request->all(),\n array(\n 'live_group_id' => 'required|integer|exists:live_groups,id',\n 'member_id' => 'required|exists:users,id',\n ),\n array(\n 'live_group_id.exists' => Helper::error_message(908),\n 'member_id.exists' => Helper::error_message(910),\n 'member_id.required' => Helper::error_message(910)\n )\n );\n\n if ($validator->fails()) {\n\n $error = implode(',', $validator->messages()->all());\n\n throw new Exception($error, 101);\n \n } else { \n\n $group_details = LiveGroup::where('id',$request->live_group_id)->first();\n\n if(!$group_details) {\n\n throw new Exception(Helper::error_message(908), 908);\n \n }\n\n /**\n | CASE 1: Owner can't join to their group \n |\n | Case 2: Owner only can add members to the group. The Other member of the group can't members\n |\n |\n |\n */\n\n // CASE 1: Owner can't join to their group\n\n if($request->id == $group_details->user_id && $request->member_id == $group_details->user_id) {\n\n throw new Exception(Helper::error_message(914), 914);\n \n }\n\n // Case 2: Owner only can add members to the group. The Other member of the group can't members\n\n if($request->id != $group_details->user_id && $request->id != $request->member_id) {\n \n throw new Exception(Helper::error_message(915), 915);\n }\n\n $member_details = User::find($request->member_id);\n\n if($member_details->status != DEFAULT_TRUE) {\n\n throw new Exception(Helper::error_message(911), 911);\n \n }\n\n // Check the member added in the selected group\n\n $group_member_count = LiveGroupMember::where('member_id' , $request->member_id)->where('live_group_id' , $request->live_group_id)->count();\n\n if($group_member_count) {\n\n throw new Exception(Helper::error_message(912), 912);\n\n }\n\n $group_member_details = new LiveGroupMember;\n $group_member_details->live_group_id = $request->live_group_id;\n $group_member_details->owner_id = $group_details->user_id;\n $group_member_details->member_id = $request->member_id;\n $group_member_details->status = 1;\n $group_member_details->added_by = $request->id == $group_details->user_id ? 'owner' : 'joined';\n\n if($group_member_details->save()) {\n\n // Save Notification\n\n $groupUserDetails = User::find($group_details->user_id);\n\n $notification = NotificationTemplate::getRawContent(USER_GROUP_ADD, $groupUserDetails);\n\n $content = $notification ? $notification : USER_GROUP_ADD;\n\n UserNotification::save_notification($request->member_id, $content, $request->live_group_id, USER_GROUP_ADD , $request->id);\n\n $response_array = ['success' => true , 'message' => Helper::get_message(133 , $member_details->username ? $member_details->username : \"user\") , 'code' => 133 , 'is_member' => LIVE_GROUP_MEMBER_YES];\n\n } else {\n\n throw new Exception(Helper::error_message(907), 907);\n }\n\n }\n\n return response()->json($response_array,200);\n\n } catch(Exception $e) {\n\n $error_message = $e->getMessage();\n\n $error_code = $e->getCode();\n\n $response_array = ['success'=>false, 'error'=> $error_message ,'error_messages' => $error_message, 'error_code' => $error_code];\n\n return response()->json($response_array);\n\n }\n\n }",
"private function inviteMembers(User $invitee, Invitable $invitable)\n {\n $this->logger->debug(\"Sending an invitation to all others members of the invitee [{invitee}] group\",\n array (\"invitee\" => $invitee));\n\n $allMembers = new ArrayCollection();\n /** @var Collection<Collection<User>> $groupsMembers */\n $groupsMembers = $invitee->getGroups()->map(function (Group $group) {\n return $group->getMembers();\n });\n\n /** @var Collection<User> $members */\n foreach ($groupsMembers as $members)\n {\n /** @var User $member */\n foreach ($members as $member)\n {\n if (($invitee->getId() != $member->getId()) && !$allMembers->contains($member))\n {\n $allMembers->add($member);\n }\n }\n }\n\n foreach ($allMembers as $member)\n {\n $entity = new Invitation(get_class($invitable), $invitable->getId(), $member, Invitation::SOURCE_INVITABLE);\n $this->em->persist($entity);\n\n $this->logger->debug(\"Invitation created [{invitation}] for the group member\",\n array (\"invitation\" => $entity));\n }\n }",
"function update_group_memberships()\n {\n if (! is_null($this->group_id))\n {\n $group_users_arr = $this->viewer->get_group_users($this->group_id);\n $group_users = array();\n \n foreach ($group_users_arr as $user)\n {\n $group_users[$user->get_id()] = $user->get_id();\n }\n \n $values = $this->exportValue(Manager::PARAM_GROUP_USERS);\n \n foreach ($values as $type => $elements)\n {\n foreach ($elements as $id)\n {\n if ($type == self::PARAM_USER)\n {\n // type = user\n if (! in_array($id, $group_users))\n {\n if (! $this->viewer->user_is_enrolled_in_group($id))\n {\n $this->viewer->add_user_to_group($id, $this->group_id); // user can be enrolled in one\n // PA-group/publication\n }\n else\n {\n $user = \\Chamilo\\Core\\User\\Storage\\DataManager::retrieve_by_id(\n \\Chamilo\\Core\\User\\Storage\\DataClass\\User::class_name(), \n $id);\n $already_enrolled[] = $user->get_firstname() . ' ' . $user->get_lastname();\n }\n }\n else\n {\n unset($group_users[$id]);\n }\n }\n // type = group\n elseif ($type == self::PARAM_GROUP)\n {\n $context_group_users = $this->viewer->get_context_group_users($id);\n \n foreach ($context_group_users as $user)\n {\n if (! in_array($user->get_id(), $group_users))\n {\n if (! $this->viewer->user_is_enrolled_in_group($user->get_id()))\n {\n $this->viewer->add_user_to_group($user->get_id(), $this->group_id); // user can be\n // enrolled in\n // one\n // PA-group/publication\n }\n else\n {\n $already_enrolled[] = $user->get_firstname() . ' ' . $user->get_lastname();\n }\n }\n else\n {\n unset($group_users[$id]);\n }\n }\n }\n }\n }\n \n // remove remaining users\n foreach ($group_users as $user_id)\n {\n $this->viewer->remove_user_from_group($user_id, $this->group_id);\n }\n }\n \n if (count($already_enrolled) > 0)\n $this->enroll_errors = implode(',', $already_enrolled) . ' ' . Translation::get('AlreadyEnrolled');\n }",
"public function testAddGroupFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_add_group();\n }",
"public static function preventExtraGuestsFromJoining(Room $room): void {\n\t\tif ($room->getObjectType() !== 'share:password') {\n\t\t\treturn;\n\t\t}\n\n\t\tif ($room->getNumberOfParticipants(false) > 1) {\n\t\t\tthrow new \\OverflowException('Only the owner and another participant are allowed in rooms to request the password for a share');\n\t\t}\n\t}",
"protected function matchHideForNonAdminsCondition() {}",
"function deny()\r\n\t{\r\n\t\tJRequest::checkToken() or jexit('Invalid Token');\r\n\t\t\r\n\t\t// Get the selected items\r\n\t\t$cid = JRequest::getVar('cid', array(0), 'post', 'array');\r\n\t\t\r\n\t\t$total = count($cid);\r\n\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_DENIED', $total);\r\n\t\t\r\n\t\t// Force array elements to be integers\r\n\t\tJArrayHelper::toInteger($cid, array(0));\r\n\t\t\r\n\t\t$msg = '';\r\n\t\t\r\n\t\t// No items are selected\r\n\t\tif (!is_array($cid) || count($cid) < 1)\r\n\t\t\tJError::raiseWarning(500, JText::_('SELECT ITEM'));\r\n\t\telse\r\n\t\t{\r\n\t\t\t$user =& JFactory::getUser();\r\n\t\t\t$user_id = $user->get('username');\r\n\t\t\tforeach ($cid as $id)\r\n\t\t\t{\r\n\t\t\t\tRSMembership::saveTransactionLog('Manually denied by '.$user_id, $id);\r\n\t\t\t\tRSMembership::deny($id);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$total = count($cid);\r\n\t\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_DENIED', $total);\r\n\t\t\t\r\n\t\t\t// Clean the cache, if any\r\n\t\t\t$cache =& JFactory::getCache('com_rsmembership');\r\n\t\t\t$cache->clean();\r\n\t\t}\r\n\t\t\r\n\t\t$this->setRedirect('index.php?option=com_rsmembership&view=transactions', $msg);\r\n\t}",
"function customcert_get_conditional_issues_sql($cm, $groupmode) {\n global $CFG, $DB;\n\n // Get all users that can manage this customcert to exclude them from the report.\n $context = context_module::instance($cm->id);\n $conditionssql = '';\n $conditionsparams = array();\n if ($certmanagers = array_keys(get_users_by_capability($context, 'mod/customcert:manage', 'u.id'))) {\n list($sql, $params) = $DB->get_in_or_equal($certmanagers, SQL_PARAMS_NAMED, 'cert');\n $conditionssql .= \"AND NOT u.id $sql \\n\";\n $conditionsparams += $params;\n }\n\n $restricttogroup = false;\n if ($groupmode) {\n $currentgroup = groups_get_activity_group($cm);\n if ($currentgroup) {\n $restricttogroup = true;\n $groupusers = array_keys(groups_get_members($currentgroup, 'u.*'));\n if (empty($groupusers)) {\n return array();\n }\n }\n }\n\n $restricttogrouping = false;\n\n // If groupmembersonly used, remove users who are not in any group.\n if (!empty($CFG->enablegroupings) and $cm->groupmembersonly) {\n if ($groupingusers = groups_get_grouping_members($cm->groupingid, 'u.id', 'u.id')) {\n $restricttogrouping = true;\n } else {\n return array();\n }\n }\n\n if ($restricttogroup || $restricttogrouping) {\n if ($restricttogroup) {\n $allowedusers = $groupusers;\n } else if ($restricttogroup && $restricttogrouping) {\n $allowedusers = array_intersect($groupusers, $groupingusers);\n } else {\n $allowedusers = $groupingusers;\n }\n\n list($sql, $params) = $DB->get_in_or_equal($allowedusers, SQL_PARAMS_NAMED, 'grp');\n $conditionssql .= \"AND u.id $sql \\n\";\n $conditionsparams += $params;\n }\n\n return array($conditionssql, $conditionsparams);\n}",
"function add_warning_if_franchisee_in_group_with_fulltime_course () {\n global $pagenow;\n\n if ( $pagenow == 'post.php' && get_post_type() == 'groups' ) {\n\n $group_id = get_the_id();\n $group_enrolled_courses = learndash_group_enrolled_courses ( $group_id );\n \n foreach ( $group_enrolled_courses as $course ) {\n if ( in_category( 'Full Time', $course) )\n \n $group_user_ids = learndash_get_groups_user_ids ( $group_id );\n \n foreach ( $group_user_ids as $user ) {\n if ( user_can ( $user , 'subscriber' ) ) {\n \n ?>\n <div class=\"update-nag notice\">\n <p><?php _e( '<strong>WARNING: </strong>You have enrolled a full time course in a group that contains franchisees. Please ensure you mean to do this as full time courses contain content that is not geared toward franchisees.', 'my_plugin_textdomain' );?></p>\n </div>\n <?php \n\n return;\n }\n }\n }\n \n }\n}",
"function check_group_members($value)\n{\n\tif ($value['max_member_no_limit'] == MEMBER_PER_GROUP_NO_LIMIT)\n\t{\n\t\treturn true;\n\t}\n\tif ($value['max_member'] < count($value['group_members']))\n\t{\n\t\treturn array ('group_members' => get_lang('GroupTooMuchMembers'));\n\t}\n\treturn true;\n}",
"public function panelist_uninvited() {\n\t\tif (!$this->get_settings()) {\n\t\t\treturn;\n\t\t}\n\t\t$http = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\t\t$results = $http->get($this->settings['hostname.mbd'].'/ignite/getinvites?X-ApiKey='.$this->settings['mbd.api_key'], $this->options);\t\t\n\t\t$results = json_decode($results, true);\n\t\t\n\t\t$mbd_panelist_ids = array_unique(Set::extract('/panelistId', $results)); \n\t\t\n\t\t$this->PartnerUser->bindModel(array('belongsTo' => array('User')));\n\t\t$partner_users = $this->PartnerUser->find('all', array(\n\t\t\t'fields' => array('User.id'),\n\t\t\t'conditions' => array(\n\t\t\t\t'PartnerUser.partner' => 'mbd',\n\t\t\t\t'PartnerUser.uid is not null',\n\t\t\t\t'User.last_touched >=' => date(DB_DATETIME, strtotime('-48 hours'))\n\t\t\t)\n\t\t));\n\t\t\n\t\t$active_panelists = Set::extract('/User/id', $partner_users); \n\t\t\n\t\t$this->out('Found '.count($mbd_panelist_ids).' MBD invites');\n\t\t$this->out('Found '.count($active_panelists).' active MV panelists');\n\t\t$diff = array_diff($active_panelists, $mbd_panelist_ids); \n\t\t$this->out('Found '.count($diff).' panelists that were not invited to MBD');\n\t}",
"public function prepareUserGroups(PrepareUserGroups $event)\n {\n if (!PermissionLock::shouldApplyPermissionRestrictions()) {\n return;\n }\n\n // Don't look further if the user is already a guest\n if ($event->user->isGuest()) {\n return;\n }\n\n /**\n * @var $policies PolicyRepository\n */\n $policies = app(PolicyRepository::class);\n\n // The Repository will check permissions against the Gate, which will fetch the user permissions,\n // which will fetch the groups again, which will trigger this same event\n // With this lock class we tell ourselves to not act when the event will be called inside the event itself\n // That way in the Gate check, the user will have its original groups and the permission will be applied\n // according to the permission settings of the admin panel\n PermissionLock::stopRestrictingPermissions();\n\n // Revoke access the same way as the suspend extension does\n if ($policies->mustAcceptNewPolicies($event->user)) {\n $event->groupIds = [Group::GUEST_ID];\n }\n\n // Restore our ability to restrict permissions for the next permission check for the same or another user\n PermissionLock::continueRestrictingPermissions();\n }",
"public function blockCustomerGroupSave()\n {\n $this->_forward();\n return false;\n }",
"public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}",
"function is_joinable($group, $uid = NULL, $gen_err = FALSE) {\n if (!$uid)\n $uid = userid();\n\n $group_id = $group['group_id'];\n if ($this->is_member($uid, $group['group_id'])) {\n if ($gen_err)\n e(lang('grp_join_error'));\n return false;\n }elseif ($group['group_privacy'] != 2 || $this->is_invited($uid, $group_id, $group['userid'], $gen_err))\n return true;\n else\n return false;\n }",
"function removeUsersFromGroup($group_id, $user_ids){\n\n}",
"function tx_notusergroup($cmd){\r\n\t\t$cmd = t3lib_div::trimExplode('|',$cmd,true);\r\n\t\t$gr_list = $GLOBALS['TSFE']->gr_list;\r\n\t\tforeach( $cmd as $grp) {\r\n\t\t\tif(t3lib_div::inList($gr_list,$grp)){\r\n\t\t\t\treturn false; // matched a group so condition is false\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true; // no Group Found so return true;\r\n\t}",
"function virustotalscan_check_permissions($groups_comma)\r\n{\r\n global $mybb;\r\n // daca nu a fost trimis niciun grup ca si parametru\r\n if ($groups_comma == '') return false;\r\n // se verifica posibilitatea ca nu cumva sa fie mai multe grupuri trimise ca parametru\r\n $groups = explode(\",\", $groups_comma);\r\n // se creaza vectori cu acestee grupuri\r\n $add_groups = explode(\",\", $mybb->user['additionalgroups']);\r\n // se fac teste de apartenenta\r\n if (!in_array($mybb->user['usergroup'], $groups)) { \r\n // in grupul primar nu este\r\n // verificam mai departe daca este in cel aditional, secundar\r\n if ($add_groups) {\r\n if (count(array_intersect($add_groups, $groups)) == 0)\r\n return false;\r\n else\r\n return true;\r\n }\r\n else \r\n return false;\r\n }\r\n else\r\n return true;\r\n}",
"public function validateAdminRoleAction()\n {\n $id = $this->_request->getParam('rid', $this->_request->getParam('role_id'));\n if ($id) {\n $limited = $this->_collectionsFactory->create()->getRolesOutsideLimitedScope(\n $this->_role->getIsAll(),\n $this->_role->getWebsiteIds(),\n $this->_role->getStoreGroupIds()\n );\n if (in_array($id, $limited)) {\n $this->_forward();\n return false;\n }\n }\n return true;\n }",
"function _gallery2_adminapi_removememberhook($args)\n{\n // first check if the module has been configured\n if(!xarGallery2Helper::isConfigured()) {\n return $args['extrainfo'];\n }\n \n extract($args['extrainfo']);\n \n // we only accept roles module hook calls\n if (!isset($module) || $module != 'roles') {\n return $args['extrainfo'];\n }\n \n // we need both, the parent id (itemid) and the child id (uid)\n if (!isset($itemid) || !isset($uid)) {\n $msg = xarML('removemember hook call without group/user ids!');\n xarErrorSet(XAR_USER_EXCEPTION, 'BAD_PARAM', new DefaultUserException($msg));\n return $args['extrainfo'];\n }\n \n // Start G2 transaction\n if(!xarGallery2Helper::init()) {\n return $args['extrainfo'];\n }\n \n // if child is a group: remove all child users from \"groups to be removed\"\n // if child is a user: remove user from \"groups to be removed\"\n // \"groups to be removed\" = getAncestors of parent + parent - getAncestors of child \n \n // this is ridiculous, the role get function defaults to type =1 if none was specified\n $childRole = xarModAPIFunc('roles','user','get', array('uid' => $uid));\n if ( !isset($childRole['type']) || $childRole['uid'] != $uid) {\n $childRole = xarModAPIFunc('roles','user','get', array('uid' => $uid, 'type' => 1));\n }\n \n $xarChildUsers = array();\n if ($childRole['type'] == 1) { // it's a group\n $xarChildUsers = xarGallery2Helper::xarGetChildUsers($uid); // returns only users, no groups\n } else {\n $xarChildUsers[] = $childRole;\n }\n \n // Load the parent role\n list($parentRole, $xarParentGroups) = xarGallery2Helper::xarGetAncestors(array('uid' => $itemid)); // an ancestor is a group per se\n $xarParentGroups[] = $parentRole;\n \n $removeGroupsList = array();\n foreach ($xarParentGroups as $group) {\n $removeGroupsList[$group['uid']] = $group;\n }\n\n // don't remove users from the G2 all users group\n $defaultGroupData = xarModAPIFunc('roles','user','get'\n\t\t\t\t , array('name' => xarModGetVar('roles', 'defaultgroup'), 'type' => 1));\n \n foreach ($xarChildUsers as $child) {\n // first get the remaining memberships and delete the group in \n // $removeGroupsList that we still want to be member of\n $currentGroupsRemoveList = $removeGroupsList;\n list($thechildRole, $remainingGroups) = xarGallery2Helper::xarGetAncestors(array('uid' => $child['uid']));\n foreach ($remainingGroups as $remGroup) {\n $currentGroupsRemoveList[$remGroup['uid']] = null;\n }\n // Now remove the memberships\n foreach ($currentGroupsRemoveList as $groupId => $group) {\n if ($group == null) {\n\tcontinue; // still a member of this group\n }\n \n // don't remove user from G2 all user group\n if ($group['uid'] == $defaultGroupData['uid']) {\n\tcontinue;\n }\n\n // make sure the group already exists in G2, if not, add it (there are some\n // rare scenarios where the group doesn't exist in G2. i.e. if the group was \n // in deleted state in xaraya while we imported/exported the groups and now\n // this group is back, recalled. \n // other CMS shouldn't care i guess, just a strange and rare issue\n list($ret, $g2Group) = GalleryCoreApi::loadEntityByExternalId($group['uid'], 'GalleryGroup');\n if ($ret) {\n\tif ($ret->getErrorCode() & ERROR_MISSING_OBJECT) { \n\t // ok, we need to create this group first\n\t if (!xarGallery2Helper::g2createGroup($group['uid'], $group)) {\n\t return $args['extrainfo'];\n\t }\n\t} else { // a real error, damn\n\t $msg = xarML('Failed to fetch group for extId [#(1)] removeusertogroup synchronization! Here\n\t\t\t\t\t\t\tis the error message from G2: <br />', $group['uid'], $ret->getAsHtml());\n\t xarErrorSet(XAR_SYSTEM_EXCEPTION, 'FUNCTION_FAILED', new SystemException($msg));\n\t return $args['extrainfo'];\n\t}\n }\n\n // remove user from group\n $ret = GalleryEmbed::removeUserFromGroup($child['uid'], $group['uid']);\n if ($ret) {\n\t$msg = xarML('Failed to remove g2 user [#(1)] with extId [#(2)] from g2 group [#(3)]! Here is the\n\t\t\t\t\terror from G2: <br />', $child['uname'], $child['uid'], $group['name'], $ret->getAsHtml());\n\txarErrorSet(XAR_SYSTEM_EXCEPTION, 'FUNCTION_FAILED', new SystemException($msg));\n\treturn $args['extrainfo'];\n }\n }\n }\n \n // complete G2 transaction\n xarGallery2Helper::done();\n \n return $args['extrainfo'];\n}",
"public function forbiddenContexts() {}",
"public function iShouldBeAbleToLeaveTheGroup()\n {\n $main = $this->getMainContext();\n /** @var \\Behat\\MinkExtension\\Context\\MinkContext $mink */\n $mink = $main->getSubcontext('mink');\n\n $mink->clickLink('My profile');\n $this->waitForPageToLoad();\n\n $mink->clickLink('Leave group');\n $this->waitForPageToLoad();\n\n $mink->pressButton('Leave the Group');\n $this->waitForPageToLoad();\n\n $mink->assertPageContainsText(\"You've left\");\n }",
"public function testUpdateGroupFailsIfLackingPermissions(): void\n {\n $this->expectException(\\Exception::class);\n $this->slimStub->shouldReceive('halt')->times(1)->with(403, '{\"status\":403,\"message\":\"Access Denied\",\"title\":\"You do not have the permission: manage_groups\"}')->andThrow(new \\Exception);\n\n $this->userController->_update_group();\n }",
"public function canManageOwnSubdomain();",
"public function allow_unenrol(stdClass $instance) {\n return false;\n }"
] | [
"0.6403085",
"0.6118794",
"0.605944",
"0.59526056",
"0.57342535",
"0.5721309",
"0.56360734",
"0.5636036",
"0.5632193",
"0.5569195",
"0.5568988",
"0.5556467",
"0.5541279",
"0.5515305",
"0.5490671",
"0.5484996",
"0.54816407",
"0.54723686",
"0.5465246",
"0.5463045",
"0.5448393",
"0.5437698",
"0.5433913",
"0.5417289",
"0.5415983",
"0.5407691",
"0.54071635",
"0.5400985",
"0.53666556",
"0.53570724",
"0.53562933",
"0.53559595",
"0.5346733",
"0.53421646",
"0.5340586",
"0.5329812",
"0.53210676",
"0.5301798",
"0.5257752",
"0.5251157",
"0.5250858",
"0.5249838",
"0.52425176",
"0.5238857",
"0.5235612",
"0.5228902",
"0.5227628",
"0.5222101",
"0.52205545",
"0.5212704",
"0.52116835",
"0.5211548",
"0.5203203",
"0.51823056",
"0.51750064",
"0.51733154",
"0.5172994",
"0.51567644",
"0.5154567",
"0.51523423",
"0.5145828",
"0.51293164",
"0.5126794",
"0.5117807",
"0.51036674",
"0.5103494",
"0.50865656",
"0.5085971",
"0.5085478",
"0.508329",
"0.5083127",
"0.50773567",
"0.5074043",
"0.5071697",
"0.50711006",
"0.5066042",
"0.5065597",
"0.5063521",
"0.5062022",
"0.5058247",
"0.5054905",
"0.505278",
"0.50454825",
"0.504423",
"0.50405645",
"0.50380045",
"0.5037478",
"0.503462",
"0.50291026",
"0.5026044",
"0.50254935",
"0.50249374",
"0.5023418",
"0.5022762",
"0.5020865",
"0.50149083",
"0.50022995",
"0.50003886",
"0.49972174",
"0.49915358"
] | 0.6696632 | 0 |
re/routes some urls that go through the groups handler | function au_subgroups_groups_router($hook, $type, $return, $params) {
au_subgroups_breadcrumb_override($return);
// subgroup options
if ($return['segments'][0] == 'subgroups') {
elgg_load_library('elgg:groups');
$group = get_entity($return['segments'][2]);
if (!elgg_instanceof($group, 'group') || (($group->subgroups_enable == 'no') && ($return['segments'][1] != "delete"))) {
return $return;
}
elgg_set_context('groups');
elgg_set_page_owner_guid($group->guid);
switch ($return['segments'][1]) {
case 'add':
set_input('au_subgroup', true);
set_input('au_subgroup_parent_guid', $group->guid);
if (include(elgg_get_plugins_path() . 'au_subgroups/pages/add.php')) {
return true;
}
break;
case 'delete':
if (include(elgg_get_plugins_path() . 'au_subgroups/pages/delete.php')) {
return true;
}
break;
case 'list':
if (include(elgg_get_plugins_path() . 'au_subgroups/pages/list.php')) {
return true;
}
break;
}
}
// need to redo closed/open tabs provided by group_tools - if it's installed
if ($return['segments'][0] == 'all' && elgg_is_active_plugin('group_tools')) {
$filter = get_input('filter', false);
if(empty($filter) && ($default_filter = elgg_get_plugin_setting("group_listing", "group_tools"))){
$filter = $default_filter;
set_input("filter", $default_filter);
}
if(in_array($filter, array("open", "closed", "alpha"))){
au_subgroups_handle_openclosed_tabs();
return true;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function executeGroupRoutes()\n {\n /*\n * Set multiple group routes\n */\n $this->router->group('/movies', function ($route)\n {\n $route->get('/', function (){\n echo \"Movies Overview\";\n });\n\n $route->get('english/{:id}', function ($route, $id) {\n echo \"Movie $id\";\n });\n\n $route->where('{:id}', '(\\d+)')->get('spanish/{:id}', function ($route, $id) {\n echo \"Movie with custom where clause $id\";\n });\n });\n\n return $this;\n }",
"function group_membership_router($hook, $type, $return, $params) {\n\n\tif (!is_array($return)) {\n\t\treturn;\n\t}\n\t\n\t// Initial page identifier might be different from /groups\n\t// i.e. subtype specific handler e.g. /schools\n\t$initial_identifier = elgg_extract('identifier', $params);\n\t$identifier = elgg_extract('identifier', $return);\n\t$segments = elgg_extract('segments', $return);\n\n\tif ($identifier !== 'groups') {\n\t\treturn;\n\t}\n\n\t$page = array_shift($segments);\n\tif (!$page) {\n\t\t$page = 'all';\n\t}\n\n\t// we want to pass the original identifier to the resource view\n\t// doing this via route hook in order to keep the page handler intact\n\t$resource_params = array(\n\t\t'identifier' => $initial_identifier ? : 'groups',\n\t\t'segments' => $segments,\n\t);\n\n\tswitch ($page) {\n\t\tcase 'members':\n\t\t\t$guid = array_shift($segments);\n\t\t\t$sort = array_shift($segments);\n\t\t\t$resource_params['guid'] = $guid;\n\t\t\t$resource_params['sort'] = $sort;\n\t\t\tif (!elgg_is_active_plugin('user_sort') && elgg_view_exists(\"resources/groups/members/$sort\")) {\n\t\t\t\techo elgg_view_resource(\"groups/members/$sort\", $resource_params);\n\t\t\t} else {\n\t\t\t\techo elgg_view_resource('groups/members', $resource_params);\n\t\t\t}\n\t\t\treturn false;\n\t\tcase 'requests' :\n\t\tcase 'invited' :\n\t\tcase 'invite' :\n\t\t\t$guid = array_shift($segments);\n\t\t\t$resource_params['guid'] = $guid;\n\t\t\techo elgg_view_resource(\"groups/$page\", $resource_params);\n\t\t\treturn false;\n\t}\n}",
"public function register_routes() {\n\n\t\t\\add_filter( 'do_parse_request', array( $this, 'handle_routing' ) );\n\n\t}",
"public function register_routes() {\n\n\t\t\t$collection_params = $this->get_collection_params();\n\t\t\t$schema = $this->get_item_schema();\n\n\t\t\t$get_item_args = array(\n\t\t\t\t'context' => $this->get_context_param( array( 'default' => 'view' ) ),\n\t\t\t);\n\n\t\t\tregister_rest_route(\n\t\t\t\t$this->namespace,\n\t\t\t\t'/' . $this->rest_base . '/(?P<id>[\\d]+)/' . $this->rest_sub_base,\n\t\t\t\tarray(\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t\t'description' => esc_html__( 'User ID', 'learndash' ),\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t\t'callback' => array( $this, 'get_user_groups' ),\n\t\t\t\t\t\t'permission_callback' => array( $this, 'get_user_groups_permissions_check' ),\n\t\t\t\t\t\t'args' => $this->get_collection_params(),\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'methods' => WP_REST_Server::EDITABLE,\n\t\t\t\t\t\t'callback' => array( $this, 'update_user_groups' ),\n\t\t\t\t\t\t'permission_callback' => array( $this, 'update_user_groups_permissions_check' ),\n\t\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t\t'group_ids' => array(\n\t\t\t\t\t\t\t\t'description' => esc_html__( 'Group IDs to add to User.', 'learndash' ),\n\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\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\tarray(\n\t\t\t\t\t\t'methods' => WP_REST_Server::DELETABLE,\n\t\t\t\t\t\t'callback' => array( $this, 'delete_user_groups' ),\n\t\t\t\t\t\t'permission_callback' => array( $this, 'delete_user_groups_permissions_check' ),\n\t\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t\t'group_ids' => array(\n\t\t\t\t\t\t\t\t'description' => esc_html__( 'Group IDs to remove from User.', 'learndash' ),\n\t\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t\t'type' => 'array',\n\t\t\t\t\t\t\t\t'items' => array(\n\t\t\t\t\t\t\t\t\t'type' => 'integer',\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'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t)\n\t\t\t);\n\t\t}",
"function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }",
"private static function runDispatcher()\n {\n if (self::$groupHalt || self::$halts) {\n return;\n }\n $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $method = $_SERVER['REQUEST_METHOD'];\n $searches = array_keys(static::$patterns);\n $replaces = array_values(static::$patterns);\n $found_route = false;\n\n self::$routes = str_replace('//', '/', self::$routes);\n // Check if route is defined without regex\n\n if (in_array($uri, self::$routes)) {\n $route_pos = array_keys(self::$routes, $uri);\n foreach ($route_pos as $route) {\n // Using an ANY option to match both GET and POST requests\n if (self::$methods[$route] === $method || self::$methods[$route] === 'ANY') {\n //dd(preg_match('#^' . $route . '$#', $uri, $matched));\n\n // If route is not an object\n if (!is_object(self::$callbacks[$route])) {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n // Grab all parts based on a / separator\n $parts = explode('/', self::$callbacks[$route]);\n\n // Collect the last index of the array\n $last = end($parts);\n\n // Grab the controller name and method call\n $segments = explode('@', $last);\n\n if (count($segments) >= 2) {\n // Instanitate controller\n $controller = new $segments[0]();\n\n // Call method\n $controller->{$segments[1]}();\n } else {\n Viewer::file(self::$callbacks[$route]);\n }\n\n if (self::$halts) {\n return true;\n }\n } else {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n // Call closure\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n if (is_object(self::$callbacks[$route])) {\n call_user_func(self::$callbacks[$route]);\n } else {\n Viewer::file(self::$callbacks[$route]);\n }\n\n if (self::$halts) {\n return true;\n }\n }\n }\n }\n } else {\n // Check if defined with regex\n $pos = 0;\n foreach (self::$routes as $route) {\n if (strpos($route, ':') !== false) {\n $route = str_replace($searches, $replaces, $route);\n }\n\n if (preg_match('#^'.$route.'$#', $uri, $matched)) {\n if (self::$methods[$pos] === $method || self::$methods[$pos] === 'ANY') {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n // Remove $matched[0] as [1] is the first parameter.\n array_shift($matched);\n if (!is_object(self::$callbacks[$pos])) {\n // Grab all parts based on a / separator\n $parts = explode('/', self::$callbacks[$pos]);\n // Collect the last index of the array\n $last = end($parts);\n // Grab the controller name and method call\n $segments = explode('@', $last);\n // Instanitate controller\n $controller = new $segments[0]();\n\n // Fix multi parameters\n if (!method_exists($controller, $segments[1])) {\n //\"controller and action not found\"\n Debugger::report(500);\n } else {\n call_user_func_array([$controller, $segments[1]], $matched);\n }\n if (self::$halts) {\n return;\n }\n } else {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n call_user_func_array(self::$callbacks[$pos], $matched);\n if (self::$halts) {\n return;\n }\n }\n } else {\n // continue searching\n }\n }\n $pos++;\n }\n }\n\n // Tell if there is no found grouped routes\n return false;\n }",
"public function map()\n {\n $this->adminGroup(function () {\n $this->mapAdminRoutes();\n });\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapACLRoutes(); \n //\n }",
"protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}",
"public function hookDefineRoutes($args)\n {\n if (is_admin_theme() && !get_option('clean_url_use_admin')) {\n return;\n }\n\n $router = $args['router'];\n\n $mainPath = get_option('clean_url_main_path');\n $collectionGeneric = get_option('clean_url_collection_generic');\n $itemGeneric = get_option('clean_url_item_generic');\n $fileGeneric = get_option('clean_url_file_generic');\n\n $allowedForItems = unserialize(get_option('clean_url_item_alloweds'));\n $allowedForFiles = unserialize(get_option('clean_url_file_alloweds'));\n\n // Note: order of routes is important: Zend checks from the last one\n // (most specific) to the first one (most generic).\n\n // Get all collections identifiers with one query.\n $collectionsIdentifiers = get_view()->getRecordTypeIdentifiers('Collection', false);\n\n if (!empty($collectionsIdentifiers)) {\n // Use one regex for all collections. Default is case insensitve.\n $collectionsRegex = array_map('preg_quote', $collectionsIdentifiers);\n // To avoid a bug with identifiers that contain a \"/\", that is not\n // escaped with preg_quote().\n $collectionsRegex = '(' . str_replace('/', '\\/', implode('|', $collectionsRegex)) . ')';\n\n // Add a collection route.\n $route = $mainPath . $collectionGeneric;\n $router->addRoute('cleanUrl_collections', new Zend_Controller_Router_Route(\n $route . ':record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'collection-show',\n ),\n array(\n 'record_identifier' => $collectionsRegex,\n )));\n\n // Add a collection route for files.\n if (in_array('collection', $allowedForFiles)) {\n $router->addRoute('cleanUrl_collections_file', new Zend_Controller_Router_Route(\n $route . ':collection_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-collection-file',\n ),\n array(\n 'collection_identifier' => $collectionsRegex,\n )));\n }\n\n // Add a collection / item route for files.\n if (in_array('collection_item', $allowedForFiles)) {\n $router->addRoute('cleanUrl_collections_item_file', new Zend_Controller_Router_Route(\n $route . ':collection_identifier/:item_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-collection-item-file',\n ),\n array(\n 'collection_identifier' => $collectionsRegex,\n )));\n }\n\n // Add a collection route for items.\n if (in_array('collection', $allowedForItems)) {\n $router->addRoute('cleanUrl_collections_item', new Zend_Controller_Router_Route(\n $route . ':collection_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-collection-item',\n ),\n array(\n 'collection_identifier' => $collectionsRegex,\n )));\n }\n }\n\n // Add a generic route for files.\n if (in_array('generic', $allowedForFiles)) {\n $route = $mainPath . $fileGeneric;\n $router->addRoute('cleanUrl_generic_file', new Zend_Controller_Router_Route(\n $route . ':record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-file',\n 'collection_id' => NULL,\n )));\n }\n\n // Add a generic / item route for files.\n if (in_array('generic_item', $allowedForFiles)) {\n $route = $mainPath . $itemGeneric;\n $router->addRoute('cleanUrl_generic_item_file', new Zend_Controller_Router_Route(\n $route . ':item_identifier/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-item-file',\n 'collection_id' => NULL,\n )));\n }\n\n // Add a generic route for items.\n if (in_array('generic', $allowedForItems)) {\n $route = $mainPath . trim($itemGeneric, '/');\n $router->addRoute('cleanUrl_generic_items_browse', new Zend_Controller_Router_Route(\n $route,\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'items-browse',\n )));\n $router->addRoute('cleanUrl_generic_item', new Zend_Controller_Router_Route(\n $route . '/:record_identifier',\n array(\n 'module' => 'clean-url',\n 'controller' => 'index',\n 'action' => 'route-item',\n 'collection_id' => NULL,\n )));\n }\n }",
"public function map()\n {\n $this->prefix('stats')->name('stats.')->group(function () {\n $this->get('/', 'DashboardController@index')\n ->name('index'); // admin::tracker.stats.index\n });\n\n $this->prefix('visitors')->name('visitors.')->group(function () {\n $this->get('/', 'VisitorsController@index')\n ->name('index'); // admin::tracker.visitors.index\n });\n\n $this->prefix('settings')->name('settings.')->group(function () {\n $this->get('/', 'SettingsController@index')\n ->name('index'); // admin::tracker.settings.index\n });\n }",
"public function map()\n {\n //panel\n $this->mapPanelRoutes();\n //auth\n $this->mapAuthRoutes();\n //almacen\n $this->mapInventoryRoutes();\n //contabilidad\n $this->mapAccountingRoutes();\n //Recursos Humanos\n $this->mapHumanResourceRoutes();\n //ventas\n $this->mapSaleRoutes();\n\n $this->mapApiRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapFrontWebRoutes();\n $this->mapBackWebRoutes();\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n $this->mapAdminRoutes();\n //\n }",
"public function route() {\n return array(\n '/^sitemap\\.xml$/' => 'actionMap',\n '/^download\\/(.+?).html/' => array(\n 'class' => 'Download',\n 'argument' => '$1'\n )\n );\n }",
"public function map()\n {\n $this->mapProcessEngineRoutes();\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }",
"public function __invoke(\\Slim\\App $app): void\n {\n foreach ($this->config('routes') as $group_name => $routes) {\n $app->group($group_name, function () use ($group_name, $routes): void {\n $controller = ('/' === $group_name || !$group_name) ? 'index' : \\trim($group_name, '/');\n\n foreach ($routes as $name => $route) {\n $methods = $route['methods'] ?? ['GET'];\n $pattern = $route['pattern'] ?? '';\n $callable = function (Request $request, Response $response, array $args = []) use ($controller, $name) {\n $args['action'] = $name;\n\n return $this['controller']($controller)->__invoke($request, $response, $args);\n };\n $this->map($methods, $pattern, $callable)->setName(('index' === $controller ? '' : $controller).'-'.$name);\n }\n });\n }\n }",
"function group($pattern, $callable)\n {\n $old = server('router.pattern.group');\n $pattern = str_ireplace(array_keys($GLOBALS['$horus.patterns']), array_values($GLOBALS['$horus.patterns']), $pattern);\n\n server('router.pattern.group', call(scope('$horus.slashes'), rtrim($old, '/\\\\').'/'.ltrim($pattern, '/\\\\')));\n call($callable);\n server('router.pattern.group', $old);\n }",
"public function route()\n {\n $this->dashboardRouting($this->relativeCmsUri);\n $this->logOffRouting($this->request, $this->relativeCmsUri);\n $this->apiRouting($this->relativeCmsUri);\n $this->documentRouting($this->userRights, $this->relativeCmsUri);\n $this->valuelistsRouting($this->userRights, $this->relativeCmsUri);\n $this->sitemapRouting($this->userRights, $this->relativeCmsUri);\n $this->redirectRouting($this->userRights, $this->relativeCmsUri);\n $this->imageRouting($this->userRights, $this->relativeCmsUri);\n $this->filesRouting($this->userRights, $this->relativeCmsUri);\n $this->configurationRouting($this->userRights, $this->relativeCmsUri);\n $this->searchRouting($this->relativeCmsUri);\n }",
"protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n // Check default routes format\n if (is_string($this->routes[$uri])) {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n // Is there a matching http verb?\n elseif (is_array($this->routes[$uri]) && isset($this->routes[$uri][$http_verb])) {\n $this->_set_request(explode('/', $this->routes[$uri][$http_verb]));\n return;\n }\n }\n\n // decryption of module/controller/function name in admin\n if ($this->config->item('is_admin') == 1) {\n if ($this->config->item('ADMIN_URL_ENCRYPTION') == 'Y') {\n $uri_t = str_replace('admin/', '', $uri);\n if ($uri_t != \"\") {\n require_once(APPPATH . '/libraries/Ci_encrypt.php');\n $CI_Enc = new Ci_encrypt();\n $uri_t_decode = $CI_Enc->decrypt($uri_t, true);\n $CI_Enc->convertEncryptedVars();\n }\n $uri = 'admin/' . $uri_t_decode;\n }\n }\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val) {\n // Check if route format is using http verb\n if (is_array($val)) {\n if (isset($val[$http_verb])) {\n $val = $val[$http_verb];\n } else {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n #$key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^' . $key . '$#', $uri, $matches)) {\n // Are we using callbacks to process back-references?\n if (!is_string($val) && is_callable($val)) {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE) {\n $val = preg_replace('#^' . $key . '$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n $this->mapArticleRoutes();\n $this->mapVideoRoutes();\n $this->mapProductRoutes();\n $this->mapHarvestRoutes();\n $this->mapUserRoutes();\n $this->mapCategoryRoutes();\n $this->mapRegionRoutes();\n $this->mapUnitRoutes();\n $this->mapOrderRoutes();\n $this->mapLandRoutes();\n $this->mapBannerRoutes();\n $this->mapAdminRoutes();\n\n //\n }",
"protected function _parse_routes()\n {\n $uri = implode('/', $this->uri->segments);\n\n // only for test\n // sometime js file has map file but not found in server\n if (ENVIRONMENT === 'development') {\n log_message('error', json_encode($uri));\n }\n\n // Get HTTP verb\n $http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n // Loop through the route array looking for wildcards\n foreach ($this->routes as $key => $val)\n {\n // Check if route format is using HTTP verbs\n if (is_array($val))\n {\n $val = array_change_key_case($val, CASE_LOWER);\n if (isset($val[$http_verb]))\n {\n $val = $val[$http_verb];\n }\n else\n {\n continue;\n }\n }\n\n // Convert wildcards to RegEx\n $key = str_replace(array(':any', ':num'), array('.+', '[0-9]+'), $key);\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri, $matches))\n {\n // Are we using callbacks to process back-references?\n if ( ! is_string($val) && is_callable($val))\n {\n // Remove the original string from the matches array.\n array_shift($matches);\n\n // Execute the callback using the values in matches as its parameters.\n $val = call_user_func_array($val, $matches);\n }\n // Are we using the default routing method for back-references?\n elseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request(array_values($this->uri->segments));\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n //\n }",
"public function map()\n {\n $this->mapWebRoutes();\n\n $this->mapApiRoutes();\n\n //\n }",
"public function registerSiteRoutes()\n\t{\n\t\t// NOTE: the second route is used to capture files in subdirectories as well\n\t\treturn array(\n\t\t\t'internal/(?P<id>.\\d*)' => array('action' => 'AssetManagement/Assets/findById'),\n\t\t\t'internal/(?P<directory>.*)/(?P<name>.*)' => array('action' => 'AssetManagement/Assets/findInDirectory')\n\t\t);\n\t}",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function map()\n {\n //wap端路由为了防止和web端路由冲突一定要放到前面\n $this->mapWapRoutes();\n //web端路由\n $this->mapWebRoutes();\n //api路由\n $this->mapApiRoutes();\n //Backend路由\n $this->mapBackendRoutes();\n }",
"public function route()\n\t{\n\t\t/* [http|https]/[Ajax|]/[Get|Post|Delete|Put]/uri */\n\t\t$this->route = $this->route_raw = ($this->c->Request->is_https ? 'https' : 'http').'/'.($this->c->Request->is_ajax ? 'Ajax' : '').'/'.$this->c->Request->request.'/'.$this->c->Request->uri;\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->preRouter();\n\n\t\t/* rewrite dispatch route */\n\t\tforeach ($this->c->router['routes'] as $regexpath => $switchto) {\n\t\t\tif (preg_match($regexpath, $this->route)) {\n\t\t\t\t/* we got a match */\n\t\t\t\t$this->route = preg_replace($regexpath, $switchto, $this->route);\n\t\t\t\t$this->route_matched = $regexpath;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t/* call dispatch event */\n\t\t$this->c->Event->postRouter();\n\n\t}",
"public function map() {\n\t\tRoute::middleware( 'web' )->group( mantle_base_path( 'routes/web.php' ) );\n\t\tRoute::middleware( 'rest-api' )->group( mantle_base_path( 'routes/rest-api.php' ) );\n\t}",
"function endpoints() {\r\n\t\tadd_rewrite_endpoint( 'backers', EP_PERMALINK | EP_PAGES );\r\n\t}",
"function dispatch_rewrites() {\n\t\\path_dispatch()->add_path(\n\t\t[\n\t\t\t'path' => 'homepage',\n\t\t\t'rewrite' => [\n\t\t\t\t'rule' => 'page/([0-9]+)/?',\n\t\t\t\t'redirect' => 'index.php?dispatch=homepage&pagination=$matches[1]',\n\t\t\t\t'query_vars' => 'pagination',\n\t\t\t],\n\t\t]\n\t);\n}",
"function add_urls() {\n\tadd_rewrite_rule( '^sso-login/?', 'index.php?sso-login=sso-login', 'top' );\n add_rewrite_endpoint( 'sso-login', EP_PERMALINK);\n\n\t// URLs for step 2 of webserver oauth flow\n\tadd_rewrite_rule( '^sso-callback/?', 'index.php?sso-callback=sso-callback', 'top' );\n add_rewrite_endpoint( 'sso-callback', EP_PERMALINK);\n}",
"public function routes()\n {\n register_rest_route('can', '/donation-forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'fundraisingPages'\n ],\n ]);\n\n register_rest_route('can', '/forms', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'forms'\n ],\n ]);\n\n register_rest_route('can', '/petitions', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'petitions'\n ],\n ]);\n\n register_rest_route('can', '/person/add', [\n 'methods' => 'GET',\n 'callback' => [\n $this, 'addPerson'\n ],\n ]);\n }",
"public function matchRoute() {\n\t\tforeach($this->routes as $pattern => $callback) {\n\t\t\tif (preg_match('{^' . $pattern . '$}', $this->url) === 1) {\n\t\t\t\tif(!isset($_SESSION)){ session_start(); }\n\t\t\t\t// Parameters\n\t\t\t\t$params = array();\n\t\t\t\tif (isset($callback['params'])) {\n\t\t\t\t\t$url = explode('/', $this->url);\n\t\t\t\t\t$url = array_slice($url, -1 * count($callback['params']));\n\t\t\t\t\t$params = array_combine(array_keys($callback['params']), $url);\n\t\t\t\t}\n\t\t\t\t// Secured (Backend)\n\t\t\t\tif (isset($callback['secured'])) {\n\t\t\t\t\tif (isset($_SESSION['auth']) && $_SESSION['auth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'http://' . $_SERVER['SERVER_NAME'] . '/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Secured (Frontend)\n\t\t\t\t} elseif (isset($callback['clientsecured'])) {\n\t\t\t\t\tif (isset($_SESSION['fauth']) && $_SESSION['fauth'] === true) {\n\t\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->url = 'home/login';\n\t\t\t\t\t\theader('location:' . $this->url);\n\t\t\t\t\t}\n\t\t\t\t// Simple\n\t\t\t\t} else {\n\t\t\t\t\t$this->dispatch($callback['controller'], $callback['action'], $params);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// No match\n\t\t$this->dispatch('Default', 'error', array('code' => 404));\n\t\treturn;\n\t}",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapCustomerRoutes();\n\n $this->mapInternalRoutes();\n\n $this->mapVendorRoutes();\n\n $this->mapWhiteGloveRoutes();\n\n $this->mapLocalRoutes();\n }",
"public static function returnRoutes($prefix = null) {\n\n Route::group(array('prefix' => 'admin/' . self::$name), function() {\n\n Route::any('faces', array('as' => 'eve.faces', 'uses' => __CLASS__.'@getEveFaces'));\n Route::any('faces/change_status', array('as' => 'eve.change_status', 'uses' => __CLASS__.'@changeStatus'));\n Route::any('faces/full_delete', array('as' => 'eve.full_delete', 'uses' => __CLASS__.'@fullDelete'));\n });\n\n Route::any(self::$name . '/load_photo', array('as' => 'eve.load_photo', 'uses' => __CLASS__.'@postLoadPhoto'));\n }",
"public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }",
"public function map()\n {\n $this->mapApiRoutes();\n $this->mapWebRoutes();\n }",
"public function run()\n {\n $this->executeStaticRoutes();\n $this->executeGroupRoutes();\n }",
"protected function mapWebRoutes()\n {\n $this->mapDefaultWebRoutes();\n\n $this->mapUnauthenticatedWebRoutes();\n\n $this->mapAuthenticatedWebRoutes();\n $this->mapAdminAuthenticatedWebRoutes();\n $this->mapClientAuthenticatedWebRoutes();\n\n $this->mapPaginationRoutes();\n $this->mapAdminPaginationRoutes();\n $this->mapClientPaginationRoutes();\n\n $this->mapAjaxRoutes();\n $this->mapAdminAjaxRoutes();\n $this->mapClientAjaxRoutes();\n }",
"private function mapAdminRoutes()\n {\n $this->name('backups.')\n ->prefix($this->config()->get('arcanesoft.backups.route.prefix', 'backups'))\n ->group(function () {\n Routes\\StatusesRoutes::register();\n });\n }",
"protected function preReRouting()\n {\n\n }",
"private function parse_urlpatterns(array $urlpatterns) : array {\n $tmp_routes = array();\n foreach($urlpatterns as $url => $view) {\n //Parse group middlewares\n if(is_int($url)) {\n if(array_key_exists('view', $view)) {\n //Parse urlpatterns array\n $tmp_parsed_routes = $this->parse_urlpatterns($view['view']);\n //Add group middlewares to urls\n foreach($tmp_parsed_routes as $tmp_url => $tmp_view) {\n $route = $tmp_url;\n $tmp_routes[$route]['view'] = (is_array($tmp_view) ? $tmp_view['view'] : $tmp_view);\n if(isset($tmp_view['middleware'])) {\n if(is_array($tmp_view['middleware'])) {\n $tmp_routes[$route]['middleware'] = array_merge($tmp_view['middleware'], is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n } else {\n $tmp_routes[$route]['middleware'] = array_merge(array($tmp_view['middleware']), is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n }\n } else {\n $tmp_routes[$route]['middleware'] = $view['middleware'];\n }\n }\n } else {\n http_response_code(500);\n exit('Error : invalid urlpatterns format');\n }\n } else {\n //Parse urlpatterns array\n $url = ($url === '/' ? $url : '/'.ltrim($url, '/'));\n if(is_array($view)) {\n //Parse route middleware\n if(array_key_exists('view', $view)) {\n $route = $url;\n $tmp_routes[$route] = $view;\n } else {\n //Parse nested urlpatterns\n foreach($view as $nested_url => $view) {\n //Parse group middlewares\n if(is_int($nested_url)) {\n if(array_key_exists('view', $view)) {\n //Parse urlpatterns array\n $tmp_parsed_routes = $this->parse_urlpatterns($view['view']);\n //Add group middlewares to urls\n foreach($tmp_parsed_routes as $tmp_url => $tmp_view) {\n $tmp_url = ($tmp_url === '/' ? $tmp_url : '/'.ltrim($tmp_url, '/'));\n $route = ($url === '/' ? $tmp_url : rtrim($url, '/').$tmp_url);\n $tmp_routes[$route]['view'] = (is_array($tmp_view) ? $tmp_view['view'] : $tmp_view);\n if(isset($tmp_view['middleware'])) {\n if(is_array($tmp_view['middleware'])) {\n $tmp_routes[$route]['middleware'] = array_merge($tmp_view['middleware'], is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n } else {\n $tmp_routes[$route]['middleware'] = array_merge(array($tmp_view['middleware']), is_array($view['middleware']) ? $view['middleware'] : array($view['middleware']));\n }\n } else {\n $tmp_routes[$route]['middleware'] = $view['middleware'];\n }\n }\n } else {\n http_response_code(500);\n exit('Error : invalid urlpatterns format');\n }\n } else {\n $nested_url = ($nested_url === '/' ? $nested_url : '/'.ltrim($nested_url, '/'));\n if(is_array($view)) {\n //Parse route middlewares\n if(array_key_exists('view', $view)) {\n if(is_array($view['view'])) {\n exit('Error : invalid urlpatterns format');\n } else {\n $route = ($url === '/' ? $nested_url : rtrim($url, '/').$nested_url);\n $tmp_routes[$route] = $view;\n }\n } else {\n http_response_code(500);\n exit('Error : invalid urlpatterns format');\n }\n } else {\n $route = ($url === '/' ? $nested_url : rtrim($url, '/').$nested_url);\n $tmp_routes[$route] = $view;\n }\n }\n }\n }\n } else {\n $route = $url;\n $tmp_routes[$route] = $view;\n }\n }\n }\n return $tmp_routes;\n }",
"public function createRoutes() {\n \n $this->app->get('/order-detail/by-order/{id}', function ($request, $response, $args) {\n $resultado = [];\n $id = $args['id'];\n $resultado = OrderDetail::GetDetailByOrderId($id);\n $response->write(json_encode($resultado,JSON_UNESCAPED_SLASHES));\n\n return $response;\n });\n\n\n\n\n $this->app->group('/order-detail/{id}', function () {\n\n\n\n $this->map(['GET', 'DELETE', 'PUT'], '', function ($request, $response, $args) {\n // Find, delete, patch or replace user identified by $args['id']\n $method = $request->getMethod();\n switch ($method) {\n case 'GET':\n $id = $args['id'];\n $product = OrderDetail::GetProductById($id);\n return $response->write(json_encode($product,JSON_UNESCAPED_SLASHES));\n break;\n case 'PUT':\n $id = $args['id'];\n $body = $request->getParsedBody();\n //Se parsea de un array a un json y del json a un objecto \n // var_dump($body);\n $product = json_decode(json_encode($body));\n // var_dump($product);\n $product = OrderDetail::ProductUpdate($id,$product);\n $body = $response->getBody();\n $body->write(json_encode($product,JSON_UNESCAPED_SLASHES));\n return $response;\n break;\n case 'DELETE':\n $id = $args['id'];\n OrderDetail::ProductDelete($id);\n return $response;\n break;\n\n default:\n # code...\n break;\n }\n });\n });\n\n $this->app->get('/order-detail[/]', function ($request, $response, $args) {\n $resultado = [];\n $resultado = OrderDetail::GetAllProducts();\n $response->write(json_encode($resultado,JSON_UNESCAPED_SLASHES));\n return $response;\n });\n\n\n\n $this->app->post('/order-detail[/]', function ($request, $response, $args)\n {\n $body = $request->getParsedBody();\n //Se parsea de un array a un json y del json a un objecto \n // var_dump($body);\n $product = json_decode(json_encode($body));\n // var_dump($product);\n $product = OrderDetail::ProductCreate($product);\n $body = $response->getBody();\n $body->write(json_encode($product,JSON_UNESCAPED_SLASHES));\n return $response;\n });\n }",
"public function map(): void\n {\n $this->adminGroup(function () {\n $this->prefix('permissions')->name('permissions.')->group(function () {\n // admin::auth.permissions.index\n $this->get('/', [PermissionsController::class, 'index'])\n ->name('index');\n\n $this->mapDataTableRoutes();\n\n $this->prefix('{'.self::PERMISSION_WILDCARD.'}')->group(function () {\n // admin::auth.permissions.show\n $this->get('/', [PermissionsController::class, 'show'])\n ->name('show');\n\n $this->namespace('Permissions')->group(function () {\n static::mapRouteClasses([\n Permissions\\RolesRoutes::class,\n ]);\n });\n });\n });\n });\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n }",
"protected function mapWebRoutes()\n {\n Route::group(lit_base_path('routes/web.php'));\n }",
"public function add_endpoint() {\r\n add_rewrite_rule('^api/films/?(\\w+)?/?','index.php?__api=1&films=$matches[1]','top');\r\n }",
"protected function mapApiRoutes()\n {\n /*Route::group([\n 'middleware' => 'api',\n 'namespace' => $this->namespace,\n 'prefix' => 'api',\n ], function ($router) {\n require module_path('frontend', 'Routes/api.php');\n });*/\n\n /* 将api中的路由按模块分成多个子文件 */\n foreach(glob(module_path('frontend', 'Routes/api/*.php'))as $file){\n Route::middleware('api')\n ->namespace($this->namespace)\n ->group($file);\n }\n }",
"public function map()\n {\n $this->mapApiRoutes();\n\n $this->mapWebRoutes();\n\n $this->mapMobileRoutes();\n }",
"public static function returnRoutes($prefix = null) {\n $class = __CLASS__;\n #echo $prefix;\n Route::group(array('before' => 'auth', 'prefix' => $prefix), function() use ($class) {\n \tRoute::controller($class::$group.\"/brand_advices\", $class);\n });\n }",
"private function parseRoutes()\n {\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->getSegments());\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri])) {\n return $this->setRequest(explode('/', $this->routes[$uri]));\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val) {\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri)) {\n // Do we have a back-reference?\n if (strpos($val, '$') !== false && strpos($key, '(') !== false) {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n\n return $this->setRequest(explode('/', $val));\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->setRequest($this->uri->getSegments());\n }",
"function routes_poputi(){\n\n\n $routes[] = array(\n '_uri' => '/^poputi\\/v([0-9]+).html$/i',\n 'do' => 'read_v',\n 1 => 'id'\n );\n\t\t\t\t\t\t \n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/published([0-9]+).html$/i',\n 'do' => 'published',\n 1 => 'id'\n );\n\t\t\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/status([0-9]+)-([0-9]+).html$/i',\n 'do' => 'status',\n 1 => 'id',\n 2 => 'st'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/depub([0-9]+).html$/i',\n 'do' => 'depublished',\n 1 => 'id'\n );\n\t\t\n $routes[] = array(\n '_uri' => '/^poputi\\/p([0-9]+).html$/i',\n 'do' => 'read_p',\n 1 => 'id'\n );\n\t\t\t\t\t\t \n $routes[] = array(\n '_uri' => '/^poputi\\/del([0-9]+).html$/i',\n 'do' => 'delprof',\n 1 => 'id'\n );\n\n $routes[] = array(\n '_uri' => '/^poputi\\/add.html$/i',\n 'do' => 'add'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/edit([0-9]+).html$/i',\n 'do' => 'edit',\n\t\t\t\t\t\t\t1\t\t=> 'id'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/search$/i',\n 'do' => 'search'\n );\n\t\t\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/drivers\\/([0-9]+)$/i',\n 'do' => 'drivers',\n\t\t\t\t\t\t\t1\t\t=> 'page'\n );\n\t\t\t\t\t\t \n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/passenger\\/([0-9]+)$/i',\n 'do' => 'passenger',\n\t\t\t\t\t\t\t1\t\t=> 'page'\n );\n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/drivers$/i',\n 'do' => 'drivers'\n );\n\t\t\t\t\t\t \n\t\t$routes[] = array(\n '_uri' => '/^poputi\\/passenger$/i',\n 'do' => 'passenger'\n );\n\n return $routes;\n\n }",
"protected function mapPanelRoutes()\n {\n Route::group([\n 'middleware' => ['web'/*,'auth'*/],\n 'namespace' => 'App\\Http\\Controllers\\Panel',//$this->namespace,\n ], function ($router) {\n require base_path('routes/panel.php');\n });\n }",
"protected function _loadRoutes()\n\t{\n\t\t$this->_routes['/^\\/login\\/?$/'] = '/account/login';\n\t}",
"public function setRoutes()\n {\n $this->route('/test_extend', function() {\n $this->get(function($request, $response, $params) {\n $array = array_merge($this->foo(), $request->getHeaders());\n $response->write(200, $array);\n\n return $response;\n })->auth(\\Dioxide\\AUTH_BASIC); // require basic auth to use this method\n });\n\n\n // send the request headers back to the user\n $this->route('/headers', function() {\n $this->get(function($request, $response, $params) {\n $rateHeaders = $this->emit('rate.limit.headers', [$request->getRealRemoteAddr()]);\n\n $response->write(200, $request->getHeaders()); // send the request headers back\n $response->headers($rateHeaders);\n\n return $response;\n });\n });\n\n $this->route('/post_test', function() {\n $this->post(function($request, $response, $params) {\n $response->write(200, $request->getContent());\n return $response;\n });\n });\n\n $this->route('/server_vars', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, $_SERVER);\n return $response;\n });\n });\n\n $this->route('/cache_test', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, ['foo' => 'bar']); // will be a 304 with no response body if cached\n return $response;\n });\n });\n\n }",
"protected function mapRoutes()\n {\n foreach($this->apiNamespaces as $namespace) {\n $prefix = strtolower($namespace);\n\n Route::prefix('v1/'.$prefix)\n ->middleware('api')\n ->namespace($this->apiBaseNamespace.'\\\\'.$namespace)\n ->group(base_path('routes/api/'.$prefix.'.php'));\n }\n }",
"public function map()\n {\n $this->prefix('stats')->name('stats.')->group(function () {\n $this->get('/', 'DashboardController@index')\n ->name('index'); // admin::seo.stats.index\n });\n }",
"public function group(Closure $routes): void\n {\n foreach ($this->i18n->getRegions() as $region) {\n $this->router\n ->name($region.'.')\n ->prefix($region)\n ->group($routes);\n }\n }",
"public function map()\n {\n $this->mapRoutes();\n\n $this->mapWebRoutes();\n\n //\n }"
] | [
"0.66813266",
"0.65422785",
"0.64529145",
"0.64511544",
"0.6127165",
"0.6102336",
"0.60892606",
"0.6078064",
"0.60473365",
"0.60373664",
"0.60192096",
"0.6010302",
"0.59340835",
"0.59144884",
"0.59120584",
"0.5906681",
"0.5845595",
"0.5845263",
"0.5840648",
"0.58251464",
"0.5814044",
"0.5809925",
"0.5785749",
"0.5782188",
"0.5782188",
"0.5782188",
"0.5782188",
"0.5782188",
"0.5782188",
"0.5782188",
"0.5782188",
"0.5775579",
"0.5774051",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5763895",
"0.5761966",
"0.57572967",
"0.57445467",
"0.57309294",
"0.5728538",
"0.5727067",
"0.57216036",
"0.57111114",
"0.56988835",
"0.56699747",
"0.56647646",
"0.56641066",
"0.56641066",
"0.56587446",
"0.5657786",
"0.56349856",
"0.56321186",
"0.5618319",
"0.56062824",
"0.56058097",
"0.5604678",
"0.5599957",
"0.558217",
"0.5581415",
"0.5579522",
"0.5576537",
"0.5575975",
"0.557545",
"0.5562561",
"0.55416715",
"0.5536715",
"0.5532529",
"0.5528355",
"0.552477",
"0.5522638"
] | 0.59348387 | 12 |
Display a listing of the resource. | public function index()
{
$stocks = Stock::paginate(20);
return view('stock.index', compact('stocks'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.6830523",
"0.6802689",
"0.6797",
"0.67957735",
"0.67871135",
"0.6760129",
"0.67427456",
"0.6730486",
"0.67272323",
"0.67255723",
"0.67255723",
"0.67255723",
"0.67177945",
"0.6707866",
"0.6706713",
"0.6704375",
"0.6664782",
"0.6662871",
"0.6660302",
"0.6659404",
"0.6656656",
"0.6653517",
"0.6647965",
"0.6620322",
"0.66185474",
"0.6618499",
"0.6606105",
"0.6600617",
"0.65996987",
"0.6594775",
"0.6587389",
"0.6585109",
"0.6581641",
"0.6581017",
"0.6577157",
"0.65747666",
"0.6572513",
"0.65721947",
"0.6570553",
"0.65646994",
"0.6563556",
"0.6554194",
"0.65529937",
"0.65460825",
"0.65368485",
"0.653429",
"0.65328294",
"0.6526759",
"0.6526695",
"0.6526284",
"0.65191334",
"0.65183175",
"0.65174305",
"0.651703",
"0.65141153",
"0.6507088",
"0.65061647",
"0.6504046",
"0.64942145",
"0.6491893",
"0.64883405",
"0.6486392",
"0.6485077",
"0.64846045",
"0.6478858",
"0.64756656",
"0.64726377",
"0.6471126",
"0.64701074",
"0.6467418",
"0.6462195",
"0.64618355",
"0.6459199",
"0.6457831",
"0.6454631",
"0.64533997",
"0.6451915",
"0.6450861",
"0.6449301",
"0.64492667",
"0.64469045"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
// $product= Product::find($id);
// $stock = Stock::where('pid', $id)->first();
// if(empty($stock)){
// Stock::create([
// 'pid'=>$product->id,
// 'category'=>$product->category,
// 'title'=>$product->title,
// 'description'=>$product->description,
// 'image'=>$product->image,
// 'quantity'=>$product->quantity,
// ]);
// }
// else{
// $stock->update([
// 'quantity'=>$stock->quantity + $request->quantity,
// ]);
// }
//
// Session::flash('success', 'Stock is added successfully');
// return redirect()->route('stock.index');
$pid = $request->pid;
$status = $request->status;
// return $pid.$status;
$product = Product::find($pid);
$product->update([
'status'=> $status,
]);
$test = Stock::where('bid', $product->bid)->get();
// $quan = - 1;
// $test->update([
// 'quantity'=> $quan ,
// ]);
return $test->quantity;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
] | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$stock=Stock::find($id);
return view('stock.show', compact('stock'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
] | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245",
"0.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
] | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
} | {
"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)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
] | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"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 |
Set the data container. If the given data is wrapped in a reference object, the data container will be a reference to the value of the reference object. | public function setData(array|Reference $data): static
{
if ($data instanceof Reference) {
$this->data = &$data->get();
} else {
$this->data = $data;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDataAsRef(array &$data)\n {\n $this->data = &$data;\n }",
"public function & setDataRef( & $a_data )\r\n\t{\r\n\t\tswitch(gettype($a_data))\r\n\t\t{\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'array':\r\n\t\t\t\t$this->fromArrayRef($a_data);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'object':\r\n\t\t\t\t$this->fromObjectRef($a_data);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn $this;\r\n\t}",
"public function & setDataRef( & $a_data )\n\t{\n\t\t$this->m_data->setDataRef($a_data);\n\t\treturn $this;\n\t}",
"function setAllData(&$data) {\n\t\t$this->_data =& $data;\n\t}",
"final public function setData($data) {\n $this->data = $data;\n }",
"public static function setData($data) {}",
"public function set_data($data)\n {\n $this->data = $data;\n }",
"public function set($data);",
"public function setData($data){\n\t\t$this->_storage = $data;\n\t\t\n\t\t// set update flag\n\t\t$this->_isModified = true;\n\t\t\n\t\t// new data available\n\t\t$this->_dataAvailable = true;\n\t}",
"public function setDataIntoTemplate($reference,$data) {\n\t$this->assign($reference,$data);\n }",
"public function setData($data)\n {\n $this->_data = $data;\n }",
"public function set_data($data)\n {\n }",
"public function set_data($data)\n {\n }",
"public function setData($data)\r\n\t{\r\n\t\t$this->data = $data;\r\n\t}",
"public function setData($data)\n {\n return $this->set('data', $data);\n }",
"public function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n {\n $this->data = $data;\n }",
"public function setData($data) {\n $this->data = $data;\n }",
"public function setData($data)\n {\n $this->data = $data;\n }",
"public function setData($data)\n {\n $this->data = $data;\n }",
"public function setData($data) \n\t{\n $this->data = $data;\n }",
"public function setData( $data )\n {\n $this->data = $data;\n }",
"private function setData($data)\n {\n \t$this->data = $data;\n }",
"protected function setData($data) {\n $this->data = collect($data);\n }",
"public function setData($data): void\n {\n $this->data = $data;\n }",
"public function setInternalData($data): void\n {\n $this->internal_data = $data;\n }",
"public function setData($data)\n\t{\n\t\t$this->_data = unserialize($data);\n\t\t$this->_hashFunc = $this->_data['hashFunc'];\n\t}",
"public static function setData(Data $data)\n {\n self::$data = $data;\n }",
"public function setData($data)\r\n {\r\n }",
"public static function setData($data)\n {\n self::$rawData = $data;\n }",
"abstract public function object_data(&$data);",
"public function setData($_data)\n {\n $this->_data = $_data;\n }",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setData($data);",
"public function setData($data) { \n $this->data = $data; \n }",
"public function setObjectData(&$data)\n {\n $objVarNames = array_keys(get_object_vars($this));\n $theData = $data;\n if (is_object($theData)) $theData = get_object_vars($data);\n foreach($theData as $propertyName => &$propertyValue)\n {\n foreach ($objVarNames as &$varName)\n {\n if (strcasecmp($varName, $propertyName) == 0)\n {\n $this->$varName = $propertyValue;\n }\n }\n }\n }",
"function setData ($data) {\n if ($data !== ($oldData = $this->data)) {\n $this->data = $data;\n if ($this->resetCacheOnDataChange($oldData, $data)) \n $this->resetCache();\n }\n }",
"public final function setData($data)\n {\n $this->data = $data;\n return $this;\n }",
"protected function setData($data)\n {\n $this->sha1 = null;\n $this->data = $data;\n }",
"public function setConnectionData($data)\n {\n $this->metadata = $data;\n }",
"public function setData($data)\n {\n $resultData = $this->hydrateIfJsonToArray($data);\n if (!empty($resultData)) {\n $this->data = $resultData;\n }\n else {\n $this->data = [];\n }\n }",
"public function setViewData($data)\n {\n $this->__viewData = $data;\n }",
"public function set_fields($data)\n\t{\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (isset($this->aliases[$key]))\n\t\t\t\t$key = $this->aliases[$key];\n\n\t\t\tif (array_key_exists($key, $this->data))\n\t\t\t\t$this->data[$key] = $value;\n\t\t}\n\t}",
"public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}",
"public function setData($data, $key = null);",
"public function setData($data)\n {\n $this->data = $data;\n return $this;\n }",
"public function setData($data)\n {\n $this->data = $data;\n return $this;\n }",
"protected function setData($data)\n\t{\n\t\t$this->originalData = $data;\n\t\treturn $this;\n\t}",
"public function setData(array $data) {\n\t\t$this->_data = $data;\n\t}",
"public function setData($data)\n {\n $this->_data = $data;\n\n return $this;\n }",
"public function set($data, array $options = array()) {\n return $data;\n }",
"public function setData($data, $encodeoptions = JSON_FORCE_OBJECT){\n\t\t$this->data = $data;\n\t\t$this->options = $encodeoptions;\n\t}",
"public function setFromArray(array &$_data);",
"public function setData($data)\n {\n $this->data = $data;\n $this->normalizedData = $this->normalize($data);\n $this->transformedData = $this->transform($this->normalizedData);\n }",
"public function _setData($data = []){\n \t$this->dataredis\t= $data;\n \tunset($this->dataredis['clientId']);\n \tunset($this->dataredis['clientToken']);\n \t$this->dataredis\t= $this->common->arraySortByKey($this->dataredis, \"ASC\");\n \t$temp\t\t\t\t= \"\";\n \tforeach($this->dataredis as $k => $v){\n \t\tif(is_array($v)) $v = json_encode($v);\n \t\t$temp\t.= urlencode($k).\"=\".urlencode($v).\"&\";\n \t}\n \t$this->dataredis\t= substr($temp,0,strlen($temp)-1);\n \tif(strlen($this->dataredis)==0) $this->dataredis\t= \"null\";\n }",
"public function setData($data)\n\t{\n\t\t$this->_pageData['data'] = $data;\n\t}",
"public function setData($data)\n {\n $this->data = $data;\n\n return $this;\n }",
"public function setData($data)\n {\n $this->data = $data;\n\n return $this;\n }",
"public function setData($data)\n {\n $this->data = $data;\n\n return $this;\n }",
"public function setData($data)\n {\n $this->data = $data;\n\n return $this;\n }",
"public function setData($data)\n {\n if (!is_array($data)) {\n return false;\n }\n\n $this->_objData = $data;\n return $this->_objData;\n }",
"public static function set($data, $value = null)\n {\n static::getInstance()->set($data, $value);\n }",
"public function setData($data) {\n $this->data = (string) $data;\n }",
"public function set_data(array $data)\n\t{\n\t\t$this->data = $data;\n\t\treturn $this;\n\t}",
"public function setData($data = array())\n {\n $this->data = XmlSerializer::serialize($data);\n return $this->update();\n }",
"public function setData(tx_imagemapwizard_model_dataObject $data) {\n\t\t$this->data = $data;\n\t}",
"public function & setData( $a_data )\n\t{\n\t\t$this->m_data->setData($a_data);\n\t\treturn $this;\n\t}",
"public function setData($data)\n {\n $this->data['data'] = $data;\n\n return $this;\n }",
"private function setCachedData($data)\n\t{\n\t\tif (!is_bool($this->useCache)) {\n\t\t\t$this->cacheDuration = (int) $this->useCache;\n\t\t}\n\n\t\tYii::$app->db->cache(function () use ($data) {\n\t\t\tif ($this->useDataProvider) {\n\t\t\t\treturn $this->data->prepare(); //set cached dataProvider data\n\t\t\t} else {\n\t\t\t\t$this->data = $this->data->all();\n\t\t\t\treturn $this->data; //set cached query data\n\t\t\t}\n\t\t}, $this->cacheDuration);\n\t}",
"public function setData (array $data) : void {\n\t\t$this->data = $data;\n\t}",
"public function set_data($key, $data)\n\t{\n\t\t$this->_data[$key] = $data;\n\t}",
"public function setData(array $data = []);",
"private function setData($data) {\r\n\t\t$this->set_cd_jogo($data[\"cd_jogo\"]);\r\n\t\t$this->set_nm_jogo($data[\"nm_jogo\"]);\r\n\t\t$this->set_vl_jogo($data[\"vl_jogo\"]);\r\n\t\t$this->set_ds_sinopse(utf8_decode($data[\"ds_sinopse\"]));\r\n\t\t$this->set_dt_lancamento($data[\"dt_lancamento_jogo\"]);\r\n\t\t$this->set_ds_requisito_minimo($data[\"ds_requesito_minimo\"]);\r\n\t\t$this->set_ds_requisito_sugerido($data[\"ds_requesito_sugerido\"]);\r\n\t}",
"public function geographySetData($data) {\n\t\t$this->data = $data;\n\t\treturn( true );\n\t}",
"public function setData( $data ) {\n\t\t$this->data = $data;\n\t\t$this->addField( new ACHRecordField([4,83], $data) );\n\t}",
"public function data($data = null)\n {\n $this->data = $data;\n\n return $this;\n }",
"public function setData($data = array())\n {\n $this->data = (string) $data;\n\n $this->update();\n }",
"public function setData($data) {\n if (empty($data)) {\n return;\n }\n if (is_object($data) || is_array($data)) {\n foreach ($this->_data as $field => $value) {\n if (array_key_exists($field, $data)) {\n $temp_val = $data[$field];\n } else {\n $temp_val = $value;\n }\n $this->__set($field, $temp_val);\n }\n } else {\n throw new Exception('The entity \"' . get_class($this) .\n '\" must be created by an array or object.');\n }\n }",
"static public function setRepeaterData(array $data)\n\t{\n\t\tself::$_data = $data;\n\t}",
"public function setData($data)\n {\n// -- `idVeiculo` INT(11) NOT NULL,\n// -- `idMotorista` INT(11) NOT NULL,\n// -- `idTiposFretes` INT(11) NOT NULL,\n// -- `Observacoes` VARCHAR(255) NULL DEFAULT NULL,\n// -- `ValorPedagios` DECIMAL(10,2) NOT NULL,\n// -- `Distancia` DECIMAL(10,3) NOT NULL,\n// -- `DataEntrega` DATE NULL DEFAULT NULL,\n// -- `ValorFrete` DECIMAL(10,2) NOT NULL,\n $this->SetIdNotaTransporte($data['IdNotaTransporte']);\n $this->SetIdVeiculo($data['idVeiculo']);\n $this->SetIdMotoriste($data['idMotorista']);\n $this->SetIdTipoFrete($data['idTipoFretes']);\n $this->SetDistancia($data['Distancia']); \n $this->SetValorFrete($data['ValorFrete']);\n $this->SetDataEmissao($data['DataEntrega']);\n }",
"public function set($key, $data, $collection = false, $lifetime = 3600) {\n\t\t// Database_MySQL_Result objects contain resources which cannot be serialized\n\t\t// Results should be cached, not the Database_MySQL_Result object\n\t\tif (is_object($data) && get_class($data) == 'Database_MySQL_Result') {\n\t\t\tthrow new Kohana_Exception('Unable to serialize Database_MySQL_Result for caching');\n\t\t}\n\n\t\t// Serialize then Unserialize creates copies of objects\n\t\t// Otherwise objects are passed by reference and can have strange side effects\n\t\t$data = serialize($data);\n\t\tif (!$collection) {\n\t\t\t$this->_cache[$key] = $data;\n\t\t}\n\t\telse {\n\t\t\tif (!isset($this->_collections[$collection])) {\n\t\t\t\t$this->_collections[$collection] = array(\n\t\t\t\t\t$key => $data\n\t\t\t\t);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->_collections[$collection][$key] = $data;\n\t\t\t}\n\t\t}\n\t}",
"public function setData(Array $data)\n {\n $this->data_view = array_merge_recursive($this->data_view, $data);\n }",
"public function setData(array $data);",
"public function setData(array $data);",
"public function setData(array $data);",
"public static function setRawData($data)\n {\n self::$rawData = $data;\n }",
"public function setData($data, $encapsulationName = 'db')\n {\n $this->_data[$encapsulationName] = $data;\n }",
"public function set($key, $data);",
"public function setData($Data) {\n\t\t$this->Data=$Data;\n\t}",
"public function setData(array $data = array ())\r\n\t{\r\n\t\t$this->data = $data;\r\n\t\treturn $this;\r\n\t}",
"public function data($data){\n $this->_options['data'] = $data;\n return $this;\n }",
"public function data(array $data)\n {\n $this->data = $data;\n\n return $this;\n }",
"function setRef($name, &$value) {\n $this->vars[$name] =& $value; //is_object($value) ? $value->fetch() : $value;\n }",
"public function setData(?Data $data): self\n {\n if ($data === null && $this->data !== null) {\n $this->data->setQuestion(null);\n }\n\n // set the owning side of the relation if necessary\n if ($data !== null && $data->getQuestion() !== $this) {\n $data->setQuestion($this);\n }\n\n $this->data = $data;\n\n return $this;\n }"
] | [
"0.7423217",
"0.7341393",
"0.70289266",
"0.66722083",
"0.66632986",
"0.6663027",
"0.6609764",
"0.66018754",
"0.65649",
"0.65606916",
"0.6517567",
"0.6481942",
"0.6481548",
"0.64634234",
"0.6402068",
"0.64015764",
"0.6399144",
"0.6399144",
"0.6399144",
"0.63869506",
"0.63850164",
"0.6381791",
"0.6381791",
"0.6360847",
"0.6357072",
"0.6334308",
"0.6306368",
"0.62901974",
"0.6278337",
"0.62782025",
"0.6261684",
"0.62540305",
"0.6251848",
"0.6220553",
"0.6209633",
"0.6184378",
"0.6184378",
"0.6184378",
"0.6184378",
"0.6184378",
"0.61473626",
"0.6082534",
"0.6077506",
"0.6048278",
"0.60089",
"0.60046506",
"0.5993279",
"0.5979635",
"0.59612304",
"0.5943064",
"0.59419584",
"0.5929745",
"0.5929745",
"0.592277",
"0.5914091",
"0.5910222",
"0.58919966",
"0.58743227",
"0.5853988",
"0.58407944",
"0.5838767",
"0.58374834",
"0.58329827",
"0.58329827",
"0.58329827",
"0.58329827",
"0.5823816",
"0.58233887",
"0.5819911",
"0.58038044",
"0.57875955",
"0.5785304",
"0.57847756",
"0.578039",
"0.57801485",
"0.57733285",
"0.57600343",
"0.57527703",
"0.57498467",
"0.57450384",
"0.5739533",
"0.5736588",
"0.5712909",
"0.57114863",
"0.56977254",
"0.56927985",
"0.5692496",
"0.5676533",
"0.5669393",
"0.5669393",
"0.5669393",
"0.5662446",
"0.56486386",
"0.5615606",
"0.5614782",
"0.55997366",
"0.5593464",
"0.55928874",
"0.5582972",
"0.5564919"
] | 0.72394407 | 2 |
Set a key value pair If the given value is wrapped in a reference object, the value will be a reference to the value of the reference object. | public function set(string $key, mixed $value = null): static
{
$data = &$this->data;
$segments = explode($this->delimiter, $key);
$key = array_pop($segments);
foreach ($segments as $segment) {
if (! isset($data[$segment]) || ! is_array($data[$segment])) {
$data[$segment] = [];
}
$data = &$data[$segment];
}
if ($value instanceof Reference) {
$data[$key] = &$value->get();
} else {
$data[$key] = $value;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function & setValueRef( $a_key, & $a_value )\r\n\t{\r\n\t\treturn $this->_set($a_key, $a_value);\r\n\t}",
"public function & setRef( $a_key, & $a_value )\r\n\t{\r\n\t\treturn $this->_set($a_key, $a_value);\r\n\t}",
"public function putref($key, $value) {\n $this->_hash[$key]= $value;\n }",
"public function set ( $key, &$value ) { \t$this->storage[$key] = $value; }",
"public function setReferenceKey(?string $value): void {\n $this->getBackingStore()->set('referenceKey', $value);\n }",
"public function set ($key, $value);",
"public function set( $key, $value );",
"public function set( $key, $value );",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public static function assignByRef($key,&$value) {\r\n\t\tself::$_smarty->assignByRef($key,$value);\r\n\t}",
"public function setValue($key, $value);",
"public function setValue($key, $value);",
"public function __set($key, $value);",
"function setRef($name, &$value) {\n $this->vars[$name] =& $value; //is_object($value) ? $value->fetch() : $value;\n }",
"public function __set($key, $value)\n {\n return $this->var_holder->setByRef($key, $value);\n }",
"public function set($key, $value = null);",
"public function set($key, $value = null);",
"public function set($key, $value) {\n\n }",
"public function set(string $key, $value);",
"public function set(string $key, $value);",
"public function assignRef (mixed $value, mixed $value)\n {\n }",
"function setReference( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Reference = $value;\n }",
"function set($key, $value);",
"function set($key, $value);",
"function set($key, $value);",
"public function setVarByReference($key, &$value)\n {\n assert(is_string($key), '$key expected to be String');\n assert(!isset($offset), 'Cannot redeclare var $offset');\n $offset = $this->_toArrayOffset($key);\n $this->_contents[$offset] =& $value;\n return $this;\n }",
"final public function set($key,$value):Main\\Map\n {\n $this->checkAllowed('set')->checkBefore(false,$value);\n $return = $this->onPrepareThis('set');\n $key = $this->onPrepareKey($key);\n $value = $this->onPrepareValueSet($value);\n Base\\Arrs::setRef($key,$value,$return->arr(),$this->isSensitive());\n\n return $return->checkAfter();\n }",
"abstract public function set ($key, $value);",
"public function __set($key, $val);",
"public function set(string $key, $value = null);",
"abstract public function set($key, $value);",
"abstract public function set($key, $value);",
"public function __set($key, $value)\n {\n return $this->varHolder->setByRef($key, $value);\n }",
"public function set($strKey, $varValue);",
"public function __set($key, $value) {\n\t}",
"public function setRef($ref);",
"function set($key, $newvalue) {\n\t\t$this->valuemap[$key]= $newvalue;\n\t}",
"public function set($key, $value): void;",
"public function __set($key, $value)\n\t{\n\t\t$this->with($key, $value);\n\t}",
"public function __set($key, $value)\n\t{\n\t\t$this->with($key, $value);\n\t}",
"function set_ref($k, &$v) {\n $this->keep($k);\n $this->flash[$k] =& $v;\n }",
"public function set(string $key, $value): void;",
"public function __set($key, $value)\n {\n $this->with($key, $value);\n }",
"public function __set($key, $value)\n {\n $this->with($key, $value);\n }",
"public static function Set($key, $val);",
"public function __set($key, $value)\n {\n }",
"public function __set($key, $value)\n {\n }",
"public function __set($key, $value)\n {\n }",
"public function __set($key, $value)\n {\n }",
"public function set($key, $value)\n\t{\n\t\techo \"Original set called\\n\";\n\t}",
"function set($k,$v){\r\n\t\t$this->_Set($k,$v);\r\n\t}",
"public function setRef($ref)\n {\n $this->_ref = $ref;\n }",
"public function __set($key, $value) {\n\t\t$this->set($key, $value); \n\t}",
"public function __set($key, $value) {\n\t\t$this->set($key, $value); \n\t}",
"public function __set($key, $value)\r\n {\r\n $this->set($key, $value);\r\n }",
"public function put($key, $value);",
"public function put($key, $value);",
"public function set($key, $value)\n {\n if ($this->_doValidate) {\n // validate the value passed\n ValueValidator::validate($value);\n }\n\n if ($key[0] === '_') {\n if ($key === self::ENTRY_ID) {\n $this->setInternalId($value);\n return;\n }\n\n if ($key === self::ENTRY_KEY) {\n $this->setInternalKey($value);\n return;\n }\n\n if ($key === self::ENTRY_REV) {\n $this->setRevision($value);\n return;\n }\n\n if ($key === self::ENTRY_ISNEW) {\n $this->setIsNew($value);\n return;\n }\n }\n\n if (!$this->_changed) {\n if (!isset($this->_values[$key]) || $this->_values[$key] !== $value) {\n // set changed flag\n $this->_changed = true;\n }\n }\n\n // and store the value\n $this->_values[$key] = $value;\n }",
"public function __set($key, $value) {\n\t\t$this->set($key, $value);\n\t}",
"public function set(string $key, mixed $value): void\n {\n }",
"public function __set($key,$value) {\n $cur = $this->key();\n if(!isset($this->_changed[$cur]) || !is_array($this->_changed[$cur])){\n $this->_changed[$cur]=[];\n }\n if($this->$key != $value){\n $this->_changed[$cur][$key] = $value;\n }\n $this->_data[$cur][$key] = $value;\n }",
"public function __set($key, $value) {\n $this->setField($key, $value);\n }",
"public function set ($key, $value) {\r\n\t\t$this->_data[$key] = $value;\r\n\t}",
"public function set($key, $value)\r\n {\r\n $this->values[$key] = $value;\r\n }",
"abstract protected function putValue($key, $value);",
"public function __set($key, $value)\n {\n\n $this->setData($key, $value);\n\n }",
"public function __set($key, $value) {\n $this->pos = 0;\n $this->data[$key] = $value;\n $this->keys = array_keys($this->data);\n }",
"public function set($key, $data);",
"public function __set($key, $value)\n\t{\n\t\tparent::__set($key, $value);\n\t}",
"public function __set($key, $value)\n\t{\n\t\t$this->set($key, $value);\n\t}",
"public function setPropByRef($name, &$value)\n {\n $this->engine->assignByRef($name, $value);\n }",
"public function set($key, $value)\n {\n return $this->add('set', $key .' = ' . $value, true);\n }",
"public function set($key, $value)\n {\n $this->engine->assign($key, $value);\n }",
"public function set($key, $value)\n {\n $this->engine->assign($key, $value);\n }",
"public function set($key, $value) {\n\t\t$this->data[$key] = $value;\n\t}",
"public final function __set($key, $value)\n {\n $this->set($key, $value);\n }",
"public function __set($key, $value)\n {\n $this->stack[$key] = $value;\n }",
"public /*void*/ function __set(/*scalar*/ $key, /*mixed*/ $value){}",
"public function set($key,$value) {\n $this->_data[$key]=$value;\n }",
"public function __set( $key, $value ) {\n\n\t\t$this->_data[ $key ] = $value;\n\t}",
"public function __set($key, $value)\r\n {\r\n $this->shared_data->set($key, $value);\r\n }",
"public function __set(string $key, $value): void\n\t{\n\t\tif ($this->parentIsSet($key)) {\n\t\t\t$this->parentSet($key, $value);\n\n\t\t} else {\n\t\t\t$this->data[$key] = $value;\n\t\t}\n\t}",
"public function set ($key, $value) {\n\t\t$this->root = $this->setLoop($key, $value, $this->root);\n\t}",
"public function __set($key, $value)\n {\n $this->set($key, $value);\n }",
"public function __set($key, $value)\n {\n $this->set($key, $value);\n }"
] | [
"0.7614492",
"0.7582375",
"0.7481037",
"0.7252821",
"0.7138896",
"0.6894457",
"0.689085",
"0.689085",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.687702",
"0.67629737",
"0.67097557",
"0.67097557",
"0.66704524",
"0.664618",
"0.6619647",
"0.6593031",
"0.6593031",
"0.65515214",
"0.65166664",
"0.65166664",
"0.6495166",
"0.6486881",
"0.64673746",
"0.64673746",
"0.64673746",
"0.6418846",
"0.64082515",
"0.6359866",
"0.63507843",
"0.6341185",
"0.63190764",
"0.63190764",
"0.6316896",
"0.62881655",
"0.6270631",
"0.62082523",
"0.6201485",
"0.6201043",
"0.619635",
"0.619635",
"0.61900306",
"0.61733234",
"0.6172973",
"0.6172973",
"0.6157355",
"0.6142617",
"0.6142617",
"0.61422485",
"0.61393255",
"0.6126664",
"0.6104206",
"0.6087524",
"0.6087316",
"0.6087316",
"0.60483646",
"0.60474074",
"0.60474074",
"0.6040503",
"0.60363984",
"0.60294837",
"0.60279673",
"0.60237247",
"0.60037905",
"0.5982425",
"0.5981318",
"0.5969992",
"0.5969818",
"0.59664387",
"0.5963774",
"0.59481835",
"0.59421486",
"0.5936645",
"0.5934985",
"0.5934985",
"0.5930511",
"0.5929724",
"0.5922556",
"0.5916998",
"0.59166133",
"0.59048724",
"0.5903016",
"0.59011674",
"0.5894694",
"0.58925647",
"0.58925647"
] | 0.0 | -1 |
Get the value of the given key If the given key is null, the entire data container will be returned. If the given key is not found, the given default value will be returned. | public function &get(string $key = null, mixed $default = null): mixed
{
if (is_null($key)) {
return $this->data;
}
$data = &$this->data;
foreach (explode($this->delimiter, $key) as $segment) {
if (! is_array($data) || ! isset($data[$segment])) {
return $default;
}
$data = &$data[$segment];
}
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($key, $default = null) {\n if ($this->exists($key)) {\n return $this->data[$key];\n }\n\n return $default;\n }",
"public function get( $key, $default = null ) {\n\t\treturn data_get( $this->data, $key, $default );\n\t}",
"function getValue($key, $default = null)\r\n {\r\n return $this->coalesce($this->container[$key], $default);\r\n }",
"public function get($key, $default = null)\n {\n return array_key_exists($key, $this->data) ? $this->data[$key] : $default;\n }",
"public function get( $key, $default = null )\n\t\t{\n\t\t\treturn isset( $this->_data[ $key ] )? $this->_data[ $key ]: $default;\n\t\t}",
"private function get($key, $default = null)\n {\n $key = mb_strtolower($key);\n\n return isset($this->data[$key]) ? $this->data[$key] : $default;\n }",
"public function get($key, $default = null)\r\n\t{\r\n\t\tlist($baseKey, $searchKey) = $this->fetchKey($key);\r\n\r\n\t\t$value = $this->fetchValue($baseKey, $searchKey);\r\n\r\n\t\treturn ( ! is_null($value) ) ? $value : $default;\r\n\t}",
"public function get ($key, $default=false) {\r\n\t\treturn !empty($this->_data[$key])\r\n\t\t\t? $this->_data[$key]\r\n\t\t\t: $default\r\n\t\t;\r\n\t}",
"public function get($key, $default = null)\n {\n $data = new Data(self::$configs);\n\n if ($this->has($key)) {\n return $data->get($key);\n }\n\n return $default;\n }",
"public function get(string $key, $default = null): mixed;",
"public function get(string $key, mixed $default = null): mixed;",
"public function get(string $key, mixed $default = null): mixed;",
"public function getData($key, $default = null)\n\t{\n\t\treturn (isset($this->data[$key]) ? $this->data[$key] : $default);\n\t}",
"public function get($key, $default=false) {\n if(isset($this->_data[$key]))\n return $this->_data[$key];\n return $default;\n }",
"public function __get($key, $default = null)\n\t{\n\t\tif(isset($this->data[$key])) {\n\t\t\treturn $this->data[$key];\n\t\t}\n\t\treturn $default;\n\t}",
"public function get($key, $default = null)\n {\n return (!is_null($item = $this->retrieve($key))) ? $item : $default;\n }",
"public function get($key, $default = null)\n {\n if(!isset($this->item[$item = explode('.', $key)[0]])){\n $this->add($item);\n }\n return data_get($this->item, $key, $default);\n }",
"public function get($key, $default = null)\n {\n return DotArr::get($this->data, $key, $default);\n }",
"public function get($key = null, $default = null) {\n\t\t\treturn $this->method == self::METHOD_GET\n\t\t\t\t? $this->data($key, $default)\n\t\t\t\t: null;\n\t\t}",
"public function getData(string $key = null, $default = null)\n {\n if (!empty($key)) {\n return $this->data[$key] ?? $default;\n } else {\n return $this->data;\n }\n }",
"public static function get ( $key, $default = null ) {\n return self::getAdapter()->get( $key );\n }",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function data($key, $default = NULL)\n\t{\n\t\t$data = $this->_data;\n\t\treturn isset($data[$key]) ? $data[$key] : $default;\n\t}",
"public function get(string $key, mixed $default = null): mixed\n {\n $data = $this->arrayify();\n\n return array_get($data, $key, $default);\n }",
"public function get($key = null, $default = null)\n {\n if($key == null){\n return $this->get;\n }\n else {\n if(array_key_exists($key, $this->get)){\n return $this->get[$key];\n }\n return $default;\n }\n }",
"public function get($key, $default = null)\r\n {\r\n if ($this->offsetExists($key)) {\r\n return $this->items[$key];\r\n }\r\n\r\n return value($default);\r\n }",
"public function value($key, $default = NULL)\n {\n return $this->get($key, $default);\n }",
"public function get($key, $default = null)\n\t{\n\t\tif ($option = self::where('key', $key)->first()) {\n\t\t\treturn $option->value;\n\t\t}\n\n\t\treturn $default;\n\t}",
"public function get($key, $default = null)\n {\n if ($this->offsetExists($key)) {\n return $this->items[$key];\n }\n\n return $default;\n }",
"public function get($key, $default = null)\n {\n if(isset($this->values[$key])) {\n return $this->values[$key];\n }\n return $default;\n }",
"public function getValueOrDefault($key) {\n return $this->values->get($key) !== NULL\n ? $this->values->get($key)\n : $this->values->get('Default'.$key);\n }",
"public function get(string $key, $default = null);",
"public function get(string $key, $default = null);",
"public function get(string $key, $default = null);",
"public function get(string $key, $default = null);",
"public function get(string $key, $default = null);",
"public function get(string $key, $default = null);",
"public function get(string $key, $default = null);",
"public function get(string $key, $default = null);",
"public function get($key, $default = null)\n {\n $value = $this->driver->get($key);\n\n return ! is_null($value) ? $value : value($default);\n }",
"public function getValue( $a_key, $a_default = null )\r\n\t{\r\n\t\treturn $this->_get($a_key, $a_default);\r\n\t}",
"public function getVar( $data, $key, $default = null )\n {\n if (empty($data) || is_null($key) || '' === $key)\n return $default;\n\n if (is_array($data)) {\n $value = isset( $data[ $key ] ) ? $data[ $key ] : $default;\n } \n elseif (is_object($data)) {\n $value = isset( $data->$key ) ? $data->$key : $default;\n }\n else {\n $value = $default;\n }\n\n return $value;\n }",
"public static function Get($key = '')\r\n {\r\n $result = null;\r\n if (isset(self::$Data[$key])) {\r\n $result = self::$Data[$key];\r\n } else {\r\n $defaults = self::GetAllDefaults();\r\n if (isset($defaults[$key])) {\r\n $result = $defaults[$key];\r\n }\r\n }\r\n return $result;\r\n }",
"public function get($key, $default = null) {\n return array_key_exists($key, $this->values) ? $this->values[$key] : $default;\n }",
"public function get( $key, $default = null )\n\t{\n\t\treturn Arr::get( $this->items, $key, $default );\n\t}",
"public function get($key, $default = null)\n {\n if (isset($this->queryHits[$key])) {\n return $this->queryHits[$key];\n }\n\n if (isset($this->queryMisses[$key])) {\n return $default;\n }\n\n list($namespace, $dataKey) = $this->namespaceAndKey($key);\n\n $prefix = $this->firstKeySegments($dataKey, $this->prefixLength($namespace, $dataKey));\n $arrayKey = $this->arrayKey($dataKey, $prefix);\n\n foreach ($this->dataForPrefix($namespace, $prefix) as $data) {\n\n if (!is_array($data)) {\n $this->queryHits[$key] = $data;\n return $data;\n }\n\n $result = $arrayKey ? Helper::offsetGet($data, $arrayKey) : $data;\n\n if ($result === null) {\n continue;\n }\n\n $this->queryHits[$key] = $result;\n return $result;\n }\n\n $this->queryMisses[$key] = true;\n\n return $default;\n\n }",
"public function get(string $key, $default = null)\n {\n\t\treturn array_key_exists($key, $this->values) ? $this->values[$key] : $default;\n\t}",
"public function get($key, $default = null)\n {\n return Arr::get($this->items, $key, $default);\n }",
"public function get($key, $default = null)\n {\n if ($this->containsKey($key)) {\n return $this->items[$key];\n }\n\n return $default;\n }",
"public function get( $key = null, $default = null )\n {\n return Utils::get( $this->_original, $key, $default );\n }",
"public function getValue($key, $default = null)\n {\n if (is_array($this->kwargs) && isset($this->kwargs[$key])) {\n return $this->kwargs[$key];\n }\n return $default; // @codeCoverageIgnore\n }",
"public function get($key, $default = null)\n\t{\n\t\tif (isset($this->_object[$key]))\n\t\t{\n\t\t\treturn $this->_object[$key];\n\t\t}\n\t\t\n\t\treturn $default;\n\t}",
"public function get(string $key, $default = null)\n {\n return array_get($this->raw, $key, $default);\n }",
"public function val($key, $default = null) {\n return $this->field[$key] ?? $default;\n }",
"function get($key, $default = null);",
"public function get( $key, $default = null )\n\t{\n\t\treturn $this->getObject()->get( $key, $default );\n\t}",
"public function get($key, $default = null)\n {\n\n $value = $this->store->get($key);\n\n if (is_null($value)){\n $value = value($default);\n }\n\n return $value;\n }",
"public function get($key, $default = null)\n {\n if ($key == '*') {\n return $this->all();\n }\n\n if ($this->exists($key)) {\n return $this->offsetGet($key);\n }\n\n return $default;\n }",
"public function getOrDefault($key, $defaultValue);",
"public function get(string $key, $default = null)\n {\n return Arr::get($this->values, $key, $default);\n }",
"public static function get($key, $default = null)\n {\n return Arr::get(static::load(), self::buildKey($key), $default);\n }",
"private function _get($key, $default = null) {}",
"public function getData($key, $default = null)\n {\n return (!isset($this->gateway_data[$key])) ? $default : $this->gateway_data[$key];\n }",
"public function getIfExists($key, $default_value=null);",
"public function get($key,$default = null)\n {\n return $this->manager->get($key,$this->getName(),$default);\n }",
"public function get( $a_key, $a_default = null )\r\n\t{\r\n\t\treturn $this->_get($a_key, $a_default);\r\n\t}",
"public function get($key = null, $default = null)\n {\n if (null === $key) {\n return $this->items;\n }\n\n if ($this->_uses($key)) {\n return $this->_get($this->items, $key, $default);\n } else {\n if (array_key_exists($key, $this->items)) {\n return $this->items[$key];\n }\n }\n\n return $default;\n }",
"public static function get(?string $key = null, $default = null)\n {\n return static::getInstance()->get($key, $default);\n }",
"final public static function get($key, $default = FALSE) {\n if (is_num($key) OR is_false($old = static::fetch_item($key))) {\n return $default;\n }\n return $old;\n }",
"public function get($key, $default = null)\n {\n return @isset($this->fields[$key])\n ? $this->fields[$key]\n : $default;\n }",
"public function get($key, $default = null)\n {\n return $this->query->get(\n $key,\n $this->attributes->get(\n $key,\n $this->request->get(\n $key,\n $default\n )\n )\n );\n }",
"public function get($key, $defaultValue = null);",
"public function get($key, $defaultValue = null)\n {\n return (array_key_exists($key, $this->data)) ? $this->data[$key] : $defaultValue;\n }",
"public function get($key, $defaultValue = null)\n {\n return (array_key_exists($key, $this->data)) ? $this->data[$key] : $defaultValue;\n }",
"public function get($key, $default = []);",
"public function get(string $key, mixed $default = null): mixed\n {\n $value = $this->cache->get($key);\n\n if ($value === null) {\n return $default;\n }\n\n return $value;\n }",
"public function get ($key, $default=false);",
"public static function get( $key = null, $default = null )\n\t{\n\t\tif ($key === null)\n\t\t{\n\t\t\treturn self::$container;\n\t\t}\n\t\treturn isset( self::$container[ $key ] ) ? self::$container[ $key ] : $default;\n\t}",
"public function result($key = NULL, $default = 0)\n\t{\n\t\tif (is_null($this->_result)) return NULL;\n\n\t\tif (isset($key))\n\t\t{\n\t\t\treturn array_get($this->_result, $key, $default);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_result;\t\n\t\t}\n\t}",
"public function get(string $key, $default = false);",
"static function get($key = null, $default = null){\n\t\t\tif(empty($key)){ return self::$vars; }\n\n\t\t\tif(isset(self::$vars[$key])){\n\t\t\t\treturn self::$vars[$key];\n\t\t\t} else {\n\t\t\t\treturn $default;\n\t\t\t}\n\t\t}",
"public function get($key, $default = null)\n {\n $cache = unserialize(file_get_contents($this->cacheFile));\n $cache = $this->cleanCache($cache, $this->cacheFile);\n\n if (! isset($cache[$key])) {\n return $default;\n }\n\n return $cache[$key]['v'];\n }",
"public function get(\n string $key,\n $default = null,\n ) {\n $this->boot();\n\n /**\n * @var Get $event\n */\n $event = $this->configuration->eventDispatcher()->dispatch(new Get($this, $key));\n $value = $event->getValue();\n\n if (null === $value) {\n return $default;\n }\n\n return $value;\n }",
"public function get ($key, $default = null): mixed\n {\n if ($this->existsInCache($key)){\n return $this->fromCache($key);\n }\n\n return $this->addToCache(\n $key, $this->extractFromConfig($key)?? $default\n );\n }",
"abstract public function Get(string $key, $default = NULL);"
] | [
"0.8284028",
"0.8228508",
"0.82257825",
"0.8134114",
"0.80666196",
"0.79134464",
"0.7913052",
"0.7901247",
"0.78848165",
"0.7873556",
"0.7873159",
"0.7873159",
"0.78592163",
"0.7854862",
"0.7826716",
"0.7812406",
"0.77836376",
"0.77778924",
"0.7776032",
"0.77375144",
"0.77216864",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7698855",
"0.7672592",
"0.76713216",
"0.76647305",
"0.7663148",
"0.76589346",
"0.76562977",
"0.76548994",
"0.76328444",
"0.76280504",
"0.76230705",
"0.76230705",
"0.76230705",
"0.76230705",
"0.76230705",
"0.76230705",
"0.76230705",
"0.76230705",
"0.7620937",
"0.7603257",
"0.75990385",
"0.7597615",
"0.7586716",
"0.75395054",
"0.75206757",
"0.7520505",
"0.7501645",
"0.74981636",
"0.7469825",
"0.7461141",
"0.74553984",
"0.7453938",
"0.7442209",
"0.74218696",
"0.74013394",
"0.7399803",
"0.7392724",
"0.7382806",
"0.73708695",
"0.73657227",
"0.7340157",
"0.7334458",
"0.7331825",
"0.7327626",
"0.73050743",
"0.72870857",
"0.7270985",
"0.7255595",
"0.7210205",
"0.72072136",
"0.71890444",
"0.71866536",
"0.71866536",
"0.71632695",
"0.71619004",
"0.7158076",
"0.71536124",
"0.7133978",
"0.71183765",
"0.71128637",
"0.70973366",
"0.70935667",
"0.7092252",
"0.7078235"
] | 0.72159994 | 84 |
Remove the given key | public function forget(string $key): static
{
$data = &$this->data;
$segments = explode($this->delimiter, $key);
$key = array_pop($segments);
foreach ($segments as $segment) {
if (! isset($data[$segment])) {
return $this;
}
$data = &$data[$segment];
if (! is_array($data)) {
return $this;
}
}
unset($data[$key]);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key);",
"public function remove($key) {}",
"public function remove(string $key);",
"protected function _removeKey($key) {}",
"function remove($key);",
"function remove($key);",
"function remove ($key);",
"abstract public function remove($key);",
"public function removeItem($key);",
"public function remove(string $key): void;",
"function remove(string $key): void;",
"public function removeAt($key);",
"public function del($key);",
"public function remove($key){\n\n }",
"public function remove($key) {\n unset($this->_hash[$key]);\n }",
"public function remove(string $key): self;",
"public function __unset($key);",
"public function __unset($key);",
"public function erase($key);",
"public function rem($key);",
"public function unsetKey(string $key);",
"public function delete( $key );",
"function rm($key) {\n }",
"public function delete($key);",
"public function delete($key);",
"public function delete($key);",
"function remove($key)\n {\n unset($this->data[$key]);\n }",
"function remove($key)\n {\n unset($this->data[$key]);\n }",
"public function remove($key)\n {\n unset($this->data[$key]);\n }",
"public function delete($key): void;",
"public function Remove($key)\n {\n $actualKey = null;\n if($this->_key($key, $actualKey))\n {\n unset($this->_keyValPairs[$actualKey]);\n }\n }",
"public function remove(string $key): void\n {\n\t\tunset($this->values[$key]);\n\t}",
"public function remove($key)\n\t{\n\t\tif (isset($this->data[$key])) {\n\t\t\tunset($this->data[$key]);\n\t\t}\n\t}",
"public function unlink($key);",
"public function remove(string $key): bool {}",
"public static function remove($key)\n {\n unset(self::$map[$key]);\n }",
"public function deleteItem($key);",
"public function remove($key)\n {\n unset($this->items[$key]);\n }",
"public function __unset($key) {\n\t\t$this->remove($key); \n\t}",
"public function __unset($key) {\n\t\t$this->remove($key); \n\t}",
"public function remove($key)\r\n {\r\n unset($this->attributes[$key]);\r\n }",
"abstract public function delete( $key );",
"public function delete(string $key): void;",
"abstract public function delete ($key);",
"abstract public function delete($key);",
"public function without($key);",
"public function query_remove($key) {\n\t\t\t\\uri\\query::remove($this->object, $key);\n\t\t}",
"public function remove($key)\r\n {\r\n unlink($this->getFullFileName($key));\r\n }",
"public function __unset($key)\r\n {\r\n $this->remove($key);\r\n }",
"public function remove(string $key): void\n {\n unset($this->items[$key]);\n }",
"function remove($key) {\n return apc_delete($key);\n }",
"public function remove($key)\n {\n if ($this->offsetExists($key)) {\n $this->offsetUnset($key);\n }\n }",
"public function remove($key, $value = '');",
"public function remove($key) {\n return apc_delete($key);\n }",
"public function remove($key)\r\r\n\t{\r\r\n\t\t$this->_storage->remove($key);\r\r\n\t}",
"public function remove($key)\r\n {\r\n return apc_delete($key);\r\n }",
"public function remove( $key ) {\n\t\tif (isset($this->array[$key])) {\n\t\t\tunset($this->array[$key]);\n\t\t}\n\t}",
"public static function remove($key){\n if(self::exists($key)){\n unset(self::$answers[strtolower($key)]);\n }\n }",
"public function remove($key) {\n return $this->connection->delete($this->key($key));\n }",
"public function forget($key);",
"public function forget($key);",
"public function forget($key);",
"public function forget($key);",
"public function remove($key) {\r\n\t\tif(in_array($key, array_keys($key))) {\r\n\t\t\tunset($this->arg[$key]);\r\n\t\t\t--$this->size;\r\n\t\t}\r\n\t}",
"public function __unset($key)\r\n {\r\n $this->shared_data->remove($key);\r\n }",
"public function __unset($key)\n\t{\n\t\t$this->delete($key);\n\t}",
"public function __unset($key)\n {\n $this->forget($key);\n }",
"public /*void*/ function __unset(/*scalar*/ $key){}",
"private function delKey($key)\n {\n $this->model::where('key', $key)->get()->map(function($row){ $row->delete(); });\n }",
"function delete($key) {\n\t\tunset($this->_cache[$key]);\n\t}",
"public function __unset($key)\n {\n }",
"public static function delete($key)\n {\n if (self::has($key)) {\n unset(self::$__request[$key]);\n }\n }",
"public function remove($key, $id)\n\t{\n\t\treturn db::delete($this->_table_name.'_'.AutoModeler::factory(inflector::singular($key))->get_table_name())->where($key.'_id', '=', $id)->where(inflector::singular($this->_table_name).'_id', '=', $this->_data['id'])->execute($this->_db);\n\t}",
"public function __unset($key) {\n unset(current($this->_data)[$key]);\n }",
"public function unsetValue($key);",
"public static function Remove($key)\n {\n unset($_REQUEST[$key]);\n }",
"public function remove($key) {\n\t\t$value = isset($this->data[$key]) ? $this->data[$key] : null;\n\t\t$this->trackChange(\"unset:$key\", $value, null); \n\t\tunset($this->data[$key]); \n\t\treturn $this;\n\t}",
"public function offsetUnset( $key );",
"abstract public function forget($key);",
"public function remove($key)\n {\n if(isset($this->list[$key]))\n {\n unset($this->list[$key]);\n }else\n {\n throw new InvalidCollectionKey(\"The key provided does not exist\");\n }\n }",
"public function offsetUnset($key) {\n\t\t$this->remove($key);\n\t}",
"public function deleteItem($key)\n {\n }",
"public function removeKey($key, $id = null)\n {\n $params['index'] = $this->model->getIndex();\n $params['type'] = $this->model->getType();\n if ($this->model->_id == null) {\n $params['id'] = $id;\n }\n $params['body']['script'] = \"ctx._source.remove(\\\"\".$key.\"\\\")\";\n return $this->client->update($params) ? true : false;\n }",
"public function remove( $key ) \n {\n unset( $this->variables[$key] );\n }",
"public function delInCache($key);",
"public function __unset( $key ) {\n\t\tunset( $this->_data[$key] );\n\t}",
"public function delete_key($key){\n if($this->driver==\"file\"){\n $this->file->delete_file($this->path.md5($key).\".txt\");\n }\n if($this->driver==\"redis\"){\n $this->redis->hDel($this->path,md5($key));\n }\n }",
"public function remove($key) \r\n {\r\n if(is_null($key)) \r\n {\r\n throw new ArgumentNullException(\"key is null.\");\r\n }\r\n \r\n unset($this->elements[$key]);\r\n }",
"public function offsetUnset($key)\r\n {\r\n $this->remove($key);\r\n }",
"public function remove(string $key): void\n\t{\n\t\tunset($this->headers[$this->formatKey($key)]);\n\t}",
"public function remove($key, $force = false);",
"public function forget(string $key): void;",
"public function removeObjectForKey($key)\n {\n $this->removeObjectForKeyWithLifeTimePathAndDomain($key);\n }",
"public function delete($key) {\n\t\t// and return the result\n\t\treturn eaccelerator_rm($key);\n\t}"
] | [
"0.9121032",
"0.9121032",
"0.9121032",
"0.9121032",
"0.9121032",
"0.9121032",
"0.9121032",
"0.9121032",
"0.90813917",
"0.9058851",
"0.8958092",
"0.8891371",
"0.8891371",
"0.88369817",
"0.8807458",
"0.86597097",
"0.856772",
"0.85661155",
"0.85380894",
"0.84892803",
"0.8457287",
"0.8400445",
"0.8340585",
"0.8207389",
"0.8207389",
"0.8179031",
"0.817667",
"0.81625074",
"0.81368047",
"0.81324387",
"0.80713546",
"0.80713546",
"0.80713546",
"0.8008029",
"0.8008029",
"0.7988366",
"0.7967764",
"0.78968453",
"0.7883882",
"0.78448474",
"0.784322",
"0.7825625",
"0.78153455",
"0.77878064",
"0.77776927",
"0.7761394",
"0.7761394",
"0.77555656",
"0.77547425",
"0.7741546",
"0.7739677",
"0.7737223",
"0.7707551",
"0.7704854",
"0.77014273",
"0.77010715",
"0.76993906",
"0.7673357",
"0.7672313",
"0.7663584",
"0.7660476",
"0.76520157",
"0.7590321",
"0.7576369",
"0.753353",
"0.75156325",
"0.75007683",
"0.75007683",
"0.75007683",
"0.75007683",
"0.7478933",
"0.74722373",
"0.74630433",
"0.74345046",
"0.7434324",
"0.74249685",
"0.7424127",
"0.74182415",
"0.74097455",
"0.7363246",
"0.7340175",
"0.7311468",
"0.730678",
"0.7291539",
"0.7289729",
"0.72757864",
"0.7262958",
"0.7252254",
"0.7247043",
"0.7241349",
"0.72391975",
"0.7236336",
"0.72360843",
"0.72148937",
"0.7210349",
"0.72102433",
"0.7206525",
"0.7204917",
"0.72018653",
"0.7201002",
"0.71893215"
] | 0.0 | -1 |
Check if the given key exists | public function has(string $key): bool
{
$data = $this->data;
foreach (explode($this->delimiter, $key) as $segment) {
if (! is_array($data) || ! isset($data[$segment])) {
return false;
}
$data = $data[$segment];
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function exist($key) ;",
"public function exist($key);",
"public function keyExists(string $key): bool;",
"public function exists($key);",
"public function exists(string $key);",
"public function exists($key): bool;",
"function exists($key);",
"public function exists(string $key): bool\n {\n }",
"public function has(string $key): bool {}",
"public function itemExists($key);",
"public function has($key) : bool;",
"public function has(string $key) : bool;",
"public function exists($key) {\n return false;\n }",
"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 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 issetKey(string $key) : bool;",
"public function containsKey($key): bool;",
"public function containsKey($key): bool;",
"abstract public function has(string $key): bool;",
"public function exist($keyName);",
"abstract public function has( $key );",
"public function isExistInCache($key);",
"public function containsKey($key);",
"public function exists($key){\n\n //get exists\n if($this->client->exists($key)){\n return true;\n }\n return false;\n }",
"public function exist(string $key): bool\r\n {\r\n return isset($this->$key) === true;\r\n }",
"public function hasItem(string $key): bool;",
"public function hasItem(string $key): bool;",
"function exists($key) {\n\t\treturn isset($this->args[$key]);\n\t}",
"function has($key);",
"public function exists(string $key): bool\n\t{\n\t\treturn array_key_exists($this->formatKey($key), $this->all());\n\t}",
"public function hasKey(string $filename, string $key): bool;",
"public function exists( $key = '' )\n\t{\n\t\tif( isset( $this->src[$key] ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function exists(string $key): bool\n {\n return $this->factoryFromKey($key)->exists($key);\n }",
"function has ($key);",
"public function exists($key)\n\t{\n\t\treturn self::where('key', $key)->exists();\n\t}",
"private function keyExists(string $key)\n {\n return array_key_exists($key, $this->definitions);\n }",
"public function isset($key): bool;",
"public function containsKey($key)\n {\n }",
"public function is_key($key) {\n try{\n return isset($this->Items[$key]);\n }catch(Exception $e){\n throw $e;\n }\n }",
"public function __isset(string $key): bool;",
"function exists($key) {\n\t\treturn array_key_exists($key,$this->item);\n\t}",
"public function HasKey($key)\n {\n $actualKey = null;\n return $this->_key($key, $actualKey);\n }",
"public function keyExists($key)\n {\n return apc_exists($key);\n }",
"public function containsKey($key) {\n return array_key_exists($key, $this->_hash);\n }",
"public function exists(string $key): bool {\n $return = FALSE;\n if ($this->driver) {\n $return = $this->driver->exists($key);\n }\n return $return;\n }",
"public function exists($key){\n\t\treturn apc_exists($key);\n\t}",
"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 hasKey($key) {\n if ($this->client) {\n return $this->client->exists($key);\n }\n return false;\n }",
"function has($key = '')\n {\n }",
"public function exists ($key)\n {\n return apc_exists($key);\n }",
"public function has(string $key): bool\n {\n return false;\n }",
"public function exist($key)\n {\n return isset($this->_data[$key]);\n }",
"public function exists($key) {\n return apc_exists($key);\n }",
"public function key_exists($key) {\n return in_array($key, array_keys($this->params));\n }",
"public function hasKey($key){\n $item = CacheManager::getInstance('files')->getItem($key);\n return !is_null($item->get());\n }",
"public function hasKey($key)\n {\n return isset($this->items[ $key ]);\n }",
"public function keyExists($key)\n {\n\t\tif (is_array($this->_source))\n\t\t{ \n \n \t\treturn array_key_exists($key, $this->_source);\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n }",
"public function query_exists($key) {\n\t\t\treturn \\uri\\query::exists($this->object, $key);\n\t\t}",
"public function contains(string $key): bool;",
"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 has(string $key): bool\n {\n // TODO: Implement has() method.\n }",
"public function exists($key)\n\t{\n\t\treturn isset($this->_object[$key]);\n\t}",
"public function exists($key)\n {\n return ($this->driver->get($key)) ? 1 : 0;\n }",
"public function exists($key) {\n\t\treturn $this -> get($key) === FALSE;\n\t}",
"public function has($key) {\n\t\treturn file_exists($this->_dir . $key);\n\t}",
"public function exists($key)\n\t{\n\t\t$result = $this->cacheLayer->exists($key);\n\t\tLogger::getInstance()->log(LoggerEntry::CACHE, 'Cache', 'Try to find key [' . $key . '] into cache: ' . ($result ? 'true' : 'false'));\n\t\treturn $result;\n\t}",
"public function exists(string $key): bool\n {\n return apcu_exists(\n $this->getFinalKey($key)\n );\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 }",
"abstract public function contains($key): bool;",
"abstract public function Has(string $key) : bool;",
"public function has(string $key): bool\n {\n return (bool) $this->getAdapter()->exists($key);\n }",
"public function __isset($key)\r\n {\r\n return $this->exists($key);\r\n }",
"public function exist(string $key): bool\n {\n return $this->getTable()->exist($key);\n }",
"public function hasKey ($key) {\n\n return isset($this->values[$key]);\n\n }",
"public function has(mixed $key): bool\n {\n return $this->indexOf($key) > -1;\n }",
"public function containsKey(string|int $key): bool;",
"public static function has(string $key): bool\n {\n return static::getInstance()->has($key);\n }"
] | [
"0.8792048",
"0.8720139",
"0.86420125",
"0.8555259",
"0.8527922",
"0.8496382",
"0.8386396",
"0.83124524",
"0.8167436",
"0.8137039",
"0.81341964",
"0.80722743",
"0.80619895",
"0.80537766",
"0.80537766",
"0.80537766",
"0.80537766",
"0.80537766",
"0.80537766",
"0.80537766",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.8025081",
"0.79733986",
"0.79485065",
"0.7938697",
"0.7938697",
"0.79373187",
"0.7898514",
"0.78900814",
"0.78601044",
"0.7855956",
"0.78301835",
"0.7815685",
"0.7808987",
"0.7808987",
"0.7808212",
"0.77805406",
"0.77592915",
"0.7738449",
"0.7715905",
"0.7712026",
"0.7705385",
"0.76540256",
"0.7630757",
"0.76301265",
"0.7623827",
"0.7592717",
"0.7582641",
"0.75801164",
"0.75757384",
"0.75463647",
"0.75377196",
"0.75337917",
"0.75332695",
"0.75292027",
"0.752872",
"0.75216407",
"0.75200284",
"0.75100327",
"0.750405",
"0.74995005",
"0.748697",
"0.74678886",
"0.746589",
"0.7464391",
"0.7461919",
"0.7446641",
"0.74294597",
"0.7426345",
"0.74150765",
"0.73862624",
"0.73860806",
"0.73760605",
"0.73651004",
"0.73557043",
"0.7342836",
"0.7341303",
"0.73390675",
"0.7332639",
"0.7331371",
"0.7327176",
"0.73239964",
"0.73227984",
"0.7317591",
"0.73147386"
] | 0.0 | -1 |
Get all data as a flat array | public function flatten(string $prefix = null): array
{
$result = [];
$data = $this->get($prefix);
foreach ($data as $itemKey => $value) {
$nextKey = is_null($prefix) ? $itemKey : $prefix . $this->delimiter . $itemKey;
if (is_array($value)) {
$result[] = $this->flatten($nextKey);
} else {
$result[] = [$nextKey => $value];
}
}
return array_merge(...$result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _getData(): array\n {\n $result = [\n ];\n\n return parent::normalizeData($result);\n }",
"public function getData() : array{\n $this->collection->rewind();\n $data = [];\n while($this->collection->valid()){\n $data[] = $this->collection->current()->getData();\n $this->collection->next();\n }\n return $data;\n }",
"public function toArray(): array\n {\n /* Enable extraction of data and priority */\n $this->setExtractFlags(self::EXTR_BOTH);\n\n /* Prepare output */\n $data = [];\n\n /* Iterate yourself */\n foreach ($this as $item) {\n $data[] = $item;\n }\n\n return $data;\n }",
"public function allFlattened(): array;",
"function toArray(){\r\n\t\treturn $this->data;\r\n\t}",
"public function data() : array\n {\n return $this->data->toArray();\n }",
"public function toArray() {\n return $this->getData();\n }",
"public function getData(): array;",
"public function getData(): array;",
"public function getData(): array;",
"public function getData(): array;",
"public function toArray() {\n\t\treturn $this->data;\n\t}",
"public function toArray()\r\n\t{\r\n\t\treturn $this->m_data;\r\n\t}",
"public function flatten(): array\n {\n return [\n 'id' => $this->ID,\n 'title' => $this->Title,\n 'location' => $this->Location,\n 'region' => $this->Region,\n 'bucket' => $this->Bucket,\n 'key' => $this->Key,\n 'etag' => $this->ETag,\n 'name' => $this->Name,\n 'size' => $this->getSizeForHuman(),\n 'type' => $this->Type\n ];\n }",
"public function toArray()\n {\n\t\t$rev = array();\n\t\tforeach($this->_data as $item){\n\t\t\t$rev[] = $item->toArray();\n\t\t}\n return $rev;\n }",
"private function _getData():array {\n\n # Set result\n $result = [];\n\n # Return result\n return $result;\n\n }",
"public function all()\n {\n return $this->getArray('');\n }",
"public function toArray(): array\n {\n $output = $this->data;\n $output = $this->filterNotItems($output);\n $output = $this->filterOnlyItems($output);\n $output = $this->filterEmpty($output);\n $output = $this->executeConvertEmpty($output);\n $output = $this->filterTemplate($output);\n return $this->pluckItems($output);\n }",
"public function get_all_data()\n\t{\n\t\treturn $this->_data;\n\t}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray() {}",
"public function toArray()\n {\n $_data = array();\n \n foreach ($this->_data as $key=>$val) {\n $_data[$key] = method_exists($val, 'toArray') ? $val->toArray() : $val;\n }\n \n return $_data;\n }",
"public function getData()\n {\n return array(\n\n );\n }",
"public function getAllData() {\n\t\treturn $this->data;\n\t}",
"public function getAsArray();",
"public function toArray() {\n return $this->data;\n }",
"public function toArray() {\n return $this->data;\n }",
"public function toArray()\n {\n return $this->_data;\n }",
"public function toArray()\n {\n return $this->_data;\n }",
"public function toArray()\r\n {\r\n return $this->all()->toArray();\r\n }",
"public function toArray()\r\n {\r\n return $this->data;\r\n }",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function toArray();",
"public function getAllData() {\n\t\treturn $this->_data;\n\t}",
"public function get_data(): array;",
"public function get_data(): array;",
"public function toArray() {\n\t\tforeach($this->_rows as $i => $row) {\n\t\t\t$this->_data[$i] = $row->toArray();\n\t\t}\t\n\t\treturn $this->_data;\n\t}",
"public function toArray(): array\n {\n return $this->data;\n }",
"public function toArray(): array\n {\n return $this->data;\n }",
"public function toArray()\n {\n\n\n return $this->data;\n }",
"public function toArray() : array\n {\n return $this->data;\n }",
"protected function getDataArray(): array\n {\n return [];\n }",
"public function _getData(): array\n {\n $result = [\n 'traveler' => $this->getTraveler(),\n 'watcher' => $this->getWatcher(),\n 'distance' => $this->getDistance(),\n ];\n\n return parent::normalizeData($result);\n }",
"public function toArray() : array\n {\n return $this->all();\n }",
"public function toArray()\n {\n return $this->data;\n }",
"public function toArray()\n {\n return $this->data;\n }",
"public function toArray()\n {\n return $this->data;\n }",
"public function toArray()\n {\n return $this->data;\n }",
"public function toArray()\n {\n return $this->data;\n }"
] | [
"0.74167407",
"0.721966",
"0.7145202",
"0.71348655",
"0.71005476",
"0.7068235",
"0.7039634",
"0.7031772",
"0.7031772",
"0.7031772",
"0.7031772",
"0.70282036",
"0.7027411",
"0.7021983",
"0.7021299",
"0.69979054",
"0.6992005",
"0.6984301",
"0.69720095",
"0.69601923",
"0.69601923",
"0.69601923",
"0.69601923",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6959824",
"0.6958632",
"0.6958632",
"0.69523424",
"0.69457537",
"0.6939848",
"0.6938414",
"0.6926123",
"0.6926123",
"0.69066256",
"0.69066256",
"0.69018686",
"0.6898769",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.68906236",
"0.6882084",
"0.68779325",
"0.68779325",
"0.68724203",
"0.6871387",
"0.6871387",
"0.6868417",
"0.68508804",
"0.6841881",
"0.6841756",
"0.6841604",
"0.684015",
"0.684015",
"0.684015",
"0.684015",
"0.684015"
] | 0.0 | -1 |
Merge the given data into the data container | public function merge(string|null|array $key, array $data = null): static
{
if (is_array($key)) {
$data = $key;
$key = null;
}
foreach ($data as $itemKey => $value) {
$itemKey = is_null($key) ? $itemKey : $key . $this->delimiter . $itemKey;
if (is_array($value)) {
$this->merge($itemKey, $value);
} else {
$this->set($itemKey, $value);
}
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function merge(&$data) {\n\t\tarray_merge($this->data, $data);\n\t}",
"public function mergeData($data) {\n if (empty($data)) return $this;\n\t\tforeach($data as $key=>$value) {\n\t\t\tif ((!array_key_exists($key, $this->_data) && ($key != $this->_key_field)) ||\n ($key != $this->_key_field) &&\n ($value != $this->_data[$key]) &&\n (isset($this->_structure['columns'][$key])\n || isset($this->_structure['relations'][$key])\n || isset($this->_structure['abilities'][$key]))) {\n $this->offsetSet($key, $value);\n } else {\n unset($data[$key]);\n }\n\t\t}\n return $this;\n\t}",
"public function mergeData(array ...$data)\n {\n return $this->setData(array_replace($this->getData(true), ...$data));\n }",
"public function mergeData($data)\n {\n $this->initialize();\n $data = $this->pickupData($data);\n foreach ($data as $column => $value) {\n $this->set($column, $value);\n }\n return $this;\n }",
"public function merge( array $data )\n\t\t{\n\t\t\t$this->_data = \\array_merge( $this->_data, $data );\n\t\t\treturn $this;\t\n\t\t}",
"public function merge( $data )\r\n {\r\n if (! empty( $data['items'] ))\r\n {\r\n foreach ( $data['items'] as $data_key => $data_item )\r\n {\r\n // does it exist in $this? if so, merge\r\n $exists = false;\r\n foreach ( $this->items as $key => $item )\r\n {\r\n if ($item['hash'] == $data_item['hash'])\r\n {\r\n $exists = true;\r\n $data_item['id'] = $item['id'];\r\n $this->items[$key] = $data_item;\r\n break;\r\n }\r\n }\r\n \r\n // otherwise add it\r\n if (! $exists)\r\n {\r\n $this->items[] = $data_item;\r\n }\r\n }\r\n \r\n $this->save();\r\n }\r\n \r\n return $this;\r\n }",
"public function mergeFrom(array $data);",
"protected function processData($data)\n {\n // reuse the existing collection to optimize for Doctrine\n if ($data instanceof Collection) {\n $currentData = $this->getData();\n\n if (!$currentData) {\n $currentData = $data;\n } else if (count($data) === 0) {\n $currentData->clear();\n } else {\n // merge $data into $currentData\n foreach ($currentData as $entity) {\n if (!$data->contains($entity)) {\n $currentData->removeElement($entity);\n } else {\n $data->removeElement($entity);\n }\n }\n\n foreach ($data as $entity) {\n $currentData->add($entity);\n }\n }\n\n return $currentData;\n }\n\n return $data;\n }",
"private function _mergeSuperposable($data)\n {\n return ($data['data']);\n }",
"protected function merge(array $data)\n {\n foreach ($data as $value) {\n DB::connection('c2')->table($this->table->to)\n ->where($this->table->matchKeys[1], $value[$this->table->matchKeys[0]])\n ->update($this->except($value, $this->table->matchKeys[0]));\n }\n }",
"protected function processData($data)\n {\n $this->data = array_replace_recursive($this->data, $data);\n }",
"public function merge()\n {\n $args = func_get_args();\n array_unshift($args, $this->data);\n $this->data = call_user_func_array('array_merge', $args);\n\n return $this; \n }",
"public function mergeData($data1, $data2, &$result) {\n $result = $data1;\n\n if (isset($data2['overlays'])) {\n if ($data2['overlays']) {\n $result['overlays'] = $data2['overlays'];\n/* TODO: Decide what 'merge' means for overlays...\n foreach ($data2['overlays'] as $id=>$content) {\n $result['overlays'][$id] = $content;\n }\n*/\n } else {\n unset($result['overlays']);\n }\n }\n if (isset($data2['crawlers'])) {\n if ($data2['crawlers']) {\n $result['crawlers'] = $data2['crawlers'];\n/* TODO: Decide what 'merge' means for crawlers...\n foreach ($data2['crawlers'] as $id=>$content) {\n $result['crawlers'][$id] = $content;\n }\n*/\n } else {\n unset($result['crawlers']);\n }\n }\n if (isset($data2['pip'])) {\n if ($data2['pip']) {\n $result['pip'] = $data2['pip'];\n } else {\n unset($result['pip']);\n }\n }\n if (isset($data2['click_url'])) {\n if ($data2['click_url']) {\n $result['click_url'] = $data2['click_url'];\n } else {\n unset($result['click_url']);\n }\n }\n return null;\n }",
"public function merge();",
"public static function merge(...$data)\n {\n if (empty($data)) {\n return [];\n }\n $return = array_shift($data);\n $from = static::getShallowType($return);\n foreach ($data as $datum) {\n $to = static::getShallowType($datum);\n if ($from === 'boolean') {\n $return = $datum;\n } elseif ($to === 'boolean') {\n $return = $datum === false ? false : $return;\n } elseif ($from === 'number' && $to === 'number') {\n $return = (float) $return + (float) $datum;\n } elseif (in_array($from, ['string', 'number']) && in_array($to, ['string', 'number'])) {\n $return .= $datum;\n } elseif ($from === 'object' && in_array($to, ['array', 'object'])) {\n foreach ($datum as $key => $value) {\n if (!is_int($key)) {\n if ((is_object($return->{$key}) || is_array($return->{$key})) &&\n (is_object($value) || is_array($value))\n ) {\n $return->{$key} = static::merge($return->{$key}, $value);\n } else {\n $return->{$key} = $value;\n }\n }\n }\n } elseif ($from === 'array' && $to === 'object') {\n foreach ($datum as $key => $value) {\n if ((is_object($return[$key]) || is_array($return[$key])) &&\n (is_object($value) || is_array($value))\n ) {\n $return[$key] = static::merge($return[$key], $value);\n } else {\n $return[$key] = $value;\n }\n }\n } elseif ($from === 'array' && $to == 'array') {\n foreach ($datum as $key => $value) {\n if (is_int($key)) {\n $return[] = $value;\n } else {\n if (isset($return[$key]) &&\n (is_object($return[$key]) || is_array($return[$key])) &&\n (is_object($value) || is_array($value))\n ) {\n $return[$key] = static::merge($return[$key], $value);\n } else {\n $return[$key] = $value;\n }\n }\n }\n } else {\n $return = $datum;\n }\n }\n return $return;\n }",
"public function putAll($data)\n\t{\n\t\t$this->data = array_merge($this->data, $data);\n\n\t\tif ($this->autosave) $this->write();\n\t}",
"public function merge() {}",
"public static function fill($data=[])\n {\n if(!empty($data)){\n foreach ($data as $item){\n self::add($item);\n }\n }\n\n }",
"public function add_data(array $data)\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $d ){\n\t\t\tif ( is_array($d) ){\n $this->data = $this->has_data() ? array_merge($this->data,$d) : $d;\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"public function withData(array $data) {\n\t\t$this->data = array_merge($this->data, $data);\n\t\treturn $this;\n\t}",
"public function populate($data)\n {\n $set_data = [];\n\n foreach ((array)$data as $row_key => $row_value) {\n if (is_array($row_value) && isset($this->groups[$row_key])) {\n foreach ($row_value as $row_subkey => $row_subvalue) {\n $set_data[$row_key . '_' . $row_subkey] = $row_subvalue;\n }\n } else {\n $set_data[$row_key] = $row_value;\n }\n }\n\n foreach ($set_data as $field_name => $field_value) {\n if (isset($this->fields[$field_name])) {\n $field = $this->fields[$field_name];\n $field->setValue($field_value);\n }\n }\n }",
"public function data(array $data)\n\t{\n\t\tself::$__data = array_merge(self::$__data, $data);\n\t}",
"final public function add_data($data = array())\n\t{\n\t\t$data = !is_array($data) ? (array)$data: $data;\n\t\t$this->data = array_merge($this->data, $data);\n\t}",
"public function fill($data){\n\n\t\t$not_added = array();\n\t\t\n\t\tif($this->check_fields){\n\t\t\tforeach($data as $key => $value){\n\t\t\t\tif(in_array($key, $this->fields)){\n\t\t\t\t\t$this->data[$key] = $value;\n\t\t\t\t}else{\n\t\t\t\t\t$not_added[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$this->data = $data;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function mergeWith($data, $recursive = true)\n\t{\n\t\tif (is_array($data) || $data instanceof \\Traversable) {\n\t\t\tif ($data instanceof self) {\n\t\t\t\t$data = $data->_d;\n\t\t\t}\n\t\t\tif ($recursive) {\n\t\t\t\tif ($data instanceof \\Traversable) {\n\t\t\t\t\t$d = array();\n\t\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t\t$d[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t\t$this->_d = ArrayHelper::merge($this->_d, $d);\n\t\t\t\t} else {\n\t\t\t\t\t$this->_d = ArrayHelper::merge($this->_d, $data);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t$this->add($key, $value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new InvalidParamException('The data to be merged with must be an array or an object implementing Traversable.');\n\t\t}\n\t}",
"protected function merge(array $data, $timestamp)\n {\n if ($timestamp > $this->ts) foreach ($data as $uniqueID => $info)\n {\n if (empty($this->vs[$uniqueID])) continue;\n if (isset($info['value']) && array_key_exists('value', $this->vs[$uniqueID]['properties']))\n {\n $this->vs[$uniqueID]['properties']['value'] = $info['value'];\n }\n if (isset($info['attrs']))\n {\n $this->vs[$uniqueID]['attributes'] = array_merge($this->vs[$uniqueID]['attributes'], $info['attrs']);\n }\n if (isset($info['removed']))\n {\n foreach ($info['removed'] as $attr) unset($this->vs[$uniqueID]['attributes'][$attr]);\n }\n }\n }",
"public function merge($data = null, $path = null)\n\t{\n\t\tif ($data !== null) {\n\t\t\tif (!is_traversable($data)) {\n\t\t\t\tthrow new \\InvalidArgumentException();\n\t\t\t}\n\t\t\tforeach ($data as $param => $values) {\n\t\t\t\tif (is_traversable($values)) {\n\t\t\t\t\t$path = $path ?: $param;\n\t\t\t\t\tforeach ($values as $param => $value) {\n\t\t\t\t\t\t$this->set($param, $value, $path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->set($param, $values, $path ?: 'global');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"public function add($data)\n {\n if (is_array($data[0])) {\n return array_map(function ($val) use ($data) {\n return [\"view\" => $val, \"content\" => $data[1], \"region\" => $data[2]];\n }, $data[0]);\n }\n // if multiple content (multideminsional) create indexes for them\n if (array_key_exists(0, $data[1])) {\n return array_map(function ($val) use ($data) {\n return [\"view\" => $data[0], \"content\" => $val, \"region\" => $data[2]];\n }, $data[1]);\n }\n return [[\"view\" => $data[0], \"content\" => $data[1], \"region\" => $data[2]]];\n }",
"function data_merge($new)\n\t{\n\t\tparent::data_merge($new);\n\n\t\tif ($this->customfields)\n\t\t{\n\t\t\tforeach(array_keys($this->customfields) as $name)\n\t\t\t{\n\t\t\t\tif (isset($new[$field = $this->get_cf_field($name)]))\n\t\t\t\t{\n\t\t\t\t\t$this->data[$field] = $new[$field];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function _dataMerge( $row )\n\t{\n\t\tif ( $row instanceof Zend_Db_Table_Row )\n\t\t\t$row = $row->toArray();\n\t\t\n\t\t$this->_data = array_merge($this->_data, $row);\n\t\t\n\t\tif (array_key_exists('user_id', $this->_data))\n\t\t\t$this->ownerUserId = $this->_data['user_id'];\n\t}",
"public function setData(Array $data)\n {\n $this->data_view = array_merge_recursive($this->data_view, $data);\n }",
"public function data(array $data = null)\n {\n if (is_null($data)) {\n return $this->data;\n }\n\n $this->data = array_merge($this->data, $data);\n }",
"public function populate(array $data);",
"function data_merge($new)\n\t{\n\t\tif ((int) $this->debug >= 4) echo \"<p>so_sql::data_merge(\".print_r($new,true).\")</p>\\n\";\n\n\t\tif (!is_array($new) || !count($new))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tforeach($this->db_cols as $db_col => $col)\n\t\t{\n\t\t\tif (array_key_exists($col,$new))\n\t\t\t{\n\t\t\t\t$this->data[$col] = $new[$col];\n\t\t\t}\n\t\t}\n\t\tforeach($this->non_db_cols as $db_col => $col)\n\t\t{\n\t\t\tif (array_key_exists($col,$new))\n\t\t\t{\n\t\t\t\t$this->data[$col] = $new[$col];\n\t\t\t}\n\t\t}\n\t\tif (isset($new[self::USER_TIMEZONE_READ]))\n\t\t{\n\t\t\t$this->data[self::USER_TIMEZONE_READ] = $new[self::USER_TIMEZONE_READ];\n\t\t}\n\t\tif ((int) $this->debug >= 4) _debug_array($this->data);\n\t}",
"public function handleData($data)\n {\n $data['members'] = array_merge($data['members'], array('steamid'));\n\n /* Return */\n return $data;\n }",
"public function setData (array $data) {\n return $this->setField('data', array_merge($this->data, $data));\n }",
"public function setAllData($data)\n {\n \n foreach ($data as $key => $value) {\n $this->setData($key, $value);\n }\n \n }",
"public function fill($data);",
"public function addData(array $data)\n {\n $this->data = array_merge($this->data, $data);\n return $this;\n }",
"public function fill(Collection $data): MetaDataOperator;",
"protected function addOtherData(array $data) : void\n {\n $this->otherData += $data;\n }",
"public function testMerge() {\n $data1 = array(\n 'foo' => 'bar',\n 'boolean' => true,\n 'string' => 'abc',\n 'number' => 123,\n 'one'\n );\n\n $data2 = array(\n 'foo' => 'baz',\n 'boolean' => false,\n 'string' => 'xyz',\n 'number' => 456,\n 'two'\n );\n\n $this->assertEquals(array(\n 'foo' => 'baz',\n 'boolean' => false,\n 'string' => 'xyz',\n 'number' => 456,\n 'two'\n ), Hash::merge($data1, $data2));\n\n $data1['array'] = array(\n 'key' => 'value',\n 123,\n true\n );\n\n $data2['array'] = array();\n\n $this->assertEquals(array(\n 'foo' => 'baz',\n 'boolean' => false,\n 'string' => 'xyz',\n 'number' => 456,\n 'two',\n 'array' => array(\n 'key' => 'value',\n 123,\n true\n )\n ), Hash::merge($data1, $data2));\n\n $data2['array'] = array(\n 'key' => 'base',\n 'foo' => 'bar',\n 123\n );\n\n $this->assertEquals(array(\n 'foo' => 'bar',\n 'boolean' => true,\n 'string' => 'abc',\n 'number' => 123,\n 'one',\n 'array' => array(\n 'key' => 'value',\n 'foo' => 'bar',\n 123,\n true\n )\n ), Hash::merge($data2, $data1));\n\n $this->assertEquals(array(), Hash::merge());\n }",
"public function add(array $data)\n {\n $this->data = array_merge($this->data, $data);\n }",
"public function add($data)\n {\n // this method can be overloaded\n foreach (func_get_args() as $data) {\n // redefine var\n $data = (string) $data;\n\n // load data\n $value = $this->load($data);\n $key = ($data != $value) ? $data : 0;\n\n // initialize key\n if(!array_key_exists($key, $this->data)) $this->data[$key] = '';\n\n // store data\n $this->data[$key] .= $value;\n }\n }",
"function setAllData(&$data) {\n\t\t$this->_data =& $data;\n\t}",
"public function __construct($data = null)\n\t{\n\t\t$this->merge($data);\n\t}",
"private function addData($data)\n {\n if(!is_array($data))\n\t\t\tthrow new Exception(\"Could not load a non-array data!\");\n\t\tif(!isset ($data['id']))\n\t\t\tthrow new Exception(\"Every array of data needs an 'id'!\");\n\t\tif(!isset ($data['data']))\n\t\t\tthrow new Exception(\"Loaded array needs an element 'data'!\");\n\n\t\t$this->_data[]=$data;\n }",
"private function mergeData(string $className, ?array $data = null): array\n {\n return \\array_merge($this->getDefaultData($className), $data ?? []);\n }",
"public function mergeWithAppData($data, $type = 'config')\n {\n if (! in_array($type, ['config', 'lang', 'options'])) {\n throw new InvalidArgumentException('The data you wish to merge is not supported');\n }\n $parent = $this->app[$type];\n foreach ($data as $key => $items) {\n $current = $parent->get($key, []);\n $parent->set($key, array_merge($items, $current));\n }\n }",
"public function merge(Base $loader)\n {\n $newData = $loader->load();\n if (is_array($newData)) {\n $this->data = array_replace_recursive($this->data, $newData);\n }\n }",
"public function addDataView($data)\n {\n $this->vars = array_merge($this->vars, $data);\n }",
"abstract public function updateData();",
"public function buildAndFetch( $data );",
"public function append($data);",
"public function populate($data = array())\n {\n $this->id = $data['id'];\n $this->nome = $data['nome'];\n $date = new \\DateTime(\"now America/Sao_Paulo\");\n $this->data_cadastro = $date;\n $this->data_alteracao = $data['data_alteracao'];\n \n }",
"public function merge($collection) {\r\n\t\tif (is_object($collection) && $collection->count() > 0) {\r\n \t$this->collection = array_merge($this->collection, $collection->collection);\r\n\t\t}\r\n }",
"public function mergePreviousData(array $data)\n {\n if (!empty($data['event_id'])) {\n $this->setId($data['event_id']);\n $this->setCreatedAt($data['created_at']);\n }\n\n return $this;\n }",
"public static function add(...$data)\n {\n if (empty($data)) {\n return [];\n }\n $return = array_shift($data);\n $from = static::getShallowType($return);\n foreach ($data as $datum) {\n $to = static::getShallowType($datum);\n if ($from === 'boolean') {\n $return = $datum;\n } elseif ($from !== 'array' && $to === 'boolean') {\n $return = $datum === false ? false : $return;\n } elseif ($from === 'number' && $to === 'number') {\n $return = (float) $return + (float) $datum;\n } elseif (in_array($from, ['string', 'number']) && in_array($to, ['string', 'number'])) {\n $return .= $datum;\n } elseif ($from === 'array' && $to === 'array' || $to === 'object') {\n foreach ((array) $datum as $key => $value) {\n if (is_int($key)) {\n $return[] = $value;\n } else {\n $newValue = isset($return[$key]) ? static::add($return[$key], $value) : $value;\n $return[$key] = $newValue;\n }\n }\n } elseif ($from === 'object' && $to === 'array') {\n foreach ($datum as $key => $value) {\n if (!is_int($key)) {\n $propertyExists = property_exists(get_class($return), $key);\n $newValue = $propertyExists ? static::add($return->$key, $value) : $value;\n $return->$key = $newValue;\n }\n }\n } elseif ($from === 'array') {\n $return[] = $datum;\n } else {\n $return = $datum;\n }\n }\n return $return;\n }",
"public function mergeData($woo_data, $api_data)\n\t{\n\t\t\t// Loop to compare woo commerce to api.\n\t\t\tforeach ($woo_data as $woo_data_single)\n\t\t\t{\n\t\t\t\t$woo_product = wc_get_product($woo_data_single->ID);\n\t\t\t\t$woo_products_array[] = $woo_product;\n\t\t\t\t$woo_products_array_sku[] = $woo_product->sku;\t\n\t\t\t}\n\t\t\t// Get products from API and output SKU\n\t\t\tforeach ($api_data as $api_data_single)\n\t\t\t{\n\t\t\t\t$api_data_array_sku[] = $api_data_single->sku;\n\t\t\t}\n\t\t\t// diff fore deletion\n\t\t\t$delete_data_sku = array_diff($woo_products_array_sku, $api_data_array_sku);\n\n\t\t\t// merge data\n\t\t\tforeach ($api_data as $api_data_single)\n\t\t\t{\n\t\t\t\t$api_data_array_sku[] = $api_data_single->sku;\n\t\t\t}\n\n\t\t\t$merge_data = array_merge($woo_products_array, $api_data);\n\t\t\t$data_unique = $api_data;\n\t\t\t//array_unique($merge_data, SORT_REGULAR);\n\n\t\t\treturn array($data_unique, $delete_data_sku, $woo_products_array, $woo_products_array_sku, $api_data_array_sku);\n\t}",
"protected function rebuildData($data)\n {\n // If data is json convert it to array.\n if ($this->isJson($data)) {\n $data = $this->toArray($data);\n }\n\n // Rebuild array to corresponding format.\n $rebuiltedData = [\n 'id' => $this->getVideoId(),\n 'thumbnail' => $data['pictures']['sizes'][3]['link'],\n 'thumbnailSize' => $data['pictures']['sizes'][3],\n 'authorName' => $data['user']['name'],\n 'authorChannelUrl' => $data['user']['link'],\n 'title' => $data['name'],\n 'description' => $data['description'],\n 'iframe' => $data['embed']['html'],\n 'iframeSize' => '',\n 'tags' => $data['tags']\n ];\n\n // Return rebuilted data.\n return $rebuiltedData;\n }",
"public function populate($data = array())\n {\n parent::populate($data);\n }",
"public function updateData($id, $data=[]){\n $block = $this->layout->getOrCreate($id);\n $block->data = array_merge($block->data, $data);\n return $this;\n }",
"public function set_all_data($data)\n\t{\n\t\t$this->_data = $data;\n\t}",
"protected function appendData($data)\n {\n $this->sha1 = null;\n $this->data.=$data;\n }",
"public function copyFrom($data)\n\t{\n\t\tif (is_array($data) || $data instanceof \\Traversable) {\n\t\t\tif ($this->_d !== array()) {\n\t\t\t\t$this->removeAll();\n\t\t\t}\n\t\t\tif ($data instanceof self) {\n\t\t\t\t$data = $data->_d;\n\t\t\t}\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$this->add($key, $value);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new InvalidParamException('Data must be either an array or an object implementing Traversable.');\n\t\t}\n\t}",
"public function _setData($data = []){\n \t$this->dataredis\t= $data;\n \tunset($this->dataredis['clientId']);\n \tunset($this->dataredis['clientToken']);\n \t$this->dataredis\t= $this->common->arraySortByKey($this->dataredis, \"ASC\");\n \t$temp\t\t\t\t= \"\";\n \tforeach($this->dataredis as $k => $v){\n \t\tif(is_array($v)) $v = json_encode($v);\n \t\t$temp\t.= urlencode($k).\"=\".urlencode($v).\"&\";\n \t}\n \t$this->dataredis\t= substr($temp,0,strlen($temp)-1);\n \tif(strlen($this->dataredis)==0) $this->dataredis\t= \"null\";\n }",
"public function merge(array $config)\n {\n $this->data = array_replace_recursive($this->get(), $config);\n }",
"public function updateData(array $data);",
"public function populate($data = array())\n {\n $this->id = $data['id'];\n $this->img = $data['img'];\n $this->comment = $data['comment'];\n $this->date = $data['date'];\n $this->idStatus = $data['idStatus'];\n $this->idUser = $data['idUser'];\n }",
"public function additional(array $data);",
"public function addData($data)\n {\n $data = $this->hydrateIfJsonToArray($data);\n $this->data[] = $data;\n }",
"public function exchangeDataArray($data){\n \tif($data){\n \t\t$data = $data->toArray();\n \t}\n \treturn $data;\n }",
"public function updateAndProcess($data){\n if(is_array($data)){\n foreach($data as $k => $v) {\n if ( $v == \"\") {\n $data[$k] = NULL;\n }\n }\n if(!is_null($data['gridref'])) {\n $data = $this->_processFindspot($data);\n }\n }\n if(array_key_exists('csrf', $data)){\n unset($data['csrf']);\n }\n if(array_key_exists('landownername', $data)){\n unset($data['landownername']);\n }\n if(array_key_exists('parishID', $data) && !is_null($data['parishID'])){\n $parishes = new OsParishes();\n $data['parish'] = $parishes->fetchRow($parishes->select()->where('osID = ?', $data['parishID']))->label;\n }\n if(array_key_exists('countyID', $data) && !is_null($data['countyID'])){\n $counties = new OsCounties();\n $data['county'] = $counties->fetchRow($counties->select()->where('osID = ?', $data['countyID']))->label;\n }\n\n if(array_key_exists('districtID', $data) && !is_null($data['districtID'])){\n $district = new OsDistricts();\n $data['district'] = $district->fetchRow($district->select()->where('osID = ?', $data['districtID']))->label;\n }\n return $data;\n }",
"public function extendData() {\n }",
"public function populate($data = array())\n {\n }",
"public function addData($data) {\n foreach ($data as $value) {\n $this->add(new Option($value));\n }\n }",
"public function mergeData(array $data, $recursive = true)\n {\n if ($recursive) {\n $this->_data = array_merge_recursive($this->_data, $data);\n } else {\n $this->_data = array_merge($this->_data, $data);\n }\n return $this;\n }",
"public function applyData($data): ?array;",
"protected function build($data)\n {\n return $this->manager->createData($data)->toArray();\n }",
"public function hydrate($data) {\n foreach ($data as $key => $value) {\n $method = 'set' . ucfirst($key);\n if(!isset($value)){\n $v = null;\n }else{\n $v = $value;\n }\n if (method_exists($this, $method)) {\n $this -> $method($v);\n }\n }\n\t}",
"public function addData($data) {\n foreach ($data as $value) {\n $this->add(new Post($value));\n }\n }",
"public function appendData($name, array $data) {\n $this->data[$name] = array_merge($this->data[$name], $data);\n }",
"protected function setData($data) {\n $this->data = collect($data);\n }",
"private function mergeData()\n {\n\n $files = $this->files;\n $folders = $this->folders;\n $this->templates = [];\n\n if($this->deletedTemplates) {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n $this->templates[] = $this->fileFindById($item->reference_id);\n }\n }\n }\n\n } else {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n }\n }\n }\n\n if($files) {\n foreach($files as $file) {\n $file['parent_id'] = $this->findParentIdByRefId($file->id);\n $file['ancestors'] = $this->getFileAncestors($file->id);\n $this->templates[] = $file;\n }\n }\n }\n\n if(!$this->limit) {\n return $this->templates;\n }\n $this->templates = Paginator::make($this->templates, $this->folders->getTotal(), $this->folders->getPerPage());\n return true;\n }",
"public function processData(array $data, array $options = []);",
"public function populate($data = array())\n {\n $this->id = $data['id'];\n\t\t$this->id_anuncio = $data['id_anuncio'];\n $this->id_plano = $data['id_plano'];\n $this->status = $data['status'];\n $this->data_inicio = $data['data_inicio'];\n $this->data_fim = $data['data_fim'];\n\t\t$this->media_clique = $data['media_clique'];\n $this->posicao_media = $data['posicao_media'];\n\t\t$this->tipo = $data['tipo'];\n $this->url_site = $data['url_site'];\n\t\t$date = new \\DateTime(\"now America/Sao_Paulo\");\n $this->data_cadastro = $date;\n $this->data_alteracao = $data['data_alteracao'];\n $this->data_finalizado = $data['data_finalizado'];\n \n }",
"protected function populate_data_individual($data)\n {\n $data_status = $data['status'];\n $listing_data = $data['data'];\n $table_name = $data['tb_name'];\n \n if($data_status) :\n\n $count = 0;\n $total = count($listing_data);\n\n // Listing layer\n foreach ($listing_data as $listing) {\n\n // Check if listing already exists\n $matrix_id = $listing[\"Matrix Unique ID\"];\n \n // Store listing, flat table structure\n foreach ($listing as $key_name => $key_value) {\n\n // if the value is not empty\n if(!empty($key_value)){\n\n // clean the string\n $key_name = preg_replace(\"/\\s+/\", \"\", $key_name);\n $success = $this -> insert_data($matrix_id, $table_name, $key_name, $key_value);\n echo ($success) ? '*' : '';\n }\n }\n \n $count ++;\n } \n\n // When it's done callback\n return ($count === $total) ? 1 : 0;\n\n endif;\n }",
"public function addData(array $data): void\n {\n $this->data = $this->processSchema([$this->data, $data]);\n $this->cache = [];\n }",
"public function expand_all ($data) {\n\t\tif (empty($data)) return $data;\n\n\t\t$content = parent::expand_all(json_encode($data));\t\t\n\t\t$data = json_decode($content, true);\n\n\t\treturn $data;\n\t}",
"private function _split_data(array $data = array())\n\t{\n\t\tif (empty($data))\n\t\t{\n\t\t\treturn $data;\n\t\t}\n\n\t\t$_data = array();\n\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\t// Entities table.\n\t\t\tif (in_array($key, $this->_parent->entities->fields()))\n\t\t\t{\n\t\t\t\t$_data[0][$key] = $val;\n\t\t\t}\n\t\t\t// Groups table.\n\t\t\telseif (in_array($key, $this->fields()))\n\t\t\t{\n\t\t\t\t$_data[1][$key] = $val;\n\t\t\t}\n\t\t\t// The rest are metadata.\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_data[2][$key] = $val;\n\t\t\t}\n\t\t}\n\n\t\tif (empty($_data))\n\t\t{\n\t\t\treturn $data;\n\t\t}\n\n\t\t// Make sure all three elements are set.\n\t\t(isset($_data[0])) OR $_data[0] = array();\n\t\t(isset($_data[1])) OR $_data[1] = array();\n\t\t(isset($_data[2])) OR $_data[2] = array();\n\n\t\t// Sort things up.\n\t\tksort($_data);\n\n\t\treturn $_data;\n\t}",
"public function merge($merge)\n {\n if (!(is_array($merge) || ($merge instanceof Traversable))) {\n throw new Exception\\InvalidArgumentException(sprintf(\n '%s: expects an array, or Traversable argument; received \"%s\"',\n __METHOD__, (is_object($merge) ? get_class($merge) : gettype($merge))\n ));\n }\n\n foreach ($merge as $key => $value) {\n if (array_key_exists($key, $this->data)) {\n if (is_int($key)) {\n $this->data[] = $value;\n } elseif ($value instanceof self && $this->data[$key] instanceof self) {\n $this->data[$key]->merge($value);\n } elseif (is_array($value) && is_array($this->data[$key])) {\n $this->data[$key] = array_merge($this->data[$key], $value);\n } else {\n if ($value instanceof self) {\n $this->data[$key] = new static($value->toArray());\n } else {\n $this->data[$key] = $value;\n }\n }\n } else {\n if ($value instanceof self) {\n $this->data[$key] = new static($value->toArray());\n } else {\n $this->data[$key] = $value;\n }\n\n $this->count++;\n }\n }\n\n return $this;\n }",
"public function merge(self $queue): void\n {\n $data = $queue->toArray();\n\n foreach ($data as $item) {\n $this->insert($item['data'], $item['priority']);\n }\n }",
"public function addData(array $data, $templates = null);",
"abstract protected function prepareData( $data );",
"abstract function prepare_data(&$data_arr);",
"public function loadData($data)\n {\n foreach ($data as $key => $value) {\n if (property_exists($this, $key)) {\n $this->{$key} = $value;\n }\n }\n }",
"public function populate($data)\n {\n if ($data instanceof Arrayable) {\n $this->values = $data->toArray();\n }else {\n $this->values = (array)$data;\n }\n\n if (!empty($this->old)) {\n $this->values = $this->old;\n }\n\n return $this;\n }",
"protected function mergeNewRecordData()\n\t{\n\t\tif( !$this->auditObj && !$this->eventsObject->exists(\"AfterEdit\") )\n\t\t\treturn;\n\n\t\tforeach($this->getOldRecordData() as $f => $v)\n\t\t{\n\t\t\tif( !isset( $this->newRecordData[ $f ] ) )\n\t\t\t\t$this->newRecordData[ $f ] = $v;\n\t\t}\n\t}",
"private function setData($data) {\r\n\t\t$this->set_cd_jogo($data[\"cd_jogo\"]);\r\n\t\t$this->set_nm_jogo($data[\"nm_jogo\"]);\r\n\t\t$this->set_vl_jogo($data[\"vl_jogo\"]);\r\n\t\t$this->set_ds_sinopse(utf8_decode($data[\"ds_sinopse\"]));\r\n\t\t$this->set_dt_lancamento($data[\"dt_lancamento_jogo\"]);\r\n\t\t$this->set_ds_requisito_minimo($data[\"ds_requesito_minimo\"]);\r\n\t\t$this->set_ds_requisito_sugerido($data[\"ds_requesito_sugerido\"]);\r\n\t}",
"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 }"
] | [
"0.7815212",
"0.7274143",
"0.71224475",
"0.71044946",
"0.69207907",
"0.6906422",
"0.66918826",
"0.6649419",
"0.64606446",
"0.6395553",
"0.63954544",
"0.63254726",
"0.63083553",
"0.6304594",
"0.6204126",
"0.611524",
"0.60837555",
"0.6063689",
"0.5984776",
"0.5983571",
"0.59624785",
"0.595738",
"0.5950472",
"0.59056985",
"0.58837754",
"0.58626825",
"0.5811728",
"0.5778893",
"0.5731297",
"0.571584",
"0.57079774",
"0.57058907",
"0.5705574",
"0.5673519",
"0.56647146",
"0.5642632",
"0.5635836",
"0.5632506",
"0.55885524",
"0.55605364",
"0.5559713",
"0.5549511",
"0.5544813",
"0.55418605",
"0.55339617",
"0.5529197",
"0.5527788",
"0.5524397",
"0.5521225",
"0.5474287",
"0.54709214",
"0.54582584",
"0.5453162",
"0.5440593",
"0.5433467",
"0.54316306",
"0.54247296",
"0.5422923",
"0.5410418",
"0.5409449",
"0.5407328",
"0.54021",
"0.54002726",
"0.5398184",
"0.5392068",
"0.5391693",
"0.53889203",
"0.53867525",
"0.5373883",
"0.5372273",
"0.5372173",
"0.536906",
"0.535112",
"0.53491294",
"0.5347238",
"0.53425443",
"0.5341874",
"0.53344935",
"0.5332664",
"0.5330708",
"0.5330114",
"0.5328773",
"0.53191864",
"0.5316556",
"0.530644",
"0.5296897",
"0.52956796",
"0.5291545",
"0.5281532",
"0.52814436",
"0.52810127",
"0.52795684",
"0.5265329",
"0.5254994",
"0.5252143",
"0.5244318",
"0.52373505",
"0.5235963",
"0.52354527",
"0.5235389"
] | 0.60642165 | 17 |
Map the data to the result of the given callback | public function map($key, $callback = null): mixed
{
if (is_callable($key)) {
$callback = $key;
$key = null;
}
$data = $this->get($key);
if (is_array($data)) {
$data = array_map($callback, $data);
} else {
$data = $callback($data);
}
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function map(callable $callback);",
"public function map(callable $callback);",
"public function map(\\Closure $callback);",
"public function map(callable $callback)\n {\n return $this->toBase()->map($callback);\n }",
"public function map(callable $callback): Sequence;",
"public function map(callable ...$callbacks): self;",
"public function pipeAndReturnCallbackResult(callable $callback);",
"public function map($callback)\n {\n $data = array_map($callback, $this->_data);\n return new static($data);\n }",
"public function map(Closure $callback, array $data = []) {\n\t\tif (empty($data)) {\n\t\t\t$this->_value = array_map($callback, $this->_value);\n\t\t} else {\n\t\t\t$this->_value = array_map($callback, $this->_value, $data);\n\t\t}\n\n\t\treturn $this;\n\t}",
"abstract public function map($data);",
"public function map(callable $callback): \\IvoPetkov\\DataList\n {\n $this->actions[] = ['map', $callback];\n return $this;\n }",
"public function map($callback)\n {\n $callback = \\PHPF\\Closure::getAsCallable($callback);\n\n foreach ($this->data as $key => $value) {\n $this->data[$key] = $callback($value, $key, $this);\n }\n\n return $this;\n }",
"public function map(callable $callback) : self\n {\n $b = [];\n\n foreach ($this->a as $rowA) {\n $b[] = array_map($callback, $rowA);\n }\n\n return self::quick($b);\n }",
"public function asyncMap(callable $callback): Collection;",
"public function map(callable $c);",
"public function map(callable $callback) {\n return $this->requestModels->map($callback);\n }",
"public static function map($array,$callback){\n\t\t$newArray = array();\n\t\tforeach($array as $key=>$value)\n\t\t\t$newArray[$key] = $callback($key,$value);\n\t\treturn $newArray;\n\t}",
"public function map(Closure $mutate): Result;",
"public function apply(callable $callback);",
"public function map(callable $callback): self {\n\t\t$generator = function (Stream $stream) use ($callback) {\n\t\t\tforeach ($stream as $value) {\n\t\t\t\tyield $callback($value);\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($this));\n\t}",
"abstract public function map(callable $func);",
"public function map(callable $fn);",
"private function callCallback() {\n\t\tif ($this->callback !== null) {\n\t\t\t$response = $this->buildResponse();\n\t\t\tcall_user_func($this->callback, $response, $this->data);\n\t\t}\n\t}",
"public function callback();",
"public function map(callable $callback)\n {\n $literal = [];\n\n for ($i = 0; $i < $this->getRowCount(); $i++) {\n $row = [];\n\n for ($j = 0; $j < $this->getColumnCount(); $j++) {\n $row[] = $callback($this->get($i, $j), $i, $j, $this);\n }\n\n $literal[] = $row;\n }\n\n return new static($literal);\n }",
"public function map(callable $callback)\n {\n $literal = array();\n\n for ($i = 0; $i < $this->rows; $i++) {\n $row = array();\n\n for ($j = 0; $j < $this->columns; $j++) {\n $row[] = $callback($this->get($i, $j), $i, $j, $this);\n }\n\n $literal[] = $row;\n }\n\n return new static($literal);\n }",
"public function process($callback)\n {\n $this->result = $callback($this->result());\n\n return $this;\n }",
"public function map($callback)\n {\n return new self(array_map($callback, $this->toArray()));\n }",
"public function map(callable $callback)\n {\n $keys = array_keys($this->items);\n $items = array_map($callback, $this->items, $keys);\n $this->items = array_combine($keys, $items);\n return $this;\n }",
"public function map($callback, $callbackArg = null) {\n\treturn array_walk($this->_elArray, $callback, $callbackArg);\n}",
"public function map(callable $callback) {\n\t\t$data = array_map(function($row) use ($callback) {\n\t\t\treturn array_map(function($value) use ($callback) {\n\t\t\t\t$new_value = $callback($value);\n\t\t\t\t\n\t\t\t\tif (!is_numeric($new_value)) {\n\t\t\t\t\tthrow new Matrix\\Exception\\NotNumericException(\"Value returned by map function is not a numeric\");\n\t\t\t\t}\n\n\t\t\t\treturn $new_value;\n\t\t\t}, $row);\n\t\t}, $this->_data);\n\n\t\treturn new self($data);\n\t}",
"public function map(callable $callback)\n {\n $keys = array_keys($this->items);\n\n $items = array_map($callback, $this->items, $keys);\n\n return new static(array_combine($keys, $items));\n }",
"public function parse($data, $callback){\r\n $parser = new \\SimpleXMLIterator($data);\r\n $this->content = $data;\r\n //process the root node\r\n if(isset($callback)){\r\n foreach($this->mappings as $mapping){\r\n if(strcmp($mapping->name(), $parser->getName()) == 0){\r\n $result = $this->invokeParser($mapping, $parser);\r\n if(isset($result)){\r\n $this->results[] = $result;\r\n }\r\n }\r\n }\r\n }\r\n //process children\r\n $this->start($parser, $callback);\r\n return $this->results;\r\n }",
"public function process(Closure $callback = null);",
"public function map(callable $f): Result\n {\n if (!$this->isOk()) {\n return $this;\n }\n\n return Result::ok(call_user_func($f, $this->value));\n }",
"public function success(Closure $callback);",
"public function map(callable $callback): self\n {\n $collection = Factory::create();\n\n $index = 0;\n foreach ($this->items as $key => $value) {\n $collection->set($key, $callback($value, $key, $index++));\n }\n\n return $collection;\n }",
"public function each($callback)\n {\n foreach ($this->_data as $key => $val) {\n $this->_data[$key] = $callback($val, $key, $this);\n }\n return $this;\n }",
"public function map($callback)\n {\n return Collection::new(array_map($callback, $this->items));\n }",
"public function map(callable $callback): NonEmptyMap;",
"private function doTransform($data, callable $func = null)\n {\n if (null === $func || null === $data) {\n return $data;\n }\n\n if (!is_array($data)) {\n $data = [$data];\n }\n\n return call_user_func_array($func, $data);\n }",
"public function map(callable $callback) : self\n {\n return new static(array_map($callback, $this->items));\n }",
"public function reduce(callable $callback, $initialValue = null)\n\t{\n\t\t$data = $initialValue;\n\t\t\n\t\tforeach ($this->data as $key => $value)\n\t\t{\n\t\t\t$data = $callback($value, $key, $data);\n\t\t}\n\t\t\n\t\treturn $data;\n\t}",
"public function map(callable $callback)\n {\n if (!$this->repoClass) {\n throw new LogicException(\"To support shard map, you need to pass Repo class.\");\n }\n $mapResults = [];\n foreach ($this as $shardId => $shard) {\n $repo = $shard->createRepo($this->repoClass);\n $mapResults[$shardId] = $callback($repo, $shard);\n }\n return $mapResults;\n }",
"public function map(callable $callback, array $data, $maxChildren)\n {\n $this->disconnectAll();\n $pids = [];\n $res = [];\n\n try {\n foreach ($data as $k => $args) {\n $pid = pcntl_fork();\n if ($pid == -1) {\n throw new ForkException(pcntl_strerror(pcntl_get_last_error()));\n } elseif ($pid > 0) {\n // if we are in parent collect pids of child processes\n $pids[$pid] = $k;\n // reserve place for result value in proper sequence\n $res[$k] = null;\n // wait some child to exit if max children reached\n if (count($pids) >= $maxChildren) {\n $pid = pcntl_wait($status);\n $res[$pids[$pid]] = $this->getValue($pid, $status);\n unset($pids[$pid]);\n }\n } else {\n // do the job in child\n try {\n try {\n $this->connectAll();\n $result = call_user_func_array($callback, (array)$args);\n $this->putValue(getmypid(), $result);\n } catch (Exception $ex) {\n $msg = $this->logException($ex);\n $this->putValue(getmypid(), $msg);\n exit(1);\n }\n } catch (Exception $ex) {\n exit(1);\n } finally {\n exit(0);\n }\n }\n }\n } finally {\n // wait all remaining processes\n foreach ($pids as $pid => $one) {\n pcntl_waitpid($pid, $status);\n $res[$pids[$pid]] = $this->getValue($pid, $status);\n }\n $this->connectAll();\n }\n\n return $res;\n }",
"public function map(callable $callback): self {\n\t\treturn new static(array_map($callback, $this->array));\n\t}",
"abstract public function mapValues(\\Closure $f): self;",
"public function mapSpread(callable $callback)\n {\n return $this->map(function ($chunk) use ($callback) {\n return $callback(...$chunk);\n });\n }",
"public function flatMap(Closure $doSomething): Result;",
"public function getDataMapper() {}",
"public final function runCallbacks($callbacks, $data, $exit_on_false = false)\n {\n foreach ( $callbacks as $callback )\n {\n // Callback method in a different model?\n if (strpos($callback, '::') !== false)\n {\n list($model_name, $callback) = explode('::', $callback);\n $model = $this->getModel($model_name);\n $data = $model->{$callback}($data);\n } else\n $data = $this->{$callback}($data);\n\n // Stop processing as soon as return value of callback is boolean false.\n if ($exit_on_false && $data === false)\n break;\n }\n\n return $data;\n }",
"public function map(Closure $function): array;",
"function apply(callable $cb) {\n\t\tarray_walk($this->rows, $cb, $this);\n\t\treturn $this;\n\t}",
"public function map(callable $callback): Matrix\n {\n $rows = new Vector();\n $rows->allocate($this->y);\n foreach ($this->table as $y => $row) {\n $row_Vector = new Vector();\n $row_Vector->allocate($this->x);\n foreach ($row as $x => $cell) {\n $row_Vector->push($callback($cell, $x, $y));\n }\n $rows->push($row_Vector);\n }\n\n return new self($rows);\n }",
"public function process($data);",
"public function doProcessData() {}",
"public function inspect(callable $callback): Stream {\n\t\treturn $this->map(function ($data) use ($callback) {\n\t\t\t$callback($data);\n\t\t\treturn $data;\n\t\t});\n\t}",
"protected function filterDatas($callback)\n {\n return $this->filterDatasInGroup($this->getSchema(), $callback);\n }",
"protected abstract function map();",
"public function map(callable $callback): Set;",
"public function map(callable $callback): Collection\n {\n return new Collection(array_map($callback, $this->items()));\n }",
"public function map(callable $mapper)\n {\n return $this->transform($mapper);\n }",
"function processData() ;",
"public function map(callable $callback)\n\t{\n\t\treturn new static(array_map($callback, $this->stack, array_keys($this->stack)));\n\t}",
"public static function apply($path, $data, $callback, $options = [])\n {\n $defaults = ['type' => 'pass'];\n $options = array_merge($defaults, $options);\n $data = self::prepareDataArray($data);\n $extracted = self::extract($path, $data);\n \n if ($options['type'] === 'map') {\n return array_map($callback, $extracted);\n } elseif ($options['type'] === 'reduce') {\n return array_reduce($extracted, $callback);\n } elseif ($options['type'] === 'pass') {\n return call_user_func_array($callback, [$extracted]);\n }\n return null;\n }",
"public function callback(callable $callback)\n {\n return $this\n ->addCallback($callback)\n ->execute();\n }",
"public function walk($callback, array $args = array())\n {\n $results = array();\n $useItemCallback = is_string($callback) && strpos($callback, '::') === false;\n foreach($this->_data as $id => $item) {\n if ($useItemCallback) {\n $cb = array($item , $callback);\n } else {\n $cb = $callback;\n array_unshift($args, $item);\n }\n $results[$id] = call_user_func_array($cb, $args);\n }\n return $results;\n }",
"public function processData() {}",
"public function map(Callable $func) {\n $result = [];\n\n foreach ($this->list as $item) {\n $result[] = $func($item);\n }\n\n return $result;\n }",
"public function call($key, $ttl, array $callback)\r\r\n\t{\r\r\n\t\t$temp = $this->get($key);\r\r\n\r\r\n\t\tif ($temp != NULL) \r\r\n\t\t{\r\r\n\t\t\treturn $temp;\r\r\n\t\t}\r\r\n\t\telse\r\r\n\t\t{\t\t\t\r\r\n\t\t\t$result = call_user_func_array($callback['func'], $callback['params']);\r\r\n\t\t\t$this->set($key, $ttl, $result);\r\r\n\t\t\treturn $result;\r\r\n\t\t}\t\t\r\r\n\t}",
"private function verifyData()\n {\n return function ($data) {\n return $data['render_data'];\n };\n }",
"public static function mapFromResult(array $data): array\n {\n return $data;\n }",
"public function map($sel, $callback)\n\t{\n\n\t\t$nodes = pq($sel);\n\t\t$this->data = [];\n\t\tforeach ($nodes as $node) {\n\t\t\t// node is a domelement\n\t\t\t$node = pq($node);\n\t\t\t$datum = $this->$callback($node);\n\t\t\t$this->data[] = $datum;\n\t\t}\n// $this->data = $data;\n\n\t\treturn $this;\n\t}",
"public function map(callable $callback): Collection {\n $keys = array_keys($this->items);\n $items = array_map($callback, $this->items, $keys);\n return new static(array_combine($keys, $items));\n }",
"private function prepareDataLoaderMockCallback(string $path, array $expectedFilesMap, ?array $expectedLoadData = null): callable\n {\n return static function (MockInterface $dataLoaderMock) use ($expectedFilesMap, $expectedLoadData, $path) {\n foreach ($expectedFilesMap as $key => $expectedFile) {\n $filePath = \"$path/$expectedFile\";\n $returnData = $expectedLoadData[$key] ?? [];\n $dataLoaderMock->shouldReceive('load')->withArgs([$filePath])->andReturn($returnData);\n }\n };\n }",
"public function readWithCallback(callable $callback)\n {\n while (!$this->eof()) {\n $content = $this->readPart();\n\n if ($content == null) {\n break;\n }\n\n $callback($content, null);\n }\n }",
"public function forEach(callable $callback): void {\n\t\tforeach ($this as $value) {\n\t\t\t$callback($value);\n\t\t}\n\t}",
"public function listenForPredictModelsResponse(\\Closure $callback)\n {\n $this->ch->basic_consume($this->opts['predict-models.response.queue'], \"\",\n false, false, false, false, function (AMQPMessage $msg) use ($callback) {\n $reader = new PredictModelsResponseReader();\n $resp = $reader->read($msg->body);\n if ($resp) {\n call_user_func($callback, $resp);\n $msg->delivery_info['channel']->\n basic_ack($msg->delivery_info['delivery_tag']);\n }\n });\n }",
"public function each(\\Closure $callback);",
"public static function map( $callback, $array, $applyToKeys = FALSE )\n\t{\n\t\tif ( $applyToKeys ) {\n\t\t\t$newArr = array();\n\t\t}\n\t\tforeach ( $array as $key => $val ) {\n\t\t\tif ( is_array( $val ) ) {\n\t\t\t\tif ( $applyToKeys ) {\n\t\t\t\t\t$newArr[call_user_func( $callback, $key )] = self::map( $callback, $val, $applyToKeys );\n\t\t\t\t} else {\n\t\t\t\t\t$array[$key] = self::map( $callback, $val );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ( $applyToKeys ) {\n\t\t\t\t\t$newArr[call_user_func( $callback, $key )] = $val;\n\t\t\t\t} else {\n\t\t\t\t\t$array[$key] = call_user_func( $callback, $val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ( $applyToKeys ) {\n\t\t\treturn $newArr;\n\t\t} else {\n\t\t\treturn $array;\n\t\t}\n\t}",
"protected static function callFilter( $event, $data ) {\r\n\t\t\t$event = strtolower( $event );\r\n\t\t\t//\r\n\t\t\tif (isset(self::$eventMap[$event])) {\r\n\t\t\t\tforeach ( self::$eventMap[$event] as $callback ) {\r\n\t\t\t\t\t$data = call_user_func($callback, $data );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $data;\r\n\t\t}",
"public function mapResults(array &$results, array $map = [])\n {\n foreach ($results as &$result) {\n $this->mapResult($result, $map);\n }\n }",
"public function setCallback($callback);",
"function process_data($data) {\n }",
"public function each($callback)\n {\n array_walk($this->items, $callback);\n }",
"public function pipe(callable $callback)\n {\n return $callback($this);\n }",
"public function pipe(callable $callback)\n {\n return $callback($this);\n }",
"public function map(callable $callback): self\n {\n $keys = $this->keys();\n $values = array_map($callback, $this->values(), $this->keys());\n\n $fluentArray = $this->derive();\n\n foreach ($values as $index => $value) {\n $key = $keys[$index];\n $fluentArray->set($key, $value);\n }\n\n return $fluentArray;\n }",
"public function each(callable $callback);",
"public function each(callable $callback);",
"public function each(callable $callback);",
"public function each(callable $callback);",
"function callback($input=NULL,$function='empty')\n\t{\n\t\treturn $this->waterfall($input,array($function));\n\t}",
"public function each($callback)\n {\n foreach ($this->entries as $entry) {\n call_user_func_array($callback, [\n 'file' => $entry,\n ]);\n }\n }",
"public function pakai_cache($callback, $cache_id, $lama)\n\t{\n\t\tif (! $data = $this->file->get($cache_id))\n\t\t{\n\t\t\t$data = call_user_func($callback);\n\t\t\t$this->file->save($cache_id, $data, $lama);\n\t\t}\n\n\t\treturn $data;\n\t}",
"public function map(\\Closure $f)\n {\n array_walk_recursive($this->_data, $f);\n\n return $this;\n }",
"public abstract function map(callable|UnaryFunction|string|MapOperator $mapper): Stream;",
"private function performOperation($callback = null)\n {\n $name = $this->getCurrentCounterName();\n $data = $this->readCounterData($name);\n if ($callback !== null) {\n $callback($data);\n }\n $this->writeCounterData($name, $data);\n $this->currentCount = $data[self::DATA_COUNT];\n return [\n 'name' => $name,\n 'count' => $this->currentCount,\n ];\n }",
"public function transform(Closure $callback)\n {\n $array = $this->toArray();\n\n $array = array_map($callback, $array);\n\n $indexedArray = static::createFormArray($array);\n $indexedArray->bucketSize = $this->getSize();\n\n return $indexedArray;\n }",
"public function transform(callable $callback)\n {\n $this->items = $this->map($callback)->all();\n\n return $this;\n }"
] | [
"0.7449025",
"0.7449025",
"0.7269324",
"0.69956654",
"0.6993641",
"0.6885259",
"0.68120533",
"0.67906594",
"0.6737103",
"0.67214644",
"0.66248673",
"0.65421575",
"0.6324179",
"0.6298836",
"0.6254732",
"0.62227404",
"0.6198958",
"0.6184253",
"0.6118961",
"0.6115894",
"0.61135846",
"0.6106798",
"0.6076557",
"0.60197556",
"0.6019331",
"0.6004164",
"0.59576184",
"0.591007",
"0.5821114",
"0.5758876",
"0.57255256",
"0.5718618",
"0.57153255",
"0.57118315",
"0.5703967",
"0.5694434",
"0.5677258",
"0.5673297",
"0.56721574",
"0.566511",
"0.56572497",
"0.5655075",
"0.5652936",
"0.5629695",
"0.56194735",
"0.5605787",
"0.55975866",
"0.5589277",
"0.55837315",
"0.55614436",
"0.5542175",
"0.55258805",
"0.5510647",
"0.5478349",
"0.5467531",
"0.5453458",
"0.5436431",
"0.5435445",
"0.5431343",
"0.54227",
"0.54180956",
"0.54064083",
"0.5400768",
"0.5399439",
"0.53843284",
"0.5372003",
"0.53601176",
"0.5341637",
"0.53300864",
"0.53187484",
"0.53120005",
"0.5292409",
"0.5289202",
"0.5285548",
"0.5281061",
"0.52726805",
"0.5271141",
"0.52684045",
"0.52399284",
"0.5230687",
"0.52193266",
"0.52135605",
"0.52128965",
"0.5211583",
"0.5208282",
"0.5204059",
"0.5204059",
"0.51982504",
"0.5196553",
"0.5196553",
"0.5196553",
"0.5196553",
"0.51719314",
"0.51597553",
"0.51597476",
"0.51589197",
"0.5145421",
"0.513885",
"0.5132472",
"0.51319385"
] | 0.67776054 | 8 |
Clear the data container | public function clear(): static
{
$this->data = [];
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clear()\n {\n $this->data = [];\n }",
"public function clear()\n {\n $this->_data = [];\n }",
"public function clear() {\n $this->_data = [];\n }",
"public function clear()\n {\n $this->dataStorage = [];\n }",
"public function clearData() {\n unset($this->data);\n }",
"private function clearData()\n {\n $this->_data=array();\n }",
"public function clearData() {\n $this->viewData = array();\n }",
"function clearContainer()\r\n {\r\n foreach ($this->container as $k => $v)\r\n unset($this->container[$k]);\r\n }",
"public function remove_all_data()\n\t{\n\t\t$this->_data = array();\n\t}",
"public static function clear()\n\t\t{\n\t\t\tself::$data = [];\n\t\t\tself::$file = [];\n\t\t}",
"public function clear()\n {\n $this->fromArray(array());\n }",
"function clear() {\r\n /* clear datasource. you should call this before calling another populate() to avoid datasource gets appended\r\n */\r\n $this->ds = new DataSource;\r\n $this->db_count = 0;\r\n }",
"public function clear() {\n\t\t$this->array = array();\n\t}",
"public function reset()\n {\n $this->data = array();\n }",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"public function clear();",
"function reset_data() {\n\t\t$this->data_layer()->clear();\n\t\t$this->log = null;\n\t\t$this->location = null;\n\t\t$this->tax_location = null;\n\t}",
"public function clear() {}",
"public function clear() {}",
"public function clear() {}",
"public function clear() {}",
"protected function reset() {\n\t\t$this->data = array();\n\t}",
"public function reset(): void\n {\n $this->data = [];\n }",
"public function clear ()\n {\n\n $this->groups = null;\n $this->groups = array();\n $this->names = null;\n $this->names = array();\n\n }",
"public function clear () {\n \n }",
"protected function clear() {}",
"public function clear()\r\n\t{\r\n\t\t$this->isLoaded = false;\r\n\t\t$this->elements = array();\r\n\t\t$this->keyAssocation = array();\r\n\t\t$this->i = 0;\r\n\t\t$this->count = 0;\r\n\t}",
"public function clear()\n {\n $this->items = array();\n $this->itemsCount = 0;\n }",
"public function clear( );",
"private function clear()\n {\n $this->mappedQueries = [];\n $this->mappedFilters = [];\n $this->requestData = [];\n }",
"public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}",
"public function clear() {\n\t\t\t$this->elements = array();\n\t\t\t$this->size = 0;\n\t}",
"public function clear(): void\n {\n $this->collectionStatsById = [];\n $this->proxyStatsByClass = [];\n }",
"public function clear(): void\n {\n $this->items = [];\n $this->length = 0;\n $this->cursor = 0;\n }",
"public function clear()\n {\n $this->items = array();\n }",
"protected function _resetData()\n\t{\n\n\t\t// clean data, total and pagination, as we need them rebuilt\n\t\t$this->_data = null;\n\t\t$this->_total = null;\n\t\t$this->_pagination = null;\n\t}",
"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 resetData();",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function clear(): void;",
"public function Clear()\n {\n $this->items = array();\n }",
"function clear() {\n\t\t\t$this->items = [];\n\t\t}",
"public function clear()\n\t{\n\t\t$this->items = [];\n\t}",
"public function clear()\n {\n\n $this->synchronized = true;\n $this->id = null;\n $this->newId = null;\n $this->data = [];\n $this->savedData = [];\n $this->multiRef = [];\n\n }",
"public function clear()\n {\n $this->_id = null;\n $this->_title = null;\n $this->_positions = [];\n $this->_isDefault = null;\n }",
"public function clear()\n\t{\n\t\t$this->uniqid = '';\n\t\t$this->base_url = '';\n\t\t$this->no_result = '';\n\t\t$this->pagination_tmpl = '';\n\n\t\t$this->sort = array();\n\t\t$this->column_config = array();\n\n\t\t$this->jq_template = FALSE;\n\n\t\t$this->rows\t\t\t\t= array();\n\t\t$this->heading\t\t\t= array();\n\t\t$this->auto_heading\t\t= TRUE;\n\t}",
"public function resetData()\r\n {\r\n }",
"public function clear() {\n $this->elements = array();\n }",
"public function clearCollection()\n {\n $this->collections = [];\n }",
"public function clear()\n {\n $this->collection->clear();\n $this->keys = [];\n }",
"public function clearMembros()\n\t{\n\t\t$this->collMembros = null; // important to set this to NULL since that means it is uninitialized\n\t}",
"public function clear() {\n $this->collection = [];\n $this->noteCollectionChanged();\n }",
"public function flushData()\n\t{\n\t\t$class = get_class($this);\n\t\tunset($this->_data[$class]);\n\t}",
"public function clear() {\n\t}",
"function clear()\r\n {\r\n $this->items=array();\r\n }",
"public function clear()\n {\n if (null !== $this->getDraft()) {\n $this->getDraft()->clear();\n } else {\n $this->_subcontent->clear();\n $this->subcontentmap = array();\n $this->_data = array();\n $this->index = 0;\n }\n }",
"function clear()\n {\n $this->id = \"\";\n $this->offset = \"\";\n $this->title = \"\";\n $this->description = \"\";\n }",
"public function clear()\n\t{\n\t\t$this->getObject()->clear();\n\t}",
"public function clear()\n {\n $this->sql = '';\n $this->columns = array();\n $this->values = array();\n }",
"public function clear(): self;",
"function clear()\r\n\t\t{\r\n\t\t\t$this->elements = array();\r\n\t\t}",
"public function clear()\n {\n return $this->performOperation(\n function (&$data) {\n $data[self::DATA_COUNT] = 0;\n }\n );\n }",
"public function clear(){\n\t\t// create array containing all data of the business object not including linked tables//\n\t\t$this->business_data = \n\t\t\tarray(\n\t\t\t\"service_id\"=>0,\n\t\t\t\"service_name\"=>\"\",\n\t\t\t\"service_cost\"=>\"\",\n\n\t\t\t\"service_sys_account_id\"=>0,\n\t\t\t\"sys_account_name\"=>\"\",\n\t\t\t);\n\t}",
"function clear() {}",
"private function clear(): void\n {\n $this->centralDirectoryRecords = [];\n $this->offset = 0;\n\n if($this->operationMode === OperationMode::NORMAL) {\n $this->ready = false;\n $this->recordedSimulation = [];\n } else {\n $this->operationMode = OperationMode::NORMAL;\n }\n }",
"public function clearCacheData(){\n $cacheKey = $this->getCacheKey();\n $this->clearCache($cacheKey);\n }",
"public function clear()\n {\n }",
"public function Clear(){\n\t\t// create array containing all data of the business object not including linked tables//\n\t\t$this->business_data = Array (\n\t\t\t\"group_id\"=>0 ,\n\t\t\t\"group_name\"=>\"\" , \n\t\t\t\"group_remarks\"=>\"\",\n\t\t\t\"group_active\"=>0 ,\n\t\t\t\"group_code\"=>\"\"\n\t\t\t);\n\t\t\t\t\n\t}",
"public function Clear() {\n $this->_row = '';\n $this->_table = '';\n $this->_itemcount = 0;\n $this->_rown = 0;\n }",
"public function clear()\n {\n $this->inputFieldsGroup->clear();\n $this->inputFilesGroup->clear();\n $this->inputImagesGroup->clear();\n $this->inputConditionsGroup->clear();\n }",
"public static function clear()\n {\n self::$map = array();\n self::$instances = array();\n }",
"function Clear()\r\n {\r\n $this->_items = array();\r\n }",
"public function clear(): void {\n\t\t$this->m_elements = [];\n\t}",
"public function clear()\n {\n $this->items = [];\n $this->saveItems();\n }"
] | [
"0.8440366",
"0.8437471",
"0.84069395",
"0.83090574",
"0.8292563",
"0.8208733",
"0.80798954",
"0.77472967",
"0.7662405",
"0.76596516",
"0.7610196",
"0.74861926",
"0.7471272",
"0.74589914",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.74418765",
"0.7428477",
"0.74122596",
"0.74122596",
"0.74122596",
"0.74122596",
"0.7380123",
"0.735335",
"0.7290279",
"0.7282387",
"0.7268221",
"0.72618014",
"0.7247885",
"0.72410876",
"0.72264916",
"0.7213882",
"0.7213882",
"0.72095233",
"0.7207608",
"0.7203108",
"0.7192661",
"0.7192522",
"0.7180161",
"0.7166438",
"0.7166438",
"0.7166438",
"0.7166438",
"0.7166438",
"0.7166438",
"0.7139714",
"0.71316296",
"0.71261746",
"0.7115914",
"0.7109346",
"0.70856565",
"0.7083175",
"0.70785743",
"0.7077951",
"0.7046694",
"0.7037851",
"0.70306426",
"0.70248294",
"0.7024403",
"0.70142317",
"0.70082915",
"0.6971669",
"0.6971363",
"0.6966994",
"0.69632995",
"0.69459397",
"0.69437116",
"0.6927922",
"0.69265133",
"0.692618",
"0.6909521",
"0.69024587",
"0.6897044",
"0.68895364",
"0.6877879",
"0.6873969",
"0.6856177",
"0.6844351",
"0.6836843"
] | 0.6834293 | 100 |
Set the delimiter used for accessing nested data | public function setDelimiter(string $delimiter): static
{
$this->delimiter = $delimiter;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDelimiter($delimiter) {\n $this->delimiter = $delimiter;\n }",
"public function delimiter()\n {\n return static::TABULAR_DELIMITER;\n }",
"public function getDelim(): string\n {\n return $this->delimiter;\n }",
"public function setDelimiter($pValue) {\n\t\t$this->delimiter = $pValue;\n\t\treturn $this;\n\t}",
"public function getDelimiter()\n {\n\n }",
"public function get_hierarchy_delimiter() {\n return $this->delimiter;\n }",
"public function setDelimiter($delimiter)\n\t{\n\t\t$this->_delimiter = $delimiter;\n\t\t$this->setCsvControl($this->_delimiter, $this->_enclosure);\n\t}",
"public function setDelimiter(string $delimiter): void\n {\n $this->delimiter = $delimiter;\n }",
"public function getDelimiter(): string;",
"public function setDelimiter($delimiter)\n {\n $this->delimiter = $delimiter;\n return $this;\n }",
"public function setDelimiter($delimiter)\n {\n $this->delimiter = $delimiter;\n return $this;\n }",
"public function setDelimiter($delimiter)\n {\n $this->delimiter = $delimiter;\n return $this;\n }",
"public function getDelimiter() {\n return $this->delimiter;\n }",
"public function getDelimiter(): string\n {\n return $this->delimiter;\n }",
"public function setDelimiter(string $delimiter): self\n {\n $this->options->FIELD_DELIMITER = $delimiter;\n\n return $this;\n }",
"public function setDelimiter(string $delimiter)\n {\n $this->delimiter = $delimiter;\n return $this;\n }",
"public function getDelimiter()\n {\n return $this->delimiter;\n }",
"public function getDelimiter()\n {\n return $this->delimiter;\n }",
"public function getDelimiter() {\n return $this->delimiter;\n }",
"public function with_delimiter($delimiter) {\n $this->contexts[$this->current][self::DELIMITER] = (string) $delimiter;\n return $this;\n }",
"public function getFieldsSeparator();",
"protected function _getDelimiter() {\n\t\treturn ',';\n\t}",
"public function setSeparator($separator);",
"function __give_import_delimiter_set_callback( $delimiter ) {\n\t$delimite_type = array(\n\t\t'csv' => ',',\n\t\t'tab-separated-values' => \"\\t\",\n\t);\n\n\treturn ( array_key_exists( $delimiter, $delimite_type ) ? $delimite_type[ $delimiter ] : ',' );\n}",
"public function setDelimiter($delimiter)\n {\n $this->delimiter = (string) $delimiter;\n\n return $this;\n }",
"public function setFieldDelimiter($fieldDelimiter)\r\n\t{\r\n\t\t$this->fieldDelimiter = $fieldDelimiter;\r\n\t\treturn $this;\r\n\t}",
"public function getFieldsSeparator() {\n return $this->fieldsSeparator;\n }",
"protected function delimiterCharacter () : string {\n return ',';\n }",
"public function getPathDelimiter()\n {\n return $this->_pathDelimiter;\n }",
"public function getDelimiterReplacement()\n {\n return $this->_delimiterReplacement;\n }",
"function set_delimiters($l = '{', $r = '}')\n\t{\n\t\t$this->l_delim = $l;\n\t\t$this->r_delim = $r;\n\t}",
"public function setLineDelimiter($delim) {\n $this->lineDelim= $delim; // could be more than one character\n }",
"public function setSeparator($separator) {\n $this->_separator = $separator;\n }",
"public function testGetSetRulesSeparator()\n {\n $this->ruleParse->setRulesDelimiter('||');\n $this->assertEquals('||', $this->ruleParse->getRulesDelimiter());\n }",
"public function withDelimiter($delimiter) {\n if ($this->final) {\n $self= clone $this;\n $self->final= FALSE;\n } else {\n $self= $this;\n }\n $self->setDelimiter($delimiter);\n return $self;\n }",
"public function getDelimiter(): string\n {\n return \"\\x00\";\n }",
"public function setColDelimiter($delim) {\n $this->colDelim= $delim{0};\n }",
"public function setColDelimiter($delim) {\n $this->colDelim= $delim{0};\n }",
"function setSeparator($sep = ', '){\n\t\t\t$this->separator = $sep;\n\t\t}",
"public function setDelimiter($delim) {\n\n if (!($this->file instanceof SplFileObject)) {\n throw new RuntimeException('Delmiter must be set after initializing a CSVFile');\n }\n\n if (strlen($delim) > 1) {\n throw new InvalidArgumentException(\"Delimiter must be a single character\");\n }\n\n $this->file->setCsvControl($delim);\n $this->delimiter = $delim;\n }",
"public function testSetDefaultRulesSeparator()\n {\n $this->assertEquals('|', $this->ruleParse->getRulesDelimiter());\n }",
"public function getSeparator()\n {\n return $this->getOption('separator');\n }",
"public function getSeparator();",
"private function _getCategoryPathDelimiter()\n\t{\n\t\tif (!$this->_categoryPathDelimiter) {\n\t\t\t$this->_categoryPathDelimiter = $this->getVar('category_path_delimiter', '>');\n\t\t}\n\t\treturn $this->_categoryPathDelimiter;\n\t}",
"function setNavVarsSeparator($t) {\r\n global $SYS;\r\n\r\n $SYS[\"NAV_SEPARATOR\"]=$t;\r\n $SYS[\"NAV_SEPARATOR_I\"]=\"\";\r\n\r\n}",
"private function getSeparator(): string\n {\n return $this->getModelGeneratorConfig()->getConfig('separator', '');\n }",
"public function getDelimiter() {\n\n if (!$this->delimiter) {\n if (isset(self::$delimiterMap[$this->name])) {\n $this->delimiter = self::$delimiterMap[$this->name];\n } else {\n // To be a bit future proof, we are going to default the\n // delimiter to ;\n $this->delimiter = ';';\n }\n }\n return $this->delimiter;\n\n }",
"public function setDelimiterChar(string $delimiterChar): CsvImport\n {\n $this->delimiterChar = $delimiterChar;\n return $this;\n }",
"public function getSeparator() {\n return $this->_separator;\n }",
"public function getSeparator()\n {\n return $this->separator;\n }",
"public function getSeparator()\n {\n return $this->separator;\n }",
"private function getSeparator() {\n if (!$this -> separator) {\n $this -> separator = \",\";\n $test_line = explode($this -> separator, $this -> fileContents[0]);\n if (sizeof($test_line) > 1) {\n return $this -> separator;\n }\n $this -> separator = \";\";\n $test_line = explode($this -> separator, $this -> fileContents[0]);\n if (sizeof($test_line) > 1) {\n return $this -> separator;\n }\n $this -> separator = false;\n }\n return $this -> separator;\n }",
"protected function blockDelimiter()\n {\n return '';\n }",
"public function resetDelimiters() {\n\t\t$this->setColumnDelimiter('');\n\t\t$this->setEnclosure('');\n\t\t$this->setEscape(null);\n\t}",
"private function _getCategoryDelimiter()\n\t{\n\t\tif ($this->_categoryDelimiter == null) {\n\t\t\t$this->_categoryDelimiter = $this->getVar('category_delimiter', '#');\n\t\t}\n\t\treturn $this->_categoryDelimiter;\n\t}",
"public function getMultipleValueSeparator()\n {\n if (!empty($this->_parameters[Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR])) {\n return $this->_parameters[Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR];\n }\n return Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR;\n }",
"private function setSeparator()\n\t\t{\n\t\t\t$separetor = explode('/', $this->_url);\n\t\t\t$separetor[2] = (isset($separetor[2]) && $separetor[2] != null ? $separetor[2] . 'Action' : 'indexAction');\n\t\t\tunset($separetor[0]);\n\t\t\t$this->_separetor = $separetor;\n\t\t}",
"private function setCoreCsvSettings()\n {\n $delimiter = $this->core->attributes->getNamedItem('fieldsTerminatedBy')->nodeValue;\n $this->coreDelimiter = ($delimiter === \"\\\\t\") ? \"\\t\" : $delimiter;\n $enclosure = $this->core->attributes->getNamedItem('fieldsEnclosedBy')->nodeValue;\n $this->coreEnclosure = $enclosure === '' ? '\"' : $enclosure;\n\n if ($this->coreDelimiter === '')\n {\n throw new \\Exception(trans('errors.csv_core_delimiter'));\n }\n }",
"public function setDelimiterReplacement($delimiterReplacement)\n {\n $this->_delimiterReplacement = $delimiterReplacement;\n return $this;\n }",
"function getEndDelimiter()\n {\n return $this->_objectPool[$this->_lastUsedObjectKey]->getOption('delimiter',1);\n }",
"public function setEscapeDelimiter($escape) {\n $this->escape= $escape{0};\n }",
"public function __construct($deliminator = ':') {\n\t\t$this->deliminator = $deliminator;\n\t}",
"public function setSeparator($sep)\n {\n $this->separator = $sep;\n return $this;\n }",
"public function getWordDelimiter()\n {\n return $this->_wordDelimiter;\n }",
"public function setSeparator($sep = ' - ')\n\t{\n\t\t$this->_separator = $sep;\n\t}",
"function __construct($delim = ',', $enclosure = '\"', $escape = '\\\\') {\n\t\t$this->delimeter = $delim;\n\t\t$this->enclosure = $enclosure;\n\t\t$this->escape = $escape;\n\t}",
"public function setColumnDelimiter(string $delimiter): self {\n\t\t$this->_columnDelimiter = $delimiter;\n\t\treturn $this;\n\t}",
"public function getSchemaSeparatorSymbol()\n {\n // if \"i5 naming\" is on, use '/' to separate schema and table. Otherwise use '.'\n if (array_key_exists('i5_naming', $this->driverOptions) && $this->driverOptions['i5_naming']) {\n\n // \"i5 naming\" mode requires a slash\n return '/';\n\n } else {\n // SQL naming requires a dot\n return '.';\n }\n }",
"public function getSeparator()\n\t{\n\t\treturn $this->_separator;\n\t}",
"public function begin_with_delimiter($delimiter, $margin = 0) {\n return $this->begin($margin)->with_delimiter($delimiter);\n }",
"private function setDirectorySeparator() {\n if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {\n // Windows\n self::$_DS = '\\\\';\n }\n }",
"public function getFileDelimiter()\n {\n $value = $this->_config->get('file/delimiter');\n\n if ($value === null) {\n $value = ';';\n }\n\n return $value;\n }",
"public function setDelimiter(\n string $separator = \",\",\n string $enclosure = \"\\\"\",\n string $escape = \"\\\\\"\n ): self {\n $this->file->setCsvControl($separator, $enclosure, $escape);\n\n return $this;\n }",
"private function setExtensionCsvSettings()\n {\n $delimiter = $this->extension->attributes->getNamedItem('fieldsTerminatedBy')->nodeValue;\n $this->extDelimiter = ($delimiter === \"\\\\t\") ? \"\\t\" : $delimiter;\n $enclosure = $this->extension->attributes->getNamedItem('fieldsEnclosedBy')->nodeValue;\n $this->extEnclosure = $enclosure === '' ? '\"' : $enclosure;\n\n if ($this->extDelimiter === '')\n {\n throw new \\Exception(trans('errors.csv_ext_delimiter'));\n }\n }",
"public function setSeparator($sep)\n {\n $this->setOption('separator', $sep);\n return $this;\n }",
"public function getSeparatorCharacter()\n\t{\n\t\treturn '_';\n\t}",
"public function providerDelimiters()\r\n\t{\r\n\t\treturn array(\r\n\t\t\tarray(\r\n\t\t\t\tarray(Delimiters::DELIMITER_COMMA, Delimiters::DELIMITER_NEW_LINE),\r\n\t\t\t\t\"\",\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\tarray(';', '%', Delimiters::DELIMITER_NEW_LINE),\r\n\t\t\t\t\"//[;][%]\\n1;2%3\",\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\tarray(\"\\n\"),\r\n\t\t\t\t\"//[%0A]\\n1\\n2\",\r\n\t\t\t),\r\n\t\t\tarray(\r\n\t\t\t\tarray('AsD', '\\*\\*\\*', Delimiters::DELIMITER_NEW_LINE),\r\n\t\t\t\t\"//[AsD][***][%0A]\\n1\\n***2AsD3\",\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"public function getSeparator()\n {\n return $this->_sSeparator;\n }",
"public function setNestSeparator($separator)\r\n {\r\n $this->_nestSeparator = $separator;\r\n\r\n return $this;\r\n }",
"function wploop_change_separator()\n{\nreturn '|';\n}",
"public function getColumnDelimiter(): string {\n\t\treturn $this->_columnDelimiter;\n\t}",
"public function __toString(){\r\n return \"DELIMITER \";\r\n }",
"protected function defaultCsvControl(& $delimiter, & $enclosure)\n {\n $csv = $this->getCsvControl();\n\n if (is_null($delimiter)) {\n $delimiter = $csv[0];\n }\n\n if (is_null($enclosure)) {\n $enclosure = $csv[1];\n }\n }",
"public function testGetSetArgumentsSeparator()\n {\n $this->ruleParse->setArgumentsDelimiter(',,');\n $this->assertEquals(',,', $this->ruleParse->getArgumentsDelimiter());\n }",
"public function seperator($seperator)\n {\n $this->seperator = $seperator;\n return $this->withMeta(['seperator' => $seperator]);\n }",
"public function testSetGetValidatorArgumentsSeparator()\n {\n $this->ruleParse->setValidatorArgumentsDelimiter('::');\n $this->assertEquals('::', $this->ruleParse->getValidatorArgumentsDelimiter());\n }",
"public\n function delimiter($data)\n {\n if ($data) {\n $idsOfTimeSlot = explode(\"/\", $data, -1);\n return $idsOfTimeSlot;\n }\n\n }",
"public function set_namespace_separator ( $sep ) {\r\n\t\t$this->_namespace_separator = $sep;\r\n\t}",
"abstract protected function getTokenSeparators() : array;",
"public function separator(): string;",
"function getDelimiter()\n{\n global $sugar_config;\n global $current_user;\n\n if (!empty($sugar_config['export_excel_compatible'])) {\n return \"\\t\";\n }\n\n $delimiter = ','; // default to \"comma\"\n $userDelimiter = $current_user->getPreference('export_delimiter');\n $delimiter = empty($sugar_config['export_delimiter']) ? $delimiter : $sugar_config['export_delimiter'];\n $delimiter = empty($userDelimiter) ? $delimiter : $userDelimiter;\n\n return $delimiter;\n}",
"public function getNodeKeySep()\n {\n return $this->nodeKeySep;\n }",
"public function exploder($delimiter,$value){\n\n\t return explode($delimiter, $value);\n\n }",
"function testSeparator(){\n\t\t#mdx:Separator\n\t\t$select = new HtCklist(\"select_days\");\n\t\t$select->options([1=>'Mon',2=>'Tue',3=>'Wed',4=>'Thu',5=>'Fri',6=>'Sat'])\n\t\t\t->separator(\" \");\n\n\t\t#/mdx echo $select\n\t\t$this->expectOutputRegex(\"/input.*?select_days.*?Mon.*?\".preg_quote(' ').\".*?Tue/s\");\n\t\techo $select;\t\t\n\t}",
"public function setTitleDelimiter($delimiter)\n {\n if (is_string($delimiter)) {\n $this->__titleDelimiter = $delimiter;\n }\n }",
"public static function setQuoteSeparator() {\n if (is_null(self::$quoteSeparator)) {\n switch(self::$connector->getAttribute(PDO::ATTR_DRIVER_NAME)) {\n case 'pgsql':\n case 'sqlsrv':\n case 'dblib':\n case 'mssql':\n case 'sybase':\n self::$quoteSeparator = '\"';\n break;\n case 'mysql':\n case 'sqlite':\n case 'sqlite2':\n default:\n self::$quoteSeparator = '`';\n }\n }\n }",
"public function setNodeKeySep($sep)\n {\n $this->nodeKeySep = (string) $sep;\n }",
"public function get_list_item_separator()\n {\n }",
"public function explodeField($value) {\n return $this->setProperty('explodeField', $value);\n }",
"public function explodeField($value) {\n return $this->setProperty('explodeField', $value);\n }"
] | [
"0.69964385",
"0.691462",
"0.6843811",
"0.6776612",
"0.6767413",
"0.67483395",
"0.67138314",
"0.67112726",
"0.66982",
"0.6601414",
"0.6601414",
"0.6601414",
"0.65962434",
"0.6542022",
"0.6477506",
"0.6475488",
"0.64649206",
"0.64649206",
"0.6419218",
"0.6359965",
"0.631946",
"0.6315702",
"0.6308942",
"0.6295403",
"0.6290026",
"0.6274039",
"0.626562",
"0.62347347",
"0.62329215",
"0.60717624",
"0.6013254",
"0.59938675",
"0.5965934",
"0.5892159",
"0.58701503",
"0.58608264",
"0.58458316",
"0.58458316",
"0.5840498",
"0.5829941",
"0.58043116",
"0.58034474",
"0.57895046",
"0.5764849",
"0.5748968",
"0.5731072",
"0.5721324",
"0.56711304",
"0.5665656",
"0.5604652",
"0.5604652",
"0.56004125",
"0.55810916",
"0.5566791",
"0.5566146",
"0.5533386",
"0.5494127",
"0.5470876",
"0.5469923",
"0.5460718",
"0.5450641",
"0.54186964",
"0.5417873",
"0.53938717",
"0.5392699",
"0.5386041",
"0.53769934",
"0.5372714",
"0.5370624",
"0.5368316",
"0.53624743",
"0.535928",
"0.53504103",
"0.53503716",
"0.53406096",
"0.5327157",
"0.53211856",
"0.53052056",
"0.53043014",
"0.5303391",
"0.5300815",
"0.52688605",
"0.52677244",
"0.52585936",
"0.5251156",
"0.5244641",
"0.52370626",
"0.5223059",
"0.51983833",
"0.51719326",
"0.51602054",
"0.51561576",
"0.51484466",
"0.51368874",
"0.51241577",
"0.51133645",
"0.5111028",
"0.51035887",
"0.50739557",
"0.50739557"
] | 0.6144288 | 29 |
Create a new Eloquent model instance. | public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->setTable(config('laravel-authorisation.table_names.roles'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }",
"protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }",
"protected function newModel(): Model\n {\n return (new $this->model)->fresh();\n }",
"protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\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 }",
"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 }",
"public function create(): Model;",
"protected function makeModel()\n {\n $model = app($this->getModelClass());\n\n if (!$model instanceof Model) {\n throw new \\Exception(\"Invalid Eloquent model\");\n }\n\n $this->model = $model;\n }",
"public function create(array $attributes): Model\n {\n return $this->model->create($attributes);\n }",
"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 createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}",
"public function create(array $attributes = [])\n {\n $class = $this->getModelNamespace();\n /** @var \\Illuminate\\Database\\Eloquent\\Model $model */\n $model = new $class($attributes);\n $res = $model->save();\n if ($res !== true) throw new \\Exception('Error creating model.');\n return $model;\n }",
"public function create()\n {\n return $this->modelManager->instance($this->model);\n }",
"protected function makeModel()\n {\n return factory(Employee::class)->create();\n }",
"public function create(Model $model);",
"public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}",
"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 }",
"public function create(array $attributes) : Model;",
"public function makeModel() {\r\n $model = $this->app->make($this->model());\r\n\r\n if (!$model instanceof Model) {\r\n throw new RepositoryException(\"Class {$this->model()} must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\r\n }\r\n return $this->model = $model;\r\n }",
"public function makeModel()\n {\n $model = $this->app->make($this->model());\n\n if (!$model instanceof Model)\n throw new RepositoryException(\"Class {$this->model()} must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n return $this->model = $model;\n }",
"private function makeModel() {\n \n $model = $this->app->make( $this->model() );\n\n if ( !$model instanceof Model )\n throw new RepositoryException(\"Class {$this->model} must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n $this->model = $model;\n\n return $this;\n }",
"public function create($data) : Model\n {\n return $this->getModel()->create($data);\n }",
"public function createModel()\n {\n }",
"public static function create(array $attributes = [])\n {\n $model = new static($attributes);\n\n $model->save();\n\n return $model;\n }",
"public static function create(array $attributes = [])\n {\n $model = new static($attributes);\n\n $model->save();\n\n return $model;\n }",
"protected function getModelInstance()\n {\n return new $this->model();\n }",
"protected function getNewModel()\n {\n $modelName = $this->getModelName();\n return new $modelName;\n }",
"protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }",
"public function create(Request $request): Model;",
"public static function model()\n {\n return new self;\n }",
"public static function create($params = array())\n {\n $model = new static();\n static::getSchema();\n if (!empty($params)) {\n $model->setProperties($params);\n }\n\n return $model;\n }",
"public function model()\n {\n $model = $this->_model;\n return new $model;\n\n }",
"public function create($data)\n\t{\n\t\t$model = $this->model->create($data);\n\n\t\treturn $model;\n\t}",
"public function __construct()\n {\n $this->model = app()->make($this->model());\n }",
"protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }",
"public function create(array $request): Model;",
"public function createModel()\n {\n return \\Model::factory(Group::class)->create();\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 createModel() {\n return null;\n }",
"private static function newModel(string $model, array $attributes = [])\n {\n return new $model(...array_values($attributes));\n }",
"public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }",
"abstract protected function newModel(): Model;",
"protected function _newModel($class)\n {\n // instantiate\n $model = new $class($this);\n \n // done!\n return $model;\n }",
"public function create(array $data = [])\n {\n $model = $this->factory($data);\n\n $this->save($model);\n\n return $model;\n }",
"public function model(Model $model)\n {\n return new ModelBuilder($model, $this->pdo, $this->handler);\n }",
"public function __construct(Eloquent $model)\n {\n $this->model = $model;\n }",
"public function getNewModel( array $attributes = array() ) {\n\t\treturn $this->model->newInstance( $attributes );\n\t}",
"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 }",
"public function newModel($name)\n {\n $class = $this->getClass($name);\n return $this->_newModel($class);\n }",
"protected function createModelInstance($options = [])\n {\n if (isset($options['model']) && !is_bool($options['model'])) {\n if (is_object($options['model'])) {\n return $options['model'];\n }\n $class = $this->getModelClass($options['model']);\n } else {\n $class = $this->getModelClass();\n }\n\n return new $class();\n }",
"public static function from(Model $model)\n {\n return new static($model);\n }",
"public function getModel()\n {\n return new $this->model;\n }",
"public static function create(array $attributes = [])\n {\n $model = new static($attributes);\n $model->setIncrementing(false)->save();\n return $model;\n }",
"public function create()\n {\n return view('eloquent.create');\n }",
"protected function makeInstance(array $attributes = [])\n {\n return Model::unguarded(function () use ($attributes) {\n $instance = new $this->class(\n $this->getRawAttributes($attributes)\n );\n\n if (isset($this->connection)) {\n $instance->setConnection($this->connection);\n }\n\n return $instance;\n });\n }",
"public function createModel($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->createModelWithOptions($request, $runtime);\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n // This method just provides a convenient way for us to generate fresh model\n // instances of this current model. It is particularly useful during the\n // hydration of new objects via the Eloquent query builder instances.\n $type = Arr::get($attributes, $this->getTypeColumn());\n\n if ($this->getTypes()->has($type)) {\n $class = $this->getTypes()->get($type);\n $model = new $class((array) $attributes);\n } else {\n $model = new static((array) $attributes);\n }\n\n $model->exists = $exists;\n\n $model->setConnection(\n $this->getConnectionName()\n );\n\n return $model;\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n\n $model = parent::newInstance($attributes, $exists);\n $model->setTable($this->table);\n\n return $model;\n }",
"public static function newModel($modelName) {\n\n\t\t$model = \"\\\\App\\\\Models\\\\\".$modelName;\n\n\t\treturn new $model();\n\n\t}",
"public function newInstance($attributes = [], $exists = false)\n {\n // This method just provides a convenient way for us to generate fresh model\n // instances of this current model. It is particularly useful during the\n // hydration of new objects via the Eloquent query builder instances.\n $model = new static((array) $attributes);\n\n $model->exists = $exists;\n\n $model->setConnection(\n $this->getConnectionName()\n );\n\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}",
"protected function model() {\n\t\t$model = Config::get('auth.model');\n\n\t\treturn new $model;\n\t}",
"public function create(array $attributes = [])\n {\n return tap($this->newModelInstance($attributes), function ($instance) {\n if (method_exists($instance, 'isTableShard')) {\n if ($instance->isTableShard()) {\n $instance->setTable($instance->getShardTable());\n }\n }\n $instance->save();\n });\n }",
"public function makeModel()\n {\n return $this->model;\n }",
"public static function create($attributes) {\n\t\t$model = new static($attributes);\n\n\t\t$success = $model->save();\n\n\t\treturn ($success) ? $model : false;\n\t}",
"public function make($modelClass);",
"static function Create() \n\t{\n if (NULL == self::$userModel) {\n self::$userModel = new UserModel();\n }\n return self::$userModel;\n }",
"public static function newModel(...$params) : Model\n {\n $model = new Model();\n $count = $params ? count($params) : 0;\n\n if ($count === 1)\n {\n $model->loadModelFromText($params[0]);\n }\n\n if ($count === 2 && $params[0])\n {\n $model->loadModel($params[0]);\n }\n\n return $model;\n }",
"public function create($attributes)\n {\n return $this->model->create($attributes);\n }",
"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 }",
"public function createModel(PayModel $model);",
"public function create(array $input)\n {\n $model = new $this->model();\n $model->fill($input);\n $model->save();\n\n return $model;\n }",
"public function model($name){\n\t\treturn new $name();\n\t}",
"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 create(array $attributes)\n {\n $model = $this->model->newInstance($attributes);\n $model->save();\n\n $this->resetModel();\n\n event(new RepositoryEntityCreated($this, $model));\n\n return $model;\n }",
"public static function getModel($name) {\r\n\r\n $class_name = '\\\\App\\\\Models\\\\' . ucfirst($name);\r\n return new $class_name();\r\n\r\n\r\n }",
"public function create()\n {\n return new $this->class;\n }",
"protected function _create_model_instance($orm) {\n\t\t\tif ($orm === false) {\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$model = new $this->_class_name();\n\t\t\t$model->set_orm($orm);\n\t\t\treturn $model;\n\t}",
"public function create($data=null) {\n\t\t\treturn $this->_create_model_instance(parent::create($data));\n\t}",
"public function create()\n {\n return $this->objectManager->create($this->className);\n }",
"protected function model()\n {\n $model = new $this->className;\n foreach ($this->conditions as $cond) {\n if (is_array($cond)) {\n if (count($cond) === 3) {\n // Convert to whereIn()\n if ($cond[1] === 'in') {\n $model = $model->whereIn($cond[0], $cond[2]);\n }\n // Typical 3 params where()\n else {\n $model = $model->where($cond[0], $cond[1], $cond[2]);\n }\n }\n elseif (count($cond) === 2) {\n // Typical 2 params where()\n $model = $model->where($cond[0], $cond[1]);\n }\n else {\n throw new \\Exception('Invalid number of parameters.');\n }\n }\n }\n $this->model = $model;\n return $this->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 }",
"public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }",
"public static function model($attrs)\n {\n $model = new static;\n\n foreach ($attrs as $key => $value) {\n $model->$key = $value;\n }\n\n return $model;\n }",
"public function getModel()\n {\n $model = Post::class;\n\n return new $model;\n }",
"private function makeModel($ip)\n {\n return $this->model->newInstance($ip);\n }",
"public function __construct()\n {\n $this->modelName = explode('.', Route::currentRouteName())[0];\n $this->model = new Model($this->modelName);\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n $model = new static((array) $attributes);\n\n $model->exists = $exists;\n\n return $model;\n }",
"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}",
"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 getModelInstance($modelName)\n {\n $modelInstance = new $modelName();\n\n if (!$modelInstance instanceof EloquentModel) {\n $message = \"Target [$modelName] is not an Illuminate\\Database\\Eloquent\\Model instance.\";\n\n throw new InvalidModelException($message);\n }\n\n return $modelInstance;\n }",
"protected function create()\n {\n return new $this->entityClass();\n }",
"public function query()\n {\n if ($model = $this->model) {\n return new $model();\n }\n }",
"public function _instanciar_model() {\n $Model = ClassRegistry::init('Autenticacao.' . $this->config['model_usuario']);\n return $Model;\n }",
"public function newInstance($attributes = [], $exists = false)\n {\n // This method just provides a convenient way for us to generate fresh model\n // instances of this current model. It is particularly useful during the\n // hydration of new objects via the Halcyon query builder instances.\n $model = new static((array) $attributes);\n\n $model->exists = $exists;\n\n return $model;\n }",
"public function model($model)\n\t{\n\t\trequire_once INC_ROOT .'/app/models/'. $model .'.php';\n\t\treturn new $model();\n\t}",
"public function getModel()\n {\n return $this->model->newInstance();\n }",
"public static function newModel()\n {\n return resolve(Manager::class);\n }",
"public function create(Request $request)\n {\n $model = $this->modelClass::create($request->all());\n return response()->json($model, 201);\n }",
"public function makeModel()\n {\n $modelPath = $this->getPath($this->getModelName());\n if(!$this->files->exists($modelPath)) {\n $this->call('make:model', [\n 'name' => $this->getModelName()\n ]);\n\n return true;\n }\n\n return false;\n }"
] | [
"0.7716505",
"0.76831555",
"0.76538384",
"0.76250803",
"0.7488277",
"0.74825823",
"0.74825823",
"0.7448064",
"0.7422717",
"0.7399602",
"0.7372696",
"0.72821194",
"0.7255092",
"0.7227033",
"0.72069234",
"0.70941734",
"0.7083216",
"0.69964826",
"0.6970113",
"0.6932459",
"0.69285417",
"0.68909836",
"0.6814157",
"0.6785681",
"0.6784601",
"0.6784601",
"0.6723278",
"0.66630644",
"0.66322935",
"0.65960056",
"0.65926224",
"0.65563834",
"0.65340406",
"0.65191877",
"0.65061283",
"0.64838165",
"0.6435244",
"0.6396941",
"0.6376497",
"0.63504934",
"0.63339",
"0.6318723",
"0.62790465",
"0.62739533",
"0.6254923",
"0.6242272",
"0.6240282",
"0.62189096",
"0.62178475",
"0.6211302",
"0.62012553",
"0.6191497",
"0.6173891",
"0.616844",
"0.6154717",
"0.6145988",
"0.6141606",
"0.61415356",
"0.6138199",
"0.613369",
"0.61333954",
"0.6128235",
"0.6123105",
"0.6076764",
"0.6062758",
"0.6053885",
"0.6040093",
"0.60369664",
"0.6029187",
"0.6025454",
"0.60229146",
"0.59812593",
"0.5973671",
"0.59708905",
"0.5967723",
"0.59618455",
"0.59566844",
"0.5954983",
"0.5948949",
"0.594689",
"0.5944768",
"0.59443575",
"0.5938722",
"0.5937692",
"0.5929185",
"0.591904",
"0.59122527",
"0.5896002",
"0.5883717",
"0.58794177",
"0.5863942",
"0.5862345",
"0.58500075",
"0.5847706",
"0.58458877",
"0.5843974",
"0.583036",
"0.5822564",
"0.58170444",
"0.58157593",
"0.5813466"
] | 0.0 | -1 |
A role may be given various permissions. | public function permissions()
{
return $this->belongsToMany(
config('laravel-authorisation.models.permission'),
config('laravel-authorisation.table_names.role_has_permissions')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function rolePerms($role);",
"public function ability($roles, $permissions, $options = []);",
"public function setRole($role);",
"public function is_role($role)\n {\n }",
"public function setAuthenticatedRole($role);",
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public function get_role($role)\n {\n }",
"public function assign($role, $permission);",
"public function getRole();",
"public function getRole();",
"public function get_role()\n {\n }",
"public function getRole() {}",
"public function add_role($role)\n {\n }",
"public function getAllPermissionsForRole(string $role): array;",
"public function is($role);",
"function add_manager_role()\n{\n add_role('manager', __(\n 'Manager'),\n array(\n 'read' => true, // Allows a user to read\n 'create_posts' => true, // Allows user to create new posts\n 'edit_posts' => true, // Allows user to edit their own posts\n )\n );\n}",
"public function hasRole($name);",
"public function set_role($role)\n {\n }",
"function getRole() {\n\t\treturn 1;\n\t}",
"protected abstract function getAllowedRoles();",
"public function testCreateRole()\n {\n }",
"public function testCreateRole()\n {\n }",
"public function rolesForUser();",
"public function run()\n {\n\n \t// ???\n $role = App\\Role::where('name', 'super')->first();\n\n $role = App\\Role::where('name', 'content')->first();\n $role->addPermission('gallery.create');\n $role->addPermission('gallery.edit');\n $role->addPermission('gallery.delete');\n\n }",
"function hasRole($role, $userId = null);",
"abstract public function hasRole($roleName);",
"public function role_can(Role $Role, string $action): bool;",
"function add_role($role, $display_name, $capabilities = array())\n {\n }",
"public function hasRole() {\n return $this->_has(2);\n }",
"public function HasRole ($roleName = NULL, $idRole = NULL);",
"function add_user_role_leadership(){\r\n\tif(isset($_GET['addrole']) && ($_GET['addrole'] == 'do')){\r\n\t\tadd_role( 'quote_manager', 'Quote Manager', array( 'read' => true, 'level_2' => true ) );\r\n\r\n//\t\tremove_role( 'tow_company' );\r\n\t}\r\n}",
"public function hasRole(string $role): bool;",
"static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }",
"public function isRole(): bool\n {\n return $this->getType() === static::TYPE_ROLE;\n }",
"public function hasRole($name, $requireAll = false);",
"public function getRolePermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $role_name = $this->argument('needle');\n\n $role = $this->permission->findBy('role_name', $role_name);\n if ($role) {\n $permissions = json_to_array($role->permission);\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n\n foreach ($permission as $ability=>$perm) {\n $vals = [$module, $ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No role found!\");\n }\n }",
"function hasRole($role)\n{\n\treturn $this->loggedUser? $this->loggedUser->hasRole($role) : false;\n}",
"public function getRole(){\n return $this->role; \n }",
"private function isOnlyRole($role = 'user') : bool\n {\n return $this->maxRole() === $role;\n }",
"public function authorize()\n {\n return auth()->user()->can('updatePermissions', [Role::class, request('role')]);\n }",
"function psp_add_role_caps()\n{\n $roles = array('manager');\n\n // Loop through each role and assign capabilities\n foreach ($roles as $the_role) {\n\n $role = get_role($the_role);\n\n $role->add_cap('read');\n $role->add_cap('create_cpt_project');\n $role->add_cap('create_private_cpt_project');\n $role->add_cap('read_cpt_project');\n $role->add_cap('read_private_cpt_project');\n $role->add_cap('edit_cpt_project');\n $role->add_cap('edit_published_cpt_project');\n $role->add_cap('publish_cpt_project');\n $role->add_cap('delete_private_cpt_project');\n $role->add_cap('delete_published_cpt_project');\n\n }\n}",
"public function attachRole($role);",
"public function attachRole($role);",
"public function hasRole($role)\n {\n return $this->isGranted($role); \n }",
"function wp_roles()\n {\n }",
"public function setRole($var)\n {\n GPBUtil::checkString($var, True);\n $this->role = $var;\n\n return $this;\n }",
"function auth_permissions($role)\n {\n $auth = _cfg('auth');\n $perms = isset($auth['permissions']) ? $auth['permissions'] : array();\n\n return isset($perms[$role]) ? $perms[$role] : null;\n }",
"function auth_role($role)\n {\n if (auth_isAnonymous()) {\n return false;\n }\n\n $auth = auth_prerequisite();\n $field = $auth['fields']['role'];\n $session = auth_get();\n\n return $session->$field == $role;\n }",
"function roleCreate(Role $role);",
"public function getPermissionByRoleID($id);",
"protected function configurePermissions()\n {\n Jetstream::defaultApiTokenPermissions(['read']);\n\n Jetstream::role('admin', __('Administrator'), [\n 'create',\n 'read',\n 'update',\n 'delete',\n ])->description(__('Administrator users can perform any action.'));\n\n Jetstream::role('editor', __('Editor'), [\n 'read',\n 'create',\n 'update',\n ])->description(__('Editor users have the ability to read, create, and update.'));\n }",
"public function run()\n {\n $clients = Permission::where('name', 'like', '%clients%')->get()->toArray();\n $corporations = Permission::where('name', 'like', '%corporations%')->get()->toArray();\n $jobs = Permission::where('name', 'like', '%jobs%')->get()->toArray();\n $users = Permission::where('name', 'like', '%users%')->get()->toArray();\n $tags = Permission::where('name', 'like', '%tags%')->get()->toArray();\n\n \\tecai\\Models\\System\\Role::create([\n 'name' => 'root',\n 'display_name' => 'Super Admin',\n 'description' => 'the root account,Super Admin'\n ]);\n\n $roleAdmin = \\tecai\\Models\\System\\Role::create([\n 'name' => 'admin',\n 'display_name' => 'platform Admin',\n 'description' => 'the guy to admin the platform'\n ]);\n $this->attachPermission($roleAdmin, $clients, $corporations, $jobs, $users, $tags);\n\n\n $roleLegaler = \\tecai\\Models\\System\\Role::create([\n 'name' => 'legaler',\n 'display_name' => 'corporation-legaler',\n 'description' => 'the corporation legal person'\n ]);\n $this->attachPermission($roleLegaler, $corporations, $jobs, $users, $tags);\n\n $roleStaff = \\tecai\\Models\\System\\Role::create([\n 'name' => 'staff',\n 'display_name' => 'corporation-staff',\n 'description' => 'the corporation staff'\n ]);\n $this->attachPermission($roleStaff, $corporations, $jobs, $users, $tags);\n\n }",
"public function has(Role $role, Permission $permission)\n {\n // todo: implement method\n }",
"function getRole()\n {\n return $this->role;\n }",
"public function testPolicyPermissions()\n {\n // User of super admin role always has permission\n $role = factory(\\App\\Models\\Role::class)->make(['name' => 'Admin']);\n $this->roleRepository->create($role);\n $admin = $this->createUser(['role' => $role]);\n $this->assertTrue($admin->isSuperAdmin());\n $this->assertTrue($admin->can('create', User::class));\n\n // User of normal role does not have permission ...\n $user = $this->createUser();\n $this->assertFalse($user->isSuperAdmin());\n $this->assertFalse($user->can('create', User::class));\n $this->assertFalse($user->can('list', User::class));\n\n // ... even if it has module permission ..\n $role = $user->getRole();\n $this->roleRepository->addPermission($role, $this->permissionRepository->findBy('name', 'use-access-module'));\n $this->assertTrue($user->can('access', 'module'));\n $this->assertFalse($user->can('master', 'module'));\n $this->assertFalse($user->can('create', User::class));\n\n // ... until final permission is added\n $this->roleRepository->addPermission($role, $this->permissionRepository->findBy('name', 'user-create'));\n $this->assertTrue($user->can('create', User::class));\n $this->assertFalse($user->can('list', User::class));\n }",
"public function getPermissionRoleByRoleID($id);",
"function custom_permissions() {\n\t\tif ($this->dx_auth->is_logged_in()) {\n\t\t\techo 'My role: '.$this->dx_auth->get_role_name().'<br/>';\n\t\t\techo 'My permission: <br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('edit') != NULL AND $this->dx_auth->get_permission_value('edit')) {\n\t\t\t\techo 'Edit is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Edit is not allowed';\n\t\t\t}\n\t\t\t\n\t\t\techo '<br/>';\n\t\t\t\n\t\t\tif ($this->dx_auth->get_permission_value('delete') != NULL AND $this->dx_auth->get_permission_value('delete')) {\n\t\t\t\techo 'Delete is allowed';\n\t\t\t} else {\n\t\t\t\techo 'Delete is not allowed';\n\t\t\t}\n\t\t}\n\t}",
"public function getRole() : string;",
"function auth_roles()\n {\n if (auth_isAnonymous()) {\n return false;\n }\n\n $auth = auth_prerequisite();\n $field = $auth['fields']['role'];\n $session = auth_get();\n $roles = func_get_args();\n\n return in_array($session->$field, $roles);\n }",
"public function checkRole(Role $role){\n $grant = false;\n foreach ($this->getRoles() as $userRole){\n if($userRole == $role){\n $grant = true;\n }\n }\n if(!$grant){ \n $_SESSION['login_message'] = 'You do not have required permissions to acces the page';\n header('Location: index.php');\n exit();\n }\n }",
"public function addRole($username, $role);",
"public function listPermissionByRole()\n {\n $roles = $this->roleRepository->all();\n $permissions = $this->permissionRepository->all();\n return view('admin.permission.permission_role', compact('roles', 'permissions'));\n }",
"private function role_assigned($event) {\n global $DB;\n $contextlevel = $event->contextlevel;\n $userid = $event->relateduserid;\n $gmail = $this->get_google_authenticated_users_gmail($userid);\n $insertcalls = array();\n if ($contextlevel == 40) {\n // Category role assigned.\n $categoryid = $event->contextinstanceid;\n $courses = $DB->get_records('course', array('category' => $categoryid), '', 'id, visible');\n foreach ($courses as $course) {\n $courseid = $course->id;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n if (has_capability('moodle/course:view', $coursecontext, $userid)) {\n // Manager; insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $userid)) {\n // Teacher (enrolled) (active); insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true)) {\n // Student (enrolled) (active); do nothing (user_enrolment_created handles reader permission).\n } else {\n // Unenrolled user; do nothing (user enrolment would not have changed during this event).\n }\n }\n }\n }\n }\n } elseif ($contextlevel == 50) {\n // Course role assigned.\n $courseid = $event->courseid;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n if (has_capability('moodle/course:view', $coursecontext, $userid)) {\n // Manager; insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $userid)) {\n // Teacher (enrolled) (active); insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true)) {\n // Student (enrolled) (active); do nothing (user_enrolment_created handles reader permission).\n } else {\n // Unenrolled user; do nothing (user enrolment would not have changed during this event).\n }\n }\n }\n }\n } else if ($contextlevel == 70) {\n // Course module role assigned.\n $cmid = $event->contextinstanceid;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n if (has_capability('moodle/course:view', $coursecontext, $userid)) {\n // Manager; insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $userid)) {\n // Teacher (enrolled) (active); insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true)) {\n // Student (enrolled) (active); do nothing (user_enrolment_created handles reader permission).\n } else {\n // Unenrolled user; do nothing (user enrolment would not have changed during this event).\n }\n }\n }\n \n }\n\n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n }",
"public function getRole() \n {\n return $this->role;\n }",
"function rolePermissionFactory()\n {\n return [\n 'factory'=>(new JbRolePermission)\n ];\n }",
"public function set_role($role) {\n $this->role = $role;\n }",
"public function getAuthenticatedRole();",
"public function authorize()\n {\n return auth()->user()->can('role@create') || auth()->user()->can('role@edit');\n }",
"public function roles_protected() {\n return true;\n }",
"public function getRole()\n {\n return $this->access_level;\n }",
"public function getRole(){\r\n\t\t\treturn $this->role;\r\n\t\t}",
"function passes_required_role($requiredrole,$loggedrole){\n\t$ret=false;\n\tif($loggedrole==1) $ret=true;//admin sees everything\n\telse if(is_array($requiredrole) and in_array($loggedrole,$requiredrole)) $ret=true;\n\telse if(!is_array($requiredrole) and ($requiredrole>=$loggedrole)) $ret=true;\n\treturn $ret;\n}",
"public function getRole(){\n\t\tif (current_user_can('editor')) {\n\t\t\t$this->role_object = get_role('editor');\n\t\t}\n\t}",
"public function testCheckingRoles()\n {\n $this->assertTrue($this->principal->hasRole('baz'));\n $this->assertFalse($this->principal->hasRole('doesNotExist'));\n }",
"public function testUpdateRole()\n {\n }",
"public function testUpdateRole()\n {\n }",
"public function hasRole($user, string $role = 'login'): bool {}",
"public function assignPermission(Request $request, Role $role)\n {\n if(Auth::user()->can('assign-permission-to-role')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $permission = Permission::find($id);\n $role->givePermissionTo($permission->name);\n ActivityLogger::activity(\"Le role ID:\".$role->id.'('.$role->name.') a désormais la permission id:'.$permission->id.'('.$permission->name.') donnée par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' role(s) assigné(s) à la permission '.$permission->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role avec la liste des permissions possibles\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }",
"public function index($id = null)\n {\n if (is_null($id)) {\n redirect('/roles');\n }\n\n // permissions restrictions are the same as for roles\n $this->checkPermission('roles', 'edit');\n\n // check if role exists\n $this->db->where('id', $id);\n $q = $this->db->get('roles');\n if ($q->num_rows() <= 0) {\n redirect('/roles');\n }\n $role = $q->result()[0];\n\n // form was submitted\n if (\n isset($_SERVER['REQUEST_METHOD']) &&\n $_SERVER['REQUEST_METHOD'] == 'POST'\n ) {\n $this->db->delete('rights', ['role_id' => $id]);\n\n foreach ($this->input->post('permissions') as $name => $values) {\n if (!array_key_exists($name, $this->permissions)) {\n continue;\n }\n $this->db->insert('rights', [\n 'role_id' => $id,\n 'name' => $name,\n 'show' =>\n (\n array_key_exists('show', $values) &&\n $this->permissions[$name]->show\n )\n ? 1\n : 0,\n 'add' =>\n (array_key_exists('add', $values) && $this->permissions[$name]->add)\n ? 1\n : 0,\n 'edit' =>\n (\n array_key_exists('edit', $values) &&\n $this->permissions[$name]->edit\n )\n ? 1\n : 0,\n 'delete' =>\n (\n array_key_exists('delete', $values) &&\n $this->permissions[$name]->delete\n )\n ? 1\n : 0\n ]);\n }\n\n $this->writeLog(\n 'update',\n 'rights',\n ['permissions' => $this->input->post('permissions'), 'role_id' => $id],\n $id\n );\n\n $this->session->set_flashdata(\n 'success',\n \"Les permissions de ce rôle ont bien été modifiées avec succès !\"\n );\n\n redirect('/roles');\n }\n\n // get current role permissions\n $this->db->where('role_id', $id);\n $permissions = $this->db->get('rights')->result();\n\n foreach ($permissions as $permission) {\n if (!array_key_exists($permission->name, $this->permissions)) {\n continue;\n }\n if ($permission->show == 1) {\n $this->permissions[$permission->name]->checked[] = 'show';\n }\n if ($permission->add == 1) {\n $this->permissions[$permission->name]->checked[] = 'add';\n }\n if ($permission->edit == 1) {\n $this->permissions[$permission->name]->checked[] = 'edit';\n }\n if ($permission->delete == 1) {\n $this->permissions[$permission->name]->checked[] = 'delete';\n }\n }\n\n $this->view('permissions', [\n 'role' => $role,\n 'permissions' => $this->permissions\n ]);\n }",
"public function grant_permission(Role $Role, string $action): ?PermissionInterface;",
"public function role(){\n $obj = $this->hasMany(UserRole::class,'user_id','id')\n ->join('role', 'role.id', '=', 'role_id')->with('permissions');\n return $obj;\n }",
"public function testRolesAreAppledToAdminAndEditor() {\n\t\tberry_activation();\n\t\t$admin = get_role( 'administrator' );\n\t\t$this->assertTrue( $admin->has_cap( 'berry_admin' ) );\n\n\t\t$editor = get_role( 'editor' );\n\t\t$this->assertTrue( $editor->has_cap( 'berry_user' ) );\n\n\t}",
"function create_role($name, $shortname, $description, $legacy='') {\n\n // check for duplicate role name\n\n if ($role = get_record('role','name', $name)) {\n error('there is already a role with this name!');\n }\n\n if ($role = get_record('role','shortname', $shortname)) {\n error('there is already a role with this shortname!');\n }\n\n $role = new object();\n $role->name = $name;\n $role->shortname = $shortname;\n $role->description = $description;\n\n //find free sortorder number\n $role->sortorder = count_records('role');\n while (get_record('role','sortorder', $role->sortorder)) {\n $role->sortorder += 1;\n }\n\n if (!$context = get_context_instance(CONTEXT_SYSTEM)) {\n return false;\n }\n\n if ($id = insert_record('role', $role)) {\n if ($legacy) {\n assign_capability($legacy, CAP_ALLOW, $id, $context->id);\n }\n\n /// By default, users with role:manage at site level\n /// should be able to assign users to this new role, and override this new role's capabilities\n\n // find all admin roles\n if ($adminroles = get_roles_with_capability('moodle/role:manage', CAP_ALLOW, $context)) {\n // foreach admin role\n foreach ($adminroles as $arole) {\n // write allow_assign and allow_overrid\n allow_assign($arole->id, $id);\n allow_override($arole->id, $id);\n }\n }\n\n return $id;\n } else {\n return false;\n }\n\n}",
"public function testAdminCanAddARole()\n {\n $permission = Permission::where('name', 'view_roles')->first();\n\n $params = [\n 'name' => $this->faker->name(),\n 'permissions' => [$permission->name],\n ];\n\n $response = $this\n ->actingAs($this->admin)\n ->post('/admin/roles', $params);\n\n $response->assertStatus(302);\n $response->assertSessionHasNoErrors();\n $response->assertRedirect('/admin/roles');\n $response->assertSessionHas('success', __('roles.success_create_message'));\n\n $role = Role::where('name', $params['name'])->first();\n $this->assertNotNull($role);\n $this->assertEquals($params['name'], $role->name);\n }",
"private function getUserRolePermissions()\n {\n return [];\n }",
"public function testHasRoleModule()\n {\n\n $this->user->switchUser('test_annon');\n\n $orm = $this->db->orm;\n $textTest = $orm->get('WbfsysText',\"access_key='text_1'\");\n $textSecret = $orm->get('WbfsysText',\"access_key='secret'\");\n\n $res = $this->acl->hasRole('test_annon');\n $this->assertTrue('hasRole test_annon returned false',$res);\n\n $res = $this->acl->hasRole('test_annon', 'mod-test');\n $this->assertTrue('hasRole test_annon returned false',$res);\n\n $res = $this->acl->hasRole('test_annon', 'mod-test', $textTest);\n $this->assertTrue('hasRole test_annon for text test returned false',$res);\n\n $res = $this->acl->hasRole('test_annon', 'mod-test', $textSecret);\n $this->assertTrue('hasRole test_annon text secret returned false',$res);\n\n $res = $this->acl->hasRole('test_annon', 'mod-test_2');\n $this->assertTrue('hasRole test_annon returned false',$res);\n\n $res = $this->acl->hasRole('test_annon', 'mod-test_2', $textTest);\n $this->assertTrue('hasRole test_annon for text test returned false',$res);\n\n $res = $this->acl->hasRole('test_annon', 'mod-test_2', $textSecret);\n $this->assertTrue('hasRole test_annon text secret returned false',$res);\n\n $res = $this->acl->hasRole('fubar');\n $this->assertFalse('hasRole fubar returned true',$res);\n\n }",
"public function testAddRole()\n {\n $this->assertEquals([[PhpAro::DEFAULT_ROLE]], $this->Acl->Aro->roles('foobar'));\n $this->Acl->Aro->addRole(['User/foobar' => 'Role/accounting']);\n $this->assertEquals([['Role/accounting'], ['User/foobar']], $this->Acl->Aro->roles('foobar'));\n }",
"public function testOgRole() {\n $roles = OgRole::loadMultiple();\n\n $this->assertEquals(7, count($roles), '7 roles were migrated.');\n\n // Asserts that the non-member role has subscribe permission.\n $anonymousRole = OgRole::load('node-test_content_type-non-member');\n $this->assertEquals(['subscribe'], $anonymousRole->getPermissions());\n\n // Asserts permissions on administrative role.\n $adminRole = OgRole::load('node-test_content_type-administrator');\n $expected = [\n 'add user',\n 'administer group',\n 'approve and deny subscription',\n 'manage members',\n 'manage permissions',\n 'manage roles',\n 'update group',\n ];\n $this->assertEquals($expected, $adminRole->getPermissions());\n\n // Asserts permissions for content creator role.\n $contentRole = OgRole::load('node-test_content_type-content-creator');\n $expected = [\n 'create article content',\n 'create page content',\n ];\n $this->assertEquals($expected, $contentRole->getPermissions());\n }",
"public function isRole(){\n $r=Cache::get('role');\n if ((int)$r ==2)\n {\n return true;\n }\n else\n return false;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }",
"public function getRole()\n {\n return $this->role;\n }"
] | [
"0.74771976",
"0.7247951",
"0.7148672",
"0.7126162",
"0.70345294",
"0.69388777",
"0.69388777",
"0.69388777",
"0.69388777",
"0.69222504",
"0.6896925",
"0.6866305",
"0.6866305",
"0.6820855",
"0.6813886",
"0.6809663",
"0.67830205",
"0.6780388",
"0.67657846",
"0.6756673",
"0.67521757",
"0.67510164",
"0.6747241",
"0.67320186",
"0.67320186",
"0.67226857",
"0.6710102",
"0.67087436",
"0.67083085",
"0.6694102",
"0.6675055",
"0.65966564",
"0.65783936",
"0.6564802",
"0.654174",
"0.65399605",
"0.65096444",
"0.6497037",
"0.64949715",
"0.64907557",
"0.64902145",
"0.6484801",
"0.6467986",
"0.6461865",
"0.64598346",
"0.64598346",
"0.6418273",
"0.6417102",
"0.6415583",
"0.64083534",
"0.64030355",
"0.6402771",
"0.6396858",
"0.639589",
"0.6392921",
"0.6386507",
"0.6370129",
"0.6369193",
"0.63615143",
"0.63556653",
"0.63530403",
"0.63503873",
"0.63462555",
"0.6346246",
"0.6343233",
"0.6342435",
"0.63268536",
"0.63176155",
"0.6316279",
"0.63105935",
"0.6305869",
"0.6300546",
"0.62967414",
"0.62920123",
"0.62866515",
"0.6279558",
"0.6279129",
"0.6274208",
"0.6274208",
"0.62726253",
"0.62725383",
"0.6272527",
"0.6264226",
"0.6260826",
"0.6248745",
"0.62463117",
"0.6243935",
"0.624227",
"0.62331164",
"0.6231632",
"0.622711",
"0.6227047",
"0.6224402",
"0.6224402",
"0.6224402",
"0.6224402",
"0.6224402",
"0.6224402",
"0.6224402",
"0.6224402",
"0.6224402"
] | 0.0 | -1 |
A role may be assigned to various users. | public function users()
{
return $this->belongsToMany(
config('auth.model') ?: config('auth.providers.users.model'),
config('laravel-authorisation.table_names.user_has_roles')
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setRole($role);",
"public function addRole($username, $role);",
"public function assignRole ($name);",
"abstract protected function rolePerms($role);",
"public function add_role($role)\n {\n }",
"function hasRole($role, $userId = null);",
"public function is_role($role)\n {\n }",
"public function attachRole($role);",
"public function attachRole($role);",
"public function set_role($role)\n {\n }",
"public function rolesForUser();",
"public function assignUser(Request $request, Role $role)\n {\n if(Auth::user()->can('assign-role-to-user')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $user = User::find($id);\n $user->assignRole($role->name);\n ActivityLogger::activity(\"Le collaborateur ID:\".$user->id.'('.$user->name.') a désormais le role id:'.$role->id.'('.$role->name.') donné par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' collaborateur(s) assigné(s) au role '.$role->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role avec la liste des permissions possibles\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }",
"public function setAuthenticatedRole($role);",
"function add_role($role, $display_name, $capabilities = array())\n {\n }",
"public function assign($role, $permission);",
"function roleCreate(Role $role);",
"public function role() {\n\t\treturn $this->has_one('Role_Assignment', 'user_id');\n\t}",
"private function role_assigned($event) {\n global $DB;\n $contextlevel = $event->contextlevel;\n $userid = $event->relateduserid;\n $gmail = $this->get_google_authenticated_users_gmail($userid);\n $insertcalls = array();\n if ($contextlevel == 40) {\n // Category role assigned.\n $categoryid = $event->contextinstanceid;\n $courses = $DB->get_records('course', array('category' => $categoryid), '', 'id, visible');\n foreach ($courses as $course) {\n $courseid = $course->id;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n if (has_capability('moodle/course:view', $coursecontext, $userid)) {\n // Manager; insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $userid)) {\n // Teacher (enrolled) (active); insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true)) {\n // Student (enrolled) (active); do nothing (user_enrolment_created handles reader permission).\n } else {\n // Unenrolled user; do nothing (user enrolment would not have changed during this event).\n }\n }\n }\n }\n }\n } elseif ($contextlevel == 50) {\n // Course role assigned.\n $courseid = $event->courseid;\n $course = $DB->get_record('course', array('id' => $courseid), 'visible');\n $coursecontext = context_course::instance($courseid);\n $coursemodinfo = get_fast_modinfo($courseid, -1);\n $cms = $coursemodinfo->get_cms();\n foreach ($cms as $cm) {\n $cmid = $cm->id;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n if (has_capability('moodle/course:view', $coursecontext, $userid)) {\n // Manager; insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $userid)) {\n // Teacher (enrolled) (active); insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true)) {\n // Student (enrolled) (active); do nothing (user_enrolment_created handles reader permission).\n } else {\n // Unenrolled user; do nothing (user enrolment would not have changed during this event).\n }\n }\n }\n }\n } else if ($contextlevel == 70) {\n // Course module role assigned.\n $cmid = $event->contextinstanceid;\n $cmcontext = context_module::instance($cmid);\n $fileids = $this->get_fileids($cmid);\n if ($fileids) {\n foreach ($fileids as $fileid) {\n if (has_capability('moodle/course:view', $coursecontext, $userid)) {\n // Manager; insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true) && has_capability('moodle/course:manageactivities', $cmcontext, $userid)) {\n // Teacher (enrolled) (active); insert writer permission.\n $call = new stdClass();\n $call->fileid = $fileid;\n $call->gmail = $gmail;\n $call->role = 'writer';\n $insertcalls[] = $call;\n if (count($insertcalls) == 1000) {\n $this->batch_insert_permissions($insertcalls);\n $insertcalls = array();\n }\n } elseif (is_enrolled($coursecontext, $userid, null, true)) {\n // Student (enrolled) (active); do nothing (user_enrolment_created handles reader permission).\n } else {\n // Unenrolled user; do nothing (user enrolment would not have changed during this event).\n }\n }\n }\n \n }\n\n // Call any remaining batch requests.\n if (count($insertcalls) > 0) {\n $this->batch_insert_permissions($insertcalls);\n }\n }",
"function add_user_role_leadership(){\r\n\tif(isset($_GET['addrole']) && ($_GET['addrole'] == 'do')){\r\n\t\tadd_role( 'quote_manager', 'Quote Manager', array( 'read' => true, 'level_2' => true ) );\r\n\r\n//\t\tremove_role( 'tow_company' );\r\n\t}\r\n}",
"public function setRole($userId, $roleId);",
"public function assignRole($role)\n {\n if (!Yii::$app->authManager->checkAccess($this->id, $role)) {\n $authRole = Yii::$app->authManager->getRole($role);\n Yii::$app->authManager->assign($authRole, $this->id);\n\n return true;\n }\n\n return false;\n }",
"static function role_assigned($data) {\n require_once CURMAN_DIRLOCATION.'/lib/student.class.php';\n require_once CURMAN_DIRLOCATION.'/lib/instructor.class.php';\n global $CURMAN;\n if (!($context = get_context_instance_by_id($data->contextid))) {\n $context = get_context_instance($data->contextid, $data->itemid);\n }\n if (!empty($context) && $context->contextlevel == context_level_base::get_custom_context_level('class', 'block_curr_admin')) {\n $cmuserid = cm_get_crlmuserid($data->userid);\n if ($data->roleid == $CURMAN->config->enrolment_role_sync_student_role) {\n // add enrolment record\n $student = new student();\n $student->userid = $cmuserid;\n $student->classid = $context->instanceid;\n // NOTE: student::add checks if the student is already\n // enrolled, so we don't have to check here\n $student->add();\n }\n if ($data->roleid == $CURMAN->config->enrolment_role_sync_instructor_role) {\n // add instructor record\n if (!instructor::user_is_instructor_of_class($cmuserid, $context->instanceid)) {\n $instructor = new instructor();\n $instructor->userid = $cmuserid;\n $instructor->classid = $context->instanceid;\n $instructor->add();\n }\n }\n }\n return true;\n }",
"public function roles();",
"public function roles();",
"public function roles();",
"public function roles();",
"public function assignRole($role)\n {\n $roles = is_array($role) ? $role : [$role];\n $roles = array_map(function($role) {\n return is_string($role) ? Role::find($role) : $role;\n }, $roles);\n $this->set('roles', $roles);\n $result = TableFactory::getUserModel()\n ->save($this) !== false;\n RolesTableTrait::refreshCache($this->id);\n\n return $result;\n }",
"public function actionUserRole ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\n\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} забрали права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $user->getRolesNames()) ]));\n\t\t\t\t$user->revokeAllRoles();\n\t\t\t\tif (is_array($post[ 'roles' ]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($post[ 'roles' ] as $item)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->assignRole($item);\n\t\t\t\t\t}\n\t\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} добавили права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $post[ 'roles' ]) ]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}",
"public function testCreateRole()\n {\n }",
"public function testCreateRole()\n {\n }",
"public function HasRole ($roleName = NULL, $idRole = NULL);",
"public function assignRole(\n string $username,\n string $role,\n ColumnInterface $column = null\n ):bool;",
"function user_can_assign($context, $targetroleid) {\n\n // first check if user has override capability\n // if not return false;\n if (!has_capability('moodle/role:assign', $context)) {\n return false;\n }\n // pull out all active roles of this user from this context(or above)\n if ($userroles = get_user_roles($context)) {\n foreach ($userroles as $userrole) {\n // if any in the role_allow_override table, then it's ok\n if (get_record('role_allow_assign', 'roleid', $userrole->roleid, 'allowassign', $targetroleid)) {\n return true;\n }\n }\n }\n\n return false;\n}",
"public function setRole($var)\n {\n GPBUtil::checkString($var, True);\n $this->role = $var;\n\n return $this;\n }",
"public function get_role($role)\n {\n }",
"public function set_role($role) {\n $this->role = $role;\n }",
"function SetUserRole ($userRoleId = null, $data = array()) {\n $answer = $this->answer;\n\n if ($userRoleId) {\n // update user role\n $this->db\n ->where('role_id', $userRoleId)\n ->update('user_role', $data);\n // here must be notification email function\n }\n else {\n // create user role\n $this->db->insert('user_role', $data);\n $userRoleId = $this->db->insert_id();\n\n // here must be notification email function, new id is for it\n }\n\n $answer['success'] = true;\n $answer['result'] = $userRoleId;\n return $answer;\n }",
"public function setUserRole(User $user, Role $role);",
"function wv_create_user_roles($roleName, $roleKey, $capability_Arr) {\n add_role($roleKey, $roleName, $capability_Arr);\n }",
"abstract public function hasRole($roleName);",
"public function hasRole($name);",
"public function isHasRole($userId, $role) {\n\t}",
"function getRole() {\n\t\treturn 1;\n\t}",
"public function AddRole ($roleName = NULL, $idRole = NULL);",
"public function hasRole($user, string $role = 'login'): bool {}",
"public function giveRole($role)\n {\n return Role::whereName($role)\n ->firstOrFail()\n ->assignRoleTo($this);\n }",
"public function is($role);",
"public function assignRole($role)\n {\n return $this->roles()->sync([$role]);\n }",
"function set_user_role($role, $user_id = null) {\n\tglobal $db;\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\t$prepared = $db->prepare(\"\n UPDATE users\n\t\t\tSet role_id = (SELECT role_id FROM roles WHERE name = ?)\n\t\t\tWhere user_id = ?\n \");\n\n\t$prepared->bind_param('si', $role, $user_id);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function getRole();",
"public function getRole();",
"public function hasRole($name, $requireAll = false);",
"function set_roles( $user_id, $roles ) {\r\n\r\n\t\t}",
"function create_role($name, $shortname, $description, $legacy='') {\n\n // check for duplicate role name\n\n if ($role = get_record('role','name', $name)) {\n error('there is already a role with this name!');\n }\n\n if ($role = get_record('role','shortname', $shortname)) {\n error('there is already a role with this shortname!');\n }\n\n $role = new object();\n $role->name = $name;\n $role->shortname = $shortname;\n $role->description = $description;\n\n //find free sortorder number\n $role->sortorder = count_records('role');\n while (get_record('role','sortorder', $role->sortorder)) {\n $role->sortorder += 1;\n }\n\n if (!$context = get_context_instance(CONTEXT_SYSTEM)) {\n return false;\n }\n\n if ($id = insert_record('role', $role)) {\n if ($legacy) {\n assign_capability($legacy, CAP_ALLOW, $id, $context->id);\n }\n\n /// By default, users with role:manage at site level\n /// should be able to assign users to this new role, and override this new role's capabilities\n\n // find all admin roles\n if ($adminroles = get_roles_with_capability('moodle/role:manage', CAP_ALLOW, $context)) {\n // foreach admin role\n foreach ($adminroles as $arole) {\n // write allow_assign and allow_overrid\n allow_assign($arole->id, $id);\n allow_override($arole->id, $id);\n }\n }\n\n return $id;\n } else {\n return false;\n }\n\n}",
"public function getRole() {}",
"public function get_role()\n {\n }",
"public function setRole() {\n\n $res= $_POST['link']->query(\"SELECT t2.perm_name FROM role_perm as t1\n JOIN permissions as t2 ON t1.perm_id = t2.perm_id\n WHERE t1.role_id = $this->rol_id\");\n\n\n foreach($res as $item)\n $this->role_perm[]= $item['perm_name'];\n }",
"function canChangeRole($user) {\n \treturn $user->isAdministrator() || $user->isPeopleManager();\n }",
"public function setRole($role)\n {\n $this->_role = $role;\n }",
"public function assignRole($role)\n {\n return $this->roles()->save(\n Role::whereName($role)->firstOrFail()\n );\n }",
"public function assignRole($role)\n {\n return $this->roles()->save(\n Role::whereName($role)->firstOrFail()\n );\n }",
"public function actionCreateRole($role_name, $user_id_or_name){\n $user_id = $this->getUserId($user_id_or_name);\n\n $auth = Yii::$app->authManager;\n $role = $auth->createRole($role_name . '-user-id-' . $user_id);\n $auth->add($role);\n }",
"public function assignRole($role)\n {\n return $this->role()->save(\n Role::whereName($role)->firstOrFail()\n );\n }",
"public function testAddRole()\n {\n $this->assertEquals([[PhpAro::DEFAULT_ROLE]], $this->Acl->Aro->roles('foobar'));\n $this->Acl->Aro->addRole(['User/foobar' => 'Role/accounting']);\n $this->assertEquals([['Role/accounting'], ['User/foobar']], $this->Acl->Aro->roles('foobar'));\n }",
"public function to($role);",
"public function roleInUse(string $role): bool;",
"static function setRole(&$rsData, $role)\n {\n $rsData['role'] = $role;\n }",
"public function hasRole(string $role): bool;",
"function user_has_role_assignment($userid, $roleid, $contextid=0) {\n\n if ($contextid) {\n return record_exists('role_assignments', 'userid', $userid, 'roleid', $roleid, 'contextid', $contextid);\n } else {\n return record_exists('role_assignments', 'userid', $userid, 'roleid', $roleid);\n }\n}",
"function add_manager_role()\n{\n add_role('manager', __(\n 'Manager'),\n array(\n 'read' => true, // Allows a user to read\n 'create_posts' => true, // Allows user to create new posts\n 'edit_posts' => true, // Allows user to edit their own posts\n )\n );\n}",
"private function isOnlyRole($role = 'user') : bool\n {\n return $this->maxRole() === $role;\n }",
"function setRole($value)\n\t{\n\t\t$this->setState('__role', $value);\n\t}",
"public function setRole($role)\n {\n $this->role = $role;\n }",
"public function testRolesAreAppledToAdminAndEditor() {\n\t\tberry_activation();\n\t\t$admin = get_role( 'administrator' );\n\t\t$this->assertTrue( $admin->has_cap( 'berry_admin' ) );\n\n\t\t$editor = get_role( 'editor' );\n\t\t$this->assertTrue( $editor->has_cap( 'berry_user' ) );\n\n\t}",
"public function setRoles($roles = [])\n {\n\n $rolesPermissionsToUpdate = Role::whereIn('name',$roles);\n $rolesPermissionsToDelete = $this->roles()->whereNotIn('role_id',$rolesPermissionsToUpdate->pluck('id')->toArray())->where('user_id',$this->id);\n\n UserRole::whereIn('role_id',$rolesPermissionsToDelete->pluck('id')->toArray())->where('user_id',$this->id)->delete();\n\n $diff = array_intersect($rolesPermissionsToUpdate->pluck('name')->toArray(),$roles);\n\n if (sizeOf($diff) > 0)\n {\n collect($diff)->each(function($roleName) use ($rolesPermissionsToUpdate){\n\n $role = Role::where('name',$roleName)->first();\n\n UserRole::create([\n 'user_id' => $this->id,\n 'role_id' => $role->id\n ]);\n\n });\n }\n\n }",
"public function addUserRole($role)\r\n {\r\n if($this->userRoleModel->isExistUserRole($role['id']))\r\n {\r\n $this->userRoleModel->updateExistingUserRole($role);\r\n }\r\n else\r\n {\r\n //IF role not exist then add new role\r\n $this->userRoleModel->addNewUserRole($role);\r\n }\r\n }",
"public function testSetRoleUsers()\n {\n }",
"function is_user_in_role( $user_id, $role ) {\r\n $user = new WP_User( $user_id );\r\n\treturn ( ! empty( $user->roles ) && is_array( $user->roles ) && in_array( $role, $user->roles ) );\r\n}",
"private function setRoles() {\r\n\t\t$all_roles = array(); $role = Model_Role::retrieve(); \r\n\t\tforeach ($role->fetchEntries(array(\r\n \t\t'NAME', 'PARENT' => new Data_Column('PARENT_ROLE_ID', null, $role, 'NAME'))) as $rel)\r\n\t\t{\t\r\n \t\t$all_roles[$rel['NAME']] = array($rel['PARENT']);\r\n\t\t}\r\n\t\t\r\n\t\t// get users with role reslationship \r\n\t\t$userRole = Model_User_Role::retrieve(); \r\n\t\tforeach ($userRole->fetchEntries(array(\r\n \t\t'NAME' => new Data_Column('USER_ID', null, $userRole, 'LOGIN'),\r\n \t\t'PARENT' => new Data_Column('ROLE_ID', null, $userRole, 'NAME')), null, true) as $rel)\r\n\t\t{\t\t\t\r\n\t\t // one user can belong to more than one role\r\n\t\t\tif (array_key_exists($rel['NAME'], $all_roles))\r\n\t\t array_push($all_roles[$rel['NAME']], $rel['PARENT']);\r\n\t\t else\r\n\t\t $all_roles[$rel['NAME']] = array($rel['PARENT']);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t// now register all roles and users from database as application roles\r\n\t\tforeach ($all_roles as $name => $roles) {\r\n\t\t $this->_registerRole($name, $all_roles);\r\n\t\t}\r\n\t\t\r\n\t\t//$this->_registerRole('Guest', array());\r\n\t}",
"public function SetRoles ($roles);",
"public function assignRole($role)\n {\n return $this->roles()->attach($role);\n }",
"public function actionRole()\n {\n foreach (USER::getRoleOptions() as $key => $val) {\n\n self::log(\"\\n\" . $val . ' Role-id is ' . $key . \"\\n\");\n }\n\n if (is_null($this->email)) {\n\n self::log('Email required ! (Hint -e=)');\n\n return ExitCode::DATAERR;\n }\n\n $model = User::findOne([\n 'email' => $this->email\n ]);\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->role_id)) {\n\n self::log('Current Role Id is ' . $model->role_id . \"\\n\");\n self::log('Add correct Role id (Hint -r=)');\n\n return ExitCode::DATAERR;\n }\n\n if (is_null(ArrayHelper::getValue(USER::getRoleOptions(), $this->role_id))) {\n\n self::log('Please enter correct role id :');\n\n return ExitCode::DATAERR;\n }\n\n $model->role_id = $this->role_id;\n\n if (! $model->save()) {\n\n self::log('Please enter valid Role Id ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Role Id successfully Updated !');\n\n return ExitCode::OK;\n }",
"function user_role_need ($role) {\r\n\t$info = user_info();\r\n\treturn ($info[3] == $role ? true : false);\r\n}",
"function assign($Role, $UserID = null)\n\t{\n $databaseManager = Rbac::getInstance()->getDatabaseManager();\n \n\t if ($UserID === null)\n {\n throw new RbacUserNotProvidedException('$UserID is a required argument.');\n } \n $RoleID = Rbac::getInstance()\n ->getRbacManager()\n ->getRoleManager()\n ->getId($Role)\n ;\n\n return $databaseManager->request(\n 'INSERT INTO ' . $databaseManager->getTablePrefix() . 'userroles\n (UserID,RoleID,AssignmentDate) VALUES (?,?,?)'\n , [$UserID, $RoleID, time()]) >= 1;\n\t}",
"public function addRole($role)\n {\n $role = strtoupper($role);\n if ($role === static::ROLE_DEFAULT) {\n return;\n }\n if (!in_array($role, $this->roles, true)) {\n $this->roles[] = $role;\n }\n }",
"public function isUserAssignable()\r\n {\r\n return strpos($this->assignRole,'ROLE_USER') !== false ? true : false;\r\n }",
"function assign_user_role($userId, $roleId) {\n\t\tglobal $database;\n\t\t$assignrolequery = \"INSERT INTO user_in_rules (user_id, role_id) VALUES (:userId, :roleId)\";\n\n\t\t$stmt = $database->prepare($assignrolequery);\n\n\t\t$stmt->bindParam(':userId', $userId);\n\t\t$stmt->bindParam(':roleId', $roleId);\n\n\t\t$stmt->execute();\n\t}",
"public function associateRolesToUser($params)\n {\n $this->db_removeAllRolesFromUser($params);\n\n //2. Add Current Roles From User\n $roles_arr = $params['role_ids'];\n foreach($roles_arr as $role)\n {\n $data = array(\n 'user_id' => $params['user_id'],\n 'role_id' => $role\n );\n $this->db_addRoleToUser($data);\n }\n\n return true;\n }",
"public function setDesiredRole($val)\n {\n $this->_propDict[\"desiredRole\"] = $val;\n return $this;\n }",
"public function visitUser(User $role);",
"protected abstract function getAllowedRoles();",
"public function attachRoles($roles);",
"function frame_user_role($role, $user_id = null)\n{\n if (is_numeric($user_id))\n $user = get_userdata($user_id);\n else\n $user = wp_get_current_user();\n\n if (empty($user))\n return false;\n\n $intersection = array_intersect((array) $role, (array) $user->roles);\n\n return !empty($intersection) ? true : false;\n}",
"function hasRole($role)\n{\n\treturn $this->loggedUser? $this->loggedUser->hasRole($role) : false;\n}",
"public function getRole(){\n return $this->role; \n }",
"function group_can_change_role($groupid, $userid, $role) {\n $groupid = group_param_groupid($groupid);\n $userid = group_param_userid($userid);\n\n if (!group_user_access($groupid, $userid)) {\n return false;\n }\n\n // Sole remaining admins can never change their role\n if (group_is_only_admin($groupid, $userid)) {\n return false;\n }\n\n // admin role permissions check\n if ($role == 'admin') {\n $group = group_current_group();\n $user = new User();\n $user->find_by_id($userid);\n safe_require('grouptype', $group->grouptype);\n return in_array($group->jointype, call_static_method('GroupType' . $group->grouptype, 'user_allowed_join_types', $user));\n }\n\n return true;\n}",
"static public function add()\n {\n add_role(\n self::ROLE_KEY, \n self::ROLE_NAME, \n [\n 'read' => true,\n 'edit_posts' => true, \n 'upload_files' => false,\n 'edit_others_posts' => true, //a tester a false\n\n 'edit_exercices' => true,\n 'publish_exercices' => false,\n 'read_exercice' => true,\n 'delete_exercice' => true,\n //'delete_exercices' => true,\n 'edit_others_exercices' => false,\n 'delete_others_exercices' => false,\n 'edit_exercice' => true,\n\n 'edit_lessons' => true,\n 'publish_lessons' => true,\n 'read_lesson' => true,\n 'delete_lesson' => true,\n 'edit_others_lessons' => false,\n 'delete_others_lessons' => false,\n 'edit_lesson' => true,\n\n 'manage_arts' => false,\n 'edit_arts' => false,\n 'delete_arts' => false,\n 'assign_arts' => true, \n ]\n\n );\n }",
"public function giveRole($role)\n {\n if($role instanceof Role) {\n return $role->assignRoleTo($this);\n }\n\n return Role::whereName($role)\n ->firstOrFail()\n ->assignRoleTo($this);\n }",
"static function assign($roles)\n {\n $org = &self::$users[self::$user][self::$org];\n\n if(!isset($org))\n $org = [];\n\n foreach((array)$roles as $role)\n array_push($org, $role);\n\n return __CLASS__;\n }",
"public function addRole($role)\n {\n $this->roles[] = $role;\n }",
"function assignRoles($uName, $roleList) {\n\n Util::throwExceptionIfNullOrBlank($uName, \"User Name\");\n Util::throwExceptionIfNullOrBlank($roleList, \"RoleList\");\n $objUtil = new Util($this->apiKey, $this->secretKey);\n\n try {\n $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n if (is_array($roleList)) {\n $body = '{\"app42\":{\"user\":{\"userName\":\"' . $uName . '\",\"roles\": { \"role\": ' . json_encode($roleList) . '}}}}';\n } else {\n $body = '{\"app42\":{\"user\":{\"userName\":\"' . $uName . '\",\"roles\": { \"role\": \"' . $roleList . '\"}}}}';\n }\n $signParams['body'] = $body;\n $signature = urlencode($objUtil->sign($signParams));\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/assignrole\";\n $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams);\n $userResponseObj = new UserResponseBuilder();\n $userObj = $userResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n\n return $userObj;\n }"
] | [
"0.7209276",
"0.713437",
"0.7113247",
"0.7072112",
"0.6998895",
"0.69528925",
"0.6921699",
"0.689455",
"0.689455",
"0.6883119",
"0.67959195",
"0.674237",
"0.67267007",
"0.67080843",
"0.6672729",
"0.66716594",
"0.66711766",
"0.66699445",
"0.6648641",
"0.6638523",
"0.6627777",
"0.66190326",
"0.65920967",
"0.65920967",
"0.65920967",
"0.65920967",
"0.6583806",
"0.6575691",
"0.6570221",
"0.6570221",
"0.656088",
"0.6532637",
"0.65291035",
"0.65227705",
"0.6522191",
"0.6487927",
"0.64788884",
"0.6466259",
"0.64655006",
"0.64349806",
"0.6408323",
"0.6403067",
"0.6402672",
"0.6396811",
"0.639382",
"0.6388168",
"0.638759",
"0.63764745",
"0.6367146",
"0.635104",
"0.635104",
"0.63425434",
"0.6337395",
"0.6320789",
"0.6319652",
"0.6298975",
"0.6290298",
"0.6289529",
"0.628511",
"0.6272212",
"0.6272212",
"0.6270164",
"0.62606424",
"0.62527996",
"0.625123",
"0.6248485",
"0.62466234",
"0.62418485",
"0.6240596",
"0.62278163",
"0.62271106",
"0.6227074",
"0.6223779",
"0.622268",
"0.62183255",
"0.62021774",
"0.6197184",
"0.6187322",
"0.61802274",
"0.6178148",
"0.6174306",
"0.6170164",
"0.616743",
"0.6166278",
"0.6165023",
"0.6163001",
"0.6160408",
"0.6151327",
"0.61410487",
"0.614056",
"0.6131821",
"0.6131225",
"0.61266124",
"0.61262494",
"0.6117837",
"0.61111647",
"0.611012",
"0.61075866",
"0.6103878",
"0.610223",
"0.6100898"
] | 0.0 | -1 |
A role can have een parent role. | public function parentrole()
{
return $this->belongsTo(self::class, 'parent_id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function parentRole()\n {\n if ($this->parent_id == null) {\n return null;\n }\n return $this->hasOne(Config::get('guardian.role'), 'id', 'parent_id');\n }",
"protected function parentRole()\n {\n return !empty($this->parentRole) ? $this->parentRole : $this->parent->recordRole();\n }",
"public function parent()\n {\n if ($this->parent_id == null) {\n return null;\n }\n return $this->hasOne(Config::get('guardian.role'), 'id', 'parent_id');\n }",
"public function parent()\n {\n return $this->belongsTo(config('rbac.models.role'),'parent_id');\n }",
"public function setParent(Role $parent)\n {\n $this->parent = $parent;\n }",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function children()\n {\n return $this->hasMany(config('rbac.models.role'),'parent_id');\n }",
"final public function allowsParent() {\n\t\treturn true;\n\t}",
"public function hasParent() {}",
"public function isParent();",
"public function hasParent()\n {\n }",
"public function hasParent();",
"public function hasParent();",
"public function hasParent();",
"protected function hasParentMenuItem() {}",
"public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }",
"public function setRole($role)\n {\n $this->parentRole = $role;\n }",
"public function getAllRolesWithParentRoles() {\n return RoleHelper::getUserParentRoles($this);\n }",
"public function canHaveChildren() {}",
"function parentNode() {\n if (!$this->id && empty($this->data)) {\n return null;\n }\n if (isset($this->data['User']['role_id'])) {\n $roleId = $this->data['User']['role_id'];\n } else {\n $roleId = $this->field('role_id');\n }\n if (!$roleId) {\n return null;\n } else {\n return array('Role' => array('id' => $roleId));\n }\n }",
"public function role() {\n\t\treturn $this->has_one('Role_Assignment', 'user_id');\n\t}",
"public function role()\n {\n return $this->hasOne('App\\Roles','id','role');\n }",
"public function hasRole() {\n return $this->_has(2);\n }",
"function is_role($roles = array(), $use_role_name = TRUE, $check_parent = TRUE)\n\t{\n\t\t// Default return value\n\t\t$result = FALSE;\n\t\n\t\t// Build checking array\n\t\t$check_array = array();\n\t\t\n\t\tif ($check_parent)\n\t\t{\n\t\t\t// Add parent roles into check array\n\t\t\tif ($use_role_name)\n\t\t\t{\n\t\t\t\t$check_array = $this->ci->session->userdata('DX_parent_roles_name');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$check_array = $this->ci->session->userdata('DX_parent_roles_id');\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Add current role into check array\n\t\tif ($use_role_name)\n\t\t{\n\t\t\tarray_push($check_array, $this->ci->session->userdata('DX_role_name'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tarray_push($check_array, $this->ci->session->userdata('DX_role_id'));\n\t\t}\n\t\t\n\t\t// If $roles not array then we add it into an array\n\t\tif ( ! is_array($roles))\n\t\t{\n\t\t\t$roles = array($roles);\n\t\t}\n\t\t\n\t\tif ($use_role_name)\n\t\t{\n\t\t\t// Convert check array into lowercase since we want case insensitive checking\n\t\t\tfor ($i = 0; $i < count($check_array); $i++)\n\t\t\t{\n\t\t\t\t$check_array[$i] = strtolower($check_array[$i]);\n\t\t\t}\n\t\t\n\t\t\t// Convert roles into lowercase since we want insensitive checking\n\t\t\tfor ($i = 0; $i < count($roles); $i++)\n\t\t\t{\n\t\t\t\t$roles[$i] = strtolower($roles[$i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check if roles exist in check_array\n\t\tif ($this->_array_in_array($roles, $check_array))\n\t\t{\n\t\t\t$result = TRUE;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function role()\n {\n return $this->hasOne('App\\Models\\Role');\n }",
"public function parentPermissions()\n {\n $parentPermissions = collect([]);\n\n $parent = $this->parentrole;\n\n while (!is_null($parent)) {\n if ($parent->permissions->count()) {\n $parentPermissions->push($parent->permissions);\n }\n $parent = $parent->parentrole;\n }\n\n return $parentPermissions;\n }",
"public function hasParentId(){\n return $this->_has(3);\n }",
"public function role()\n {\n return $this->hasOne('Role', 'id', 'role_id');\n }",
"abstract public function parent();",
"public function role()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\RoleModel', 'role_id');\n }",
"public function role()\n {\n return $this->belongsTo('\\\\Neoflow\\\\CMS\\\\Model\\\\RoleModel', 'role_id');\n }",
"public function user_role (){\n return $this->hasOne(Role::class);// relates to role model\n }",
"abstract public function is_for_parent_node(Jquarry_Node $parent);",
"public function role()\n {\n return $this->hasOne('App\\Models\\Role', 'id', 'role_id');\n }",
"public function role()\n {\n return $this->hasOne('App\\Models\\UserRoles', 'role_id', 'id');\n }",
"abstract public function hasRole($roleName);",
"public function isRole(): bool\n {\n return $this->getType() === static::TYPE_ROLE;\n }",
"public function role() {\n return $this->belongsTo(Role::class);\n }",
"public function role() {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(Role::class);\n }",
"public function HasRole ($roleName = NULL, $idRole = NULL);",
"public function getParentRoles()\n {\n $parents = collect([]);\n\n $parent = $this->parent;\n\n while (!is_null($parent)) {\n $parents->push($parent);\n $parent = $parent->parent;\n }\n\n return $parents;\n }",
"public function role()\n {\n return $this->belongsTo(Role::class, 'role_id', 'role_id');\n }",
"public function role() {\n return $this->belongsTo('App\\Role');\n }",
"public function role()\n {\n return $this->hasMany('App\\Role', 'role_user');\n }",
"public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }",
"public function parent()\n {\n return $this->belongsTo('Amerhendy\\Employment\\App\\Models\\Base\\Menu', 'parent_id');\n }",
"public function role()\n {\n return $this->belongsTo('Role');\n }",
"public function is_role($role)\n {\n }",
"public function role() {\n return $this->belongsTo('App\\Role');\n }",
"protected function hasParentMenuItemKey() {}",
"public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }",
"public function role()\n {\n return $this->belongsTo('App\\Role');\n }",
"public function roles(): MorphToMany;",
"public function isParent(): bool // need to move method to services\n {\n $match = User::join('account_user_permission', 'account_user_permission.user_id','=','users.id')\n ->join('accounts', 'accounts.id','=','account_user_permission.account_id')\n ->join('permissions','permissions.id','=','account_user_permission.permission_id')\n ->where('permissions.name','=','permissions.parents')\n ->where('users.id','=',$this->id)\n ->count();\n if($match>0) {\n return true;\n }\n return false;\n }",
"public function parent_acl_resource() {\n return $this->_model('parent_acl_resource', $this->vars['parent_id'], 'acl\\resource\\model');\n }",
"public function role(){\n return $this->belongsTo('App\\Role');\n }",
"public function hasRole($name);",
"public function getRole();",
"public function getRole();",
"public function role()\n {\n return $this->belongsTo(Role::class, 'role_id');\n }",
"public function role()\n {\n return $this->belongsTo(Role::class, 'role_id');\n }",
"public function role(){\n return $this->belongsTo('App\\Role', 'role-id');\n }",
"public function role() //<- role + _id == role_id\n {\n return $this->belongsTo(Role::class);\n }",
"public function role()\n {\n return $this->belongsTo(\"App\\Models\\Role\", \"role_id\", \"id\");\n }",
"public function role(){\n return $this->belongsToMany('App\\Models\\Role','permission_role','permission_id', 'role_id');\n }",
"function getRole() {\n\t\treturn 1;\n\t}",
"public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }",
"public static function role(): Role\n {\n return new Role;\n }",
"public function getRole() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"public function getParent() {}",
"private function parent()\n {\n return $this->belongsTo(Menu::class);\n }",
"public function is($role);",
"public function parent() { }",
"public function role(){\n return $this->belongsTo(Rol::class);\n }",
"public function role()\n {\n return $this->belongsTo('App\\Roles', 'role_id');\n }",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"public function getParent();",
"protected function hasParentMenuArr() {}"
] | [
"0.7558466",
"0.72053415",
"0.7043911",
"0.70424426",
"0.6691024",
"0.6591013",
"0.6505603",
"0.6461153",
"0.6369699",
"0.6353067",
"0.626471",
"0.62257785",
"0.62257785",
"0.62257785",
"0.620633",
"0.6202284",
"0.61791736",
"0.6111024",
"0.60926",
"0.60570765",
"0.6054575",
"0.60345095",
"0.6027444",
"0.59641683",
"0.59289736",
"0.5904427",
"0.5901599",
"0.5894751",
"0.5886294",
"0.58840185",
"0.58840185",
"0.58778244",
"0.58604103",
"0.58413494",
"0.5826056",
"0.5810926",
"0.5794475",
"0.57870144",
"0.57870144",
"0.5778063",
"0.5778063",
"0.5778063",
"0.5778063",
"0.5778063",
"0.5778063",
"0.5778063",
"0.5778063",
"0.5758447",
"0.5753334",
"0.57449406",
"0.5743564",
"0.574124",
"0.57280815",
"0.5709974",
"0.570474",
"0.5702334",
"0.5701591",
"0.569313",
"0.56890064",
"0.5680611",
"0.56756794",
"0.56659776",
"0.56651044",
"0.565678",
"0.5647901",
"0.56454766",
"0.56454766",
"0.5639505",
"0.5639505",
"0.56271476",
"0.5609478",
"0.56003535",
"0.5592468",
"0.55913985",
"0.55815434",
"0.55802953",
"0.55767757",
"0.557375",
"0.557375",
"0.557375",
"0.557375",
"0.557375",
"0.557375",
"0.557375",
"0.5572769",
"0.5554269",
"0.5552152",
"0.5540168",
"0.55335873",
"0.55325377",
"0.55325377",
"0.55325377",
"0.55325377",
"0.55325377",
"0.55325377",
"0.55325377",
"0.55325377",
"0.55325377",
"0.55325377",
"0.5531369"
] | 0.7532712 | 1 |
Find a role by its name. | public static function findByName($name)
{
$role = static::where('name', $name)->first();
if (!$role) {
throw new RoleDoesNotExist();
}
return $role;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function findByName($name)\n {\n return Role::where('name', $name)->firstOrFail();\n }",
"public function findRoleByName(string $name)\n {\n if (! $this->roles) {\n $this->roles = $this->client->guild->getGuildRoles([\n 'guild.id' => $this->guildId,\n ]);\n }\n\n foreach ($this->roles as $role) {\n if ($role->name == $name) {\n return $role;\n }\n }\n\n return null;\n }",
"public static function findByName($name)\n {\n $role = static::where('name', $name)->first();\n\n if (! $role) {\n throw new RoleDoesNotExist();\n }\n\n return $role;\n }",
"public function getByName($roleName);",
"public function getRoleByName(string $name): Role\n {\n return Role::where('name', $name)->first();\n }",
"public function getRoleIdByName($name)\n {\n return $this->roles->where('name', $name)->pluck('id')->first();\n }",
"function get_role($role_name){\n\t\tglobal $database;\n\t\t$getrolequery = \"SELECT id FROM roles WHERE role = :roleName\";\n\n\t\t$stmt = $database->prepare($getrolequery);\n\n\t\t$stmt->bindParam(':roleName', $role_name);\n\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetch();\n\t}",
"public static function findByRole($role_name)\n {\n return static::find()\n ->join('LEFT JOIN','auth_assignment','auth_assignment.user_id = easyii_users.user_id')\n ->where(['auth_assignment.item_name' => $role_name]);\n }",
"function IdRole($name)\n {\n $role = Catalogo::select('id')->table('ROLES')->where('codigo',$name)->first();\n return $role->id;\n }",
"public static function getRole($role_name)\r\n\t{\r\n\t\t$roleModel = new self();\r\n\t\t$select = $roleModel->select();\r\n\t\t$select->from('role',array('role_id'));\r\n\t\t$select->where('role_name = \"' . $role_name .'\"');\t\t\r\n\t\treturn $roleModel->fetchAll($select);\t\t\r\n\t}",
"public static function getByRoleName($role_name)\n {\n return self::getByAnyField(__CLASS__, 'role_name', $role_name);\n }",
"public static function getProjectRoleId($name){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT id\n FROM project_role\n\t\t\tWHERE name = :name\";\n $stmt = $db->prepare($sql);\n\t\t$stmt->bindValue(\":name\", $name);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }\n\t}",
"public function hasRole($name);",
"public function findByName($name)\n {\n $role = $this->model->where('name', $name)->first();\n\n return $this->toDomainModel($role);\n }",
"public function getNameByRole ($name, $role) {\n\t\t#coopy/CompareFlags.hx:407: characters 9-37\n\t\t$parts = HxString::split($name, \":\");\n\t\t#coopy/CompareFlags.hx:408: characters 9-48\n\t\tif ($parts->length <= 1) {\n\t\t\t#coopy/CompareFlags.hx:408: characters 34-45\n\t\t\treturn $name;\n\t\t}\n\t\t#coopy/CompareFlags.hx:409: lines 409-411\n\t\tif ($role === \"parent\") {\n\t\t\t#coopy/CompareFlags.hx:410: characters 13-28\n\t\t\treturn ($parts->arr[0] ?? null);\n\t\t}\n\t\t#coopy/CompareFlags.hx:413: lines 413-415\n\t\tif ($role === \"local\") {\n\t\t\t#coopy/CompareFlags.hx:414: characters 13-43\n\t\t\treturn ($parts->arr[$parts->length - 2] ?? null);\n\t\t}\n\t\t#coopy/CompareFlags.hx:416: characters 9-39\n\t\treturn ($parts->arr[$parts->length - 1] ?? null);\n\t}",
"public function find(int $roleId);",
"public function get_role($role)\n {\n }",
"public function getRoleById($id){\n\t\t$sql = \"SELECT name FROM role WHERE id = ?\";\n\t\t$req = $GLOBALS[\"conn\"]->prepare($sql);\n\t\t$req->execute([$id]);\n\n\t\t$result = $req->fetch();\n\t\treturn $result[\"name\"];\n\t}",
"public static function resolve_user_role($name)\n {\n }",
"function getter_role_exists($role_name) {\n\n\tif (is_callable('roles_get_role_by_name')) {\n\t\t$role = call_user_func('roles_get_role_by_name', $role_name);\n\t}\n\n\t$role_guid = (elgg_instanceof($role)) ? $role->guid : ELGG_ENTITIES_NO_VALUE;\n\n\tglobal $INBOX_TABLE_ITERATOR;\n\t$INBOX_TABLE_ITERATOR++;\n\n\t$table = \"inb$INBOX_TABLE_ITERATOR\";\n\n\t$dbprefix = elgg_get_config('dbprefix');\n\treturn array(\n\t\t'wheres' => array(\n\t\t\t\"EXISTS (SELECT * FROM {$dbprefix}entity_relationships {$table} \n\t\t\t\tWHERE {$table}.guid_one = e.guid AND {$table}.relationship = 'has_role' AND {$table}.guid_two = {$role_guid})\"\n\t\t)\n\t);\n}",
"public function getRole();",
"public function getRole();",
"protected function getRole($role)\n\t{\n\t\treturn Role::where('type', $role)->get()->first();\n\t}",
"public function HasRole ($roleName = NULL, $idRole = NULL);",
"function findRole($idrole, $pdo){\n $req = $pdo -> prepare('SELECT * FROM t_roles WHERE ID_ROLE = ?');\n $req -> execute([$idrole]);\n $row = $req -> fetch();\n return $row['ROLEDESI'] ;\n}",
"protected function is_exists($name, $id = null)\n {\n return Role::where('name', '=', str_replace(' ', '_', strtolower($name)))\n ->where('id', '<>', $id)->get()->count();\n }",
"public function findResource($id)\n {\n // TODO: Implement findResource() method.\n if (!$role = Role::findOrFail($id))\n {\n return Response::responseNotFound();\n }\n\n return $role;\n }",
"public static function find($name);",
"public static function find($name);",
"public static function findByRolename($rolename)\n {\n return static::findOne(['name' => $rolename]);\n }",
"public function getRoleByName() {\n $term = Request::input('term', '');\n\n $results = array();\n $queries = Role::where('name', 'LIKE', '%'.$term.'%')\n ->take(10)->get();\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->name];\n return response()->json($results);\n }",
"public function findByName(String $name);",
"public function getRole()\n\t{\n\t\tif ($this->roles->count())\n\t\t\treturn $this->roles[0]->name;\n\n\t\treturn null;\n\t}",
"function is($role_name){\n $this->CI->load->model('role');\n $role = $this->CI->role->getRoleOnUserByName($this->username(), $role_name);\n if(!empty($role)) return $role;\n else return false;\n }",
"public function findByName($name);",
"public function findByName($name);",
"public function findByName($name);",
"public function getRole() {}",
"public function findRol(Route $route)\n\t{\n\t\t$this->rol = Rol::findOrFail($route->getParameter('roles'));\n\t}",
"function removeRole( $name ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['roles'] as $key => $role) {\n if ($name == $role['name']) {\n unset($d['roles'][$key]);\n $found = true;\n }\n }\n if ($found) {\n audit( \"removeRole\", $name );\n saveDB( $d );\n }\n }",
"abstract public function hasRole($roleName);",
"public function findByName(string $name)\n {\n return Permission::whereName($name)->first();\n }",
"static public function getRole() {\n\t\tif(!Yii::$app->user->isGuest) {\n\t\t\tif($role = AuthAssignment::findOne(['user_id' => Yii::$app->user->identity->id]))\n\t\t\t\tif($key = array_search($role->item_name, Yii::$app->params['league_roles']))\n\t\t\t\t\treturn $key;\n\t\t\treturn self::DEFAULT_ROLE;\n\t\t}\n\t\treturn null;\n\t}",
"public static function getRow($name) {\n\t\t// fetch the user's row\n\t\t$roleModel = new self ( );\n\t\t\t$select = $roleModel->select ();\n\t\t\t$select->where ( 'name = ? ', $name );\n\t\t\treturn $roleModel->fetchRow ( $select );\n\t}",
"function getRole($roleId) {\n $statement = 'SELECT role FROM ROLE_LOV where id = (?)';\n $query = $this->prepare($statement);\n $query->execute([$roleId]);\n return $query->fetch();\n }",
"public function assignRole ($name);",
"public function findRole($value)\n {\n if ($this->isInstanceOfRoleModel($value)) {\n return $value;\n }\n\n if (is_int($value)) {\n return Role::find($value);\n }\n\n return Role::where('slug', $value)->first();\n }",
"public function find($id)\n {\n return $this->roles->findOrFail($id);\n }",
"public function findName($name)\n {\n return $this->model->where('name', $name)->first();\n }",
"public function findByName(string $name): Route\n {\n foreach ($this->routes as $routingCollection) {\n foreach ($routingCollection as $route) {\n if ($route->getName() === $name) {\n return $route;\n }\n }\n }\n\n throw new RouteNotFoundException(\"Named Route '{$name}' not found!\");\n }",
"public function find(string $name): ?Route\n {\n /** @var Route|RouteCollection $route */\n foreach ($this->iterable ?? $this->routes as $route) {\n if ($route instanceof Route && $name === $route->get('name')) {\n return $route;\n }\n }\n\n return null;\n }",
"function get_role($role_id) {\n\t\treturn $this->db->get_where('system_security.security_role', array('role_id' => $role_id));\n\t\t\n\t}",
"function getName() {\n\t\treturn \"role\";\n\t}",
"public function hasRole($name)\n {\n foreach ($this->roles as $role)\n {\n if ($role->name == $name) return true;\n }\n return false;\n }",
"public function getRole() : string;",
"public function find($id) {\n // Récupération du rôle à partir de son id\n $row = $this->getDb()->fetchAssoc(\"select * from roles where id=?\", array($id));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new \\Exception(\"Aucun role trouvé pour l'id \" . $id);\n }",
"public function get(NtUid $id)\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('r')\n ->from(Role::class, 'r')\n ->where('r.id=:id')\n ->setParameter('id', $id);\n\n $role = $qb->getQuery()->getOneOrNullResult();\n\n if($role == null) {\n throw new RoleNotFoundException($id);\n }\n\n return $role;\n }",
"public function roleExists(string $role): bool;",
"function resolve($role) {\n if($role instanceof Role) {\n return $role;\n }\n \n if(is_int($role)) {\n $role = (string) $role;\n }\n \n if(is_string($role) && parent::has($role)) {\n return parent::get($role);\n }\n \n throw new InvalidArgumentException('Unable to resolve unknown role');\n }",
"static function getRoleName($role)\n {\n return self::$_roles[$role];\n }",
"private function _getRole()\n {\n //return role\n if(false/*logged_in*/){\n\n }else{\n $this->load->Model('user_roles/Mdl_roles');\n return $this->Mdl_roles->getRolesName();\n }\n }",
"public function getRoleName()\n {\n $roles = Yii::$app->authManager->getRolesByUser($this->id);\n if (!$roles) {\n return null;\n }\n\n reset($roles);\n /* @var $role \\yii\\rbac\\Role */\n $role = current($roles);\n\n return $role->name;\n }",
"public function getRole()\n {\n return $this->getName();\n }",
"public function reverseTransform($roleName): ?Role\n {\n $role = null;\n\n if ($roleName !== null) {\n $role = $this->resource->findOne((string)$roleName, false);\n\n if ($role === null) {\n throw new TransformationFailedException(sprintf(\n 'Role with name \"%s\" does not exist!',\n (string)$roleName\n ));\n }\n }\n\n return $role;\n }",
"function findMember($name,$id){\n\t\tif($name == null || strlen($name) == 0 || !$this->isValidStr($name)){\n\t\t\tthrow new Exception (\"Please enter a valid name.\");\n\t\t}elseif ($id == null || (!is_numeric($id))){\n\t\t\tthrow new Exception (\"Please enter a valid id.\");\n\t\t}else{\n\t\t\t//Find the member\n\t\t\t$members = $this->urlms->getLab_index(0)->getStaffMembers();\n\t\t\t$staffMember=null;\n\t\t\tfor ($i = 0; $i < sizeof($members); $i++){\n\t\t\t\tif($name == $members{$i}->getName() && $id == $members{$i}->getID()){\n\t\t\t\t\t$staffMember = $members{$i};\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($staffMember == null){\n\t\t\t\tthrow new Exception (\"Staff Member not found.\");\n\t\t\t}\n\t\t}\n\t\treturn $staffMember;\n\t}",
"public function getRoleID(string $role):string;",
"public function getRole(string $roleName): RoleInterface\n {\n if (! isset($this->roles[$roleName])) {\n throw new Exception\\InvalidArgumentException(sprintf(\n 'No role with name \"%s\" could be found',\n $roleName\n ));\n }\n return $this->roles[$roleName];\n }",
"function addRole( $name ) {\n $d = loadDB();\n \n $found = false;\n $highestID = 0;\n foreach ($d['roles'] as $role) {\n if ($name == $role['name']) {\n $found = true;\n }\n if ($role['id'] > $highestID)\n $highestID = $role['id'];\n }\n $highestID++;\n if (!$found) {\n array_push( $d['roles'], array( \"name\" => $name, \"id\" => $highestID, \"permissions\" => array() ) );\n saveDB( $d );\n } else {\n $highestID = -1; // indicate error\n }\n audit( \"addRole\", $name );\n return $highestID;\n }",
"public function getRoleById($id) {\r\n $sql = $this->db->query(\"SELECT * FROM ms_role WHERE roleid = '$id'\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->row_array();\r\n }\r\n return null;\r\n }",
"private function getUserRoleFromName($roleName)\n {\n $role = $this->roleFactory->create();\n $role = $role->getCollection()->addFieldToFilter('role_name', $roleName)->getFirstItem();\n\n return $role->getId();\n }",
"public function findRoles() {\n\t\t\n\t}",
"public function get_role()\n {\n }",
"public function getPermissionRoleByRoleID($id);",
"public function getROLE()\n {\n return $this->hasOne(Role::className(), ['id' => 'ROLE']);\n }",
"public function roleNameC(): string\n {\n $roles = $this->getRoleNames()->all();\n foreach ([\"Admin\", \"Volunteer\", \"Donor\"] as $item) {\n if (in_array($item, $roles)) {\n return $item;\n }\n }\n return \"No Role\";\n }",
"private function /*bool*/ findUsername(/*string*/ $name) {\n\t\t$variations = array(\n\t\t\t$name,\n\t\t\tstrtolower($name[0]) . substr($name, 1),\n\t\t\tstr_replace(\" \", \"_\", $name),\n\t\t);\n\n\t\t$crowd = $this->getCrowd();\n\t\tforeach ($variations as $v) {\n\t\t\ttry {\n\t\t\t\t$crowd->findPrincipalByName(array(\"in0\" => $this->token, \"in1\" => $v));\n\t\t\t\treturn $v;\n\t\t\t} catch (Exception $e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"protected function _getRole(){\n\t$user = new Pas_User_Details();\n $person = $user->getPerson();\n if($person){\n \treturn $person->role;\n } else {\n \treturn false;\n }\n }",
"function &getFromRoleName() {\n\t\t$roleDao =& DAORegistry::getDAO('RoleDAO');\n\t\treturn $roleDao->getRoleName($this->getFromRoleId());\n\t}",
"public function getRole() {\n\n return session('role');\n\n }",
"function getRole($index){\r\n //as we won't be using classes yet this is our (messy) work-around\r\n $ROLES = array('Student' => STUDENT,\r\n 'Lector' => LECTURER,\r\n 'Studieadviseur' => ADVISOR,\r\n 'Administrator' => ADMIN);\r\n foreach($ROLES as $role => $roleIndex){\r\n if($index == $roleIndex){\r\n return $role;\r\n }\r\n }\r\n}",
"public function role()\n {\n return $this->hasOne('Role', 'id', 'role_id');\n }",
"public function getRole()\n {\n return $this->hasOne(Role::className(), ['id' => 'role_id']);\n }",
"public function show($id)\n {\n return Role::findOrFail($id);\n }",
"public function getRole($role)\n {\n if ($this->getAcl()->hasRole($role)) {\n return $this->getRoleManager()->get($role);\n }\n if (!$this->getRoleManager()->has($role)) {\n throw new RoleNotFound($role . ' could not be found in ' . RoleManager::class);\n }\n $roleObject = $this->getRoleManager()->get($role);\n $roleParents = array_map([$this, 'getRole'], $this->getRoleRelationshipManager()->getRoleParents($roleObject));\n $this->getAcl()->addRole($roleObject, $roleParents);\n $this->loadRules(\n [$roleObject],\n array_merge(\n [null],\n array_map([$this->getAcl(), 'getResource'], $this->getAcl()->getResources())\n )\n );\n return $roleObject;\n }",
"public function findByRole($role)\n {\n $qb = $this->_em->createQueryBuilder();\n $qb->select('u')\n ->from($this->_entityName, 'u')\n ->where('u.roles LIKE :roles')\n ->setParameter('roles', '%\"'.$role.'\"%');\n\n return $qb->getQuery()->getResult();\n }",
"public function getDetail($id)\n {\n $role = $this->roles->find($id);\n return $role;\n }",
"public function hasRole($roleName) {\n $role = Role::where('name','=',$roleName)->first();\n return (strtoupper($this->role->id) >= strtoupper($role->id));\n }",
"function find_route_by_name(string $name, string $module): ?array\n{\n foreach (Router::getRoutes() as $route) {\n if (isset($route['name']) &&\n strtolower($route['name']) == strtolower($name) &&\n strtolower($route['module']) == strtolower($module)) {\n \n return $route;\n }\n }\n\n return null;\n}",
"public function getRoleName()\n\t{\n\t\treturn $this->_roleName;\n\t}",
"protected function getRoleId($role)\n {\n if (!$role) {\n throw new Exception('No role provided.');\n }\n\n if (is_string($role) && !($role = Role::whereSlug($role)->first())) {\n throw new Exception('Invalid role slug.');\n }\n\n if ($role instanceof Model) {\n $role = $role->getKey();\n }\n\n if (!is_numeric($role)) {\n throw new Exception('Invalid role id.');\n }\n\n return $role;\n }",
"public function getSingleRole() {\n return $this->roles[0];\n }",
"public function getRoleName()\r\n {\r\n return $this->roleName;\r\n }",
"public function getRoleId()\n {\n if (array_key_exists(\"roleId\", $this->_propDict)) {\n return $this->_propDict[\"roleId\"];\n } else {\n return null;\n }\n }",
"public function getRoleName()\n {\n $item = $this->belongsTo(Role::class, 'role_id', 'id');\n return $item->first()->name;\n }",
"public function show (Role $role)\n {\n\n }",
"public function setRoleName($roleName)\n {\n }",
"public function getName()\n {\n return $this->get('roleName');\n }",
"public function getRoleName()\n {\n return $this->getRoles()->one()->name;\n }",
"public static function find(String $name) {\n\t\treturn false;\n\t}",
"function getRoleId($roleString) {\n $statement = 'SELECT id FROM role_lov where role = (?)';\n $query = $this->prepare($statement);\n $query->execute([$roleString]);\n return $query->fetch()['id'];\n }"
] | [
"0.8013064",
"0.7789813",
"0.76431966",
"0.7416432",
"0.7131292",
"0.6848656",
"0.6805318",
"0.6605281",
"0.6544543",
"0.65205956",
"0.6470921",
"0.64456826",
"0.6426703",
"0.6389912",
"0.6365247",
"0.6271024",
"0.62156564",
"0.61606365",
"0.61543024",
"0.6148565",
"0.6117672",
"0.6117672",
"0.6110985",
"0.6044222",
"0.6030265",
"0.60176086",
"0.60170275",
"0.60073924",
"0.60073924",
"0.5949294",
"0.5935583",
"0.5935184",
"0.5933299",
"0.5922839",
"0.5920625",
"0.5920625",
"0.5920625",
"0.5903255",
"0.58856",
"0.58644843",
"0.58558977",
"0.58335555",
"0.57804996",
"0.576795",
"0.57504535",
"0.5748522",
"0.5739024",
"0.57328737",
"0.57312286",
"0.56945467",
"0.5684931",
"0.5642755",
"0.56350094",
"0.5631479",
"0.5616064",
"0.56128806",
"0.5591603",
"0.5580773",
"0.55572784",
"0.5551709",
"0.5542999",
"0.5536502",
"0.5516029",
"0.5493712",
"0.54853547",
"0.5484192",
"0.5480406",
"0.5479108",
"0.54690325",
"0.546124",
"0.5460435",
"0.5444978",
"0.54432255",
"0.54269326",
"0.54208875",
"0.5411618",
"0.5403845",
"0.5403002",
"0.5396904",
"0.53951824",
"0.5388905",
"0.53875184",
"0.5385257",
"0.53641903",
"0.5355191",
"0.5339568",
"0.53339",
"0.533079",
"0.53226244",
"0.5322539",
"0.5311123",
"0.53097814",
"0.5309528",
"0.52969444",
"0.5296862",
"0.5296271",
"0.52911866",
"0.52835524",
"0.5283132",
"0.52827144"
] | 0.7671544 | 2 |
Determine if the user may perform the given permission. | public function hasPermissionTo($permission)
{
if (is_string($permission)) {
$permission = app(Permission::class)->findByName($permission);
}
return $this->permissions->contains('id', $permission->id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }",
"public function can($permission);",
"public function isGranted($userOrId, $permission);",
"public function permissions()\n\t{\n\t\t// add any additional custom permission checking here and \n\t\t// return FALSE if user doesn't have permission\n\t\n\t\treturn TRUE;\n\t}",
"public function hasAccess($permission);",
"public function canManagePermissions()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( static::$permApp !== NULL and static::$permType !== NULL and static::restrictionCheck( 'permissions' ) );\n\t}",
"public function checkPolicy($permission) {\n $access = true;\n\n /* first check moderator access */\n if ($this->get('moderated')) {\n $moderatorGroups = $this->trimArray($this->get('moderator_group'));\n $moderators = $this->trimArray($this->get('moderators'));\n $inModeratorGroup = !empty($moderatorGroups) && !empty($this->xpdo->user) ? $this->xpdo->user->isMember($moderatorGroups) : false;\n $access = $inModeratorGroup || in_array($this->xpdo->user->get('username'),$moderators);\n } else {\n $access = $this->xpdo->user->isMember('Administrator');\n }\n\n /* now check global access */\n switch ($permission) {\n case 'view':\n $access = $this->xpdo->hasPermission('quip.thread_view');\n break;\n case 'truncate':\n $access = $this->xpdo->hasPermission('quip.thread_truncate');\n break;\n case 'remove':\n $access = $this->xpdo->hasPermission('quip.thread_remove');\n break;\n case 'comment_approve':\n $access = $this->xpdo->hasPermission('quip.comment_approve');\n break;\n case 'comment_remove':\n $access = $this->xpdo->hasPermission('quip.comment_approve');\n break;\n case 'comment_update':\n $access = $this->xpdo->hasPermission('quip.comment_approve');\n break;\n }\n\n return $access;\n }",
"protected function isPermissionCorrect() {}",
"public function isPermitted(string $permission, callable $callback = null, ...$callbackArguments): bool;",
"protected function check_permission()\n {\n return true;\n }",
"public static function uses_permissions(): bool;",
"public function can($permission, $requireAll = false);",
"private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }",
"public function isPermissible()\n {\n return !$this->invisible && (\n [] === $this->permissions || Wa::panel()->isAccessible(\n $this->module, $this->panel, $this->permissions));\n }",
"function auth_can($perm)\n {\n if (auth_isAnonymous()) {\n return false;\n }\n\n $sess = auth_get();\n\n if (!is_array($sess->permissions)) {\n return false;\n }\n\n if (count($sess->permissions) == 0 || in_array($perm, $sess->permissions)) {\n return true;\n }\n\n return false;\n }",
"public function HasPermission()\n\t\t{\n\t\t\tstatic $perms = null;\n\t\t\tif ($perms === null) {\n\t\t\t\t$perms = $GLOBALS[\"ISC_CLASS_ADMIN_AUTH\"]->GetPermissions();\n\t\t\t}\n\n\t\t\tif (in_array(AUTH_Edit_Customers, $perms)\n\t\t\t\t&& in_array(AUTH_Edit_Orders, $perms)\n\t\t\t\t&& in_array(AUTH_Newsletter_Subscribers, $perms)) {\n\t\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function isAlwaysGranted(): bool;",
"function can($permission, $accessType) {\n\n $userPermissions = app('request')->user()->getAllPermissionsFormAllRoles();\n if ($userPermissions->get($permission) != $accessType && $userPermissions->get($permission) != \"full_access\") {\n return false;\n }\n\n return true;\n }",
"public function hasPermission($action = \"\");",
"function check_has_permissions() {\n $details = $this->get_user_details('1');\n\t\treturn 0 != strcmp(strtoupper($details['StatusInfo']), '\"ACCESS DENIED\"');\n\t}",
"function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}",
"public function has_permission($permission) {\n\t\t\n\t}",
"public function checkPermissions();",
"function is_user_granted_permission($permission, $user_id = NULL) {\n\t$user_permissions_clause = format_sql_in_clause ( $permission );\n\t\n\tif (strlen ( $user_id ) == 0 && is_site_public_access ()) {\n\t\t$query = \"SELECT 'X' \n\t\t\tFROM \ts_role_permission\n\t\t\tWHERE \trole_name = '\" . get_public_access_rolename () . \"' AND\n\t\t\t\t \tpermission_name IN ($user_permissions_clause)\";\n\t} else {\n\t\tif (strlen ( $user_id ) == 0)\n\t\t\t$user_id = get_opendb_session_var ( 'user_id' );\n\t\t\n\t\t$query = \"SELECT 'X' \n\t\t\tFROM \ts_role_permission srp, \n\t\t\t\t \tuser u \n\t\t\tWHERE \tu.user_role = srp.role_name AND\n\t\t\t\t \tsrp.permission_name IN ($user_permissions_clause) AND\n\t\t\t\t \tu.user_id = '$user_id'\";\n\t}\n\t\n\t$result = db_query ( $query );\n\tif ($result && db_num_rows ( $result ) > 0) {\n\t\tdb_free_result ( $result );\n\t\treturn TRUE;\n\t}\n\t\n\t//else\n\treturn FALSE;\n}",
"function hasPermission($perm)\n {\n switch ($perm) {\n case Horde_Perms::EDIT: return false;\n case Horde_Perms::DELETE: return false;\n default: return true;\n }\n }",
"public function can($permissions);",
"public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }",
"public function get_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function permissionInUse(string $permission): bool;",
"public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"protected function user_authorized()\n\t{\n\t\t// If the user has the super role, then allow access\n\t\t$super_role = Kohana::config('acl.super_role');\n\t\tif ($super_role AND in_array($super_role, $this->user->roles_list()))\n\t\t\treturn TRUE;\n\t\t// If the user is in the user list, then allow access\n\t\tif (in_array($this->user->id, $this->rule['users']))\n\t\t\treturn TRUE;\n\t\t\t\n\t\t// If the user has all (AND) the capabilities, then allow access\n\t\t$difference = array_diff($this->rule['capabilities'], $this->user->capabilities_list());\n\t\tif ( ! empty($this->rule['capabilities']) AND empty($difference))\n\t\t\treturn TRUE;\n\n\t\t// If there were no capabilities allowed, check the roles\n\t\tif (empty($this->rule['capabilities']))\n\t\t{\n\t\t\t// If the user has one (OR) the roles, then allow access\n\t\t\t$intersection = array_intersect($this->rule['roles'], $this->user->roles_list());\n\t\t\tif ( ! empty($intersection))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"public function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}",
"function can($permission, $form){\n\n $this->CI->load->model('permission');\n $this->CI->load->model('form');\n if(!is_object($form)){\n $res = $this->CI->form->getByName($form);\n $formname = $res[0]->name;\n if($res[0]->creator == $this->username()) return true;\n }else{\n $formname = $form->name;\n if($form->creator == $this->username()) return true; \n }\n\n //first check granular permissions on a form\n $res = $this->CI->permission->hasPermissionOnUserAndForm($permission, $this->username(), $formname);\n if($res) return $res;\n \n //see if we have a role with the perm\n $this->CI->load->model('role');\n $roles = $this->CI->role->getOnFormAndUser($formname, $this->username());\n foreach($roles as $r){\n if($this->CI->permission->hasPermissionOnRole($permission, $r->id)) return true;\n }\n\n //see if person has one of the global roles\n $supereditor = $this->is('supereditor');\n if($supereditor && $this->CI->permission->hasPermissionOnRole($permission, $supereditor->id)) return true;\n else if($this->is('superadmin')){ //superadmin can do ALL\n return true;\n }\n return false;\n }",
"public function canDo($permission, $force = false);",
"public function hasPermission(int $permission, int $permissions): bool;",
"public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }",
"function can_do($privilege)\n {\n return $this->storage->can_do($privilege);\n }",
"private function hasPermission()\n { $user = User::getLoggedInUser();\n $has_permission = false;\n if ($user->getCurrentRoleName() == \"instructor\") {\n $instructor = $user->getCurrentRoleData();\n if ($instructor->hasPermission(\"Edit Compliance Status\")) {\n $has_permission = true;\n }\n }\n\n return $has_permission;\n }",
"public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }",
"public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }",
"public function isAllowed(IPresenter $presenter): bool\n {\n // use user acl\n if (isset($this->permissionResource) && isset($this->permissionPrivilege)) {\n /* @noinspection PhpUndefinedMethodInspection */\n return $presenter->getUser()->isAllowed($this->permissionResource, $this->permissionPrivilege);\n }\n return true;\n }",
"public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }",
"public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"private function isAllowed() {\n $allowed = array(\n \"rss\" => array(\"feed\"),\n \"torrent\" => array(\"download\"),\n \"user\" => array(\"login\", \"register\", \"confirm\", \"recover\", \"invite\")\n );\n if (!isset($allowed[$this->data['url']['application']]))\n return false;\n if (in_array($this->data['url']['action'], $allowed[$this->data['url']['application']]))\n return true;\n else\n return false;\n }",
"public function canGrantAnyPermissions(...$permission)\n {\n }",
"function checkPermissions() {\n\t\t$current_user = wp_get_current_user();\n\t\tif(current_user_can('manage-lepress') || is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function userCan($permission)\n {\n // search own permission\n $strpos = strpos($permission,\"-own\");\n // if find check permission for user (not admin)\n if ($strpos !== false) {\n $parsPermission = str_replace(\"-own\",\"\",$permission);\n if (!$this->hasRole('user') && $this->can($permission) && !$this->can($parsPermission)) {\n return true;\n }\n return false;\n }\n return $this->can($permission);\n }",
"public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }",
"function is_user_allowed($user, $permission){\n\n \tif($permission == PERMISSION_LOGIN){\n \t\tif($user->is_surveyor == TRUE\n \t\t\t\t&& $user->is_supervisor == FALSE\n \t\t\t\t&& $user->is_manager == FALSE\n \t\t\t\t&& $user->is_general_manager == FALSE\n \t\t\t\t&& $user->is_admin == FALSE){\n \t\t\treturn FALSE;\n \t\t}\n \t}else if($permission == PERMISSION_ADD_SURVEYOR\n \t\t\t|| $permission == PERMISSION_EDIT_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DELETE_SURVEYOR\n \t\t\t|| $permission == PERMISSION_DETAIL_SURVEYOR){\n \t\treturn $user->is_admin;\n \t}\n\n \treturn TRUE;\n }",
"private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}",
"public function can($permission, $requireAll = false)\n {\n return $this->hasPermission($permission, $requireAll);\n }",
"public function hasPermission($name)\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->hasPermission($name) : false;\r\n }",
"public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }",
"protected function check(string $permission): bool\n {\n return Gate::allows($permission);\n }",
"public function isAllowed(): bool\n {\n foreach ($this->rights as $rights) {\n [$module, $action] = explode('/', $rights);\n\n // check action rights\n if ($module !== '' && $action !== '' && !BackendAuthentication::isAllowedAction($action, $module)) {\n return false;\n }\n }\n\n return true;\n }",
"public function isPermitted($action)\r\n {\r\n // users Roles\r\n $Roles = $this->User->RoleCollection->getPropertyList('name');\r\n $Roles[] = 'everyone';\r\n\r\n // if user is owner\r\n if ($this->isOwner()) {\r\n $Roles[] = 'owner';\r\n }\r\n\r\n // superadmin can do anything\r\n if (in_array('superadmin', $Roles)) {\r\n return true;\r\n }\r\n\r\n // only roles user is in can perform an action with those roles set\r\n $AllowedGroups = $this->Permissions->getPermitted($action);\r\n if ($permitted = (bool) count(array_intersect($Roles, $AllowedGroups))) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }",
"function um_user_can( $permission ) {\r\n\t\t\tif ( ! is_user_logged_in() )\r\n\t\t\t\treturn false;\r\n\r\n\t\t\t$user_id = get_current_user_id();\r\n\t\t\t$role = UM()->roles()->get_priority_user_role( $user_id );\r\n\t\t\t$permissions = $this->role_data( $role );\r\n\r\n\t\t\t/**\r\n\t\t\t * UM hook\r\n\t\t\t *\r\n\t\t\t * @type filter\r\n\t\t\t * @title um_user_permissions_filter\r\n\t\t\t * @description Change User Permissions\r\n\t\t\t * @input_vars\r\n\t\t\t * [{\"var\":\"$permissions\",\"type\":\"array\",\"desc\":\"User Permissions\"},\r\n\t\t\t * {\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t * @change_log\r\n\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t * @usage\r\n\t\t\t * <?php add_filter( 'um_user_permissions_filter', 'function_name', 10, 2 ); ?>\r\n\t\t\t * @example\r\n\t\t\t * <?php\r\n\t\t\t * add_filter( 'um_user_permissions_filter', 'my_user_permissions', 10, 2 );\r\n\t\t\t * function my_user_permissions( $permissions, $user_id ) {\r\n\t\t\t * // your code here\r\n\t\t\t * return $permissions;\r\n\t\t\t * }\r\n\t\t\t * ?>\r\n\t\t\t */\r\n\t\t\t$permissions = apply_filters( 'um_user_permissions_filter', $permissions, $user_id );\r\n\r\n\t\t\tif ( isset( $permissions[ $permission ] ) && is_serialized( $permissions[ $permission ] ) )\r\n\t\t\t\treturn unserialize( $permissions[ $permission ] );\r\n\r\n\t\t\tif ( isset( $permissions[ $permission ] ) && $permissions[ $permission ] == 1 )\r\n\t\t\t\treturn true;\r\n\r\n\t\t\treturn false;\r\n\t\t}",
"public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}",
"function isAllowed($user, $resource = IAuthorizator::ALL, $privilege = IAuthorizator::ALL, $id);",
"function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Match Server Attribute?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Match Server Attribute?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Match Server Attribute?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n // View all existing Match Server Attributes?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Match Server Attribute?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n $this->set('permissions', $p);\n return $p[$this->action];\n }",
"public static function can($what)\n\t{\n\t\treturn (devMode() || isset(self::accesslist()[$what]));\n\t}",
"public function hasUsageRights() {}",
"public function authorize()\n {\n return auth()->user()->can('role@create') || auth()->user()->can('role@edit');\n }",
"abstract protected function canAccess();",
"protected function _isAllowed()\n {\n return $this->_getAclHelper()->isActionAllowed($this->_aclSection);\n }",
"public function current_role_can(string $action): bool;",
"function hasPermission($uriPermission){\n\tif(Auth::check() && Auth::user()->hasAnyPermission($uriPermission))\n return true;\n else\n return false;\n}",
"public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-referral', 'manage-referral'], true);\n }",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\treturn $this->user()->can('create', WorkFunction::class) && $this->user()->can('update', $this->workplace);\n\t}",
"public function hasPermissionTo($permission){\n\n return $this->hasDirectPermission($permission) || $this->hasPermissionViaRole($permission);\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }",
"protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }",
"function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public function hasPermissions()\n {\n return $this->roles()->count() > 1;\n }",
"public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }",
"public function havePermission($permission){\n $roles_user = $this->roles;\n\n //recorro cada rol y lo comparo\n foreach ($roles_user as $role) {\n //si tiene full acceso a los permisos regreso true\n if ($role['full-access'] == 'Si') {\n return true;\n }\n //recorro los permisos correspondientes al rol\n foreach ($role->permissions as $permission_user) {\n //verifico si tiene entre sus permisos el permiso a verificar en la function\n //si lo tiene regreso true\n if ($permission_user->slug == $permission) {\n return true;\n }\n }\n }\n //sino tiene ningun permiso regreso false\n return false;\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = 0)\n {\n global $ilUser, $ilAccess;\n\n if ($a_user_id == 0) {\n $a_user_id = $ilUser->getId();\n }\n\n switch ($a_permission) {\n case \"read\":\n /*if (!ilObjUFreibFeedbackAccess::checkOnline($a_obj_id) &&\n !$ilAccess->checkAccessOfUser($a_user_id, \"write\", \"\", $a_ref_id))\n {\n return false;\n }*/\n break;\n }\n\n return true;\n }",
"public function hasPermission($id);",
"public function hasPermission($id);",
"public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function authorize()\n {\n // all who has permission\n return true;\n }",
"function hook_permission_check($data) {\n\t\treturn false;\n\t}",
"public function HasAnyManagePrivilege()\n\t{\n\t\t$q = \"SELECT 1 FROM `GrantedPrivileges` WHERE (MemberID={$this->ID}\";\n\n\t\t$callings = $this->Callings();\n\t\tforeach ($callings as $calling)\n\t\t\t$q .= \" OR `CallingID`={$calling->ID()}\";\n\t\t$q .= \") AND `PrivilegeID` BETWEEN 7 AND 13\";\n\t\t\n\t\t$r = DB::Run($q);\n\t\treturn mysql_num_rows($r) > 0;\n\t}",
"public function authorize()\n {\n abort_if(Gate::denies('permission_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n return true;\n }",
"public function authorize()\n {\n if(session('contact_key'))\n return true;\n\n if (! $this->user()->hasFeature(FEATURE_DOCUMENTS))\n return false;\n\n \n if ($this->invoice && $this->user()->cannot('edit', $this->invoice))\n return false;\n\n\n if ($this->expense && $this->user()->cannot('edit', $this->expense))\n return false;\n\n\n if($this->ticket && $this->user()->cannot('edit', $this->ticket))\n return false;\n\n\n return true;\n //return $this->user()->can('create');\n }",
"public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function IsAllowed ($permissionNameOrNames, $allPermissionsRequired = TRUE);",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"function is_granted($type) {\n\t\tif(!isset($this->user->rank)) return false;\n\t\treturn $this->user->rank >= $this->get('right', $type);\n\t}",
"public function hasPermission($name) {\n return $this->getGuardUser() ? $this->getGuardUser()->hasPermission($name) : false;\n }",
"public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }"
] | [
"0.76699024",
"0.76590455",
"0.76184106",
"0.74865174",
"0.73728347",
"0.7318341",
"0.72653204",
"0.7252939",
"0.72481745",
"0.72332704",
"0.7206348",
"0.715905",
"0.71333474",
"0.70453876",
"0.69550747",
"0.69475",
"0.6939063",
"0.6936571",
"0.6918756",
"0.69005674",
"0.6897431",
"0.6882647",
"0.68816674",
"0.6881295",
"0.6869426",
"0.6866589",
"0.68607056",
"0.6860047",
"0.6836821",
"0.6828894",
"0.6804549",
"0.6803037",
"0.67899746",
"0.6785589",
"0.677304",
"0.67599857",
"0.6756117",
"0.6753476",
"0.6747662",
"0.673927",
"0.67358655",
"0.67345506",
"0.6729152",
"0.67282194",
"0.6723016",
"0.67221826",
"0.66969866",
"0.6696449",
"0.6689982",
"0.66844004",
"0.6682715",
"0.66814756",
"0.66779506",
"0.6676472",
"0.6659922",
"0.6655907",
"0.6648957",
"0.6647478",
"0.6647055",
"0.6635276",
"0.66237193",
"0.6620597",
"0.66126657",
"0.66092867",
"0.6606428",
"0.6598431",
"0.65911543",
"0.65908074",
"0.6590146",
"0.65836453",
"0.6577595",
"0.65772957",
"0.65772957",
"0.65772957",
"0.6576763",
"0.65746665",
"0.65725356",
"0.6569143",
"0.6566231",
"0.6564732",
"0.6564651",
"0.65602297",
"0.65527695",
"0.6544971",
"0.6544971",
"0.6543423",
"0.6537962",
"0.6536948",
"0.65359735",
"0.65294474",
"0.6528395",
"0.65272635",
"0.65258",
"0.65163577",
"0.65163577",
"0.651626",
"0.6515497",
"0.6515497",
"0.6512409",
"0.6511564",
"0.65065557"
] | 0.0 | -1 |
Get all parent roles. | public function getParentRoles()
{
$parents = collect([]);
$parent = $this->parent;
while (!is_null($parent)) {
$parents->push($parent);
$parent = $parent->parent;
}
return $parents;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllRolesWithParentRoles() {\n return RoleHelper::getUserParentRoles($this);\n }",
"public function parentPermissions()\n {\n $parentPermissions = collect([]);\n\n $parent = $this->parentrole;\n\n while (!is_null($parent)) {\n if ($parent->permissions->count()) {\n $parentPermissions->push($parent->permissions);\n }\n $parent = $parent->parentrole;\n }\n\n return $parentPermissions;\n }",
"public function getRoles()\n {\n return $this->acl->getRoleAndParents($this->getRole());\n }",
"public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }",
"public function children()\n {\n return $this->hasMany(config('rbac.models.role'),'parent_id');\n }",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"protected function parentRole()\n {\n return !empty($this->parentRole) ? $this->parentRole : $this->parent->recordRole();\n }",
"public function getAll()\n {\n try{\n return $this->roles;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"private function get_all_roles(){\n return Role::all();\n }",
"public function parentRole()\n {\n if ($this->parent_id == null) {\n return null;\n }\n return $this->hasOne(Config::get('guardian.role'), 'id', 'parent_id');\n }",
"public function getParents()\n {\n return Menu::where('locale', getCurrentSessionAppLocale())\n ->where(function ($query){\n $query->whereNull('parent_slug')\n ->orWhere('parent_slug', '');\n })\n ->orderBy('menu_order', 'asc')\n ->get();\n }",
"public function getRoles()\n {\n return $this->getRelation('roles');\n }",
"public function getAllRoles()\n {\n return $this->repository->getAllRoles();\n }",
"public function getRoles() {\n return $this->getRelation(\"roles\");\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function roles()\n {\n\n return Role::all();\n }",
"public function getRoles()\n {\n $roles = $this->getExplicitRoles();\n\n if (!$roles) {\n return null;\n }\n\n $finalRoles = array();\n foreach ($roles as $role) {\n $childRoles = $role->getChildRoles();\n\n foreach ($childRoles as $childRole) {\n if (!in_array($childRole, $finalRoles)) {\n $finalRoles[] = $childRole;\n }\n }\n\n if (!in_array($role, $finalRoles)) {\n $finalRoles[] = $role;\n }\n }\n\n return $finalRoles;\n }",
"public function all()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('r')\n ->from(Role::class, 'r');\n\n return $qb->getQuery()->getResult();\n }",
"public function getRoles(): iterable\n {\n return [];\n }",
"public function getChildren($role)\n {\n $children = array();\n $model = Pi::model('acl_inherit');\n $rowset = $model->select(array('parent' => $role));\n\n foreach ($rowset as $row) {\n $children[] = $row->child;\n $sub = $this->getChildren($row->child);\n $children = array_unique(array_merge($children, $sub));\n }\n\n return $children;\n }",
"public function getParents()\n\t{\n\t\tif ($this->get('parents'))\n\t\t{\n\t\t\treturn $this->get('parents');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->setParents();\n\t\t}\n\t}",
"public function getDirectRoles() {\n return $this->roles;\n }",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function getParents()\n {\n return $this->parents;\n }",
"public function getMenuParents()\n {\n return $this->db->select('*')->from('admin_menu')->where('parent',0)->get()->result_array();\n }",
"public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }",
"public function get_roles()\n {\n $users_roles = user_role_active_record::search()->where('uid', $this->uid)->exec();\n $roles = array();\n foreach ($users_roles as $users_role) {\n $roles[] = role_active_record::search()->where('rid', $users_role->rid)->execOne();\n }\n return $roles;\n }",
"public function getAllParents()\n {\n $parents = array();\n\n $parent = $this;\n\n while ($parent = $parent->getParent()) {\n $parents[] = $parent;\n }\n\n return $parents;\n }",
"public function all()\n {\n $roles = collect($this->table()->where('user_id', $this->user->id())->get());\n\n if ($roles->isEmpty()) {\n return collect();\n }\n\n return $roles; // todo: groups\n }",
"public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\n {\n return $this->roles;\n }",
"public function getRoles()\r\n {\r\n return $this->roles;\r\n }",
"public function parentrole()\n {\n return $this->belongsTo(self::class, 'parent_id');\n }",
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"public function getRoleTree()\n {\n $roleTree = Security::getRoleTree();\n\n $simplifyRoleTree = function (&$level) use (&$simplifyRoleTree) {\n foreach ($level as &$role) {\n $role['role'] = $role['role']->getId();\n if (!empty($role['children'])) {\n $simplifyRoleTree($role['children']);\n }\n }\n };\n\n $simplifyRoleTree($roleTree);\n\n return $roleTree;\n }",
"public function getRoles() \n {\n return $this->roles;\n }",
"public function roles()\n {\n return $this->belongsToMany(Role::class, null, \"context_ids\", \"role_ids\");\n }",
"function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}",
"public function all_parent()\r\n\t{\r\n\t\t$query = $this->db->select('*')->get('menu')->result_array(); \r\n\t \treturn $query;\r\n\t}",
"public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }",
"public function getRoles()\n {\n // get roles of own Publisher, note: WITHOUT role 'ROLE_PUBLISHER'\n $roles = $this->publisher->getRoles();\n\n if (($key = array_search('ROLE_PUBLISHER', $roles)) !== false) {\n unset($roles[$key]);\n }\n\n // merge all roles of this and own Publisher\n $roles = array_merge($this->roles, $roles);\n\n foreach ($this->getGroups() as $group) {\n $roles = array_merge($roles, $group->getRoles());\n }\n\n // we need to make sure to have at least one role\n $roles[] = static::ROLE_DEFAULT;\n\n return array_unique($roles);\n }",
"protected function getRoles() {\n return $this->roleStorage->loadMultiple();\n }",
"private function getRoles()\n\t{\n\t\tif (!isset($this->roles)) {\n\t\t\t$this->roles = $this->roles()\n\t\t\t\t->with('permissions')\n\t\t\t\t->withCount('users')\n\t\t\t\t->get();\n\t\t}\n\t\treturn $this->roles;\n\t}",
"public function getAncestors($role)\n {\n $parents = array();\n $model = Pi::model('acl_inherit');\n $rowset = $model->select(array('child' => $role));\n\n foreach ($rowset as $row) {\n $parents[] = $row->parent;\n $sub = $this->getAncestors($row->parent);\n $parents = array_unique(array_merge($parents, $sub));\n }\n\n return $parents;\n }",
"function getRoleSelectTree()\n {\n //find all roles below users current role\n $roles = $this->all();\n if (\\Config::get('user')->isAdmin())\n {\n return [[\n 'name' => $this->name,\n 'value' => $this->id,\n 'children' => $this->findChildren($roles, $this->id, 1)\n ]];\n\n }\n\n return $this->findChildren($roles, $this->id, 1);\n\n\n }",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"public function getParents() {}",
"public static function getAllParentRoles($userRole, $system)\n\t{\n\t\t// Filling $allParentsWithChildren\n\t\tif(empty(self::$allParentsWithChildren))\n\t\t{\n\t\t\t// Getting all role-manage permission for the current user\n\t\t\t$parents = PermissionModel::where('permission' , 'like' , 'role-manage.%');\n\n\t\t\t// if system flag then get all roles in the estate plus the roles with site_id = null\n\t\t\tif($system)\n\t\t\t{\n\t\t\t\t$rolesInEstate = self::getRolesInEstate(true);\n\t\t\t\t$parents = $parents->whereIn('role_id', array_keys($rolesInEstate));\n\t\t\t}\n\n\t\t\t$parents = $parents->get()->toArray();\n\n\t\t\t// Will store all Parents and their role-manage roles\n\t\t\tforeach ($parents as $parent)\n\t\t\t{\n\t\t\t\tself::$allParentsWithChildren[$parent['role_id']][] = substr($parent['permission'], 12);\n\t\t\t}\n\t\t}\n\n\t\tself::getParentRoles($userRole, $system);\n\t\treturn self::$parentRoles;\n\t}",
"public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }",
"public function getAllRoles(): array;",
"public function getInheritedRoles(array $roles): array;",
"public function getRoles()\n {\n return $this->userRoles->toArray();\n /*$roles = array();\n foreach ($this->userRoles as $role) {\n $roles[] = $role->getRole();\n }\n\n return $roles;*/\n }",
"public function getRoles()\n\t{\n\t\treturn $this->roles->toArray();\n\t}",
"public function getRoles()\n {\n return $this->hasMany(AuthRole::className(), ['id' => 'role_id'])->viaTable('auth_user_role', ['user_id' => 'id']);\n }",
"public function getCurrentRoles()\n {\n $userRoles = $this->getUserRoles();\n\n $roles = [];\n foreach ($userRoles as $userRole) {\n $roles[] = $userRole->getRole();\n }\n\n return $roles;\n }",
"public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }",
"public function getRoles()\n {\n return $this->roles->toArray();\n }",
"public function getRoles()\n {\n return $this->roles->toArray();\n }",
"public function getRoles() {\n return \\array_filter(Role::getMap(), [ $this, 'hasRole' ], \\ARRAY_FILTER_USE_KEY);\n }",
"public function getRoles()\n {\n return $this->getMemberRoles()->toArray();\n }",
"public function getParents()\n {\n return $this->Parents_->filter(function ($persona) {\n return $persona->approved;\n })->pluckNamed('Parent');\n }",
"public static function getRoles()\n {\n return self::$roles;\n }",
"public function cl_roles()\n {\n return $this->hasMany(ClRole::class);\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n }",
"public function getRoles()\n {\n $roles = array();\n \n foreach ($this->roles as $role) {\n $roles = array_merge($roles, $role->getRecursiveNames());\n }\n \n return array_unique($roles);\n }",
"public static function parentCategories()\n {\n return Category::with('children')\n ->orderBy('priority')\n ->where([\n 'category_type' => static::class,\n 'parent_id' => null,\n ])->get();\n }",
"public static function getAll()\n {\n return Role::with(['permissions'])->get();\n }",
"public function getChildRoleIDs()\n\t{\n\t\t$returnValue = array();\n\n\t\tif (class_exists('Default_Model_Role', TRUE)) {\n\t\t\ttry {\n\t\t\t\t$roleCollection = Doctrine_Query::create()\n\t\t\t\t\t->from('Default_Model_Role m')\n\t\t\t\t\t->where('m.role_id = ? ', array($this->_roleId))\n\t\t\t\t\t->execute()\n\t\t\t\t;\n\t\t\t\tforeach ($roleCollection as $roleModel) {\n\t\t\t\t\t$returnValue = $this->_retrieveChildRoleId($roleModel->id);\n\t\t\t\t}\n\t\t\t\t$returnValue = array_unique($returnValue);\n\n\t\t\t\t/**\n\t\t\t\t * cause of non ending trees we have to add guestID, if not yet in here\n\t\t\t\t */\n\t\t\t\t$roleGuestModel = Doctrine_Query::create()\n\t\t\t\t\t->from('Default_Model_Role m')\n\t\t\t\t\t->where('m.short = ? ', array('guest'))\n\t\t\t\t\t->limit(1)\n\t\t\t\t\t->execute()\n\t\t\t\t\t->getFirst()\n\t\t\t\t;\n\t\t\t\tif ($roleGuestModel) {\n\t\t\t\t\tif (!in_array($roleGuestModel->id, $returnValue) &&\n\t\t\t\t\t\t$this->_roleId != $roleGuestModel->id) {\n\n\t\t\t\t\t\t$returnValue[] = $roleGuestModel->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (Doctrine_Connection_Exception $exception) {\n\t\t\t\t/**\n\t\t\t\t * @todo maybe do something\n\t\t\t\t */\n\t\t\t}\n\t\t}\n\n\t\treturn $returnValue;\n\t}",
"public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }",
"public function roles()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Util\\ClassMapper $classMapper */\n $classMapper = static::$ci->classMapper;\n\n return $this->belongsToMany($classMapper->getClassMapping('role'), 'permission_roles', 'permission_id', 'role_id')->withTimestamps();\n }",
"public function getRoles(): array\n {\n return $this->roles;\n }",
"public function getRoles(): array\n {\n return $this->roles;\n }",
"public function get_parents(){\n\t\treturn $this->master->parent_list_construct();\n\t}",
"public function getRoles()\n {\n return [$this->role];\n }",
"public function getRoles()\n {\n return [$this->role];\n }",
"function get_all_menu_selected_by_parent($params) {\n $sql = \"SELECT a.*, b.role_id, b.role_tp\n FROM com_menu a\n LEFT JOIN (SELECT * FROM com_role_menu WHERE role_id = ?) b ON a.nav_id = b.nav_id\n WHERE portal_id = ? AND parent_id = ?\n ORDER BY nav_no ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->result_array();\n $query->free_result();\n return $result;\n } else {\n return array();\n }\n }",
"public function getRoles()\n {\n\n $rolesReturn = [];\n $roles = $this->roles()->with(['role'])->get();\n\n $rolesReturn = $roles->pluck('role.name');\n\n // Add Standard role to the user roles\n\n if($rolesReturn->contains(config('user.standardRole')) === false)\n {\n $rolesReturn->push(config('user.standardRole'));\n }\n\n return $rolesReturn;\n\n }",
"function getRoles()\n {\n $roles = array();\n\n foreach ($this->grupos as $grupo) {\n $roles[] = $grupo->getRole();\n }\n return $roles;\n }",
"public function getParents()\r\n\t{\r\n\t\treturn $this->parentNodes;\r\n\t}",
"public function roles()\n {\n return $this->hasManyThrough(Permission::class);\n }",
"public function getRoles(): array\n\t{\n\t\treturn $this->roles;\n\t}",
"public function getCurrentUserRoles()\n {\n $this->load([\n 'roles' => function($query) {\n $query->active()\n ->whereNull('expires_at')\n ->orWhere('expires_at', '>', Carbon::now());\n },\n ]);\n\n return $this->roles;\n }",
"public function getRoles()\n {\n $roles = $this->roles;\n\n return array_unique($roles);\n }",
"public function getParents();",
"abstract protected function getRoles();",
"public function findAll()\n {\n $sql = \"SELECT * FROM parent\";\n $res = $this->getDb()->fetchAll($sql);\n\n $parents = array();\n foreach($res as $row)\n {\n $id_parent = $row['id_parent'];\n $parents[$id_parent] = $this->buildDomainObject($row);\n }\n\n return $parents;\n }",
"public function roles()\n {\n return $this->belongsToMany(config('rpac.models.role'))->withTimestamps();\n }",
"public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }",
"public function getRoles()\n {\n if (!isset($this->roles)) {\n return new \\TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage();\n } else {\n return $this->roles;\n }\n }",
"public function getRoles()\n {\n return array($this->role);\n }",
"public function parent()\n {\n if ($this->parent_id == null) {\n return null;\n }\n return $this->hasOne(Config::get('guardian.role'), 'id', 'parent_id');\n }"
] | [
"0.8765492",
"0.74436235",
"0.7337989",
"0.72473437",
"0.7016529",
"0.68748724",
"0.67876744",
"0.6731614",
"0.6718011",
"0.6700322",
"0.6654085",
"0.6645281",
"0.65859544",
"0.6573733",
"0.65629727",
"0.6554917",
"0.6536156",
"0.6528295",
"0.6515692",
"0.65018666",
"0.6501254",
"0.6467297",
"0.64321804",
"0.6419158",
"0.63911664",
"0.63813287",
"0.6375184",
"0.6370076",
"0.6367716",
"0.6366935",
"0.63493276",
"0.63108295",
"0.63092655",
"0.63092655",
"0.63092655",
"0.63092655",
"0.63092655",
"0.63092655",
"0.6305781",
"0.63024753",
"0.6298756",
"0.6292589",
"0.6275605",
"0.6271559",
"0.6254393",
"0.6250142",
"0.62385607",
"0.62300736",
"0.6226405",
"0.6224032",
"0.61966914",
"0.6194559",
"0.61878854",
"0.6182341",
"0.61752814",
"0.61646813",
"0.6158332",
"0.6138191",
"0.61300534",
"0.6127575",
"0.6116265",
"0.6116018",
"0.6114613",
"0.6105149",
"0.6105149",
"0.610491",
"0.61008567",
"0.60933757",
"0.6093229",
"0.60829777",
"0.6074348",
"0.6074348",
"0.6074348",
"0.60728836",
"0.6072794",
"0.60653996",
"0.60591567",
"0.6058487",
"0.6052762",
"0.60496813",
"0.60496813",
"0.60445786",
"0.6017136",
"0.6017136",
"0.60125554",
"0.6007108",
"0.60063636",
"0.6002379",
"0.5999795",
"0.59863096",
"0.5985149",
"0.59848344",
"0.59801555",
"0.5979258",
"0.5974025",
"0.5971535",
"0.5970193",
"0.5969197",
"0.5963957",
"0.5963484"
] | 0.8359708 | 1 |
Get permissions from all parent roles. | public function parentPermissions()
{
$parentPermissions = collect([]);
$parent = $this->parentrole;
while (!is_null($parent)) {
if ($parent->permissions->count()) {
$parentPermissions->push($parent->permissions);
}
$parent = $parent->parentrole;
}
return $parentPermissions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllRolesWithParentRoles() {\n return RoleHelper::getUserParentRoles($this);\n }",
"public function getPermissionsViaRole()\n {\n return $this->roles->map(function (Role $role) {\n return $role->getAllPermissions();\n })->flatten();\n }",
"protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }",
"public function getAllPermissions()\n {\n $roles = $this->getAllRoles();\n $permissions = $roles ? call_user_func_array('array_merge', array_map(function(RoleInterface $role) {\n return $role->getAllPermissions();\n }, $roles)) : [];\n\n return (new Collection($permissions))->combine('slug', function($permission) {\n return $permission;\n })\n ->toArray();\n }",
"public function getRolePermissions()\n {\n return self::select(\"r.*, p.*\")\n ->leftJoin('role_permissions rp', 'r.roleID = rp.roleID')\n ->leftJoin('permissions p', 'p.permissionID = rp.permissionID')\n ->get();\n }",
"public static function getAll()\n {\n return Role::with(['permissions'])->get();\n }",
"public function allPermissions(): Collection\n {\n return $this->permissions->merge($this->rolePermissions());\n }",
"public function roles()\n {\n return $this->hasManyThrough(Permission::class);\n }",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function getPermissions(Roleable $resource = null);",
"public function getParentRoles()\n {\n $parents = collect([]);\n\n $parent = $this->parent;\n\n while (!is_null($parent)) {\n $parents->push($parent);\n $parent = $parent->parent;\n }\n\n return $parents;\n }",
"public function allPermissions(): Collection\n {\n if ($this->allPermissions) {\n return $this->allPermissions;\n }\n\n return $this->allPermissions =\n $this->roles\n ->pluck('permissions')\n ->flatten()\n ->keyBy($this->getKeyName());\n }",
"public function permissions()\n {\n return $this->embedsMany(\n config('laravel-permission.table_names.role_has_permissions')\n );\n }",
"public function getAllPermissionsAttribute()\n {\n // Check for inherited permissions and merge them in\n if($this->has_parent){\n return $this->permissions->merge(\n $this->parent->all_permissions\n );\n }\n\n return $this->permissions;\n }",
"public function rolePermissions(): Collection\n {\n return $this->roles?->loadMissing('permissions')->pluck('permissions')->flatten() ?? collect();\n }",
"protected function getPermissions()\n {\n if (!$this->tablePermissionsExists()) {\n return [];\n }\n return Permission::with('roles')->get();\n }",
"function getPermissions() {\n // For eficientcy, we will just store the names, not the objects\n if ( is_null($this->allPermissions) ) {\n $tmpRole = FactoryObject::newObject(\"_Permission\");\n $this->allPermissions = $tmpRole ->getAllPermissionByIdRole($this->getId());\n } \n\n return $this->allPermissions;\n }",
"private function getUserRolePermissions()\n {\n return [];\n }",
"public function roles()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Util\\ClassMapper $classMapper */\n $classMapper = static::$ci->classMapper;\n\n return $this->belongsToMany($classMapper->getClassMapping('role'), 'permission_roles', 'permission_id', 'role_id')->withTimestamps();\n }",
"public function getRoles()\n {\n return $this->acl->getRoleAndParents($this->getRole());\n }",
"public function permissions()\n\t{\n\t\treturn $this->manyShiftsToMany('Permission');\n\t}",
"public function getAllPermissions()\n {\n return $this->repository->getAllPermissions();\n }",
"public function getAllPermissions();",
"public function getAllPermissions();",
"private function get_all_roles(){\n return Role::all();\n }",
"public function children()\n {\n return $this->hasMany(config('rbac.models.role'),'parent_id');\n }",
"public function getPermissions()\n {\n\n $roles = Role::where(function($query){\n\n $query->whereIn('id',$this->roles()->pluck('role_id'));\n\n })->with('permissions')->get();\n\n\n $permissions = $roles->map(function($role){\n\n $permissionData = $role->permissions->pluck('permission');\n\n if(sizeOf($permissionData) > 0)\n {\n return $permissionData[0];\n }\n\n })->filter(function($item){\n if($item !== null)\n {\n return $item;\n }\n });\n\n if ($permissions->count() <= 1)\n {\n return $permissions;\n }\n\n return $permissions->unique();\n\n }",
"public function getRolePermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $role_name = $this->argument('needle');\n\n $role = $this->permission->findBy('role_name', $role_name);\n if ($role) {\n $permissions = json_to_array($role->permission);\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n\n foreach ($permission as $ability=>$perm) {\n $vals = [$module, $ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No role found!\");\n }\n }",
"public function permissions()\n {\n return $this->belongsToManyThrough(\n EloquentTestPermission::class,\n EloquentTestRole::class,\n 'role_users',\n 'user_id',\n 'role_id',\n 'permission_roles',\n 'role_id',\n 'permission_id'\n );\n }",
"public static function getAllPermissions()\n\t{\n\t\treturn Permission::all();\n\t}",
"public function permissions()\n {\n return $this->belongsToMany(\n config('admin.permission.models.permission'),\n config('admin.permission.table_names.role_has_permissions')\n );\n }",
"public function getPermissions()\n\t{\n\t\tif(!$this->id)\n\t\t\treturn array();\n $role= UserRole::model()->getUserRole($this);\n if(!$role->role_id){\n return array();\n }\n\t\t$permissions = array();\n\t\t$sql = \"SELECT pa.ACTION_ID AS id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_ROLE.\"' and pm.principal_id = {$role->role_id}\";\n\t\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t\t$permissions[$permission['id']] = $permission['key'];\n\t\t\n\n\n\t\t// Direct user permission assignments\n\t\t$sql = \"select pa.ACTION_ID as id, pa.key from \". PermissionMap::model()->tableName().\" pm left join \". PermissionAction::model()->tableName().\" pa on pa.ACTION_ID = pm.permission_id where pm.type = '\".PermissionMap::TYPE_USER.\"' and pm.principal_id = {$this->id}\";\n\t\tforeach (Yii::app()->db->cache(500)->createCommand($sql)->query()->readAll() as $permission)\n\t\t\t$permissions[$permission['id']] = $permission['key'];\n\n\n\t\treturn $permissions;\n\t}",
"public function getChildren($role)\n {\n $children = array();\n $model = Pi::model('acl_inherit');\n $rowset = $model->select(array('parent' => $role));\n\n foreach ($rowset as $row) {\n $children[] = $row->child;\n $sub = $this->getChildren($row->child);\n $children = array_unique(array_merge($children, $sub));\n }\n\n return $children;\n }",
"public function perms() {\n return $this->belongsToMany(config('entrust.permission'), config('entrust.permission_role_table'), 'role_id', 'permission_id');\n }",
"public function permissions()\n {\n return $this->belongsToMany('bedoke\\LaravelRolePerms\\Models\\Permission', 'role_permissions')\n ->withPivot('id')\n ->withTimestamps();\n }",
"public function getAll()\n {\n try{\n return $this->roles;\n }\n catch (\\Exception $exception)\n {\n return null;\n }\n }",
"public function getAllPermissions()\r\n {\r\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissions() : array();\r\n }",
"public function getAllPermissions() {\n return $this->getGuardUser() ? $this->getGuardUser()->getAllPermissions() : array();\n }",
"public function roles()\n {\n $pivotTable = config('permission.database.permission_roles_table');\n\n $relatedModel = config('permission.database.roles_model');\n\n return $this->belongsToMany($relatedModel, $pivotTable, 'permission_id', 'role_id')->withTimestamps();\n }",
"public function roles() {\n $roleClass = config('cani.models.role');\n $rolePropertieInPermission = config('cani.collections.role_permissions_propertie');\n \n return $this->belongsToMany(\n $roleClass, null, $rolePropertieInPermission . '._id'\n );\n }",
"public function getAllPermissionsForRole(string $role): array;",
"public function get_all_roles()\n {\n return App\\Role::all();\n }",
"public function perms()\n {\n return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id');\n }",
"public function permissions()\n {\n return $this->belongsToMany(EloquentTestPermission::class, 'permission_roles', 'role_id', 'permission_id');\n }",
"public function permissions(): BelongsToMany\n {\n return $this->belongsToMany(\n Permission::class,\n 'role_permissions',\n 'role_id',\n 'permission_id'\n );\n }",
"public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }",
"public function permissions()\n {\n return $this->belongsToMany('Bican\\Roles\\Permission');\n }",
"public function permissions()\n {\n return $this->belongsToMany(\n config('laravel-authorisation.models.permission'),\n config('laravel-authorisation.table_names.role_has_permissions')\n );\n }",
"public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}",
"public function perms()\n {\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function perms()\n {\n return $this->belongsToMany(Config::get('entrust-branch.permission'), Config::get('entrust-branch.permission_role_table'));\n }",
"public function all() : Collection\n {\n return Permission::all();\n }",
"private function getRoles()\n\t{\n\t\tif (!isset($this->roles)) {\n\t\t\t$this->roles = $this->roles()\n\t\t\t\t->with('permissions')\n\t\t\t\t->withCount('users')\n\t\t\t\t->get();\n\t\t}\n\t\treturn $this->roles;\n\t}",
"public static function getAllPermissions()\n {\n return Cache::rememberForever('permissions.all', function() {\n return self::all();\n });\n }",
"public function roles()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.role'), config('bootstrap-menu.relations.permission_role'))->withTimestamps();\r\n }",
"public function getRoles()\n {\n #obsolete, I don't wnat user roles, I want the permission those roles are linked to\n # so I just need a getPermissions once, store those constants in a small session array\n #$roles = $this->roles;\n\n #d($roles);\n\n #foreach ($roles as $role) {\n # echo $role->name;\n #}\n }",
"public function permissions()\n {\n \t// belongsTo(RelatedModel, foreignKey = _id, keyOnRelatedModel = id)\n \treturn $this->belongsToMany('App\\Permission','permission_role','role_id','permission_id')->withTimestamps();\n }",
"public function permissions()\n {\n return $this->permissionModel->findAll();\n }",
"public function getAllPermission()\n {\n $query = $this->createQuery('permission');\n $query->innerJoin('permission.UserGroup');\n $query->innerJoin('permission.Resource');\n $query->orderBy('granted Desc');\n\n return $query;\n }",
"public function all()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('r')\n ->from(Role::class, 'r');\n\n return $qb->getQuery()->getResult();\n }",
"public function getDirectRoles() {\n return $this->roles;\n }",
"public function getAllRoles()\n {\n return $this->roles;\n }",
"public static function getAllParentRoles($userRole, $system)\n\t{\n\t\t// Filling $allParentsWithChildren\n\t\tif(empty(self::$allParentsWithChildren))\n\t\t{\n\t\t\t// Getting all role-manage permission for the current user\n\t\t\t$parents = PermissionModel::where('permission' , 'like' , 'role-manage.%');\n\n\t\t\t// if system flag then get all roles in the estate plus the roles with site_id = null\n\t\t\tif($system)\n\t\t\t{\n\t\t\t\t$rolesInEstate = self::getRolesInEstate(true);\n\t\t\t\t$parents = $parents->whereIn('role_id', array_keys($rolesInEstate));\n\t\t\t}\n\n\t\t\t$parents = $parents->get()->toArray();\n\n\t\t\t// Will store all Parents and their role-manage roles\n\t\t\tforeach ($parents as $parent)\n\t\t\t{\n\t\t\t\tself::$allParentsWithChildren[$parent['role_id']][] = substr($parent['permission'], 12);\n\t\t\t}\n\t\t}\n\n\t\tself::getParentRoles($userRole, $system);\n\t\treturn self::$parentRoles;\n\t}",
"public function permissions()\n {\n\n return Permission::all();\n }",
"public function permissions()\n {\n return $this->belongsToMany(\n Permission::class,\n null,\n \"context_ids\",\n \"permission_ids\"\n );\n }",
"public function getRoles()\n {\n $roles = $this->getExplicitRoles();\n\n if (!$roles) {\n return null;\n }\n\n $finalRoles = array();\n foreach ($roles as $role) {\n $childRoles = $role->getChildRoles();\n\n foreach ($childRoles as $childRole) {\n if (!in_array($childRole, $finalRoles)) {\n $finalRoles[] = $childRole;\n }\n }\n\n if (!in_array($role, $finalRoles)) {\n $finalRoles[] = $role;\n }\n }\n\n return $finalRoles;\n }",
"public function fetchAll()\n\t{\n\t\t$permissions = $this->getRoleModel()->fetchAll();\n\t\treturn $permissions;\n\t}",
"public function getRoles()\n {\n if (!in_array(Permissions::ROLE_EVERYONE, $this->roles)) {\n $this->roles[] = Permissions::ROLE_EVERYONE;\n }\n\n return $this->roles;\n }",
"public function getAllPermissions(): array;",
"public function getInheritedRoles(array $roles): array;",
"public function roles()\n {\n return $this->belongsToMany(EloquentTestRole::class, 'permission_roles', 'permission_id', 'role_id');\n }",
"public function getRoles()\n {\n // get roles of own Publisher, note: WITHOUT role 'ROLE_PUBLISHER'\n $roles = $this->publisher->getRoles();\n\n if (($key = array_search('ROLE_PUBLISHER', $roles)) !== false) {\n unset($roles[$key]);\n }\n\n // merge all roles of this and own Publisher\n $roles = array_merge($this->roles, $roles);\n\n foreach ($this->getGroups() as $group) {\n $roles = array_merge($roles, $group->getRoles());\n }\n\n // we need to make sure to have at least one role\n $roles[] = static::ROLE_DEFAULT;\n\n return array_unique($roles);\n }",
"static public function get_all_roles() {\n\t\tif ( ! function_exists( 'get_editable_roles' ) ) {\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/user.php' );\n\t\t}\n\n\t\t$editable_roles = get_editable_roles();\n\t\t$roles = array();\n\t\t$caps = apply_filters( 'fl_builder_user_access_capabilities', array( 'edit_posts' ) );\n\n\t\tforeach ( $editable_roles as $role => $data ) {\n\t\t\tforeach ( $caps as $cap ) {\n\t\t\t\tif ( isset( $data['capabilities'][ $cap ] ) && 1 == $data['capabilities'][ $cap ] ) {\n\t\t\t\t\t$roles[ $role ] = $data['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $roles;\n\t}",
"public function permissions(): BelongsToMany\n {\n return $this->belongsToMany(\n HCAclPermission::class,\n 'hc_acl_role_permission_connection',\n 'role_id',\n 'permission_id'\n );\n }",
"abstract public function getPermissions();",
"public function getPermissionAndRoleList()\n {\n $user = $this->user;\n\n if (!$user) {\n throw new RoleAndPriviledgeServiceException(\"The user is not defined\");\n }\n $permissions = $user->directPermissions;\n\n $user->loadMissing(\"roles\", \"roles.permissions\");\n\n $roles = $user->roles;\n\n // $roles = $user->roles()->with(\"permissions\")->get();\n\n $roles->each(function ($role) use (&$permissions) {\n $permissions = $permissions->merge($role->permissions);\n });\n\n $rv = [\n array_unique($permissions->pluck(\"name\")->all()),\n array_unique($roles->pluck(\"name\")->all())\n ];\n\n return $rv;\n }",
"public function permissions()\n {\n return $this->belongsToMany(config('rbac.models.permission'))->withTimestamps()->withPivot('granted');\n }",
"function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }",
"public function children(): HasMany\n {\n return $this->hasMany(Permission::class);\n }",
"public function permissions() {\n return $this->belongsToMany(Permission::class);\n }",
"public function getAllPermissionsForRole($role)\n {\n return $this->repository->getAllPermissionsForRole($role);\n }",
"public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }",
"public function all()\n {\n $roles = collect($this->table()->where('user_id', $this->user->id())->get());\n\n if ($roles->isEmpty()) {\n return collect();\n }\n\n return $roles; // todo: groups\n }",
"public function roles()\n {\n\n return Role::all();\n }",
"private function getRolesPermissions()\n {\n return [\n [\n 'name' => 'Roles - List all roles',\n 'description' => 'Allow to list all roles.',\n 'slug' => RolesPolicy::PERMISSION_LIST,\n ],\n [\n 'name' => 'Roles - View a role',\n 'description' => 'Allow to view the role\\'s details.',\n 'slug' => RolesPolicy::PERMISSION_SHOW,\n ],\n [\n 'name' => 'Roles - Add/Create a role',\n 'description' => 'Allow to create a new role.',\n 'slug' => RolesPolicy::PERMISSION_CREATE,\n ],\n [\n 'name' => 'Roles - Edit/Update a role',\n 'description' => 'Allow to update a role.',\n 'slug' => RolesPolicy::PERMISSION_UPDATE,\n ],\n [\n 'name' => 'Roles - Delete a role',\n 'description' => 'Allow to delete a role.',\n 'slug' => RolesPolicy::PERMISSION_DELETE,\n ],\n ];\n }",
"public function roles(): BelongsToMany\n {\n return $this->belongsToMany(\n config('acl.models.role'),\n config('acl.table_names.role_has_permissions')\n );\n }",
"protected static function getPermissions(): Collection\n {\n return app(PermissionRegistrar::class)->getPermissions();\n }",
"protected static function getPermissions(): Collection\n {\n return app(PermissionRegistrar::class)->getPermissions();\n }",
"public function roles(): BelongsToMany\n {\n $role = $this->aclRoleModelInstance();\n\n return $this->belongsToMany(\n $this->aclRoleModel(),\n $this->aclTable('roles_permissions'),\n $this->getForeignKey(),\n $role->getForeignKey()\n );\n }",
"public function cachedPermissions()\n {\n $rolePrimaryKey = $this->primaryKey;\n $cacheKey = 'guardian_permissions_for_role_' . $this->$rolePrimaryKey;\n if (Cache::getStore() instanceof TaggableStore) {\n return Cache::tags(Config::get('guardian.permission_role_table'))->remember($cacheKey, Config::get('cache.ttl', 60), function () {\n return $this->perms()->get();\n });\n } else {\n return $this->perms()->get();\n }\n }",
"public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }",
"public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }",
"public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }",
"public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }",
"public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }",
"public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }",
"public function roles()\n {\n return $this->belongsToMany(\n config('laravel-permission.models.role'),\n config('laravel-permission.table_names.user_has_roles')\n )->withTimestamps();\n }",
"public function permissions(){ return new manytomany_link($this, 'permission', 'rolepermissions');\n }",
"public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }",
"public function getAll()\n {\n $permissionArray = [];\n foreach ($this->permissions as $permission => $status) {\n if ($status) {\n $permissionArray[] = $permission;\n }\n }\n return $permissionArray;\n }"
] | [
"0.725679",
"0.70296824",
"0.699677",
"0.68958336",
"0.6870528",
"0.6829015",
"0.66528183",
"0.6624707",
"0.6621569",
"0.66188425",
"0.6608916",
"0.65669155",
"0.6542632",
"0.6509425",
"0.6507237",
"0.6491133",
"0.6443972",
"0.6328512",
"0.62803066",
"0.6271014",
"0.62388605",
"0.6229176",
"0.6224069",
"0.6224069",
"0.6204945",
"0.6196641",
"0.61853963",
"0.6165575",
"0.613569",
"0.6129622",
"0.61027884",
"0.60671544",
"0.6062424",
"0.6038371",
"0.60378605",
"0.6027734",
"0.60056275",
"0.60026646",
"0.5985963",
"0.59842396",
"0.59830797",
"0.5982742",
"0.5972257",
"0.59691125",
"0.59482485",
"0.5928321",
"0.5926141",
"0.59071946",
"0.58936757",
"0.5881753",
"0.5877088",
"0.58753765",
"0.58662075",
"0.5860171",
"0.5857761",
"0.5852013",
"0.5842703",
"0.5840645",
"0.5839132",
"0.5819142",
"0.58163345",
"0.5815661",
"0.57991433",
"0.5793202",
"0.5792207",
"0.57908386",
"0.5760518",
"0.5760033",
"0.57508945",
"0.5745054",
"0.5724506",
"0.5715344",
"0.57144296",
"0.5707736",
"0.570485",
"0.570281",
"0.56996363",
"0.5692887",
"0.5690108",
"0.5686072",
"0.5680501",
"0.5678864",
"0.56781363",
"0.56771857",
"0.5661419",
"0.565983",
"0.56565976",
"0.56565976",
"0.56516033",
"0.5636393",
"0.56313634",
"0.56313634",
"0.56313634",
"0.56313634",
"0.56313634",
"0.56313634",
"0.5630534",
"0.56243557",
"0.5623797",
"0.56225926"
] | 0.77577955 | 0 |
Determine if the user may perform the given permission for any parent role. | public function parentsHavePermissionTo($permission)
{
if (is_string($permission)) {
$permission = app(Permission::class)->findByName($permission);
}
$parent = $this->parent;
while (!is_null($parent)) {
if ($parent->permissions->contains('id', $permission->id)) {
return true;
}
$parent = $parent->parent;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }",
"public function current_role_can(string $action): bool;",
"public function hasPermissions()\n {\n return $this->roles()->count() > 1;\n }",
"public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return auth()->user()->can('role@create') || auth()->user()->can('role@edit');\n }",
"public function authorize() {\n\t\treturn $this->user()->hasPermission('edit.roles');\n\t}",
"public function checkACL()\n {\n return parent::checkACL() || \\XLite\\Core\\Auth::getInstance()->isPermissionAllowed('manage orders');\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }",
"public function authorize()\n {\n return auth()->user()->can('updatePermissions', [Role::class, request('role')]);\n }",
"public function authorize()\n {\n if (Auth::user()->can('update-assignment')) return true;\n if (Auth::user()->hasRole('student'))\n if ($this->owns('assignment')) return true;\n return false;\n }",
"public function authorize()\n {\n return Auth::check() && Auth::user()->hasAnyRol([\n 'contractor-superadmin',\n 'contractor-manager',\n 'contractor-worker',\n 'contractor-admin',\n ]);\n }",
"function can($permission, $form){\n\n $this->CI->load->model('permission');\n $this->CI->load->model('form');\n if(!is_object($form)){\n $res = $this->CI->form->getByName($form);\n $formname = $res[0]->name;\n if($res[0]->creator == $this->username()) return true;\n }else{\n $formname = $form->name;\n if($form->creator == $this->username()) return true; \n }\n\n //first check granular permissions on a form\n $res = $this->CI->permission->hasPermissionOnUserAndForm($permission, $this->username(), $formname);\n if($res) return $res;\n \n //see if we have a role with the perm\n $this->CI->load->model('role');\n $roles = $this->CI->role->getOnFormAndUser($formname, $this->username());\n foreach($roles as $r){\n if($this->CI->permission->hasPermissionOnRole($permission, $r->id)) return true;\n }\n\n //see if person has one of the global roles\n $supereditor = $this->is('supereditor');\n if($supereditor && $this->CI->permission->hasPermissionOnRole($permission, $supereditor->id)) return true;\n else if($this->is('superadmin')){ //superadmin can do ALL\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public static function currentUserisParent()\n {\n return (check_user_role('parent')) ? true : false;\n }",
"public function isGranted($userOrId, $permission);",
"public function permissions()\n\t{\n\t\t// add any additional custom permission checking here and \n\t\t// return FALSE if user doesn't have permission\n\t\n\t\treturn TRUE;\n\t}",
"private function hasPermission()\n { $user = User::getLoggedInUser();\n $has_permission = false;\n if ($user->getCurrentRoleName() == \"instructor\") {\n $instructor = $user->getCurrentRoleData();\n if ($instructor->hasPermission(\"Edit Compliance Status\")) {\n $has_permission = true;\n }\n }\n\n return $has_permission;\n }",
"public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }",
"public function hasRoleAccess()\n {\n $roles = $this->map[$this->uri]['roles'];\n\n if ($roles === self::ROLE_PUBLIC) {\n\n return true;\n }\n\n $this->isArray($roles);\n\n $this->collectMissingRoles($roles);\n\n return count(array_intersect($this->currentUserRoles, $roles)) > 0;\n }",
"public function authorize()\n {\n return $this->user()->hasRole(['admin', 'superadmin']);\n }",
"public function canDo($permission, $require = false){\n if(is_array($permission)){\n foreach ($permission as $permName){\n $permName = $this->canDo($permName); // recursion\n if($permName && !$require){\n return true;\n } elseif (!$permName && $require){\n return false;\n }\n }\n return $require;\n } else {\n foreach($this->roles()->get() as $role){\n foreach ($role->permissions()->get() as $perm){\n if(str_is($permission, $perm->name)){\n return true;\n }\n }\n }\n }\n }",
"public function canApply(): bool\n {\n if (is_null($this->subject)) {\n return false;\n }\n $parent = $this->getParentNode();\n $nodeType = $this->subject->getNodeType();\n\n return $parent && $this->isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }",
"public function canApply()\n {\n $parent = $this->getSiblingNode()->findParentNode();\n $nodeType = $this->getSubject()->getNodeType();\n\n return NodeInfoHelper::isNodeTypeAllowedAsChildNode($parent, $nodeType);\n }",
"public function authorize()\n\t{\n if (!$this->auth->check())\n return false;\n if (!$this->auth->user()->can('manage_roles'))\n return false;\n\n return true;\n\t}",
"public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }",
"public function canManagePermissions()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn ( static::$permApp !== NULL and static::$permType !== NULL and static::restrictionCheck( 'permissions' ) );\n\t}",
"function isAuthorized($type = null, $object = null, $user = null)\n {\n $valid = parent::isAuthorized($type, $object, $user);\n \n if(!$valid && $type == 'actions' && $this->user($this->parentModel))\n {\n // get the groups from the Session, and set the proper Aro path\n $otherRoles = $this->user($this->parentModel);\n $valid = $this->Acl->check(array($this->parentModel => array('id' => $otherRoles)), $this->action()); \n\t\t} \n return $valid;\n }",
"public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }",
"public function authorize()\n {\n return auth()->user()->hasRole('superadmin|admin');\n }",
"protected function _hasModPermission(){\n global $auth;\n return $auth->acl_get('m_inttree');\n }",
"public function authorize()\n {\n $name = $this->relatedResource()->name();\n $model = $this->resource()->getModel();\n $relatedModel = $this->relationship()->getRelated();\n\n return parent::authorize()\n && $this->authorizeIfPolicyExists(\"detach$name\", $model, $relatedModel);\n }",
"public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }",
"public function authorize()\n {\n return Auth::user()->hasAnyRole(['kuchar', 'manager']);\n }",
"protected function user_authorized()\n\t{\n\t\t// If the user has the super role, then allow access\n\t\t$super_role = Kohana::config('acl.super_role');\n\t\tif ($super_role AND in_array($super_role, $this->user->roles_list()))\n\t\t\treturn TRUE;\n\t\t// If the user is in the user list, then allow access\n\t\tif (in_array($this->user->id, $this->rule['users']))\n\t\t\treturn TRUE;\n\t\t\t\n\t\t// If the user has all (AND) the capabilities, then allow access\n\t\t$difference = array_diff($this->rule['capabilities'], $this->user->capabilities_list());\n\t\tif ( ! empty($this->rule['capabilities']) AND empty($difference))\n\t\t\treturn TRUE;\n\n\t\t// If there were no capabilities allowed, check the roles\n\t\tif (empty($this->rule['capabilities']))\n\t\t{\n\t\t\t// If the user has one (OR) the roles, then allow access\n\t\t\t$intersection = array_intersect($this->rule['roles'], $this->user->roles_list());\n\t\t\tif ( ! empty($intersection))\n\t\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}",
"public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }",
"abstract public function isPermittedForUser($parentRow = array(), $removeItems = array());",
"public function hasAccessRestrictions() {\n\t\tif (!is_array($this->accessRoles) || empty($this->accessRoles)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (count($this->accessRoles) === 1 && in_array('TYPO3.Flow:Everybody', $this->accessRoles)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }",
"public function havePermission($permission){\n $roles_user = $this->roles;\n\n //recorro cada rol y lo comparo\n foreach ($roles_user as $role) {\n //si tiene full acceso a los permisos regreso true\n if ($role['full-access'] == 'Si') {\n return true;\n }\n //recorro los permisos correspondientes al rol\n foreach ($role->permissions as $permission_user) {\n //verifico si tiene entre sus permisos el permiso a verificar en la function\n //si lo tiene regreso true\n if ($permission_user->slug == $permission) {\n return true;\n }\n }\n }\n //sino tiene ningun permiso regreso false\n return false;\n }",
"private function canModify()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }",
"public function hasPermissionTo($permission){\n\n return $this->hasDirectPermission($permission) || $this->hasPermissionViaRole($permission);\n }",
"public function authorize()\n {\n // if ($this->hasRole(['admin','superadmin'])) {\n // return true;\n // }\n // else {\n // return false;\n // }\n\n return true;\n }",
"private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }",
"function check_access() {\n foreach ($this->children as $child) {\n if ($child->check_access()) {\n return true;\n }\n }\n return false;\n }",
"public function HasPermission()\n\t\t{\n\t\t\tstatic $perms = null;\n\t\t\tif ($perms === null) {\n\t\t\t\t$perms = $GLOBALS[\"ISC_CLASS_ADMIN_AUTH\"]->GetPermissions();\n\t\t\t}\n\n\t\t\tif (in_array(AUTH_Edit_Customers, $perms)\n\t\t\t\t&& in_array(AUTH_Edit_Orders, $perms)\n\t\t\t\t&& in_array(AUTH_Newsletter_Subscribers, $perms)) {\n\t\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function authorize()\n {\n return $this->user()->hasRole('admin');\n }",
"function isAllowed($role, $resource, $privilege)\n\t{\n\t\tif ($this->mode == self::MODE_OPTIMISTIC) {\n\t\t\t$roles = $this->aclModel->getTableSelection()\n\t\t\t\t->select('role')\n\t\t\t\t->where('namespace', $this->getNamespaceRepository()->getCurrentNamespace())\n\t\t\t\t->where('resource', $resource)\n\t\t\t\t->where('privilege', $privilege)\n\t\t\t\t->fetchPairs('role', 'role');\n\t\t\treturn count($roles) == 0 || array_key_exists($role, $roles);\n\t\t} elseif($this->mode == self::MODE_PESSIMISTIC) {\n\t\t\treturn (bool) $this->aclModel->getTableSelection()\n\t\t\t\t->select('id')\n\t\t\t\t->where('namespace', $this->getNamespaceRepository()->getCurrentNamespace())\n\t\t\t\t->where('role', $role)\n\t\t\t\t->where('resource', $resource)\n\t\t\t\t->where('privilege', $privilege)\n\t\t\t\t->count();\n\t\t}\n\t}",
"function isAuthorized($role_policy) {\n global $SEC_ROLES;\n $user_role = $_SESSION['user']['role'];\n $sub_roles = $SEC_ROLES[$user_role];\n if ($user_role !== $role_policy && !in_array($role_policy, $sub_roles)) {\n return false;\n }\n return true;\n}",
"public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }",
"public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }",
"public function canSetControllableAcl();",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function authorize()\n {\n return $this->user()->can('manage-routes');\n }",
"public function hasRole() {\n return $this->_has(2);\n }",
"public function role_can(Role $Role, string $action): bool;",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function hasPermissionThroughRole($permission)\n {\n foreach ($permission->roles as $role){\n if($this->roles->contains($role)) return true;\n }\n return false;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }",
"private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}",
"function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}",
"public function parentPerms()\n {\n if ($this->parent_id == null) {\n return null;\n }\n\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }",
"public function authorize(): bool\n {\n return $this->user()->can('create', Role::class);\n }",
"public function authorize()\n {\n $contact = $this->route('contact');\n\n return $contact->user_id == auth()->id() || user()->acl < 9;\n }",
"protected function passesAuthorization(): bool\n {\n return $this->hasNestedMenu();\n }",
"public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }",
"function checkPermissions() {\n\t\t$current_user = wp_get_current_user();\n\t\tif(current_user_can('manage-lepress') || is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }",
"public function authorize()\n {\n if (auth()->user()->hasRole(RoleNames::ADMIN)) {\n return true;\n }\n if (auth()->user()->hasRole(RoleNames::FIRM) &&\n auth()->user()->firm_id === $this->device->firm_id) {\n return true;\n }\n if (auth()->user()->hasRole(RoleNames::LOCATION) &&\n auth()->user()->firm_id === $this->device->firm_id &&\n auth()->user()->location_id === $this->device->location_id) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }",
"public function hasAccess($permission);",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"public function can($permission, $requireAll = false);",
"public function authorize()\n\t{\n\t\treturn Auth::user()->hasRole('admin');\n\t}",
"public function authorize()\n\t{\n\t\treturn Auth::user()->hasRole('admin');\n\t}",
"public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }",
"public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }",
"public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }",
"public function initializeForCustomPermissions () {\n// if (($currentUser = $this->modx->getAuthenticatedUser()) && $currentUser->get('sudo')) { return true; }\n\n if ($this->getProperty('checkByRelatedObjects', false)) {\n $checkParents = $this->checkByRelatedObjects();\n if ($checkParents !== true) {\n return $checkParents;\n }\n }\n\n $ownerField = $this->defaultOwnerField;\n if (empty($ownerField) || !$ownerField) {\n $result = $this->checkCommonCustomPermissions();\n } else {\n $result = $this->checkCustomPermissionsByOwner();\n }\n\n return $result;\n }",
"public function can($permission, $requireAll = false)\n {\n if (is_array($permission)) {\n foreach ($permission as $permName) {\n $hasPerm = $this->can($permName);\n\n if ($hasPerm && !$requireAll) {\n return true;\n } elseif (!$hasPerm && $requireAll) {\n return false;\n }\n }\n\n // If we've made it this far and $requireAll is FALSE, then NONE of the perms were found\n // If we've made it this far and $requireAll is TRUE, then ALL of the perms were found.\n // Return the value of $requireAll;\n return $requireAll;\n } else {\n // Validate against the Permission table\n foreach ($this->getActiveRole()->permissions as $perm) {\n if ($perm->name == $permission) {\n return true;\n }\n }\n }\n\n return false;\n }",
"public function can($permission);",
"public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}",
"protected function isPermissionCorrect() {}",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"function check_acl($role = '', $resource, $permission)\n\t{\n\t\tif (!$this->acl->has($resource))\n\t\t{\n\t\t\treturn 1;\n\t\t}\n\t\tif (empty($role)) {\n\t\t\tif (isset($this->CI->session->userdata['role'])) {\n\t\t\t\t$role = $this->CI->session->userdata['role'];\n\t\t\t}\n\t\t}\n\t\tif (empty($role)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->acl->isAllowed($role, $resource, $permission);\n\t}",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}",
"public function authorize()\n {\n return $this->user()->can('create mindoro transaction');\n }",
"public function isPermissible()\n {\n return !$this->invisible && (\n [] === $this->permissions || Wa::panel()->isAccessible(\n $this->module, $this->panel, $this->permissions));\n }",
"public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }",
"public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }",
"protected function hasParentMenuItem() {}",
"function can($permission, $accessType) {\n\n $userPermissions = app('request')->user()->getAllPermissionsFormAllRoles();\n if ($userPermissions->get($permission) != $accessType && $userPermissions->get($permission) != \"full_access\") {\n return false;\n }\n\n return true;\n }"
] | [
"0.6822185",
"0.6741132",
"0.6677624",
"0.6567889",
"0.6550108",
"0.6496332",
"0.6486982",
"0.6404294",
"0.6374595",
"0.63615346",
"0.63265556",
"0.6323175",
"0.6317228",
"0.63136184",
"0.63076556",
"0.6303054",
"0.62989473",
"0.6287384",
"0.6280437",
"0.6237681",
"0.6225082",
"0.6224869",
"0.6213511",
"0.6201749",
"0.6192966",
"0.6192354",
"0.6172272",
"0.61632776",
"0.61628085",
"0.6161465",
"0.6152358",
"0.6129132",
"0.6124917",
"0.6108988",
"0.6103912",
"0.6094982",
"0.60933614",
"0.609285",
"0.6089067",
"0.6086393",
"0.60804963",
"0.6070516",
"0.6068905",
"0.6064013",
"0.6054963",
"0.605223",
"0.6050333",
"0.6035973",
"0.60352373",
"0.60112625",
"0.6005739",
"0.60033315",
"0.5986932",
"0.5986932",
"0.5985003",
"0.59826636",
"0.5963619",
"0.59597933",
"0.595568",
"0.595568",
"0.595568",
"0.595568",
"0.5955087",
"0.5952661",
"0.59454715",
"0.5945251",
"0.5945059",
"0.5942033",
"0.5940268",
"0.5935848",
"0.5929757",
"0.59256756",
"0.5922081",
"0.59164083",
"0.5905893",
"0.59052616",
"0.59046054",
"0.59029406",
"0.59029406",
"0.5897565",
"0.58953416",
"0.58936834",
"0.5891454",
"0.5888546",
"0.58867466",
"0.58865637",
"0.5886179",
"0.5885273",
"0.5873487",
"0.5873487",
"0.5865525",
"0.58645666",
"0.5864223",
"0.58602124",
"0.58601886",
"0.5856486",
"0.58558136",
"0.58558136",
"0.58542156",
"0.5853854"
] | 0.6014497 | 49 |
Set whether or not to allow external connections This is useful for testing to see responses, and stub out services | static function setAllowExternalConnections($b) {
self::$allow_external_connections = $b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function doesAllowExternalConnections() {\n return self::$allow_external_connections;\n }",
"public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}",
"function enableTestMode()\n {\n $this->testMode = TRUE;\n $this->gatewayUrl = 'https://sandbox/url/yet/to/define';\n }",
"function setRequiredExternalAccess( $flag = true )\r\n\t{\r\n\t $this->require_external_access = $flag;\r\n\t}",
"public function allowRequest(): bool\n {\n return true;\n }",
"function __allowRelay($allow)\n {\n $this->__relayAllowed=$allow;\n }",
"public function setIsWebRequest($val)\r\n\t{\r\n\t\tif (!is_bool($val))\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Invalid value');\r\n\t\t}\r\n\t\t$this->isWebRequest = $val;\r\n\t}",
"public function setHttpProxyTunnelUsed($used);",
"function enableclient()\n {\n exec('ifconfig ' . escapeshellarg($this->interface) . ' up');\n exec($this->arfilelocation['iwpriv'] . ' ' . escapeshellarg($this->interface) . ' set SiteSurvey=1');\n }",
"private function setConnectionStat($bool){\n\t\t$this->m_IsConnected = $bool;\n\t}",
"private function setCurlUse(bool $bool){\n\t\t$this->curluse = $bool;\n\t}",
"public function setSecureOnly()\n\t{\n\t\tif ( isset( $this->OAuthSecret ) ) {\n\t\t\t$this->secure = true;\n\t\t}\n\t}",
"public function setUseSSL($use_ssl){\r\n\t\t$this->useSSL = $use_ssl;\r\n\t}",
"public function setAllow($value) {\r\n $this->allow = $value;\r\n }",
"function instance_allow_config() {\n return true;\n }",
"function instance_allow_config() {\n\n return false;\n }",
"function secure_connection() {\n\tif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"protected function use_http_get() {\n return false;\n }",
"public static function setTrustProxy($isTrusted = true) {\n\t self::$trust = $isTrusted ? true : false;\n\t}",
"public function set_is_api_request() {\n\t\t// Constant is not defined until parse_request.\n\t\tif ( ! $this->is_api_request ) {\n\t\t\t$this->is_api_request = defined( 'REST_REQUEST' ) && REST_REQUEST;\n\t\t}\n\t}",
"public function checkConnection(){\r\n\t\treturn false;\r\n\t}",
"public function set_use_ssl($_use_ssl)\n {\n $this->_use_ssl = $_use_ssl;\n }",
"public function allowResponse() {\n return $this->allow_response;\n }",
"public function useRemoteSubscription()\n {\n return false;\n }",
"public function isApiEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/api_connection/active')==0) ? false : true;\n }",
"public function connect(bool $sandbox = false);",
"public function instance_allow_config() {\n return false;\n }",
"function instance_allow_config()\r\n\t\t{\r\n\t\t\r\n\t\t}",
"public function instance_allow_config() {\n return true;\n }",
"public function enableSecureApiUrl()\n\t{\n\t\t$this->api_url = self::API_SECURE_URL;\n\t}",
"public function set_api_is_reachable( $flag ) {\n\t\t$value = (bool) true === $flag ? 'yes' : 'no';\n\t\tupdate_option( 'algolia_api_is_reachable', $value );\n\t}",
"public function setPublic()\n {\n $this->private = false;\n }",
"public function getUseProxy() {\n return $this->useProxy;\n }",
"public function can_perform_loopback()\n {\n }",
"public function setUp(): void\n {\n $this->secureRequest = new TCPRequest('localhost', 896, true);\n $this->insecureRequest = new TCPRequest('localhost', 896, false);\n }",
"public function disableAPI($value = true)\n {\n $this->api_disabled = $value;\n }",
"public function connect() {\n\t\treturn true;\n\t}",
"private function setSSL()\n {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n }",
"public function setAccessControlAllowCredentials(): void\n {\n $this->allowCredentials = \"true\";\n }",
"function setProxy($proxy=true){\n $this->platform->setProxy($proxy);\n }",
"function connect($conn=false) {\n return true;\n }",
"public function connect() : bool\r\n {\r\n if ($this->authenticated() === false)\r\n return false;\r\n\r\n // TODO: check connection with basic api request\r\n\r\n return true;\r\n }",
"private function _setUse($use) {\n if (is_string($use) && strtolower($use) === DolBlsApi::JSON) {\n $this->_useJson = true;\n } else if (is_string($use) && strtolower($use) === DolBlsApi::XML) {\n $this->_useXml = true;\n }\n }",
"public function getRemoteCallEnabled() {\n\t\tif (is_null($this->remoteCallEnabled)) {\n\t\t\t$this->remoteCallEnabled = Mage::getStoreConfigFlag('dev/aoe_templatehints/enablePhpstormRemoteCall');\n\t\t}\n\t\treturn $this->remoteCallEnabled;\n\t}",
"public function developmentMode()\n {\n $this->API_URL = self::DEVELOPMENT_API_URL;\n $this->username = self::DEVELOPMENT_API_USERNAME;\n $this->password = self::DEVELOPMENT_API_PASSWORD;\n }",
"public function connect_to_site() {\n\t\treturn false;\n\t}",
"public function allowToSetOptions($allow){\n $this->allowToSetOptions = (bool)$allow;\n }",
"private function isUsingTrustedProxy() : bool\n\t{\n\t\tif ($this->isRunningInConsole()) { return false; }\n\n\t\t$remoteAddress = $this->getServerParams()['REMOTE_ADDR'];\n\n\t\treturn in_array($remoteAddress, self::$trustedProxies);\n\t}",
"public function setProxy()\n\t{\n\t\t$args = phpSmug::processArgs( func_get_args() );\n\t\t$this->proxy['server'] = $args['server'];\n\t\t$this->proxy['port'] = $args['port'];\n\t\t$this->proxy['username'] = ( isset( $args['username'] ) ) ? $args['username'] : '';\n\t\t$this->proxy['password'] = ( isset( $args['password'] ) ) ? $args['password'] : '';\n\t\t$this->proxy['auth_scheme'] = ( isset( $args['auth_scheme'] ) ) ? $args['auth_scheme'] : 'basic';\n\t\t$this->req->setConfig( array( 'proxy_host' => $this->proxy['server'],\n\t\t\t\t\t\t\t\t\t 'proxy_port' => $this->proxy['port'],\n\t\t\t\t\t\t\t\t\t 'proxy_user' => $this->proxy['username'],\n\t\t\t\t\t\t\t\t\t 'proxy_password' => $this->proxy['password'],\n\t\t\t\t\t\t\t\t\t 'proxy_auth_scheme' => $this->proxy['auth_scheme'] ) );\n }",
"public function isUsingProxy()\n {\n return ((int)$this->use_proxy === 1);\n }",
"public function getSecureTunnelUrl()\n {\n return false;\n }",
"public static function get_allowed_on_network()\n {\n }",
"public function useProxy() {\n $this->_use_proxy = TRUE;\n return $this;\n }",
"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 is_enabled() {\n return $this->proxy_host && $this->proxy_port;\n }",
"function setExternalAccessUserAuthorization( $flag = true )\r\n\t{\r\n\t $this->external_access_user_authorization = $flag;\r\n\t}",
"function shapeSpace_block_proxy_visits() {\n\tif (@fsockopen($_SERVER['REMOTE_ADDR'], 80, $errstr, $errno, 1)) {\n\t\tdie('Proxy access not allowed');\n\t}\n}",
"public function setPrivate()\n {\n $this->private = true;\n }",
"public function external(bool $value = true): self\n {\n $this->external = $value;\n\n return $this;\n }",
"public static function allowServerInfo()\n\t{\n\t\treturn MHTTPD::$config['Admin']['allow_server_info'];\n\t}",
"public function use_authentication() {\n return $this->proxy_user && $this->proxy_pass;\n }",
"public function setUseIPAddress($use_ipaddr) \n \t{\n \t\t$this->use_ipaddr = $use_ipaddr;\n \t}",
"public function isClientSafe();",
"public function setSecurity($security = false) {\r\n\t\t$this->security = $security;\r\n\t}",
"public function isPreflightRequest(): bool;",
"private function toggleTunnel(){\n\t\tif(isset($_POST['tunnelid']) && is_numeric($_POST['tunnelid'])){\n\t\t\tforeach($this->data->tunnels->tunnel as $tunnel){\n\t\t\t\tif((string)$tunnel['id'] == $_POST['tunnelid']){\n\t\t\t\t\t\n\t\t\t\t\tif((string)$tunnel['enable'] == 'true'){\n\t\t\t\t\t\t$tunnel['enable'] = 'false';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$tunnel['enable'] = 'true';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->config->saveConfig();\n\t\t\t\t\techo '<reply action=\"ok\"/>';\n\t\t\t\t\treturn true;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new Exception('The specified tunnel could not be found');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('An invalid tunnel identifier was submitted');\n\t\t}\n\t}",
"public function set_use_tls($_use_tls)\n {\n $this->_use_tls = $_use_tls;\n }",
"private function setConnection() {\n try {\n //Decrypt Keys\n $this->response['access_key'] = Crypt::decrypt($this->request['access_key']);\n $this->response['secret'] = Crypt::decrypt($this->request['secret']);\n $this->response['region'] = $this->request['region'];\n $this->response['bucket'] = $this->request['bucket'];\n $this->response['bucket_type'] = !empty($this->request['bucket_type']) ? $this->request['bucket_type'] : 'bucket';\n $this->response['prefix'] = !empty($this->request['prefix']) ? $this->request['prefix'] : null;\n //Always reset the connection.\n $this->response['connected'] = false;\n //Set config and client.\n Config::set('aws::config.key', $this->response['access_key']);\n Config::set('aws::config.secret', $this->response['secret']);\n Config::set('aws::config.region', $this->response['region']);\n $this->client = \\AWS::get('s3');\n return true;\n } catch (\\Aws\\S3\\Exception\\S3Exception $ex) {\n $this->response['errorMessage'] = 'Set Connection: ' . $ex->getMessage();\n return false;\n }\n }",
"function trusted() {\n\t//-----------------------------------------------------------\n\t// Check for trusted host\n\tif(getenv('HTTP_REFERRER')) {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERRER'));\n\t\t} else {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERER'));\n\t\t}\n\tif($ref_url_parts['host'] !== $this->accept_host) {\n\t\treturn false;\n\t\t//print \"ERROR - You do not have permission to access this site remotely.\";\n\t\t//exit;\n\t} else {\n\t\treturn true;\n\t}\n}",
"public function get_use_ssl()\n {\n return $this->_use_ssl;\n }",
"public function setPassthru($passthru)\n {\n $this->passthru = StringHelper::booleanValue($passthru);\n }",
"public function isClientSafe()\n {\n }",
"private function usesNonStandardHttpPort(): bool\n {\n return 'http' === $this->getScheme() && '80' != $this->router->getContext()->getHttpPort();\n }",
"protected function setProxyAuthScheme() {}",
"private function set_proxy(array $options) {\r\n $this->proxyhost = $options['host'];\r\n\r\n if (isset($options['port'])) {\r\n $this->proxyport = $options['port'];\r\n }\r\n if (isset($options['user'])) {\r\n $this->proxyuser = $options['user'];\r\n }\r\n if (isset($options['password'])) {\r\n $this->proxypassword = $options['password'];\r\n }\r\n }",
"protected function init()\n { \n // get remote config\n $this->_remoteConfig = Mage::helper('shoptimally_core/remoteConfig');\n \n // calculate enabled status\n $this->_isEnabled = ($this->getGeneralSetting('ShoptimallyEnabled')) &&\n (strlen($this->getApiKey()) > 0) &&\n $this->_remoteConfig->get(\"enabled\");\n \n // init shoptimally domain\n $this->_shoptimallyDomain = $this->_remoteConfig->get('shoptimally_domain');\n if (is_null($this->_shoptimallyDomain) || \n strlen($this->_shoptimallyDomain) == 0)\n {\n $this->_shoptimallyDomain = \"api1.shoptimally.com\"; \n }\n }",
"private function checkAccess(): bool\n {\n echo \"Proxy: Checking access prior to firing a real request.\\n\";\n\n return true;\n }",
"private function setLoginOption() {\r\n\t\t$this->options = array(\r\n\t\t\t'http' => array(\r\n\t\t\t\t'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\r\n\t\t\t\t'method' => 'POST',\r\n\t\t\t\t'content' => http_build_query($this->data)\r\n\t\t\t),\r\n\t\t);\r\n\t}",
"function setNonBlockingSocket()\n\t{\n\t\tsocket_set_nonblock($this->socket);\n\t}",
"function setSharingEnabled($value);",
"public function setAllowAllCaptiveNetworkPlugins(?bool $value): void {\n $this->getBackingStore()->set('allowAllCaptiveNetworkPlugins', $value);\n }",
"abstract function _is_conn();",
"public function isHttpProxyTunnelUsed();",
"public function setShowInsecure($showInsecure) {\n\t\t\t$this->showInsecure = (bool) $showInsecure;\n\t\t}",
"public static function setConnectDefault()\n {\n static::$connect = self::CONNECT_DEFAULT;\n }",
"protected function allow() {\n\t\t\n\t\treturn true;\n\t}",
"public static function setConnectAdvanced()\n {\n static::$connect = self::CONNECT_ADVANCED;\n }",
"public function canSetControllablePolicy();",
"public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }",
"public function allowCustomResponseCode()\n {\n $this->allowCustomResponseCode = \\true;\n }",
"function setBlockingSocket()\n\t{\n\t\tsocket_set_block($this->socket);\n\t}",
"public function force_fsockopen($enable = \\false)\n {\n }",
"function setProxyServer($value)\n {\n $this->_props['ProxyServer'] = $value;\n }",
"private function setOptions()\n {\n $this->clientId = $this->config['stravaSettings']['clientId'];\n $this->clientSecret = $this->config['stravaSettings']['clientSecret'];\n $this->redirectUri = $this->config['stravaSettings']['redirectUri'];\n $this->aprovalPrompt = $this->config['stravaSettings']['approval_prompt'];\n $this->scopes = $this->config['stravaSettings']['scopes'];\n }",
"public function getUseSSL(){\r\n\t\treturn $this->useSSL;\r\n\t}",
"function fccpod_set_validation_boolean() {\n\t$api_validation = fccpod_jw_account_verify_api_key_secret();\n\n\tif ( $api_validation ) {\n\t\tupdate_option( 'fccpod_jw_api_authorized', 1 );\n\t} else {\n\t\tupdate_option( 'fccpod_jw_api_authorized', 0 );\n\t}\n\n}",
"private function setCrypto()\n {\n $this->cryptoType = STREAM_CRYPTO_METHOD_TLS_CLIENT;\n //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT\n //so add them back in manually if we can\n if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {\n $this->cryptoType |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;\n $this->cryptoType |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;\n }\n }",
"private function ngrokSet(): bool\n {\n return env('MOLLIE_NGROK_REDIRECT', false) == true;\n }",
"private function setConnection(){\n\n\n\t\t\t$this->apiKey = Settings::get( 'apiKey' );\n\n\t\t\tif( $this->apiKey ){\n\n\t\t\t\t$this->gateway = new MailChimp( $this->apiKey );\n\n\t\t\t}else{\n\n\t\t\t\t//log an error\n\n\t\t\t}\n\n\t\t}",
"public function setAllowTrustMeAccount($allow_tma){\r\n\t\t$this->allowTrustMeAccount = $allow_tma;\r\n\t\t$this->overwriteGlobalTMASettings = true;\r\n\t}"
] | [
"0.6615528",
"0.62036014",
"0.60414904",
"0.6011218",
"0.575766",
"0.573498",
"0.5678765",
"0.5637087",
"0.55337846",
"0.5501304",
"0.5497651",
"0.54956484",
"0.5464986",
"0.5451374",
"0.5445402",
"0.54255193",
"0.5424967",
"0.5372971",
"0.5366408",
"0.5359078",
"0.5356375",
"0.5347017",
"0.5329687",
"0.53291076",
"0.5321233",
"0.5319417",
"0.53175724",
"0.53022945",
"0.5277735",
"0.52757233",
"0.5255241",
"0.52551115",
"0.5242868",
"0.5228258",
"0.52243257",
"0.52203435",
"0.52148813",
"0.5210373",
"0.52021587",
"0.51978725",
"0.51954573",
"0.51824576",
"0.51811713",
"0.51770306",
"0.5174418",
"0.51658857",
"0.5161762",
"0.51585954",
"0.51523054",
"0.51521593",
"0.5150653",
"0.5140236",
"0.51357055",
"0.5131639",
"0.5128508",
"0.51251036",
"0.51233983",
"0.51218224",
"0.50850695",
"0.50829524",
"0.5078525",
"0.5078399",
"0.50750566",
"0.5074363",
"0.5070351",
"0.506498",
"0.50626636",
"0.50545514",
"0.50473326",
"0.5042407",
"0.5040508",
"0.5030551",
"0.5026774",
"0.5023694",
"0.5023244",
"0.50217205",
"0.50137156",
"0.5013319",
"0.5011247",
"0.5007889",
"0.5001698",
"0.50005794",
"0.5000217",
"0.49980095",
"0.4992425",
"0.49913883",
"0.49845615",
"0.4982606",
"0.49746084",
"0.49731082",
"0.49725017",
"0.49672076",
"0.49662653",
"0.4959378",
"0.49571013",
"0.49560902",
"0.49559978",
"0.4955871",
"0.49541345",
"0.49488991"
] | 0.69687444 | 0 |
get whether or not we are allowing external connections | static function doesAllowExternalConnections() {
return self::$allow_external_connections;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkConnection(){\r\n\t\treturn false;\r\n\t}",
"public function isConnect()\n {\n return $this->bbb->isConnectionWorking();\n }",
"abstract function _is_conn();",
"public function isOnline() \n {\n // pings example.com and google.com\n $is_conn = null;\n $connected1 = @fsockopen(\"www.example.com\", 80); //website, port (try 80 or 443)\n $connected2 = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n // if either is successful\n if ($connected1 || $connected2){\n $is_conn = true; //action when connected\n fclose($connected1);\n fclose($connected2);\n }else{\n $is_conn = false; //action in connection failure\n }\n return $is_conn;\n }",
"public function isConnectionOpen(): bool;",
"public function isConnected() {}",
"public function isConnected() {}",
"public function isConnected() {}",
"public function is_connected()\n {\n $result = @$this->mcache->getExtendedStats();\n $canconnect = false;\n\n if($result) {\n foreach($result as $server => $stats) {\n if($stats) {\n $canconnect = true;\n break;\n }\n }\n }\n \n return $canconnect;\n }",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected();",
"public function isConnected(): bool;",
"public function isConnected(): bool;",
"public function isConnected(): bool;",
"public static function get_allowed_on_network()\n {\n }",
"function is_connected()\n\t{\n\t\t$connected = @fsockopen(\"www.google.com\", 80); //website, port (try 80 or 443)\n\t\tif ($connected){\n\t\t \t$is_conn = true; //action when connected\n\t\t\tfclose($connected);\n\t\t}else{\n\t\t\t$is_conn = false; //action in connection failure\n\t\t}\n\t\treturn $is_conn;\n\n\t}",
"public function serverOnline()\n {\n return @fsockopen( setting('server.ip', '127.0.0.1'), config( 'pw-api.ports.client' ), $errCode, $errStr, 1 ) ? TRUE : FALSE;\n }",
"public function isConnected()\n\t{\n\t\treturn $this->isUser() || $this->isOrga();\n\t}",
"public static function checkConnection() {\r\n\t\t$url = MoufReflectionProxy::getLocalUrlToProject().\"src/direct/test_connection.php\";\r\n\t\r\n\t\t$response = self::performRequest($url);\r\n\t\t\r\n\t\tif ($response == 'ok') {\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 isConnected():bool;",
"public function CheckConnection() {\n\t\tif (is_resource($this->SQLConnection)\n\t\t\t&& strpos(get_resource_type($this->SQLConnection), 'odbc link') !== false)\n\t\t{\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isConnected(){\n\n if (is_a($this->resourceId,\"mysqli\")) {\n return mysqli_ping($this->resourceId);\n }\n return false;\n }",
"public function aim_connected()\r\n\t{\r\n\t\tif (is_resource($this->resource)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthrow new TACException('Unable to find active connection');\r\n\t\t}\r\n return false;\r\n\t}",
"public function IsConnected()\r\n\t{\r\n\t\tif( gettype( $this->db_link ) == 'resource' )\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public static function hasAccess(): bool\n {\n return in_array(Helper::getClientIP(), self::$ips);\n }",
"function is_connected()\n {\n static $isConnected = null;\n if ($isConnected !== null) {\n return $isConnected;\n }\n $isConnected = false;\n $connection = env('IS_CONNECTED', true) ? @fsockopen('www.google.com', 80) : null;\n if ($connection) {\n fclose($connection);\n $isConnected = true;\n }\n\n return $isConnected;\n }",
"function getIsAvailable() ;",
"public function isOnline() {}",
"public function isConnected()\n {\n return true;\n }",
"function isListening() {\n\t\treturn !empty($this->data['INFO_REMOTE_METHOD']) && !empty($this->data['INFO_REMOTE_URI']);\n\t}",
"public function isConnected()\n\t{\n\t\t// TODO: Make this check the login functionality or something..!!\n\t\treturn true;\n\t}",
"static public function is_connected()\n {\n return R::testConnection();\n }",
"public function getIsAvailable();",
"public function isConnected()\n {\n return !is_null($this->user);\n }",
"public function isConnected(): bool\n {\n }",
"public function isValid () {\n\tif ($this->doConnect()) return true;\n\treturn false;\n }",
"public function get_api_is_reachable() {\n\t\t$enabled = get_option( 'algolia_api_is_reachable', 'no' );\n\n\t\treturn 'yes' === $enabled;\n\t}",
"public function isConnected()\n {\n return isset($this->conn);\n }",
"public function isAccessAllowed()\n\t{\n\t\t$returnValue \t=\tFALSE;\n\n\t\tif($this->isUserIPAddressAllowedAccess())\n\t\t{\n\t\t\t$returnValue\t=\tTRUE;\n\t\t}\n\n\t\treturn $returnValue;\n\t}",
"abstract public function isConnected();",
"abstract public function isConnected();",
"public function connected() {\r\n\t\treturn $this->_phpseclib !== null;\r\n\t}",
"public function canBeImpersonated();",
"public function isPublic()\n {\n $allowsAllHosts = false;\n $allowsRListings = false;\n foreach ($this->rules as $rule) {\n if (self::READ & $rule['mask']) {\n if (!empty($rule['rlistings'])) {\n $allowsRListings = true;\n } elseif (!empty($rule['host']) && trim($rule['host']) == '*') {\n $allowsAllHosts = true;\n }\n }\n }\n\n return $allowsAllHosts && $allowsRListings;\n }",
"function isOnline()\n{\n $connected = checkdnsrr(\"google.com\");\n\n if ($connected) {\n return true;\n }\n\n return false;\n}",
"private function checkAccess(): bool\n {\n echo \"Proxy: Checking access prior to firing a real request.\\n\";\n\n return true;\n }",
"private function checkConnection()\n {\n $status = false;\n $url = 'http://' . trim($this->ip) . ':80/';\n $curlInit = curl_init($url);\n curl_setopt($curlInit, CURLOPT_CONNECTTIMEOUT, 2); //третий параметр - время ожидания ответа сервера в секундах\n curl_setopt($curlInit, CURLOPT_HEADER, true);\n curl_setopt($curlInit, CURLOPT_NOBODY, true);\n curl_setopt($curlInit, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curlInit);\n curl_close($curlInit);\n if ($response) {\n $status = true;\n }\n return $status;\n }",
"public function isConnected() {\n\t\treturn isset($this->conn);\n\t}",
"public function isConnected() {\n\t\treturn isset($this->conn);\n\t}",
"public function is_enabled() {\n return $this->proxy_host && $this->proxy_port;\n }",
"public function isConnected()\n {\n return $this->getResource()->isConnected();\n }",
"function ticketbud_server_connectivity_ok() {\n\t// skip the check on WPMU because the status page is hidden\n\tglobal $ticketbud_unused_api_key;\n\tif ( $ticketbud_unused_api_key )\n\t\treturn true;\n\t$servers = ticketbud_get_server_connectivity();\n\treturn !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );\n}",
"public function isExternal()\n\t{\n\t\treturn $this->isUser() && $this->user->getKeepActive();\n\t}",
"public function getIsAvailable() {}",
"public function getRemoteCallEnabled() {\n\t\tif (is_null($this->remoteCallEnabled)) {\n\t\t\t$this->remoteCallEnabled = Mage::getStoreConfigFlag('dev/aoe_templatehints/enablePhpstormRemoteCall');\n\t\t}\n\t\treturn $this->remoteCallEnabled;\n\t}",
"public static function isConnected() {\n return isset($_SESSION['userid']);\n }",
"protected function _isActive() {\n\t\treturn connection_status() === CONNECTION_NORMAL && !connection_aborted();\n\t}",
"function is_connected($domain = 'www.perfexcrm.com')\r\n{\r\n $connected = @fsockopen($domain, 80);\r\n //website, port (try 80 or 443)\r\n if ($connected) {\r\n $is_conn = true; //action when connected\r\n fclose($connected);\r\n } else {\r\n $is_conn = false; //action in connection failure\r\n }\r\n return $is_conn;\r\n}",
"function trusted() {\n\t//-----------------------------------------------------------\n\t// Check for trusted host\n\tif(getenv('HTTP_REFERRER')) {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERRER'));\n\t\t} else {\n\t\t$ref_url_parts=parse_url(getenv('HTTP_REFERER'));\n\t\t}\n\tif($ref_url_parts['host'] !== $this->accept_host) {\n\t\treturn false;\n\t\t//print \"ERROR - You do not have permission to access this site remotely.\";\n\t\t//exit;\n\t} else {\n\t\treturn true;\n\t}\n}",
"function adminChk(){\r\n\treturn $_SERVER[\"REMOTE_ADDR\"] == \"118.36.189.171\" || $_SERVER[\"REMOTE_ADDR\"] == \"39.115.229.173\" || $_SERVER[\"REMOTE_ADDR\"] == \"127.0.0.1\";\r\n}",
"function isConnected()\n\t{\n\t\tif($this->connected) return true;\n\t\telse\t\t return false;\n\t}",
"public function isConnect()\n {\n return $this->getMethod() === 'CONNECT';\n }",
"function controlAccess() {\n $ip = FILTER_INPUT(INPUT_SERVER, \"REMOTE_ADDR\");\n $whitelist = [\n \"127.0.0.1\",\n \"91.231.229.130\",\n \"176.38.54.30\",\n \"176.38.54.34\",\n \"94.153.222.226\"\n ];\n return array_search($ip, $whitelist) !== false;\n}",
"function secure_connection() {\n\tif (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"public function isAvailable()\n {\n if (empty($this->_url)) {\n return false;\n } // if\n\n try {\n $this->sendrequest('status', null);\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }",
"function canHandleRequest() ;",
"public function openConnection(): bool;",
"public function openConnection(): bool;",
"final public function connected() {\n if (is_a($this->resourceId,\"mysqli\")) {\n return mysqli_ping($this->resourceId);\n }\n return false;\n }",
"public function isConnected()\n {\n return $this->manager->isConnected();\n }",
"public function isConnected()\n {\n if($this->is_connected)\n {\n return true;\n }\n else{\n return false;\n }\n }",
"public function isRemote();",
"abstract function isConnected();",
"public function hasAccess() : bool\n\t{\n\t\t$ip = Server::getIP();\n\t\t$access = false;\n\n\t\t// Allow local access\n\t\tif ( Stringify::contains(['127.0.0.1','::1'], $ip) ) {\n\t\t\t$access = true;\n\n\t\t} else {\n\n\t\t\t// Check allowed IPs\n\t\t\t$allowed = $this->applyFilter('access-allowed-ip', $this->getAllowedAccess());\n\t\t\tif ( !empty($allowed) ) {\n\t\t\t\tif ( Stringify::contains($allowed, $ip) ) {\n\t\t\t\t\t$access = true;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Deny access\n\t\t\t\t$denied = $this->applyFilter('access-denied-ip', $this->getDeniedAccess());\n\t\t\t\tif ( Stringify::contains($denied, $ip) ) {\n\t\t\t\t\t$access = false;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data = ['ip' => $ip, 'access' => $access];\n\t\t$this->doAction('ip-access', $data);\n\t\treturn $access;\n\t}",
"public function is_connected() {\n\t\treturn true;\n\t}",
"public function testConnection()\n {\n $lists = $this->_getLists();\n if ($lists === false) {\n return $this->_error;\n }\n\n return true;\n }",
"public function isConnection()\n {\n return ($this->_connection) ? true : false;\n }",
"public function canImpersonate();",
"protected function is_connected_to_proxy() {\n\t\treturn (bool) $this->authentication->is_authenticated()\n\t\t\t&& $this->authentication->credentials()->has()\n\t\t\t&& $this->authentication->credentials()->using_proxy();\n\t}",
"public function isConnected()\n {\n return $this->_conn !== null;\n }",
"public function isConnected()\n {\n return (bool) $this->socket;\n }",
"public function isIpnUrlAccessRestricted()\n {\n return Mage::getStoreConfigFlag(self::GENERAL_SETTINGS_PATH . 'restrictaccess', $this->getStoreId());\n }",
"public function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }",
"public function isConnect()\n\t{\n\t\treturn $this->httpMethod() == self::MethodConnect;\n\t}",
"public function isOnline() {\n }",
"public function IsConnected()\r\n\t{\r\n\t\treturn $this->_isConnected;\r\n\t}",
"function isOpen() \r\n{ \r\nreturn ($this->Socket ? true : false); \r\n}",
"public function isConnected()\n\t{\n\t\treturn $this->isConnected;\n\t}",
"public function isConnect()\n {\n return $this->method === self::METHOD_CONNECT;\n }",
"public function isConnected()\n\t{\n\t\treturn ( $this->_connected == true ) ? true : false;\n\t}",
"public function hasConnection()\n {\n return $this->connection ? true : false;\n }",
"public function isAvailable(): bool;",
"public function is_available() {\n if ($this->enabled == \"yes\") {\n if (!is_ssl() && !$this->testmode) {\n return false;\n }\n // Required fields check\n if (!$this->secret_key || !$this->publishable_key) {\n return false;\n }\n return true;\n }\n return false;\n }",
"public function connect() : bool\r\n {\r\n if ($this->authenticated() === false)\r\n return false;\r\n\r\n // TODO: check connection with basic api request\r\n\r\n return true;\r\n }",
"public function isConnected()\n {\n return isset($this->connection);\n }",
"function isConnected(){\n $connected = FALSE;\n if($_SESSION['level']>0){\n $connected = TRUE;\n }\n return $connected;\n }"
] | [
"0.7054565",
"0.7030525",
"0.6975314",
"0.68853116",
"0.68583184",
"0.6839419",
"0.6839419",
"0.6839076",
"0.6828748",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6808892",
"0.6771379",
"0.6771379",
"0.6771379",
"0.67427135",
"0.6720285",
"0.6688985",
"0.66861385",
"0.6672659",
"0.6656094",
"0.6654841",
"0.6631892",
"0.66084677",
"0.66040736",
"0.6588644",
"0.6587997",
"0.6562443",
"0.65503675",
"0.6548085",
"0.6527141",
"0.6515308",
"0.6513292",
"0.6510853",
"0.650038",
"0.6498992",
"0.64856625",
"0.64653504",
"0.6455489",
"0.645307",
"0.6448771",
"0.6448771",
"0.64363897",
"0.64335924",
"0.64322406",
"0.64207345",
"0.6416665",
"0.6408637",
"0.6403561",
"0.6403561",
"0.6403236",
"0.6394504",
"0.6379434",
"0.63794273",
"0.637672",
"0.6371175",
"0.6364951",
"0.6351673",
"0.63484794",
"0.63369894",
"0.63054764",
"0.63019687",
"0.6299495",
"0.6299124",
"0.6298963",
"0.628258",
"0.6280402",
"0.6278745",
"0.6278745",
"0.62767863",
"0.62688965",
"0.6268557",
"0.6266577",
"0.62640613",
"0.626354",
"0.6262724",
"0.6258268",
"0.62567693",
"0.62546605",
"0.62486947",
"0.6247983",
"0.6246038",
"0.6228896",
"0.62278825",
"0.6227416",
"0.6216756",
"0.6214811",
"0.62097836",
"0.62080723",
"0.6201708",
"0.6200334",
"0.6197904",
"0.61964077",
"0.6190552",
"0.6186935",
"0.6186533",
"0.61813205"
] | 0.8181926 | 0 |
This function allows you to register a responder. If there is a responder registered for a given request, Instead of hitting the outside world, its return value will be returned. These are evaluated in the order they are registered | static function register($formula) {
self::$matchers[] = $formula;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function resolveRequestHandler() {}",
"public function register()\n {\n //Using contextual binding to bind the needed incentive module based on request received\n $this->app->when(IncentivesController::class)\n ->needs(IncentivesInterfaceModule::class)\n ->give(function () {\n return request()->incentiveId === '1'\n ? $this->app->get(IncentiveEvent1Module::class)\n : $this->app->get(IncentiveEvent2Module::class);\n });\n\n }",
"public function dispatch(RequestContract $request) {\n\n\t\t$response = NULL;\n\n\t\tforeach ($this->routes as $route) {\n\n\t\t\tif ($route->matches($request)) {\n\n\t\t\t\t$response = $route->fire($request);\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $response;\n\n\t}",
"public static function client_responce()\n {\n // Find out Request Type\n $req_type = self::client_request_type();\n\n // Fire Responce\n self::{$req_type}();\n\n // End..\n die();\n }",
"static function match($request) {\n foreach (self::$matchers as $matcher) {\n $response = $matcher($request);\n if ($response !== null) {\n $response->request = $request;\n return $response;\n }\n } \n return null;\n }",
"public function lookup() { return $this->doRequest(); }",
"abstract protected function registerHandlers();",
"public function resolveRequestHandler() {\n\t\t$availableRequestHandlerClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface('F3\\FLOW3\\MVC\\RequestHandlerInterface');\n\n\t\t$suitableRequestHandlers = array();\n\t\tforeach ($availableRequestHandlerClassNames as $requestHandlerClassName) {\n\t\t\tif (!$this->objectManager->isObjectRegistered($requestHandlerClassName)) continue;\n\n\t\t\t$requestHandler = $this->objectManager->getObject($requestHandlerClassName);\n\t\t\tif ($requestHandler->canHandleRequest()) {\n\t\t\t\t$priority = $requestHandler->getPriority();\n\t\t\t\tif (isset($suitableRequestHandlers[$priority])) throw new \\F3\\FLOW3\\MVC\\Exception('More than one request handler with the same priority can handle the request, but only one handler may be active at a time!', 1176475350);\n\t\t\t\t$suitableRequestHandlers[$priority] = $requestHandler;\n\t\t\t}\n\t\t}\n\t\tif (count($suitableRequestHandlers) === 0) throw new \\F3\\FLOW3\\MVC\\Exception('No suitable request handler found.', 1205414233);\n\t\tksort($suitableRequestHandlers);\n\t\treturn array_pop($suitableRequestHandlers);\n\t}",
"public function dispatch(Request $request)\n\t{\n\t\t// Before we handle the requests we need to make sure the application has been\n\t\t// booted up. The boot process will call the \"boot\" method on each service\n\t\t// provider giving them all a chance to register any application events.\n\t\tif ( ! $this->booted)\n\t\t{\n\t\t\t$this->boot();\n\t\t}\n\n\t\t$this->prepareRequest($request);\n\n\t\t// First we will call the \"before\" global middlware, which we'll give a chance\n\t\t// to override the normal requests process when a response is returned by a\n\t\t// middlewares. Otherwise we'll call the route just like a normal reuqest.\n\t\t$response = $this->callGlobalMiddleware('before');\n\n\t\tif ( ! is_null($response))\n\t\t{\n\t\t\treturn $this->prepareResponse($response, $request);\n\t\t}\n\n\t\t$route = $this['router']->dispatch($request);\n\n\t\t// Once we have the route and before middlewares, we will iterate through them\n\t\t// and call each one. If a given filter returns a response we will let that\n\t\t// value override the rest of the request cycle and return the Responses.\n\t\t$before = $this->getBeforeMiddlewares($route, $request);\n\n\t\tforeach ($before as $middleware)\n\t\t{\n\t\t\t$response = $this->callMiddleware($middleware);\n\t\t}\n\n\t\t// If none of the before middlewares returned a response, we will just execute\n\t\t// the route that matched the request, then call the after filters for this\n\t\t// and return the responses back out and they'll get sent to the clients.\n\t\tif ( ! isset($response))\n\t\t{\n\t\t\t$response = $route->run();\n\t\t}\n\n\t\t$response = $this->prepareResponse($response, $request);\n\n\t\t// Once all of the \"after\" middlewares are called we should be able to return\n\t\t// the completed response object back to the consumers so it will be given\n\t\t// to the client as a response. The Responses should be final and ready.\n\t\tforeach ($route->getAfterMiddlewares() as $middleware)\n\t\t{\n\t\t\t$this->callMiddleware($middleware, array($response));\n\t\t}\n\n\t\t$this->callAfterMiddleware($response);\n\n\t\treturn $response;\n\t}",
"function http_request_method_register($method) {}",
"public function getResponder(): string\n {\n return $this->responder;\n }",
"public function __invoke($request)\n {\n $next = $this->middleware->get($this->index);\n\n if ($next)\n {\n $name = ($next['n']) ?? '';\n $mParams = explode(',',($next['p']) ?? '');\n\n // check if the middleware class actually exist,\n // otherwise we will need to close out this.\n if (!class_exists($name)) return false;\n\n // increment the middelware we instantiate\n $this->index++;\n\n // begin our middleware instance\n $middleware = new $name();\n\n // load our middelware handle instance for the request\n if (method_exists($middleware, 'handle'))\n {\n $this->middlewareInstances[] = $middleware;\n\n return $middleware->handle($request, $this, ...$mParams);\n }\n else\n {\n // if the middleware does not have a handle, we will need to end the script.\n // All middlewares must have a handle.\n return false;\n }\n }\n\n // return the updated response\n return $this->response;\n }",
"public function activateReactor($request)\n {\n return $this->start()->uri(\"/api/reactor\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"public function run(Request $req = null, Responder $resp = null)\n {\n $this->tracer->info(\"Beginning Request Cycle\");\n \n $this->reset();\n list($req, $resp) = $this->prepareRequestAndResponse($req, $resp);\n $this->lastRequest = $req;\n \n $controller = $this->findController($req);\n if ($controller instanceof NotFoundControllerInterface) {\n return $this->dispatch($req, $resp, $controller);\n \n } else if ($controller instanceof ControllerInterface) {\n $this->addParameters($controller, $req);\n return $this->dispatch($req, $resp, $controller);\n \n } else {\n return false;\n }\n }",
"public function __invoke(\n RequestInterface $request,\n ResponseInterface $response,\n DelegateInterface $next = null\n )/*# : ResponseInterface */ {\n return $this->process($request, $response, $next);\n }",
"public static function getInstance(): Responder\n {\n if (!self::$instance) {\n self::$instance = new Responder();\n }\n\n return self::$instance;\n }",
"public function register():void\n {\n //returning a concrete Client request interface depending on the config. Mainly for testing\n $this->app->singleton(ClientRequestInterface::class, function($app){\n if(\\config('app')['env'] === 'live') {\n return new LiveClientRequest();\n }\n return new TestClientRequest();\n });\n }",
"public function route(Request &$request): false|string|callable|array\n\t{\n\t\t$routeInfo = $this->dispatcher->dispatch(\n\t\t\t$request->getMethod(),\n\t\t\t$request->getUri()->getPath()\n\t\t);\n\n\t\tif ($routeInfo[0] !== \\FastRoute\\Dispatcher::FOUND) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($routeInfo[2] as $key => $val) {\n\t\t\t$request = $request->withAttribute($key, $val);\n\t\t}\n\t\treturn $routeInfo[1];\n\t}",
"public function AddDelegate($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }",
"public function processRequest(): ResponseInterface\n {\n $routes = $this->bs->routes();\n $request = new Request($this->bs->globals());\n $routingEngine = new RoutingEngine($routes);\n $result = $routingEngine->resolve(\n $request->method(),\n $request->uri()\n );\n if($result === null) {\n return new TextResponse(\"404 page not found\");\n }\n $requestHandler = new RequestHandler(\n $this,\n $request,\n $this->bs->middlewares(),\n $result\n );\n $response = $requestHandler->handleRequest();\n return $response;\n }",
"public function respond();",
"public function respond();",
"public function checkRegistryRequestsAnswers()\n {\n\n if (! $this->organizationId) {\n if ($this->respondent) {\n $this->organizationId = $this->respondent->getOrganizationId();\n }\n if (! $this->organizationId) {\n $this->organizationId = $this->request->getParam(\\MUtil_Model::REQUEST_ID2);\n }\n }\n\n if ($this->organizationId && (! $this->respondentId)) {\n if ($this->respondent) {\n $this->respondentId = $this->respondent->getId();\n }\n if (! $this->respondentId) {\n $this->respondentId = $this->util->getDbLookup()->getRespondentId(\n $this->request->getParam(\\MUtil_Model::REQUEST_ID1),\n $this->organizationId\n );\n }\n }\n\n return $this->organizationId && $this->respondentId && $this->db && $this->model;\n }",
"public function get_matched_handler()\n {\n }",
"public function match(ServerRequestInterface $request);",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function canHandleRequest() {}",
"public function run(Request $request) {\n\t\treturn $this->responder->run($request);\n\t}",
"public function register(Request $request)\n {\n Session::put('last_auth_attempt', 'register');\n //The trait is not a class. You can't access its members directly.\n return $this->traitRegister($request);\n }",
"public function canHandleRequest();",
"public function canHandleRequest();",
"public function RouteRequest ();",
"public function invoke()\n {\n /** @var Request $request */\n $request = $this->bootstrap->getActiveRequestHandler()->getHttpRequest();\n $this->floodMitigationService->registerAccess($request->getClientIpAddress());\n\n return true;\n }",
"public function in(Request $request)\n {\n $tagged = false;\n\n /**\n * @var Route $route\n */\n foreach ($this->routes as $route) {\n\n $placeholders = $route->matches($request);\n if ($placeholders !== false) {\n\n // Dispatch a matched event\n if (!is_null($this->dispatcher)) {\n $this->dispatcher->dispatch(RouterEvent::ROUTE_MATCHED, new RouterEvent($route, $this));\n }\n\n // Add the matched route's parameters to the request\n $request = $request->withParameter('_controller', array(\n 'class' => $route->getController(),\n 'method' => $route->getAction()\n ));\n\n // Add any matched route placeholders to the request parameters\n foreach ($placeholders as $placeholderKey => $placeholderValue) {\n $request = $request->withParameter($placeholderKey, $placeholderValue);\n }\n\n $tagged = true;\n break;\n }\n }\n\n // If no suitable route was found...\n if (!$tagged) {\n throw RouterException::noRouteExists($request->getMethod(), $request->getUri()->getPath());\n }\n\n return $request;\n }",
"public function register(\n ServerRequestInterface $request, ResponseInterface $response\n );",
"protected function registered()\n {\n //\n }",
"function klein_dispatch( $uri = null, $req_method = null, array $params = null, $capture = false, $passthru = false ) {\n\tglobal $__klein_routes;\n\n\t// Pass $request, $response, and a blank object for sharing scope through each callback\n\t$request = new klein_Request;\n\t$response = new klein_Response;\n\t$app = new klein_App;\n\n\t// Get/parse the request URI and method\n\tif ( null === $uri ) {\n\t\t$uri = isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/';\n\t}\n\tif ( false !== strpos( $uri, '?' ) ) {\n\t\t$uri = str_replace( stristr( $uri, \"?\" ), \"\", $uri );\n\t}\n\tif ( null === $req_method ) {\n\t\t$req_method = isset( $_SERVER['REQUEST_METHOD'] ) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n\n\t\t// For legacy servers, override the HTTP method with the X-HTTP-Method-Override\n\t\t// header or _method parameter\n\t\tif ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) {\n\t\t\t$req_method = $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'];\n\t\t} elseif ( isset( $_REQUEST['_method'] ) ) {\n\t\t\t$req_method = $_REQUEST['_method'];\n\t\t}\n\t}\n\n\t// Force request_order to be GP\n\t// http://www.mail-archive.com/[email protected]/msg33119.html\n\t$_REQUEST = array_merge( $_GET, $_POST );\n\tif ( null !== $params ) {\n\t\t$_REQUEST = array_merge( $_REQUEST, $params );\n\t}\n\n\t$matched = 0;\n\t$methods_matched = array();\n\n\tob_start();\n\n\tforeach ( $__klein_routes as $handler ) {\n\t\tlist( $method, $_route, $callback, $count_match ) = $handler;\n\n\t\t$method_match = null;\n\t\t// Was a method specified? If so, check it against the current request method\n\t\tif ( is_array( $method ) ) {\n\t\t\tforeach ( $method as $test ) {\n\t\t\t\tif ( strcasecmp( $req_method, $test ) === 0 ) {\n\t\t\t\t\t$method_match = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( null === $method_match ) {\n\t\t\t\t$method_match = false;\n\t\t\t}\n\t\t} elseif ( null !== $method && strcasecmp( $req_method, $method ) !== 0 ) {\n\t\t\t$method_match = false;\n\t\t} elseif ( null !== $method && strcasecmp( $req_method, $method ) === 0 ) {\n\t\t\t$method_match = true;\n\t\t}\n\n\t\t// If the method was matched or if it wasn't even passed (in the route callback)\n\t\t$possible_match = is_null( $method_match ) || $method_match;\n\n\t\t// ! is used to negate a match\n\t\tif ( isset( $_route[0] ) && $_route[0] === '!' ) {\n\t\t\t$negate = true;\n\t\t\t$i = 1;\n\t\t} else {\n\t\t\t$negate = false;\n\t\t\t$i = 0;\n\t\t}\n\n\t\t// Check for a wildcard (match all)\n\t\tif ( $_route === '*' ) {\n\t\t\t$match = true;\n\n\t\t\t// Easily handle 404's\n\t\t} elseif ( $_route === '404' && ! $matched && count( $methods_matched ) <= 0 ) {\n\t\t\ttry {\n\t\t\t\tcall_user_func( $callback, $request, $response, $app, $matched, $methods_matched );\n\t\t\t}\n\t\t\tcatch ( Exception $e ) {\n\t\t\t\t$response->error( $e );\n\t\t\t}\n\n\t\t\t++ $matched;\n\t\t\tcontinue;\n\n\t\t\t// Easily handle 405's\n\t\t} elseif ( $_route === '405' && ! $matched && count( $methods_matched ) > 0 ) {\n\t\t\ttry {\n\t\t\t\tcall_user_func( $callback, $request, $response, $app, $matched, $methods_matched );\n\t\t\t}\n\t\t\tcatch ( Exception $e ) {\n\t\t\t\t$response->error( $e );\n\t\t\t}\n\n\t\t\t++ $matched;\n\t\t\tcontinue;\n\n\t\t\t// @ is used to specify custom regex\n\t\t} elseif ( isset( $_route[ $i ] ) && $_route[ $i ] === '@' ) {\n\t\t\t$match = preg_match( '`' . substr( $_route, $i + 1 ) . '`', $uri, $params );\n\n\t\t\t// Compiling and matching regular expressions is relatively\n\t\t\t// expensive, so try and match by a substring first\n\t\t} else {\n\t\t\t$route = null;\n\t\t\t$regex = false;\n\t\t\t$j = 0;\n\t\t\t$n = isset( $_route[ $i ] ) ? $_route[ $i ] : null;\n\n\t\t\t// Find the longest non-regex substring and match it against the URI\n\t\t\twhile ( true ) {\n\t\t\t\tif ( ! isset( $_route[ $i ] ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t} elseif ( false === $regex ) {\n\t\t\t\t\t$c = $n;\n\t\t\t\t\t$regex = $c === '[' || $c === '(' || $c === '.';\n\t\t\t\t\tif ( false === $regex && false !== isset( $_route[ $i + 1 ] ) ) {\n\t\t\t\t\t\t$n = $_route[ $i + 1 ];\n\t\t\t\t\t\t$regex = $n === '?' || $n === '+' || $n === '*' || $n === '{';\n\t\t\t\t\t}\n\t\t\t\t\tif ( false === $regex && $c !== '/' && ( ! isset( $uri[ $j ] ) || $c !== $uri[ $j ] ) ) {\n\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t}\n\t\t\t\t\t$j ++;\n\t\t\t\t}\n\t\t\t\t$route .= $_route[ $i ++ ];\n\t\t\t}\n\n\t\t\t// Check if there's a cached regex string\n\t\t\t$regex = wp_cache_get( \"route:$route\", 'klein' );\n\t\t\tif ( false === $regex ) {\n\t\t\t\t$regex = klein_compile_route( $route );\n\t\t\t\twp_cache_set( \"route:$route\", $regex,'klein' );\n\t\t\t}\n\n\t\t\t$match = preg_match( $regex, $uri, $params );\n\t\t}\n\n\t\tif ( isset( $match ) && $match ^ $negate ) {\n\t\t\t// Keep track of possibly matched methods\n\t\t\t$methods_matched = array_merge( $methods_matched, (array) $method );\n\t\t\t$methods_matched = array_filter( $methods_matched );\n\t\t\t$methods_matched = array_unique( $methods_matched );\n\n\t\t\tif ( $possible_match ) {\n\t\t\t\tif ( null !== $params ) {\n\t\t\t\t\t$_REQUEST = array_merge( $_REQUEST, $params );\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tcall_user_func( $callback, $request, $response, $app, $matched, $methods_matched );\n\t\t\t\t}\n\t\t\t\tcatch ( Exception $e ) {\n\t\t\t\t\t$response->error( $e );\n\t\t\t\t}\n\t\t\t\tif ( $_route !== '*' ) {\n\t\t\t\t\t$count_match && ++ $matched;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $matched && count( $methods_matched ) > 0 ) {\n\t\t$response->code( 405 );\n\t\t$response->header( 'Allow', implode( ', ', $methods_matched ) );\n\t} elseif ( ! $matched ) {\n\t\t$response->code( 404 );\n\t}\n\n\tif ( $capture ) {\n\t\tif ( $passthru && $matched == 0 ) {\n\t\t\tob_end_clean();\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ob_get_clean();\n\t} elseif ( $response->chunked ) {\n\t\t$response->chunk();\n\t} else {\n\t\tob_end_flush();\n\t}\n}",
"function canHandleRequest() ;",
"public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }",
"public function getRequestHandler(): RequestHandlerInterface;",
"public function Matches (\\MvcCore\\IRequest $request);",
"public function setRequestOnHandler($request)\n {\n }",
"public function register()\n {\n $this->reportable(function (Throwable $e) {\n });\n\n $this->renderable(function (Exception $e, Request $request) {\n if ($request->wantsJson()) {\n return $this->handleException($request, $e);\n }\n });\n }",
"public function register()\n {\n //前端响应对象\n $this->app->bind('ApiResponse', function() {\n return new ApiResponse();\n });\n }",
"public function register()\n {\n //register_shutdown_function(array($this, 'shutdown'));\n return set_error_handler(array($this, 'handle'));\n }",
"public function handle(Request $foundationRequest, Closure $next): Response\n {\n $psr7Request = $this->getPsr7Request($foundationRequest);\n $nextAdapted = $this->getNextExecutionHandlerAdapter($foundationRequest, $next);\n\n $response = $this->psr15Middleware->process($psr7Request, $nextAdapted);\n\n return $this->getResponse($response);\n }",
"public function register(Request $request)\n {\n $this->registerValidator();\n //极验验证\n $request->offsetSet('geetest_challenge', $request->input('verify'));\n $this->validator($request->all())->validate();\n //最后验证短信码\n if ($request->get('model') != 'email') {\n Validator::make($request->all(), [\n 'mobile_phone_code' => 'required|sms_code:mobile_phone' //短信验证码\n ], [\n 'mobile_phone_code.sms_code' => '短信验证码验证失败'\n ], [\n 'mobile_phone_code' => '短信验证码'\n ])->validate();\n }\n event(new Registered($user = $this->create($request->all())));\n if ($request->get('model') != 'email') {\n $this->guard()->login($user);\n //用户数据记录\n app('user.logic')->loginCacheInfo();\n }\n return $this->registered($request, $user)\n ?: orRedirect($this->redirectPath());\n }",
"function klein_dispatch_or_continue( $uri = null, $req_method = null, array $params = null ) {\n\t$found = klein_dispatch( $uri, $req_method, $params, true, true );\n\tif ( $found ) {\n\t\t$dieCallback = null;\n\n\t\tif ( function_exists( 'apply_filters' ) ) {\n\t\t\t/**\n\t\t\t * Filters the die (output) handler to use when a route is matched.\n\t\t\t *\n\t\t\t * @since 1.0.3\n\t\t\t *\n\t\t\t * Use the special value \"echo \"To just echo the result and return, e.g.:\n\t\t\t *\n\t\t\t * add_filter('klein_die_handler', function(){\n\t\t\t * return 'echo';\n\t\t\t * });\n\t\t\t *\n\t\t\t * @params callabe $handler The function that will be called to output the request; default `die`\n\t\t\t */\n\t\t\t$dieCallback = apply_filters( 'klein_die_handler', null );\n\t\t}\n\n\t\tswitch ( $dieCallback ) {\n\t\t\tcase 'echo':\n\t\t\t\techo $found;\n\n\t\t\t\treturn;\n\t\t\tcase null:\n\t\t\t\tdie ( $found );\n\t\t\tdefault:\n\t\t\t\treturn $dieCallback( $found );\n\t\t}\n\t}\n}",
"protected function dispatchToRouter()\n {\n return function ($request) {\n return $this->router->setApplication($this->app)->dispatch($request);\n };\n }",
"protected static function register() {}",
"public function getDispatcher($user_request_destination){\n $this->user_request_destination = $user_request_destination; \n }",
"public function register() {}",
"public function register()\n {\n $this->app->when(Controller::class)\n ->needs(SRP::class)\n ->give(function ($app) {\n $config = $app['config']->get('srp');\n\n return new SRP(\n new Server(Config::fromArray($config)),\n $app['cache.store'],\n $config['ttl']\n );\n });\n }",
"function klein_respond( $method, $route = '*', $callback = null ) {\n\tglobal $__klein_routes, $__klein_namespace;\n\n\t$args = func_get_args();\n\t$callback = array_pop( $args );\n\t$route = array_pop( $args );\n\t$method = array_pop( $args );\n\n\tif ( null === $route ) {\n\t\t$route = '*';\n\t}\n\n\t// only consider a request to be matched when not using matchall\n\t$count_match = ( $route !== '*' );\n\n\tif ( $__klein_namespace && $route[0] === '@' || ( $route[0] === '!' && $route[1] === '@' ) ) {\n\t\tif ( $route[0] === '!' ) {\n\t\t\t$negate = true;\n\t\t\t$route = substr( $route, 2 );\n\t\t} else {\n\t\t\t$negate = false;\n\t\t\t$route = substr( $route, 1 );\n\t\t}\n\n\t\t// regex anchored to front of string\n\t\tif ( $route[0] === '^' ) {\n\t\t\t$route = substr( $route, 1 );\n\t\t} else {\n\t\t\t$route = '.*' . $route;\n\t\t}\n\n\t\tif ( $negate ) {\n\t\t\t$route = '@^' . $__klein_namespace . '(?!' . $route . ')';\n\t\t} else {\n\t\t\t$route = '@^' . $__klein_namespace . $route;\n\t\t}\n\t} // empty route with namespace is a match-all\n\telseif ( $__klein_namespace && ( '*' === $route ) ) {\n\t\t$route = '@^' . $__klein_namespace . '(/|$)';\n\t} else {\n\t\t$route = $__klein_namespace . $route;\n\t}\n\n\t$__klein_routes[] = array( $method, $route, $callback, $count_match );\n\n\treturn $callback;\n}",
"abstract function __invoke(RequestInterface $request, ResponseInterface $response, callable $next);",
"public function checkRegistryRequestsAnswers()\n {\n return true;\n }",
"public function match(ServerRequestInterface $request):Result;",
"public function register()\n {\n $this->registered = true;\n\n return $this->registrar->register(\n $this->name, $this->controller, $this->options\n );\n }",
"public function process(HTTPRequest $request, callable $delegate)\n {\n /** @var HTTPResponse $response */\n $response = $delegate($request);\n\n // Ignore by regexes.\n if ($this->shouldCheckHttpHost() && $this->isIgnoredDomain($_SERVER['HTTP_HOST'])) {\n return $response;\n }\n\n foreach ($this->requestedPolicies as $requestedPolicy) {\n /** @var ControllerPolicy $policyInstance */\n $policyInstance = $requestedPolicy['policy'];\n\n $policyInstance->applyToResponse(\n $requestedPolicy['originator'],\n $request,\n $response\n );\n }\n\n return $response;\n }",
"public function handled($rt = '')\n {\n $uriSegmentsInThisRoute = explode('/', $this->urlToMatch);\n $uriSegmentsInRequestedRoute = explode('/', $rt);\n\n if (count($uriSegmentsInRequestedRoute) == count($uriSegmentsInThisRoute)) {\n $thisUrlUpToFirstDollarSign = explode('/$',$this->urlToMatch)[0];\n $numberOfSegmentsUpToFirstDollarSign = count( explode('/',$thisUrlUpToFirstDollarSign) );\n $theyMatch = true;\n for( $i=0; $i<$numberOfSegmentsUpToFirstDollarSign; $i++ ) {\n if ( strcmp($uriSegmentsInThisRoute[$i],$uriSegmentsInRequestedRoute[$i]) <> 0 ) {\n $theyMatch = false;\n break;\n }\n }\n\n if ( $theyMatch ) {\n if ($this->processMiddleWare()==true) {\n // have to explode these two again, in case middleware changed anything\n $uriSegmentsInThisRoute = explode('/',$this->urlToMatch);\n $uriSegmentsInRequestedRoute = explode('/', $rt);\n $NumberOfParams = count(explode('$',$this->urlToMatch)) - 1;\n $params = array();\n for ($i = count($uriSegmentsInThisRoute) - $NumberOfParams; $i < count($uriSegmentsInThisRoute); $i++) {\n $params[] = $uriSegmentsInRequestedRoute[$i];\n }\n \\ipinga\\log::ipinga('Route {'. $this->identifier .'} ('. $this->urlToMatch. ') fired!');\n self::launchController($this->controller, $this->method, $params);\n $this->fired = true;\n return true;\n } else {\n \\ipinga\\log::ipinga('Route {'. $this->identifier .'} middcleware refused');\n }\n }\n\n }\n\n return false;\n\n }",
"public function register()\n {\n $this->reportable(function (Throwable $e) {\n if (request()->is(\"api/*\")) {\n request()->headers->set('Accept', 'application/json', true);\n $this->handelException($e);\n }\n });\n }",
"function rest_dispatch_requests( $response, $request ) {\n\t$attributes = $request->get_attributes();\n\tlist( $callback_class, $callback_func ) = ( ! empty( $attributes['callback'] ) ) ? $attributes['callback'] : [];\n\n\t// If the request is using the WP_REST_Posts_Controller, call the same callback from our custom controller.\n\tif (\n\t\tis_object( $callback_class )\n\t\t&& get_class( $callback_class ) === 'WP_REST_Posts_Controller'\n\t\t&& ( $callback_func === 'create_item' || $callback_func === 'update_item' )\n\t) {\n\t\t$controller = new REST_Posts_Controller( get_post_type( $request->get_params()['id'] ) );\n\n\t\treturn call_user_func( [ $controller, $callback_func ], $request );\n\t}\n\n\treturn $response;\n}",
"public function dispatch(): ResponseInterface\n {\n if(!isset($this->current_route)){\n $this->current_route = $this->resolve($this->current_method, $this->current_url);\n }\n\n $hasRoute = isset($this->current_route) && !empty($this->current_route);\n\n if($hasRoute === FALSE){\n return $this->notFound();\n }\n\n $route = $this->current_route;\n $arguments = $route['arguments'] ?? [];\n \\define('INITPHP_ROUTER_CURRENT_ARGUMENTS', $arguments);\n\n $filters = [\n 'before' => [],\n 'after' => [],\n ];\n if(isset($route['options']['middleware']['before'])){\n $filters['before'] = $route['options']['middleware']['before'];\n unset($route['options']['middleware']['before']);\n }\n if(isset($route['options']['middleware']['after'])){\n $filters['after'] = $route['options']['middleware']['after'];\n unset($route['options']['middleware']['after']);\n }\n if(isset($route['options']['middleware']) && !empty($route['options']['middleware'])){\n $filters['before'] = \\array_merge($route['options']['middleware'], $filters['before']);\n $filters['after'] = \\array_merge($route['options']['middleware'], $filters['after']);\n unset($route['options']['middleware']);\n }\n\n $this->middleware_handle($filters['before'], $arguments, self::BEFORE);\n $responseStatusCode = (int)$this->response->getStatusCode();\n if($responseStatusCode < 200 || $responseStatusCode > 299){\n return $this->response;\n }\n if ($route['methods'] === ['LINK']) {\n return $this->execute($route['execute'], $arguments, self::LINK);\n } else {\n if(\\is_callable($route['execute'])){\n \\define('INITPHP_ROUTER_CURRENT_CONTROLLER', '__CALLABLE__');\n \\define('INITPHP_ROUTER_CURRENT_METHOD', '');\n $this->response = $this->execute($route['execute'], $arguments);\n }else{\n $parse = $this->getControllerMethod($route['execute'], $route['options']);\n $parse['controller'] = $this->controllerFind($parse['controller']);\n $reflection = new \\ReflectionClass($parse['controller']);\n $controller = $this->getClassContainer($reflection);\n $this->middleware_handle($this->controller_middlewares_property($controller, $parse['method'], self::BEFORE), $arguments, self::BEFORE);\n \\define('INITPHP_ROUTER_CURRENT_CONTROLLER', \\get_class($controller));\n \\define('INITPHP_ROUTER_CURRENT_METHOD', $parse['method']);\n $responseStatusCode = (int)$this->response->getStatusCode();\n if($responseStatusCode < 200 || $responseStatusCode > 299){\n return $this->response;\n }\n $this->response = $this->execute([$controller, $parse['method']], $arguments);\n $after_middleware = $this->controller_middlewares_property($controller, $parse['method'], self::AFTER);\n if(!empty($after_middleware)){\n $filters['after'] = \\array_merge($filters['after'], $after_middleware);\n }\n }\n }\n\n $this->middleware_handle($filters['after'], $arguments, self::AFTER);\n\n return $this->response;\n }",
"public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next): ResponseInterface\n\t{\n\t\tif ($this->isWhitelisted($request)) {\n\t\t\treturn $next($request, $response);\n\t\t}\n\n\t\t$user = $this->authenticator->authenticate($request);\n\n\t\t// If we have a identity, then go to next middlewares,\n\t\t// otherwise stop and return current response\n\t\tif ($user === null) {\n\t\t\treturn $this->denied($request, $response);\n\t\t}\n\n\t\t// Add info about current logged user to request attributes\n\t\t$request = $request->withAttribute(RequestAttributes::APP_LOGGED_USER, $user);\n\n\t\t// Pass to next middleware\n\t\treturn $next($request, $response);\n\t}",
"private function execute(ServerRequestInterface $request) : ResponseInterface\n {\n $result = $this->container->getRouter()->resolve($request);\n $stack = $this->middleware;\n\n if ($result->isMatch()) {\n $stack = array_merge($stack, $result->getRoute()->getStack());\n }\n\n if ($result->isNotFound()) {\n $stack = array_merge($stack, [$this->container->getNotFoundController()]);\n }\n\n if ($result->isNotAllowed()) {\n $stack = array_merge($stack, [$this->container->getNotAllowedController()]);\n }\n\n $stack = new Stack($this->container->getDefaultController(), $stack);\n\n $request = $this->container->getRequest();\n $request = $request->withAttribute(static::ROUTE, $result->getRoute());\n $request = $request->withAttribute(static::ROUTE_STATUS, $result->getStatus());\n $request = $request->withAttribute(static::ROUTE_PARAMS, $result->getParams());\n\n return $stack->handle($request);\n }",
"public function onMatchRequest(GetResponseEvent $event)\n {\n $this->matcher->matches($event->getRequest());\n }",
"function register()\n\t{\n\t\tset_error_handler(array($this,'_handleError'));\n\t\tset_exception_handler(array($this,'_handleException'));\n\t\tregister_shutdown_function(array($this,'_shutdown'));\n\t\t$this->_registered = true;\n\t\treturn $this;\n\t}",
"public function resolve(): void\n {\n $path = $this->request->path();\n $method = $this->request->method();\n $handler = $this->routes[$method][$path] ?? false;\n\n if (!$handler) {\n $this->response->showNotFoundPage();\n return;\n }\n\n [$controller, $method] = $handler;\n\n (new $controller())->$method($this->request);\n }",
"public function register()\n {\n Paginator::currentPageResolver(function ($pageName = 'page') {\n\n $keeper = $this->app->make('keeper', [$this->app['request']->path()]);\n\n if ($this->app['request']->has($pageName)) {\n\n $currentPage = $this->app['request']->input($pageName);\n\n //Persisto o pagina corrente\n $keeper->keep([$pageName => $currentPage]);\n\n return $currentPage;\n }\n\n //Utilizo o pagina persistida em algum momento anterior.\n $currentPage = $keeper->get($pageName);\n\n //Ou retorno 1\n return $currentPage ?: 1;\n });\n }",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function register();",
"public function GetDelegate($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }",
"public function handlerNeedsRequest()\n {\n }",
"public function onRequest(ReactRequest $request, ReactResponse $response)\n {\n if ($this->middleware === null) {\n return;\n }\n\n $psr7Request = $this->mapRequest($request);\n\n $middleware = $this->middleware;\n\n $initialResponse = new DiactorosResponse;\n $psr7Response = $middleware($psr7Request, $initialResponse);\n\n $this->mapResponse($psr7Response, $response);\n }",
"public function register()\n {\n self::$beforeFilterName = self::getFullPackageName('request', '.');\n self::$afterFilterName = self::getFullPackageName('response', '.');\n\n // Register the config file\n $this->app['config']->package(self::getFullPackageName(), $this->getPackagePath('config'));\n\n // Register the filters\n $this->app['router']->filter(self::$beforeFilterName, 'Wowe\\Cache\\Response\\BeforeFilter');\n $this->app['router']->filter(self::$afterFilterName, 'Wowe\\Cache\\Response\\AfterFilter');\n\n // Register the 'router.matched' event\n $this->app['router']->matched(function (Route $route, Request $request) {\n $this->routerMatchedCallback($route, $request);\n });\n }",
"public function register()\n {\n $container = $this->getContainer();\n $container->add(Request::class, Request::createFromGlobals());\n $container->add(Response::class, new Response());\n }",
"public function testPostHandleReturn()\n {\n $catch = true;\n $request = Request::create('/foo', 'GET');\n $regularResponse = new Response();\n $postResponse = new Response();\n\n $httpCache = $this->getHttpCachePartialMock(['lookup']);\n $testListener = new TestListener($this, $httpCache, $request);\n $testListener->postHandleResponse = $postResponse;\n $httpCache->addSubscriber($testListener);\n $httpCache\n ->expects($this->any())\n ->method('lookup')\n ->with($request)\n ->will($this->returnValue($regularResponse))\n ;\n\n $this->assertSame($postResponse, $httpCache->handle($request, HttpKernelInterface::MASTER_REQUEST, $catch));\n $this->assertEquals(1, $testListener->preHandleCalls);\n $this->assertEquals(1, $testListener->postHandleCalls);\n }",
"public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }",
"abstract public function register();",
"abstract public function register();",
"abstract public function register();",
"public function registerRequestPlugins()\n {\n $this->registerPlugin(new \\Jaxon\\Request\\Plugin\\CallableObject(), 101);\n $this->registerPlugin(new \\Jaxon\\Request\\Plugin\\UserFunction(), 102);\n $this->registerPlugin(new \\Jaxon\\Request\\Plugin\\BrowserEvent(), 103);\n $this->registerPlugin(new \\Jaxon\\Request\\Plugin\\FileUpload(), 104);\n }",
"function register()\n {\n //Create the validators\n $tickerValidator = Validator::regex('/[A-Z]{2,4}[:][A-Z]{2,10}/')\n ->noWhitespace()->length(1, 14);\n $validators = array('ticker' => $tickerValidator);\n $middleware = new \\DavidePastore\\Slim\\Validation\\Validation($validators);\n return $middleware;\n }",
"public function match(Request $request)\n {\n }",
"public function DispatchRequest ();",
"public function testRequestResponseStrategyRouteRequestFromServiceProvider()\n {\n\n $container = new Container();\n\n //Build mock provider\n $provider = $this->getMock('League\\Container\\ServiceProvider');\n\n $provider->expects($this->any())\n ->method('provides')\n ->will($this->returnCallback(function() {\n $args = func_get_args();\n return $args[0] === 'Symfony\\Component\\HttpFoundation\\Request';\n }));\n\n $provider->expects($this->once())\n ->method('register')\n ->will($this->returnCallback(function() use ($container) {\n $container->add('Symfony\\Component\\HttpFoundation\\Request', null, true)->withArguments([['get' => 4], ['post' => 5]]);\n }));\n\n $container->addServiceProvider($provider);\n\n $collection = new Route\\RouteCollection($container);\n $collection->setStrategy(new RequestResponseStrategy);\n\n $collection->get('/route', function ($request, $response) {\n $this->assertEquals(4, $request->query->get('get'));\n $this->assertEquals(5, $request->request->get('post'));\n return $response;\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route');\n\n }",
"protected function registeredDomain()\n {\n }",
"protected function registeringDomain()\n {\n }",
"public function resolve() : mixed\n {\n $method = $this->request->getMethod();\n $url = $this->request->getUrl();\n $callback = $this->routeMap[$method][$url] ?? false;\n if (!$callback) {\n\n $callback = $this->getCallback();\n\n if ($callback === false) {\n throw new NotFoundException();\n }\n }\n if (is_string($callback)) {\n return $this->renderView($callback);\n }\n if (is_array($callback)) {\n /**\n * @var $controller \\kingstonenterprises\\app\\Controller\n */\n $controller = new $callback[0];\n $controller->action = $callback[1];\n Application::$app->controller = $controller;\n /*$middlewares = $controller->getMiddlewares();\n foreach ($middlewares as $middleware) {\n $middleware->execute();\n }*/\n $callback[0] = $controller;\n }\n return call_user_func($callback, $this->request, $this->response);\n }",
"public function __invoke(Request $request): Response;",
"private static function runDispatcher()\n {\n if (self::$groupHalt || self::$halts) {\n return;\n }\n $uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $method = $_SERVER['REQUEST_METHOD'];\n $searches = array_keys(static::$patterns);\n $replaces = array_values(static::$patterns);\n $found_route = false;\n\n self::$routes = str_replace('//', '/', self::$routes);\n // Check if route is defined without regex\n\n if (in_array($uri, self::$routes)) {\n $route_pos = array_keys(self::$routes, $uri);\n foreach ($route_pos as $route) {\n // Using an ANY option to match both GET and POST requests\n if (self::$methods[$route] === $method || self::$methods[$route] === 'ANY') {\n //dd(preg_match('#^' . $route . '$#', $uri, $matched));\n\n // If route is not an object\n if (!is_object(self::$callbacks[$route])) {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n // Grab all parts based on a / separator\n $parts = explode('/', self::$callbacks[$route]);\n\n // Collect the last index of the array\n $last = end($parts);\n\n // Grab the controller name and method call\n $segments = explode('@', $last);\n\n if (count($segments) >= 2) {\n // Instanitate controller\n $controller = new $segments[0]();\n\n // Call method\n $controller->{$segments[1]}();\n } else {\n Viewer::file(self::$callbacks[$route]);\n }\n\n if (self::$halts) {\n return true;\n }\n } else {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n // Call closure\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n if (is_object(self::$callbacks[$route])) {\n call_user_func(self::$callbacks[$route]);\n } else {\n Viewer::file(self::$callbacks[$route]);\n }\n\n if (self::$halts) {\n return true;\n }\n }\n }\n }\n } else {\n // Check if defined with regex\n $pos = 0;\n foreach (self::$routes as $route) {\n if (strpos($route, ':') !== false) {\n $route = str_replace($searches, $replaces, $route);\n }\n\n if (preg_match('#^'.$route.'$#', $uri, $matched)) {\n if (self::$methods[$pos] === $method || self::$methods[$pos] === 'ANY') {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n // Remove $matched[0] as [1] is the first parameter.\n array_shift($matched);\n if (!is_object(self::$callbacks[$pos])) {\n // Grab all parts based on a / separator\n $parts = explode('/', self::$callbacks[$pos]);\n // Collect the last index of the array\n $last = end($parts);\n // Grab the controller name and method call\n $segments = explode('@', $last);\n // Instanitate controller\n $controller = new $segments[0]();\n\n // Fix multi parameters\n if (!method_exists($controller, $segments[1])) {\n //\"controller and action not found\"\n Debugger::report(500);\n } else {\n call_user_func_array([$controller, $segments[1]], $matched);\n }\n if (self::$halts) {\n return;\n }\n } else {\n self::haltOnMatch();\n $found_route = true;\n self::$currentURI = $uri;\n\n if (self::$isGroup) {\n self::$groupHalt = true;\n self::$groupController->{self::$groupMethodName}();\n }\n\n call_user_func_array(self::$callbacks[$pos], $matched);\n if (self::$halts) {\n return;\n }\n }\n } else {\n // continue searching\n }\n }\n $pos++;\n }\n }\n\n // Tell if there is no found grouped routes\n return false;\n }",
"public function handle($request, Closure $next)\n {\n return Event::fire('interceptor.response', $next(Event::fire('interceptor.request', $request)));\n }",
"public function register()\n {\n $this->reportable(function (Throwable $e) {\n //\n });\n\n $this->renderable(function (Throwable $e, $request) {\n // if user is unauthenticated\n if($e instanceof AuthenticationException && $request->expectsJson()){\n return response()->json([\n 'alertType' => 'user-unauthenticated',\n 'message' => 'You are unauthenticated.'\n ], 401);\n }\n // if user exceeds the maximum number of attempt\n if($e instanceof ThrottleRequestsException && $request->expectsJson()){\n return response()->json([\n 'alertType' => 'too-many-attempts',\n 'message' => 'You have exceeded the maximum number of attempts. Please try again later.'\n ], 403);\n }\n // checks for maintainance mode\n if($e instanceof HttpException && $request->expectsJson()){\n return response()->json([\n 'alertType' => 'app-in-maintainance',\n 'message' => 'Our application is in maintainance mode. Try after some time.'\n ], 503);\n }\n });\n }"
] | [
"0.5440251",
"0.54181397",
"0.53108764",
"0.5298159",
"0.522541",
"0.5220224",
"0.5145059",
"0.49789953",
"0.49622056",
"0.4955322",
"0.49288097",
"0.49129012",
"0.49034882",
"0.48739567",
"0.4866702",
"0.48639566",
"0.48557666",
"0.48439378",
"0.48427862",
"0.48077685",
"0.4786986",
"0.4786986",
"0.47844973",
"0.4741741",
"0.47369102",
"0.47314513",
"0.47314513",
"0.47314513",
"0.47314513",
"0.47303063",
"0.4727773",
"0.4699529",
"0.4699529",
"0.4694311",
"0.46930087",
"0.46801186",
"0.4677253",
"0.46630543",
"0.4650715",
"0.46499804",
"0.46362773",
"0.4624911",
"0.46125877",
"0.46115485",
"0.4609768",
"0.46059814",
"0.4604905",
"0.4598796",
"0.4593947",
"0.45929056",
"0.45926204",
"0.45898917",
"0.45848078",
"0.45816278",
"0.45805848",
"0.4576691",
"0.45758587",
"0.45726147",
"0.45646727",
"0.4556017",
"0.4550961",
"0.4548228",
"0.45475706",
"0.45427394",
"0.45406893",
"0.45355207",
"0.452985",
"0.45274442",
"0.450272",
"0.44962528",
"0.44946638",
"0.44910097",
"0.44910097",
"0.44910097",
"0.44910097",
"0.44910097",
"0.44910097",
"0.44910097",
"0.44910097",
"0.44900516",
"0.44880205",
"0.44868186",
"0.44806388",
"0.4479924",
"0.44763666",
"0.4469784",
"0.44665024",
"0.44665024",
"0.44665024",
"0.44639727",
"0.44509417",
"0.4447077",
"0.4438627",
"0.44383612",
"0.4433685",
"0.44274586",
"0.44233924",
"0.4422502",
"0.44190696",
"0.44189787",
"0.44175777"
] | 0.0 | -1 |
Perform (construct and send) a GET request on the given url, with optional body and headers | static function get($url, $body = null, $headers = array()) {
$request = new NiceHTTP\GetRequest($url, $body, $headers);
return $request->send();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($url, $query = array(), $headers = array());",
"public function get ($url, $headers = null, $options = null);",
"function httpGET($url = '/', $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n ($headers = trim($headers)) === '' or $headers .= \"\\r\\n\";\n\n // Note: in HTTP/1.1 Connection defaults to Keep Alive which will keep\n // the connection hanging unless you send 'Connection: close'. Its output\n // also changes due to chunked transfer encoding.\n $headers = \"GET $url HTTP/1.0\\r\\n\".\n $headers.\"\\r\\n\";\n\n $this->write($headers);\n return $this->readAll();\n }",
"public function get(string $url, array $input = [], $headers = null);",
"function curl_get($url, array $get = NULL, array $headers = NULL, array $options = array()) { \n $defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 4,\n $headers\n ); \n \n $ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults));\n \n if ( ! $result = curl_exec($ch)) { \n trigger_error(curl_error($ch)); \n } \n curl_close($ch); \n return $result; \n}",
"public function makeRequest( $url, $method = 'GET', $headers = null );",
"public function execGET($url, $params = []){\n\t\t#Parse URL params\n\t\t$url = $this->parseURL($url, $params);\n\t\t#Initialize a CURL session. \n\t\t$ch = curl_init();\n\t\t#Set body (empty on GET)\n\t\t$curlBody = json_encode([]);\n\t\t#Set curl headers\n\t\t$curlHeaders = [\n\t\t\t'User-Agent: ' . $this->getRandAgent(), #Set the user agent with a random-selected real one\n\t\t];\n\t\t#Set CURL options\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders); #Set headers\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); #Retrieve output instead of displaying it\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 30); #Set timeout to 30 seconds\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); #Disable SSL host verification\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); #Disable SSL peer verification\n\t\tcurl_setopt($ch, CURLOPT_URL, $url); #Set URL\n\t\t#Return raw CURL request output\n\t\treturn curl_exec($ch);\n\t}",
"public function get($url, $params);",
"public function get( $url, array $headers=array() ) {\n return $this->httpRequest( $url, 'GET', $headers );\n }",
"public function get ( $url, $params=[] )\n {\n $param_string = $this->buildParamString( $params );\n $url = $url . $param_string;\n\n $this->init( $url );\n\n $options = [\n CURLOPT_FAILONERROR => true,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_USERAGENT => 'fake'\n ];\n\n $this->setOptions( $options );\n }",
"private function GET($url,$params=false){\n return $this->Request($url,$params,HTTP_GET);\n }",
"function get($url, $args = array()) {\n\t\t$defaults = array('method' => 'GET');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}",
"function get($url, $options = array()) {\n\t\treturn $this->request($url, $options);\n\t}",
"public function get($requestUrl, array $requestParams = [], array $requestHeaders = []);",
"public function request_get($uri, array $options = array()) {\n $options['method'] = 'GET';\n return $this->request($uri, $options);\n }",
"public function get($url) {\n $request = $this->getRequest($url, HttpRequest::METH_GET);\n try {\n // this could be parametrized using optional options interface\n $options = array(\n 'useragent' => \"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; MS-RTC LM 8)\",\n 'connecttimeout' => 120, // timeout in seconds on connect \n 'timeout' => 120, // timeout in seconds on response \n 'redirect' => 5, // stop after 5 redirects\n 'compress' => true, // allow compression or not\n 'referer' => \"https://www.google.com/#output=search&sclient=psy-ab&q=jachty&fp=1\",\n );\n $request->setOptions($options);\n $request->send();\n } catch (Exception $e) {\n throw new Exception('Loading failed with exception', $request->getResponseCode(), $e);\n }\n $code = $request->getResponseCode();\n $body = $request->getResponseBody();\n\n // make sure we did not fail\n if ($code >= 500) {\n throw new Exception('Error response code recieved: ' . $body, $code);\n } elseif ($code >= 400) {\n throw new Exception('Permanent failure' . $body, $code);\n } elseif (trim($body) == '') {\n throw new Exception('Empty response', $code);\n }\n\n return $body;\n }",
"function curl_get($url, $get = false, $options = array()) { \n $defaults = array(\n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : '') . (is_array($get) ? http_build_query($get) : ''),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4,\n\t\tCURLOPT_FOLLOWLOCATION => true\n );\n \n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}",
"public function get($url);",
"private function get($url = '', $headers = [])\n {\n $settings = [\n 'http_errors' => false,\n 'headers' => $headers\n ];\n $client = new Client;\n $request = $client->request('GET', $url, $settings);\n return $request;\n }",
"public function request($url);",
"function Get( $url )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Get( $url )\\n\";\r\n\t\t$this->responseHeaders = $this->responseBody = \"\";\r\n\t\t$uri = $this->makeUri( $url );\r\n\t\t\r\n\t\tif( $this->sendCommand( \"GET $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}",
"private function do_get_request($ch,$url,$params=array()){ \n if(is_array($params) && count($params)>0){\n $url.='?';\n foreach($params as $key=>$val){\n $url.='&'.$key.'='.urlencode($val);\n }\n }\n $ch=curl_init();\n $timeout=5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n $result=curl_exec($ch);\n return $result;\n }",
"function http_get($url, ?array $options = null, ?array &$info = null) {}",
"public static function Get($url)\r\n {\r\n return self::doRequest('GET', $url);\r\n }",
"public function _get($url = null, $parameters = []);",
"public function get($url, $params = array(), $options = array())\n\t{\n\t\tif ( iterable($params) ) {\n\t\t\tif ( !preg_match('/\\?$/', $url) ) {\n\t\t\t\t$url .= '?';\n\t\t\t}\n\t\t\t\n\t\t\t$url .= http_build_query($params);\n\t\t}\n\t\t\n\t\t$options[CURLOPT_URL] = $url;\n\t\t$options[CURLOPT_RETURNTRANSFER] = array_ensure($options, CURLOPT_RETURNTRANSFER, 1);\n\t\t$options[CURLOPT_HEADER] = array_ensure($options, CURLOPT_HEADER, 0);\n\t\t$options[CURLOPT_USERAGENT] = array_ensure($options, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0');\n\t\t$options[CURLOPT_IPRESOLVE] = array_ensure($options, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);\n\t\t\n\t\t$curl = curl_init();\n\t\t\n\t\tcurl_setopt_array($curl, $options);\n\t\t\n\t\t$response = curl_exec($curl);\n\t\t\n\t\t//print_r(curl_getinfo($curl));\n\t\t\n\t\tif ( false === $response ) {\n\t\t\techo curl_error($curl);\n\t\t}\n\t\t\n\t\tcurl_close($curl);\n\t\t\n\t\treturn $response;\n\t}",
"function request( $url, $args = array() ) {\n\t\t$defaults = array(\n\t\t\t'method' => 'GET',\n\t\t\t'timeout' => 5,\n\t\t\t'redirection' => 5,\n\t\t\t'httpversion' => '1.0',\n\t\t\t'user-agent' => 'WP_Http',\n\t\t\t'blocking' => true,\n\t\t\t'headers' => array(),\n\t\t\t'cookies' => array(),\n\t\t\t'body' => null,\n\t\t\t'compress' => false,\n\t\t\t'decompress' => true,\n\t\t\t'sslverify' => true\n\t\t);\n\n\t\t$r = array_merge( $defaults, $args );\n\n\t\t$arrURL = parse_url($url);\n\n\t\t// Determine if this is a https call and pass that on to the transport functions\n\t\t// so that we can blacklist the transports that do not support ssl verification\n\t\tif ( $arrURL['scheme'] == 'https' || $arrURL['scheme'] == 'ssl' )\n\t\t\t$r['ssl'] = true;\n\t\telse\n\t\t\t$r['ssl'] = false;\n\n\t\tif ( is_null( $r['headers'] ) )\n\t\t\t$r['headers'] = array();\n\n\t\tif ( ! is_array($r['headers']) ) {\n\t\t\t$processedHeaders = WP_Http::processHeaders($r['headers']);\n\t\t\t$r['headers'] = $processedHeaders['headers'];\n\t\t}\n\n\t\tif ( isset($r['headers']['User-Agent']) ) {\n\t\t\t$r['user-agent'] = $r['headers']['User-Agent'];\n\t\t\tunset($r['headers']['User-Agent']);\n\t\t}\n\n\t\tif ( isset($r['headers']['user-agent']) ) {\n\t\t\t$r['user-agent'] = $r['headers']['user-agent'];\n\t\t\tunset($r['headers']['user-agent']);\n\t\t}\n\n\t\t// Construct Cookie: header if any cookies are set\n\t\tWP_Http::buildCookieHeader( $r );\n\n\t\tif( WP_Http_Encoding::is_available() )\n\t\t\t$r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();\n\n\t\tif ( is_null($r['body']) ) {\n\t\t\t// Some servers fail when sending content without the content-length\n\t\t\t// header being set.\n\t\t\t$r['headers']['Content-Length'] = 0;\n\t\t\t$transports = WP_Http::_getTransport($r);\n\t\t} else {\n\t\t\tif ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {\n\t\t\t\t$r['body'] = http_build_query($r['body'], null, '&');\n\t\t\t\t$r['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';\n\t\t\t\t$r['headers']['Content-Length'] = strlen($r['body']);\n\t\t\t}\n\n\t\t\tif ( ! isset( $r['headers']['Content-Length'] ) && ! isset( $r['headers']['content-length'] ) )\n\t\t\t\t$r['headers']['Content-Length'] = strlen($r['body']);\n\n\t\t\t$transports = WP_Http::_postTransport($r);\n\t\t}\n\n\t\t$response = array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );\n\t\tforeach( (array) $transports as $transport ) {\n\t\t\ttry {\n\t\t\t\t$response = $transport->request($url, $r);\n\t\t\t\treturn $response;\n\t\t\t} catch ( WP_Http_Exception $exception ) {\n\t\t\t\t// TODO: do anything?\n\t\t\t\tthrow $exception;\n\t\t\t}\n\t\t}\n\n\t\treturn $response;\n\t}",
"protected function Request($url)\n {\n $guzzle = new Client;\n\n return $guzzle->get($url, ['http_errors' => false]);\n }",
"public static function get($url, array $options = []) {\n $ch = curl_init();\n static::parse_query_params($url, $options);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPGET, true);\n static::parse_options($ch, $options);\n return static::parse_response(curl_exec($ch), $options);\n }",
"public function get($url, array $data = [], array $headers = [])\n {\n if (!empty($data)) {\n $url .= '?' . http_build_query($data);\n }\n \n return $this->sendRequest($url, 'GET', [], $headers);\n }",
"function request($url, $args = array()) {\n\t\t$defaults = array(\n\t\t\t'method' => 'GET', 'timeout' => 5,\n\t\t\t'redirection' => 5, 'httpversion' => '1.0',\n\t\t\t'blocking' => true,\n\t\t\t'headers' => array(), 'body' => null, 'cookies' => array()\n\t\t);\n\n\t\t$r = array_merge( $defaults, $args );\n\n\t\tif ( isset($r['headers']['User-Agent']) ) {\n\t\t\t$r['user-agent'] = $r['headers']['User-Agent'];\n\t\t\tunset($r['headers']['User-Agent']);\n\t\t} else if( isset($r['headers']['user-agent']) ) {\n\t\t\t$r['user-agent'] = $r['headers']['user-agent'];\n\t\t\tunset($r['headers']['user-agent']);\n\t\t}\n\n\t\t// Construct Cookie: header if any cookies are set\n\t\tWP_Http::buildCookieHeader( $r );\n\n\t\t$arrURL = parse_url($url);\n\n\t\tif ( false === $arrURL )\n\t\t\tthrow new WP_Http_Streams_Exception( 'Malformed URL: ' . $url );\n\n\t\tif ( 'http' != $arrURL['scheme'] && 'https' != $arrURL['scheme'] )\n\t\t\t$url = str_replace($arrURL['scheme'], 'http', $url);\n\n\t\t// Convert Header array to string.\n\t\t$strHeaders = '';\n\t\tif ( is_array( $r['headers'] ) )\n\t\t\tforeach( $r['headers'] as $name => $value )\n\t\t\t\t$strHeaders .= \"{$name}: $value\\r\\n\";\n\t\telse if ( is_string( $r['headers'] ) )\n\t\t\t$strHeaders = $r['headers'];\n\n\t\t$arrContext = array('http' =>\n\t\t\tarray(\n\t\t\t\t'method' => strtoupper($r['method']),\n\t\t\t\t'user_agent' => $r['user-agent'],\n\t\t\t\t'max_redirects' => $r['redirection'],\n\t\t\t\t'protocol_version' => (float) $r['httpversion'],\n\t\t\t\t'header' => $strHeaders,\n\t\t\t\t'timeout' => $r['timeout'],\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t\t'verify_peer' => $r['sslverify'],\n\t\t\t\t\t\t'verify_host' => $r['sslverify']\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t$proxy = new WP_HTTP_Proxy();\n\n\t\tif ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {\n\t\t\t$arrContext['http']['proxy'] = 'tcp://'.$proxy->host().':'.$proxy->port();\n\n\t\t\t// We only support Basic authentication so this will only work if that is what your proxy supports.\n\t\t\tif ( $proxy->use_authentication() ) {\n\t\t\t\t$arrContext['http']['header'] .= $proxy->authentication_header() . \"\\r\\n\";\n\t\t\t}\n\t\t}\n\n\t\tif ( ! is_null($r['body']) && ! empty($r['body'] ) )\n\t\t\t$arrContext['http']['content'] = $r['body'];\n\n\t\t$context = stream_context_create($arrContext);\n\n\t\tif ( ! defined('WP_DEBUG') || ( defined('WP_DEBUG') && false === WP_DEBUG ) )\n\t\t\t$handle = @fopen($url, 'r', false, $context);\n\t\telse\n\t\t\t$handle = fopen($url, 'r', false, $context);\n\n\t\tif ( ! $handle)\n\t\t\tthrow new WP_Http_Streams_Exception( 'Could not open handle for fopen() to ' . $url );\n\n\t\t// WordPress supports PHP 4.3, which has this function. Removed sanity checking for\n\t\t// performance reasons.\n\t\tstream_set_timeout($handle, $r['timeout'] );\n\n\t\tif ( ! $r['blocking'] ) {\n\t\t\tstream_set_blocking($handle, 0);\n\t\t\tfclose($handle);\n\t\t\treturn array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );\n\t\t}\n\n\t\t$strResponse = stream_get_contents($handle);\n\t\t$meta = stream_get_meta_data($handle);\n\n\t\tfclose($handle);\n\n\t\t$processedHeaders = array();\n\t\tif( isset( $meta['wrapper_data']['headers'] ) )\n\t\t\t$processedHeaders = WP_Http::processHeaders($meta['wrapper_data']['headers']);\n\t\telse\n\t\t\t$processedHeaders = WP_Http::processHeaders($meta['wrapper_data']);\n\n\t\tif ( ! empty( $strResponse ) && isset( $processedHeaders['headers']['transfer-encoding'] ) && 'chunked' == $processedHeaders['headers']['transfer-encoding'] )\n\t\t\t$strResponse = WP_Http::chunkTransferDecode($strResponse);\n\n\t\tif ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($processedHeaders) )\n\t\t\t$strResponse = WP_Http_Encoding::decompress( $strResponse );\n\n\t\treturn array('headers' => $processedHeaders['headers'], 'body' => $strResponse, 'response' => $processedHeaders['response'], 'cookies' => $processedHeaders['cookies']);\n\t}",
"private function sendGetRequest($url)\n {\n // Send the request and process the response\n $guzzleResponse = $this->client->request('GET', $url);\n $this->lastResponse = new SmartwaiverResponse($guzzleResponse);\n }",
"public function get($url, array $query = [], array $headers = [])\n {\n return $this->execute('GET', $this->buildGetUrl($url, $query), [], $headers);\n }",
"public function get($uri, array $headers = []): ResponseInterface;",
"protected function _doGet($in_url, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'GET', null, null, $in_additional_curl_options);\r\n }",
"public static function makeRequest($method, $url, array $headers = null, $body = null) {\n\t\t$options = [\n\t\t\t'http' => [\n\t\t\t\t'method' => $method\n\t\t\t]\n\t\t];\n\n\t\tif (isset($headers)) {\n\t\t\t$options['http']['header'] = $headers;\n\t\t}\n\n\t\tif (isset($body)) {\n\t\t\t$options['http']['content'] = $body;\n\t\t}\n\n\t\t$context = \\stream_context_create($options);\n\t\t$result = @\\file_get_contents($url, false, $context);\n\n\t\treturn $result;\n\t}",
"protected function get($url)\n {\n return Zttp::withHeaders([\n \"Content-Type\" => \"application/xml\",\n \"Authorization\" => $this->createAuthHeader(\"GET\",$url)\n ])->get($url);\n }",
"function http_get($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //curl_setopt($ch,CURLOPT_HEADER, false); \n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}",
"public function get(string $uri, array $params = [], array $headers = [], $sink = null): ResponseInterface;",
"public function request($method, $url, array $body = [], array $headers = [], $version = '1.1');",
"public static function request($url, $options = NULL)\n\t{\n\t\t$options = self::options($options);\n\t\t\n\t\t// Start Request\n\t\t$connection = curl_init($url);\n\t\t\n\t\t// Set Options\n\t\tcurl_setopt_array($connection,$options);\n\t\t\n\t\t// Execute request\n\t\t$result = curl_exec($connection);\n\n\t\t// Return body\n\t\treturn $result;\n\t}",
"function get (string $url, array $args = []): string {\n\t$append = '';\n\tif (count($args) > 0) {\n\t\t$append .= '/'.parseUrlGet($args);\n\t}\n\n\t$curlCall = curl_init($url.$append);\n\n\tcurl_setopt($curlCall, CURLOPT_RETURNTRANSFER, 1);\n\n\t$return = curl_exec($curlCall);\n\tcurl_close($curlCall);\n\n\treturn $return;\n}",
"public function get($url, $params = false, $options = false, $timeout = false)\n\t\t{\n\t\t\treturn $this->request($url, $params, self::GET, $options, $timeout);\n\t\t}",
"function httpGet($url){\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n// curl_setopt($ch,CURLOPT_HEADER, false);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}",
"public static function _call_get($url){\n $curl = curl_init();\n // Set curl opt as array\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n // No more than 30 sec on a website\n CURLOPT_TIMEOUT=>10,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n ));\n // Run curl\n $response = curl_exec($curl);\n //Check for errors \n if(curl_errno($curl)){\n $errorMessage = curl_error($curl);\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log error message .\n $return = array('success'=>FALSE,'error'=>$errorMessage,'status'=>$statusCode);\n } else {\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log success\n $return = array('success'=>TRUE,'response'=>$response,'status'=>$statusCode);\n }\n //close request\n curl_close($curl);\n //Return\n return $return;\n }",
"function http($url, $method = 'GET', $postfields = NULL, $headers = array()) {\n\t\t$ci = curl_init();\n\t\t/* Curl settings */\n\t\tcurl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n\t\tcurl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, array_merge(array('Expect:'),$headers));\n\t\tcurl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n\n\t\tswitch ($method) {\n\t\tcase 'POST':\n\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\t\tif (!empty($postfields)) {\n\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tif (!empty($postfields)) {\n\t\t\t\t$url = \"{$url}?{$postfields}\";\n\t\t\t}\n\t\t}\n\n\t\tcurl_setopt($ci, CURLOPT_URL, $url);\n\t\t$response = curl_exec($ci);\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ($ci);\n\t\treturn $response;\n\t}",
"public function get($url): ResponseInterface {\n return $this->httpClient->get($url, [\n 'headers' => $this->getDefaultHeaders(),\n ]);\n }",
"public function request($url, $params=array()){\n\t\t\n\t\t$this->_initRequest($url, $params);\n\t\t\n\t\t@curl_setopt($this->_curl, CURLOPT_RETURNTRANSFER, true);\n\t\t\n\t\t$response = curl_exec($this->_curl);\n\t\t\n\t\t$error = curl_error($this->_curl);\n\t\tif(!empty($error))\n\t\t\tthrow new \\Exception(\"curl error: \".$error);\n\t\t\n\t\treturn $response;\t\t\n\t}",
"function FetchURL($url, $options = array())\n\t{\n\t\t$timeout = 20;\n\t\tif (isset($options['timeout'])) { $timeout = $options['timeout']; }\n\n\t\t$curl_handler = curl_init();\n\n\t\tif (!empty($options['get_fields']))\n\t\t{\n\t\t\t$url_parameters = array();\n\t\t\tforeach($options['get_fields'] as $field => $value)\n\t\t\t{ $url_parameters[] = urlencode($field) . '=' . urlencode($value); }\n\n\t\t\t$url .= '?' . join('&', $url_parameters);\n\t\t}\n\n\t\tcurl_setopt($curl_handler, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl_handler, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl_handler, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t//curl_setopt($curl_handler, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\n\t\tif (!empty($options['post_array']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_POSTFIELDS, $options['post_array']);\n\t\t}\n\n\t\tif (!empty($options['auth_string']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_USERPWD, $auth_string);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\t\t\tcurl_setopt($curl_handler, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t}\n\t\t\n\t\tif (!empty($options['follow']))\n\t\t{\n\t\t\tcurl_setopt($curl_handler, CURLOPT_FOLLOWLOCATION, true);\n\t\t}\n\n\t\tif (!empty($options['headers'])) { curl_setopt($curl_handler, CURLOPT_HTTPHEADER, $headers); }\n\n\t\t$response = curl_exec($curl_handler);\n\t\tself::$status = curl_getinfo($curl_handler, CURLINFO_HTTP_CODE);\n\t\tcurl_close($curl_handler);\n\n\t\treturn $response;\n\t}",
"public function get($url, $data = array()) {\n\t\treturn $this->request($url, $data, false);\n\t}",
"function get( $url, $post = null, $auth = null, $progress = false, $timeout = 5, &$error = false, $options = array() ) {\n\n // Create CURL Object\n $CURL = curl_init();\n\n // By using array union we can pre-set/change options from function call\n $curl_opts = $options + array(\n CURLOPT_URL => $url,\n CURLOPT_TIMEOUT => $timeout,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_USERAGENT => 'Mozilla/5.0 (AIO Radio Station Player) AppleWebKit/537.36 (KHTML, like Gecko)',\n CURLOPT_FOLLOWLOCATION => ( ( ini_get( 'open_basedir' ) == false ) ? true : false ),\n CURLOPT_CONNECTTIMEOUT => ( ( $timeout < 6 && $timeout != 0 ) ? 5 : $timeout ),\n CURLOPT_REFERER => 'http' . ( ( $_SERVER[ 'SERVER_PORT' ] == 443 ) ? 's://' : '://' ) . $_SERVER[ 'HTTP_HOST' ] . strtok( $_SERVER[ 'REQUEST_URI' ], '?' ),\n CURLOPT_CAINFO => dirname( __FILE__ ) . '/bundle.crt'\n );\n\n\n // Post data to the URL (expects array)\n if ( isset( $post ) && is_array( $post ) ) {\n\n // Make every just simpler using custom array for options\n $curl_opts = $curl_opts + array(\n CURLOPT_POSTFIELDS => http_build_query( $post, '', '&' ),\n CURLOPT_POST => true,\n CURLOPT_FRESH_CONNECT => true,\n CURLOPT_FORBID_REUSE => true\n );\n\n }\n\n // Use HTTP Authorization\n if ( isset( $auth ) && !empty( $auth ) ) {\n\n $curl_opts = $curl_opts + array( CURLOPT_USERPWD => $auth );\n\n }\n\n // Call anonymous $progress_function function\n if ( $progress !== false && is_callable( $progress ) ) {\n\n $curl_opts = $curl_opts + array(\n CURLOPT_NOPROGRESS => false,\n CURLOPT_PROGRESSFUNCTION => $progress\n );\n\n }\n\n // Before executing CURL pass options array to the session\n curl_setopt_array( $CURL, $curl_opts );\n\n // Finally execute CURL\n $data = curl_exec( $CURL );\n\n // Parse ERROR\n if ( curl_error( $CURL ) ) {\n\n // This must be referenced in-memory variable\n $error = curl_error( $CURL );\n\n // Only works when writeLog function is available\n if ( function_exists( 'writeLog' ) )\n writeLog( 'errors', \"CURL Request \\\"{$url}\\\" failed! LOG: \" . curl_error( $CURL ), dirname( __FILE__ ) . '/./../tmp/logs/' );\n\n }\n\n // Close connection and return data\n curl_close( $CURL );\n return $data;\n\n }",
"public static function get($uri,$params=[],$options=[]) {\n return self::request('GET',$uri,$params,$options);\n }",
"private function request($url)\n {\n try {\n $res = $this->client->request('GET', $url);\n return $res->getBody();\n } catch (ConnectException $e) {\n $this->infos['messages'][] = \"Could not connect to the Jira's API's server\";\n $this->infos['errorBoolean'] = true ;\n } catch(ClientException $e){\n $this->infos['status'] = $e->getResponse()->getStatusCode();\n $this->infos['messages'][] = $e->getResponse()->getReasonPhrase();\n $this->infos['errorBoolean'] = true ;\n }\n }",
"public function get($uri = null, $headers = null, $body = null)\n {\n return $this->createRequest('GET', $uri, $headers, $body);\n }",
"function forwardGetRequest($url) {\n\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => $url,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t\tCURLOPT_HTTPHEADER => array(\"cache-control: no-cache\"),\n\t\t\tCURLOPT_SSL_VERIFYPEER => false\n\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\tif ($response === false) echo \"Bad response\";\n\n\t\tcurl_close($curl);\n\t\treturn $response;\n\n\t}",
"public static function request($method='GET',$uri,$params,$options=[]) { \n $ch = curl_init(); \n \n if (!isset($options['no_return'])) {\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n }\n \n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; CrawlBot/1.0.0)'); \n curl_setopt($ch, CURLOPT_ENCODING, \"\");\n curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); # required for https urls\n curl_setopt($ch, CURLOPT_MAXREDIRS, 15); \n \n if (isset($options['setopt']) && !empty($options['setopt'])) {\n foreach ($options['setopt'] as $k => $v) {\n curl_setopt($ch, $k, $v); \n }\n }\n \n if (isset($options['follow'])) {\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n }\n \n if (isset($options['timeout'])) {\n curl_setopt($ch, CURLOPT_TIMEOUT, $options['timeout']); //timeout in seconds\n }\n \n if (isset($options['connect_timeout'])) {\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $options['connect_timeout']);\n }\n \n if (isset($options['keep_alive'])) {\n curl_setopt($ch, CURLOPT_TCP_KEEPALIVE, 1);\n curl_setopt($ch, CURLOPT_TCP_KEEPIDLE, $options['keep_alive']);\n curl_setopt($ch, CURLOPT_TCP_KEEPINTVL, 15);\n }\n \n if (isset($options['headers']) && !empty($options['headers'])) {\n $aux_headers = [];\n foreach ($options['headers'] as $k_h => $v_h) {\n if (!empty($v_h)) {\n $aux_headers[] = $k_h.': '.$v_h;\n }\n } \n curl_setopt($ch, CURLOPT_HTTPHEADER, $aux_headers);\n }\n \n if (isset($options['httpquery']) && !empty($options['httpquery'])) {\n $httpquery = $options['httpquery'];\n } \n elseif (!empty($params)) {\n $httpquery = http_build_query($params);\n }\n \n if ($method == \"POST\") {\n curl_setopt($ch, CURLOPT_POST, 1);\n }\n \n if ($method == \"POST\" || $method == \"PUT\") { \n if (!empty($httpquery)) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $httpquery);\n }\n } \n if ($method != \"GET\") {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n }\n \n if ($method == 'GET' && !empty($httpquery)) {\n if (empty(parse_url($uri,PHP_URL_QUERY))) {\n $uri .= '?'.$httpquery;\n } else {\n $uri .= '&'.$httpquery;\n }\n }\n \n curl_setopt($ch, CURLOPT_URL, $uri);\n \n $start = microtime(true); \n if (isset($options['bg']) && $options['bg'] == 1) {\n $extra_curl = '';\n if (isset($options['timeout'])) {\n $extra_curl .= ' --max-time '.$options['timeout'];\n }\n if (isset($options['connect_timeout'])) {\n $extra_curl .= ' --connect-timeout '.$options['connect_timeout'];\n }\n if (isset($options['keep_alive'])) {\n $extra_curl .= ' --keepalive-time '.$options['keep_alive'];\n }\n if (isset($options['headers'])) {\n foreach ($options['headers'] as $k => $v) {\n $extra_curl .= ' -H \"'.$k.': '.$v.'\"';\n }\n \n }\n if (isset($options['follow'])) {\n $extra_curl .= \" -L\";\n }\n \n if ($method == \"POST\") { \n $extra_curl .= \" -X \\\"POST\\\"\"; \n if (!empty($httpquery)) {\n $uid = uniqid();\n file_put_contents('/tmp/'.$uid,$httpquery); \n } \n } \n $curl = 'curl -s '.$extra_curl.' \"'.$uri.'\"';\n if ($method == \"POST\" && !empty($httpquery)) {\n $curl .= \" -k -d @- < /tmp/\".$uid;\n }\n $curl .= ' > /dev/null 2>&1 &'; \n $output = shell_exec($curl);\n } else {\n $output = curl_exec($ch); \n }\n $end = (microtime(true) - $start);\n $getinfo = curl_getinfo($ch);\n $getinfo['curl_exec_timing_ms'] = $end;\n if (!empty($httpquery)) {\n $getinfo['http_query'] = $httpquery;\n }\n if (!empty($aux_headers)) { \n $getinfo['headers'] = implode(', ',$aux_headers);\n }\n if (isset($curl) && !empty($curl)) {\n $getinfo['curl'] = $curl;\n }\n \n curl_close($ch); \n \n if (isset($options['jsondecode_output'])) {\n $aux = @json_decode($output,true);\n $output_copy = $output;\n if ($aux === null && json_last_error() !== JSON_ERROR_NONE) {\n $output = 'JSON Decode Error: '.json_last_error_msg();\n $output .= '<h4>Response</h4><pre>'.print_r($output_copy,true).'</pre>';\n } else {\n $output = $aux;\n }\n }\n \n if ($getinfo['http_code'] != 200) {\n $return = ['result' => false, 'info' => $getinfo, 'output' => $output]; \n }\n else $return = ['result' => true, 'info' => $getinfo, 'output' => $output]; \n \n if (isset($options['json'])) {\n $aux = json_encode($return); \n if ($aux === false && json_last_error() == JSON_ERROR_UTF8) {\n $output = utf8_encode($output);\n $aux = json_encode(['result' => $return['result'], 'info' => $return['info'], 'output' => $output]);\n }\n $return = $aux; \n }\n return $return;\n }",
"function request($url = '', $format='xml', $params=null, $method = \"GET\", $data = null, $headers = null) {\n\t\t$query_string_params = array();\n\t\t\t\t\n\t\t// add additional parameters if necessary\n\t\tif (!is_null($params) && is_array($params)) {\n\t\t\t$query_string_params = $params;\n\t\t}\n\t\t\n\n\t\t// set proper format request\n\t\tif ($this->format_as_extension) { $this->baseURL .= '.' . $format; }\n\t\telse { $query_string_params['format'] = $format; }\n\n\t\t// add the url as parameter, oembed-style\n\t\t$query_string_params['url'] = $url;\t\t\n\t\t\n\t\t$this->setQueryString($query_string_params);\t\t\n\n\t\treturn parent::request('', $method, $data, $headers);\n\t}",
"public function get($url, $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n curl_close($this->handle);\n return $this->response_object;\n }",
"function request($url, $options = array()) {\n\n\t\t// parse request\n\t\t$request = $this->_parseRequest($url, $options);\n\n\t\t// create stream options \n\t\t$options = array('http' =>\n\t\t\tarray('method' => $request['method'],\n\t\t\t \t 'protocol_version' => $request['version'],\n\t\t\t\t 'max_redirects' => $request['redirects'],\n\t\t\t\t 'timeout' => $request['timeout'],\n\t\t\t\t 'ignore_errors' => true,\n\t\t\t\t 'content' => $request['body']\n\t\t\t\t)\n\t\t\t);\n\n\t\t// create header string\n\t\t$options['http']['header'] = $this->_buildHeader($request['header']);\n\t\tif (!empty($request['cookies'])) {\n\t\t\t$options['http']['header'] .= $this->buildCookies($request['cookies']);\n\t\t}\n\n\t\t// connect with fopen and streams\n\t\t$res = false;\n\t $fp = @fopen($url, 'r', false, stream_context_create($options));\n\t\t$res = stream_get_contents($fp);\n\t\t$meta = stream_get_meta_data($fp);\n\t\tfclose($fp);\n\n\t\t// parse response\n\t\t$res = $this->_parseResponse((isset($meta['wrapper_data']) ? implode($this->line_break, $meta['wrapper_data']).$this->line_break.$this->line_break : null).$res);\n\n\t\t// save to file\n\t\tif ($res && $request['file'] && file_put_contents($request['file'], $res['body']) === false) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $res;\n\t}",
"public function get($url, $endpoint = \"\", $header = array(), $query = array())\n {\n $url .= $endpoint . \"?\";\n if (count($query) > 0) {\n $query = http_build_query($query);\n $url .= $query;\n }\n\n //$log = \"New GET Request.\\n\";\n //$log .= \"URL: $url\\n\";\n\n $ch = curl_init();\n\n //Set the URL that you want to GET by using the CURLOPT_URL option.\n curl_setopt($ch, CURLOPT_URL, $url);\n\n //Set CURLOPT_RETURNTRANSFER so that the content is returned as a variable.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n //Set CURLOPT_FOLLOWLOCATION to true to follow redirects.\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\n if (array_key_exists('headers', $header)) {\n // Set HTTP Header for POST request \n //$log .= \"Header sent: \" . json_encode($header['headers']) . \"\\n\";\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header['headers']);\n }\n\n //Execute the request.\n $result = curl_exec($ch);\n\n\n //Handle curl errors\n if (curl_error($ch)) {\n $error_msg = curl_error($ch);\n //$log .= \"Error: $error_msg\\n\";\n throw new \\Exception(curl_error($ch));\n }\n\n //$log .= \"\\n------------------------END-------------------------\\n\\n\";\n //file_put_contents('log.txt', $log, FILE_APPEND);\n\n //Close the cURL handle.\n curl_close($ch);\n\n //Print the data out onto the page.\n //header('Content-Type: application/json');\n return json_encode(json_decode($result));\n }",
"function customGet($url, $refer, $header_array)\n {\n $USER_AGENT=\"Mozilla/5.0 (Windows NT 6.3; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0\";\n\n if (!isset($CONNECT_TIMEOUT) || !filter_var($CONNECT_TIMEOUT, FILTER_VALIDATE_INT)) {$CONNECT_TIMEOUT=10;} //use 10 seconds by default when no timeout is set\n if (!isset($refer) || !filter_var($refer, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED | FILTER_FLAG_HOST_REQUIRED)) {$refer=$url;} //use original url as refer when no valid URL provided\n\n $ch=curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, $USER_AGENT);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $CONNECT_TIMEOUT);\n curl_setopt($ch, CURLOPT_TIMEOUT, $CONNECT_TIMEOUT);\n curl_setopt($ch, CURLOPT_REFERER, $refer);\n if (is_array($header_array)) //add custom header\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header_array);\n }\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n $result=curl_exec($ch);\n curl_close($ch);\n\n return $result;\n }",
"public function get($url, $params = null)\n {\n return $this->request('GET', $url, $params);\n }",
"public function url_get_contents($url, $useragent = 'cURL', $headers = false, $follow_redirects = true, $debug = false)\n {\n $ch = curl_init();\n // specify the URL to be retrieved\n curl_setopt($ch, CURLOPT_URL, $url);\n // we want to get the contents of the URL and store it in a variable\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // specify the useragent: this is a required courtesy to site owners\n curl_setopt($ch, CURLOPT_USERAGENT, $useragent);\n // ignore SSL errors\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n // return headers as requested\n if ($headers == true) {\n curl_setopt($ch, CURLOPT_HEADER, 1);\n }\n // only return headers\n if ($headers == 'headers only') {\n curl_setopt($ch, CURLOPT_NOBODY, 1);\n }\n // follow redirects - note this is disabled by default in most PHP installs from 4.4.4 up\n if ($follow_redirects == true) {\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n }\n // if debugging, return an array with CURL's debug info and the URL contents\n if ($debug == true) {\n $result['contents'] = curl_exec($ch);\n $result['info'] = curl_getinfo($ch);\n }\n // otherwise just return the contents as a variable\n else {\n $result = curl_exec($ch);\n }\n // free resources\n curl_close($ch);\n // send back the data\n return $result;\n }",
"function h_GET(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n if ($data) {\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n \n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($result, true);\n}",
"public function get($url, $params = '', array $config = [])\n\t{\n\t\treturn $this->request($url, $params, $config);\n\t}",
"function get($url, $headers=array(), $userPW=0, $params=array())\n{\n $paramLength = count($params);\n // only set params if there are some else url is fine\n if ($paramLength > 0)\n {\n $url = $url.'?'.http_build_query($params,'','&');\n }\n echo $url . \"<br/>\";\n $ch = curl_init();\n // set the url\n curl_setopt($ch, CURLOPT_URL, $url);\n // set http method\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n if ($userPW <> 0)\n {\n curl_setopt($ch, CURLOPT_USERPWD, User_Creds::PingUser . \":\" . User_Creds::PingPass);\n }\n $headerLength = count($headers);\n if ($headerLength > 0)\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n //get response\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}",
"protected static function get(string $url, array $params = [], array $opts = [], array $headers = []) : string\n {\n $data = http_build_query($params);\n $url .= \"?{$data}\";\n\n $opts[CURLOPT_URL] = $url;\n $opts[CURLOPT_CONNECTTIMEOUT] = 5;\n $opts[CURLOPT_TIMEOUT] =5;\n $opts[CURLOPT_RETURNTRANSFER] = true;\n $opts[CURLOPT_SSL_VERIFYHOST] = false;\n $opts[CURLOPT_SSL_VERIFYPEER] = false;\n $opts[CURLOPT_ENCODING] = \"\";\n $opts[CURLOPT_HTTPHEADER] = $headers;\n\n if (PSN::$proxy != \"\" && PSN::$proxyProt > 0) {\n $opts[CURLOPT_PROXY] = PSN::$proxy;\n $opts[CURLOPT_PROXYPORT] = PSN::$proxyPort;\n }\n\n $ch = curl_init();\n curl_setopt_array($ch, $opts);\n $result = curl_exec($ch);\n curl_close($ch);\n\n return $result;\n }",
"public function request() {\n // The basic flow: build the url, make the request, parse and return the\n // output.\n $url = $this->query_builder->getUrl();\n\n // @todo: does this make sense to be in a separate class? Anyway, this shoudl\n // be somehow refactored because it is hard to replace or overwrite it.\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n $response = curl_exec($curl);\n // @todo: very important: check the curl errors here.\n\n return $this->parser->parse($response);\n }",
"public function get($url,$param=null,$header=null){\n\t\t$ch = curl_init();\n\t\tif(!is_null($param)){\n\t\t\t$url = $url . \"?\" . http_build_query($param);\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_URL,$url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $header);\n\t\t$response = curl_exec($ch);\n\t\t$err = curl_error($ch);\n\t\tcurl_close($ch);\n\t\tif ($err) {\n\t\t\tarray_push($this->curlError,$err);\n\t\t\treturn $err;\n\t\t} else {\n\t\t $response = json_decode($response, TRUE);\n\t\t}\n\t\treturn $response;\n\n\t}",
"public static function CurlGet($url, array $get = NULL, array $options = array()) {\n $defaults = array(\n CURLOPT_URL => $url . (strpos($url, '?') === FALSE ? '?' : '') . http_build_query($get),\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => TRUE,\n CURLOPT_TIMEOUT => 4\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if (!$result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n }",
"public function Get( $sUrl );",
"public static function fetch($url, $options = array())\n {\n if(!function_exists('curl_exec'))\n {\n Broadstreet_Log::add('error', \"cURL is not installed! Throwing an exception..\");\n throw new Broadstreet_Exception(\"The cURL module must be installed\");\n }\n\n $curl_handle = curl_init($url);\n $options += array(CURLOPT_RETURNTRANSFER => true);\n\n curl_setopt_array($curl_handle, $options);\n\n $timer = \"Call to $url via HTTP\";\n Broadstreet_Benchmark::start($timer);\n\n $body = curl_exec($curl_handle);\n $status = curl_getinfo($curl_handle, CURLINFO_HTTP_CODE);\n\n Broadstreet_Benchmark::stop($timer);\n\n return (object)(array('url' => $url, 'body' => $body, 'status' => $status));\n }",
"function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}",
"public function get($url, array $params = []) \n {\n $this->parameters = $params;\n\n return $this->request('GET', $url);\n }",
"protected function makeHTTPRequest($url, $param = array(), $method=\"GET\"){\n\t\t$curl = new Curl();\n\t\tswitch($method){\n\t\t\tcase \"GET\":\n\t\t\t\t$result = $curl->get($url, $param);\n\t\t\t\tbreak;\n\t\t\tcase \"POST\":\n\t\t\t\t$result = $curl->post($url, $param);\n\t\t\t\tbreak;\n\t\t}\n\t\tif(!($result->headers['Status-Code'] == 202 || $result->headers['Status-Code'] == 200)){\n\t\t\tthrow new Kanedo_Readability_Exception($result);\n\t\t}\n\t\treturn $result;\n\t}",
"public function doGet($path = '', array $query = array());",
"private function getRequest($url, $params = array()) {\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->api_base_uri . $url .(!empty($params) ? '?'. http_build_query($params) \n: ''));\n\t\t$json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $json;\n\t}",
"public function get($url, $payload = array(), $do_not_exit = true, $return_transfer = true, $uri = false, $curl_opt_header = true)\n {\n //do not exit flag used in user controller.\n if($do_not_exit)\n {\n $this->do_not_exit = true;\n }\n\n $this->url = $url;\n $payload_arr = array();\n $curlopt_header = false;\n \n if ($uri)\n {\n foreach($payload as $v)\n {\n $payload_arr[] = urlencode($v);\n }\n $this->url = $url . '/' . implode('/', $payload_arr); \n }\n else\n {\n foreach($payload as $k => $v)\n {\n $payload_arr[] = urlencode($k) . '=' . urlencode($v);\n }\n $this->url = $url . '?' . implode('&', $payload_arr);\n }\n $this->curl_handle = curl_init();\n curl_setopt($this->curl_handle, CURLOPT_URL, $this->url);\n curl_setopt($this->curl_handle, CURLOPT_HTTPHEADER, $this->header);\n curl_setopt($this->curl_handle, CURLOPT_RETURNTRANSFER, $return_transfer ); //true may kill the response\n curl_setopt($this->curl_handle, CURLOPT_HEADER, $curl_opt_header);\n $this->curl_response = curl_exec($this->curl_handle);\n\n $this->parse_curl_response();\n return $this->http_body;\n }",
"function api_get($url, $identifier = null, $shared_secret = null)\n {\n $curl_auth = $identifier . \":\" . $shared_secret;\n $ch = curl_init($url);\n\n curl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, $curl_auth);\n\n return $this->gather_response($ch);\n }",
"public static function get($url, $httpHeaders = array())\n {\n //Initialize the Curl resource\n $ch = self::init($url, $httpHeaders);\n\n return self::processRequest($ch);\n }",
"private function curl_get($url)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }",
"public function get($url, $data = array())\n {\n $client = $this->getClient($url);\n $request = $client->get($url, array(), array('query' => $data));\n return $this->send($request);\n }",
"function pete_curl_get($url, $params){\n\t$post_params = array();\n\tforeach ($params as $key => &$val) {\n\t\tif (is_array($val)) $val = implode(',', $val);\n\t\t$post_params[] = $key.'='.urlencode($val);\n\t}\n\t$post_string = implode('&', $post_params);\n\t$fullurl = $url.\"?\".$post_string;\n\t$ch = curl_init();curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);curl_setopt($ch, CURLOPT_URL, $fullurl);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040608');\n\t$result = curl_exec($ch);curl_close($ch);\n\treturn $result;\n}",
"protected function request($url, array $headers = [])\n {\n return $this->getResponse($url, $headers)->getBody()->__toString();\n }",
"function curlGet($url, $headers=null) {\r\n //write_log(\"Function fired\");\r\n $mc = JMathai\\PhpMultiCurl\\MultiCurl::getInstance();\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL,$url);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 3);\r\n\t\tcurl_setopt ($ch, CURLOPT_CAINFO, rtrim(dirname(__FILE__), '/') . \"/cert/cacert.pem\");\r\n\t\tif ($headers) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\t\t//$result = curl_exec($ch);\r\n\t\t//curl_close ($ch);\r\n $call = $mc->addCurl($ch);\r\n // Access response(s) from your cURL calls.\r\n $result = $call->response;\r\n\t\t//write_log(\"URL is \".$url.\". Result is \".$result);\r\n\t\treturn $result;\r\n\t}",
"protected function doRequest($url, $headers, $method, $data) {\n return drupal_http_request($url, array('headers' => $headers, 'method' => $method, 'data' => $data));\n }",
"private static function startGetHttpRequest($url, $timeout, $host = '') {\n $urlParts = self::parseURL($url);\n return self::startRequest(\n $urlParts['host'],\n $urlParts['port'],\n self::buildHeaderString(array(\n 'GET' => $urlParts['path'] . \"?\" . $urlParts['query'] . \" HTTP/1.1\",\n 'Host:' => $host ?: $urlParts['host'],\n 'Connection:' => 'close',\n )),\n $timeout\n );\n }",
"private function _request($url, $method = \"GET\", $params = []) {\n $url = DolBlsApi::BASE_URL.$url;\n\n $params = json_encode($params);\n\n $contentType = \"Content-Type: application/json\";\n $contentLength = \"Content-Length: \" . strlen($params);\n\n $header = $contentType . \"\\r\\n\" . $contentLength . \"\\r\\n\";\n\n $results = file_get_contents(\n $url, null, stream_context_create(\n [\n \"http\" => [\n \"method\" => $method,\n \"header\" => $header,\n \"content\" => $params\n ],\n ]\n )\n );\n\n /** @var DolBlsResponse|bool $results */\n $results = $this->_filterResults($results);\n\n if ($this->_useJson) {\n $results = json_encode($results);\n } else if ($this->_useXml) {\n $xml = new SimpleXMLElement('<root/>');\n\n array_walk_recursive(\n json_decode(json_encode($results), true),\n [\n $xml,\n 'addChild'\n ]\n );\n\n $results = $xml->asXML();\n }\n\n return $results;\n }",
"public function GET($query_params = null)\n {\n $query_string = '';\n\n if (is_array($query_params)) {\n $query_string = $this->constructQueryParams($query_params);\n }\n\n $url = $this->url . $query_string;\n $response = $this->curlGet($url);\n\n return $response;\n }",
"public function _GET($url, $params = null, $username = null, $password = null)\n {\n $response = $this->call($url, 'GET', $params, $username, $password);\n\n return $this->parseResponse($response);\n }",
"public function httpRequest($url, $data, $headers = array(), $method = 'GET') {\n $options = array(\n 'method' => $method,\n 'headers' => $headers,\n 'data' => $data,\n );\n return $this->curl_http_request($url, $options, 90);\n }",
"public static function urlGet($url,$headers=null) {\n\n $c = curl_init();\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($c, CURLOPT_URL, $url);\n if ($headers != null && is_array($headers)){\n\n curl_setopt($c, CURLOPT_HTTPHEADER, $headers);\n\n }\n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($c, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($c);\n\n if($errno = curl_errno($c)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n curl_close($c);\n return utf8_encode($contents);\n }",
"private function Request($url,$params=false,$type=HTTP_GET){\n \n // Populate data for the GET request\n if($type == HTTP_GET) $url = $this->MakeUrl($url,$params);\n \n \n // borrowed from Andy Langton: http://andylangton.co.uk/\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n if ( isset($_SERVER['HTTP_USER_AGENT']) ) {\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );\n } else {\n // Handle the useragent like we are Google Chrome\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.X.Y.Z Safari/525.13.');\n }\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n //$acceptLanguage[] = \"Accept-Language:\" . $this->ClientLanguage;\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $acceptLanguage); \n // Populate the data for POST\n if($type == HTTP_POST) {\n curl_setopt($ch, CURLOPT_POST, 1); \n if($params) curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n }\n\n //execute\n $response=curl_exec($ch);\n $headers=curl_getinfo($ch);\n\n //fetch errors\n $errorNumber = curl_errno($ch);\n $errorMessage = curl_error($ch);\n\n curl_close($ch);\n\n // replace ids with their string values, added because of some\n // PHP-version can't handle these large values\n $response = preg_replace('/id\":(\\d+)/', 'id\":\"\\1\"', $response);\n\n // we expect JSON, so decode it\n $json = @json_decode($response, true);\n\n // validate JSON\n if ($json === null) {\n // should we provide debug information\n if (self::DEBUG) {\n // make it output proper\n echo '<pre>';\n\n // dump the header-information\n var_dump($headers);\n\n // dump the error\n var_dump($errorMessage);\n\n // dump the raw response\n var_dump($response);\n\n // end proper format\n echo '</pre>';\n }\n\n // throw exception\n throw new Exception('Invalid response.');\n }\n\n // any errors\n if (isset($json['diagnostic']['error_msgs'])) {\n // should we provide debug information\n if (self::DEBUG) { \n\n echo '<pre>';\n echo \"<h3>Header</h3>\";\n // dump the header-information\n var_dump($headers);\n\n echo \"<h3>Error message</h3>\";\n // dump the error\n var_dump($errorMessage);\n\n echo \"<h3>Raw Response</h3>\";\n // dump the raw response\n var_dump($response);\n\n echo \"<h3>Response</h3>\";\n var_dump($json);\n \n echo '</pre>';\n exit();\n }\n\n // throw exception\n /*\n if (isset($json['errors'][0]['message'])) {\n throw new Exception($json['errors'][0]['message']);\n } elseif (isset($json['errors']) && is_string($json['errors'])) {\n throw new Exception($json['errors']);\n } else throw new Exception('Invalid response.');\n */\n }\n\n return $json;\n }",
"function get_response($url, $headers) {\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n curl_setopt($ch, CURLOPT_HEADER, false);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($ch);\r\n curl_close($ch);\r\n return $response;\r\n }",
"function getrequest($url){\n\t// gets cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_RETURNTRANSFER => 1,\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_USERAGENT => 'BenGreenlineApp'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\t//returns the json encoded response\n\t\n\t\n\t$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\tif($httpCode == 404) {\n $resp[0]= \"MetroTransit API gave 404\" ;\n\t};\n\t\n\t\n\treturn json_decode($resp);\n}",
"public function request(string $url): self\n {\n $url = 'http://' . $this->host . ':' . $this->port . '/' . $url;\n\n $data = $this->getData();\n\n $options = array(\n 'http' => array(\n 'method' => $this->method,\n 'user_agent' => $this->userAgent,\n 'follow_location' => 1,\n 'protocol_version' => 1.1,\n 'timeout' => $this->timeout,\n 'header' => '',\n )\n );\n\n $this->addHeader(\"X-HTTP-Method-Override: \" . strtoupper($this->method));\n $this->addHeader(\"Content-Type: application/json\");\n $this->addHeader(\"Accept: application/json\");\n switch (strtoupper($this->method)) {\n case 'GET':\n break;\n case 'POST';\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"COPY\":\n break;\n case \"DELETE\":\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"PUT\":\n if ($data) {\n $this->addHeader(\"Content-Length: \" . strlen($data));\n $options['http']['content'] = $data;\n }\n break;\n case \"HEAD\":\n break;\n }\n if (!empty($this->username) && !empty($this->password)) {\n $this->addHeader(\"Authorization: Basic \" . base64_encode($this->username . \":\" . $this->password));\n }\n foreach ($this->getHeaders() as $header) {\n $options['http']['header'] .= $header . \"\\r\\n\";\n }\n\n $context = stream_context_create($options);\n $response = @file_get_contents($url, false, $context);\n\n foreach ($http_response_header as $line) {\n $this->getHeader(NULL, $line);\n }\n\n if ($response == false) {\n $this->error = array('code' => http_response_code(), 'text' => '');\n } else {\n $this->response = $response;\n }\n\n $this->url = $url;\n\n return $this;\n }",
"public static function doGet(Array $params)\n {\n $request = new self();\n\n $params = array_merge(array('url' => '', 'data' => array(), 'requestMethod' => 'GET', 'tryNum' => 1), $params);\n $url = $params['url'];\n $tryNum = $params['tryNum'];\n $data = http_build_query($params['data']);\n\n $curl_options = array(\n CURLOPT_VERBOSE => 0,\n CURLOPT_HEADER => 0,\n CURLOPT_FOLLOWLOCATION => 1,\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_SSLVERSION => 3,\n CURLOPT_SSL_VERIFYPEER => 0,\n CURLOPT_SSL_VERIFYHOST => 0,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_HTTPHEADER => array(\"Content-Type: application/x-www-form-urlencoded\", \"Accept: text/plain\"),\n );\n\n if (!in_array($params['requestMethod'], array('GET', 'POST')))\n {\n $curl_options[CURLOPT_CUSTOMREQUEST] = $params['requestMethod'];\n }\n\n if (is_debugmode('verbose')) {\n $verboseFile = fopen('php://temp', 'r+');\n $curl_options[CURLOPT_VERBOSE] = 1;\n $curl_options[CURLOPT_STDERR] = $verboseFile;\n }\n\n if ($data)\n {\n if ($params['requestMethod'] == 'POST')\n {\n $curl_options[CURLOPT_POST] = 1;\n $curl_options[CURLOPT_POSTFIELDS] = $data;\n } else {\n $url .= '?' . $data;\n }\n }\n $curl_options[CURLOPT_URL] = $url;\n\n $ch = curl_init();\n curl_setopt_array($ch, $curl_options);\n\n do\n {\n $result = curl_exec($ch);\n $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $tryNum--;\n } while ($http_code >= 500 && $tryNum > 0);\n $effective_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n curl_close($ch);\n\n if ($params['requestMethod'] == 'POST')\n {\n $effective_url .= '?' . $data;\n }\n\n $request->_setAnswer(array(\n 'result' => $result,\n 'http_code' => $http_code,\n 'effective_url' => $effective_url,\n 'request_method' => $params['requestMethod'],\n ));\n\n if (is_debugmode('request')) {\n $request->debug(array(\n 'Mode' => 'Request'\n ));\n }\n if (is_debugmode('verbose')) {\n rewind($verboseFile);\n $request->_setAnswer(array(\n 'verbose_info' => fread($verboseFile, 8192),\n ));\n\n $request->debug(array(\n 'Mode' => 'Verbose request'\n ));\n }\n return $request;\n }",
"public function http_get($uri = null, $curl = false) {\n\n\t\tif (!preg_match('/^https?/', $uri)) return json_encode(array('e' => 'Non-http URL specified'));\n\t\n\t\tif ($curl) {\n\t\t\tif (!function_exists('curl_exec')) {\n\t\t\t\treturn json_encode(array('e' => 'No Curl installed'));\n\t\t\t\tdie;\n\t\t\t}\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $uri);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, true);\n\t\t\tcurl_setopt($ch, CURLOPT_STDERR, $output = fopen('php://temp', \"w+\"));\n\t\t\t$response = curl_exec($ch);\n\t\t\t$error = curl_error($ch);\n\t\t\t$getinfo = curl_getinfo($ch);\n\t\t\tcurl_close($ch);\n\n\t\t\trewind($output);\n\t\t\t$verb = stream_get_contents($output);\n\n\t\t\t$resp = array();\n\t\t\tif (false === $response) {\n\t\t\t\t$resp['e'] = htmlspecialchars($error);\n\t\t\t}\n\t\t\t$resp['r'] = (empty($response)) ? '' : htmlspecialchars(substr($response, 0, 2048));\n\n\t\t\tif (!empty($verb)) $resp['r'] = htmlspecialchars($verb).\"\\n\\n\".$resp['r'];\n\n\t\t\t// Extra info returned for Central\n\t\t\t$resp['verb'] = $verb;\n\t\t\t$resp['response'] = $response;\n\t\t\t$resp['status'] = $getinfo;\n\n\t\t\treturn json_encode($resp);\n\t\t} else {\n\t\t\t$response = wp_remote_get($uri, array('timeout' => 10));\n\t\t\tif (is_wp_error($response)) {\n\t\t\t\treturn json_encode(array('e' => htmlspecialchars($response->get_error_message())));\n\t\t\t}\n\t\t\treturn json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'r' => wp_remote_retrieve_response_code($response).': '.htmlspecialchars(substr(wp_remote_retrieve_body($response), 0, 2048)),\n\t\t\t\t\t'code' => wp_remote_retrieve_response_code($response),\n\t\t\t\t\t'html_response' => htmlspecialchars(substr(wp_remote_retrieve_body($response), 0, 2048)),\n\t\t\t\t\t'response' => $response\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}",
"function requesturl($url, $timeout) {\n $client = new \\GuzzleHttp\\Client();\n\n try {\n $res = $client->request('GET', $url, ['timeout' => $timeout]);\n } catch (GuzzleException $e) {\n return false;\n }\n\n $status = $res->getStatusCode();\n\n if($status!=200){\n return false;\n }\n\n $body = $res->getBody();\n\n return $body;\n }",
"public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}"
] | [
"0.81084126",
"0.7877043",
"0.7455169",
"0.72478807",
"0.72330433",
"0.72246397",
"0.71367097",
"0.712742",
"0.6970128",
"0.6966542",
"0.69565487",
"0.6929547",
"0.68641096",
"0.684597",
"0.68442774",
"0.68037754",
"0.6800389",
"0.677419",
"0.6763892",
"0.67317975",
"0.6703176",
"0.6697669",
"0.6682374",
"0.66157746",
"0.65991724",
"0.65755934",
"0.65699387",
"0.6567402",
"0.65442926",
"0.6543175",
"0.6539877",
"0.6535247",
"0.651616",
"0.64914185",
"0.6478793",
"0.6473124",
"0.6446742",
"0.6439312",
"0.6416921",
"0.6408732",
"0.6403771",
"0.6399457",
"0.63966835",
"0.63953716",
"0.63811636",
"0.63803846",
"0.6318078",
"0.6306905",
"0.62892985",
"0.6287873",
"0.62819743",
"0.6275612",
"0.6258318",
"0.6253261",
"0.6247874",
"0.62450635",
"0.624287",
"0.6240561",
"0.62385404",
"0.62279785",
"0.62245053",
"0.6223189",
"0.6215495",
"0.62143105",
"0.6212708",
"0.6211737",
"0.6208318",
"0.6192837",
"0.6182413",
"0.6176146",
"0.6169541",
"0.6152249",
"0.6150551",
"0.6148827",
"0.6127028",
"0.6115428",
"0.61114514",
"0.6111265",
"0.61112297",
"0.61088854",
"0.6108633",
"0.6103822",
"0.60930485",
"0.6092383",
"0.6090751",
"0.60816944",
"0.6080879",
"0.60807085",
"0.6079525",
"0.6078362",
"0.6074674",
"0.606528",
"0.6064351",
"0.6063299",
"0.6061172",
"0.60541886",
"0.60500216",
"0.6044063",
"0.60420424",
"0.60387605"
] | 0.7275457 | 3 |
Perform (construct and send) a POST request on the given url with optional body and headers | static function post($url, $body = null, $headers = array()) {
$request = new NiceHTTP\PostRequest($url, $body, $headers);
return $request->send();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function post($url, $body = array(), $query = array(), $headers = array());",
"public function post($url, $body){\n\t\t\n\t\t// do we even need this?\n\t\t// $headers = array('Content-Type: application/x-www-form-urlencoded')\n\t\t\n\t\treturn $this->doRequest('POST', $url, $body);\n }",
"public function post($requestUrl, $requestBody, array $requestHeaders = []);",
"function do_post_request($url, $data, $optional_headers = null)\n{\n $params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n return $response;\n}",
"function httpPOST($url, array $data, $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n $query = http_build_query($data, '', '&');\n ($headers = trim($headers) === '') or $headers .= \"\\r\\n\";\n\n $headers = \"POST $url HTTP/1.0\\r\\n\".\n $headers.\n \"Content-Type: application/x-www-form-urlencoded\\r\\n\".\n \"Content-Length: \".strlen($query).\"\\r\\n\".\n \"$query\\r\\n\";\n\n $this->write($headers);\n return $this->readAllAndClose();\n }",
"public function post ($url, $data = null, $headers = null, $options = null);",
"public function post(string $url, array $input = [], $headers = null);",
"function do_post_request($url, $data, $optional_headers = null)\n {\n\t \n$params = array('http' => array(\n 'method' => 'POST',\n 'content' => $data\n ));\n if ($optional_headers !== null) {\n $params['http']['header'] = $optional_headers;\n }\n $ctx = stream_context_create($params);\n $fp = @fopen($url, 'rb', false, $ctx);\n if (!$fp) {\n throw new Exception(\"Problem with $url, $php_errormsg\");\n }\n $response = @stream_get_contents($fp);\n if ($response === false) {\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\n }\n\t //print_r($response);\n return $response;\n }",
"function doPost($url, $post = array() , $format = 'plain')\n{\n return curlExecute($url, 'post', $post, $format);\n}",
"public function post($url, $payload, $options = [])\n {\n $request = new Client();\n $request->init();\n\n $request->setopt(CURLOPT_URL, $url);\n\n foreach ($this->options as $optionKey => $optValue) {\n $request->setopt($optionKey, $optValue);\n }\n\n foreach ($options as $optionKey => $optValue) {\n $request->setopt($optionKey, $optValue);\n }\n\n $request->setopt(CURLOPT_POSTFIELDS, $payload);\n $request->setopt(\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: ' . $this->dataType,\n 'Content-Length: ' . strlen($payload)\n ]\n );\n\n if (!$this->body = $request->exec()) {\n $this->error = $request->error();\n }\n\n $info = $request->getinfo();\n $this->status = isset($info['http_code']) ? $info['http_code'] : null;\n\n $request->close();\n }",
"public function post( $url, array $headers=array(), $data=null ) {\n return $this->httpRequest( $url, 'POST', $headers, $data );\n }",
"public function doPostRequest($url, $data, $headers = array('Content-Type: application/x-www-form-urlencoded')) {\r\n $php_errormsg = '';\r\n if (is_array($data)) {\r\n $data = http_build_query($data, '', '&');\r\n }\r\n $params = array('http' => array(\r\n 'method' => 'POST',\r\n 'content' => $data)\r\n );\r\n if ($headers !== null) {\r\n $params['http']['header'] = $headers;\r\n }\r\n $ctx = stream_context_create($params);\r\n $fp = fopen($url, 'rb', false, $ctx);\r\n if (!$fp) {\r\n return \"Error: gateway is inaccessible\";\r\n }\r\n //stream_set_timeout($fp, 0, 250);\r\n try {\r\n $response = stream_get_contents($fp);\r\n if ($response === false) {\r\n throw new Exception(\"Problem reading data from $url, $php_errormsg\");\r\n }\r\n return $response;\r\n } catch (Exception $e) {\r\n $response = $e->getMessage();\r\n return $response;\r\n }\r\n}",
"public function _post($url = null, array $parameters = []);",
"function h_POST(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n $payload = json_encode($data);\n\n // Prepare new cURL resource\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n \n // Set HTTP Header for POST request \n curl_setopt(\n $ch,\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($payload)\n ]\n );\n \n // Submit the POST request\n $response = curl_exec($ch);\n curl_close($ch);\n\n return $response;\n}",
"function post($url, $fields = array(), $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_POST] = true;\n $http_options[CURLOPT_POSTFIELDS] = $fields;\n if (is_array($fields)) {\n $http_options[CURLOPT_HTTPHEADER] = array(\"Content-Type: multipart/form-data\");\n }\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }",
"function curl_post($url, array $post = NULL, array $headers = NULL, array $options = array()) {\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $_defaults = defaults;\n \n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}",
"public function postGuzzleRequest($headers, $url, $body)\n {\n $client = new \\GuzzleHttp\\Client(['headers' => $headers]);\n $response = $client->post($url, array('form_params'=>$body));\n\n $response = json_decode($response->getBody());\n\n\n return $response;\n }",
"function httpPOST($url, $data)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n}",
"public function post($url, $payload = array(), $do_not_exit = true)\n {\n if($do_not_exit)\n {\n $this->do_not_exit = true;\n }\n\n $this->url = $url;\n $this->curl_handle = curl_init();\n $payload = http_build_query($payload);\n curl_setopt($this->curl_handle, CURLOPT_URL, $this->url);\n curl_setopt($this->curl_handle, CURLOPT_POST, true);\n curl_setopt($this->curl_handle, CURLOPT_HTTPHEADER, $this->header);\n curl_setopt($this->curl_handle, CURLOPT_POSTFIELDS, $payload);\n curl_setopt($this->curl_handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($this->curl_handle, CURLOPT_HEADER, true);\n $this->curl_response = curl_exec($this->curl_handle);\n\n $this->parse_curl_response();\n return $this->http_body;\n }",
"function post($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'POST', 'body' => $data), $options));\n\t}",
"private function POST($url,$params=false){\n return $this->Request($url,$params,HTTP_POST);\n }",
"public function post($url, array $data = [], array $headers = [])\n {\n return $this->sendRequest($url, 'POST', $data, $headers);\n }",
"function curl_post($url, array $post = NULL, array $options = array())\n{\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch))\n {\n echo \"curl_exec failed \" . $url;\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}",
"function http_post($url, $params = array()) {\n $postData = '';\n //create name value pairs seperated by &\n foreach ($params as $k => $v) {\n $postData .= $k . '=' . $v . '&';\n }\n $postData = rtrim($postData, '&');\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POST, count($postData));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);\n $output = curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}",
"function post($url, $args = array()) {\n\t\t$defaults = array('method' => 'POST');\n\t\t$r = array_merge( $defaults, $args );\n\t\treturn $this->request($url, $r);\n\t}",
"public function Post( $sUrl, array $aFields );",
"public function pearRequest($url, $headers, $body)\n\t{\n\t\tif (!class_exists('HTTP_Request2')) require_once('HTTP/Request2.php');\n\t\tif (!class_exists('HTTP_Request2_Adapter_Socket')) require_once 'HTTP/Request2/Adapter/Socket.php';\n\n\t\t$adapter = new HTTP_Request2_Adapter_Socket;\n\t\t$req = new HTTP_Request2($url, HTTP_Request2::METHOD_POST);\n\t\t$req->setAdapter($adapter);\n\t\t$req->setHeader($headers);\n\t\t$req->setBody($body);\n\t\treturn $req->send()->getStatus();\n\t}",
"public static function do_post_request($url, $request_body, $port = false, &$optional_headers = null) {\n $ch = curl_init($url);\n if ($port !== false) {\n curl_setopt($ch, CURLOPT_PORT, $port);\n }\n curl_setopt($ch, CURLOPT_USERAGENT,\n \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36\");\n\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request_body);\n\n $has_headers = !empty($optional_headers);\n curl_setopt($ch, CURLOPT_HEADER, $has_headers);\n if ($has_headers) {\n $hasCL = false;\n foreach ($optional_headers as $index => $header) {\n if (substr($header, 0, 15) == 'Content-Length:') {\n $hasCL = true;\n break;\n }\n }\n if (!$hasCL) {\n $cl = strlen($request_body);\n $optional_headers[] = \"Content-Length: $cl\";\n }\n curl_setopt($ch, CURLOPT_HTTPHEADER, $optional_headers);\n }\n\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 10);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n $result = curl_exec($ch);\n if (false === $result) {\n $errno = curl_errno($ch);\n $error = curl_error($ch);\n static::debugError($url, $optional_headers, $request_body, \"$errno: $error\");\n return 'Erreur :\\n' . $error;\n }\n curl_close($ch);\n\n return $result;\n }",
"public function post($url, array $params = []) \n {\n return $this->request('POST', $url, $params);\n }",
"public static function urlPost($url, $content, $headers=null) {\n\n $isJsonForm = false;\n\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n //array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $content = json_encode($content);\n $contentString = $content;\n }\n else{\n\n $contentString = '';\n foreach ($content as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $contentString .= $key . \"=\" . $value .\"&\";\n }\n $contentString .= \"\\n\";\n }\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $contentString);\n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($curl);\n \n if($errno = curl_errno($curl)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\n /*\n if ($status != 201) {\n die(\"Error: call to URL $url failed with status $status, response $contents, curl_error: \" . curl_error($curl) . \", curl_errno: \" . curl_errno($curl));\n }\n */\n curl_close($curl);\n \n return utf8_encode($contents);\n }",
"function postRequest( $url, $fields, $optional_headers = null ) {\n\t\t// http_build_query is preferred but doesn't seem to work!\n\t\t// $fields_string = http_build_query($fields, '', '&', PHP_QUERY_RFC3986);\n\t\t\n\t\t// Create URL parameter string\n\t\tforeach( $fields as $key => $value )\n\t\t\t$fields_string .= $key.'='.$value.'&';\n\t\t\t\n\t\t$fields_string = rtrim( $fields_string, '&' );\n\n//\t\techo \"controlKey.php : postRequest() : URL = $url\";\n//\t\techo \"controlKey.php : postRequest() : Fields_string = $fields_string\";\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_POST, count( $fields ) );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $fields_string );\n\t\t\n\t\t$result = curl_exec( $ch );\n\t\t\n\t\tcurl_close( $ch );\n\t}",
"public function post($url, $params = array(), $options = array())\n\t{\n\t\t$field_string = '';\n\t\t\n\t\tif ( iterable($params) ) {\n\t\t\tforeach ( $params as $key => $value ) {\n\t\t\t\t$field_string .= urlencode($key) . '=' . urlencode($value) . '&';\n\t\t\t}\n\t\t\t\n\t\t\trtrim($field_string, '&');\n\t\t}\n\t\t\n\t\t$options[CURLOPT_URL] = $url;\n\t\t$options[CURLOPT_RETURNTRANSFER] = array_ensure($options, CURLOPT_RETURNTRANSFER, 1);\n\t\t$options[CURLOPT_HEADER] = array_ensure($options, CURLOPT_HEADER, 0);\n\t\t$options[CURLOPT_USERAGENT] = array_ensure($options, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0');\n\t\t$options[CURLOPT_IPRESOLVE] = array_ensure($options, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);\n\t\t$options[CURLOPT_POST] = sizeof($params);\n\t\t$options[CURLOPT_SSL_VERIFYPEER] = false;\n\t\t$options[CURLOPT_SSL_VERIFYHOST] = 0;\n\t\t$options[CURLOPT_POSTFIELDS] = $field_string;\n\t\t//$options[CURLOPT_HEADER] = strlen($field_string);\n\t\t\n\t\t$curl = curl_init();\n\t\t\n\t\tcurl_setopt_array($curl, $options);\n\t\t\n\t\t$response = curl_exec($curl);\n\t\t\n\t\tif ( false === $response ) {\n\t\t\techo curl_error($curl);\n\t\t}\n\t\t\n\t\tcurl_close($curl);\n\t\t\n\t\treturn $response;\n\t}",
"function request_post_api($url=\"\",$post=\"\") {\n\tif(empty($url))\n\t\treturn false;\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tif($post){\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); \t\t\n\t}\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $response;\n}",
"function http_post($url, $post_string) {\n\t\t\n\t\t// add any additional curl options here\n\t\t$options = array(CURLOPT_URL => $url,\n\t\tCURLOPT_POST => true,\n\t\tCURLOPT_POSTFIELDS => $post_string,\n\t\tCURLOPT_USERAGENT => $this->user_agent);\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, $options);\n\t\t\n\t\t$response = curl_exec($ch);\n\t\t$this->last_response = $response;\n\t\t$info = curl_getinfo($ch);\n\t\t\n\t\tcurl_close($ch);\n\t\t\n\t\t// all good\n\t\tif ($info['http_code'] == 204)\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"protected function makePostRequest($uri, $params) {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL,$this->server_url . $uri);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS,\n http_build_query($params));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $output = curl_exec($curl);\n $this->response = $output;\n $this->response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close ($curl);\n }",
"public function post($url, $params = null)\n {\n return $this->request('POST', $url, $params);\n }",
"public static function sendPost($_url, $_data, $_headers = [],\n $_return_header = true)\n {\n return self::sendCurl($_url,\n array(\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_FOLLOWLOCATION => 0,\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => $_data,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_HTTPHEADER => $_headers,\n CURLOPT_HEADER => $_return_header\n ));\n }",
"public function post($url)\n {\n $this->requestType = Client::REQUEST_POST;\n $this->url = $url;\n return $this;\n }",
"public static function post($url, $data, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //Set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n return self::processRequest($ch);\n }",
"function new_post($request,$url) {\n ##Data Post\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n return curl_exec($ch);\n}",
"function post($url, $data) {\n $options = array(\n\t\t 'http' => array(\n\t\t\t\t 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n\t\t\t\t 'method' => 'POST',\n\t\t\t\t 'content' => http_build_query($data),\n\t\t\t\t ),\n\t\t );\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n return $result;\n}",
"function api_post($url, array $post_contents, $username = null, $password = null)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_contents));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n if ($username != NULL) {\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n }\n return $this->gather_response($ch);\n }",
"function post_to_url($url, $data) {\r\n\t\t$fields = '';\r\n\t\tforeach($data as $key => $value) {\r\n\t\t\t$fields .= $key . '=' . $value . '&';\r\n\t\t}\r\n \r\n\t\trtrim($fields, '&');\r\n\t\t$post = curl_init();\r\n \r\n\t\t curl_setopt($post, CURLOPT_URL, $url);\r\n\t\t curl_setopt($post, CURLOPT_POST, count($data));\r\n\t\t curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\r\n\t\t curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t $result = curl_exec($post);\r\n\t\t curl_close($post);\r\n\t}",
"public function postCurlCall($url, $post_params){\n return $this->utilities->curlPost($url, $post_params);\n }",
"public function request_post($uri, array $options = array()) {\n $options['method'] = 'POST';\n return $this->request($uri, $options);\n }",
"public function post($url, $params = '', array $config = [])\n\t{\n\t\treturn $this->request($url, $params, $config, Request::METHOD_POST);\n\t}",
"function post_request($url, $param)\n{\n //リクエスト時のオプション指定\n $options = array(\n 'http' => array(\n 'method' => 'POST', //ここでPOSTを指定\n 'header' => array(\n 'Content-type: application/x-www-form-urlencoded',\n 'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1'\n ),\n 'content' => http_build_query($param),\n 'ignore_errors' => true,\n 'protocol_version' => '1.1'\n ),\n 'ssl' => array(\n 'verify_peer' => false,\n 'verify_peer_name' => false\n )\n );\n\n //リクエスト実行\n $contents = @file_get_contents($url, false, stream_context_create($options));\n\n //ステータスコード抜粋\n preg_match('/HTTP\\/1\\.[0|1|x] ([0-9]{3})/', $http_response_header[0], $matches);\n $statusCode = (int)$matches[1];\n\n //配列で返すためにjsonのエンコード\n $contents_array = array();\n if($statusCode === 200){\n $contents_array = json_decode($contents);\n }\n return $contents_array;\n}",
"public function http($url, $method='POST', $postfields = null, $headers = array())\r\n {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ci, CURLOPT_COOKIESESSION, true);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, false);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, true);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if (isset($this->accessToken) && $this->accessToken) {\r\n $headers[] = \"Authorization: OAuth2 \" . $this->accessToken;\r\n }\r\n\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n curl_setopt($ci, CURLOPT_URL, $url);\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, true);\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo '=====info=====' . \"\\r\\n\";\r\n print_r(curl_getinfo($ci));\r\n\r\n echo '=====$response=====' . \"\\r\\n\";\r\n print_r($response);\r\n }\r\n\r\n curl_close($ci);\r\n return $response;\r\n }",
"public function https_post($url, $data = [] , $is_raw = false){\n// $this->response = $curl->post($url , $data , $is_raw)\n// ->setHeader('X-Requested-With', 'XMLHttpRequest')\n// ->setHeader(\"Accept\" , 'application/json')\n// ->setHeader('Content-Type' , 'application/json')\n// //->setOpt(CURLOPT_PROXY , '127.0.0.1:8888')\n// ->response;\n\n $header = [\n 'Accept:application/json' , 'Content-Type:application/json'\n ];\n $this->response = $this->https_request($url , json_encode($data ) , $header);\n\n return $this;\n }",
"public static function Post($url, $vars, $auth = false) \r\n {\r\n return self::doRequest('POST', $url, $vars, $auth);\r\n }",
"public function curlRequest($url, $headers, $body)\n\t{\n\t\t$header_strings = array();\n\t\tforeach ($headers as $key => $val) {\n\t\t\t$header_strings[] = \"{$key}: {$val}\";\n\t\t}\n\n\t\t$curlHandle = curl_init();\n\t\tcurl_setopt($curlHandle, CURLOPT_URL, $url);\n\t\tcurl_setopt($curlHandle, CURLOPT_POST, 1);\n\t\tcurl_setopt($curlHandle, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($curlHandle, CURLOPT_TIMEOUT, $this->timeout);\n\t\tcurl_setopt($curlHandle, CURLOPT_POSTFIELDS, $body);\n\t\tcurl_setopt($curlHandle, CURLOPT_HTTPHEADER, $header_strings);\n\t\tcurl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_exec($curlHandle);\n\t\t$status = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE);\n\t\tcurl_close($curlHandle);\n\t\treturn $status;\n\t}",
"public function post($uri = null, $headers = null, $postBody = null)\n {\n return $this->createRequest('POST', $uri, $headers, $postBody);\n }",
"public function post($url, $params = [])\n {\n return $this->request($url, 'POST', $params);\n }",
"function post($url, $headers, $params)\n{\n $data = json_encode($params);\n\n $curl = curl_init();\n\n array_push($headers, \"Content-Type: application/json\");\n array_push($headers, \"Content-Length: \" . strlen($data));\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n // print_r(\"=========请求信息 start =========\\n\");\n // print_r($url . \"\\n\");\n // print_r(json_encode($headers) . \"\\n\");\n // print_r($data . \"\\n\");\n $response = curl_exec($curl);\n curl_close($curl);\n // print_r(\"==============================\\n\");\n // print_r($response);\n // print_r(\"\\n=========请求信息 end =========\\n\");\n return $response;\n}",
"public function post($url, $params=array(), $token='', $secret='') {\n return $this->request('POST', $url, $params, $token, $secret);\n }",
"function curl_post($url, array $post = NULL, array $options = array()) {\n\t\t$this->curlError = 0;\n\t $defaults = array(\n\t CURLOPT_POST => 1,\n\t CURLOPT_HEADER => 0,\n\t CURLOPT_URL => $url,\n\t CURLOPT_FRESH_CONNECT => 1,\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_FORBID_REUSE => 1,\n\t CURLOPT_TIMEOUT => 4,\n\t CURLOPT_POSTFIELDS => $this->decodeParamsIntoGetString($post),\n\t\t\tCURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT']\n\t );\n\t \n\t $this->logMessage(\"Posting to: \".$this->decodeParamsIntoGetString($post));\n\t\t\n\t $ch = curl_init();\n\t curl_setopt_array($ch, ($options + $defaults));\n\t if( !$result = curl_exec($ch))\n\t { \n\t // trigger_error(curl_error($ch));\n\t \t$this->curlError = curl_error($ch);\n\t \treturn false;\n\t }\n\t else {\n\t \treturn $result;\n\t \n\t \t} \t\n\t}",
"function ccweb_httpPost2($url, $data, &$outResponse) { \r\n $params = array('http' => array('method' => 'POST', 'content' => $data)); \r\n $context = stream_context_create($params);\r\n\r\n $fh = fopen($url, 'rb', false, $context);\r\n if (!$fh) {return FALSE;} \r\n \r\n $response = stream_get_contents($fh); \r\n if ($response === false) {return FALSE;} \r\n \r\n $outResponse = $response; \r\n return TRUE; \r\n}",
"protected function post($url, $params) {\n $client = new Emory_Http_Client($url,\n array('timeout' => 60)\t// increase timeout to 60 seconds (default is 10)\n );\n $client->setParameterPost($params);\n $client->setEncType(Zend_Http_Client::ENC_FORMDATA);\n $client->setMethod(Zend_Http_Client::POST);\n $response = $client->request();\n if ($response->isSuccessful())\n return $response->getRawBody();\t// don't do any decoding, etc\n else {\n // FIXME: is this exception-worthy?\n throw new SolrException($response->getMessage());\n }\n }",
"function request(string $url, string $fields = '', int $isPost = 0)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, $isPost);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n if ($isPost) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n }\n $requestHeaders = array(\n 'Content-type: application/x-www-form-urlencoded',\n 'Content-Length: ' . strlen($fields),\n );\n curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);\n return curl_exec($ch);\n}",
"public function post($url, $params = false, $options = false, $timeout = false)\n\t\t{\n\t\t\treturn $this->request($url, $params, self::POST, $options, $timeout);\n\t\t}",
"public function post($url, $data = array()) {\n\t\treturn $this->request($url, $data, true);\n\t}",
"function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}",
"static function file_post_contents($url,$headers=false) {\n $url = parse_url($url);\n\n if (!isset($url['port'])) {\n if ($url['scheme'] == 'http') { $url['port']=80; }\n elseif ($url['scheme'] == 'https') { $url['port']=443; }\n }\n $url['query']=isset($url['query'])?$url['query']:'';\n\t\t\n $url['protocol']=$url['scheme'].'://';\n $eol=\"\\r\\n\";\n\t\t\n $headers = \"POST \".\n\t\t$url['protocol'].$url['host'].$url['path'].\" HTTP/1.0\".$eol.\n\t\t\"Host: \".$url['host'].$eol.\n\t\t\"Referer: \".$url['protocol'].$url['host'].$url['path'].$eol.\n\t\t\"Content-Type: application/x-www-form-urlencoded\".$eol.\n\t\t\"Content-Length: \".strlen($url['query']).$eol.\n\t\t$eol.\n\t\t$url['query'];\n $fp = fsockopen($url['host'], $url['port'], $errno, $errstr, 30);\n if($fp) {\n fputs($fp, $headers);\n $result = '';\n while(!feof($fp)) { $result .= fgets($fp, 128); }\n fclose($fp);\n if (!$headers) {\n //removes headers\n\t// NOTE: these backslashes work, b/c they are actual chars!\n $pattern=\"/^.*\\r\\n\\r\\n/s\";\n $result=preg_replace($pattern,'',$result);\n }\n return $result;\n }\n }",
"private function http($url, $method, $postfields = NULL, $headers = array())\n {\n $this->http_info = array();\n $ci = curl_init();\n /* Curl settings */\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\n\n switch ($method) {\n case 'POST':\n curl_setopt($ci, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n }\n break;\n case 'DELETE':\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)) {\n $url = \"{$url}?{$postfields}\";\n }\n }\n\n curl_setopt($ci, CURLOPT_URL, $url );\n if($headers) {\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\n }\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\n\n $response = curl_exec($ci);\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\n\n if ($this->debug) {\n echo \"=====post data======\\r\\n\";\n var_dump($postfields);\n\n echo '=====info====='.\"\\r\\n\";\n print_r( curl_getinfo($ci) );\n\n echo '=====$response====='.\"\\r\\n\";\n print_r( $response );\n }\n curl_close ($ci);\n return $response;\n }",
"private function doPost($url, $data) {\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query($data),\n ),\n );\n\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n\n Logger::info(\"Got result from GW: \". $result);\n }",
"function post(Request &$request, Response &$response);",
"public function send_post_request(){\n $url = \\Request::get('url');\n $post_array = \\Request::all();\n\n//\t\t$url = 'http://localhost/_websites/ahmed-badawy.com/site/json-test';\n//\t\t$post_array = array('type' => 'scss', 'source' => '.pre{color:red;background-color:green;}', 'compress'=>true);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post_array);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $query = curl_exec($ch);\n curl_close($ch);\n\n return $query;\n }",
"function curl_post($url, $postfields=array(), $headers=array(), $auth=array()) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);\n if(!empty($auth['username']) && !empty($auth['password'])) {\n curl_setopt($ch, CURLOPT_USERPWD, $auth['username'].\":\".$auth[\"password\"]);\n }\n return curl_exec($ch);\n}",
"protected function _doPost($in_url, $in_content, $in_content_type, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'POST', $in_content, $in_content_type, $in_additional_curl_options);\r\n }",
"function http_post_data($url, $data = null, ?array $options = null, ?array &$info = null) {}",
"static function submitHttpPost($url, $postParams = null, $timeout = 50) {\n $ch = curl_init();\n\n // set up the request\n curl_setopt($ch, CURLOPT_URL, $url);\n // make sure we submit this as a post\n curl_setopt($ch, CURLOPT_POST, true);\n if (isset($postParams)) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);\n }else{\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"\"); \t\n }\n // make sure problems are caught\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n // return the output\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // set the timeouts\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);\n curl_setopt($ch, CURLOPT_TIMEOUT,$timeout);\n // set the PHP script's timeout to be greater than CURL's\n set_time_limit($timeout + 25);\n\n $result = curl_exec($ch);\n // check for errors\n if (0 == curl_errno($ch)) {\n curl_close($ch);\n return $result;\n } else {\n\t\t\t$this->modx->log(MODX_LOG_LEVEL_ERROR,'XFlickr Request failed. '.curl_errno($ch).': '. curl_error($ch).' URL:'.$url);\n curl_close($ch);\n }\n }",
"public static function post($uri,$params=[],$options=[]) {\n return self::request('POST',$uri,$params,$options);\n }",
"public static function http_post($url, $postargs = NULL, $output_errors = TRUE) {\n $session = curl_init();\n // Set the POST options.\n curl_setopt($session, CURLOPT_URL, $url);\n if ($postargs !== NULL) {\n curl_setopt($session, CURLOPT_POST, TRUE);\n if (is_array($postargs) && version_compare(phpversion(), '5.5.0') >= 0) {\n // Posting a file using @ prefix is deprecated as of version 5.5.0.\n foreach ($postargs as $key => $value) {\n // Loop through postargs to find files where the value is prefixed @.\n if (strpos($value ?? '', '@') === 0) {\n // Found a file - could be in form @path/to/file;type=mimetype.\n $fileparts = explode(';', substr($value, 1));\n $filename = $fileparts[0];\n if (count($fileparts) == 1) {\n // Only filename specified.\n $postargs[$key] = new CurlFile($filename);\n }\n else {\n // Mimetype may be specified too.\n $fileparam = explode('=', $fileparts[1]);\n if ($fileparam[0] == 'type' && isset($fileparam[1])) {\n // Found a mimetype.\n $mimetype = $fileparam[1];\n $postargs[$key] = new CurlFile($filename, $mimetype);\n }\n else {\n // The fileparam didn't seem to be a mimetype.\n $postargs[$key] = new CurlFile($filename);\n }\n }\n }\n }\n }\n curl_setopt($session, CURLOPT_POSTFIELDS, $postargs);\n }\n curl_setopt($session, CURLOPT_HEADER, FALSE);\n curl_setopt($session, CURLOPT_RETURNTRANSFER, TRUE);\n // Do the POST and then close the session.\n $response = curl_exec($session);\n $httpCode = curl_getinfo($session, CURLINFO_HTTP_CODE);\n $curlErrno = curl_errno($session);\n // Check for an error, or check if the http response was not OK.\n if ($curlErrno || $httpCode != 200) {\n if ($output_errors) {\n echo '<div class=\"error\">cUrl POST request failed. Please check cUrl is installed on the server and the $base_url setting is correct.<br/>URL:' . $url . '<br/>';\n if ($curlErrno) {\n echo 'Error number: ' . $curlErrno . '<br/>';\n echo 'Error message: ' . curl_error($session) . '<br/>';\n }\n echo \"Server response<br/>\";\n echo $response . '</div>';\n }\n $return = [\n 'result' => FALSE,\n 'output' => $curlErrno ? curl_error($session) : $response,\n 'errno' => $curlErrno,\n 'status' => $httpCode\n ];\n }\n else {\n $arr_response = explode(\"\\r\\n\\r\\n\", $response);\n // Last part of response is the actual data.\n $return = ['result' => TRUE, 'output' => array_pop($arr_response)];\n }\n curl_close($session);\n return $return;\n }",
"public function post($url = null, array $data = [])\n {\n $this->init($url);\n\n curl_setopt($this->handler, CURLOPT_POST, count($data));\n curl_setopt($this->handler, CURLOPT_POSTFIELDS, http_build_query($data));\n\n return $this->exec();\n }",
"protected static function post(string $url, array $params = [], array $opts = [], array $headers = []) : string\n {\n $data = http_build_query($params);\n\n $opts[CURLOPT_URL] = $url;\n $opts[CURLOPT_CONNECTTIMEOUT] = 5;\n $opts[CURLOPT_TIMEOUT] =5;\n $opts[CURLOPT_RETURNTRANSFER] = true;\n $opts[CURLOPT_POST] = true;\n $opts[CURLOPT_POSTFIELDS] = $data;\n $opts[CURLOPT_SSL_VERIFYHOST] = false;\n $opts[CURLOPT_SSL_VERIFYPEER] = false;\n $opts[CURLOPT_ENCODING] = \"\";\n $opts[CURLOPT_HTTPHEADER] = $headers;\n\n if (static::$proxy != \"\" && static::$proxyPort > 0) {\n $opts[CURLOPT_PROXY] = static::$proxy;\n $opts[CURLOPT_PROXYPORT] = static::$proxyPort;\n }\n\n $ch = curl_init();\n curl_setopt_array($ch, $opts);\n $result = curl_exec($ch);\n curl_close($ch);\n\n return $result;\n }",
"function PostURL($url, $postData, $options = array())\n\t{\n\t\t//\t\t$postString = '';\n\t\t//\t\tforeach ($postData as $key => $value) { $postString .= \"$key=$value&\"; }\n\n//\t\t\n//\t\t$options['post_string'] = http_build_query($postData);\n\t\t$options['post_array'] = $postData;\n\t\treturn self::FetchURL($url, $options);\n\t\t\n\t}",
"private function submitRequest($url, $data) { \n\t\t$accessToken = $this->getAccessToken();\n\t\tif($accessToken == '' || $accessToken == FALSE) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: Bearer '.$accessToken));\n\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\n\t\treturn $response;\n\t}",
"private function post (string $url)\r\n\t{\r\n\t\ttry {\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t$handle = curl_init();\t\t\t\r\n\t\t\tcurl_setopt_array($handle, array(\r\n\t\t\t\tCURLOPT_URL => $url,\r\n\t\t\t\tCURLOPT_CONNECTTIMEOUT => 5,\r\n\t\t\t\tCURLOPT_TIMEOUT => 60,\r\n\t\t\t\tCURLOPT_RETURNTRANSFER => true,\r\n\t\t\t\tCURLOPT_POST => true,\r\n\t\t\t\tCURLOPT_POSTFIELDS => $this->paramUrl\r\n\t\t\t\t));\t\t\r\n\t\t\t//curl_setopt($ch, CURLOPT_ENCODING ,\"\");\r\n\t\t\t//curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded; charset=UTF-8'));\r\n\t\t\t\r\n\t\t\t$response = curl_exec($handle);\t\t\r\n\t\t\t$resp = json_decode($response);\t\t\t\r\n\t\t\tif ($resp['ok'] == false)\r\n\t\t\t\tthrow new \\Exception($resp['description']);\t\t\t\r\n\t\t\t\r\n\t\t} catch ( \\Exception $e) {\r\n\t\t\t$Logger = new \\Logger('TelegramMain.txt');\r\n\t\t\t$Logger -> log($response, $url.$this->paramUrl);\r\n\t\t}finally{\t\t\t\r\n\t\t\tcurl_close($handle);\t\t\r\n\t\t\treturn $response;\t\t\t\r\n\t\t}\r\n\r\n\t}",
"function post($url, $data = '', $content_type = '')\n{\n\t\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n\t\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\n\tif ($content_type != '')\n\t{\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, \n\t\t\tarray(\n\t\t\t\t\"Content-type: \" . $content_type\n\t\t\t\t)\n\t\t\t);\n\t}\t\n\t\n\t$response = curl_exec($ch);\n\tif($response == FALSE) \n\t{\n\t\t$errorText = curl_error($ch);\n\t\tcurl_close($ch);\n\t\tdie($errorText);\n\t}\n\t\n\t$info = curl_getinfo($ch);\n\t$http_code = $info['http_code'];\n\t\t\n\tcurl_close($ch);\n\t\n\treturn $response;\n}",
"function postDataToUrl($url, $data) {\r\n $curl = curl_init();\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($curl, CURLOPT_VERBOSE, 0);\r\n curl_setopt($curl, CURLOPT_HEADER, 1);\r\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n $response = curl_exec ($curl);\r\n curl_close ($curl);\r\n\treturn $response;\r\n}",
"public static function post($url,array $params = array()) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $params);\n $data = curl_exec($ch);\n curl_close($ch);\n\n return $data;\n }",
"function forwardPostRequest($url, $data) {\n\t\t\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => $url,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_POST => 1,\n\t\t\tCURLOPT_POSTFIELDS => $data,\n\t\t\tCURLOPT_HTTPHEADER => array(\"cache-control: no-cache\"),\n\t\t\tCURLOPT_SSL_VERIFYPEER => false\n\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\tif ($response === false) echo \"Bad response\";\n\n\t\tcurl_close($curl);\n\t\treturn $response;\n\n\t}",
"public function doPost(array $parsed_body);",
"public static function post($url, $data)\n {\n return self::fetch($url, array (\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => $data\n )\n );\n }",
"function web_hook_post($url, $fields) {\n // url-ify the data for the POST\n foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n rtrim($fields_string,'&');\n\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return ($result);\n}",
"private function callPostMethod($url, $data) {\n\t\t$options = array(\n\t\t\t'http' => array(\n\t\t\t\t'timeout' => 3600,\n\t\t\t\t'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n\t\t\t\t'method' => 'POST',\n\t\t\t\t'content' => http_build_query($data),\n\t\t\t),\n\t\t);\n\t\t$context = stream_context_create($options);\n\t\t$result = file_get_contents($url, false, $context);\n\t}",
"public function makeRequest( $url, $method = 'GET', $headers = null );",
"function wget_post($url, $data) {\n //if ($data == null) $data = array(\"\"=>\"\");\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n //'header'=> \"Content-Type: application/json\\r\\n\" .\n // \"Accept: application/json\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query($data),\n ),\n );\n $context = stream_context_create($options);\n return file_get_contents($url, false, $context);\n}",
"public function post($location, $body);",
"private function http($url, $method, $postfields = NULL, $headers = array()) {\n\t\t$response = new \\HttpResponse ( $url, $headers, $method, $postfields );\n\t\t$ci = curl_init ();\n\t\t/* Curl settings */\n\t\tcurl_setopt ( $ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );\n\t\tcurl_setopt ( $ci, CURLOPT_USERAGENT, $this->useragent );\n\t\tcurl_setopt ( $ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout );\n\t\tcurl_setopt ( $ci, CURLOPT_TIMEOUT, $this->timeout );\n\t\tcurl_setopt ( $ci, CURLOPT_RETURNTRANSFER, TRUE );\n\t\tcurl_setopt ( $ci, CURLOPT_ENCODING, \"UTF-8\" );\n\t\tcurl_setopt ( $ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer );\n\t\tcurl_setopt ( $ci, CURLOPT_SSL_VERIFYHOST, \"1\" );\n\t\tcurl_setopt ( $ci, CURLOPT_HEADERFUNCTION, array (\n\t\t\t\t$this,\n\t\t\t\t'getHeader' \n\t\t) );\n\t\tcurl_setopt ( $ci, CURLOPT_HEADER, FALSE );\n\t\t\n\t\tswitch ($method) {\n\t\t\tcase 'POST' :\n\t\t\t\tcurl_setopt ( $ci, CURLOPT_POST, TRUE );\n\t\t\t\tif (! empty ( $postfields )) {\n\t\t\t\t\tcurl_setopt ( $ci, CURLOPT_POSTFIELDS, $postfields );\n\t\t\t\t\t$this->postdata = $postfields;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'DELETE' :\n\t\t\t\tcurl_setopt ( $ci, CURLOPT_CUSTOMREQUEST, 'DELETE' );\n\t\t\t\tif (! empty ( $postfields )) {\n\t\t\t\t\t$url = \"{$url}?{$postfields}\";\n\t\t\t\t}\n\t\t}\n\t\t$headers [] = \"API-RemoteIP: \" . $_SERVER ['REMOTE_ADDR'];\n\t\tcurl_setopt ( $ci, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ci, CURLOPT_HTTPHEADER, $headers );\n\t\tcurl_setopt ( $ci, CURLINFO_HEADER_OUT, TRUE );\n\t\t\n\t\t$response->data = curl_exec ( $ci );\n\t\t$response->http_code = curl_getinfo ( $ci, CURLINFO_HTTP_CODE );\n\t\t$response->http_info = array_merge ( $response->http_info, curl_getinfo ( $ci ) );\n\t\t$response->url = $url;\n\t\tcurl_close ( $ci );\n\t\treturn $response;\n\t}",
"private function create_curl($s_url, $post_params = array() )\n\t{\n\n\t\t$full_url = $this->settings['server'];\n if ($this->settings['port'] != '80') $full_url .= ':' . $this->settings['port'];\n $full_url .= $s_url ;\n\n\t\t$this->log( 'curl_init( ' . $full_url . ' )' );\n\t\t\n $post_value = Centrifuge::array_implode( '=', '&', $post_params );\n \n\t\t# Set cURL opts and execute request\n\t\t$ch = curl_init();\n\t\tif ( $ch === false )\n\t\t{\n\t\t\tthrow new CentrifugeException('Could not initialize cURL!');\n\t\t}\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $full_url );\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array ( \"Content-type: application/x-www-form-urlencoded\" ) );\t\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $this->settings['timeout'] );\n\t\t\n $this->log( 'trigger POST: ' . $post_value );\n\n\t\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $post_value );\n \n\t\treturn $ch;\n\t}",
"function Send($url, $POST){ //работа с CURL'ом\n\t$ch = curl_init();// Устанавливаем соединение\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $POST);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\n\t$result = curl_exec($ch);\n\n\tif($result === false) print $err = curl_error($ch);\n\n\treturn $result;\n}",
"public function zendRequest($url, $headers, $body)\n\t{\n\t\t$header_strings = array();\n\t\tforeach ($headers as $key => $val) {\n\t\t\t$header_strings[] = \"{$key}: {$val}\";\n\t\t}\n\n\t\t$client = new Zend_Http_Client($url);\n\t\t$client->setHeaders($header_strings);\n\t\t$client->setRawData($body, 'text/xml');\n\n\t\t$response = $client->request('POST');\n\n\t\treturn $response->getStatus();\n\t}",
"private function post(string $url, array $data = [], array $headers = []): string\n {\n try {\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n $response = curl_exec($ch);\n if (curl_errno($ch)) {\n throw new Exception(\"cURL Error: \" . curl_error($ch));\n } else {\n return $response;\n }\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }",
"function do_it_background($url, $params)\n {\n $post_string = http_build_query($params);\n $parts = parse_url($url);\n $errno = 0;\n $errstr = \"\";\n \n //Use SSL & port 443 for secure servers\n //Use otherwise for localhost and non-secure servers\n //For secure server\n //$fp = fsockopen('ssl://' . $parts['host'], isset($parts['port']) ? $parts['port'] : 443, $errno, $errstr, 30);\n //For localhost and un-secure server\n $fp = fsockopen($parts['host'], isset($parts['port']) ? $parts['port'] : 80, $errno, $errstr, 30);\n \n if(!$fp)\n {\n echo \"Some thing Problem\"; \n }\n $out = \"POST \".$parts['path'].\" HTTP/1.1\\r\\n\";\n $out.= \"Host: \".$parts['host'].\"\\r\\n\";\n $out.= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n $out.= \"Content-Length: \".strlen($post_string).\"\\r\\n\";\n $out.= \"Connection: Close\\r\\n\\r\\n\";\n if (isset($post_string)) $out.= $post_string;\n fwrite($fp, $out);\n fclose($fp);\n }",
"function send_request( $http_method, $url, $auth_header = null, $postData = null ) {\n\t$curl = curl_init( $url );\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_FAILONERROR, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\n\tswitch( $http_method ) {\n\t\tcase 'GET':\n\t\t\tif( $auth_header ) {\n\t\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( $auth_header ) );\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'POST':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/atom+xml',\n\t\t\t\t$auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_POST, 1 );\n\t\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $postData );\n\t\t\tbreak;\n\t\tcase 'PUT':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/atom+xml',\n\t\t\t\t$auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $http_method );\n\t\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $postData );\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( $auth_header ) );\n\t\t\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $http_method );\n\t\t\tbreak;\n\t}\n\t$response = curl_exec( $curl );\n\tif( !$response ) {\n\t\t$response = curl_error( $curl );\n\t}\n\tcurl_close( $curl );\n\treturn $response;\n}",
"public static function performRequest($url, $post = array()) {\r\n\t\t// preparation de l'envoi\r\n\t\t$ch = curl_init();\r\n\t\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tif($post) {\r\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post, '', '&'));\r\n\t\t} else {\r\n\t\t\tcurl_setopt($ch, CURLOPT_POST, false);\r\n\t\t}\r\n\t\t\t\r\n\t\tif (isset($_SERVER['HTTPS'])) {\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n\t\t}\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); //Fixes the HTTP/1.1 417 Expectation Failed Bug\r\n\t\r\n\t\t// Let's forward all cookies so the session in preserved.\r\n\t\t// Problem: because the session file is locked, we cannot do that without closing the session first\r\n\t\tsession_write_close();\r\n\t\r\n\t\t$cookieArr = array();\r\n\t\tforeach ($_COOKIE as $key=>$value) {\r\n\t\t\t$cookieArr[] = $key.\"=\".urlencode($value);\r\n\t\t}\r\n\t\t$cookieStr = implode(\"; \", $cookieArr);\r\n\t\tcurl_setopt($ch, CURLOPT_COOKIE, $cookieStr);\r\n\t\r\n\t\t$response = curl_exec($ch );\r\n\t\r\n\t\t// And let's reopen the session...\r\n\t\tsession_start();\r\n\t\r\n\t\tif( curl_error($ch) ) {\r\n\t\t\tthrow new MoufException(\"An error occurred: \".curl_error($ch));\r\n\t\t}\r\n\t\tcurl_close( $ch );\r\n\t\r\n\t\treturn $response;\r\n\t}",
"public function post($url,$param,$header=null){\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$url);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($param));\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\t\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t$response = curl_exec($ch);\n\t\t$err = curl_error($ch);\n\t\tcurl_close($ch);\n\t\tif ($err) {\n\t\t\tarray_push($this->curlError,$err);\n\t\t\treturn $err;\n\t\t} else {\n\t\t $response = json_decode($response, TRUE);\n\t\t}\n\t\treturn $response;\n\t}",
"protected function postHttpRequest(array $data, string $url)\n {\n // TODO use CurlWrapper\n $options = [\n 'http' => [\n 'header' => \"Content-Type: application/x-www-form-urlencoded\\r\\n\" .\n \"User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0\\r\\n\" .\n ($this->sessionId !== '' ? \"Cgi-Authorization: Basic \" . $this->sessionId . \"\\r\\n\" : '') .\n ($this->headers !== null ? implode(\"\\r\\n\", $this->headers) . \"\\r\\n\" : ''),\n 'method' => 'POST',\n 'content' => http_build_query($data)\n ]\n ];\n\n $context = stream_context_create($options);\n $result = file_get_contents($url, false, $context);\n\n $this->assertErrors($result, 'Request have returned warnings/errors');\n\n return json_decode($result);\n }",
"function post($url,$fields){\n curl_setopt($this-> ch,CURLOPT_POST,1);\n curl_setopt($this-> ch,CURLOPT_POSTFIELDS,$fields);\n curl_setopt($this-> ch,CURLOPT_URL,$url);\n curl_setopt($this-> ch,CURLOPT_COOKIE, COOKIE_FILE); \n curl_setopt($this-> ch,CURLOPT_FOLLOWLOCATION,true);\n // 返回跳转后的页面 如果只提交表单,则返回1表示成功\n return $this-> html = curl_exec($this-> ch);\n }"
] | [
"0.794393",
"0.76176304",
"0.75774145",
"0.73404855",
"0.73208547",
"0.7247408",
"0.7201397",
"0.71423835",
"0.6991002",
"0.6944255",
"0.6882476",
"0.6859556",
"0.6844626",
"0.68330806",
"0.67695266",
"0.6766748",
"0.6747542",
"0.67285174",
"0.6716485",
"0.66976315",
"0.6670688",
"0.6668519",
"0.665419",
"0.66021",
"0.65758824",
"0.65541416",
"0.6531476",
"0.6531337",
"0.6525401",
"0.6520522",
"0.6501048",
"0.6499657",
"0.64857274",
"0.64793396",
"0.6472432",
"0.6457684",
"0.6442314",
"0.64376557",
"0.6434792",
"0.64166033",
"0.6409954",
"0.64000684",
"0.6357673",
"0.63519764",
"0.6343768",
"0.63409436",
"0.6340783",
"0.63377017",
"0.6316318",
"0.63084304",
"0.6303461",
"0.6300747",
"0.62961274",
"0.6295233",
"0.62783957",
"0.6278026",
"0.62774825",
"0.6277352",
"0.62759966",
"0.62732863",
"0.62612265",
"0.6253989",
"0.62483644",
"0.62411034",
"0.62401956",
"0.6231638",
"0.6229466",
"0.6208446",
"0.6201473",
"0.6194447",
"0.61907893",
"0.6181144",
"0.6173954",
"0.616417",
"0.6163949",
"0.614357",
"0.6136106",
"0.61268264",
"0.61175966",
"0.61174196",
"0.6113281",
"0.6099111",
"0.6098419",
"0.6093658",
"0.6091188",
"0.60821056",
"0.60682636",
"0.60610026",
"0.6059212",
"0.6047267",
"0.6039783",
"0.6030941",
"0.60269696",
"0.6008088",
"0.60044056",
"0.60014784",
"0.5996752",
"0.59962326",
"0.5993053",
"0.59835094"
] | 0.7181827 | 7 |
Perform a put request on the given url with optional body and headers | static function put($url, $body = null, $headers = array()) {
$request = new NiceHTTP\PutRequest($url, $body, $headers);
return $request->send();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function put($url, $body = array(), $query = array(), $headers = array());",
"public function put(string $url, array $input = [], $headers = null);",
"public function put($url, $headers = [], $data = [], $options = [])\n {\n }",
"public function _put($url = null, array $parameters = []);",
"public static function put($url, $headers = [], $data = [], $options = [])\n {\n }",
"function put($url, $fields, $headers)\n{\n $ch = curl_init($url); //initialize and set url\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\"); //set as put request\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); //set fields, ensure they are properly encoded\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // set headers pass encoding here and tokens.\n $response = curl_exec($ch); // save the response\n curl_close ($ch);\n return $response;\n}",
"public static function put($url, array $options = []) {\n $ch = curl_init();\n static::parse_query_params($url, $options);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n static::set_body($ch, $options);\n static::parse_options($ch, $options);\n return static::parse_response(curl_exec($ch), $options);\n }",
"function put($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'PUT', 'body' => $data), $options));\n\t}",
"function put($url, $data = \"\", $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"PUT\";\n $http_options[CURLOPT_POSTFIELDS] = $data;\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }",
"public function put( $url, array $headers=array(), $data=null ) {\n return $this->httpRequest( $url, 'PUT', $headers, $data );\n }",
"public function put($uri, $body = null, array $headers = []): ResponseInterface;",
"public function put($location, $body);",
"public function put(string $uri, array $params = [], $body = null, array $headers = []): ResponseInterface;",
"public function put($url, $params = false, $options = false, $timeout = false)\n\t\t{\n\t\t\treturn $this->request($url, $params, self::PUT, $options, $timeout);\n\t\t}",
"public static function put($url, $data, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n return self::processRequest($ch);\n }",
"public function Put( $sUrl, $vRequestBody, $bJsonEncode = false );",
"public function put($url, $params = '', array $config = [])\n\t{\n\t\treturn $this->request($url, $params, $config, Request::METHOD_PUT);\n\t}",
"public function put($url, $params = []) \n {\n return $this->request('PUT', $url, $params);\n }",
"public function put($url, $params = null)\n {\n return $this->request('PUT', $url, $params);\n }",
"function put(Request &$request, Response &$response);",
"public static function urlPUT($url, $data, $headers=null) {\n\n $isJsonForm = false;\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n $arrKeys = array_keys($data);\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n curl_close($ch);\n\n return utf8_encode($contents);\n }",
"public function put($url)\n {\n $this->requestType = Client::REQUEST_PUT;\n $this->url = $url;\n return $this;\n }",
"public function put($url, $params = [])\n {\n return $this->request($url, 'PUT', $params);\n }",
"protected function makePutRequest($uri, $params) {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL,$this->server_url . $uri);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS,\n http_build_query($params));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $output = curl_exec($curl);\n $this->response = $output;\n $this->response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close ($curl);\n }",
"public function _PUT($url, $params = null, $username = null, $password = null, $contentType = null)\n {\n $response = $this->call($url, 'PUT', $params, $username, $password, $contentType);\n\n return $this->parseResponse($this->convertEncoding($response, 'utf-8', $this->_encode));\n }",
"private function curl_put($url, $data)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }",
"protected function _doPut($in_url, $in_content, $in_content_type, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'PUT', $in_content, $in_content_type, $in_additional_curl_options);\r\n }",
"private function put($url, $content = '', $type = 'application/xml', $header = '') {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Set headers.\n\t\t$headers = array();\n\t\tif (!empty($type)) {\n\t\t\t$headers[] = 'Content-Type: ' . $type . '; charset=UTF-8';\n\t\t}\n\t\t$headers[] = 'Content-Length: ' . strlen($content);\n\t\tif (!empty($header)) {\n\t\t\t$headers[] = $header;\n\t\t}\n\n\t\t// PUT in PHP requires content to be in a file. Store in temp.\n\t\t$fp = fopen(\"php://temp\", \"r+\");\n\t\tfputs($fp, $content);\n\t\trewind($fp);\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\tif (count($headers) > 0) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\tfclose($fp);\n\t\treturn $output;\n\t}",
"public function put($uri = null, $headers = null, $body = null)\n {\n return $this->createRequest('PUT', $uri, $headers, $body);\n }",
"public function doPut($path, array $parsed_body);",
"public function put(string $uri, array $options = []): ResponseInterface {\n return $this->request('PUT', $uri, $options);\n }",
"function restPut($url, $content) {\n\t$ch = curl_init();\n\t// Uses the URL passed in that is specific to the API used\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t// When posting to a Fuel API, content-type has to be explicitly set to application/json\n\t$headers = [\"Content-Type: application/json\", \"User-Agent: \" . getSDKVersion()];\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t// The content is the JSON payload that defines the request\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t//Need to set ReturnTransfer to True in order to store the result in a variable\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t//Need to set the request to be a PATCH\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t// Disable VerifyPeer for SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$outputJSON = curl_exec($ch);\n\t$responseObject = new \\stdClass();\n\t$responseObject->body = $outputJSON;\n\t$responseObject->httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\treturn $responseObject;\n}",
"public function put($database, $url, $data);",
"public function put($url, array $options = null) {\n\t\treturn $this->put_pseudo($url, $options);\n\t\t}",
"function http_put_data($url, $data = null, ?array $options = null, ?array &$info = null) {}",
"function rest_put_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}",
"public function put($url, $data, $access_token = null){\n\n if ($access_token == null)\n $access_token = CakeSession::read('OPAUTH_ACCESS_TOKEN');\n\n $HttpSocket = new HttpSocket();\n $response = $HttpSocket->put(\n $url,\n json_encode($data),\n array(\n 'header' => array(\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $access_token,\n ),\n )\n );\n\n if ($response->code == 200){\n return json_decode($response->body, true);\n }\n\n $error = array(\n 'message' => \"Error with PUT to $url\",\n 'code' => $response->code,\n 'raw' => array(\n 'response' => $response,\n 'headers' => $response->headers,\n ),\n );\n\n CakeLog::write(LOG_ERROR, \"Error in put(). URL: $url. Data: \" . print_r($data, true) . \". Error: \" . print_r($error,1));\n\n $this->errorCallback($error);\n switch ($response->code){\n case 404:\n throw new NotFoundException($error['message']);\n break;\n }\n return $error;\n }",
"public function put($url, $endpoint = \"\", $header = array(), $query = array(), $sendJSON = false)\n {\n if ($sendJSON == true) {\n $payload = json_encode($query);\n } else {\n $payload = $query;\n }\n\n // Prepare new cURL resource\n $ch = curl_init($url . $endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n //curl_setopt($ch, CURLOPT_PUT, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n if (array_key_exists('headers', $header)) {\n // Set HTTP Header for POST request \n curl_setopt($ch, CURLOPT_HTTPHEADER, $header['headers']);\n }\n\n // Submit the POST request\n $result = curl_exec($ch);\n\n //header('Content-Type: application/json');\n return json_encode(json_decode($result));\n\n // Close cURL session handle\n curl_close($ch);\n }",
"public function put($path, $parameters = null, $body = null);",
"abstract public function put(Request $request);",
"public function put($url = '/', $options = [])\n {\n return $this->send($url, $options, 'PUT');\n }",
"public static function put($url, $data)\n {\n $putData = tmpfile();\n\n fwrite($putData, $data);\n fseek($putData, 0);\n\n $result = self::fetch($url, array(\n CURLOPT_PUT => true,\n CURLOPT_INFILE => $putData,\n CURLOPT_INFILESIZE => strlen($putData)\n ));\n\n fclose($putData);\n\n return $result;\n }",
"function http_put_stream($url, $stream = null, ?array $options = null, ?array &$info = null) {}",
"protected function httpPut(string $path, array $params = [], array $requestHeaders = []): ResponseInterface\n {\n return $this->httpClient->request('PUT', $path, [\n 'body' => $this->createJsonBody($params),\n 'headers' => $requestHeaders,\n ]);\n }",
"public function put ( $path, $body = null, $params ) {\n \n \t$body = json_encode ( $body );\n \n $opts = array (\n\t\t\t CURLOPT_HTTPHEADER \t\t=> array ( 'Content-Type: application/json' ),\n\t\t\t CURLOPT_CUSTOMREQUEST \t=> \"PUT\",\n\t\t\t CURLOPT_POSTFIELDS \t\t=> $body\n );\n \n $exec = $this->execute ( $path, $opts, $params );\n\n return $exec;\n }",
"public function put($path, array $params = array())\n\t{\n\t\t// If a new resource is created, the origin server MUST inform the user agent via the 201 (Created) response.\n\t\t// If an existing resource is modified, either the 200 (OK) or 204 (No Content) response codes SHOULD be sent to indicate successful completion of the request.\n\t\t$this->Response->end('HTTP PUT', 501); // 501 Not Implemented\n\t}",
"public function curlPutCall( $url, $postData ) \n {\n // prx($postData);\n $fields = array();\n foreach ($postData as $postKey => $postVal){\n $fields[$postKey] = urlencode($postVal);\n }\n //url-ify the data for the POST\n foreach($fields as $key=>$value) { \n $fields_string .= $key.'='.$value.'&';\n }\n \n rtrim($fields_string, '&');\n\n try\n {\n // $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //execute post\n $result = curl_exec($ch);\n \n //close connection\n curl_close($ch);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n \n $responseArr = json_decode($result, true);\n return $responseArr;\n }",
"public function requestPut(string $path, string $body): bool\n {\n return $this->request('put', $path, $body);\n }",
"public function put($path, $data = null);",
"public function controllerPUT($url) {\r\n\treturn $this->controller($url);\r\n }",
"function http_put_file($url, $file = null, ?array $options = null, ?array &$info = null) {}",
"public function put($localFile, $remoteFile, $url);",
"public function makePutRequest($routeName, $routeParams = array(), $putParams = array())\n\t{\n\t\t$uri = Route::url($routeName, $routeParams);\n\n\t\ttry\n\t\t{\n\t\t\t$request = Request::factory($uri);\n\t\t\t$this->_response = $request\n\t\t\t\t->method(Http_Request::PUT)\n\t\t\t\t->post($putParams)\n\t\t\t\t->execute();\n\t\t}\n\t\tcatch (RedirectException $e)\n\t\t{\n\t\t\t$this->_redirect = json_decode($e->getMessage(), TRUE);\n\t\t}\n\t}",
"abstract public function put($data);",
"function doPUT (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"PUT method not supported\");\n }",
"public function put(...$args)\n {\n return $this->curl('put', ...$args);\n }",
"public function put($uri, array $data = [], array $headers = []): TestResponse\n {\n return $this->call('PUT', $uri, $data, $this->defaultCookies, [], $headers);\n }",
"public function put( $uri, $parameters = [], $headers = [] )\n {\n return $this->send( $uri, 'PUT', $parameters, $headers );\n }",
"public function put($path, $content);",
"public function put($content);",
"public function put()\n {\n #HTTP method in uppercase (ie: GET, POST, PUT, DELETE)\n $sMethod = 'PUT';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_POSTFIELDS, $this->getData());\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"accept-language: \" . $this->getAcceptLanguage(),\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'PUT::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'PUT::DATA', $this->getData());\n Log::write('WebRequest', 'PUT::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'PUT::RESPONSE', $sOutput);\n\n $this->setData('');\n\n if ($iHTTPCode !== 204) {\n print_r($sOutput);\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 204');\n }\n return $sOutput;\n }",
"public function put($content = NULL) {\n\t\tif (is_array ( $content )) {\n\t\t\t$content = http_build_query ( $content );\n\t\t\t$this->setHeader ( 'Content-Type', 'application/x-www-form-urlencoded' );\n\t\t}\n\t\t$this->request_body = $content . self::CRLF . self::CRLF;\n\t\t$this->method = \"PUT\";\n\t\t$this->send ();\n\t\treturn $this->status_code;\n\t}",
"public function sendPutRequestToUrl(\n\t\tstring $fullUrl,\n\t\tstring $user,\n\t\tstring $password,\n\t\tstring $xRequestId = '',\n\t\tarray $headers = [],\n\t\tstring $content = \"\"\n\t): ResponseInterface {\n\t\treturn HttpRequestHelper::sendRequest($fullUrl, $xRequestId, 'PUT', $user, $password, $headers, $content);\n\t}",
"function make_put_call($mid_url, $put_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($put_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }",
"public function put(\n $url,\n ParametersBagInterface $parameters = null,\n $cacheLifeTime = 500\n ) {\n return $this->request('PUT', $url, $parameters, $cacheLifeTime);\n }",
"private function put_request( $endpoint = '/', $args = [], $request_args = [] ) {\n return $this->request( 'PUT', $endpoint, $args, $request_args );\n }",
"private function put($uri, $data = null)\n {\n $request = $this->client->put($uri, ['body' => $this->toJson($data)]);\n\n return $this->createResponse($request);\n }",
"public function put($path,$content) ;",
"public function api_put($path, $data = array()) {\n\n $path = GoCardless_Client::$api_path . $path;\n\n return $this->request('put', $path, $data);\n\n }",
"public function httpPut()\n {\n return $this->method(\"PUT\");\n }",
"public function testUpdateMetadata3UsingPUT()\n {\n }",
"public function put($path, array $parameters = array(), ApiInterface $api);",
"function handlePut($isValid, $update)\n{\n $isSuccess = false;\n\n try {\n # extract the id portion of the URL\n $id = substr($_SERVER['PATH_INFO'], 1);\n # get the JSON format body and decode it\n $put = trim(file_get_contents(\"php://input\"));\n $data = json_decode($put, true);\n // var_dump($data);\n $isSuccess = $update($data, $id);\n } catch (Exception $e) {\n}\n\n $resp = new stdClass();\n $resp->success = $isSuccess;\n\n echo json_encode($resp);\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 put($endpoint, $data=null, $extra_headers=array())\n {\n return $this->_request($endpoint, 'put', $data, $extra_headers);\n }",
"public function put($id, array $params);",
"public function put($path = '*', $callback = null)\r\n {\r\n // Get the arguments in a very loose format\r\n extract(\r\n $this->parseLooseArgumentOrder(func_get_args()),\r\n EXTR_OVERWRITE\r\n );\r\n\r\n return $this->respond('PUT', $path, $callback);\r\n }",
"public function put(string $path, string $contents): Promise;",
"function CallAPI($method, $url, $data = false){\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_PUT, 1);\t\t\n\t\t$update_json = json_encode($data);\t\n\t\tcurl_setopt($curl, CURLOPT_URL, $url . \"?\" . http_build_query($data));\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSLVERSION, 4);\n\t\t$result = curl_exec($curl); \n\t\t$api_response_info = curl_getinfo($curl);\n\t\tcurl_close($curl);\n\t\treturn $result;\n}",
"function Put( $uri, $filecontent )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Put( $uri, [filecontent not displayed )\\n\";\r\n\t\t$uri = $this->makeUri( $uri );\r\n\t\t$this->requestBody = $filecontent;\r\n\t\tif( $this->sendCommand( \"PUT $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}",
"public function put()\n\t{\n\t\t$this->post();\n\n\t\t$response = $this->plugin->get( 'response' );\n\t\tif ( isset( $response->success ) && $response->success ) {\n\t\t\tJResponse::setHeader( 'status', 200, true );\n\t\t\t$response->code = 200;\n\t\t\t$this->plugin->setResponse( $response );\n\t\t}\n\t}",
"public function testUpdateMetadata1UsingPUT()\n {\n }",
"public function put();",
"public function put();",
"public function Put( $sUrl, $vRequestBody, $bJsonEncode = false )\n {\n try\n {\n return $this->oRequestObj->Put( $sUrl, $vRequestBody, $bJsonEncode );\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }",
"public function makePut(string $token, string $uri, array $params = [])\n {\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer ' . $token,\n ])->putJson($uri, $params);\n\n return $response;\n }",
"public function makeJsonPutRequest($routeName, $routeParams = array(), $params = array())\n\t{\n\t\t$uri = Route::url($routeName, $routeParams);\n\n\t\ttry\n\t\t{\n\t\t\t$request = Request::factory($uri);\n\t\t\t$this->_response = $request\n\t\t\t\t->method(Http_Request::PUT)\n\t\t\t\t->body(json_encode($params))\n\t\t\t\t->execute();\n\t\t}\n\t\tcatch (RedirectException $e)\n\t\t{\n\t\t\t$this->_redirect = json_decode($e->getMessage(), TRUE);\n\t\t}\n\t}",
"public function putJSON($url, $params = false, $options = false, $timeout = false)\n\t\t{\n\t\t\treturn $this->request($url, $params, self::PUT_JSON, $options, $timeout);\n\t\t}",
"public function testUpdateMetadata2UsingPUT()\n {\n }",
"public function send($url, $method = \"GET\", $content) {\n\t\t$handle = curl_init();\n\t\tswitch($method)\n\t\t{\n\t\t\tcase 'POST':\n\t\t\t\tcurl_setopt($handle, CURLOPT_POST, true);\n\t\t\t\tcurl_setopt($handle, CURLOPT_POSTFIELDS, $content);\n\t\t\tbreak;\n\t\t\tcase 'PUT':\n\t\t\t\t$length = strlen($content);\n\t\t\t\t$pointer = fopen('php://memory', 'rw');\n\t\t\t\tfwrite($pointer, $content);\n\t\t\t\trewind($pointer);\n\n\t\t\t\tcurl_setopt($handle, CURLOPT_INFILE, $pointer);\n\t\t\t\tcurl_setopt($handle, CURLOPT_INFILESIZE, $length);\n\t\t\t\tcurl_setopt($handle, CURLOPT_PUT, true);\n\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\tcurl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tbreak;\n\t\t}\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($handle, CURLOPT_URL, $url);\n\t\tcurl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($handle, CURLOPT_HEADER, true);\n\t\tcurl_setopt($handle, CURLINFO_HEADER_OUT, true);\n\t\tcurl_setopt($handle, CURLOPT_VERBOSE, true);\n\n\t\t$payload = curl_exec($handle);\n\t\t\n\t\t$request_header_info = curl_getinfo($handle, CURLINFO_HEADER_OUT);\n\t\t\n\t\t$information = curl_getinfo($handle);\n\t\t\n\t\t$header_size = curl_getinfo($handle, CURLINFO_HEADER_SIZE);\n\t\t$raw_headers = substr($payload, 0, $header_size);\n\t\t$body = trim(substr($payload, $header_size));\n\t\t\n\t\t$headers = $this->http_parse_headers($raw_headers);\n\t\t$headers = array_merge($information, $headers);\n\t\t\n\t\tif($method == 'PUT')\n\t\t\tfclose($pointer);\n\t\tcurl_close($handle);\n\t\t\n\t\tif($headers[\"http_code\"] == 0){\n\t\t\tthrow new Exception(\"Host is unreachable.\",0);\n\t\t} elseif($headers[\"http_code\"] == 302){\n\t\t\t$url = $headers['Location'];\n\t\t\treturn $this->send($url, $method, $content);\n\t\t}\n\n\t\tif($headers[\"http_code\"] >= 400) {\n\t\t\tif(strlen($body) != 0 && $body != '') {\n\t\t\t\tif( strrpos($headers['Content-Type'], \"json\") != false)\n\t\t\t\t{\n\t\t\t\t\t$content = json_decode($body, true);\n\t\t\t\t\t$attributes = $content['attributes'];\n\t\t\t\t} elseif(strrpos($headers['Content-Type'], \"xml\") != false) {\n\t\t\t\t\t$content = new SimpleXmlElement($body);\n\t\t\t\t\t$attributes = $content->attributes();\n\t\t\t\t} else {\n\t\t\t\t\t$attributes = array();\n\t\t\t\t\t$attributes[\"message\"] = $body;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$attributes = array();\n\t\t\t}\n\t\t\t\n\t\t\tthrow new Exception((string)$attributes[\"message\"]);\n\t\t}\n\t\treturn array(\"headers\" => $headers, \"body\" => $body);\n\t}",
"public function method_PUT( &$headers, $member ) {\n throw new DAV_Status( DAV_Request::$PARANOID ? REST::HTTP_CONFLICT : REST::HTTP_FORBIDDEN );\n}",
"public function patch(string $url, array $input = [], $headers = null);",
"public function beanstalkRequest($url, $headers, $body)\n\t{\n\t\tglobal $BEANSTALK_SERVERS;\n\t\trequire_once('pheanstalk/pheanstalk_init.php');\n\n\t\t$k = array_rand($BEANSTALK_SERVERS);\n\t\t$pheanstalk = new Pheanstalk($BEANSTALK_SERVERS[$k]['host'], $BEANSTALK_SERVERS[$k]['port']);\n\n\t\t$pheanstalk->useTube('airbrake');\n\t\t$pheanstalk->put(json_encode(array('url'=>$url, 'headers'=>$headers, 'body'=>$body)));\n\t}",
"public function testUpdateCategoryUsingPUT()\n {\n }",
"public function putAction($apiVersion, $type, $name, $key='')\n {\n $parameters = $this->getRequest()->request->all();\n\n $response = array(\n 'method' => 'PUT',\n 'version' => $apiVersion,\n 'type' => $type,\n 'name' => $name,\n 'key' => $key,\n 'parameters'=> $parameters\n );\n\n return new Response(json_encode($response));\n }",
"public function put($path, $json_filter) {\r\n $handle = $this->create_curl_handle($path, array());\r\n // Build up the headers we'll need to pass\r\n $headers = array(\r\n 'Accept: application/json',\r\n 'Content-type: application/json',\r\n \"X-App-Token: \" . $this->app_token\r\n );\r\n // Time for some cURL magic...\r\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($handle, CURLOPT_POSTFIELDS, $json_filter);\r\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\r\n // Set up request, and auth, if configured\r\n if($this->user_name != \"\" && $this->password != \"\") {\r\n curl_setopt($handle, CURLOPT_USERPWD, $this->user_name . \":\" . $this->password);\r\n }\r\n $response = curl_exec($handle);\r\n $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\r\n if($code != \"200\") {\r\n throw new Exception(\"Error \\\"$code\\\" from server: $response\");\r\n }\r\n return json_decode($response, true);\r\n }",
"public function testMakePutRequest()\n {\n $body = ['teacher' => 'Charles Xavier', 'job' => 'Professor'];\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse($body),\n ]);\n\n $this->assertEquals($client->put('teachers/1', ['job' => 'Professor']), $body);\n }",
"protected function put(): self\n {\n $this->setOpt(CURLOPT_URL, $this->url->appendQuery($this->fields));\n $this->setOpt(CURLOPT_CUSTOMREQUEST, self::METHOD_PUT);\n \n return $this;\n }",
"function getSignedUrlForPuttingObject($ossClient, $bucket)\n{\n $object = \"test/test-signature-test-upload-and-download.txt\";\n $timeout = 3600;\n $options = NULL;\n try {\n $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, \"PUT\");\n } catch (OssException $e) {\n printf(__FUNCTION__ . \": FAILED\\n\");\n printf($e->getMessage() . \"\\n\");\n return;\n }\n print(__FUNCTION__ . \": signedUrl: \" . $signedUrl . \"\\n\");\n $content = file_get_contents(__FILE__);\n\n $request = new RequestCore($signedUrl);\n $request->set_method('PUT');\n $request->add_header('Content-Type', '');\n $request->add_header('Content-Length', strlen($content));\n $request->set_body($content);\n $request->send_request();\n $res = new ResponseCore($request->get_response_header(),\n $request->get_response_body(), $request->get_response_code());\n if ($res->isOK()) {\n print(__FUNCTION__ . \": OK\" . \"\\n\");\n } else {\n print(__FUNCTION__ . \": FAILED\" . \"\\n\");\n };\n}",
"public function putAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }"
] | [
"0.8788709",
"0.7896316",
"0.7800557",
"0.77750427",
"0.77601177",
"0.767182",
"0.76223975",
"0.75847673",
"0.7391131",
"0.73700523",
"0.7259284",
"0.7214415",
"0.7204495",
"0.72022486",
"0.72010416",
"0.7130234",
"0.70983815",
"0.70396346",
"0.6986912",
"0.69466424",
"0.69305927",
"0.6922778",
"0.6906447",
"0.6893126",
"0.68771285",
"0.6862273",
"0.6834371",
"0.6792628",
"0.6762698",
"0.6732069",
"0.6689702",
"0.6672911",
"0.6612216",
"0.6607037",
"0.6592922",
"0.6574954",
"0.6568829",
"0.6553222",
"0.6536011",
"0.65017354",
"0.65010524",
"0.6460336",
"0.6443869",
"0.62829846",
"0.6281557",
"0.62740505",
"0.6259761",
"0.6259201",
"0.6257537",
"0.6256806",
"0.6222893",
"0.6218434",
"0.6204365",
"0.6200859",
"0.6198302",
"0.6187357",
"0.6183676",
"0.61587185",
"0.61475587",
"0.61464655",
"0.61423135",
"0.61381626",
"0.61291605",
"0.6118745",
"0.60720015",
"0.60441273",
"0.60336226",
"0.60201854",
"0.60048974",
"0.5986437",
"0.59715605",
"0.59626895",
"0.59180695",
"0.5909403",
"0.58849776",
"0.58553654",
"0.5848749",
"0.5837818",
"0.5823853",
"0.5813961",
"0.58072984",
"0.5807229",
"0.57981104",
"0.57981104",
"0.5794845",
"0.57900554",
"0.5786081",
"0.5773052",
"0.57579416",
"0.57328784",
"0.5729396",
"0.57038105",
"0.56878006",
"0.5685384",
"0.5670511",
"0.56630373",
"0.5661561",
"0.56505865",
"0.5596671",
"0.5594983"
] | 0.7913318 | 1 |
Perform a delete request on the given url with optional headers | static function delete($url, $headers = array()) {
$request = new NiceHTTP\DeleteRequest($url, null, $headers);
return $request->send();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($url, $query = array(), $headers = array());",
"public function delete(string $url, array $input = [], $headers = null);",
"public function _delete($url = null, array $parameters = []);",
"public static function delete($url)\n {\n return self::fetch($url, array (\n CURLOPT_CUSTOMREQUEST => 'DELETE'\n ));\n }",
"public function delete($url, $headers = [], $options = [])\n {\n }",
"public static function delete($url, $headers = [], $options = [])\n {\n }",
"public function delete($requestUrl, $requestBody, array $requestHeaders = []);",
"public function delete( $url, array $headers=array() ) {\n return $this->httpRequest( $url, 'DELETE', $headers );\n }",
"public static function delete($url, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\n return self::processRequest($ch);\n }",
"public function delete($url)\n {\n return $this->sendRequest($url, 'DELETE', [], []);\n }",
"function delete($url, $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"DELETE\";\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }",
"public function delete(string $uri, array $params = [], array $headers = []): ResponseInterface;",
"public function delete($url, array $params = []) \n {\n return $this->request('DELETE', $url, $params);\n }",
"public function delete($url, $params = '', array $config = [])\n\t{\n\t\treturn $this->request($url, $params, $config, Request::METHOD_DELETE);\n\t}",
"public static function urlDelete($url,$data,$headers=null) {\n\n $isJsonForm = false;\n\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n //array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n return utf8_encode($contents);\n }",
"private function delete($url) {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}",
"function delete(Request &$request, Response &$response);",
"private function delete(string $url, array $headers = []): string\n {\n try {\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n $response = curl_exec($ch);\n if (curl_errno($ch)) {\n throw new Exception(\"cURL Error: \" . curl_error($ch));\n } else {\n return $response;\n }\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }",
"public function delete($url, $params = null)\n {\n return $this->request('DELETE', $url, $params);\n }",
"public function delete($url, $params = [])\n {\n return $this->request($url, 'DELETE', $params);\n }",
"private function curl_delete($url)\n {\n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }",
"public function delete($url, $endpoint = \"\", $header = array(), $query = array())\n {\n $url .= $endpoint;\n if (count($query) > 0) {\n $query = http_build_query($query);\n $url .= \"?\" . $query;\n }\n\n // $log = \"New DELETE Request.\\n\";\n // $log .= \"URL: $url\\n\";\n\n $ch = curl_init();\n\n //Set the URL that you want to GET by using the CURLOPT_URL option.\n curl_setopt($ch, CURLOPT_URL, $url);\n\n\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n //Set CURLOPT_RETURNTRANSFER so that the content is returned as a variable.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n //Set CURLOPT_FOLLOWLOCATION to true to follow redirects.\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\n if (array_key_exists('headers', $header)) {\n // Set HTTP Header for POST request \n //$log .= \"Header sent: \" . json_encode($header['headers']) . \"\\n\";\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header['headers']);\n }\n\n //Execute the request.\n $result = curl_exec($ch);\n\n\n //Handle curl errors\n if (curl_error($ch)) {\n $error_msg = curl_error($ch);\n //$log .= \"Error: $error_msg\\n\";\n throw new \\Exception(curl_error($ch));\n }\n\n //$log .= \"\\n------------------------END-------------------------\\n\\n\";\n //file_put_contents('log.txt', $log, FILE_APPEND);\n\n //Close the cURL handle.\n curl_close($ch);\n\n //Print the data out onto the page.\n //header('Content-Type: application/json');\n return json_encode(json_decode($result));\n }",
"protected function _doDelete($in_url, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'DELETE', null, null, $in_additional_curl_options);\r\n }",
"public function delete($url, $options = false, $timeout = false)\n\t\t{\n\t\t\treturn $this->request($url, false, self::DELETE, $options, $timeout);\n\t\t}",
"public function delete($url)\n {\n $this->requestType = Client::REQUEST_DELETE;\n $this->url = $url;\n return $this;\n }",
"function delete($url, $parameters = array()) {\n $response = $this->oAuthRequest($url, 'DELETE', $parameters);\n if ($this->format === 'json' && $this->decode_json) {\n return json_decode($response, true);\n }\n return $response;\n }",
"public function Delete( $sUrl, array $aFields = array() );",
"abstract public function delete(Request $request);",
"function deleteAuthor($id){\r\n $url = \"http://localhost:8080/WebServicesProjet/api/rest/authors/delete/\".$id;\r\n $result = delete($url);\r\n if(intval($result) != 200 && intval($result)<=503 && intval($result)>=400){\r\n header(\"Location: \".$_SERVER['HTTP_ORIGIN'].$_SERVER['PHP_SELF'].'?/authors');\r\n die();\r\n }else{\r\n header(\"Location: \".$_SERVER['HTTP_ORIGIN'].$_SERVER['PHP_SELF'].'?/authors');\r\n die();\r\n }\r\n\r\n}",
"public function delete($uri, $body = null, array $headers = []): ResponseInterface;",
"public function url_delete () {\n\t\tif ( ! $this->get(\"id\") ) {\n\t\t\t$this->response(array(\n\t\t\t\t\"status\" => false,\n\t\t\t\t\"error_code\" => 400\n\t\t\t), 400);\n\t\t}\n\n\t\t$this->db->delete(\"statistic_urls\", array(\n\t\t\t\"id\" => $this->get(\"id\")\n\t\t));\n\t}",
"public function delete($uri = null, $headers = null)\n {\n return $this->createRequest('DELETE', $uri, $headers);\n }",
"function doDELETE (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"DELETE method not supported\");\n }",
"function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }",
"function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }",
"public function testDeleteUrlUsingDELETE()\n {\n }",
"function rest_delete_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}",
"public function controllerDELETE($url) {\r\n\treturn $this->controller($url);\r\n }",
"public function _DELETE($url, $params = null, $username = null, $password = null)\n {\n //Modified by Edison tsai on 09:50 2010/11/26 for missing part\n $response = $this->call($url, 'DELETE', $params, $username, $password);\n\n return $this->parseResponse($response);\n }",
"public function delete(string $uri, array $options = []): ResponseInterface {\n return $this->request('DELETE', $uri, $options);\n }",
"public function call_api_delete(){\n$ch = curl_init('http://localhost:8001/api/users/....');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLINFO_HEADER_OUT, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n// Submit the DELETE request\n$result = curl_exec($ch);\n\n//Close cURL session handle\ncurl_close($ch);\necho \"Deleted\"; \n }",
"public function delete($uri, array $data = [], array $headers = []): TestResponse\n {\n return $this->call('DELETE', $uri, $data, $this->defaultCookies, [], $headers);\n }",
"public function delAction(Request $request)\n {\n $id = (int)$request->get(\"id\");\n if (!$id) {\n return $this->getJsonResponse(1, \"id参数为空!\");\n }\n $em = $this->getDoctrine()->getManager();\n $entity = $em->getRepository('QihooToolBundle:AutoDownUrl')->find($id);\n if (!$entity) {\n return $this->getJsonResponse(2, \"id ($id) 在数据库不存在!(是否已经删除?)\");\n }\n $em->remove($entity);\n $em->flush();\n return $this->getJsonResponse(0, \"\"); //删除成功\n }",
"public function delete($path)\n\t{\n\t\t$this->Response->end('HTTP DELETE', 501); // 501 Not Implemented\n\t}",
"public function delete( array $params );",
"public function delete()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'DELETE';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'DELETE::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'DELETE::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'DELETE::RESPONSE', $sOutput);\n\n if ($iHTTPCode !== 204) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 204');\n }\n return $sOutput;\n }",
"public function delete($url = '/', $options = [])\n {\n return $this->send($url, $options, 'DELETE');\n }",
"function urlDelete(Request $request) {\n $urlFile = env('PBS_KIOSK_DIR').'/urls.list';\n $newContent = '';\n $urlToDel = $request->fName;\n error_log(\"Url to del \" . $urlToDel);\n $contents = file_get_contents($urlFile);\n $parsedLines = preg_split(\"/\\r?\\n|\\r/\", $contents);\n $found = false;\n $rVal = false;\n\n foreach( $parsedLines as $rurl ) {\n if( trim($urlToDel) != trim($rurl) ) { \n $newContent .= $rurl.\"\\r\\n\";\n } else {\n $rVal = true;\n $deleted = $rurl;\n }\n }\n \n // var_dump($newContent);\n if (file_put_contents($urlFile, $newContent)) {\n echo(\"File written\");\n }\n if($rVal) {\n $status = 'OK';\n $msg = \"L'url à été supprimée.\";\n } else {\n $status = 'OK';\n $msg = \"Problème lors de la suppression de l'url\";\n }\n $retVal = array('status' => $status, 'msg' => $msg, 'deleted' => $deleted);\n\n return response()->json($retVal);\n }",
"public function delete($id)\n {\n\n SCA::$logger->log(\"Entering delete()\");\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, \"DELETE\");\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/plain;\",\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 //delete does not return a body\n return true;\n }\n }",
"public function delete($id){\n\t\t$url = WEBSERVICE. \"robots/deleteById/\" . $id;\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"DELETE\");\n\t\t$response = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $response;\n\t}",
"public function delete($url)\n {\n $result = $this->curlService->delete(\n $this->getUrl() . $url,\n $this->getToken()\n );\n\n return $this->parse($result);\n }",
"public function delete(\n $url,\n ParametersBagInterface $parameters = null,\n $cacheLifeTime = 500\n ) {\n return $this->request('DELETE', $url, $parameters, $cacheLifeTime);\n }",
"public function delete($url)\n {\n $this->authorize('forceDelete', $url);\n\n $this->urlSrvc->delete($url);\n\n return redirect()->back()\n ->withFlashSuccess(__('Link was successfully deleted.'));\n }",
"public function delete( $id ){\n \t\t$response = $this->curl->delete( $this->api_url . '/' . $id, [ \n\t\t\t'access_token' \t=> $this->token\n\t\t]);\n\t\t\n\t\treturn $response;\n \t}",
"private function delete_request( $endpoint = '/', $args = [], $request_args = [] ) {\n return $this->request( 'DELETE', $endpoint, $args, $request_args );\n }",
"protected function curl_delete($uri) {\n\n\t $output = \"\";\n\n\t try {\n\n\t\t$ch = curl_init($uri);\n\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \n\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 4);\n\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\n\t\tcurl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);\n\n\t\t$output = curl_exec($ch);\n\n\t\t$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n\t } catch (Exception $e) {\n\n\t }\n\n\t \tif ($httpcode == \"200\") {\n\n\t \t\treturn json_decode($output, true);\n\n\t \t} else {\n\n\t \t\treturn array('error' => 'HTTP status code not expected - got ', 'description' => $httpcode);\n\n\t \t}\n\n\t}",
"public function delete($request, $response)\n {\n }",
"private function delete($url, $parameters = array(), $is_json = true)\n {\n $response = $this->oauthRequest($url, 'DELETE', $parameters);\n if($is_json) {\n return json_decode($response, true);\n }\n return $response;\n }",
"public function delete($location);",
"public function destroy(Request $request)\n {\n $request->validate([\n 'url' => 'required|url'\n ]);\n\n $code = explode('/', $request->input('url'));\n $code = end($code);\n $deletedRows = ShortLink::where('code', $code)->delete();\n\n if($deletedRows) {\n return $this->sendResponse('', 'URL deleted')->setStatusCode(200);\n } else {\n return $this->sendError('URL not found')->setStatusCode(404);\n }\n }",
"public function doDelete($path);",
"public function httpDelete()\n {\n return $this->method(\"DELETE\");\n }",
"public function deleteMethod(string $url, array $query): array\n {\n return $this->makeCall($url . '?' . http_build_query($query), 'delete');\n }",
"public function delete($id){\n\t\t$url = WEBSERVICE. \"status_robot/deleteById/\" . $id;\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"DELETE\");\n\t\t$response = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $response;\n\t}",
"public function delete( $uri, $parameters = [], $headers = [] )\n {\n return $this->send( $uri, 'DELETE', $parameters, $headers );\n }",
"public function delete($uri = NULL, $vars = NULL) {\n\t\tif (! empty ( $uri ))\n\t\t\t$this->uri = $uri;\n\t\tif (! empty ( $vars ) && is_array ( $vars ))\n\t\t\t$vars = http_build_query ( $vars );\n\t\tif (empty ( $this->query ))\n\t\t\t$this->query = $vars;\n\t\telse if (! empty ( $vars ))\n\t\t\t$this->query .= \"&\" . $vars;\n\t\tif (! empty ( $this->query ))\n\t\t\t$this->uri .= \"?\" . $this->query;\n\t\t$this->method = \"DELETE\";\n\t\t$this->request_body = NULL;\n\t\t$this->send ();\n\t\treturn $this->status_code;\n\t}",
"protected function httpDelete(string $path, array $params = [], array $requestHeaders = []): ResponseInterface\n {\n return $this->httpClient->request('DELETE', $path, [\n 'body' => $this->createJsonBody($params),\n 'headers' => $requestHeaders,\n ]);\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 deleteAction(){\n $id = $this->params('id');\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/'.$id);\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setMethod( Request::METHOD_DELETE );\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 }",
"public function del($database, $url);",
"public function delete(...$args)\n {\n return $this->curl('delete', ...$args);\n }",
"public function deletedon($id)\n\t{\n $url = explode('/',$_GET['url']);\t\n\t$this->model->deletedon($id);\n\theader('location: ' . URL . 'Dnr/view/'.$url[3]); \n\t}",
"public function delete()\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }",
"public function delete(Request $request)\n {\n }",
"public function deleteAction($id)\n {\n if(!parent::isValidId($id)) {\n return parent::redirect('url');\n }\n\n $manager = new TransactionManager();\n $transaction = $manager->get();\n \n try {\n $url = Url::findFirst($id);\n if($url) {\n $url->setTransaction($transaction);\n \n $batches = $url->getBatch();\n foreach($batches as $batch) {\n $batch->setTransaction($transaction);\n \n $pings = $batch->getPing();\n foreach($pings as $ping) {\n $ping->setTransaction($transaction);\n $ping->delete();\n }\n \n $batch->delete();\n }\n $url->delete();\n \n $this->flash->success('Url deleted succesfully.');\n $transaction->commit();\n \n } else {\n $this->flash->notice('Url not found, operation aborted.');\n }\n } catch(\\Exception $ex) {\n $this->flash->error('Error deleting url.');\n $transaction->rollback($ex->getMessage());\n }\n \n return $this->redirect('url');\n }",
"function Delete( $uri )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Delete( $uri )\\n\";\r\n\t\tif( $this->sendCommand( \"DELETE $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}",
"public function destroy(Url $url)\n {\n $url->delete();\n\n return response(null, 204);\n }",
"public function delete($params)\n {\n // ...\n // ...\n // ...\n // ...\n\n // Maintenant je redirige vers la page 'mon-panier'\n header('Location: '.$this->baseUrl.'/mon-panier/');\n }",
"public function makeDelete(string $token, string $uri, array $params = [])\n {\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer ' . $token,\n ])->deleteJson($uri, $params);\n\n return $response;\n }",
"public function sendDelete ()\n {\n curl_setopt($this->cURL, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n return $this->handleQuery();\n }",
"public function delete()\n\t{\n\t\t// Pass on the request to the driver\n\t\treturn $this->backend->delete('', array());\n\t}",
"function delete(){\n \tinclude '../db_connect.php';\n\n \t$id = $_GET[\"id\"];\n \t$stmt = $conn->prepare(\"DELETE FROM api_url \n \t\t\t\t\t\t\tWHERE id = :id \");\n\n \t$stmt->bindParam(':id', $id); \n \tif ($stmt->execute())\n \t{\n \techo \"<p>\".\"<strong>Regisseur verwijderd</strong>\".\"</p>\";\n \t}\n \t$conn = null;\n \theader(\"Location: ../database.php\");\n }",
"public function delete( $id );",
"public function delete($path, $data = null);",
"public function delete ( $path, $params ) {\n \n \t$opts = array ( \n \t\t\tCURLOPT_CUSTOMREQUEST => \"DELETE\"\n );\n \n $exec = $this->execute ( $path, $opts, $params );\n \n return $exec;\n }",
"public function delete($id = null)\n\t{\n\t\treturn $this->fail(lang('RESTful.notImplemented', ['delete']), 501);\n\t}"
] | [
"0.86862",
"0.77962756",
"0.76844597",
"0.7652167",
"0.7560942",
"0.7552014",
"0.7504887",
"0.74143285",
"0.7301083",
"0.7246205",
"0.7241626",
"0.7238755",
"0.72373015",
"0.7179481",
"0.71552783",
"0.7148856",
"0.7038359",
"0.7037558",
"0.7027734",
"0.7018434",
"0.6857399",
"0.685704",
"0.6851198",
"0.6760452",
"0.6754856",
"0.6733855",
"0.66843575",
"0.66448015",
"0.6630505",
"0.6580848",
"0.65762955",
"0.65583163",
"0.65571743",
"0.6552228",
"0.6552228",
"0.6545013",
"0.64864695",
"0.64745647",
"0.6460691",
"0.64248997",
"0.64206105",
"0.63641006",
"0.6360352",
"0.63518715",
"0.634383",
"0.6321742",
"0.63090247",
"0.6294325",
"0.6287138",
"0.6268425",
"0.6264829",
"0.6259174",
"0.62557733",
"0.6206083",
"0.62028766",
"0.6198679",
"0.61850977",
"0.6180068",
"0.6160456",
"0.6153385",
"0.61460215",
"0.61333394",
"0.6123236",
"0.6120145",
"0.61116797",
"0.6099796",
"0.60869086",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.60722464",
"0.6047682",
"0.6033657",
"0.60123664",
"0.5993947",
"0.59931815",
"0.5975077",
"0.5969205",
"0.5955818",
"0.5951016",
"0.5947508",
"0.5937496",
"0.5933429",
"0.5929129",
"0.59164804",
"0.59128433",
"0.59117603",
"0.5901303",
"0.5899922"
] | 0.7599099 | 4 |
Search for a matcher for the given Request. If we find one, return the proper response, otherwise return null | static function match($request) {
foreach (self::$matchers as $matcher) {
$response = $matcher($request);
if ($response !== null) {
$response->request = $request;
return $response;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function match($request)\r\n {\r\n foreach ($this->routes as $name => $route)\r\n {\r\n $route = $this->getRoute($name);\r\n\r\n if (is_array($params = $route->match($request))) {\r\n return new MatchedRoute($route, $name, $params);\r\n }\r\n }\r\n\r\n return null;\r\n }",
"public function match(Request $request) {\n\t\tif (! method_exists ( $request, 'getUri' )) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tif ($this->baseUrl === null && method_exists ( $request, 'getBaseUrl' )) {\n\t\t\t$this->setBaseUrl ( $request->getBaseUrl () );\n\t\t}\n\t\t\n\t\t$uri = $request->getUri ();\n\t\t$baseUrlLength = strlen ( $this->baseUrl ) ? : null;\n\t\t\n\t\tif ($this->requestUri === null) {\n\t\t\t$this->setRequestUri ( $uri );\n\t\t}\n\t\t\n\t\tif ($baseUrlLength !== null) {\n\t\t\t$pathLength = strlen ( $uri->getPath () ) - $baseUrlLength;\n\t\t\t\n\t\t\tforeach ( $this->routes as $name => $route ) {\n\t\t\t\tif (($match = $route->match ( $request, $baseUrlLength )) instanceof RouteMatch && $match->getLength () === $pathLength) {\n\t\t\t\t\t$match->setMatchedRouteName ( $name );\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $this->defaultParams as $paramName => $value ) {\n\t\t\t\t\t\tif ($match->getParam ( $paramName ) === null) {\n\t\t\t\t\t\t\t$match->setParam ( $paramName, $value );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\treturn $match;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn parent::match ( $request );\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function match(Request $request)\n {\n if (!method_exists($request, 'getMethod')) {\n return null;\n }\n\n $requestVerb = strtoupper($request->getMethod());\n\n if ($requestVerb === 'GET') {\n return new RouteMatch($this->defaults);\n }\n\n return null;\n }",
"function match(Nette\\Http\\IRequest $httpRequest): ?array;",
"public function match(Request $request)\n {\n if (!method_exists($request, 'getUri')) {\n return;\n }\n\n $uri = $request->getUri();\n $path = $uri->getPath();\n\n try {\n $parser = new UriParser($this->options);\n $result = $parser->parseUri($path);\n\n if (!$result instanceof Result) {\n return;\n }\n } catch (UnexpectedValueException $exception) {\n return; // todo: think about this\n } catch (TransformerNotFoundException $exception) {\n return; // todo: think about this\n }\n\n $routeMatch = new RouteMatch($this->options, strlen($path));\n $routeMatch->setParserResult($result);\n\n return $routeMatch;\n }",
"public function Matches (\\MvcCore\\IRequest $request);",
"function matchRequest(Request $request) {\n $requestPath = $request->getPath();\n\n if (mb_strpos($requestPath, $this->staticPrefix) !== 0) {\n return false;\n }\n\n if ($this->methodRequirement != null){\n if(mb_strcasecmp($this->methodRequirement, $request->getMethod()) != 0){\n return false;\n }\n }\n\n $result = preg_match($this->regex, $requestPath, $matches);\n\n if ($result == false) {\n return false;\n }\n\n foreach ($this->fnCheck as $fnCheck) {\n $result = $fnCheck($request);\n if (!$result) {\n return false;\n }\n }\n\n //Route has matched\n $params = array();\n\n foreach($this->variables as $routeVariable){\n if(array_key_exists($routeVariable->name, $matches) == true && \n strlen($matches[$routeVariable->name]) != 0) {\n $params[$routeVariable->name] = $matches[$routeVariable->name];\n }\n else if($routeVariable->default != null){\n $params[$routeVariable->name] = $routeVariable->default;\n }\n }\n\n return $params;\n }",
"public function find_route( Request $request ) {\n $this->context->logger()->debug( 'processing Request ' . $request );\n\n if(empty($this->routes)) $this->load_routes();\n\n foreach($this->routes as $route) {\n if($route->match($request)) {\n $this->context->logger()->debug( 'matched to Route ' . $route );\n return $route;\n }\n }\n throw new Exception(sprintf('Couldn\\'t find a route to match your request: %s', $request));\n }",
"private static function findRouteForRequest(Request $request) {\n\t\t\tforeach (JiaoyuCore::getRoutes() as $route) {\n\n\t\t\t\t// First we look for method - bail out if this route\n\t\t\t\t// doesn't match it\n\t\t\t\tif (!in_array($request->method, $route->methods)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Next look for a literal string match (no url params)\n\t\t\t\tif ($request->path == $route->path) {\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\n\t\t\t\t// Now we have to look for the patterns\n\t\t\t\t$requestParts = explode('/', $request->path);\n\t\t\t\t$routeParts = explode('/', $route->path);\n\t\t\t\tif (count($requestParts) != count($routeParts)) {\n\t\t\t\t\t// Matching pairs will have the same number of parts\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$matchCount = 0;\n\t\t\t\tfor ($i = 0; $i < count($requestParts); $i++) {\n\t\t\t\t\t// Exact match check for this pair of parts\n\t\t\t\t\tif ($routeParts[$i] == $requestParts[$i]) {\n\t\t\t\t\t\t$matchCount++;\n\t\t\t\t\t} else if (preg_match(\"/^\\{.+\\}$/\", $routeParts[$i])) {\n\t\t\t\t\t\t// This is an ugly check for the {varname} pattern in\n\t\t\t\t\t\t// routes with url params\n\t\t\t\t\t\t$matchCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($matchCount == count($requestParts)) {\n\t\t\t\t\t// All parts matched\n\t\t\t\t\treturn $route;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Found nothing\n\t\t\treturn null;\n\t\t}",
"public function match(Request $request)\n {\n $matcher = new CompiledUrlMatcher(\n $this->compiled, (new RequestContext)->fromRequest(\n $trimmedRequest = $this->requestWithoutTrailingSlash($request)\n )\n );\n\n $route = null;\n\n try {\n if ($result = $matcher->matchRequest($trimmedRequest)) {\n $route = $this->getByName($result['_route']);\n }\n } catch (ResourceNotFoundException|MethodNotAllowedException $e) {\n try {\n return $this->routes->match($request);\n } catch (NotFoundHttpException $e) {\n //\n }\n }\n\n if ($route && $route->isFallback) {\n try {\n $dynamicRoute = $this->routes->match($request);\n\n if (! $dynamicRoute->isFallback) {\n $route = $dynamicRoute;\n }\n } catch (NotFoundHttpException|MethodNotAllowedHttpException $e) {\n //\n }\n }\n\n return $this->handleMatchedRoute($request, $route);\n }",
"public function match(ServerRequestInterface $request):Result;",
"public function match ( Request $request ) {\n $params = [];\n $match = false;\n \n // set Request Url if it isn't passed as parameter\n $requestUrl = $request->requesturi();\n \n // set Request Method if it isn't passed as a parameter\n $requestMethod = $request->method();\n foreach($this->routes as $handler) {\n list($methods, $route, $target, $name) = $handler;\n $method_match = (stripos($methods, $requestMethod) !== false);\n // Method did not match, continue to next route.\n if (!$method_match) continue;\n \n if ( $route === '*' ) {\n // * wildcard (matches all)\n $match = true;\n } elseif (isset($route[0]) && $route[0] === '@') {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif (($position = strpos($route, '[')) === false) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url\n if (strncmp($requestUrl, $route, $position) !== 0) {\n continue;\n }\n $regex = $this->compileRoute($route);\n $match = preg_match($regex, $requestUrl, $params) === 1;\n }\n if ($match) {\n if ($params) {\n foreach($params as $key => $value) {\n if(is_numeric($key)) unset($params[$key]);\n }\n }\n return array(\n 'target' => $target,\n 'params' => $params,\n 'name' => $name\n );\n }\n }\n return false;\n }",
"public function getResponse(\\BearFramework\\App\\Request $request)\n {\n $requestPath = (string) $request->path;\n foreach ($this->data as $route) {\n foreach ($route[0] as $pattern) {\n $found = preg_match('/^' . str_replace(['%2F', '%3F', '%2A'], ['\\/', '[^\\/]+?', '.+?'], urlencode($pattern)) . '$/u', $requestPath) === 1; // symbols: /, ?, *\n if ($found && !empty($route[2])) {\n $hasMethodOption = false;\n $isMethodValid = false;\n $hasSchemeOption = false;\n $isSchemeValid = false;\n foreach ($route[2] as $option) {\n $option = strtolower($option);\n if ($option === 'get' || $option === 'head' || $option === 'post' || $option === 'delete' || $option === 'put' || $option === 'patch' || $option === 'options') {\n $hasMethodOption = true;\n if ($option === strtolower($request->method)) {\n $isMethodValid = true;\n }\n } elseif ($option === 'http' || $option === 'https') {\n $hasSchemeOption = true;\n if ($option === strtolower($request->scheme)) {\n $isSchemeValid = true;\n }\n }\n }\n if (($hasMethodOption && !$isMethodValid) || ($hasSchemeOption && !$isSchemeValid)) {\n $found = false;\n }\n }\n if ($found) {\n foreach ($route[1] as $callable) {\n ob_start();\n try {\n $response = call_user_func($callable);\n ob_end_clean();\n } catch (\\Exception $e) {\n ob_end_clean();\n throw $e;\n }\n if ($response instanceof App\\Response) {\n return $response;\n }\n }\n // continue searching\n }\n }\n }\n if ($request->method === 'HEAD') {\n $getRequest = clone($request);\n $getRequest->method = 'GET';\n $response = $this->getResponse($getRequest);\n if ($response instanceof App\\Response) {\n $response->content = '';\n return $response;\n }\n }\n return null;\n }",
"public function match(Request $request)\n {\n $pipes = $this->get($request->keys());\n\n // First, we will see if we can find a matching pipe for this current request\n // method. If we can, great, we can just return it so that it can be called\n // by the consumer.\n $pipe = $this->matchAgainstPipes($pipes, $request);\n\n if (! is_null($pipe)) {\n return $pipe->bind($request);\n }\n\n throw new NotFoundPipeException($request);\n }",
"public function match(Request $request)\n {\n }",
"public function match($requestUrl = null, $requestMethod = null)\n {\n\n $params = [];\n\n // set Request Url if it isn't passed as parameter\n if ($requestUrl === null) {\n $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';\n }\n\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n\n // Strip query string (?a=b) from Request Url\n if (($strpos = strpos($requestUrl, '?')) !== false) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n\n $lastRequestUrlChar = $requestUrl[strlen($requestUrl) - 1];\n\n // set Request Method if it isn't passed as a parameter\n if ($requestMethod === null) {\n $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';\n }\n\n foreach ($this->routes as $handler) {\n list($methods, $route, $target, $name) = $handler;\n\n $method_match = (stripos($methods, $requestMethod) !== false);\n\n if ($route === '*') {\n // * wildcard (matches all)\n $match = true;\n } elseif (isset($route[0]) && $route[0] === '@') {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif (($position = strpos($route, '[')) === false) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n // Check if last character before param is a slash, because it could be optional if param is optional too (see https://github.com/dannyvankooten/AltoRouter/issues/241)\n if (strncmp($requestUrl, $route, $position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position - 1] !== '/')) {\n continue;\n }\n\n $regex = $this->compileRoute($route);\n $match = preg_match($regex, $requestUrl, $params) === 1;\n }\n\n if ($match) {\n if ($params) {\n foreach ($params as $key => $value) {\n if (is_numeric($key)) {\n unset($params[$key]);\n }\n }\n }\n\n // Method did not match, continue to next route.\n if (!$method_match) {\n $this->methodError = true;\n continue;\n } else {\n $this->methodError = false;\n }\n\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name\n ];\n }\n }\n\n if ($this->methodError) {\n return self::METHOD_ERROR;\n } else {\n return self::NO_MATCH;\n }\n }",
"public function match(ServerRequestInterface $request);",
"public function matches ($request)\r\n {\r\n return preg_match ('@^'. $this->pattern .'$@', $request, $this->match);\r\n }",
"public function lookup($request) {\n // Search for the matching HttpResponse object\n for ($i=0; $i<count($this->requests); $i++) {\n if ($this->requests[$i] == $request) {\n break;\n }\n }\n \n // If the matching HttpResponse object was found return it, otherwise throw an exception.\n if ($i == count($this->requests)) {\n //var_dump($this->requests[0]); // only show the first request in the map\n var_dump($this->requests); // show all requests in the map\n throw new RangeException(\"Matching HTTP response not found\");\n } else {\n return $this->responses[$i];\n }\n }",
"public function match(Request $request)\n {\n if ($this->method) {\n if ($request->getMethod() != $this->method) {\n return false;\n }\n }\n if ($this->hostname && $request->hasHeader('host')) {\n if ($request->getHeader('hostname') != $this->host) {\n return false;\n }\n }\n\n // Ejecutamos la función de validación\n $function = [$this, 'match' . $this->type];\n\n $url = $request->getRequestTarget();\n $result = $function($url);\n\n if ($result) {\n // Encontramos un match. Añadimos los args del request\n $result['args'] = array_merge($this->args, \n $result['args']);\n\n return $result;\n }\n\n\n // Not valid\n return false;\n }",
"public function matchRoute(Request $request){\n $context = new RequestContext();\n $context->fromRequest($request);\n\n $matcher = new UrlMatcher($this->routeCollection, $context);\n $parameters = $matcher->match($context->getPathInfo());\n return $parameters;\n }",
"public function dispatch(RequestContract $request) {\n\n\t\t$response = NULL;\n\n\t\tforeach ($this->routes as $route) {\n\n\t\t\tif ($route->matches($request)) {\n\n\t\t\t\t$response = $route->fire($request);\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $response;\n\n\t}",
"public function match(Request $request)\n {\n foreach($this->routes as $url => $route) {\n if(!$route->test($request)) {\n continue;\n }\n $this->matched_url = $url;\n $action = $route->getAction();\n $this->cacheAction($request, $action);\n return $action;\n }\n throw new RouteNotFoundException(sprintf('No route found that matches \"%s\"', $request->getPathInfo()));\n }",
"public function match(ServerRequestInterface $request): ?Route\n {\n $result = $this->router->match($request);\n\n if ($result->isSuccess()) {\n return new Route(\n $result->getMatchedRouteName(),\n $result->getMatchedRoute()->getMiddleware()->getCallback(),\n $result->getMatchedParams()\n );\n }\n\n return null;\n }",
"public function match(ServerRequestInterface $request): ?Route\n\t{\n\t\t$result = $this->router->match($request); // instance of \\Zend\\Expressive\\Router\\RouteResult\n\t\tif ($result->isSuccess()) {\n\t\t\treturn new Route(\n $result->getMatchedRouteName(),\n\t\t\t\t$result->getMatchedRoute()->getMiddleware(),\n\t\t\t\t$result->getMatchedParams()\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}",
"public function get(Request $request)\n {\n if (!$this->allowQueries) {\n return null;\n }\n $parsedRequest = new RequestParser($request);\n $cacheKey = $parsedRequest->cacheKey();\n // If the request is not cacheable, return null\n if (!$cacheKey) {\n return null;\n }\n $cacheValue = $this->repository->get($cacheKey);\n // If no response was found, return null\n if (!$cacheValue) {\n return null;\n }\n $parsedResponse = new CacheParser($cacheValue);\n return $parsedResponse->response();\n }",
"public function onMatchRequest(GetResponseEvent $event)\n {\n $this->matcher->matches($event->getRequest());\n }",
"public function match($requestUrl = null, $requestMethod = null)\n {\n $params = [];\n // set Request Url if it isn't passed as parameter\n if ( $requestUrl === null ) {\n $requestUrl = Server::isSetted('REQUEST_URI') ? Server::get('REQUEST_URI') : '/';\n }\n // strip base path from request url\n $requestUrl = substr($requestUrl, strlen($this->basePath));\n // Strip query string (?a=b) from Request Url\n if ( ($strpos = strpos($requestUrl, '?')) !== false ) {\n $requestUrl = substr($requestUrl, 0, $strpos);\n }\n $lastRequestUrlChar = $requestUrl ? $requestUrl[strlen($requestUrl)-1] : '';\n // set Request Method if it isn't passed as a parameter\n if ( $requestMethod === null ) {\n $requestMethod = Server::isSetted('REQUEST_METHOD') ? Server::get('REQUEST_METHOD') : 'GET';\n }\n foreach ($this->routes as $handler) {\n list($methods,$route,$target,$name,$permissions) = $handler;\n $method = (stripos($methods,$requestMethod) !== false);\n // Method did not match, continue to next route.\n if ( !$method ) {\n continue;\n }\n if ( $route === '*' ) {\n // * wildcard (matches all)\n $match = true;\n } elseif ( isset($route[0]) && $route[0] === '@' ) {\n // @ regex delimiter\n $pattern = '`' . substr($route, 1) . '`u';\n $match = preg_match($pattern, $requestUrl, $params) === 1;\n } elseif ( ($position = strpos($route, '[')) === false ) {\n // No params in url, do string comparison\n $match = strcmp($requestUrl, $route) === 0;\n } else {\n // Compare longest non-param string with url before moving on to regex\n if ( strncmp($requestUrl,$route,$position) !== 0 && ($lastRequestUrlChar === '/' || $route[$position-1] !== '/') ) {\n continue;\n }\n $regex = $this->compileRoute($route);\n $match = preg_match($regex,$requestUrl,$params) === 1;\n }\n if ( $match ) {\n if ( $params ) {\n foreach ($params as $key => $value) {\n if ( TypeCheck::isInt($key) ) {\n unset($params[$key]);\n }\n }\n }\n return [\n 'target' => $target,\n 'params' => $params,\n 'name' => $name,\n 'permissions' => $permissions\n ];\n }\n }\n return false;\n }",
"public function findFirst($request = null)\r\n\t{\r\n\t\treturn current($this->find($request));\r\n\t}",
"public function match(Request $request, $pathOffset = null)\r\n {\r\n if (!method_exists($request, 'getUri')) {\r\n return null;\r\n }\r\n\r\n $uri = $request->getUri();\r\n $fullPath = $uri->getPath();\r\n\r\n $path = substr($fullPath, $pathOffset);\r\n $alias = trim($path, '/');\r\n\r\n $model = $this->routerPluginManager->getServiceLocator()->get('DotsPages\\Db\\Model\\Page');\r\n $page = $model->getByAlias($alias);\r\n\r\n if ($page) {\r\n $options = $this->defaults;\r\n $options = array_merge($options, array('alias' => $alias, 'page' => $page));\r\n return new RouteMatch($options, strlen($path));\r\n }\r\n return null;\r\n }",
"protected function _getMatch()\n {\n // match is already set, return that\n if ($this->_match !== null) {\n return $this->_match;\n }\n\n // get the base url\n $base_uri = $this->_request->getBaseUri();\n\n // optimization for the homepage so we don't have to hit the routes\n if ($base_uri === '/' && !$this->_subdomain) {\n $this->_match = array('main', 'index');\n return $this->_match;\n }\n\n $routes = $this->getRoutes();\n\n // direct match optimization\n if (isset($routes[$base_uri])) {\n $this->_setMatch($routes[$base_uri]);\n return $this->_match;\n }\n\n // get all of the keys in the routes file\n $route_keys = array_keys($routes);\n $len = count($route_keys);\n\n // explode the base uri for comparisons\n $base_bits = explode('/', $base_uri);\n\n // loop through all of the routes and check for a match\n $match = false;\n for ($i = 0; $i < $len; ++$i) {\n if ($this->_matches(explode('/', $route_keys[$i]), $base_bits)) {\n $match = true;\n\n // stop after the first match!\n break;\n }\n }\n\n if ($match) {\n $this->_setMatch($routes[$route_keys[$i]]);\n return $this->_match;\n }\n\n $this->_setMatch(null);\n return $this->_match;\n }",
"public function match(RequestInterface $request)\n {\n $slugs = [];\n $method = $request->getMethod();\n if (isset($this->routes[$method])) {\n \n foreach ($this->routes[$method] as $path => $route) {\n if ($this->processUri($path, $slugs, $request)) {\n $route->addParams($slugs);\n return $route;\n }\n }\n }\n return null;\n }",
"protected function findRoute(Request $request)\n {\n return $this->currentRoute = $this->routes->match($request);\n }",
"public function match(RequestInterface $request): Route\n {\n if (!in_array($request->getRequestMethod(), static::VERBS)) {\n throw new RouteNotFoundException();\n }\n\n try {\n /** @var \\App\\SparkPlug\\Routing\\Route $route */\n $route = $this->routes[$request->getRequestMethod()]->find($request->getUri());\n } catch (RouteNotFoundException $e) {\n foreach ($this->routes[$request->getRequestMethod()] as $route) {\n if (preg_match(RouteStringConverter::toRegex($route), $request->getUri(), $match)) {\n if (isset($match[1])) {\n array_shift($match);\n $route->setArguments($match);\n }\n\n return $route;\n }\n }\n throw new RouteNotFoundException();\n }\n\n return $route;\n }",
"public function match(IRequest $httpRequest)\n {\n $pathInfo = $httpRequest->getUrl()->getPathInfo();\n\n // parse locale\n $locale = $this->defaultParameters['locale'];\n if (preg_match('/((?<locale>[a-z]{2})\\/)?/', $pathInfo, $m) && isset($m['locale'])) {\n $locale = trim($m['locale'], '/_');\n $pathInfo = trim(substr($pathInfo, strlen($m['locale'])), '/_'); // clean slug\n }\n\n // select locale by domain\n if ($this->domainAlias) {\n $host = $httpRequest->url->host; // get url host for select by locale\n if (isset($this->domainAlias[$host])) {\n $locale = $this->domainAlias[$host];\n }\n }\n\n // parse alias\n $alias = null;\n if (preg_match('/((?<alias>[a-z0-9-\\/]+)(\\/)?)?/', $pathInfo, $m) && isset($m['alias'])) {\n $alias = trim($m['alias'], '/_');\n $pathInfo = trim(substr($pathInfo, strlen($m['alias'])), '/_'); // clean locale from slug\n }\n\n // parse paginator\n $parameters = [];\n if (preg_match('/((?<vp>[a-z0-9-]+)(\\/)?)?/', $pathInfo, $m) && isset($m['vp'])) {\n $parameters[$this->paginatorVariable] = trim($m['vp'], '/_');\n }\n\n // set default presenter\n $presenter = $this->defaultParameters['presenter'];\n\n // set locale to parameters\n $parameters['locale'] = $locale;\n\n // clean alias from last slug\n if ($alias) {\n $alias = rtrim($alias, '/_');\n }\n\n if ($alias) {\n // load parameters\n $param = $this->driver->getParametersByAlias($locale, $alias);\n if ($param) {\n $presenter = $param['presenter'];\n $parameters['action'] = $param['action'];\n if ($param['id_item']) {\n $parameters['id'] = $param['id_item'];\n }\n } else {\n return null;\n }\n }\n\n $parameters += $httpRequest->getQuery();\n\n if (!$presenter) {\n return null;\n }\n\n return new Request(\n $presenter,\n $httpRequest->getMethod(),\n $parameters,\n $httpRequest->getPost(),\n $httpRequest->getFiles(),\n [Request::SECURED => $httpRequest->isSecured()]\n );\n }",
"public function match(IRequest $httpRequest): ?array\n {\n if (!$httpRequest->isMethod($this->method)) {\n return null;\n }\n\n return $this->route->match($httpRequest);\n }",
"public function matches(Route $route, Request $request);",
"public function in(Request $request)\n {\n $tagged = false;\n\n /**\n * @var Route $route\n */\n foreach ($this->routes as $route) {\n\n $placeholders = $route->matches($request);\n if ($placeholders !== false) {\n\n // Dispatch a matched event\n if (!is_null($this->dispatcher)) {\n $this->dispatcher->dispatch(RouterEvent::ROUTE_MATCHED, new RouterEvent($route, $this));\n }\n\n // Add the matched route's parameters to the request\n $request = $request->withParameter('_controller', array(\n 'class' => $route->getController(),\n 'method' => $route->getAction()\n ));\n\n // Add any matched route placeholders to the request parameters\n foreach ($placeholders as $placeholderKey => $placeholderValue) {\n $request = $request->withParameter($placeholderKey, $placeholderValue);\n }\n\n $tagged = true;\n break;\n }\n }\n\n // If no suitable route was found...\n if (!$tagged) {\n throw RouterException::noRouteExists($request->getMethod(), $request->getUri()->getPath());\n }\n\n return $request;\n }",
"public function getMatcher();",
"public function match($request) {\n $requestArr = $this->explodeRequest($request);\n /*if (count($requestArr) < $this->countPatternArr) {\n return false;\n }*/\n for ($i = 0; $i < $this->countPatternArr; $i++) {\n if ($this->isParam($this->patternArr[$i])) {\n continue;\n }\n if (0 !== strcasecmp($this->patternArr[$i], $requestArr[$i])) {\n return false;\n }\n }\n return true;\n }",
"public function matchRequest(Request $request)\n {\n\n $url = explode('?', $request->getUri());\n $uri = $url[0];\n\n if (in_array($uri, ['', '/'])) {\n return ['result' => self::FOUND, 'route' => $this->defaultRoute, 'params' => []];\n }\n\n foreach ($this->routesCollection as $key => $route) {\n // check method rules\n if (!in_array(strtoupper($request->getMethod()), $route['allowedMethods'])) {\n continue;\n }\n\n // check if ajax is required\n if ($request->isAjax() != $route['requireAjax']) {\n continue;\n }\n\n $pattern = '@^/' . $key . '(/{0,1}$|/.+)@';\n\n if (preg_match($pattern, $uri)) {\n // check controller\n $classname = self::controllerName($route['callback']['controller']);\n if (!class_exists($classname)) {\n throw new \\Exception('Controller error!');\n }\n\n $fromUrl = explode('/', preg_replace('@^/@', '', $uri));\n array_shift($fromUrl);\n\n // override action from url\n if (isset($fromUrl[0]) && $fromUrl[0] != \"\") {\n $action = self::actionName($fromUrl[0]);\n if (method_exists($classname, $action)) {\n $route['callback']['action'] = $fromUrl[0];\n array_shift($fromUrl);\n }\n }\n\n return ['result' => self::FOUND, 'route' => $route, 'params' => $this->_filterParams($fromUrl) ];\n }\n }\n\n return ['result' => self::NOT_FOUND, 'route' => $this->notFoundRoute, 'params' => []];\n }",
"public function search($request, $response)\n {\n }",
"protected function findValueToMatch($requestPath)\n\t{\n\t\t// var_dump(\"findValueToMatch($requestPath)\");\n\t\treturn $requestPath;\n\t}",
"function getMatchingRoute($santitizedUrl) {\n \n foreach ($this->routes as &$route) { \n if ($route->isMatch($santitizedUrl)) {\n return $route; \n }\n }\n \n return null;\n }",
"public function waitRequest(): ?Request;",
"public function request(ServerRequest $request = null)\n {\n $finding = $this->map->findByRequest($request = ($request ?: $this->request));\n\n return $this->run($finding);\n }",
"public function match(ServerRequestInterface $request) : RouteInterface;",
"public function match(Request $request)\n {\n\n $newtp = $request->newTp;\n $oldtp = $request->oldTp;\n $quality = 1;\n $apiKey = $this->apiKey;\n $apiSecret = $this->apiSecret;\n $typingdna_url = urldecode($this->typingdnaurl . '/match');\n /*************************************************\n * The data to be sent to the server, you can send\n * a new typing pattern along with one older typing pattern\n *************************************************/\n $postdata = http_build_query(\n array(\n 'tp1' => $newtp,\n 'tp2' => $oldtp,\n 'quality' => $quality,\n )\n );\n $opts = array(\n 'http' => array(\n 'method' => 'POST',\n 'header' => \"Content-type: \" . \"application/x-www-form-urlencoded\" . \"\\r\\n\" .\n 'Authorization: Basic ' . base64_encode(\"$apiKey:$apiSecret\"),\n 'content' => $postdata,\n ),\n );\n $context = stream_context_create($opts);\n $response = json_decode(file_get_contents($typingdna_url, false, $context));\n /*************************************************\n * Returns a result: 1 for true match, 0 for false\n * match or returns the error if applicable\n *************************************************/\n return $response->{'score'};\n }",
"public function findFirst($req){\n\t\treturn current($this->find($req));\n\t}",
"public function lookup() { return $this->doRequest(); }",
"protected function matchValue($requestPath)\n {\n\n\n /* TODO refactoring */\n if (substr_count($requestPath, \"media/\")) {\n return false;\n }\n\n $this->request = new ActionRequest(new Request(array(), array(), array(), array()));\n $this->securityContext->setRequest($this->request);\n\n $context = current($this->contextFactory->getInstances());\n $node = null;\n $requestPathMasced = '';\n\n\n\n $nodes = $this->nodeDataRepository->findByProperties($requestPath, 'Phlu.Neos.NodeTypes:Shorturl', $context->getWorkspace(), $context->getDimensions());\n if (count($nodes) === 0) {\n $requestPathMasced = str_replace(\"/\", \"\\/\", $requestPath);\n $nodes = $this->nodeDataRepository->findByProperties($requestPathMasced, 'Phlu.Neos.NodeTypes:Shorturl', $context->getWorkspace(), $context->getDimensions());\n }\n\n\n foreach ($nodes as $n) {\n\n\n if ($node == null && $n->hasProperty('phluNeosNodeTypesShorturl') && ($n->getProperty('phluNeosNodeTypesShorturl') == $requestPath || $requestPathMasced == $requestPath)) {\n\n /* @var \\Neos\\ContentRepository\\Domain\\Model\\Node $node */\n if ($node == null && $n->getNodeType()->isOfType(\"Neos.NodeTypes:Page\")) {\n /** @var NodeInterface $node */\n $node = new Node($n, $context);\n }\n\n if ($node == null && $n->getNodeType()->isOfType(\"Phlu.Qmpilot.NodeTypes:File\")) {\n\n $asset = $n->getProperty('asset');\n\n if ($asset && $asset->getResource()) {\n\n\n if (is_string($asset->getResource()->getLink()) && substr($asset->getResource()->getLink(), 0, 7) === 'node://') {\n $node = new Node($n, $context);\n $controllerContext = new ControllerContext($this->request, new Response(), new Arguments(array()), new UriBuilder());\n header(\"Location: \" . $this->linkingService->resolveNodeUri($asset->getResource()->getLink(), $node, $controllerContext));\n exit;\n\n }\n\n\n $redirectUri = $this->resourceViewHelper->renderResource($asset->getResource());\n /** @var NodeInterface $node */\n $nNode = new Node($n, $context);\n\n $redirectUriFinal = $this->nodeHelper->getEmbeddedLink($nNode, $redirectUri, $this->request);\n\n\n header(\"Location: \" . $redirectUriFinal);\n exit;\n\n }\n\n }\n\n }\n\n }\n\n\n if ($node == null) {\n\n $nodes = $this->nodeDataRepository->findByProperties(\"%\", 'Phlu.Qmpilot.NodeTypes:File', $context->getWorkspace(), $context->getDimensions());\n\n foreach ($nodes as $n) {\n\n\n if ($node == null && $n->hasProperty('asset') && $n->getProperty('asset') && $n->getProperty('asset')->getResource()) {\n\n $asset = $n->getProperty('asset');\n\n\n $uri = $this->resourceViewHelper->render(null, null, $asset->getResource());\n $redirectUriSegments = explode(\"://\", $uri);\n\n if (isset($redirectUriSegments[1]) && ($redirectUriSegments[1] == \"www.phlu.ch/\" . $requestPath || $redirectUriSegments[1] == \"www.phlu.ch/\" . $requestPath . \"/\" || $redirectUriSegments[1] == \"iframe.phlu.ch/\" . $requestPath || $redirectUriSegments[1] == \"iframe.phlu.ch/\" . $requestPath . \"/\")) {\n /** @var NodeInterface $node */\n $node = new Node($n, $context);\n\n $flowquery = new FlowQuery(array($node));\n $documentNode = $flowquery->closest(\"[instanceof Neos.NodeTypes:Page]\")->get(0);\n\n if ($documentNode) {\n $redirectUri = $this->nodeHelper->getEmbeddedLink($node, $uri, $this->request);\n if ($redirectUri) {\n header(\"Location: \" . $redirectUri);\n exit;\n }\n }\n\n }\n }\n }\n }\n\n\n if ($node == null) {\n /* @var ContentContext $context */\n $node = $context->getNodeByIdentifier($requestPath);\n if ($node) {\n $query = new FlowQuery(array($node));\n $documentNode = $query->closest(\"[instanceof Neos.NodeTypes:Page]\")->get(0);\n if ($documentNode) {\n $node = $documentNode;\n }\n }\n\n }\n\n\n if ($node == null) {\n\n\n /* @var ContentContext $context */\n $asset = $this->assetRepository->findByIdentifier($requestPath);\n if (!$asset) {\n $asset = $this->assetRepository->findByIdentifier('qmpilot-objectid-' . $requestPath);\n }\n\n\n if (!$asset) {\n\n foreach ($this->assetRepository->findBySearchIndex($requestPath) as $a) {\n /* @var Asset $a */\n if (!$asset && substr_count($a->getSearchIndex(), 'oid=' . $requestPath)) {\n $asset = $a;\n }\n }\n }\n\n\n if ($asset) {\n\n $uri = $this->resourceViewHelper->renderResource($asset->getResource(), $context);\n\n $redirectUriSegments = explode(\"://\", $uri);\n\n\n if (isset($redirectUriSegments[1]) && ($redirectUriSegments[1] == \"www.phlu.ch/\" . $requestPath || $redirectUriSegments[1] == \"www.phlu.ch/\" . $requestPath . \"/\" || $redirectUriSegments[1] == \"iframe.phlu.ch/\" . $requestPath || $redirectUriSegments[1] == \"iframe.phlu.ch/\" . $requestPath . \"/\")) {\n /** @var NodeInterface $node */\n $node = new Node($n, $context);\n\n $flowquery = new FlowQuery(array($node));\n $documentNode = $flowquery->closest(\"[instanceof Neos.NodeTypes:Page]\")->get(0);\n\n if ($documentNode) {\n $redirectUri = $this->nodeHelper->getEmbeddedLink($node, $uri, $this->request);\n if ($redirectUri) {\n header(\"Location: \" . $redirectUri);\n exit;\n }\n }\n\n } else {\n header(\"Location: \" . $uri);\n exit;\n }\n\n\n }\n }\n\n\n\n if ($node == null) {\n throw new PageNotFoundException('Page ' . $requestPath . ' was not found.', 1346950755);\n return false;\n }\n\n $this->value = $node->getContextPath();\n\n return true;\n\n }",
"public function findMatch(\\string $uri, \\string $method);",
"public function processRequest(): ResponseInterface\n {\n $routes = $this->bs->routes();\n $request = new Request($this->bs->globals());\n $routingEngine = new RoutingEngine($routes);\n $result = $routingEngine->resolve(\n $request->method(),\n $request->uri()\n );\n if($result === null) {\n return new TextResponse(\"404 page not found\");\n }\n $requestHandler = new RequestHandler(\n $this,\n $request,\n $this->bs->middlewares(),\n $result\n );\n $response = $requestHandler->handleRequest();\n return $response;\n }",
"public function __invoke(Request $request)\n {\n if (isset($this->options['header'])) {\n if ($request->hasHeader($this->options['header'])) {\n $header = $request->getHeader($this->options['header'])[0];\n if (preg_match($this->options['regex'], $header, $matches)) {\n return $matches[1];\n }\n }\n }\n\n /** If nothing on header, try query parameters */\n if (isset($this->options['parameter'])) {\n if (!empty($request->getQueryParams()[$this->options['parameter']]))\n return $request->getQueryParams()[$this->options['parameter']];\n }\n\n /** If nothing on parameters, try cookies */\n if (isset($this->options['cookie'])) {\n $cookie_params = $request->getCookieParams();\n if (!empty($cookie_params[$this->options[\"cookie\"]])) {\n return $cookie_params[$this->options[\"cookie\"]];\n };\n }\n\n /** If nothing until now, check argument as last try */\n if (isset($this->options['argument'])) {\n if ($route = $request->getAttribute('route')) {\n $argument = $route->getArgument($this->options['argument']);\n if (!empty($argument)) {\n return $argument;\n }\n }\n }\n\n throw new TokenNotFoundException('Token not found');\n }",
"public function match(Request $request, &$params=array())\n {\n $params = array();\n $matchUri = $request->uri;\n\n foreach ($this->routines as $routine)\n if ($routine instanceof IgnorableFileExtension)\n $matchUri = preg_replace('#(\\.[\\w\\d-_.~\\+]+)*$#', '',\n $request->uri);\n\n if (!preg_match($this->regexForMatch, $matchUri, $params))\n return false;\n\n array_shift($params);\n\n if (false !== stripos($this->pattern, '/**') && false !== stripos(end($params), '/')) {\n $lastParam = array_pop($params);\n $params[] = explode('/', ltrim($lastParam, '/'));\n }\n elseif (false !== stripos($this->pattern, '/**') && !isset($params[0]))\n $params[] = array(); // callback expects a parameter give it\n\n return true;\n }",
"public function findFirstMatchingRoute($alternative=false) {\n// \t\tdebug('$this', $this);\n// \t\tdebug('Routes', $this->getRoutes());\n\t\tforeach( $this->getRoutes() as $methodRoutes ) {\n\t\t\tif( !isset($methodRoutes[$this->method]) ) { continue; }\n\t\t\t/* @var $route HTTPRoute */\n\t\t\t$route\t= $methodRoutes[$this->method];\n\t\t\tif( $route->isMatchingRequest($this, $values, $alternative) ) {\n\t\t\t\t$this->pathValues\t= (object) $values;\n\t\t\t\treturn $route;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public function getRequest(): ?RequestInterface;",
"public function getMatchingProduct($request)\n {\n require_once (dirname(__FILE__) . '/Model/GetMatchingProductResponse.php');\n return MarketplaceWebServiceProducts_Model_GetMatchingProductResponse::fromXML($this->_invoke('GetMatchingProduct'));\n }",
"public function match($url=null, $method=null)\n{\n foreach(RouteCollection::group($method) as $route)\n {\n $regex = $route->convertPattern();\n if(preg_match($regex, $url, $matches))\n {\n array_shift($matches);\n $this->matches = $matches;\n $this->route = $route;\n $route->register('matches', $matches);\n $route->register('regex', $regex);\n return $route->parameters();\n }\n }\n return false;\n}",
"public function getBestEncodingMatch(\n array $supportedEncodings,\n IHttpRequestMessage $request,\n MediaTypeHeaderValue $matchedMediaTypeHeaderValue = null\n ): ?string;",
"public function matchesRequest()\n {\n return $this->event->has('queryText') && $this->payload->has('originalDetectIntentRequest');\n }",
"public function find(ServerRequestInterface $request, array &$additionalCredentialValues): ?string;",
"public function find(Request $request, array $routes)\n {\n foreach ($routes as $route) {\n\n if(!$this->matchMethod($request, $route)){\n continue;\n }\n\n if(!$this->matchContentType($request, $route)){\n continue;\n }\n\n if(!$this->matchFilters($route)){\n continue;\n }\n\n $routeMatches = $this->matchPattern($request, $route);\n if ($routeMatches) {\n $route->setMatches($routeMatches);\n return $route;\n }\n }\n throw new RouteException(\n sprintf('No route found for uri \"%s\"', $request->getRequestUri()),\n $request,\n $routes\n );\n }",
"public function matches(RequestInterface $request) {\n\t static $regex_match = '#(nokia|iphone|android|motorola|^mot\\-|softbank|foma|docomo|kddi|up\\.browser|up\\.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\\-|longcos|pantech|gionee|^sie\\-|portalmmm|jig\\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\\s*mobi|opera\\*mini|320x320|240x320|176x220)#i';\n\n\t return $request->getHeader('X-WAP-PROFILE', false) !== false or $request->getHeader('PROFILE', false) !== false or preg_match($regex_match, strtolower($request->getHeader('USER-AGENT')));\n }",
"public function detect(Request $request)\n {\n $time = $request->server->get('REQUEST_TIME');\n\n // Ask the router for a version.\n return call_user_func($this->router, $time);\n }",
"function news_requestFilter( $inRequestVariable, $inRegex, $inDefault = \"\" ) {\n if( ! isset( $_REQUEST[ $inRequestVariable ] ) ) {\n return $inDefault;\n }\n \n $numMatches = preg_match( $inRegex,\n $_REQUEST[ $inRequestVariable ], $matches );\n\n if( $numMatches != 1 ) {\n return $inDefault;\n }\n \n return $matches[0];\n }",
"private function findRoute(RouteCollection $routes, Request $request): Route\n {\n try\n {\n return $routes->match($request);\n }\n catch (RouterException $e)\n {\n return $routes->matchCatchAll($request);\n }\n }",
"protected function MatchRoutes($Request)\n\t{\n\t\t$file=null;\n\t\tforeach (self::$Routes as $route=>$controller)\n\t\t{\n\t\t\tif (strpos($route,\"*\")!==false) //wildcard route\n\t\t\t{\n\t\t\t\tif (strpos($route,\"*\")!=strlen($route)-1)\n\t\t\t\t\tthrow new InvalidWildcardException(\"You can only set wildcard as last character of a route: {$route}\");\n\t\t\t\tif (substr($Request,0,strlen($route)-1 )==substr($route,0,-1))\n\t\t\t\t{\n\t\t\t\t\t$file=$controller;\n\t\t\t\t\t$this->restOfRequest=substr($Request,strlen($route)-1);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($Request==$route)\n\t\t\t\t\t$file=$controller;\n\t\t\t}\n\t\t\tif (!$file) continue; //route not found\n\t\t\t\n\t\t\tif( file_exists(_UFO_LOCAL_CONTROLLERS_DIR_.\"{$file}.php\")){\n\t\t\t\t$originalFile=_UFO_LOCAL_CONTROLLERS_DIR_.\"{$file}.php\";\n\t\t\t\t$file=realpath($originalFile);\n\t\t\t\tif (!$file) //file not found\n\t\t\t\t\tthrow new InvalidRouteException(\"Route '{$route}' points to a non-existing file '{$originalFile}'\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$originalFile=_UFO_GLOBAL_CONTROLLERS_DIR_.\"{$file}.php\";\n\t\t\t\t$file=realpath($originalFile);\n\t\t\t\tif (!$file) //file not found\n\t\t\t\t\tthrow new InvalidRouteException(\"Route '{$route}' points to a non-existing file '{$originalFile}'\");\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t//everything set, return this file\n\t\t\tbreak;\n\t\t}\n\t\tif (!$file) return \"\"; //no route found\n\t\treturn $file;\n\t}",
"#[Pure]\nfunction http_match_request_header($header, $value, $match_case = null) {}",
"public function get(RequestInterface $request)\n {\n $id = $request->getUrl();\n $cache = Arrays::get($this->cache, $id);\n if ($cache === null) {\n return null;\n }\n\n if ($cache['expires'] >= time()) {\n return $cache['response'];\n }\n\n unset($this->cache[$id]);\n return null;\n }",
"public function matches(Request $request)\n {\n return $this->websites->getWebsiteByDomain(\n $request->getHost()\n );\n }",
"public function matchBy(MatchableRequestInterface $matchable): bool;",
"public function testRequestResponseStrategyRouteSingletonRequestFromContainer()\n {\n\n $container = new Container();\n $container->add('Symfony\\Component\\HttpFoundation\\Request', new Request(['get' => 2], ['post' => 3]));\n $collection = new Route\\RouteCollection($container);\n $collection->setStrategy(new RequestResponseStrategy);\n\n $collection->get('/route', function ($request, $response) {\n $this->assertEquals(2, $request->query->get('get'));\n $this->assertEquals(3, $request->request->get('post'));\n return $response;\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route');\n\n }",
"public function matchAction(Request $request)\n {\n $this->denyAccessUnlessGranted(Role::ACCOUNTING);\n $queryForm = $this->createQueryForm();\n\n if ($request->get('filter')) {\n $queryForm->handleRequest($request);\n }\n\n $filters = $queryForm->getData();\n $transactions = $this->loadTransactions($filters);\n $matches = $this->findMatches($transactions, $filters);\n $postForm = $this->createPostForm($matches);\n\n $postForm->handleRequest($request);\n if ($postForm->isSubmitted() && $postForm->isValid()) {\n $this->dbm->beginTransaction();\n try {\n $this->processPost($request, $matches);\n $this->dbm->flushAndCommit();\n } catch (\\Exception $ex) {\n $this->dbm->rollBack();\n throw $ex;\n }\n return $this->redirect($this->getCurrentUri());\n }\n\n return [\n 'queryForm' => $queryForm->createView(),\n 'matches' => $matches,\n 'postForm' => $postForm->createView(),\n ];\n }",
"public function matchRequest(\\WP $environment)\n {\n $request = Request::getInstance();\n $matched_route = $this->match($environment->query_vars, $request->getMethod());\n\n if ($matched_route instanceof Route) {\n $this->matchedRoute = $matched_route;\n //Add query vars to request object\n $path = $this->matchedRoute->getPath();\n if (strpos($path, '{') !== false) {\n preg_match_all('/{(.*?)}/', $path, $wildCardsMatchs);\n if (!empty($wildCardsMatchs[1])) {\n foreach ($wildCardsMatchs[1] as $wildCard) {\n //Passing them to the request\n $request->query->set($wildCard, $environment->query_vars[$wildCard]);\n //Keeping them for the callable\n $this->matchedRouteParams[$wildCard] = $environment->query_vars[$wildCard];\n }\n }\n }\n }\n if ($matched_route instanceof \\WP_Error) {\n if (in_array('route_not_found', $matched_route->get_error_codes())) {\n wp_redirect('/404');\n }\n if (in_array('method_not_authorized', $matched_route->get_error_codes())) {\n wp_redirect('/503');\n }\n }\n }",
"function get(Request &$request, Response &$response);",
"public function testRequestResponseStrategyRouteRequestFromServiceProvider()\n {\n\n $container = new Container();\n\n //Build mock provider\n $provider = $this->getMock('League\\Container\\ServiceProvider');\n\n $provider->expects($this->any())\n ->method('provides')\n ->will($this->returnCallback(function() {\n $args = func_get_args();\n return $args[0] === 'Symfony\\Component\\HttpFoundation\\Request';\n }));\n\n $provider->expects($this->once())\n ->method('register')\n ->will($this->returnCallback(function() use ($container) {\n $container->add('Symfony\\Component\\HttpFoundation\\Request', null, true)->withArguments([['get' => 4], ['post' => 5]]);\n }));\n\n $container->addServiceProvider($provider);\n\n $collection = new Route\\RouteCollection($container);\n $collection->setStrategy(new RequestResponseStrategy);\n\n $collection->get('/route', function ($request, $response) {\n $this->assertEquals(4, $request->query->get('get'));\n $this->assertEquals(5, $request->request->get('post'));\n return $response;\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route');\n\n }",
"private function validate_match_request(Request $request){\n if ($request->host_team == $request->guest_team)\n {\n return '0';\n }else {\n return '1';\n }\n }",
"private function resolver($criteria, $request)\n {\n if (Resolver::isRegexPattern($criteria))\n {\n $template = Resolver::checkTemplate($criteria);\n return Resolver::regexTest($template, $request);\n }\n else\n {\n return Resolver::testCondition($criteria, $request);\n }\n }",
"public function verify(Request $request)\n {\n $userid = $request->userId;\n $tp = $request->tp;\n $quality = 1;\n if (isset($request->quality)) {\n $quality = $request->quality;\n }\n $apiKey = $this->apiKey;\n $apiSecret = $this->apiSecret;\n $typingdna_url = urldecode($this->typingdnaurl . '/verify/' . $userid);\n $postdata = http_build_query(\n array(\n 'tp' => $tp,\n 'quality' => $quality,\n )\n );\n $opts = array(\n 'http' => array(\n 'method' => 'POST',\n 'header' => \"Content-type: \" . \"application/x-www-form-urlencoded\" . \"\\r\\n\" .\n 'Authorization: Basic ' . base64_encode(\"$apiKey:$apiSecret\"),\n 'content' => $postdata,\n ),\n );\n $context = stream_context_create($opts);\n $response = json_decode(file_get_contents($typingdna_url, false, $context));\n /*************************************************\n * Returns a result: 1 for true match, 0 for false\n * match or returns the error if applicable\n *************************************************/\n if (intval($response->{'success'} === 0)) {\n return $response->{'message'};\n } else {\n return $response->{'result'};\n }\n }",
"public function read($request)\n {\n $request_hash = $this->hash_request($request);\n $result = $this->_db->find('first', array('conditions' => array('request_hash' => $request_hash), 'fields' => array('request_response')));\n\n if (!empty($result)) {\n return $result['MysqlCacheModel']['request_response'];\n } else {\n return false;\n }\n }",
"public function route(Request &$request): false|string|callable|array\n\t{\n\t\t$routeInfo = $this->dispatcher->dispatch(\n\t\t\t$request->getMethod(),\n\t\t\t$request->getUri()->getPath()\n\t\t);\n\n\t\tif ($routeInfo[0] !== \\FastRoute\\Dispatcher::FOUND) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($routeInfo[2] as $key => $val) {\n\t\t\t$request = $request->withAttribute($key, $val);\n\t\t}\n\t\treturn $routeInfo[1];\n\t}",
"public function matching($query, $matcher = null) {\n\n $modelClass = $this->getModel();\n\n if (!$matcher) {\n $matcher = call_user_func(array($modelClass, '__getFullTextMatcher'));\n }\n\n return $matcher->filter($this, $query);\n\n }",
"public function matchCached(Request $request)\n {\n if (!$this->cache) {\n return false;\n }\n $cached = $this->cache->fetch($key = $this->getRequestCacheKey($request));\n if ($cached) {\n if (!is_array($cached)) {\n throw new \\Exception(\"Cache value $key is not an array\");\n }\n return $cached;\n }\n return false;\n }",
"abstract public function getRouteMatch();",
"protected function findController(Request $req)\n {\n foreach ($this->controllers as $controller) {\n if ($this->matcher->match($req, $controller)) {\n $this->tracer->info(\"Found Controller \" . get_class($controller));\n return $controller;\n }\n }\n \n $this->tracer->info(\"No matching Controller for {$req->getUri()} discovered, returning not found controller: \" . ($this->notFound ? \"yes\" : \"no\"));\n return $this->notFound ?: false;\n }",
"public function getRouteMatch();",
"private function findToken(Request $request)\n {\n if ($request->headers->has('X-JWT-Assertion')) {\n return $request->headers->get('X-JWT-Assertion');\n } elseif ($request->request->has('jwt-token')) {\n return $request->request->get('jwt-token');\n } elseif ($request->query->has('jwt-token')) {\n return $request->query->get('jwt-token');\n }\n return false;\n }",
"public function testRequestResponseStrategyRouteCreateFromGlobalsRequest()\n {\n\n $collection = new Route\\RouteCollection();\n $collection->setStrategy(new RequestResponseStrategy);\n\n $_GET = ['test' => 1];\n\n $collection->get('/route', function ($request, $response) {\n $this->assertEquals(1, $request->query->get('test'));\n return $response;\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route');\n\n }",
"public static function request($path_info) {\n $result = \"\";\n // iterate through all the routes (the routes added first have the highest priority)\n $routes = self::getRoutes();\n foreach($routes as $route) {\n // check if one of the route matches\n if(($back = $route->request($path_info)) !== false) {\n // if yes return the result\n $result = $back;\n break;\n }\n }\n return $result;\n }",
"function get_request_contains($request_url,$search_string) {\n //get the current url\n $string = $search_string;\n $url = $request_url;\n //~ echo $request_url;\n //check for string in url\n $lookup = strpos($url, $string);\n\n\n //If string is found, set the value of found_context\n if($lookup > 1 || $lookup !== false) {\n //~ echo 'is_component request';\n return true;\n }\n\n //If not found, set UNSET the value of found_context\n else {\n //~ echo 'is_not component request';\n return false; \n }\n}",
"public function request(IRequest $request = null): ?IRequest {\n $this->_builder = new Request\\Builder();\n\n return $this->_builder->request($request);\n }",
"public function getMatchFound()\n {\n return $this->get('MatchFound');\n }",
"public function getResponse(string &$packageRoot, Request &$request): Response;",
"public function matchMap($requestUri)\n\t{\n\t\t$foundDynamicClass = null;\n\t\t$foundDynamicMethod = null;\n\t\t$foundDynamicArgs = array();\n\n\t\t//-- Ignore query parameters during matching\n\t\t$parsed = parse_url($requestUri);\n\t\t$pathToMatch = $parsed['path'];\n\n\t\t//-- The process of matching is easier if there are no preceding slashes\n\t\t$tempThisPath = preg_replace('/^\\//', '', $this->_path);\n\t\t$tempPathToMatch = preg_replace('/^\\//', '', $pathToMatch);\n\n\t\t//-- Get the path elements used for matching later\n\t\t$thisPathElements = explode('/', $tempThisPath);\n\t\t$matchPathElements = explode('/', $tempPathToMatch);\n\t\t\n\t\t//-- If the number of elements in each path is not the same, there is no\n\t\t// way this could be it.\n\t\tif (count($thisPathElements) !== count($matchPathElements))\n\t\t\treturn false;\n\n\t\t//-- Construct a path string that will be used for matching\n\t\t$possibleMatchString = '';\n\t\tforeach ($thisPathElements as $i => $thisPathElement) {\n\t\t\t//-- ':'s are never allowed at the beginning of the path element\n\t\t\tif (preg_match('/^:/', $matchPathElements[$i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//-- This element may simply be static, if so the direct comparison\n\t\t\t// will discover it.\n\t\t\tif ($thisPathElement === $matchPathElements[$i]) {\n\t\t\t\t$possibleMatchString .= \"/{$matchPathElements[$i]}\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//-- Consult the dynamic array for help in matching\n\t\t\tif (true === isset($this->_dynamicElements[$thisPathElement])) {\n\t\t\t\t//-- The dynamic array either contains a key like ':id' or a\n\t\t\t\t// regular expression. In the case of a key, the key matches\n\t\t\t\t// anything\n\t\t\t\tif ($this->_dynamicElements[$thisPathElement] === $thisPathElement) {\n\t\t\t\t\t$possibleMatchString .= \"/{$matchPathElements[$i]}\";\n\n\t\t\t\t\t//-- The class and/or method may be getting set dynamically. If so\n\t\t\t\t\t// extract them and set them\n\t\t\t\t\tif (':class' === $thisPathElement && null === $this->getMapClass()) {\n\t\t\t\t\t\t$foundDynamicClass = $matchPathElements[$i];\n\t\t\t\t\t} else if (':method' === $thisPathElement && null === $this->getMapMethod()) {\n\t\t\t\t\t\t$foundDynamicMethod = $matchPathElements[$i];\n\t\t\t\t\t} else if (':class' !== $thisPathElement && ':method' !== $thisPathElement) {\n\t\t\t\t\t\t$foundDynamicArgs[$thisPathElement] = $matchPathElements[$i];\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//-- Attempt a regular expression match\n\t\t\t\t$regexp = '/' . $this->_dynamicElements[$thisPathElement] . '/';\n\t\t\t\tif (preg_match($regexp, $matchPathElements[$i]) > 0) {\n\t\t\t\t\t//-- The class and/or method may be getting set dynamically. If so\n\t\t\t\t\t// extract them and set them\n\t\t\t\t\tif (':class' === $thisPathElement && null === $this->getMapClass()) {\n\t\t\t\t\t\t$foundDynamicClass = $matchPathElements[$i];\n\t\t\t\t\t} else if (':method' === $thisPathElement && null === $this->getMapMethod()) {\n\t\t\t\t\t\t$foundDynamicMethod = $matchPathElements[$i];\n\t\t\t\t\t} else if (':class' !== $thisPathElement && ':method' !== $thisPathElement) {\n\t\t\t\t\t\t$foundDynamicArgs[$thisPathElement] = $matchPathElements[$i];\n\t\t\t\t\t}\n\n\t\t\t\t\t$possibleMatchString .= \"/{$matchPathElements[$i]}\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//-- In order for a full match to succeed, all iterations must match.\n\t\t\t// Because we are continuing with the next loop if any conditions\n\t\t\t// above are met, if this point is reached, this route cannot be\n\t\t\t// a match.\n\t\t\treturn false;\n\t\t}\n\n\t\t//-- Do the final comparison and return the result\n\t\tif ($possibleMatchString === $pathToMatch) {\n\t\t\tif (null !== $foundDynamicClass)\n\t\t\t\t$this->setMapClass($foundDynamicClass);\n\n\t\t\tif (null !== $foundDynamicMethod)\n\t\t\t\t$this->setMapMethod($foundDynamicMethod);\n\n\t\t\tforeach ($foundDynamicArgs as $key => $found_dynamic_arg) {\n\t\t\t\t$this->addMapArguments($key, $found_dynamic_arg);\n\t\t\t}\n\t\t}\n\n\t\treturn ($possibleMatchString === $pathToMatch);\n\t}",
"public function findRouteValue(Enlight_Controller_Request_Request $request, array $values = null)\n {\n if (!$values) {\n $values = $this->getDefaultRouteValues();\n }\n\n $route = $this->cacheRouteGeneration->getActionRoute($request);\n if (isset($values[$route])) {\n return $values[$route];\n }\n\n $route = $this->cacheRouteGeneration->getControllerRoute($request);\n if (isset($values[$route])) {\n return $values[$route];\n }\n\n return null;\n }",
"public function getMatchingProduct($request);",
"public function testRequestResponseStrategyRouteRequestFromContainer()\n {\n\n $container = new Container();\n $container->add('Symfony\\Component\\HttpFoundation\\Request')->withArguments([['get' => 2], ['post' => 3]]);\n $collection = new Route\\RouteCollection($container);\n $collection->setStrategy(new RequestResponseStrategy);\n\n $collection->get('/route', function ($request, $response) {\n $this->assertEquals(2, $request->query->get('get'));\n $this->assertEquals(3, $request->request->get('post'));\n return $response;\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route');\n\n }",
"public function match(Zend_Controller_Request_Http $request)\r\n {\r\n \tif (Mage::app()->getStore()->isAdmin()) {\r\n return false;\r\n }\r\n \r\n \t$pathInfo = $request->getPathInfo();\r\n // remove suffix if any\r\n $suffix = Mage::helper('amlanding/url')->getSuffix();\r\n if ($suffix && '/' != $suffix){\r\n $pathInfo = str_replace($suffix, '', $pathInfo);\r\n }\r\n \r\n $pathInfo = explode('/', trim($pathInfo, '/ '), 2);\r\n $identifier = $pathInfo[0];\r\n $params = (isset($pathInfo[1]) ? $pathInfo[1] : '');\r\n \r\n \r\n\t\t/* @var $page Amasty_Xlanding_Model_Page */\r\n $page = Mage::getModel('amlanding/page');\r\n $pageId = $page->checkIdentifier($identifier, Mage::app()->getStore()->getId());\r\n if (!$pageId) {\r\n return false;\r\n }\r\n \r\n\r\n $params = trim($params, '/ ');\r\n if ($params){\r\n $params = explode('/', $params);\r\n Mage::register('amshopby_current_params', $params);\r\n if ('true' == (string)Mage::getConfig()->getNode('modules/Amasty_Shopby/active')){\r\n $parsed = Mage::helper('amshopby/url')->saveParams($request);\r\n if (!$parsed && !Mage::registry('amshopby_short_parsed')) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n $request->setModuleName('amlanding')\r\n ->setControllerName('page')\r\n ->setActionName('view')\r\n ->setParam('page_id', $pageId)\r\n ->setParam('am_landing', $identifier)\r\n ;\r\n \r\n return true;\r\n }",
"public function match(Zend_Controller_Request_Http $request)\n {\n if (!Mage::isInstalled()) {\n Mage::app()->getFrontController()->getResponse()\n ->setRedirect(Mage::getUrl('install'))\n ->sendResponse();\n exit;\n }\n\n $identifier = trim($request->getPathInfo(), '/');\n\n $condition = new Varien_Object(array(\n 'identifier' => $identifier,\n 'continue' => true\n ));\n Mage::dispatchEvent('mybrand_controller_router_match_before', array(\n 'router' => $this,\n 'condition' => $condition\n ));\n $identifier = $condition->getIdentifier();\n\n if ($condition->getRedirectUrl()) {\n Mage::app()->getFrontController()->getResponse()\n ->setRedirect($condition->getRedirectUrl())\n ->sendResponse();\n $request->setDispatched(true);\n return true;\n }\n\n if (!$condition->getContinue()) {\n return false;\n }\n\n $manufacturer = Mage::getModel('mybrand/manufacturer');\n $id = $manufacturer->checkIdentifier($identifier, Mage::app()->getStore()->getId());\n if (!$id) {\n return false;\n }\n\n $request->setModuleName('mybrand')\n ->setControllerName('manufacturer')\n ->setActionName('view')\n ->setParam('id', $id);\n $request->setAlias(\n Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS,\n $identifier\n );\n\n return true;\n }"
] | [
"0.6781053",
"0.6550235",
"0.6517535",
"0.6255369",
"0.6147484",
"0.60608935",
"0.6049397",
"0.60195595",
"0.60067314",
"0.5973606",
"0.5924475",
"0.59000385",
"0.581304",
"0.57457614",
"0.56507015",
"0.564384",
"0.5638988",
"0.5636702",
"0.56269705",
"0.56119657",
"0.560896",
"0.55899584",
"0.5584784",
"0.5564716",
"0.55464715",
"0.55377007",
"0.5514692",
"0.55102277",
"0.5494858",
"0.5487297",
"0.5380119",
"0.5353004",
"0.53498966",
"0.53325117",
"0.53263104",
"0.5314243",
"0.5311102",
"0.5295151",
"0.5264852",
"0.525063",
"0.5221441",
"0.5217876",
"0.5204802",
"0.5190833",
"0.51900756",
"0.51800305",
"0.51721215",
"0.5114005",
"0.5099864",
"0.5094907",
"0.5088297",
"0.5031893",
"0.49987185",
"0.49862677",
"0.49810448",
"0.4978113",
"0.49208486",
"0.4911201",
"0.4907463",
"0.48993778",
"0.4894322",
"0.48875198",
"0.4885099",
"0.4884979",
"0.48786575",
"0.48717046",
"0.48677173",
"0.48630714",
"0.48317352",
"0.48311642",
"0.4826811",
"0.48137552",
"0.48126355",
"0.48106274",
"0.4805631",
"0.48039618",
"0.4803741",
"0.48011473",
"0.47975767",
"0.47912484",
"0.47804266",
"0.4779047",
"0.47654152",
"0.47245198",
"0.47214055",
"0.47156802",
"0.471098",
"0.47072232",
"0.469513",
"0.4690426",
"0.46868503",
"0.46850726",
"0.46796012",
"0.4672319",
"0.4666015",
"0.4663358",
"0.46510908",
"0.4638063",
"0.46317434",
"0.46251434"
] | 0.8107515 | 0 |
Report back our current version | static function version() {
return NICEHTTP_VERSION;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCurrentVersion();",
"public function getVersion() {}",
"public function getVersion() {}",
"public function getVersion() {}",
"public function getVersion() {}",
"public function getVersion() {}",
"public function getVersion()\n\t{\n\t}",
"public function version();",
"public function version();",
"public function version();",
"public function version();",
"public function version();",
"protected function whenNewVersionWasRequested()\n {\n }",
"private function getCurrentVersion() {\n\t\t\n\t\t// Migration from SB3 to SB4\n\t\tif ($this->previous_version = false && $this->actual_version == key($this->versions)) {\n\t\t\treturn;\n\t\t}\n\t}",
"public function latest_version();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"public function getVersion();",
"function getVersion() {\r\n\t\treturn '1.1';\r\n\t}",
"function currentVersion() {\n if($this->current_version === false) {\n $this->current_version = DB::executeFirstCell('SELECT version FROM ' . TABLE_PREFIX . 'update_history ORDER BY created_on DESC LIMIT 0, 1');\n if(empty($this->current_version)) {\n $this->current_version = '1.0';\n } // if\n \t \n \t // activeCollab 2.0.2 failed to record proper version into update \n \t // history so we need to manually check if we have 2.0.2. This is done \n \t // by checking if acx_attachments table exists (introduced in aC 2).\n \t if((version_compare($this->current_version, '2.0') < 0) && DB::tableExists(TABLE_PREFIX . 'attachments')) {\n \t $this->current_version = '2.0.2';\n \t } // if\n } // if\n return $this->current_version;\n }",
"private function _log_version_number () {\n\t\tupdate_option( $this->_token . '_version', $this->_version );\n\t}",
"private function _log_version_number () {\n update_option( $this->_token . '_version', $this->_version );\n }",
"function &getCurrentVersion() {\n\t\treturn $this->currentVersion;\n\t}",
"abstract public function version();",
"abstract public function version();",
"abstract public function getVersion();",
"abstract public function getVersion();",
"abstract public function getVersion();",
"abstract public function getVersion();",
"public function getVersion(): string {}",
"public function version()\n {\n\n }",
"public function get_version();",
"public function version() {\n\t\t\t$this->output->layout = \"empty\";\n\t\t\t$this->output->set(\"date\", Settings::get(\"dynamic.Content Published\", date(\"y-m-d H:i:s\"), true));\n\t\t\t$this->output->set(\"version\", Settings::get(\"dynamic.Content Version\", 1.0, true));\n\t\t\t$this->output->view(\"api/xml/version.php\");\n\t\t\t$this->output->header(\"Content-Type: text/xml\");\n\t\t\t$this->output->cache($this->default_cache_timeout);\n\t\t}",
"function GetVersion()\n {\n return '1.0';\n }",
"private static function version()\n {\n $files = ['Version'];\n $folder = static::$root.'Foundation'.'/';\n\n self::call($files, $folder);\n }",
"public function toString()\n {\n return \"Application new version is correct.\";\n }",
"function sitemgr_upgrade1_4_002()\n{\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'] = '1.5.001';\n}",
"public function version() {\n $versionsTable = TableRegistry::get('Versions');\n $data = $versionsTable->findAllVersion();\n $this->set('web', $data[0]);\n $this->set('iOS', $data[1]);\n $this->set('android', $data[2]);\n }",
"protected function assignVersion()\n {\n\n }",
"abstract public function get_version();",
"private function _log_version_number () {\n\t\t// Log the version number.\n\t\tupdate_option( $this->token . '-version', $this->version );\n\t}",
"public function getVersion(): string;",
"public function getVersion(): string;",
"function &getNewVersion() {\n\t\treturn $this->newVersion;\n\t}",
"protected function assignVersion()\n {\n $this->version = '';\n }",
"public function get_version(){\n return $this->_version;\n }",
"function get_version() {\n\n\t\treturn $this->version;\n\n\t}",
"public function versionCheckAction()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $currentVersion = \"1.6.3\";\n $clientVersion = $_GET['ver'];\n\n if ($clientVersion < $currentVersion) {\n echo \"upgrade\";\n } elseif ($clientVersion == $currentVersion) {\n echo \"latest\";\n } elseif ($clientVersion > $currentVersion) {\n echo \"development\";\n } else {\n echo \"unknown-version\";\n }\n }",
"public function getVersion(){\n $client = Yii::$app->infoServices;\n return $client->getVersion()->return->version;\n }",
"function checkCurrentVersion() {\n $request = new Request();\n $url = 'https://api.github.com/repos/pantheon-systems/cli/releases';\n $url .= '?per_page=1';\n $response = $request->simpleRequest($url, array('absolute_url' => true));\n $release = array_shift($response['data']);\n Terminus::getCache()->putData(\n 'latest_release',\n array('version' => $release->name, 'check_date' => time())\n );\n return $release->name;\n}",
"function checkForUpdate() {\n $cache_data = Terminus::getCache()->getData(\n 'latest_release',\n array('decode_array' => true)\n );\n if (!$cache_data\n || ((int)$cache_data['check_date'] < (int)strtotime('-7 days'))\n ) {\n $logger = Terminus::getLogger();\n try {\n $current_version = checkCurrentVersion();\n if (version_compare($current_version, TERMINUS_VERSION, '>')) {\n $logger->info(\n 'An update to Terminus is available. Please update to {version}.',\n array('version' => $current_version)\n );\n }\n } catch (\\Exception $e) {\n $logger->info($e->getMessage());\n $logger->info('Cannot retrieve current Terminus version.');\n }\n }\n}",
"public function get_version() { \n\n\t\treturn $this->version; \n\n\t}",
"public function getVersion() {\n\t\tif($this->version == \"\")\n\t\t$this->version = \"0.0.0\";\n\t\treturn $this->version;\n\t}",
"public function getVersion() {\n\t\treturn '1.0';\n\t}",
"public function getVersion()\n {\n return $this->sendrequest('version', null);\n }",
"public function getVersion(){\n\t\treturn $this->version;\n\t}",
"public function getVersion() {\r\n return $this->versione;\r\n }",
"protected function _version_check()\n\t{\n\t\tee()->load->library('el_pings');\n\t\t$version_file = ee()->el_pings->get_version_info();\n\n\t\tif ( ! $version_file)\n\t\t{\n\t\t\tee('CP/Alert')->makeBanner('notices')\n\t\t\t\t->asWarning()\n\t\t\t\t->withTitle(lang('cp_message_warn'))\n\t\t\t\t->addToBody(sprintf(\n\t\t\t\t\tlang('new_version_error'),\n\t\t\t\t\tee()->cp->masked_url(DOC_URL.'troubleshooting/error_messages/unexpected_error_occurred_attempting_to_download_the_current_expressionengine_version_number.html')\n\t\t\t\t))\n\t\t\t\t->now();\n\t\t}\n\t}",
"public static function getVersion()\r\n {\r\n \t$i = self::getVersionInfo();\r\n \treturn trim(\"{$i['major']}.{$i['minor']}.{$i['revision']}\" . ($i['patch'] != '' ? \".{$i['patch']}\" : \"\")\r\n \t. \"-{$i['stability']}{$i['number']}\", '.-');\r\n }",
"public function action_update_check()\n\t{\n\t \tUpdate::add( 'DateNinja', 'e64e02e0-38f8-11dd-ae16-0800200c9a66', $this->info->version );\n\t}",
"public function version() { return $this->_m_version; }",
"public function version() { return $this->_m_version; }",
"public function getVersion(): int;",
"public function getVersion(): int;",
"public function getVersion(): int;",
"public function version(){\n\t\t/*echo \"<pre>\";\n\t\tprint_r($this->dataInfos['XMLPM']['VERSION']);\n\t\techo \"</pre>\";*/\n\t\t$version = $this->dataInfos['XMLPM']['VERSION'];\n\t\tif($version!=\"\") return $version;\n\t\treturn \"1.0\";\n\t}",
"public function syncCurrentVersion()\n {\n $date = $this->getNodeText('/p:package/p:date');\n $notes = $this->getNodeText('/p:package/p:notes');\n $api = $this->getNodeText('/p:package/p:version/p:api');\n $stability_api = $this->getNodeText('/p:package/p:stability/p:api');\n $stability_release = $this->getNodeText(\n '/p:package/p:stability/p:release'\n );\n\n $release = $this->_requireCurrentRelease();\n\n $this->replaceTextNodeRelativeTo('./p:date', $release, $date);\n $this->replaceTextNodeRelativeTo(\n './p:notes', $release, $notes . ' '\n );\n $this->replaceTextNodeRelativeTo(\n './p:license',\n $release,\n $this->getLicense(),\n array('uri' => $this->getLicenseLocation())\n );\n $version_node = $this->findNodeRelativeTo(\n './p:version', $release\n );\n $this->replaceTextNodeRelativeTo(\n './p:api', $version_node, $api\n );\n $stability_node = $this->findNodeRelativeTo(\n './p:stability', $release\n );\n $this->replaceTextNodeRelativeTo(\n './p:api', $stability_node, $stability_api\n );\n $this->replaceTextNodeRelativeTo(\n './p:release', $stability_node, $stability_release\n );\n }",
"public function getVersionLog();",
"function getVersion ()\n {\n return $this->_version;\n }",
"public function getVersion()\n {\n return \"1.0.0\";\n }",
"public static function getVersion()\n {\n return '1.0.1';\n }",
"public function version()\n {\n $sPARAMS = array( );\n $result = $this->_api(\"Version\", array($sPARAMS) );\n return($result->VersionResult);\n }",
"public function queryVersion()\n {/*{{{*/\n $this->write(pack('C',\n Firmata::REPORT_VERSION));\n $this->_eval();\n return $this->_version;\n }",
"function get_version() {\n return self::VERSION;\n }",
"function get_version() {\n return self::VERSION;\n }",
"public function fakeVersion();",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}",
"public function get_version() {\n\t\treturn $this->version;\n\t}"
] | [
"0.72814494",
"0.713132",
"0.713132",
"0.713132",
"0.713132",
"0.71305966",
"0.70881027",
"0.7067267",
"0.7067267",
"0.7067267",
"0.7067267",
"0.7067267",
"0.7053756",
"0.6988381",
"0.69844913",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.69195956",
"0.68978035",
"0.6882915",
"0.68773675",
"0.6854571",
"0.6851344",
"0.68056566",
"0.68056566",
"0.67840874",
"0.67840874",
"0.67840874",
"0.67840874",
"0.6783321",
"0.67600787",
"0.6700512",
"0.668905",
"0.66820765",
"0.6679486",
"0.66771495",
"0.6667446",
"0.66646147",
"0.66202366",
"0.65630066",
"0.6562887",
"0.6527551",
"0.6527551",
"0.65231735",
"0.6520465",
"0.64816624",
"0.6470689",
"0.6469624",
"0.64373815",
"0.6427775",
"0.6413428",
"0.64073074",
"0.63927376",
"0.63864774",
"0.6383604",
"0.63708895",
"0.6367938",
"0.6359769",
"0.6347781",
"0.6339585",
"0.6337622",
"0.6337622",
"0.63275665",
"0.63275665",
"0.63275665",
"0.63223034",
"0.6317452",
"0.6312511",
"0.6311092",
"0.6310966",
"0.6309825",
"0.63047856",
"0.6302569",
"0.62916076",
"0.62916076",
"0.6268032",
"0.62632734",
"0.62632734",
"0.62632734",
"0.62632734",
"0.62632734",
"0.62632734"
] | 0.0 | -1 |
Lists all PortfolioItem entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$portfolioSet = $em->getRepository('AntBundle:Portfolio')->findAll();
$paginator = $this->get('knp_paginator');
$pagination = $paginator->paginate(
$portfolioSet,
$this->get('request')->query->get('page', 1)/*page number*/,
10/*limit per page*/
);
foreach ($portfolioSet as $portfolio) {
$portfolioId = $portfolio->getId();
$this->ImageAction($portfolioId);
};
return $this->render('AntBundle:PortfolioItem:index.html.twig', array(
'portfolio' =>$portfolio,
'portfolioSet'=>$portfolioSet,
'pagination' => $pagination
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function all()\n\t{\n\t\t$portfolios = ORM::factory('portfolio')->where('deleted', '=', '')->find_all();\n\n\t\treturn $portfolios;\n\n\t}",
"public function index()\n {\n return $this->itemRepo->findAll();\n }",
"public function index()\n {\n $portfolios = Portfolio::all();\n return $portfolios;\n }",
"public function indexAction() {\n $service = $this->getItemService();\n\n $items = $service->findAll();\n \n return array(\n 'items' => $items,\n );\n }",
"public function indexAction()\n {\n $em = $this->getEm();\n\n $portitems = $em->getRepository('MarcaPortfolioBundle:Portitem')->findAll();\n\n return array('portitems' => $portitems);\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 list()\n {\n $portfolios= Portfolio::all();\n return view('pages.portfolios.list', compact('portfolios'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('StriideInventoryBundle:Item')->findAll();\n\n return $this->render('StriideInventoryBundle:Item:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"public function index()\n {\n $portfolios = Portfolio::paginate(15);\n\n return view('admin.portfolio.index', compact('portfolios'));\n }",
"public function index()\n {\n return view('Portfolio.index')->with('portfolios',Portfolio::all());\n }",
"public function actionPortfolio()\n {\n $searchModel = new PostSearchPortfolio();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('portfolio/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $portfolio=Portfolio::orderBy('id','DESC')->paginate(10);\n return view('backend.portfolio.index')->with('portfolios',$portfolio);\n }",
"public function all()\n {\n $item = new Item;\n $items = $item->all();\n View::renderJson($items);\n }",
"public function index()\n {\n return Inventory::all();\n }",
"public function index()\n {\n return ItemsCategory::withCount('item')->paginate($this->pagination);\n }",
"public function indexAction(Request $request)\r\n {\r\n $user = $this->getUser();\r\n $account = $user->getAccount();\r\n\r\n $sort = $request->query->get('sort');\r\n $direction = $request->query->get('direction');\r\n $em = $this->getDoctrine()->getManager();\r\n if($sort) $portfolioitems = $em->getRepository('UniAdminBundle:PortfolioItem')->findBy(array('account' => $account), array($sort => $direction));\r\n else $portfolioitems = $em->getRepository('UniAdminBundle:PortfolioItem')->findBy(array('account' => $account));\r\n $paginator = $this->get('knp_paginator');\r\n $portfolioitems = $paginator->paginate($portfolioitems, $request->query->getInt('page', 1), 100);\r\n\r\n $deleteForms = array();\r\n foreach($portfolioitems as $key => $portfolioitem) {\r\n $deleteForms[] = $this->createDeleteForm($portfolioitem)->createView();\r\n }\r\n\r\n return $this->render('UniPortfolioBundle:PortfolioItem:index.html.twig', array(\r\n 'portfolioitems' => $portfolioitems,\r\n 'direction' => $direction,\r\n 'sort' => $sort,\r\n 'deleteForms' => $deleteForms,\r\n ));\r\n }",
"public function index()\n {\n $portfolios = Portfolio::latest()->get();\n return view('admin.portfolio.index',compact('portfolios'));\n }",
"public function index()\n {\n return Item::join('categories', 'categories.id', '=', 'items.category_id')\n ->select('categories.name AS category_name', 'items.name', 'items.serial', 'items.description', 'items.max_quantity', 'items.created_at', 'items.category_id AS category', 'items.id', 'items.availability')\n ->latest()\n ->paginate(5);\n }",
"public function index()\n {\n $profileId = isset(auth()->user()->profile) ? auth()->user()->profile->id : 0;\n $portfolios = Portfolio::where('profile_id', $profileId)->orderBy('created_at', 'desc')->paginate(8);\n return view('admin.portfolio.index', compact('portfolios'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $order_Items = $em->getRepository('AppBundle:Order_Item')->findAll();\n\n return $this->render('order_item/index.html.twig', array(\n 'order_Items' => $order_Items,\n ));\n }",
"public function show(Portfolio $portfolio)\n {\n //\n }",
"public function index()\n {\n return Item::orderBy('id', 'DESC')->get();\n }",
"public function index()\n {\n $items = Item::with([\n 'gender:id,name',\n 'type:id,name',\n 'supplier:id,name',\n 'image',\n ])->get()->toArray();\n return $items;\n }",
"public function index()\n {\n return Entity::all();\n }",
"public function index()\n {\n return view('backend.admin.portfolio.experiences.list');\n }",
"public function getItems()\n {\n $items = Item::latest()->paginate(9);\n\n // dd($items);\n return $items;\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CreditUnionFrontendBundle:Pricelist')->findAll();\n\n return array('entities' => $entities);\n }",
"public function index()\n {\n $orderItems = OrderItems::all();\n return new OrderItemCollection($orderItems);\n }",
"public function index()\n {\n $portfolio=Portfolio::all();\n \n return view('dashboard.portfolio.index',[\n 'portfolio'=>$portfolio\n ]);\n }",
"public function showEntities()\n {\n return Entity::paginate(10);\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $portfolio = $em->getRepository('AntBundle:Portfolio')->find($id);\n $portfolioItem = $em->getRepository('AntBundle:PortfolioItem')->findByPortfolioId($id);\n\n if (!$portfolioItem) {\n throw $this->createNotFoundException('Unable to find PortfolioItem entity.');\n }\n\n return $this->render('AntBundle:PortfolioItem:show.html.twig', array(\n 'portfolioItem' => $portfolioItem,\n 'portfolio' => $portfolio\n ));\n }",
"public function index(): Collection\n {\n return $this->repository->findAll();\n }",
"public function index()\n {\n $sales = Sales::with('itemSales.item')->get();\n\n return new SalesCollection($sales);\n }",
"public function portfolios()\n {\n return $this->hasMany(Portfolio::class);\n }",
"public function index()\r\n {\r\n $filters = request([\"sort_by\", \"description\", \"num_items\"]);\r\n $items = InventoryItem::filter($filters)\r\n ->with(\"user\")\r\n ->with(\"transactionSummary\")\r\n ->get();\r\n\r\n return array(\"items\" => $items);\r\n }",
"public function viewAll()\n {\n $items = Item::all();\n\n\n return view('pages.items')->with('items', $items);\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n\n return view('admin.portfolio.index')->withSites(Site::all());\n }",
"public function actionIndex()\n {\n $searchModel = new ItemsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new ItemsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n return DB::table('Item')->get();\n }",
"public function getItems()\n {\n return $this->hasMany(Item::className(), ['sales_gl_acc_id' => 'account_id']);\n }",
"public function index()\n {\n return view('admin.page_resources.portfolio.index');\n }",
"public function all() {\n\n\t\t$results = DB::select('SELECT * FROM item');\n\n\t\treturn view('item', ['items' => $results]);\n\t}",
"public function actionIndex()\n {\n if(!Yii::$app->user->isGuest && Yii::$app->user->identity->PrivilegeID < 3)\n {\n return $this->redirect(['/person'])->send();\n }\n $item_data = AllItem::find()\n ->leftJoin('ItemSold is', 'AllItem.ItemID = is.ItemID')\n ->where('Image IS NOT NULL AND is.AddedOn IS NULL')->andWhere(['IsActive' => 1])->orderBy('AllItem.AddedOn DESC')->limit(4)->all();\n return $this->render('index', [\n 'item_data' => $item_data\n ]);\n }",
"public function index()\n {\n if (view()->exists('admin.portfolio.portfolio')) {\n $title = 'Портфолио';\n $portfolio = Portfolio::all();\n return view('admin.portfolio.portfolio', compact(['title', 'portfolio']));\n }\n else {\n abort(404);\n }\n }",
"protected function _getItems(){\n\n\t\t// get parent\n\t\t$model = new Default_Model_ProjectImages();\n\t\t$parentModel = new Default_Model_Projects();\n\t\t$parent = $parentModel->findById($this->_session->id);\n\n\n\t\t// get the item list\n\t\t$model = new $this->_primaryModel;\n\t\t$items = $model->fetchNotTrashedByParentId($this->_session->id);\n\n\t\t// assign specific vars to the view\n\t\t$this->view->assign(array (\n\t\t\t'items' => $items,\n\t\t\t'parent' => $parent,\n//\t\t\t'title' => $items->getRow(0)->title\n\t\t\t'title' => \"TITLE\"\n\t\t));\n\t}",
"public function index()\n {\n $data['row'] = $this->items_m->get();\n $this->template->load('template', 'product/item/item_data', $data);\n }",
"public function getAllItems()\n\t{\n\n\t\t// Get the all the parent category\n\t\t$parentCategory = Category::where('parent_id','=', NULL)->get(); \n\t\n\t\t// Get all items with paginate \n\t\t$items = Item::orderBy('created_at', 'DESC')->normal()->paginate(12);\n\t\t$trigger = TRUE;\n\n\t\tforeach($items as $item)\n\t\t{\n\t\t\t// Add the newest price to the item array\n\t\t\t$priceArray = Item::find($item->id)->prices->first(); \n\t\t\t$newestPrice = $priceArray['price'];\n\t\t\tarray_add($item, 'price',$newestPrice);\n\n\t\t\t// Add the main picture to the item array;\n\t\t\t$itemPicture = Item::find($item->id)->pictures()->where('status','=','1')->first();\n\t\t\t$pictureName = $itemPicture['picture_name'];\n\t\t\tarray_add($item, \"picture_name\", $pictureName);\n\n\n\n\t\t\t// Add the parent_category_id to the item array;\n\t\t\t$category = Item::find($item->id)->category()->first(); \n\t\t\twhile($category->parent_id != NULL)\n\t\t\t{\n\t\t\t\t// Get the current category collection\n\t\t\t\t$category = Category::find($category->parent_id);\t\t\t\t\n\t\t\t}\n\n\t\t\tarray_add($item, 'parent_category_id', $category->id);\n\t\t}\n\n\n\t\t// Check the if ajax request\n\t\tif(Request::ajax()) {\n\t\t\treturn Response::json(View::make('ajax/item-ajax', compact('items', 'parentCategory', 'trigger'))->render());\n\t\t}\n\n\n\n\n\n\n\t\treturn View::make('frontend/item/view-item-list', compact('items', 'parentCategory', 'trigger'));\t\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager(\"ms_haberes_web\");\n\n $entities = $em->getRepository('LiquidacionesCuposAnualesBundle:Liquidaciones')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function getAllItems() {\n\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from(\n array('ni' => $this->_name)\n )\n ->join(\n array('nc' => 'NewsCategory'),\n 'ni.id_nc = nc.id',\n array('nc_id' => 'nc.id', 'nc_name' => 'nc.name')\n )\n ->join(\n array('ns' => 'NewsSource'),\n 'nc.id_ns = ns.id',\n array('ns_id' => 'ns.id', 'ns_name' => 'ns.name')\n )\n ->order('pubDate DESC')\n ->limit($this->_params->fetchItemsMax);\n\n $newsItems = $this->fetchAll($select);\n $returnVal = array();\n foreach ($newsItems as $newsItemRow) {\n $returnVal[] = $this->_populateItemObject($newsItemRow);\n }\n\n return $returnVal;\n }",
"public function index()\n {\n $items = Item::with(['category'])->get();\n\n return view('pages.item.index',[\n 'items' => $items\n ]);\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n $item = Item::all();\n return view('item.index', compact(\n 'item'\n ));\n }",
"public function getItems()\n {\n $items = Item::all();\n return response($items, 200);\n }",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('JobHubBundle:Pays')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"function showItems() {\n global $DB;\n\n $budgets_id = $this->fields['id'];\n\n if (!$this->can($budgets_id, READ)) {\n return false;\n }\n\n $iterator = $DB->request([\n 'SELECT' => 'itemtype',\n 'DISTINCT' => true,\n 'FROM' => 'glpi_infocoms',\n 'WHERE' => [\n 'budgets_id' => $budgets_id,\n 'NOT' => ['itemtype' => ['ConsumableItem', 'CartridgeItem', 'Software']]\n ],\n 'ORDER' => 'itemtype'\n ]);\n\n $number = count($iterator);\n\n echo \"<div class='spaced'><table class='tab_cadre_fixe'>\";\n echo \"<tr><th colspan='2'>\";\n Html::printPagerForm();\n echo \"</th><th colspan='4'>\";\n if ($number == 0) {\n echo __('No associated item');\n } else {\n echo _n('Associated item', 'Associated items', $number);\n }\n echo \"</th></tr>\";\n\n echo \"<tr><th>\".__('Type').\"</th>\";\n echo \"<th>\".__('Entity').\"</th>\";\n echo \"<th>\".__('Name').\"</th>\";\n echo \"<th>\".__('Serial number').\"</th>\";\n echo \"<th>\".__('Inventory number').\"</th>\";\n echo \"<th>\"._x('price', 'Value').\"</th>\";\n echo \"</tr>\";\n\n $num = 0;\n $itemtypes = [];\n while ($row = $iterator->next()) {\n $itemtypes[] = $row['itemtype'];\n }\n $itemtypes[] = 'Contract';\n $itemtypes[] = 'Ticket';\n $itemtypes[] = 'Problem';\n $itemtypes[] = 'Change';\n $itemtypes[] = 'Project';\n\n foreach ($itemtypes as $itemtype) {\n if (!($item = getItemForItemtype($itemtype))) {\n continue;\n }\n\n if ($item->canView()) {\n switch ($itemtype) {\n\n case 'Contract' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_contractcosts.cost AS value'\n ],\n 'FROM' => 'glpi_contractcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_contractcosts' => 'contracts_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_contractcosts.budgets_id' => $budgets_id,\n $item->getTable() . '.is_template' => 0\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Ticket' :\n case 'Problem' :\n case 'Change' :\n $costtable = getTableForItemType($item->getType().'Cost');\n\n $sum = new QueryExpression(\n \"SUM(\" . $DB->quoteName(\"$costtable.actiontime\") . \" * \" . $DB->quoteName(\"$costtable.cost_time\") . \"/\".HOUR_TIMESTAMP.\"\n + \" . $DB->quoteName(\"$costtable.cost_fixed\") . \"\n + \" . $DB->quoteName(\"$costtable.cost_material\") . \") AS \" . $DB->quoteName('value')\n );\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n $sum\n ],\n 'FROM' => $costtable,\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n $costtable => $item->getForeignKeyField()\n ]\n ]\n ],\n 'WHERE' => [\n $costtable . '.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Project' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_projectcosts.cost AS value'\n ],\n 'FROM' => 'glpi_projectcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_projectcosts' => 'projects_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_projectcosts.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Cartridge' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_cartridgeitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_cartridgeitems' => [\n 'ON' => [\n $item->getTable() => 'cartridgeitems_id',\n 'glpi_cartridgeitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n case 'Consumable' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_consumableitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_consumableitems' => [\n 'ON' => [\n $item->getTable() => 'consumableitems_id',\n 'glpi_consumableitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n default:\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_infocoms.value',\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n $item->getTable() . '.entities_id'\n ]\n ];\n if ($item->maybeTemplate()) {\n $criteria['WHERE'][$item->getTable() . '.is_template'] = 0;\n }\n\n if ($item instanceof Item_Devices) {\n $criteria['ORDERBY'][] = $item->getTable() .'.itemtype';\n } else {\n $criteria['ORDERBY'][] = $item->getTable() . '.name';\n }\n break;\n }\n\n $iterator = $DB->request($criteria);\n $nb = count($iterator);\n if ($nb > $_SESSION['glpilist_limit']) {\n echo \"<tr class='tab_bg_1'>\";\n $name = $item->getTypeName($nb);\n //TRANS: %1$s is a name, %2$s is a number\n echo \"<td class='center'>\".sprintf(__('%1$s: %2$s'), $name, $nb).\"</td>\";\n echo \"<td class='center' colspan='2'>\";\n\n $opt = ['order' => 'ASC',\n 'is_deleted' => 0,\n 'reset' => 'reset',\n 'start' => 0,\n 'sort' => 80,\n 'criteria' => [0 => ['value' => '$$$$'.$budgets_id,\n 'searchtype' => 'contains',\n 'field' => 50]]];\n\n echo \"<a href='\". $item->getSearchURL() . \"?\" .Toolbox::append_params($opt). \"'>\".\n __('Device list').\"</a></td>\";\n echo \"<td class='center'>-</td><td class='center'>-</td><td class='center'>-\".\n \"</td></tr>\";\n\n } else if ($nb) {\n for ($prem=true; $data = $iterator->next(); $prem=false) {\n $name = NOT_AVAILABLE;\n if ($item->getFromDB($data[\"id\"])) {\n if ($item instanceof Item_Devices) {\n $tmpitem = new $item::$itemtype_2();\n if ($tmpitem->getFromDB($data[$item::$items_id_2])) {\n $name = $tmpitem->getLink(['additional' => true]);\n }\n } else {\n $name = $item->getLink(['additional' => true]);\n }\n }\n echo \"<tr class='tab_bg_1'>\";\n if ($prem) {\n $typename = $item->getTypeName($nb);\n echo \"<td class='center top' rowspan='$nb'>\".\n ($nb>1 ? sprintf(__('%1$s: %2$s'), $typename, $nb) : $typename).\"</td>\";\n }\n echo \"<td class='center'>\".Dropdown::getDropdownName(\"glpi_entities\",\n $data[\"entities_id\"]);\n echo \"</td><td class='center\";\n echo (isset($data['is_deleted']) && $data['is_deleted'] ? \" tab_bg_2_2'\" : \"'\");\n echo \">\".$name.\"</td>\";\n echo \"<td class='center'>\".(isset($data[\"serial\"])? \"\".$data[\"serial\"].\"\" :\"-\");\n echo \"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"otherserial\"])? \"\".$data[\"otherserial\"].\"\" :\"-\").\"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"value\"]) ? \"\".Html::formatNumber($data[\"value\"], true).\"\"\n :\"-\");\n\n echo \"</td></tr>\";\n }\n }\n $num += $nb;\n }\n }\n\n if ($num>0) {\n echo \"<tr class='tab_bg_2'>\";\n echo \"<td class='center b'>\".sprintf(__('%1$s = %2$s'), __('Total'), $num).\"</td>\";\n echo \"<td colspan='5'> </td></tr> \";\n }\n echo \"</table></div>\";\n }",
"public function view_portfolio()\n {\n return view('dashboardpages.portfolio.portfolio');\n }",
"public function index()\n {\n //\n $result = Item::get();\n return $result;\n }",
"public function index(Request $request)\n {\n $portfolio= Portfolio::latest()->paginate(10);\n\n return view('admin.portfolio.index',compact('portfolio'))\n\n ->with('i', ($request->input('page', 1) - 1) * 10);\n\n\n }",
"public function index(){\n return MarketInfo::all();\n }",
"public function index()\n {\n\t\t$items = Item::all();\n\n\t\treturn view('item.index')->with('items', $items);\n\t}",
"public function index()\n {\n $enities = PageEntity::with('collections')->get();\n\n return $enities;\n }",
"public function get_all_items()\r\n\t{\r\n\t\t$sql = \"SELECT *\r\n\t\t\t\tFROM tbl_item i\r\n\t\t\t\tORDER by i.item_id DESC\r\n\t\t\";\r\n\t\t$result = $this->getRows($sql);\r\n\t\treturn $result;\r\n\t}",
"public function index()\n {\n $portfolio= Portfolio::orderby('created_at','desc')->paginate(5);\n\n return view('admin.pages.portfolioshow',compact('portfolio'));\n }",
"public function index()\n {\n $items = Item::orderBy('title','ASC')->paginate(10);\n return view('items.index')->with('items', $items);\n }",
"public function all()\n {\n return $this->refresh()->getItems();\n }",
"public function index()\n {\n return Cart::with('product')\n ->orderBy('created_at', 'desc')\n ->get();\n }",
"public function portfolios()\n {\n return $this->hasManyThrough(Portfolio::class, Profile::class);\n }",
"public function index()\n {\n return Company::paginate(10);\n }",
"public function index()\n {\n return $this->articalRepository->all();\n }",
"public function getAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('p.*')\n ->from('Pc', 'p');\n\n $statement = $queryBuilder->execute();\n $PcData = $statement->fetchAll();\n foreach ($PcData as $computerData) {\n $PcEntityList[$computerData['id']] = new Pc($computerData['id'], $computerData['marque']);\n }\n\n return $PcEntityList;\n }",
"public function items()\n {\n $projects = new Item();\n $projects->select(\"*\")->select_func(\"DATE_FORMAT\", array(\"@create_date\", '[,]', '%d/%m/%Y'), 'create_date')\n ->where(array('type' => 1, 'status' => 0))\n ->order_by('create_date', 'desc')\n ->get();\n\n $breadcrumb = array(\n 'Home' => site_url('admin'),\n 'Curadoria' => \"#\",\n 'Projetos' => site_url('admin/curadoria/items')\n );\n\n $this->load->helper('html');\n\n $toview['items'] = $projects;\n\n $this->template->set_breadcrumb($breadcrumb);\n $this->template->load('admin', 'admin/curadoria/items', $toview);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('CpmJovenesBundle:Tema')->findAllQuery();\n \n return $this->paginate($entities);\n \n }",
"public function getAllItems()\n {\n if($this->itemsCollection === null)\n {\n $this->_prepareData();\n }\n\n return $this->itemsCollection->getItems();\n }",
"function rv_portfolio() {\r\n\t\treturn RV_Portfolio::get_instance();\r\n\t}",
"public function getItems()\n {\n if ($this->getCustomQuote()) {\n return $this->getCustomQuote()->getAllVisibleItems();\n }\n\n return parent::getItems();\n }",
"public function index()\n {\n $items = Item::all();\n return view('admin.item.index')->with('items', $items); \n }",
"public function index()\n {\n return InventoryRelease::with('inventory')->paginate(10);\n }",
"public function index()\n {\n return OrderCollection::collection(Order::paginate(10));\n }",
"public function actionIndex()\r\n {\r\n $this->layout = \"cafeLayout\";\r\n $searchModel = new CitemSearch();\r\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\r\n $dataProvider->pagination->pageSize = 20;\r\n return $this->render('index', [\r\n 'searchModel' => $searchModel,\r\n 'dataProvider' => $dataProvider,\r\n ]);\r\n }",
"public function allItemsByUser() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $idUser = $params['idUser'];\n $item = new Item;\n $items = $item->allItemsByUser($idUser);\n View::renderJson($items);\n }",
"public function index()\n {\n $items = Item::all();\n return view('backend.item.index',compact('items'));\n }",
"public function index()\n {\n $comissoes = Comissao::paginate(10);\n return $comissoes;\n }",
"public function index()\n {\n return new PriceCollection(Price::orderBy('id', 'desc')->take(20)->get());\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('ACInst3GridBundle:Grid')->findAll();\n\n return $this->render('ACInst3GridBundle:Grid:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }"
] | [
"0.65808535",
"0.65717596",
"0.65175515",
"0.6274976",
"0.6228333",
"0.6130638",
"0.60263383",
"0.5972795",
"0.59442633",
"0.58836156",
"0.5873014",
"0.58041155",
"0.57752866",
"0.5739238",
"0.572753",
"0.5712467",
"0.5694984",
"0.5685225",
"0.5684433",
"0.56755304",
"0.56700295",
"0.5665988",
"0.56604874",
"0.56581473",
"0.565623",
"0.5651431",
"0.56502616",
"0.56175196",
"0.55727077",
"0.5561536",
"0.5550601",
"0.5523639",
"0.55201507",
"0.55184925",
"0.5511071",
"0.54904824",
"0.54746634",
"0.54715884",
"0.54640734",
"0.54640734",
"0.5460748",
"0.54516464",
"0.544464",
"0.54384136",
"0.54383683",
"0.54289436",
"0.53994906",
"0.5395803",
"0.5393172",
"0.538736",
"0.5384023",
"0.5379267",
"0.5374447",
"0.53619814",
"0.5349599",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53483593",
"0.53349274",
"0.53346163",
"0.53289604",
"0.53268975",
"0.53265",
"0.53146154",
"0.5312947",
"0.53110737",
"0.5309032",
"0.53081775",
"0.53006285",
"0.529304",
"0.5288762",
"0.52864265",
"0.5284658",
"0.52844083",
"0.5283927",
"0.52816296",
"0.5277729",
"0.52739817",
"0.5273216",
"0.5269139",
"0.52670103",
"0.5264773",
"0.5263231",
"0.5258263",
"0.52576214",
"0.52554727",
"0.52522826",
"0.5249778",
"0.5249452",
"0.52425545"
] | 0.6570992 | 2 |
Finds and displays a PortfolioItem entity. | public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$portfolio = $em->getRepository('AntBundle:Portfolio')->find($id);
$portfolioItem = $em->getRepository('AntBundle:PortfolioItem')->findByPortfolioId($id);
if (!$portfolioItem) {
throw $this->createNotFoundException('Unable to find PortfolioItem entity.');
}
return $this->render('AntBundle:PortfolioItem:show.html.twig', array(
'portfolioItem' => $portfolioItem,
'portfolio' => $portfolio
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Portfolio $portfolio)\n {\n //\n }",
"public function showAction(PortfolioItem $portfolioitem)\r\n {\r\n $user = $this->getUser();\r\n $account = $user->getAccount();\r\n if ($account != $portfolioitem->getAccount()) return $this->redirect($this->generateUrl('portfolio_portfolioitem_index'));\r\n\r\n $editForm = $this->createEditForm($portfolioitem);\r\n $deleteForm = $this->createDeleteForm($portfolioitem);\r\n\r\n return $this->render('UniPortfolioBundle:PortfolioItem:show.html.twig', array(\r\n 'portfolioitem' => $portfolioitem,\r\n 'editForm' => $editForm->createView(),\r\n 'deleteForm' => $deleteForm->createView(),\r\n ));\r\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n $portfolioSet = $em->getRepository('AntBundle:Portfolio')->findAll();\n\n $paginator = $this->get('knp_paginator');\n $pagination = $paginator->paginate(\n $portfolioSet,\n $this->get('request')->query->get('page', 1)/*page number*/,\n 10/*limit per page*/\n );\n\n foreach ($portfolioSet as $portfolio) {\n $portfolioId = $portfolio->getId();\n $this->ImageAction($portfolioId);\n };\n\n return $this->render('AntBundle:PortfolioItem:index.html.twig', array(\n 'portfolio' =>$portfolio,\n 'portfolioSet'=>$portfolioSet,\n 'pagination' => $pagination\n ));\n }",
"public function show(Item $item)\n {\n \n }",
"public function show(Item $item)\n {\n //\n }",
"public function show(Item $item)\n {\n //\n }",
"protected function findModelPortfolio($id)\n {\n if (($model = Portfolio::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function show(FacturaItem $facturaItem)\n {\n //\n }",
"public function show(Item $item)\n {\n }",
"public function show($id)\n {\n $portfolio = Portfolio::find($id);\n return view('admin.pages.portfolio.show')->with(compact('portfolio'));\n }",
"public function show($id)\n {\n //\n $portfolio= Portfolio::find($id);\n\n return view('admin.portfolio.show',compact('portfolio'));\n }",
"public function show($id)\n {\n $portfolio = Portfolio::findOrFail($id);\n\n return view('admin.portfolio.show', compact('portfolio'));\n }",
"function showItems() {\n global $DB;\n\n $budgets_id = $this->fields['id'];\n\n if (!$this->can($budgets_id, READ)) {\n return false;\n }\n\n $iterator = $DB->request([\n 'SELECT' => 'itemtype',\n 'DISTINCT' => true,\n 'FROM' => 'glpi_infocoms',\n 'WHERE' => [\n 'budgets_id' => $budgets_id,\n 'NOT' => ['itemtype' => ['ConsumableItem', 'CartridgeItem', 'Software']]\n ],\n 'ORDER' => 'itemtype'\n ]);\n\n $number = count($iterator);\n\n echo \"<div class='spaced'><table class='tab_cadre_fixe'>\";\n echo \"<tr><th colspan='2'>\";\n Html::printPagerForm();\n echo \"</th><th colspan='4'>\";\n if ($number == 0) {\n echo __('No associated item');\n } else {\n echo _n('Associated item', 'Associated items', $number);\n }\n echo \"</th></tr>\";\n\n echo \"<tr><th>\".__('Type').\"</th>\";\n echo \"<th>\".__('Entity').\"</th>\";\n echo \"<th>\".__('Name').\"</th>\";\n echo \"<th>\".__('Serial number').\"</th>\";\n echo \"<th>\".__('Inventory number').\"</th>\";\n echo \"<th>\"._x('price', 'Value').\"</th>\";\n echo \"</tr>\";\n\n $num = 0;\n $itemtypes = [];\n while ($row = $iterator->next()) {\n $itemtypes[] = $row['itemtype'];\n }\n $itemtypes[] = 'Contract';\n $itemtypes[] = 'Ticket';\n $itemtypes[] = 'Problem';\n $itemtypes[] = 'Change';\n $itemtypes[] = 'Project';\n\n foreach ($itemtypes as $itemtype) {\n if (!($item = getItemForItemtype($itemtype))) {\n continue;\n }\n\n if ($item->canView()) {\n switch ($itemtype) {\n\n case 'Contract' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_contractcosts.cost AS value'\n ],\n 'FROM' => 'glpi_contractcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_contractcosts' => 'contracts_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_contractcosts.budgets_id' => $budgets_id,\n $item->getTable() . '.is_template' => 0\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Ticket' :\n case 'Problem' :\n case 'Change' :\n $costtable = getTableForItemType($item->getType().'Cost');\n\n $sum = new QueryExpression(\n \"SUM(\" . $DB->quoteName(\"$costtable.actiontime\") . \" * \" . $DB->quoteName(\"$costtable.cost_time\") . \"/\".HOUR_TIMESTAMP.\"\n + \" . $DB->quoteName(\"$costtable.cost_fixed\") . \"\n + \" . $DB->quoteName(\"$costtable.cost_material\") . \") AS \" . $DB->quoteName('value')\n );\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n $sum\n ],\n 'FROM' => $costtable,\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n $costtable => $item->getForeignKeyField()\n ]\n ]\n ],\n 'WHERE' => [\n $costtable . '.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Project' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id',\n 'SUM' => 'glpi_projectcosts.cost AS value'\n ],\n 'FROM' => 'glpi_projectcosts',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_projectcosts' => 'projects_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_projectcosts.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'GROUPBY' => [\n $item->getTable() . '.id',\n $item->getTable() . '.entities_id'\n ],\n 'ORDERBY' => [\n $item->getTable() . '.entities_id',\n $item->getTable() . '.name'\n ]\n ];\n break;\n\n case 'Cartridge' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_cartridgeitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_cartridgeitems' => [\n 'ON' => [\n $item->getTable() => 'cartridgeitems_id',\n 'glpi_cartridgeitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n case 'Consumable' :\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_consumableitems.name',\n 'glpi_infocoms.value'\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ],\n 'glpi_consumableitems' => [\n 'ON' => [\n $item->getTable() => 'consumableitems_id',\n 'glpi_consumableitems' => 'id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n 'entities_id',\n 'glpi_cartridgeitems.name'\n ]\n ];\n break;\n\n default:\n $criteria = [\n 'SELECT' => [\n $item->getTable() . '.*',\n 'glpi_infocoms.value',\n ],\n 'FROM' => 'glpi_infocoms',\n 'INNER JOIN' => [\n $item->getTable() => [\n 'ON' => [\n $item->getTable() => 'id',\n 'glpi_infocoms' => 'items_id'\n ]\n ]\n ],\n 'WHERE' => [\n 'glpi_infocoms.itemtype' => $itemtype,\n 'glpi_infocoms.budgets_id' => $budgets_id\n ] + getEntitiesRestrictCriteria($item->getTable()),\n 'ORDERBY' => [\n $item->getTable() . '.entities_id'\n ]\n ];\n if ($item->maybeTemplate()) {\n $criteria['WHERE'][$item->getTable() . '.is_template'] = 0;\n }\n\n if ($item instanceof Item_Devices) {\n $criteria['ORDERBY'][] = $item->getTable() .'.itemtype';\n } else {\n $criteria['ORDERBY'][] = $item->getTable() . '.name';\n }\n break;\n }\n\n $iterator = $DB->request($criteria);\n $nb = count($iterator);\n if ($nb > $_SESSION['glpilist_limit']) {\n echo \"<tr class='tab_bg_1'>\";\n $name = $item->getTypeName($nb);\n //TRANS: %1$s is a name, %2$s is a number\n echo \"<td class='center'>\".sprintf(__('%1$s: %2$s'), $name, $nb).\"</td>\";\n echo \"<td class='center' colspan='2'>\";\n\n $opt = ['order' => 'ASC',\n 'is_deleted' => 0,\n 'reset' => 'reset',\n 'start' => 0,\n 'sort' => 80,\n 'criteria' => [0 => ['value' => '$$$$'.$budgets_id,\n 'searchtype' => 'contains',\n 'field' => 50]]];\n\n echo \"<a href='\". $item->getSearchURL() . \"?\" .Toolbox::append_params($opt). \"'>\".\n __('Device list').\"</a></td>\";\n echo \"<td class='center'>-</td><td class='center'>-</td><td class='center'>-\".\n \"</td></tr>\";\n\n } else if ($nb) {\n for ($prem=true; $data = $iterator->next(); $prem=false) {\n $name = NOT_AVAILABLE;\n if ($item->getFromDB($data[\"id\"])) {\n if ($item instanceof Item_Devices) {\n $tmpitem = new $item::$itemtype_2();\n if ($tmpitem->getFromDB($data[$item::$items_id_2])) {\n $name = $tmpitem->getLink(['additional' => true]);\n }\n } else {\n $name = $item->getLink(['additional' => true]);\n }\n }\n echo \"<tr class='tab_bg_1'>\";\n if ($prem) {\n $typename = $item->getTypeName($nb);\n echo \"<td class='center top' rowspan='$nb'>\".\n ($nb>1 ? sprintf(__('%1$s: %2$s'), $typename, $nb) : $typename).\"</td>\";\n }\n echo \"<td class='center'>\".Dropdown::getDropdownName(\"glpi_entities\",\n $data[\"entities_id\"]);\n echo \"</td><td class='center\";\n echo (isset($data['is_deleted']) && $data['is_deleted'] ? \" tab_bg_2_2'\" : \"'\");\n echo \">\".$name.\"</td>\";\n echo \"<td class='center'>\".(isset($data[\"serial\"])? \"\".$data[\"serial\"].\"\" :\"-\");\n echo \"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"otherserial\"])? \"\".$data[\"otherserial\"].\"\" :\"-\").\"</td>\";\n echo \"<td class='center'>\".\n (isset($data[\"value\"]) ? \"\".Html::formatNumber($data[\"value\"], true).\"\"\n :\"-\");\n\n echo \"</td></tr>\";\n }\n }\n $num += $nb;\n }\n }\n\n if ($num>0) {\n echo \"<tr class='tab_bg_2'>\";\n echo \"<td class='center b'>\".sprintf(__('%1$s = %2$s'), __('Total'), $num).\"</td>\";\n echo \"<td colspan='5'> </td></tr> \";\n }\n echo \"</table></div>\";\n }",
"public function show($id)\n {\n $portfolio = $this->portfolioRepository->find($id);\n\n if (empty($portfolio)) {\n Flash::error('Portfolio not found');\n\n return redirect(route('portfolios.index'));\n }\n\n return view('portfolios.show')->with('portfolio', $portfolio);\n }",
"public function actionPortfolio()\n {\n $searchModel = new PostSearchPortfolio();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('portfolio/index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function showPortfolio() {\n Page::$title = 'Arthub - Portfolio';\n require(APP_NON_WEB_BASE_DIR . 'views/portfolio.php');\n }",
"public function view_portfolio()\n {\n return view('dashboardpages.portfolio.portfolio');\n }",
"public function actionViewPortfolio($id)\n {\n return $this->render('portfolio/view', [\n 'model' => $this->findModelPortfolio($id),\n ]);\n }",
"public function show(Company $company, InvoiceItem $invoiceItem)\n {\n //\n }",
"public function show($id)\n {\n $filter = Filter::find($id);\n $portfolio = $filter->portfolioAll;\n if(view()->exists('admin.portfolio.portfolio.index')) {\n return view('admin.portfolio.portfolio.index', ['filter' => $filter, 'portfolio' => $portfolio]);\n }\n abort(404);\n }",
"public function getShowPortfolio($id)\n {\n $itemProgramacao = $this->itemProgramacaoRepository->findWithoutFail($id);\n\n if (empty($itemProgramacao)) {\n $itemProgramacao = $this->itemProgramacaoRepository->findByField('url_amigavel', $id)->first();\n }\n\n if (empty($itemProgramacao)) {\n Flash::error('Programação não encontrada');\n return redirect(route('itemProgramacaos.index'));\n }\n\n return view('pages.portfolio-interno')->with([\"itemProgramacao\" => $itemProgramacao]);\n }",
"public function edit(Portfolio $portfolio)\n {\n //\n }",
"public function showItem(Request $req,$item){\n $i = $this->itemRepo->getItemById($item);\n return view('marketItem.showItem', [\n 'item' => $i,\n ]);\n }",
"public function show(Portfolio $portfolio)\n {\n return view('Portfolio.show')->with('portfolio',$portfolio);\n }",
"public function editAction(Request $request, PortfolioItem $portfolioitem)\r\n {\r\n $user = $this->getUser();\r\n $account = $user->getAccount();\r\n if ($account != $portfolioitem->getAccount()) return $this->redirect($this->generateUrl('portfolio_portfolioitem_index'));\r\n\r\n $editForm = $this->createEditForm($portfolioitem);\r\n $deleteForm = $this->createDeleteForm($portfolioitem);\r\n $editForm->handleRequest($request);\r\n\r\n if ($editForm->isSubmitted()) {\r\n if($editForm->isValid()) {\r\n $em = $this->getDoctrine()->getManager();\r\n $em->persist($portfolioitem);\r\n $em->flush();\r\n $request->getSession()->getFlashBag()->add( 'success', 'portfolioitem.edit.flash' );\r\n return $this->redirect($this->generateUrl('portfolio_portfolioitem_index'));\r\n }\r\n }\r\n\r\n return $this->render('UniPortfolioBundle:PortfolioItem:edit.html.twig', array(\r\n 'portfolioitem' => $portfolioitem,\r\n 'editForm' => $editForm->createView(),\r\n 'deleteForm' => $deleteForm->createView(),\r\n ));\r\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('StriideInventoryBundle:Item')->findAll();\n\n return $this->render('StriideInventoryBundle:Item:index.html.twig', array(\n 'entities' => $entities\n ));\n }",
"static function get_portfolio_by_id($id){\n\t\treturn self::$db->where('id',$id)->get('portfolio')->row();\n\t}",
"public function showitemAction() {\n\t\t$story_id \t\t= $this->getRequest()->getParam(\"story\");\n\t\t$source_id \t\t= $this->getRequest()->getParam(\"source\");\n\t\t$item_id\t\t= $this->getRequest()->getParam(\"item\");\n\t\t\n\t\t//Verify if the requested story exist\n\t\t$stories\t\t= new Stories();\n\t\tif (!($story\t= $stories->getStory($story_id))) {\n\t\t\treturn $this->_helper->json->sendJson(false);\n\t\t}\n\n\t\t// Check if we are the owner\n\t\tif ($this->_application->user->id != $story->user_id) {\n\t\t\treturn $this->_helper->json->sendJson(false);\n\t\t}\n\t\t\n\t\t// Ok, we can show the item\n\t\t$storyItems\t\t= new StoryItems();\n\t\t$storyItems->showItem($story_id, $source_id, $item_id);\n\t\treturn $this->_helper->json->sendJson(true);\n\t}",
"public function show($id)\n {\n $item = $this->itemCRUD->find_item($id);\n\n\n $this->load->view('theme/header');\n $this->load->view('itemCRUD/show',array('item'=>$item));\n $this->load->view('theme/footer');\n }",
"public function show(Item $item)\n {\n //\n // $result = DB::table('items')->where('id', $item->id)->get();\n $result = Item::Where('id', $item->id)->first();\n return $result;\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('StriideInventoryBundle:Item')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Item entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('StriideInventoryBundle:Item:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n 'crumbs' => array(\n array('href' => $this->get('router')->generate('StriideInventoryBundle_homepage'),\n 'label' => $this->get('translator')->trans('Inventory')),\n array('href' => $this->get('router')->generate('StriideInventoryBundle_admin_item_show', array('id' => $entity->getId())),\n 'label' => $this->get('translator')->trans('Item'))\n )\n\n ));\n }",
"public function show($id)\n {\n return Item::find($id);\n }",
"public function edit($id)\n {\n $category_list = Category::pluck( 'title', 'id')->toArray();\n $portfolio = Portfolio::find($id);\n return view('admin.pages.portfolio.edit')->with(compact('portfolio', 'category_list'));\n }",
"public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('DiverPriceLisrBundle:Items')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Items entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('DiverPriceLisrBundle:Items:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }",
"public function portfolio()\n {\n return $this->belongsTo('App\\Portfolio');\n }",
"public function show()\n {\n $is_active = [1];\n $portfolio = (new PortfolioPerformanceService())->PortfolioData($is_active, []);\n\n return $portfolio;\n }",
"public function show(ItemUser $itemUser)\n {\n //\n }",
"public function show($id)\n {\n $item = $this->itemCRUD->find($id);\n\n $this->load->view('theme/header');\n $this->load->view('items/show',array('item'=>$item));\n $this->load->view('theme/footer');\n }",
"public function index()\n {\n $portfolios = Portfolio::latest()->get();\n return view('admin.portfolio.index',compact('portfolios'));\n }",
"public function index()\n {\n $profileId = isset(auth()->user()->profile) ? auth()->user()->profile->id : 0;\n $portfolios = Portfolio::where('profile_id', $profileId)->orderBy('created_at', 'desc')->paginate(8);\n return view('admin.portfolio.index', compact('portfolios'));\n }",
"public function show($orderItem)\n {\n }",
"public function edit($id)\n {\n $portfolio = Portfolio::findOrFail($id);\n\n return view('admin.portfolio.edit', compact('portfolio'));\n }",
"function portfolio_detail($portfolio_id)\n\t{\n\t\t$this->data['title'] \t\t= 'Portfolio Detail';\n\t\t$this->data['css'] \t\t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['category'] \t= $this->portfolio_model->get_all_active_category();\n\t\t$this->data['portfolio'] \t= $this->portfolio_model->get_portfolio_by_id($portfolio_id);\n\t\t$this->data['content'] \t\t= 'content/admin/portfolio/edit_portfolio';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}",
"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 show(ResultItem $resultItem)\n {\n //\n }",
"public function index()\n {\n $portfolios = Portfolio::all();\n return $portfolios;\n }",
"public function show(int $id): string\n {\n $itemManager = new ItemManager();\n $item = $itemManager->selectOneById($id);\n\n return $this->twig->render('Item/show.html.twig', ['item' => $item]);\n }",
"function rv_portfolio() {\r\n\t\treturn RV_Portfolio::get_instance();\r\n\t}",
"public function show($id)\n {\n $item = Item::findOrFail($id);\n\n\n return $item;\n }",
"protected function detail($id)\n {\n $show = new Show(CompanyPortfolio::findOrFail($id));\n\n $show->id('الرقم');\n $show->title_ar('اسم العمل عربي');\n $show->title_en('اسم العمل انجليزي');\n\n $show->company('الشركة', function ($category) {\n\n $category->setResource('/admin/companies');\n\n $category->title_ar();\n });\n\n\n $show->created_at('تاريخ الإنشاء');\n $show->updated_at('اخر تحديث');\n\n return $show;\n }",
"public function show(ProductItem $productItem)\n {\n //\n }",
"public function show(ProductItem $productItem)\n {\n //\n }",
"public function show($id)\n {\n $item = Item::find($id);\n $item->user_name = $item->user->name;\n $item->user_phone = $item->user->phone;\n $item->user_address = $item->user->address;\n $item->user_email = $item->user->email;\n $item->currentBid = $item->currentBid() ? $item->currentBid()->amount : 0;\n return $item;\n }",
"public function edit(Portfolio $portfolio)\n {\n \n return view('dashboard.portfolio.edit',[\n 'portfolio'=>$portfolio]);\n }",
"public function show(Item $item)\n {\n // dd ($item);\n // return $item;\n //dump($item->name);\n //return view('show_item',['item' => $item]);\n return view('show_item',compact('item'));\n }",
"public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $actualite = $em->getRepository('MyAppEspritBundle:Actualite')->findAll();\n\n return $this->render('MyAppEspritBundle:Actualite:show.html.twig', array(\n 'actualite' => $actualite,\n ));\n }",
"public function detail($i)\n {\n $this->data['page_title'] = $i;\n $this->data['player-activity'] = $this->invidividual($i);\n $this->data['pagebody'] = '/portfolio';\n $this->render();\n }",
"public function edit($id)\n {\n $portfolio=Portfolio::find($id);\n return view('pages.portfolios.edit', compact('portfolio'));\n }",
"public function edit($id)\n {\n //\n $portfolio= Portfolio::find($id);\n\n return view('admin.portfolio.edit',compact('portfolio'));\n }",
"public function testWhenTheEntryIsFoundThenReturnMappedPresentationItem()\n {\n $name = 'name-1';\n $domainItem = new DomainItem('name-1', 'description-1', 'value-1', true);\n\n $this->willFindItemByName($name, $domainItem);\n $response = $this->controller->getItem($name);\n\n static::assertInstanceOf(PresentationItem::class, $response);\n static::assertEquals('name-1', $response->getName());\n static::assertEquals('description-1', $response->getDescription());\n static::assertEquals('value-1', $response->getValue());\n }",
"private function item($page_name, $item_id, $item_name)\n {\n $item_id = substr($item_id, 1);\n $item = ORM::factory('showroom_cat_item')\n ->where(array(\n 'fk_site' => $this->site_id\n ))\n ->find($item_id);\n if(!$item->loaded)\n return '<div class=\"not_found\">Invalid item</div>';\n\n # get the category \n $category = ORM::factory('showroom_cat')\n ->where(array(\n 'fk_site' => $this->site_id\n ))\n ->find($item->showroom_cat_id);\n\n # get the path to this items category\n $path = ORM::factory('showroom_cat')\n ->where(array(\n 'fk_site' => $this->site_id,\n 'showroom_id' => $category->showroom_id,\n 'lft <' => $category->lft,\n 'rgt >' => $category->rgt,\n 'local_parent !='=> 0\n ))\n ->orderby(array('lft' => 'asc'))\n ->find_all();\n \n $view = new View('public_showroom/display/single_item');\n $view->item = $item;\n $view->path = $path;\n $view->category = $category;\n $view->page_name = $page_name;\n $view->img_path = $this->assets->assets_url();\n return $view;\n }",
"function druplex_field__field_portfolio_link($variables) {\n\n $output = '';\n \n $link = $variables['items'];\n\n if (!empty($link)) {\n $output .= '<a href=\"' . drupal_render($link) . '\">' . t('View project') . '</a>';\n }\n \n return $output;\n}",
"public function index()\n {\n $portfolios = Portfolio::paginate(15);\n\n return view('admin.portfolio.index', compact('portfolios'));\n }",
"public function edit($id)\n {\n $portfolio=Portfolio::findOrFail($id);\n return view('backend.portfolio.edit')->with('portfolios',$portfolio);\n }",
"public function index()\n {\n if (view()->exists('admin.portfolio.portfolio')) {\n $title = 'Портфолио';\n $portfolio = Portfolio::all();\n return view('admin.portfolio.portfolio', compact(['title', 'portfolio']));\n }\n else {\n abort(404);\n }\n }",
"public function show($tenant, $item_id)\n {\n $item = false;\n $item_model = new Item();\n $client = \\DB::connection('neo4j')->getClient();\n $strQuery = 'MATCH (n:`Item`:`' . $tenant . '` {id:\"' . $item_id . '\"}) return n';\n $query = new Query($client, $strQuery);\n $result = $query->getResultSet();\n\n foreach ($result as $row) {\n $attributes = $row['t']->getProperties();\n $item = $item_model->newFromBuilder($attributes);\n }\n\n if ($item) {\n return \\Response::json(['error' => false, 'data' => ['item' => $item], 'message' => '', 'status' => 200], 200);\n }\n else\n return \\Response::json(['error' => false, 'message' => 'Item not found', 'status' => 404], 404);\n }",
"public function index()\n {\n $portfolio=Portfolio::orderBy('id','DESC')->paginate(10);\n return view('backend.portfolio.index')->with('portfolios',$portfolio);\n }",
"public function getStockItem()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Stock Items (Linnworks API)');\n\t\t}",
"public function getItem() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $id = $params['id'];\n try {\n $item = new Item;\n $item->getItem($id);\n View::renderJson($item);\n } catch (Exception $e) {\n View::renderJson(['status' => 0, 'message' => $e]);\n }\n }",
"public function show(TipoItem $tipoItem)\n {\n //\n }",
"public function display_item() {\n\n\t\t$id = $this->input->post('id');\n\t\t$event_id = $this->input->post('event_id');\n\n\t\t$result = $this->db->query(\"SELECT id, item_name, item_qty, item_price\n\t\t\t\t\t\t\t\t\t\t FROM events_hpp\n\t\t\t\t\t\t\t\t\t\t WHERE event_id = \" . $event_id . \"\n\t\t\t\t\t\t\t\t\t\t AND master_id = \" . $id);\n\n\t\t$attr = array(\n\t\t\t\t\t\t'count_events_hpp' \t=> $result->num_rows(),\n\t\t\t\t\t\t'events_master'\t=> $this->db->query(\"SELECT id, hpp_category, hpp_subcategory\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM events_master\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE id = \" . $id)->row_array(),\n\t\t\t\t\t\t'event_id'\t\t=> $event_id\n\t\t\t\t\t);\n\n\t\t$this->load->view('analisa/display-item', $attr);\n\n\t}",
"public function show($id)\n {\n return Inventory::find($id);\n }",
"public function retrieve($item);",
"public function list()\n {\n $portfolios= Portfolio::all();\n return view('pages.portfolios.list', compact('portfolios'));\n }",
"public function show($id)\n {\n //\n $portfolio = PortfolioModel::find($id);\n\n $encoder = Encoder::instance([\n PortfolioModel::class => PortfolioSchema::class,\n ], new EncoderOptions(JSON_PRETTY_PRINT));\n\n echo $encoder->encodeData($portfolio);\n\n }",
"public function item($item_id)\n {\n //get all stuff list\n $stuffs = Admin::SelectStuffs()\n ->Select('id', DB::raw('CONCAT(first_name, \" \", last_name) AS name'))\n ->orderBy('first_name')\n ->orderBy('last_name')\n ->get()\n ->toArray();\n $stuffs = ['' => 'Assign this job to...'] + array_convert2to1($stuffs, 'id', 'name');\n \n $item = OrderItem::find($item_id);\n \n return $this->view('sales.order.item', compact('item', 'stuffs')); \n }",
"public function display_item(Request $request){\n\n $id = $request->item_id;\n $item_id = item::where('id', $id)->first();\n return response()->json($item_id);\n }",
"public function display_item(Request $request){\n\n $id = $request->item_id;\n $item_id = item::where('id', $id)->first();\n return response()->json($item_id);\n }",
"public function show(Company $company)\n {\n //\n }",
"public function show(Company $company)\n {\n //\n }",
"public function show(Company $company)\n {\n //\n }",
"public function show(Company $company)\n {\n //\n }",
"public function show(Company $company)\n {\n //\n }",
"public function show(Company $company)\n {\n //\n }",
"public function show(Company $company)\n {\n //\n }",
"public function show(Testimonial $testimonial)\n {\n //\n }",
"public function show(Testimonial $testimonial)\n {\n //\n }",
"function get_portfolio($connection, $id, $symbol)\n{\n try {\n $sql = \"SELECT symbol, amount FROM portfolio WHERE userId = ? AND symbol = ?\";\n $statement = runQuery($connection, $sql, array($id, $symbol));\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n return $result;\n }\n catch (PDOException $e) {\n die( $e->getMessage() );\n }\n}",
"public function show(Company $company, OldInvoiceItem $oldInvoiceItem)\n {\n //\n }",
"public function show(Company $company)\n {\n\n }",
"public function show()\n {\n return view('inventory::show');\n }",
"public function show1($id)\n {\n // https://laravel.com/docs/5.5/eloquent\n //dump ($id);\n //dump($item = Item::find($id));\n //if ($item == null) abort(404);\n //try{\n //$item = Item::findOrFail($id);\n //}catch(\\Exception $e){\n //abort(404);\n //}\n //$item = Item::findOrFail($id);\n //dump($item->name);\n //return $item;\n }",
"function item( $args )\n {\n \n // if post id is null just display all\n if( $args['page'] === null || !is_numeric($args['page']) ){\n \n // redirect to browse all\n $this->app->redirect( 'browse/all' );\n }\n \n // get the post id from the page number\n $postid = (int)$args['page'];\n \n \n // initialize results\n $result = null;\n \n \n /* ======================\n * Get the listings model\n */\n $listing_model = $this->app->model('listings');\n \n \n // get the result\n $result = $listing_model->limit(1)->get_item( $postid );\n \n \n // add results to the view\n $this->view->add('listing_result', $result);\n \n /* Check for listing result */\n if( count($result) < 1 ){\n \n // item is not available, update title\n $this->view->add('page_title','Item Unavailable');\n \n // add error message\n $this->view->add('err_msg',\n 'It does not appear that this item is in our garage...'\n );\n \n // add err_msg subview to include\n $this->view->add('subviews',array('err_msg'));\n \n // end \n return;\n }\n \n // update the page title\n $this->view->add('page_title',\n $result[0]['title']\n );\n \n // set the self referencing links\n $this->view->add('self_link',\n $this->app->form_path('browse/item/'.$postid)\n );\n \n \n \n // init accepted to false\n $accepted = false;\n \n /* ===========================================\n * Load offers model to get offers for listing\n */\n \n // start the selection\n $offer_model = $this->app->model('offers');\n\t\t$limit = 10;\n\t\t$offer_page = 0;\n \n // add a test if this listing has already been accepted\n if( $result[0]['status'] ==\n GarageSale\\BaseDatabase::STATUS_ACCEPTED \n ){\n \n // get offer result\n $offers_result = $offer_model->limit(1)->get_accepted( \n (int) $result[0]['id']\n );\n \n // set accepted flag to true\n $accepted = true;\n \n } else {\n \n \n // limit to 10 displayed at a time\n $limit = 10;\n \n // default offer_page to 0\n $offer_page = 0;\n \n // set up offers page\n if( isset( $_GET['offerpage'] ) && \n is_numeric($_GET['offerpage']) \n ){\n \n // set offer_page to the user provided value\n $offer_page = ((int) $_GET['offerpage'] ) - 1;\n }\n \n $offers_result = $offer_model->limit($limit)->\n page($offer_page)->\n get_item_any_offer( (int) $result[0]['id'] );\n }\n \n \n // add to page\n $this->view->add( 'offers_result', $offers_result );\n \n \n \n /* =======================================\n * SQL Query to count the number of offers\n */\n \n if( $accepted === true ){\n \n // where accepted\n $offer_count_res = $offer_model->get_count($postid,\n GarageSale\\BaseDatabase::STATUS_ACCEPTED );\n } else {\n \n // and are active\n $offer_count_res = $offer_model->get_count($postid,\n GarageSale\\BaseDatabase::STATUS_ACTIVE );\n }\n \n // get the count\n $offer_count = (int)$offer_count_res[0]['id'];\n \n // calc offset\n $offset = $limit * $offer_page;\n \n // add comment count info to view\n $this->view->add( 'offer_count',\n array(\n // total numbr of offers that have been made\n 'total' => $offer_count,\n \n // where this set of offers starts\n 'begin' => ($offer_count > 0 ) ? $offset+1 : 0,\n \n // where this set of offers end\n 'end' => $offset + count($offers_result),\n \n // how many are selected per set\n 'per' => $limit\n )\n );\n \n \n \n /* ======================\n * Use the comments model\n */\n $comment_model = $this->app->model('comments');\n \n \n // limit to 10 for now, option for more later\n $limit = 10;\n \n // default comment page number is 0\n $comment_page = 0;\n // get comment page value\n if( isset($_GET['commentpage']) && \n is_numeric( $_GET['commentpage'])\n ){\n // convert to int and is one less than displayed.\n $comment_page = ((int) $_GET['commentpage']) - 1;\n }\n \n \n // get comment results\n $comment_result = $comment_model->limit($limit)->\n page($comment_page)->get_item( $postid );\n \n \n // add comment results to page\n if( count($comment_result) > 0 ){\n \n // add comment result response\n $this->view->add( 'listing_comments', $comment_result );\n } else {\n \n // add null for comment listings\n $this->view->add( 'listing_comments', null );\n }\n \n \n \n \n /* =========================================\n * SQL Query to count the number of comments\n */\n $comment_count_res = $comment_model->get_count($postid);\n \n // get the count\n $comment_count = (int)$comment_count_res[0]['id'];\n \n // calc offset\n $offset = $limit * $comment_page;\n \n // add comment count info to view\n $this->view->add( 'comment_count',\n array(\n // total numbr of comments that have been made\n 'total' => $comment_count,\n \n // where this set of comments starts\n 'begin' => ($comment_count > 0) ? $offset+1 : 0,\n \n // where this set of comments end\n 'end' => $offset + count($comment_result),\n \n // how many are comments per set\n 'per' => $limit\n )\n );\n \n \n\t // get wysiwyg extension\n\t $wysiwyg = $this->app->extension('wysiwyg');\n\t \n\t // load comment form\n\t $comment_form = $this->view->\n\t form('comment','listings/postcomment/'.$postid);\n\t $this->view->add('comment_form',$comment_form);\n\t \n\t \n /* -----------------------\n * Some neat Amazon stuff.\n */\n \n // require needed libraries\n $this->app->library('AmazonIntegration');\n \n $this->amazon = new \\AmazonFetcher();\n \n // get response from amazon\n $response = $this->amazon->medium($result[0]['title']);\n \n // add amazon's response to our view\n $this->view->add('amazon_response',$response);\n\t\t//Get users ID\n\t\t$row = $result[0];\n\t\t$sellerid = $row['userid'];\n\t\t\n\t\t//Get rating and number of reviews for retrieved user id\n\t\t$reviews_model = $this->app->model('reviews');\n\t\t$rating = $reviews_model->get_avg_reviews($sellerid);\n\t\t$review_count_res = $reviews_model->get_count($sellerid);\n\t\t$review_count = $review_count_res[0]['id'];\n\t\t\n\t\t//Add information to view\n\t\t$this->view->add('rating_count',$review_count);\n\t\t//$this->view->add('scripts',array('star-review'));\n\t\tif($rating[0]['rating_average'] != null){\n\t\t\t$this->view->add('rating',$rating[0]['rating_average']);\n\t\t}else{\n\t\t\t$this->view->add('rating',0);\n\t\t}\n \n }",
"function show() {\n $item = DB::select('select * from item');\n return view('catalogue',['item'=>$item]);\n }",
"public function edit($id)\n {\n $brandnames = Brandname::all();\n $portfolio = Portfolio::find($id);\n return view('admin.portfolio.edit',compact('brandnames','portfolio'));\n }",
"public function index()\n {\n return view('Portfolio.index')->with('portfolios',Portfolio::all());\n }",
"public function edit($id)\n {\n $portfolio = $this->portfolioRepository->find($id);\n $technologies = Category::where('category_id', '=', 47)->whereNull('deleted_at')->get();\n $industries = Category::where('category_id', '=', 55)->whereNull('deleted_at')->get();\n\n\n\n if (empty($portfolio)) {\n Flash::error('Portfolio not found');\n\n return redirect(route('portfolios.index'));\n }\n\n return view('portfolios.edit', ['technologies'=>$technologies , 'industries'=>$industries])->with('portfolio', $portfolio);\n }",
"static function get_portfolio_by_user($id){\n\t\treturn self::$db->where('user_id',$id)->get('stock')->result();\n\t}",
"public function showAction()\n {\n $myCompany = $this->get('mycompany')->getOrCreateDefaultMyCompany();\n\n return $this->render('mycompany/show.html.twig', array('mycompany' => $myCompany,));\n }",
"public function show(Item $item)\n {\n $item = Item::with([\n 'gender:id,name',\n 'type:id,name',\n 'supplier:id,name',\n 'image',\n ])->where('id',$item->id)->get()->toArray();\n return $item;\n }"
] | [
"0.68475884",
"0.6654383",
"0.59879124",
"0.5963228",
"0.58728725",
"0.58728725",
"0.5872448",
"0.5851569",
"0.58394796",
"0.58378035",
"0.58039135",
"0.58003455",
"0.5768453",
"0.5746798",
"0.5730695",
"0.5718938",
"0.5716693",
"0.56668675",
"0.565931",
"0.5637816",
"0.56364465",
"0.56348747",
"0.5623823",
"0.55985147",
"0.5585632",
"0.5578798",
"0.55764985",
"0.55593383",
"0.5555722",
"0.5494533",
"0.54885167",
"0.5478642",
"0.5457745",
"0.54457355",
"0.54309803",
"0.54136336",
"0.5407952",
"0.5391862",
"0.5355984",
"0.5353358",
"0.53516114",
"0.5341948",
"0.5340699",
"0.53357375",
"0.53299505",
"0.53235394",
"0.5318953",
"0.5316669",
"0.5312145",
"0.5306161",
"0.53027713",
"0.53027713",
"0.5300739",
"0.52991194",
"0.5297967",
"0.528489",
"0.5275103",
"0.5269736",
"0.52620864",
"0.5258856",
"0.5257225",
"0.5252507",
"0.5251457",
"0.52489775",
"0.5247748",
"0.5243011",
"0.5235273",
"0.52342683",
"0.52282363",
"0.51899797",
"0.51734394",
"0.5172656",
"0.51663184",
"0.5165749",
"0.5152918",
"0.51456153",
"0.5128803",
"0.5128803",
"0.5126583",
"0.5126583",
"0.5126583",
"0.5126583",
"0.5126583",
"0.5126583",
"0.5126583",
"0.51190895",
"0.51190895",
"0.5115322",
"0.51083004",
"0.5094343",
"0.50938416",
"0.5087348",
"0.5087339",
"0.50827456",
"0.5081227",
"0.50802124",
"0.50789666",
"0.50787616",
"0.5076775",
"0.5076744"
] | 0.73384213 | 0 |
alias facultatif, permet de simplifier les routes | public function exampleAction() {
//return 'tatata' // erreur : retour non valide car chaîne de caractères retournée. On doit retourner un objet de type réponse
$res = new Response("tatata"); //on transite par un objet pour pouvoir retourner une châine de caractères.
$res2 = new Response("<h1>tadaaam</h1>");
$res3 = new Response($this->getMessage());
//$res4 = new Response($this->fruits); erreur : on ne peut pas renvoyer au client une structure de données PHP non convertible en string. Si un boléen est facilement convertible, ce n'est pas le cas des tableaux.
return $this->render('test/example.html.twig', array(
'fruits' => $this->fruits3
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function routes($f3) {\r\n\r\n\t}",
"function add_rewrite_endpoint($name, $places, $query_var = \\true)\n {\n }",
"public static function route();",
"function routes($http, $uri) {\n\n $dispatcher = FastRoute\\simpleDispatcher(function(FastRoute\\RouteCollector $r) {\n $r->addRoute('GET', '/question', 'questions#get_answer');\n $r->addRoute('GET', '/hello', 'questions#get_hello');\n $r->addRoute('GET', '/question/{name}/{id}/', 'questions#get_answer');\n $r->addRoute('GET', '/question/{name}/{id}', 'questions#get_answer');\n });\n\n\n// Strip query string (?foo=bar) and decode URI\n if (false !== $pos = strpos($uri, '?')) {\n $uri = substr($uri, 0, $pos);\n }\n\n $uri = rawurldecode($uri);\n $uri = str_replace(BASENAME_DIR . '/', '', $uri);\n $routeInfo = $dispatcher->dispatch($http, $uri);\n\n switch ($routeInfo[0]) {\n case FastRoute\\Dispatcher::NOT_FOUND:\n core\\basebuild::view('error/404');\n break;\n case FastRoute\\Dispatcher::METHOD_NOT_ALLOWED:\n $allowedMethods = $routeInfo[1];\n echo 'allowed not found';\n break;\n case FastRoute\\Dispatcher::FOUND:\n\n $handler = explode('#', $routeInfo[1]);\n $build = $handler[0];\n $function = $handler[1];\n $vars = $routeInfo[2];\n $interfaces = APP_INTERFACE . $build;\n $interfaces = new $interfaces();\n $interfaces->$function();\n break;\n }\n}",
"public static function alias($alias)\n { \n self::routeCompiler($alias, '/'.self::$raw_current_route, self::$current_param); \n self::$current_param['alias'] = $alias;\n self::$routes[self::$current_route] =self::$current_param; \n }",
"public function getFullRoute();",
"private function getRoutesToReplace()\n {\n return [\n 'contactus_page' => 'web_contactus',\n 'promotion_homepage' => 'deal_homepage',\n 'web_terms' => '/' . $this->container->getParameter('alias_terms_url_divisor'),\n 'web_privacy' => '/' . $this->container->getParameter('alias_privacy_url_divisor'),\n 'web_sitemap' => '/' . $this->container->getParameter('alias_sitemap_url_divisor')\n ];\n }",
"public static function routes(): void\n {\n //\n }",
"function smarty_function_route(array $params, URLBuilder $builder)\n{\n $name = $params['route'];\n unset($params['route']);\n\n return $builder->toRoute($name, $params);\n}",
"private function uri_reroute()\n {\n $match = false;\n\n $uri = parse_url($_SERVER['REQUEST_URI']);\n if (isset($uri['path']) && $uri['path'] !== \"/\") {\n $_ = preg_split(\"|/|\", $uri['path'], -1, PREG_SPLIT_NO_EMPTY);\n\n $i = 0;\n $route = null;\n $router = null;\n // while ($match === false) {\n // $path = $_[$i];\n\n // if (isset($this->configuration['ROUTES']['/' . $path])) {\n // $match = true;\n // $route = \"/$path\";\n // $router = $this->configuration['ROUTES']['/' . $path];\n // $this->route_map = $route;\n // }\n\n // if (isset($this->configuration['ROUTES'][$path])) {\n // $match = true;\n // $route = \"$path\";\n // $router = $this->configuration['ROUTES'][$path];\n // $this->route_map = $route;\n // }\n\n // ++$i;\n // }\n\n // unset($_);\n // unset($i);\n // unset($uri);\n // unset($path);\n\n if (isset($_) && is_array($_) && count($_) > 0) {\n $path = \"\";\n foreach ($_ as $k => $v) {\n $path .= \"/\" . $v;\n\n if (isset($this->configuration['ROUTES'][$path])) {\n $match = true;\n $route = \"$path\";\n $router = $this->configuration['ROUTES'][$path];\n $this->route_map = $route;\n\n // if(is_array($router['params'])){\n\n // }elseif($router['params'] == \"*\"){\n // break;\n // }\n\n break;\n }\n }\n }\n\n if (isset($router['controller'])) {\n $this->controller = $router['controller'];\n } else {\n $this->controller = \"main\";\n }\n\n if (isset($router['method'])) {\n $this->method = $router['method'];\n } else {\n $this->method = \"index\";\n }\n\n if (isset($router['action']) && isset($this->http)) {\n if (trim(strtolower($router['action'])) != strtolower($this->http->action)) {\n $this->http->http_error(403);\n }\n }\n \n if (isset($router['type']) && isset($router['type'])){\n if (trim(strtolower($router['type'])) == \"json\" && $this->http->type != \"json\"){\n $this->http->http_error(406, \"Form \" . $this->http->action . \" data is not json\");\n }\n }\n\n if (isset($router['params'])) {\n if (is_array($router['params'])) {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (is_array($router['params'])) {\n $_ = $router['params'];\n unset($router['params']);\n\n $router['params'][] = $_;\n unset($_);\n }\n\n $nums_params = count($router['params'][0]);\n\n if ($nums_params > 0) {\n foreach ($router['params'][0] as $k => $v) {\n $this->params[$v] = trim(urldecode($uri[$k]));\n }\n }\n\n $i = 0;\n $x = 0;\n while ($nums_params < $i) {\n if (isset($uri[$x]) && is_value($uri[$x])) {\n $this->params[$router['params'][$i]] = trim(urldecode($uri[$x]));\n ++$i;\n }\n ++$x;\n }\n\n } elseif ($router['params'] != \"*\") {\n return $this->http->http_error(404);\n }\n } else {\n $uri = preg_split(\"|/|\", str_replace($route, \"\", $_SERVER['REQUEST_URI']), -1, PREG_SPLIT_NO_EMPTY);\n\n if (count($uri) > 0) {\n return $this->http->http_error(404);\n }\n }\n\n unset($uri);\n unset($i);\n unset($x);\n unset($route);\n unset($router);\n }\n\n return $match;\n }",
"#[Route('/very/cool/route/{foo}/{bar}', name: 'very_cool_route',\n defaults: ['foo' => 'foo', 'bar' => 'bar'])]\n public function eatIt()\n {\n }",
"abstract public function getRoute();",
"abstract public function routeName();",
"abstract protected function getListRoute() : string;",
"private function getRoute(){\n\t}",
"public static function getRouteAlias() {\n return implode('/', self::getRouteFragments());\n }",
"function beforeroute(){\n }",
"function beforeroute(){\n }",
"public function routeOptions();",
"function alias();",
"public function map()\n {\n //panel\n $this->mapPanelRoutes();\n //auth\n $this->mapAuthRoutes();\n //almacen\n $this->mapInventoryRoutes();\n //contabilidad\n $this->mapAccountingRoutes();\n //Recursos Humanos\n $this->mapHumanResourceRoutes();\n //ventas\n $this->mapSaleRoutes();\n\n $this->mapApiRoutes();\n\n //\n }",
"function route_class()\n{\n return str_replace('.', '-', Route::currentRouteName());\n}",
"public function getBaseRoutePattern(): string;",
"public function getRoute($name){ }",
"public function getSystemRoutes();",
"function rest_api_register_rewrites()\n {\n }",
"protected function register_rewrite_endpoints() {\n\t\tif ( ! empty( $this->endpoints ) ) {\n\t\t\tforeach ( $this->endpoints as $slug => $arr ) {\n\t\t\t\tadd_rewrite_endpoint( $slug, $arr['type'] );\n\t\t\t}\n\t\t}\n\t}",
"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 }",
"function rest_api_register_rewrites() {\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );\n}",
"function add_custom_admin_routes($app) {\n\n}",
"public function setAlias()\n\t{\n\t\tif(empty($this->alias)){\n $this->alias = Amputate::rus2route(Amputate::getLimb($this->title, 20, ''));\n }\t\n\t}",
"public function getRoute();",
"function smarty_modifier_alias($string, $params = null, $query = null, $fragment = null): string {\n if (!is_null($fragment) && substr($fragment, 0, 1) !== '#') {\n $fragment = '#'.$fragment;\n }\n\n $f3 = \\Base::instance();\n\n return GK_SITE_BASE_SERVER_URL.$f3->alias($string, $params ?? [], $query).$fragment;\n}",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function register_routes()\n {\n }",
"public function useRoute(){\n\t\t\t$routeParts = explode(\"@\", $this->matchingRoute->location);\n\t\t\treturn [\"controller\" => ucfirst($routeParts[0]), \"method\" => $routeParts[1]];\n\t\t}",
"public abstract function addRoute($nombrePuntoInicial_,$descripcionPuntoInicial_,$nombrePuntoFinal_,\n $descripcionPuntoFinal_,$coordenadas_,$estiloCoordenada_,$coordenadaInicial_,$coordenadaFinal_);",
"public static function modelRoute( $alias ){\n \n $route_ = 'Route::get(\"' . $alias . '/{extra?}\", \"OrlandoLibardi\\PageCms\\app\\Http\\Controllers\\PageShowController@show\")' . \"\\n\";\n $route_ .= '->where(\"extra\", \"([A-Za-z0-9\\-\\/]+)\")' . \"\\n\";\n $route_ .= '->middleware(\"web\");' . \"\\n\";\n return $route_;\n }",
"public function add_endpoint() {\r\n add_rewrite_rule('^api/films/?(\\w+)?/?','index.php?__api=1&films=$matches[1]','top');\r\n }",
"function endpoints() {\r\n\t\tadd_rewrite_endpoint( 'backers', EP_PERMALINK | EP_PAGES );\r\n\t}",
"function simple_example() {\n \\Drupal::service('path_alias.manager');\n}",
"public function route() {\n\t\t$route = $this->sets[':default']->route();\n\t\tif (!$route&&sizeof($this->route_extra)==0) return false;\n\t\tif (!$route) $route = new CMS_Navigation3_LinkSet();\n\t\t$n = $route->count();\n\t\tforeach($this->route_extra as $r) {\n\t\t\t$item = $r[1];\n\t\t\t$item['id'] = $n;\n\t\t\t$n++;\n\t\t\t$route->add($r[0],$item);\n\t\t}\t\n\t\treturn $route;\n\t}",
"private function mapAdminRoutes()\n {\n $this->name('backups.')\n ->prefix($this->config()->get('arcanesoft.backups.route.prefix', 'backups'))\n ->group(function () {\n Routes\\StatusesRoutes::register();\n });\n }",
"function defineRoutes(&$router) {\n /*\n * example routers\n * \n * \n */\n //$router->map('modulename', 'modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('dashboard_modulename', 'dashboard/modulename', array('controller' => 'modulename', 'action' => 'index'));\n //$router->map('modulename_view_project', 'modulename/:project_id/view', array('controller' => 'modulename', 'action' => 'view'), array('project_id' => '\\d+'));\n }",
"public function path(): RoutePathInterface;",
"public function testUrlGenerationWithRegexQualifiedParams(): void\n {\n $routes = Router::createRouteBuilder('/');\n\n $routes->connect(\n '{language}/galleries',\n ['controller' => 'Galleries', 'action' => 'index'],\n ['language' => '[a-z]{3}']\n );\n\n $routes->connect(\n '/{language}/{admin}/{controller}/{action}/*',\n ['admin' => 'admin'],\n ['language' => '[a-z]{3}', 'admin' => 'admin']\n );\n\n $routes->connect(\n '/{language}/{controller}/{action}/*',\n [],\n ['language' => '[a-z]{3}']\n );\n\n $result = Router::url(['admin' => false, 'language' => 'dan', 'action' => 'index', 'controller' => 'Galleries']);\n $expected = '/dan/galleries';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['admin' => false, 'language' => 'eng', 'action' => 'index', 'controller' => 'Galleries']);\n $expected = '/eng/galleries';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/{language}/pages',\n ['controller' => 'Pages', 'action' => 'index'],\n ['language' => '[a-z]{3}']\n );\n $routes->connect('/{language}/{controller}/{action}/*', [], ['language' => '[a-z]{3}']);\n\n $result = Router::url(['language' => 'eng', 'action' => 'index', 'controller' => 'Pages']);\n $expected = '/eng/pages';\n $this->assertSame($expected, $result);\n\n $result = Router::url(['language' => 'eng', 'controller' => 'Pages']);\n $this->assertSame($expected, $result);\n\n $result = Router::url(['language' => 'eng', 'controller' => 'Pages', 'action' => 'add']);\n $expected = '/eng/Pages/add';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/forestillinger/{month}/{year}/*',\n ['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar'],\n ['month' => '0[1-9]|1[012]', 'year' => '[12][0-9]{3}']\n );\n\n $result = Router::url([\n 'plugin' => 'Shows',\n 'controller' => 'Shows',\n 'action' => 'calendar',\n 'month' => '10',\n 'year' => '2007',\n 'min-forestilling',\n ]);\n $expected = '/forestillinger/10/2007/min-forestilling';\n $this->assertSame($expected, $result);\n\n Router::reload();\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/kalender/{month}/{year}/*',\n ['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar'],\n ['month' => '0[1-9]|1[012]', 'year' => '[12][0-9]{3}']\n );\n $routes->connect('/kalender/*', ['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar']);\n\n $result = Router::url(['plugin' => 'Shows', 'controller' => 'Shows', 'action' => 'calendar', 'min-forestilling']);\n $expected = '/kalender/min-forestilling';\n $this->assertSame($expected, $result);\n\n $result = Router::url([\n 'plugin' => 'Shows',\n 'controller' => 'Shows',\n 'action' => 'calendar',\n 'year' => '2007',\n 'month' => '10',\n 'min-forestilling',\n ]);\n $expected = '/kalender/10/2007/min-forestilling';\n $this->assertSame($expected, $result);\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 router_use_rewriting()\n{\n return framework_config('pretty_urls', false, true);\n}",
"public static function returnRoutes($prefix = null) {\n\n Route::group(array('prefix' => 'admin/' . self::$name), function() {\n\n Route::any('faces', array('as' => 'eve.faces', 'uses' => __CLASS__.'@getEveFaces'));\n Route::any('faces/change_status', array('as' => 'eve.change_status', 'uses' => __CLASS__.'@changeStatus'));\n Route::any('faces/full_delete', array('as' => 'eve.full_delete', 'uses' => __CLASS__.'@fullDelete'));\n });\n\n Route::any(self::$name . '/load_photo', array('as' => 'eve.load_photo', 'uses' => __CLASS__.'@postLoadPhoto'));\n }",
"function beforeroute() {\r\n \r\n }",
"public function objectRouteClass();",
"public function testUrlWritingWithPrefixesAndCustomRoutes(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/admin/login',\n ['controller' => 'Users', 'action' => 'login', 'prefix' => 'Admin']\n );\n $request = new ServerRequest([\n 'url' => '/',\n 'params' => [\n 'plugin' => null,\n 'controller' => 'Posts',\n 'action' => 'index',\n 'prefix' => 'Admin',\n ],\n 'webroot' => '/',\n ]);\n Router::setRequest($request);\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n\n $result = Router::url(['controller' => 'Users', 'action' => 'login']);\n $this->assertSame('/admin/login', $result);\n }",
"public function testLegacyRoutes()\n\t{\n\t\t/*//Filters disabled during unit tests unless you enable them\n\t\t//I need them enabled because they log the user in as anonymous\n\t\tRoute::enableFilters();\n\n\t\t// Test /topic/1 redirects to /home\n\t\t$this->call('GET', '/topic/1');\n\t\t$this->assertRedirectedTo('/home');\n\t\t$this->call('GET', '/topic/1/doesnt/matter');\n\t\t$this->assertRedirectedTo('/home');\n\n\t\t// ?? files/1 does not currently redirect\n\t\t// not sure if it should or not yet\n\t\t*/\n\n\t}",
"public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }",
"abstract public function getRoutePrefix();",
"public function getRoutesDefinition()\n {\n $lang = Environment::getConfig('lang');\n\n $routeList = new RouteList();\n $routeList[] = $frontRouter = new RouteList('Front');\n $frontRouter[] = new Route(\"[<locale={$lang} sk|hu|cs>/]<presenter>/<action>[/<id>]\", array(\n 'presenter' => array(\n Route::VALUE => 'Homepage',\n Route::FILTER_TABLE => array(\n 'testovaci' => 'Test',\n// 'presmerovano' => 'TestRedirect',\n ),\n ),\n 'action' => array(\n Route::VALUE => 'default',\n Route::FILTER_TABLE => array(\n 'operace-ok' => 'operationSuccess',\n ),\n ),\n 'id' => null,\n 'locale' => [\n Route::FILTER_TABLE => [\n 'cz' => 'cs',\n 'sk' => 'sk',\n 'pl' => 'pl',\n 'com' => 'en'\n ]]\n ));\n return $routeList;\n\n }",
"public function getRoute()\n {\n }",
"function generer_urls_canoniques(){\n\tinclude_spip('balise/url_');\n\n\tif (count($GLOBALS['contexte'])==0){\n\t\t$objet = 'sommaire';\n\t} elseif (isset($GLOBALS['contexte']['id_article'])) {\n\t\t$id_objet = $GLOBALS['contexte']['id_article'];\n\t\t$objet = 'article';\n\t} elseif (isset($GLOBALS['contexte']['id_rubrique'])) {\n\t\t$id_objet = $GLOBALS['contexte']['id_rubrique'];\n\t\t$objet = 'rubrique';\n\t}\n\n\tswitch ($objet) {\n\t\tcase 'sommaire':\n\t\t\t$flux .= '<link rel=\"canonical\" href=\"' . url_de_base() . '\" />';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$flux .= '<link rel=\"canonical\" href=\"' . url_de_base() . generer_url_entite($id_objet, $objet) . '\" />';\n\t\t\tbreak;\n\t}\n\n\treturn $flux;\n}",
"public function registerMiddlewaresAliases()\n {\n $router = $this->app->make(Router::class);\n $router->aliasMiddleware(config('language-switcher.alias'), SwitchLocale::class);\n }",
"public function getRoute(): Route;",
"public function rewriteEndpoint (){\n add_rewrite_endpoint( 'agreementArchiveId', EP_ALL );\n add_rewrite_endpoint( 'searchAgreementArchive', EP_ALL );\n\n flush_rewrite_rules();\n }",
"public function addRoutes(): void\n {\n $router = $this->config['router'] ?? Router::class;\n $router::$DELIMITER = $this->delimiter;\n foreach (static::$routes as [$url, $func, $method]) {\n $router::add($url, [$this, $func], $method);\n }\n }",
"public static function prefix_add_api_endpoints()\n {\n add_rewrite_tag('%rewrite_class%', '([^&/]+)'); //([0-9]+)\n add_rewrite_tag('%rewrite_method%', '([^&/]+)'); //([0-9]+)\n add_rewrite_rule(self::getRewriteAPIPrefix() . '/?([^/]*)/([^/]*)/?', 'index.php?rewrite_class=$matches[1]&rewrite_method=$matches[2]', 'top');\n }",
"function custom_rewrite_rule() {\n\n}",
"public function showRoute()\n {\n }",
"public function aliases();",
"public function getRoutes() {}",
"function defineRoutes(&$router) {\n \n // Main\n $router->map('mobile_access', 'm', array('controller' => 'mobile_access', 'action' => 'index'));\n \n $router->map('mobile_access_login', 'm/login', array('controller' => 'mobile_access_auth', 'action' => 'login'));\n $router->map('mobile_access_logout', 'm/logout', array('controller' => 'mobile_access_auth', 'action' => 'logout'));\n $router->map('mobile_access_forgot_password', 'm/forgot-password', array('controller' => 'mobile_access_auth', 'action' => 'forgot_password'));\n \n // Quick Add\n $router->map('mobile_access_quick_add', 'm/starred', array('controller' => 'mobile_access', 'action' => 'quick_add'));\n \n // Assignments\n $router->map('mobile_access_assignments', 'm/assignments', array('controller' => 'mobile_access', 'action' => 'assignments'));\n \n // Starred\n $router->map('mobile_access_starred', 'm/starred', array('controller' => 'mobile_access', 'action' => 'starred'));\n \n // People\n $router->map('mobile_access_people', 'm/people', array('controller' => 'mobile_access_people', 'action' => 'index'));\n $router->map('mobile_access_view_company', 'm/people/:object_id', array('controller' => 'mobile_access_people', 'action' => 'company'), array('object_id' => '\\d+'));\n $router->map('mobile_access_view_user', 'm/people/users/:object_id', array('controller' => 'mobile_access_people', 'action' => 'user'), array('object_id' => '\\d+'));\n \n \n // Projects\n $router->map('mobile_access_projects', 'm/projects', array('controller' => 'mobile_access_projects', 'action' => 'index'));\n \n // Project\n $router->map('mobile_access_view_project', 'm/project/:project_id', array('controller' => 'mobile_access_project', 'action' => 'index'), array('project_id' => '\\d+'));\n \n // Project discusions\n $router->map('mobile_access_view_discussions', 'm/project/:project_id/discussions', array('controller' => 'mobile_access_project_discussions', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_discussion', 'm/project/:project_id/discussions/:object_id', array('controller' => 'mobile_access_project_discussions', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project milestones\n $router->map('mobile_access_view_milestones', 'm/project/:project_id/milestones', array('controller' => 'mobile_access_project_milestones', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_milestone', 'm/project/:project_id/milestones/:object_id', array('controller' => 'mobile_access_project_milestones', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project files\n $router->map('mobile_access_view_files', 'm/project/:project_id/files', array('controller' => 'mobile_access_project_files', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_file', 'm/project/:project_id/files/:object_id', array('controller' => 'mobile_access_project_files', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project checklists\n $router->map('mobile_access_view_checklists', 'm/project/:project_id/checklists', array('controller' => 'mobile_access_project_checklists', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_checklist', 'm/project/:project_id/checklists/:object_id', array('controller' => 'mobile_access_project_checklists', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+')); \n \n // Project pages\n $router->map('mobile_access_view_pages', 'm/project/:project_id/pages', array('controller' => 'mobile_access_project_pages', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_page', 'm/project/:project_id/pages/:object_id', array('controller' => 'mobile_access_project_pages', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_page_version', 'm/project/:project_id/pages/:object_id/version/:version', array('controller' => 'mobile_access_project_pages', 'action' => 'version'), array('project_id' => '\\d+', 'object_id' => '\\d+', 'version' => '\\d+'));\n \n // Project tickets\n $router->map('mobile_access_view_tickets', 'm/project/:project_id/tickets', array('controller' => 'mobile_access_project_tickets', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_ticket', 'm/project/:project_id/tickets/:object_id', array('controller' => 'mobile_access_project_tickets', 'action' => 'view'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project timerecords\n $router->map('mobile_access_view_timerecords', 'm/project/:project_id/timerecords', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+'));\n $router->map('mobile_access_view_timerecord', 'm/project/:project_id/timerecords/:object_id', array('controller' => 'mobile_access_project_timetracking', 'action' => 'index'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n \n // Project subobjects\n $router->map('mobile_access_view_task', 'm/project/:project_id/task/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_view_comment', 'm/project/:project_id/comment/:object_id', array('controller' => 'mobile_access', 'action' => 'view_parent_object'), array('project_id' => '\\d+', 'object_id' => '\\d+'));\n $router->map('mobile_access_add_comment', 'm/project/:project_id/comment/add', array('controller' => 'mobile_access_project', 'action' => 'add_comment'));\n \n // Common\n $router->map('mobile_access_view_category', 'm/category/:object_id', array('controller' => 'mobile_access', 'action' => 'view_category', array('object_id' => '\\d+')));\n $router->map('mobile_access_toggle_object_completed_status', 'm/project/:project_id/toggle-completed/:object_id', array('controller' => 'mobile_access', 'action' => 'toggle_completed', array('project_id' => '\\d+', 'object_id' => '\\d+')));\n }",
"public function action_init_register_rewrites() {\n add_rewrite_endpoint( 'ics', EP_PERMALINK );\n }",
"public function withMethods(array $methods): Route;"
] | [
"0.643455",
"0.611371",
"0.6043431",
"0.582662",
"0.5820986",
"0.57740426",
"0.5753034",
"0.5716297",
"0.5695494",
"0.56459486",
"0.5631914",
"0.5616868",
"0.55746424",
"0.5566087",
"0.5542519",
"0.5535703",
"0.5524962",
"0.5524962",
"0.55141145",
"0.550894",
"0.55055034",
"0.54856575",
"0.5480541",
"0.54805183",
"0.54697394",
"0.5444413",
"0.54390204",
"0.5437703",
"0.54374146",
"0.5405243",
"0.54039454",
"0.53999835",
"0.5371735",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.535676",
"0.53556794",
"0.53479725",
"0.53400433",
"0.53284246",
"0.53002",
"0.52935266",
"0.52886605",
"0.5286842",
"0.52856785",
"0.5280656",
"0.52777624",
"0.52753276",
"0.5265393",
"0.52635014",
"0.5260916",
"0.5255302",
"0.52310663",
"0.5228609",
"0.5205934",
"0.5202665",
"0.5201407",
"0.51968586",
"0.51925695",
"0.5182215",
"0.5180652",
"0.5178154",
"0.5174734",
"0.51727533",
"0.51715595",
"0.5157021",
"0.5150705",
"0.5146621",
"0.5145996",
"0.5141764",
"0.5135755",
"0.51316667"
] | 0.0 | -1 |
WC Vendors Mark as Shipped | public function __construct() {
add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );
// WC Product Vendors Mark as Fulfilled
add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );
// WC Marketplace Mark as Shipped
add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );
// WCfM Marketplace Mark as Shipped
add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );
// Dokan Mark as Shipped
add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );
// WCFM Mark as Received
add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );
if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {
if( !wcfm_is_vendor() ) {
add_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );
} else {
add_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );
add_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );
add_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );
add_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );
add_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );
}
}
// Vendor Order Shippment Tracking
add_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );
add_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );
// Shipment Tracking message type
add_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}",
"function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function testUpdateExternalShipment()\n {\n }",
"function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }",
"function setShipping($ship_key)\n {\n return 4.50;\n }",
"function custom_template_single_shipping()\n {\n global $product;\n ?>\n <span class=\"shipping-cs-tag\">\n <span>Shipping:</span>\n <span>Free</span>\n </span>\n <?php\n }",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"public function isAutoShipping(): bool;",
"public function shipping_tab() {\n global $wpdb, $post;\n\n $vendor_id = $post->post_author;\n\n $shipping_zone = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT locations.zone_id, locations.seller_id, locations.location_type as vendor_location_type, locations.location_code as vendor_location_code, wc_zones.location_code, wc_zones.location_type FROM {$wpdb->prefix}dokan_shipping_zone_locations as locations INNER JOIN {$wpdb->prefix}woocommerce_shipping_zone_locations as wc_zones ON locations.zone_id = wc_zones.zone_id INNER JOIN {$wpdb->prefix}dokan_shipping_zone_methods as dokan_methods ON dokan_methods.zone_id = locations.zone_id AND dokan_methods.seller_id = locations.seller_id WHERE locations.seller_id =%d AND locations.location_type != 'postcode' ORDER BY wc_zones.zone_id ASC\", $vendor_id\n ), ARRAY_A\n );\n\n $_overwrite_shipping = get_post_meta( $post->ID, '_overwrite_shipping', true );\n $dps_processing = get_user_meta( $vendor_id, '_dps_pt', true );\n $from = get_user_meta( $vendor_id, '_dps_form_location', true );\n $dps_country_rates = get_user_meta( $vendor_id, '_dps_country_rates', true );\n $shipping_policy = get_user_meta( $vendor_id, '_dps_ship_policy', true );\n $refund_policy = get_user_meta( $vendor_id, '_dps_refund_policy', true );\n $product_processing_time = get_post_meta( $post->ID, '_dps_processing_time', true );\n $processing_time = $dps_processing;\n\n if ( 'yes' === $_overwrite_shipping ) {\n $processing_time = ( $product_processing_time ) ? $product_processing_time : $dps_processing;\n }\n\n $country_obj = new WC_Countries();\n $countries = $country_obj->countries;\n $states = $country_obj->states;\n\n $shipping_countries = '';\n $shipping_states = '';\n $location_code = '';\n $check_countries = array();\n $check_states = array();\n\n if ( $shipping_zone ) {\n foreach ( $shipping_zone as $zone ) {\n $location_code = $zone['vendor_location_code'];\n\n if ( $zone['vendor_location_type'] === 'state' ) {\n $location_codes = explode( ':', $location_code );\n $country_code = isset( $location_codes[0] ) ? $location_codes[0] : '';\n $state_code = isset( $location_codes[1] ) ? $location_codes[1] : '';\n\n if ( isset( $states[ $country_code ][ $state_code ] ) && isset( $countries[ $country_code ] ) && ! in_array( $states[ $country_code ][ $state_code ], $check_states, true ) ) {\n $get_state_name = $states[ $country_code ][ $state_code ];\n\n $check_states[ $get_state_name ] = $get_state_name;\n $shipping_states .= $get_state_name . ' (' . $countries[ $country_code ] . '), ';\n }\n }\n\n if ( $zone['vendor_location_type'] === 'country' && $countries[ $location_code ] && ! in_array( $countries[ $location_code ], $check_countries, true ) ) {\n $location_code = $countries[ $location_code ];\n $check_countries[ $location_code ] = $location_code;\n $shipping_countries .= $location_code . ', ';\n }\n }\n }\n ?>\n\n <?php if ( $shipping_countries ) { ?>\n <p>\n <?php esc_html_e( 'Shipping Countries', 'dokan' ); ?>:\n <strong><?php echo rtrim( $shipping_countries, ', ' ); ?></strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $shipping_states ) { ?>\n <p>\n <?php esc_html_e( 'Shipping States', 'dokan' ); ?>:\n <strong><?php echo rtrim( $shipping_states, ', ' ); ?></strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $processing_time ) { ?>\n <p>\n <strong>\n <?php esc_html_e( 'Ready to ship in', 'dokan' ); ?> <?php echo dokan_get_processing_time_value( $processing_time ); ?>\n\n <?php\n if ( $from ) {\n echo __( 'from', 'dokan' ) . ' ' . $countries[ $from ];\n }\n ?>\n </strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $shipping_policy ) { ?>\n <p> </p>\n <strong><?php esc_html_e( 'Shipping Policy', 'dokan' ); ?></strong>\n <hr>\n <?php echo wpautop( $shipping_policy ); ?>\n <?php } ?>\n\n <?php if ( $refund_policy ) { ?>\n <hr>\n <p> </p>\n <strong><?php esc_html_e( 'Refund Policy', 'dokan' ); ?></strong>\n <hr>\n <?php echo wpautop( $refund_policy ); ?>\n <?php } ?>\n <?php\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"function get_item_shipping() {\n\t}",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"public function testUpdateExternalShipmentCustomFields()\n {\n }",
"public function calculateQtyToShip();",
"public function store(Request $request){\n $verEnvio = \\DB::table('orders')->where('order_id', $request->id_recipies)->first();\n if($verEnvio->status == 1){\n $shipping = new Shipping();\n $shipping->id_user = $request->delivery;\n $shipping->id_recipie = $request->id_recipies;\n $shipping->recipient_name = \"\";\n $shipping->save();\n \\DB::Table('orders')->where('order_id', $request->id_recipies)->update([\n \"status\"=> 2\n ]);\n }\n return ['result' => 'success'];\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"function hide_shipping_when_free_is_available( $rates, $package ) {\n \t\n \tglobal $woocommerce;\n\t\n\t//Stop promotion after 1st June\n\t//if( '20160601' > date(\"Ymd\") ) {\n\t\n\t$products = $woocommerce->cart->get_cart(); //Returns the contents of the cart in an array with the 'data' element.\n\t$count_pub41 = 0;\n\t$only_pub41 = true;\n\t\n\tforeach( $products as $product ) {\n\t\t//All extended meta data is stored in a 'data' array, stores the WC_Product_Simple Object which contains\n\t\t//information about the product\n\t\t\n\t\t$_product = $product['data'];\n\t\t$SKU = $_product->get_sku();\n\n\t\tif ($SKU == 'PUB41') {\n\t\t\t$count_pub41 = $product['quantity'];\n\t\t}\n\t\telse if (!$_product->is_virtual()) {\n\t\t\t$only_pub41 = false;\n\t\t}\n\t}\n \n\tif ( $count_pub41 >= 1 AND $only_pub41 ) {\n\t\t//$rates['free_shipping'] = new WC_Shipping_Rate('free_shipping', 'Free Shipping', 0, array(), '');\n\t\tunset( $rates['flat_rate'] );\n\t\tunset( $rates['eca_shipping_express'] );\n\t\t//unset( $rates['eca_shipping']);\n\t\t$rates['eca_shipping']->cost = 0;\n\t}\n\t//}\n\t\n\treturn $rates;\n}",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function actionNovaPostaShipping()\n {\n echo 35.46;\n }",
"public function getShippingInvoiced();",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }",
"public function estimated_shipping() {\n\n\t\t$this->api_record_event( $this->event_name['estimated_shipping'] );\n\t}",
"function GetVendorShippingContact($SuppID,$ShipId='')\r\n\t{\r\n\t\t$AddType='shipping';\t\t\r\n\t\t \r\n\t\t$strAddQuery .= \" and ( ab.Status='1' or ab.Status='0')\";\r\n\t\t$strAddQuery .= (!empty($ShipId))?(\" and ab.AddID='\".$ShipId.\"'\"):(\"\");\t \r\n\r\n\t\t$strSQLQuery = \"SELECT s.CompanyName, ab.* FROM p_address_book ab inner join p_supplier s on ab.SuppID=s.SuppID WHERE ab.SuppID='\".$SuppID.\"' AND ab.AddType = '\".$AddType.\"' \".$strAddQuery.\" order by Status Desc\";\r\n\t\treturn $this->query($strSQLQuery, 1);\r\n\t}",
"public function ship($parcel)\n {\n return TRUE;\n }",
"function getShipping()\n {\n return array('name'=>'test','cost'=>4.5);\n }",
"public function adminSalesOrderCreateProcessDataBefore($observer)\n {\n if(Mage::getStoreConfig('carriers/shipper/active')) {\n $post = $observer->getRequestModel()->getPost();\n if(isset($post['order'])) {\n $data = $post['order'];\n\n $found = false;\n $customCarrierGroupData = array();\n $carriergroupId = isset($data['carriergroup_id']) ? $data['carriergroup_id'] : '';\n if (isset($data['shipping_amount'])) {\n $customCarrierGroupData[$carriergroupId] = array('customPrice' => $data['shipping_amount'], 'carriergroup' => $carriergroupId);\n $found = true;\n }\n\n if (isset($data['shipping_description'])) {\n if(array_key_exists($carriergroupId, $customCarrierGroupData)) {\n $shipArray = $customCarrierGroupData[$carriergroupId];\n $shipArray['customCarrier'] = $data['shipping_description'];\n $customCarrierGroupData[$carriergroupId] = $shipArray;\n }\n else {\n $customCarrierGroupData[$carriergroupId] = array('customCarrier' => $data['shipping_description'], 'carriergroup' => $carriergroupId);\n }\n $found = true;\n }\n\n if ($found) {\n $shippingAddress = $observer->getSession()->getQuote()->getShippingAddress();\n Mage::helper('shipperhq_shipper')->cleanDownRatesCollection($shippingAddress, 'shipperadmin', '');\n Mage::register('shqadminship_data', new Varien_Object($customCarrierGroupData));\n $storedLimitCarrier = $shippingAddress->getLimitCarrier();\n $shippingAddress->setLimitCarrier('shipperadmin');\n $rateFound = $shippingAddress->requestShippingRates();\n $shippingAddress->setLimitCarrier($storedLimitCarrier);\n } else {\n Mage::unregister('shqadminship_data');\n }\n }\n }\n }",
"function wcfm_order_tracking_response( $item_id, $item, $order ) {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\t\t\r\n\t\t// See if product needs shipping \r\n\t\t$product = $item->get_product(); \r\n\t\t$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product ); \r\n\t\t\r\n\t\tif( $WCFMu->is_marketplace ) {\r\n\t\t\tif( $WCFMu->is_marketplace == 'wcvendors' ) {\r\n\t\t\t\tif( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {\r\n\t\t\t\t\tif( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;\r\n\t\t\t\t}\r\n\t\t\t} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\tglobal $WCMp;\r\n\t\t\t\tif( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( $needs_shipping ) {\r\n\t\t\t$traking_added = false;\r\n\t\t\t$package_received = false;\r\n\t\t\tforeach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {\r\n\t\t\t\tif( $meta->key == 'wcfm_tracking_url' ) {\r\n\t\t\t\t\t$traking_added = true;\r\n\t\t\t\t}\r\n\t\t\t\tif( $meta->key == 'wcfm_mark_as_recived' ) {\r\n\t\t\t\t\t$package_received = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo \"<p>\";\r\n\t\t\tprintf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\tif( $package_received ) {\r\n\t\t\t\tprintf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t} elseif( $traking_added ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"#\" class=\"wcfm_mark_as_recived\" data-orderitemid=\"<?php echo $item_id; ?>\" data-orderid=\"<?php echo $order->get_id(); ?>\" data-productid=\"<?php echo $item->get_product_id(); ?>\"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>\r\n\t\t\t\t<?php\r\n\t\t\t} else {\r\n\t\t\t\tprintf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t}\r\n\t\t\techo \"</p>\";\r\n\t\t}\r\n\t}",
"public function handleVendor(){ \n $login = $this->hlp->logn();\n $vStr = \"vendorfee\";\n $vFee = intval($this->configuration->valueGetter($vStr));\n \n if (!$this->listings->isVendor($login)) {\n if ($this->wallet->getBalance($login) >= $vFee){ \n $this->wallet->moveAndStore($vStr, $login, \"profit\", $vFee);\n $this->listings->becomeVendor($login);\n $this->flashMessage(\"Váš účet má nyní vendor status\");\n $this->redirect(\"Listings:in\");\n } else {\n $this->flashMessage(\"You don't have sufficient funds!\");\n $this->redirect(\"Listings:in\");\n } \n } else {\n $this->redirect(\"Listings:in\");\n }\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function actionUkrainepostShipping()\n {\n echo 20.14;\n }",
"public function setShippingInvoiced($shippingInvoiced);",
"public function notify_warehouse( $order ) {\n\t\t$order_info = $this->get_order_info($order);\n\t\t$supplier_codes = $order_info['suppliers'];\n\t\t// for each supplier code, loop and send email with product info\n\t\tforeach($supplier_codes as $code => $supplier_info) {\n\t\t\tdo_action('wc_dropship_manager_send_order',$order_info,$supplier_info);\n\t\t}\n\t}",
"function warehouse_shipping( $products, $destination_country){\r\n\t\t$pweight=0;\r\n\t\t$amount=0;\r\n\t\t$baseshippingprice=false;\r\n\t\tforeach ( $products as $product ) {\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\t\tif($_enable_warehouse!=1) continue;\r\n\t\t\tif ( is_product_disable_shipping_weight( $product['product_id'] ) ) {\r\n continue;\r\n\t\t }\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\t\tif ( isset( $product['variation_id'] ) ) {\r\n\t\t\t\t$is_virtual = get_post_meta( $product['variation_id'], '_virtual', true );\r\n\t\t\t\t$is_downloadable = get_post_meta( $product['variation_id'], '_downloadable', true );\r\n\t\t\t} else {\r\n\t\t\t\t$is_virtual = get_post_meta( $product['product_id'], '_virtual', true );\r\n\t\t\t\t$is_downloadable = get_post_meta( $product['product_id'], '_downloadable', true );\r\n\t\t\t}\r\n\r\n\t\t\tif ( ( $is_virtual == 'yes' ) || ( $is_downloadable == 'yes' ) ) {\r\n\t\t\t\t$downloadable_count++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\r\n\t\t\t// if warehouse shipping enable for this product\r\n\t\t\tif($_enable_warehouse==1){\r\n\t\t\t\t\r\n\t\t\t\t$pweight+=$product['data']->get_weight()* $product['quantity'];\r\n\t\t\t}\r\n\t\t\t$price[ $seller_id ]['totalp_price'] += $product['line_total'];\r\n\t\t}\r\n\t\t\r\n\t\t\t\t\t\r\n\t\t$dps_country_rates= get_option('_dps_country_rates', true );\r\n\t\t$dps_weight_rates = get_option('_dps_weight_rates', true );\r\n\t\t$dps_threshold_values = get_option('_dps_threshold_value', true );\r\n\t\t$dps_threshold_value=$dps_threshold_values['threshold'];\r\n\t\tif ( isset( $dps_weight_rates[$destination_country] ) ){\r\n\t\t\t\t\t\r\n\t\t\t$baseshippingprice=false;\r\n\t\t\t$cnt=0;\r\n\t\t\tforeach ( $dps_weight_rates[$destination_country]['wf'] as $weight => $weight_rate ){\r\n\t\t\t\t $weightfrom=$dps_weight_rates[$destination_country]['wf'][$cnt];\r\n\t\t\t\t $weightto=$dps_weight_rates[$destination_country]['wto'][$cnt];\r\n\t\t\t\t $weightrate=$dps_weight_rates[$destination_country]['rate'][$cnt];\r\n\t\t\t\t//echo $price[$seller_id]['state_rates']=$weightrate;\r\n\t\t\t\t\r\n\t\t\t\tif($weightfrom<$pweight && $weightto>=$pweight){\r\n\t\t\t\t\t$priceliesonweightrange=true;\r\n\t\t\t\t\t $price[$seller_id]['shipping_rates']=$weightrate;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t $cnt++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(isset($dps_threshold_value[$destination_country])){\r\n\t\t\tif($dps_threshold_value[$destination_country]>0){\r\n\t\t\t\tif($price[$seller_id]['totalp_price']>$dps_threshold_value[$destination_country]){\r\n\t\t\t\t\t$price[$seller_id]['shipping_rates']=0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( !empty( $price ) ) {\r\n foreach ( $price as $s_id => $value ) {\r\n $amount = $amount + ( ( isset($value['shipping_rates']) ? $value['shipping_rates'] : 0 ) );\r\n\t\t\t\t\r\n\t\t\t\t\r\n }\r\n }\r\n\t\t\r\n\t\treturn $amount;\r\n}",
"public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }",
"function quote($method = '') {\r\n\r\n\t\tglobal $order, $shipping_weight, $shipping_num_boxes, $transittime, $dispinsure, $packing;\r\n\r\n\t\tif ($this->dimensions_support > 0 && is_object($packing)) {\r\n\r\n\t\t\tif ($this->dimensions_support == 1) { // # only ready to ship items are set with dimensions\r\n\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\tif ($boxesToShip[$i]['item_length'] == 0) { // size wasn't set\r\n\t\t\t\t\t\tif ($boxesToShip[$i]['item_weight'] > 60) { // use module estimated dimesions when size not set\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 50) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 40) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 30) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 20) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 10) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 5) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_length'] = $length;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_width'] = $width;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_height'] = $height;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$numBoxes = $packing->getNumberOfBoxes();\r\n\r\n\t\t\tif (SHIPPING_UNIT_LENGTH == 'CM') { // must convert centimeters to inches before getting quote\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\t$boxesToShip[$i]['item_length'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_width'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_height'] *= 0.39370079;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // # The old method. tell us how many boxes plus the box weight\r\n\r\n\t\t\tif ($shipping_weight > 60) { // these are defined in inches and don't need converting\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t} elseif ($shipping_weight > 50) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t} elseif ($shipping_weight > 40) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t} elseif ($shipping_weight > 30) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t} elseif ($shipping_weight > 20) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t} elseif ($shipping_weight > 10) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t} elseif ($shipping_weight > 5) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t} else {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t}\r\n\r\n\t\t\t$package = array('item_weight' => $shipping_weight,\r\n\t\t\t\t'item_price' => round($order->info['subtotal'] / $shipping_num_boxes, 2),\r\n\t\t\t\t'item_length' => $length,\r\n\t\t\t\t'item_width' => $width,\r\n\t\t\t\t'item_height' => $height);\r\n\r\n\t\t\t$boxesToShip = array();\r\n\r\n\t\t\tfor ($i = 0; $i < $shipping_num_boxes; $i++) {\r\n\t\t\t\t$boxesToShip[] = $package;\r\n\t\t\t}\r\n\r\n\t\t\t$totalWeight = round($shipping_weight * $shipping_num_boxes, 2);\r\n\t\t\t$numBoxes = $shipping_num_boxes;\r\n\t\t}\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'KGS') { // # must convert kilograms to pounds before getting quote\r\n\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t$boxesToShip[$i]['item_weight'] *= 2.2046226;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($this->display_weight) {\r\n\t\t\t$shiptitle = sprintf(MODULE_SHIPPING_USPS_TEXT_WEIGHT_DISPLAY, $numBoxes, $totalWeight);\r\n\t\t} else {\r\n\t\t\t$shiptitle = '';\r\n\t\t}\r\n\t\t$this->dest_zip = str_replace(' ', '', $order->delivery['postcode']);\r\n\t\tif ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { // domestic quote\r\n\t\t\t$this->dest_zip = substr($this->dest_zip, 0, 5);\r\n\t\t\t$dmstcquotes = array();\r\n\t\t\tif( $this->display_transit ){\r\n\t\t\t\t$trnstime = $this->_getDmstcTransitTimes();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$error = false;\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getDmstcQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($dmstcquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailavail'] = ($dmstcquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineavail'] = ($dmstcquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($dmstcquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif( (MODULE_SHIPPING_USPS_DMSTC_RATE == 'Internet') && $quote['onlineavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['onlineconf'])) $title .= '<br />---' . $quote['onlineconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} elseif( $quote['retailavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['retailconf'])) $title .= '<br />---' . $quote['retailconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $dmstcquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( sizeof($this->dmstc_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'Domestic',\r\n\t\t\t\t\t'changes' => $this->dmstc_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t} else { // # international quote\r\n\t\t\t$maxinsurance_query = tep_db_query(\"SELECT DISTINCT(max_insurance) FROM USPS_intl_maxins WHERE insurable AND country_code = '\" . tep_db_input($order->delivery['country']['iso_code_2']) . \"' ORDER BY max_insurance\");\r\n\t\t\t$this->intl_maxinsure = array();\r\n\r\n\t\t\twhile ($x = tep_db_fetch_array($maxinsurance_query)) {\r\n\t\t\t\t$this->intl_maxinsure[] = $x['max_insurance'];\r\n\t\t\t}\r\n\r\n\t\t\t$intlquotes = array();\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getIntlQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($intlquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailavail'] = ($intlquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineavail'] = ($intlquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$intlquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($intlquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif ((MODULE_SHIPPING_USPS_INTL_RATE == 'Internet') && $quote['onlineavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t} elseif ($quote['retailavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $intlquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if there's been a change detected, log it..\r\n\t\t\tif( sizeof($this->intl_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'International',\r\n\t\t\t\t\t'changes' => $this->intl_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (is_array($uspsQuote)) {\r\n\t\t\tif (isset($uspsQuote['error'])) {\r\n\t\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'error' => $uspsQuote['error']);\r\n\t\t\t} else {\r\n\t\t\t\t$quotesort = array();\r\n\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t$quotesort[$method['id']] = $method['cost'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $this->shipping_method_sort_direction == 'desc' ){\r\n\t\t\t\t\tarsort($quotesort); // sort methods by cost high to low\r\n\t\t\t\t} else {\r\n\t\t\t\t\tasort($quotesort);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$methods = array();\r\n\t\t\t\tforeach ($quotesort as $key => $cost) {\r\n\t\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t\tif ($method['id'] == $key) $methods[] = $method;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->quotes = array('id' => $this->code,\r\n\t\t\t\t\t'module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'methods' => $methods);\r\n\t\t\t\tif ($this->tax_class > 0) {\r\n\t\t\t\t\t$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // quotes was empty\r\n\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);\r\n\t\t}\r\n\t\tif (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);\r\n\t\t\r\n// \t\tprint_r( $this->quotes );\r\n\t\t\r\n\t\treturn $this->quotes;\r\n\t}",
"public function setShippingValues(Order $order): void;",
"public function apply()\n {\n /** @var EavSetup $eavSetup */\n $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);\n\n if (!$eavSetup->getAttribute(Product::ENTITY, 'am_shipping_type')) {\n $eavSetup->addAttribute(\n Product::ENTITY,\n 'am_shipping_type',\n [\n 'type' => 'varchar',\n 'backend' => '',\n 'frontend' => '',\n 'label' => 'Shipping Type',\n 'input' => 'select',\n 'class' => '',\n 'source' => '',\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'visible' => true,\n 'required' => false,\n 'user_defined' => false,\n 'default' => 0,\n 'searchable' => false,\n 'filterable' => false,\n 'comparable' => false,\n 'visible_on_front' => false,\n 'used_in_product_listing' => true,\n 'unique' => false,\n 'apply_to' => ''\n ]\n );\n }\n }",
"public function successAfter($observer) {\r\n $sellerDefaultCountry = '';\r\n $nationalShippingPrice = $internationalShippingPrice = 0;\r\n $orderIds = $observer->getEvent()->getOrderIds();\r\n $order = Mage::getModel('sales/order')->load($orderIds [0]);\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $getCustomerId = $customer->getId();\r\n $grandTotal = $order->getGrandTotal();\r\n $status = $order->getStatus();\r\n $itemCount = 0;\r\n $shippingCountryId = '';\r\n $items = $order->getAllItems();\r\n $orderEmailData = array();\r\n foreach ($items as $item) {\r\n\r\n $getProductId = $item->getProductId();\r\n $createdAt = $item->getCreatedAt();\r\n $is_buyer_confirmation_date = '0000-00-00 00:00:00';\r\n $paymentMethodCode = $order->getPayment()->getMethodInstance()->getCode();\r\n $products = Mage::helper('marketplace/marketplace')->getProductInfo($getProductId);\r\n $products_new = Mage::getModel('catalog/product')->load($item->getProductId());\r\n if($products_new->getTypeId() == \"configurable\")\r\n {\r\n $options = $item->getProductOptions() ;\r\n\r\n $sku = $options['simple_sku'] ;\r\n $getProductId = Mage::getModel('catalog/product')->getIdBySku($sku);\r\n }\r\n else{\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n\r\n\r\n $sellerId = $products->getSellerId();\r\n $productType = $products->getTypeID();\r\n /**\r\n * Get the shipping active status of seller\r\n */\r\n $sellerShippingEnabled = Mage::getStoreConfig('carriers/apptha/active');\r\n if ($sellerShippingEnabled == 1 && $productType == 'simple') {\r\n /**\r\n * Get the product national shipping price\r\n * and international shipping price\r\n * and shipping country\r\n */\r\n $nationalShippingPrice = $products->getNationalShippingPrice();\r\n $internationalShippingPrice = $products->getInternationalShippingPrice();\r\n $sellerDefaultCountry = $products->getDefaultCountry();\r\n $shippingCountryId = $order->getShippingAddress()->getCountry();\r\n }\r\n /**\r\n * Check seller id has been set\r\n */\r\n if ($sellerId) {\r\n $orderPrice = $item->getBasePrice() * $item->getQtyOrdered();\r\n $productAmt = $item->getBasePrice();\r\n $productQty = $item->getQtyOrdered();\r\n if ($paymentMethodCode == 'paypaladaptive') {\r\n $credited = 1;\r\n } else {\r\n $credited = 0;\r\n }\r\n\r\n /* check for checking if payment method is credit card or cash on delivery and if method\r\n is cash on delivery then it will check if the order status of previous orders are complete or not\r\n no need to disable sending email from admin*/\r\n\r\n /*-----------------Adding Failed Delivery Value--------------------------*/\r\n Mage::helper('progos_ordersedit')->getFailedDeliveryStatus($order);\r\n /*----------------------------------------------------------------------*/\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n $is_buyer_confirmation = 'No';\r\n $is_buyer_confirmation_date = $createdAt;\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n /*\r\n * Elabelz-2057\r\n */\r\n /*$product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();*/\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"):\r\n $counter = $counter + 1;\r\n endif;\r\n }\r\n if ($counter != 0) {\r\n $is_buyer_confirmation = 'Yes';\r\n $is_buyer_confirmation_yes = \"Accepted\";\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n $product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } else {\r\n $is_buyer_confirmation = 'No';\r\n $item_order_status = 'pending';\r\n $tel = $order->getBillingAddress()->getTelephone();\r\n $nexmoActivated = Mage::getStoreConfig('marketplace/nexmo/nexmo_activated');\r\n $nexmoStores = Mage::getStoreConfig('marketplace/nexmo/nexmo_stores');\r\n $nexmoStores = explode(',', $nexmoStores);\r\n $currentStore = Mage::app()->getStore()->getCode();\r\n #check nexmo sms module is active or not and check on which store its enabled\r\n $reservedOrderId = $order->getIncrementId();\r\n $mdlEmapi = Mage::getModel('restmob/quote_index');\r\n $id = $mdlEmapi->getIdByReserveId($reservedOrderId);\r\n if ($nexmoActivated == 1 && in_array($currentStore, $nexmoStores) && !$id) {\r\n # code...\r\n $data = Mage::helper('marketplace/marketplace')->sendVerify($tel);\r\n $data = $data['request_id'];\r\n\r\n }\r\n //$data = 0;\r\n\r\n }\r\n }\r\n\r\n\r\n // $orderPriceToCalculateCommision = $products_new->getPrice() * $item->getQtyOrdered();\r\n $shippingPrice = Mage::helper('marketplace/market')->getShippingPrice($sellerDefaultCountry, $shippingCountryId, $orderPrice, $nationalShippingPrice, $internationalShippingPrice, $productQty);\r\n /**\r\n * Getting seller commission percent\r\n */\r\n $sellerCollection = Mage::helper('marketplace/marketplace')->getSellerCollection($sellerId);\r\n $percentperproduct = $sellerCollection ['commission'];\r\n $commissionFee = $orderPrice * ($percentperproduct / 100);\r\n\r\n // Product price after deducting\r\n // $productAmt = $products_new->getPrice() - $commissionFee;\r\n\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n\r\n if($item->getProductType() == 'simple')\r\n {\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n /**\r\n * Storing commission information in database table\r\n */\r\n\r\n if ($commissionFee > 0 || $sellerAmount > 0) {\r\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($getProductId);\r\n $parent_product = Mage::getModel('catalog/product')->load($parentIds[0]);\r\n\r\n if ($parent_product->getSpecialPrice()) {\r\n $orderPrice_sp = $parent_product->getSpecialPrice() * $item->getQtyOrdered();\r\n $orderPrice_base = $parent_product->getPrice() * $item->getQtyOrdered();\r\n\r\n $commissionFee = $orderPrice_sp * ($percentperproduct / 100);\r\n $sellerAmount = $orderPrice_sp - $commissionFee;\r\n } else {\r\n $orderPrice_base = $item->getBasePrice() * $item->getQtyOrdered();\r\n $commissionFee = $orderPrice_base * ($percentperproduct / 100);\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n }\r\n\r\n $commissionDataArr = array(\r\n 'seller_id' => $sellerId,\r\n 'product_id' => $getProductId,\r\n 'product_qty' => $productQty,\r\n 'product_amt' => $productAmt,\r\n 'commission_fee' => $commissionFee,\r\n 'seller_amount' => $sellerAmount,\r\n 'order_id' => $order->getId(),\r\n 'increment_id' => $order->getIncrementId(),\r\n 'order_total' => $grandTotal,\r\n 'order_status' => $status,\r\n 'credited' => $credited,\r\n 'customer_id' => $getCustomerId,\r\n 'status' => 1,\r\n 'created_at' => $createdAt,\r\n 'payment_method' => $paymentMethodCode,\r\n 'item_order_status' => $item_order_status,\r\n 'is_buyer_confirmation' => $is_buyer_confirmation,\r\n 'sms_verify_code' => $data,\r\n 'is_buyer_confirmation_date'=> $is_buyer_confirmation_date,\r\n 'is_seller_confirmation_date'=> '0000-00-00 00:00:00',\r\n 'shipped_from_elabelz_date'=> '0000-00-00 00:00:00',\r\n 'successful_non_refundable_date'=> '0000-00-00 00:00:00',\r\n 'commission_percentage' => $sellerCollection ['commission']\r\n );\r\n\r\n $commissionId = $this->storeCommissionData($commissionDataArr);\r\n $orderEmailData [$itemCount] ['seller_id'] = $sellerId;\r\n $orderEmailData [$itemCount] ['product_qty'] = $productQty;\r\n $orderEmailData [$itemCount] ['product_id'] = $getProductId;\r\n $orderEmailData [$itemCount] ['product_amt'] = $productAmt;\r\n $orderEmailData [$itemCount] ['commission_fee'] = $commissionFee;\r\n $orderEmailData [$itemCount] ['seller_amount'] = $sellerAmount;\r\n $orderEmailData [$itemCount] ['increment_id'] = $order->getIncrementId();\r\n $orderEmailData [$itemCount] ['customer_firstname'] = $order->getCustomerFirstname();\r\n $orderEmailData [$itemCount] ['customer_email'] = $order->getCustomerEmail();\r\n $orderEmailData [$itemCount] ['product_id_simple'] = $getProductId;\r\n $orderEmailData [$itemCount] ['is_buyer_confirmation'] = $is_buyer_confirmation_yes;\r\n $orderEmailData [$itemCount] ['itemCount'] = $itemCount;\r\n $itemCount = $itemCount + 1;\r\n }\r\n }\r\n // if ($paymentMethodCode == 'paypaladaptive') {\r\n // $this->updateCommissionPA($commissionId);\r\n // }\r\n }\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n /*if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n $this->sendOrderEmail($orderEmailData);\r\n }*/\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"){\r\n $counter = $counter + 1;\r\n }\r\n }\r\n if ($counter != 0) {\r\n if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n\r\n $this->sendOrderEmail($orderEmailData);\r\n }\r\n }\r\n }\r\n\r\n //$this->enqueueDataToFareye($observer);\r\n\r\n }",
"public function getForcedShipmentWithInvoice();",
"public function getShipping();",
"function action_woocommerce_order_status_changed( $this_get_id, $this_status_transition_from, $this_status_transition_to, $instance ) {\n $options = get_option( 'dhl_parcel_options' );\n\n $dbh = new Database_Handler();\n $status = str_replace(\"wc-\", \"\", strtolower($options['ppoc_order_state_to_create_shipping_label ']) );\n $dhl_client = new DhlClient();\n if (!$dhl_client->isDHLParcelShipment($this_get_id)) { return; }\n $label = $dbh->get_labels_by_order_id($this_get_id,false);\n\n if( strcmp($status, $this_status_transition_to)==0 && !count($label)){\n //Reference incase its order_id and did not enter on the \"Edit order\" page.\n if ($options['ppoc_reference_field'] == \"order_id\"){\n if(!get_post_meta( $this_get_id, '_reference_field', true )){\n update_post_meta( $this_get_id, '_reference_field', $this_get_id );\n }\n }\n\n $json = $dhl_client->createDhlLabel($this_get_id);\n $json = get_object_vars($json);\n $tracking_code = $json['trackerCode'];\n $dbh->insert_labels($json['labelId'],false,$this_get_id,$tracking_code);\n\n if($options['ppoc_create_return_label']){\n $json = $dhl_client->createDhlReturnLabel($this_get_id);\n $json = get_object_vars($json);\n $tracking_code = $json['trackerCode'];\n $dbh->insert_labels($json['labelId'],true,$this_get_id,$tracking_code);\n }\n $dhl_client->createPickUpRequest($this_get_id);\n }\n\n}",
"public function updateProductShipp(Request $request)\n {\n $carts = Cart::where('user_id',auth()->user()->id?? '')->get();\n foreach ($carts as $key => $cart) {\n if ($cart->product_id) {\n $data = Product::where('id',$cart->product_id)->update([\n 'shipp_des'=>$request->val\n ]);\n }\n if ($cart->vendor_product_id) {\n $data = VendorProduct::where('id',$cart->vendor_product_id)->update([\n 'shipp_des'=>$request->val\n ]);\n }\n\n\n }\n\n return response()->json([\n 'msg'=>'success'\n ]);\n }",
"function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"public function isShipped($id){\n $q = $this->slcOrdrFild(\"shipped\", $id);\n return $this->check($q, \"yes\");\n }",
"protected function shouldAddShippingInformation(): bool\r\n {\r\n if (DocumentTypes::requiresDelivery($this->documentType)) {\r\n return true;\r\n }\r\n\r\n return $this->useShipping === Boolean::YES;\r\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"function jigoshop_upgrade_146() {\n\t\n\tJigoshop_Base::get_options()->add_option( 'jigoshop_show_checkout_shipping_fields', 'yes' );\n\t\n}",
"function action_woocommerce_before_shipping_zone_object_save( $instance, $this_data_store ) {\n $shipping_methods = $instance->get_shipping_methods();\n foreach($shipping_methods as $shipping_method){\n if( isset($instance->get_changes()['zone_locations']) ){\n update_shipping_rules($shipping_method, $instance->get_changes()['zone_locations'], $instance->get_id());\n }\n\n }\n\n}",
"public function confirm() {\n\n\t\tif (!isset($this->shipper)) {\n\t\t\tthrow new \\Exception('Shipper is not set, use \"set_shipper()\" to define one');\n\t\t}\n\n\t\tif (!isset($this->ship_from)) {\n\t\t\tthrow new \\Exception('Ship_From is not set, use \"set_ship_from()\" to define one');\n\t\t}\n\n\t\tif (!isset($this->ship_to)) {\n\t\t\tthrow new \\Exception('Recipient ship_to is not set, use \"set_ship_to()\" to define one');\n\t\t}\n\n\t\tif (!isset($this->sold_to)) {\n\t\t\tthrow new \\Exception('Recipient sold_to is not set, use \"set_sold_to()\" to define one');\n\t\t}\n\n\t\tif (count($this->packages) == 0) {\n\t\t\tthrow new \\Exception('Add package first. Use \"add_package()\" to add one');\n\t\t}\n\n\t\tif (!isset($this->service)) {\n\t\t\tthrow new \\Exception('No service set, use \"set_service()\" to add one');\n\t\t}\n\n\n\t\t$template = Template::get();\n\t\t$template->assign('shipper', $this->shipper);\n\t\t$template->assign('ship_from', $this->ship_from);\n\t\t$template->assign('sold_to', $this->sold_to);\n\t\t$template->assign('ship_to', $this->ship_to);\n\t\t$template->assign('packages', $this->packages);\n\t\t$template->assign('service', $this->service);\n\t\t$template->assign('notifications', $this->notifications);\n\t\t$template->assign('internationalforms', $this->internationalforms);\n\n\t\t$xml = $template->render('call/ShipConfirm.twig');\n\n\t\t$result = $this->call('ShipConfirm', $xml);\n\t\treturn $result;\n\t}",
"function wc_add_notice_free_shipping() {\n\n $order_min_amount = get_free_shipping_minimum();\n\n $cart = WC()->cart->subtotal;\n $remaining = $order_min_amount - $cart;\n $f_str = \"\";\n if ( $cart < 1 ) {\n $f_str .= sprintf( __( '<strong>Free delivery</strong> from %s.', 'thegrapes' ), wc_price($order_min_amount));\n } else if ( $order_min_amount > $cart ){\n $f_str .= sprintf( __( 'Spend %s more to get <strong>free delivery</strong>.', 'thegrapes' ), wc_price($remaining));\n } else {\n $f_str .= '<strong>' . __( 'You have free delivery.', 'thegrapes' ) . '</strong>';\n }\n return $f_str;\n\n}",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"public function setQuantityShippedAttribute($input)\n {\n $this->attributes['quantity_shipped'] = $input ? $input : null;\n }",
"public function _updateOnHoldAndAvailableQty($product_id,$qtyShipped){\n\t\t$warehouseOr = Mage::getModel('inventoryplus/warehouse_order')->getCollection()\n ->addFieldToFilter('order_id', $this->_orderOb->getId())\n ->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t\t\t->setPageSize(1)\n\t\t\t\t\t\t\t->setCurPage(1)\n ->getFirstItem();\n\t\tif($warehouseOr->getId()){\t\t\t\t\t\n\t\t\t$OnHoldQty = $warehouseOr->getQty() - $qtyShipped;\n\t\t\t$warehouseId = $warehouseOr->getWarehouseId();\n\t\t\tif ($OnHoldQty >= 0) {\n\t\t\t\t$warehouseOr->setQty($OnHoldQty)\n\t\t\t\t\t\t->save();\n\t\t\t} else {\n\t\t\t\t$warehouseOr->setQty(0)\n\t\t\t\t\t\t->save();\n\t\t\t}\n\t\t\t$warehousePr = Mage::getModel('inventoryplus/warehouse_product')->getCollection()\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t\t\t->setPageSize(1)\n\t\t\t\t\t\t\t->setCurPage(1)\n ->getFirstItem();\n\t\t\tif($warehousePr->getId()){\n\t\t\t\t$newAvailQty = $warehousePr->getAvailableQty()\t+ $qtyShipped;\n\t\t\t\t$warehousePr->setAvailableQty($newAvailQty);\n\t\t\t\t$warehousePr->save();\n\t\t\t}\n\t\t}\n\t}",
"public function dhlIntrashipSendShipmentBefore($event)\n {\n $request = $event->getRequest();\n\n\n $parcel = $request->offsetGet('shipment');\n $dhlaccount = $parcel->getShipment()->getBillingAddress()->getDhlaccount();\n if (!is_null($parcel->getShipment()->getShippingAddress()->getDhlaccount())) {\n $dhlaccount = $parcel->getShipment()->getShippingAddress()->getDhlaccount();\n }\n if ($parcel->hasCustomizedAddress()) {\n $dhlaccount = $parcel->getCustomizedAddress()->offsetGet('dhlaccount');\n }\n if (0 < strlen($dhlaccount)) {\n $params = $request->offsetGet('params');\n $data = $params->offsetGet('ShipmentOrder');\n if (array_key_exists('Company', $data['Shipment']['Receiver']['Company'])\n && (false == array_key_exists('name2', $data['Shipment']['Receiver']['Company']['Company'])\n || 0 == strlen(trim($data['Shipment']['Receiver']['Company']['Company']['name2']))\n )\n ) {\n $data['Shipment']['Receiver']['Company']['Company']['name2'] = $dhlaccount;\n } elseif (false == array_key_exists('Communication', $data['Shipment']['Receiver'])\n || false == array_key_exists('contactPerson', $data['Shipment']['Receiver']['Communication'])\n || 0 == strlen(trim($data['Shipment']['Receiver']['Communication']['contactPerson']))\n ) {\n if (false == array_key_exists('Communication', $data['Shipment']['Receiver'])) {\n $data['Shipment']['Receiver']['Communication'] = array();\n }\n $data['Shipment']['Receiver']['Communication']['contactPerson'] = $dhlaccount;\n } elseif (false == array_key_exists('careOfName', $data['Shipment']['Receiver']['Address'])\n || 0 == strlen(trim($data['Shipment']['Receiver']['Address']['careOfName']))\n ) {\n $data['Shipment']['Receiver']['Address']['careOfName'] = $dhlaccount;\n }\n $request->offsetGet('params')->offsetSet('ShipmentOrder', $data);\n }\n }",
"public function store(Request $request)\n {\n //dd($request->all());\n\n $this->validate($request, [\n 'shipper_code' => ['required', 'string', 'max:50'],\n 'shipper_name' => ['max:500']\n ]);\n\n $shipping = new Shipping([\n 'shipper_code' => $request->get('shipper_code'),\n 'shipper_name' => $request->get('shipper_name'),\n 'contact' => $request->get('contact'),\n 'gst_id' => $request->get('gst_id'),\n 'address1' => $request->get('address1'),\n 'city' => $request->get('city'),\n 'state' => $request->get('state'),\n 'country' => $request->get('country'),\n 'postcode' => $request->get('postcode'),\n 'telephone' => $request->get('telephone'),\n 'mobile' => $request->get('mobile'),\n 'fax' => $request->get('fax'),\n 'email' => $request->get('email'),\n 'credit_limit' => $request->get('credit_limit'),\n 'term_day' => $request->get('term_day'),\n 'invoice_format' => $request->get('invoice_format'),\n 'deleted_by' => ''\n ]);\n\n $code = $request->get('shipper_code');\n $name = $request->get('shipper_name');\n\n $checkshippercode = Shipping::where('shipper_code','=',$code)->exists();\n $checkshippername = Shipping::where('shipper_name','=',$name)->exists();\n\n if($checkshippercode == 'true')\n {\n return back()->with('error', 'Shipper code already existed.');\n }\n elseif($checkshippername == 'true')\n {\n return back()->with('error', 'Shipper name already existed.');\n }\n else\n {\n $destination = Destination::distinct()\n ->where('deleted_by','=','')\n ->orderBy('destination_code')\n ->get(['destination_code']);\n\n foreach($destination as $row){\n $data2 = array(\n 'shipper_code' => $code,\n 'destination_code' => $row['destination_code'],\n 'created_by' => '',\n 'created_on' => now()\n );\n\n DB::table('charges')->insert($data2);\n }\n\n $account = new Account([\n 'shipper_code' => $request->get('shipper_code'),\n 'shipper_name' => $request->get('shipper_name'),\n 'details' => 'Account created',\n 'amount' => '0.00',\n 'acc_bal' => '0.00',\n 'update_time' => now()\n ]);\n\n $log = new Log([\n 'status' => ''.strtoupper(auth()->user()->username).' create shipper account ['.$request->get('shipper_name').'].'\n ]);\n $log->save();\n\n //return $destination;\n $account->save();\n $shipping->save();\n return redirect()->route('shipping.index')->with('success', 'Shipping Account added successfully.');\n }\n\n }",
"public function salesOrderShipmentSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n \n if (!$settings['shipment_notification_message']) {\n return;\n }\n $order = $observer->getEvent()->getShipment()->getOrder();\n \n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_id = $order->getIncrementId();\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n $shipment = $order->getShipmentsCollection()->getFirstItem();\n $shipId = $shipment->getIncrementId();\n\n // Check if a telephone number has been specified\n if(in_array('shippment', $final_array)){\n if ($telephoneNumber) {\n // Send the shipment notification to the specified telephone number\n $text = $settings['shipment_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{shipmentno}}', $shipId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n // Display a success or error message\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The shipment notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the shipment notification SMS.');\n }\n }\n } \n}",
"public function updateLocationProduct(Request $request) {\n $product = Product::where('code', $request->code)->get();\n $product[0]->location_new = $request->location_new;\n $description = $product[0]->description;\n //send mail.....\n $status = $product[0]->status;\n $user_email = $product[0]->user->email;\n $data = array('name'=>\"ABCD\");\n // Path or name to the blade template to be rendered\n $template_path = 'email_template';\n $content = $product[0]->name;\n if ($status == 1 && $description != \"shipping\") {\n Mail::send($template_path, $data, function($message) use ($user_email, $content) {\n $message->to($user_email, 'Receiver Name')->subject('Orders are being delivered');\n $message->from('[email protected]',\"{$content}\".' is comming!');\n });\n $product[0]->description = \"shipping\";\n return response()->json([\"product\" => $product,\n \"status\" => $product[0]->save(),\n \"number\" => 201]);\n }\n if ($status == 2 && $description != \"delivered\") {\n Mail::send($template_path, $data, function($message) use ($user_email, $content) {\n $message->to($user_email, 'Receiver Name')->subject('Orders has been shipped');\n $message->from('[email protected]',\"{$content}\".' has been shipped!');\n });\n $product[0]->description = \"delivered\";\n return response()->json([\"product\" => $product,\n \"status\" => $product[0]->save(),\n \"number\" => 201]);\n }\n return response()->json([\"product\" => $product,\n \"status\" => $product[0]->save(),\n \"number\" => 201]);\n }",
"public function testBuy()\n {\n VCR::insertCassette('orders/buy.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::uspsService(),\n ]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}",
"public function payWayPurchase()\n\t{\n\t}",
"public function install()\n {\n $carrierConfig = array(\n 0 => array(\n 'name' => 'Custom Shipping',\n 'active' => true,\n 'deleted' => 0,\n 'id_tax_rule_group' => '2',\n 'shipping_handling' => false,\n 'range_behavior' => 0,\n 'delay' => array(\n 'fr' => 'Custom',\n 'en' => 'Custom',\n Language::getIsoById(Configuration::get('PS_LANG_DEFAULT')) => 'Custom',\n ),\n 'is_module' => true,\n 'shipping_external' => true,\n 'external_module_name' => 'ts_customshipping',\n 'need_range' => true,\n ),\n );\n\n $id_carrier1 = $this->installExternalCarrier($carrierConfig[0]);\n $Carrier = new Carrier((int) $id_carrier1);\n $Carrier->setTaxRulesGroup((int) $this->getTaxRulesGroupMostUsed());\n Configuration::updateValue('TS_CUSTOM_SHIPPING_CARRIER_ID', (int) $id_carrier1);\n\n return parent::install() && $this->registerHook('displayBackOfficeHeader');\n }",
"public function setShippingAddressAction()\n {\n $data = $this->Request()->getParams();\n //we need to set this because of a bug in the shopware models\n if (!isset($data['stateId'])) {\n $data['stateId'] = 0;\n }\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n if ($shippingAddressModel = $customerModel->getShipping()) {\n $shippingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($shippingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['shippingAddressId' => $shippingAddressModel->getId()]);\n }\n }",
"public function getShippingInfo();",
"function add_shippify_order_action_button( $actions, $the_order ) {\n\n // esto me dio error en algunas ordenes... \n if (in_array(\"shippify\", get_post_meta( $the_order->id, '_shipping_method', true )) && (get_post_meta( $the_order->id, '_is_dispatched', true ) != 'yes') && !isset($_GET['post_status'])){ \n $actions['shippify_action'] = array(\n 'url' => wp_nonce_url( admin_url( 'edit.php?post_type=shop_order&myaction=woocommerce_shippify_dispatch&stablishedorder=' . $the_order->id ), 'woocommerce-shippify-dispatch'), \n 'name' => __( 'Dispatch', 'woocommerce-shippify' ),\n 'action' => \"view shippify\", // setting \"view\" for proper button CSS.\n );\n }\n return $actions;\n }",
"function bill_transition_pending_soldout($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n // Start marking soldout status. Final may be COMPLETE if production occurs.\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Transaction Soldout Operation on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'SOLDOUT';\n $bill->save(true);\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n $bill->customer = $DB->get_record('local_shop_customer', array('id' => $bill->customerid));\n $bill->foruser = $bill->customer->hasaccount;\n $bill->user = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n\n $productiondata = produce_postpay($bill);\n\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Transaction Autocompletion Operation on seller behalf by $USER->username\";\n shop_trace($message);\n // Notify end user.\n // Feedback customer with mail confirmation.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->itemcount),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid,\n 'view' => 'bill',\n 'billid' => $bill->id,\n 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}",
"public static function add_vendor_info_in_product_summery() {\n include_once dirname( __FILE__ ) . '/templates/vendor-info.php';\n }",
"public function getShipcom()\n {\n return $this->shipcom;\n }",
"function dcs_dropship_install()\r\n{\r\n\tglobal $wpdb;\r\n\r\n\t//Install default Options\r\n\tif( !add_option(DCS_DROPSHIP_KEY, \"test key\") )\r\n\t{\r\n\t\tupdate_option(DCS_DROPSHIP_KEY, \"test key\");\r\n\t}\r\n\r\n\tif( !add_option(DCS_DROPSHIP_SHOPPING_CART_PAGE, site_url(\"/shopping-cart/\")) )\r\n\t{\r\n\t\tupdate_option(DCS_DROPSHIP_SHOPPING_CART_PAGE, site_url(\"/dropship-test-2/shopping-cart/\") );\r\n\t}\r\n\r\n\tif( !add_option(DCS_DROPSHIP_MARKUP, \"50\") )\r\n\t{\r\n\t\tupdate_option(DCS_DROPSHIP_MARKUP, \"50\");\r\n\t}\r\n\r\n\tif( !add_option(DCS_DROPSHIP_APPROVED_PAGE, site_url(\"/order-approved/\")) )\r\n\t{\r\n\t\tupdate_option(DCS_DROPSHIP_APPROVED_PAGE, site_url(\"/order-approved/\"));\r\n\t}\r\n\r\n\tif( !add_option(DCS_DROPSHIP_DECLINED_PAGE, site_url(\"/order-declined/\")) )\r\n\t{\r\n\t\tupdate_option(DCS_DROPSHIP_DECLINED_PAGE, site_url(\"/order-declined/\"));\r\n\t}\r\n\r\n\tif( !add_option(DCS_DROPSHIP_PRODUCT_PAGE, site_url(\"/products/\")) )\r\n\t{\r\n\t\tupdate_option(DCS_DROPSHIP_PRODUCT_PAGE, site_url(\"/products/\"));\r\n\t}\r\n\r\n\tif( !add_option(DCS_DROPSHIP_PRODUCT_INFO_PAGE, site_url(\"/product-info/\")) )\r\n\t{\r\n\t\tupdate_option(DCS_DROPSHIP_PRODUCT_INFO_PAGE, site_url(\"/product-info/\"));\r\n\t}\r\n\r\n\tdcs_dropship_createInvoiceDatabase();\r\n\r\n\t//Schedule our get tasks.\r\n\tif( strstr(site_url(), \"darktower\") != FALSE )\r\n\t{\r\n\t\twp_schedule_event( DCS_DROPSHIP_PRODUCT_GET_TASK_TIME, \"monthly\", \"dcs_dropship_get_products\" );\r\n\t\twp_schedule_event( DCS_DROPSHIP_PRODUCT_GET_TASK_TIME, \"daily\", \"dcs_dropship_get_invoices\" );\r\n\t\twp_schedule_event( DCS_DROPSHIP_PRODUCT_GET_TASK_TIME, \"daily\", \"dcs_dropship_get_inventory\" );\r\n\t}\r\n}",
"function calculate_per_seller_custom( $amount, $price, $products, $destination_country, $destination_state ) { \r\n $amount = 0.0;\r\n $price = array();\r\n\t\t$pweight=0;\r\n\t\t$warehouse_productweight=0;\r\n $seller_products = array();\r\n\t\t$baseshippingprice=true;\r\n\t\t$priceliesonweightrange=false;\r\n\t\t$_enable_warehouseflag=false;\r\n foreach ( $products as $product ) {\r\n $seller_id = get_post_field( 'post_author', $product['product_id'] );\r\n $seller_products[$seller_id][] = $product;\r\n }\r\n\r\n if ( $seller_products ) {\r\n\r\n foreach ( $seller_products as $seller_id => $products ) {\r\n\r\n if ( !is_shipping_enabled_for_seller( $seller_id ) ) {\r\n continue;\r\n }\r\n\r\n if ( !has_shipping_enabled_product( $products ) ) {\r\n continue;\r\n }\r\n\r\n $default_shipping_price = get_user_meta( $seller_id, '_dps_shipping_type_price', true );\r\n $default_shipping_add_price = get_user_meta( $seller_id, '_dps_additional_product', true );\r\n\r\n $downloadable_count = 0;\r\n\t\t\t\t$productprice=0;\r\n\t\t\t\tif(!isset($price[ $seller_id ]['totalp_price'])){\r\n\t\t\t\t\t$price[ $seller_id ]['totalp_price']=0;\r\n\t\t\t\t}\r\n\t\t\t\t$productcnt=0;\r\n foreach ( $products as $product ) {\r\n\t\t\t\t\r\n if ( is_product_disable_shipping_weight( $product['product_id'] ) ) {\r\n continue;\r\n }\r\n\t\t\t\t $_enable_warehouse=get_metadata('post',$product['product_id'],'_enable_warehouse',true);\r\n\t\t\t\t if($_enable_warehouse==1) continue;\r\n\t\t\t\t\t\r\n if ( isset( $product['variation_id'] ) ) {\r\n $is_virtual = get_post_meta( $product['variation_id'], '_virtual', true );\r\n $is_downloadable = get_post_meta( $product['variation_id'], '_downloadable', true );\r\n } else {\r\n $is_virtual = get_post_meta( $product['product_id'], '_virtual', true );\r\n $is_downloadable = get_post_meta( $product['product_id'], '_downloadable', true );\r\n }\r\n\r\n if ( ( $is_virtual == 'yes' ) || ( $is_downloadable == 'yes' ) ) {\r\n $downloadable_count++;\r\n continue;\r\n }\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( get_post_meta( $product['product_id'], '_overwrite_shipping', true ) == 'yes' ) {\r\n\t\t\t\t\t\t$default_shipping_qty_price = get_post_meta( $product['product_id'], '_additional_qty', true );\r\n\t\t\t\t\t\t$price[ $seller_id ]['addition_price'][] = get_post_meta( $product['product_id'], '_additional_price', true );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$default_shipping_qty_price = get_user_meta( $seller_id, '_dps_additional_qty', true );\r\n\t\t\t\t\t\t$price[ $seller_id ]['addition_price'][] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t//This is the base price and will be the starting shipping price for each product\r\n\t\t\t\t\t$price[ $seller_id ]['default'] = $default_shipping_price;\r\n\t\t\t\t\t\r\n\t\t\t\t\t//Every second product of same type will be charged with this price\r\n\t\t\t\t\tif ( $product['quantity'] > 1 ) {\r\n\t\t\t\t\t\t$price[ $seller_id ]['qty'][] = ( ( $product['quantity'] - 1 ) * $default_shipping_qty_price );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$price[ $seller_id ]['qty'][] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$pweight+=$product['data']->get_weight()* $product['quantity'];\r\n\t\t\t\t\t$price[ $seller_id ]['totalp_price'] += $product['line_total'];\r\n\t\t\t\t\t$productcnt++;\r\n\t\t\t\t\t\r\n }\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t if ( $productcnt > 1 ) {\r\n $price[ $seller_id ]['add_product'] = (int) $default_shipping_add_price * ( $productcnt - ( 1 + $downloadable_count ) );\r\n } else {\r\n $price[ $seller_id ]['add_product'] = 0;\r\n }\r\n\r\n $dps_country_rates = get_user_meta( $seller_id, '_dps_country_rates', true );\r\n\t\t\t\t$dps_weight_rates = get_user_meta( $seller_id, '_dps_weight_rates', true );\r\n\t\t\t\t$dps_threshold_values = get_user_meta( $seller_id, '_dps_threshold_value', true );\r\n\t\t\t\t$dps_threshold_value=$dps_threshold_values['threshold'];\r\n\t\t\t\t\r\n\t\t\t\tif ( isset( $dps_weight_rates[$destination_country] ) ){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$baseshippingprice=false;\r\n\t\t\t\t\t$cnt=0;\r\n\t\t\t\t\tforeach ( $dps_weight_rates[$destination_country]['wf'] as $weight => $weight_rate ){\r\n\t\t\t\t\t\t $weightfrom=$dps_weight_rates[$destination_country]['wf'][$cnt];\r\n\t\t\t\t\t\t $weightto=$dps_weight_rates[$destination_country]['wto'][$cnt];\r\n\t\t\t\t\t\t $weightrate=$dps_weight_rates[$destination_country]['rate'][$cnt];\r\n\t\t\t\t\t\t//echo $price[$seller_id]['state_rates']=$weightrate;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($weightfrom<$pweight && $weightto>=$pweight){\r\n\t\t\t\t\t\t\t$priceliesonweightrange=true;\r\n\t\t\t\t\t\t\t $price[$seller_id]['state_rates']=$weightrate;\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\t $cnt++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(isset($dps_threshold_value[$destination_country])){\r\n\t\t\t\t\tif($dps_threshold_value[$destination_country]>0){\r\n\t\t\t\t\t\tif($price[$seller_id]['totalp_price']>$dps_threshold_value[$destination_country]){\r\n\t\t\t\t\t\t\t$price[$seller_id]['state_rates']=0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n \r\n }\r\n }\r\n\r\n if ( !empty( $price ) ) {\r\n foreach ( $price as $s_id => $value ) {\r\n $amount = $amount + ( ( isset( $value['addition_price'] ) ? array_sum( $value['addition_price'] ) : 0 ) + ( isset( $value['qty'] ) ? array_sum( $value['qty'] ) : 0 ) +$value['add_product'] + ( isset($value['state_rates']) ? $value['state_rates'] : 0 ) );\r\n\t\t\t\t\r\n\t\t\t\tif($baseshippingprice){\r\n\t\t\t\t\t$amount+=( isset($value['default']) ? $value['default'] : 0 );\r\n\t\t\t\t}\r\n }\r\n }\r\n\t\t$warehouseship=warehouse_shipping( $products, $destination_country);\r\n\t\t\r\n return $amount+$warehouseship;\r\n }",
"public function setStatusDelivery($param) {\n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS_DELIVERY', $param['new_status']);\n $CB16PEDIDO->save(); \n }\n }",
"function bill_transition_placed_pending($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n\n $productiondata = produce_prepay($bill);\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n\n // Notify end user.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n // Feedback customer with mail confirmation.\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->billItems),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid, 'view' => 'bill', 'billid' => $bill->id, 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Delayed Transaction Activating Operations on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'PENDING';\n $bill->save(true);\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}",
"function vendor_enqueue() {\r\n \r\n\twp_enqueue_script( 'my_custom_script', plugins_url('js/vendor_shipping.js', __FILE__));\r\n\twp_enqueue_style( 'custom_wp_admin_css', plugins_url('css/style.css', __FILE__) );\r\n}",
"public function getShipviacd()\n {\n return $this->shipviacd;\n }",
"public function createShipment() {\n\t\t// create a Shipment object\n\t\ttry {\n\t\t $this->Shipment = new Ship\\Shipment( $this->shipmentData ); \n\t\t}\n\t\t// catch any exceptions \n\t\tcatch(\\Exception $e) {\n\t\t exit( WC_Shipping_Labels_Error( $e->getMessage() ) ); \n\t\t}\n\t}",
"public function savePostAction() {\n $isNeedCreateLabel = '';\n try {\n $updateOrderId = $this->getRequest ()->getParam ( 'order_id' );\n /**\n * Get marketplace commission details\n */\n $collection = Mage::getModel ( 'marketplace/commission' )->getCollection ()->addFieldToFilter ( 'seller_id', Mage::getSingleton ( 'customer/session' )->getId () )->addFieldToFilter ( 'order_id', $updateOrderId )->getFirstItem ();\n /**\n * Checking manage order enable for seller\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Checking for seller order management enable or not\n */\n if (count ( $collection ) <= 0 || $orderStatusFlag != 1) {\n $this->_getSession ()->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n return;\n }\n /**\n * Get shipment info\n */\n $data = $this->getRequest ()->getParam ( 'shipment' );\n $shipment = $this->_initShipment ();\n if (! $shipment) {\n $this->_forward ( 'noRoute' );\n return;\n }\n /**\n * Register shipment\n */\n $shipment->register ();\n $comment = '';\n if (! empty ( $data ['comment_text'] )) {\n $shipment->addComment ( $data ['comment_text'], isset ( $data ['comment_customer_notify'] ), isset ( $data ['is_visible_on_front'] ) );\n if (isset ( $data ['comment_customer_notify'] )) {\n $comment = $data ['comment_text'];\n }\n }\n $shipment->setEmailSent ( true );\n /**\n * Set customer notify.\n */\n $shipment->getOrder ()->setCustomerNoteNotify ( true );\n $responseAjax = new Varien_Object ();\n $isNeedCreateLabel = isset ( $data ['create_shipping_label'] ) && $data ['create_shipping_label'];\n if ($isNeedCreateLabel && $this->_createShippingLabel ( $shipment )) {\n $responseAjax->setOk ( true );\n }\n /**\n * Save shipment\n */\n $this->_saveShipment ( $shipment );\n\n /**\n * Send shipment email\n */\n $shipment->sendEmail ( true, $comment );\n /**\n * Initilize shipment label\n */\n $shipmentCreatedMessage = $this->__ ( 'The shipment has been created.' );\n $labelCreatedMessage = $this->__ ( 'The shipping label has been created.' );\n $savedQtys = $this->_getItemQtys ();\n Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $savedQtys, $updateOrderId, 0 );\n $this->_getSession ()->addSuccess ( $isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage : $shipmentCreatedMessage );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Thorugh the exception error message.\n */\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( $e->getMessage () );\n } else {\n /**\n * When error occured, redirect to the view order page.\n */\n $this->_getSession ()->addError ( $e->getMessage () );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n } catch ( Exception $e ) {\n Mage::logException ( $e );\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( /**\n * Through error when create shipping label.\n */\n Mage::helper ( 'sales' )->__ ( 'An error occurred while creating shipping label.' ) );\n } else {\n $this->_getSession ()->addError ( $this->__ ( 'Cannot save shipment.' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }\n if ($isNeedCreateLabel) {\n $this->getResponse ()->setBody ( $responseAjax->toJson () );\n } else {\n /**\n * Redirect to the view order page.\n */\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }",
"protected function setShipment(array $value)\n {\n $this->shipment = $value;\n }",
"function action_woocommerce_order_item_meta_start( $item_name, $item, $order ) { \r\n\t\r\n\t$product_id = $item['product_id'];\r\n\t$_enable_warehouse=get_metadata('post',$product_id,'_enable_warehouse',true);\r\n\tif($_enable_warehouse==1) \r\n\treturn $item_name.' (shipped by warehouse) ';\r\n\telse return $item_name;\r\n\t\r\n\t\r\n}",
"public function getShippingAmount();",
"public function getNotShippedOrders(){\n\n $resource = $this->_productFactory->create()->getResource();\n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n [\"main_table\"=>$resource->getTable('ves_vendor_sales_order')],\n ['*']\n )->join(\n [\n 'order_grid'=>$resource->getTable('sales_order')],\n 'main_table.order_id = order_grid.entity_id',\n [\n 'is_virtual'\n ]\n )->join(\n [\n 'order_item'=>$resource->getTable('sales_order_item')],\n 'main_table.entity_id=order_item.vendor_order_id',\n [\n 'is_virtual',\n 'locked_do_ship',\n 'parent_item_id',\n ]\n )->where(\n 'main_table.vendor_id = :vendor_id'\n )->where(\n 'order_grid.is_virtual = 0'\n )->where(\n 'order_item.locked_do_ship IS NULL'\n )->where(\n 'order_item.is_virtual = 0'\n )\n ->where(\n 'order_item.parent_item_id IS NULL'\n )->where(\n '(order_item.qty_ordered - order_item.qty_shipped - order_item.qty_refunded - order_item.qty_canceled) >= 1'\n )->group('main_table.order_id');\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n\n $total = $connection->fetchALL($select,$bind);\n\n return count($total);\n }",
"private function setSoldIndividually() {\n $this->product->set_sold_individually($this->wcData->isSoldIndividually());\n }",
"public function send_order($order_info,$supplier_info) {\n\t\t$attachments = array();\n\t\t$attachments = apply_filters('wc_dropship_manager_send_order_attachments',$attachments,$order_info,$supplier_info); // create a pdf packing slip file\n\t\t$options = get_option( 'wc_dropship_manager' );\n\t\t$text = '';\n\n\t\t$hdrs = array();\n\t\t$hdrs['From'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['To'] = $supplier_info['order_email_addresses'].','.get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['CC'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['Subject'] = 'New Order #'.$order_info['id'].' From '.get_option( 'woocommerce_email_from_name' );\n\t\t$hdrs['Content-Type'] = 'multipart/mixed';\n\t\tif (strlen($supplier_info['account_number']) > 0)\n\t\t{\n\t\t\t$text .= get_option( 'woocommerce_email_from_name' ).' account number: '.$supplier_info['account_number'].'<br/>';\n\t\t}\n\t\t$text = $this->get_packingslip_html($order_info,$supplier_info);\n\t\t$text = $options['email_order_note'] . $text;\n\t\t$html = apply_filters('wc_dropship_manager_send_order_email_html',$text);\n\n\t\t // Filters for the email\n\t\tadd_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tadd_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tadd_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t\twp_mail( $hdrs['To'], $hdrs['Subject'], $html, $hdrs, $attachments );\n\n\t\t// Unhook filters\n\t\tremove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tremove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tremove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t}",
"function smarty_function_shipping($params, $template)\r\n{\t\r\n\tglobal $config;\r\n\tglobal $order;\t\t\r\n\t\t\r\n\tApp::uses('SmartyComponent', 'Controller/Component');\r\n\t\t$Smarty = new SmartyComponent(new ComponentCollection());\r\n\r\n\tApp::import('Model', 'ShippingMethod');\r\n\t\t$ShippingMethod = new ShippingMethod();\r\n\r\n\t// Get the shipping method \r\n\t$shipping = $ShippingMethod->read(null,$order['Order']['shipping_method_id']);\r\n\t\r\n\t$assignments = array('shipping_alias' => $shipping['ShippingMethod']['code']);\r\n\r\n\t$display_template = $Smarty->load_template($params,'shipping');\t\r\n\t$Smarty->display($display_template,$assignments);\r\n\t\r\n}",
"function wdts_check_number_of_shipments() {\n\t$option = wdts_option();\n\t$max = intval( trim( $option['shipments_per_day'] ) );\n\n\tif ( $max < 1 ) {\n\t\twp_send_json_success();\n\t}\n\n\tif ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'check-shipping' ) || empty( $_POST['date'] ) ) {\n\t\twp_send_json_error( array(\n\t\t\t'message' => __( 'Invalid request', 'woocommerce' ),\n\t\t\t'type' => 'invalid',\n\t\t) );\n\t}\n\n\t$report = wdts_get_shipping_report();\n\t$date = date( 'd-m-Y', strtotime( $_POST['date'] ) );\n\n\tif ( isset( $report[ $date ] ) && $max <= $report[ $date ] ) {\n\t\t$message = $option['notification_exceeded_shipments'] ? $option['notification_exceeded_shipments'] : __( 'You cannot request shipping on this day!', 'woocommerce' );\n\t\twp_send_json_error( array(\n\t\t\t'message' => $message,\n\t\t\t'type' => 'exceed',\n\t\t) );\n\t\t\n\t}\n\telse {\n\t\t$num = isset( $report[ $date ] ) ? absint( $report[ $date ] ) : 0;\n\t\t$num += 1;\n\t\t$report[ $date ] = $num;\n\t\t// Delete shipping days less than today\n\t\t$report = wdts_delete_past_dates( $report );\n\t\t// Save report\n\t\twdts_update_shipping_report( $report );\n\t\twp_send_json_success();\n\t}\n}",
"public function create_shipment(Request $request){\n \t// dd($request->all());\n \t$order_id = $request->input('order_id');\n \t$create_label_quantity = $request->input('create_label_quantity');\n \t$create_label_type = $request->input('create_label_type');\n\n \t// dd($order_id);\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', '1');\n\t\t\n\t\t$soapClient = new \\SoapClient(asset('assets/aramex/').'/shipping-services-api-wsdl.wsdl');\n\t\t// echo '<pre>';\n\t\t// print_r($soapClient->__getFunctions());\n\n\t\t$obj_get_order = $this->BaseModel->with('get_customer_details')\n\t\t\t\t\t\t\t\t\t\t ->with(['get_order_details'=>function($q){\n\t\t\t\t\t\t\t\t\t\t \t$q->with('get_combination_details');\n\t\t\t\t\t\t\t\t\t\t }])\n\t\t\t\t\t\t\t\t\t\t ->where('id',$order_id)->first();\n\t\t// dd($obj_get_order->toArray());\n\n\t\tif($obj_get_order){\n\t\t\t$arr_data = $obj_get_order->toArray();\n\n\t\t\t$total_weight = 1;\n\t\t\t$weight = 0;\n\t\t\tif($arr_data['get_order_details']){\n\n\t\t\t\tforeach ($arr_data['get_order_details'] as $key => $value) {\n\t\t\t\t\t# code...\n\t\t\t\t\t$total_weight = $weight + $value['get_combination_details']['weight'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$params = array(\n\t\t\t\t'Shipments' => array(\t \n\t\t\t\t\t'Shipment' => array(\n\t\t\t\t\t\t\t'Shipper'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'Reference1' \t=> 'Ref 111111',\n\t\t\t\t\t\t\t\t\t\t\t// 'Reference2' \t=> 'Ref 222222',\n\t\t\t\t\t\t\t\t\t\t\t'AccountNumber' => '60500178',\n\t\t\t\t\t\t\t\t\t\t\t'PartyAddress'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Line1'\t\t\t\t\t=> 'Airport Road, King Khalid International Airport, ',\n\t\t\t\t\t\t\t\t\t\t\t\t'Line2' \t\t\t\t=> 'Riyadh, 13463,',\n\t\t\t\t\t\t\t\t\t\t\t\t'Line3' \t\t\t\t=> 'SAUDI ARABIA',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'City'\t\t\t\t\t=> 'Amman',\n\t\t\t\t\t\t\t\t\t\t\t\t'City'\t\t\t\t\t=> 'RUH',\n\t\t\t\t\t\t\t\t\t\t\t\t'StateOrProvinceCode'\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PostCode'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CountryCode'\t\t\t=> 'Jo'\n\t\t\t\t\t\t\t\t\t\t\t\t'CountryCode'\t\t\t=> 'SA'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'Contact'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Department'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PersonName'\t\t\t=> 'Printplus Team',\n\t\t\t\t\t\t\t\t\t\t\t\t'Title'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CompanyName'\t\t\t=> 'Printplus',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1'\t\t\t=> '5555555',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1Ext'\t\t=> '125',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1Ext'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2Ext'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'FaxNumber'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CellPhone'\t\t\t\t=> '07777777',\n\t\t\t\t\t\t\t\t\t\t\t\t'EmailAddress'\t\t\t=> '[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type'\t\t\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'Consignee'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'Reference1'\t=> 'Ref 333333',\n\t\t\t\t\t\t\t\t\t\t\t// 'Reference2'\t=> 'Ref 444444',\n\t\t\t\t\t\t\t\t\t\t\t'AccountNumber' => '',\n\t\t\t\t\t\t\t\t\t\t\t'PartyAddress'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Line1'\t\t\t\t\t=> $arr_data['get_customer_details']['address'],\n\t\t\t\t\t\t\t\t\t\t\t\t'Line2'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'Line3'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'City'\t\t\t\t\t=> 'Dubai',\n\t\t\t\t\t\t\t\t\t\t\t\t'StateOrProvinceCode'\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PostCode'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CountryCode'\t\t\t=> 'AE'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'Contact'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Department'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PersonName'\t\t\t=> $arr_data['get_customer_details']['full_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t'Title'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CompanyName'\t\t\t=> $arr_data['get_customer_details']['full_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1'\t\t\t=> '6666666',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1Ext'\t\t=> '155',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1'\t\t\t=> $arr_data['get_customer_details']['mobile_number'],\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1Ext'\t\t=> $arr_data['get_customer_details']['country_code_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2Ext'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'FaxNumber'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CellPhone'\t\t\t\t=> $arr_data['get_customer_details']['country_code_id'].'-'.$arr_data['get_customer_details']['mobile_number'],\n\t\t\t\t\t\t\t\t\t\t\t\t'EmailAddress'\t\t\t=> $arr_data['get_customer_details']['email'],\n\t\t\t\t\t\t\t\t\t\t\t\t'Type'\t\t\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// 'ThirdParty' => array(\n\t\t\t\t\t\t\t// \t\t\t\t'Reference1' \t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t'Reference2' \t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t'AccountNumber' => '',\n\t\t\t\t\t\t\t// \t\t\t\t'PartyAddress'\t=> array(\n\t\t\t\t\t\t\t// \t\t\t\t\t'Line1'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Line2'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Line3'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'City'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'StateOrProvinceCode'\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PostCode'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'CountryCode'\t\t\t=> ''\n\t\t\t\t\t\t\t// \t\t\t\t),\n\t\t\t\t\t\t\t// \t\t\t\t'Contact'\t\t=> array(\n\t\t\t\t\t\t\t// \t\t\t\t\t'Department'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PersonName'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Title'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'CompanyName'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber1'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber1Ext'\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber2'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber2Ext'\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'FaxNumber'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'CellPhone'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'EmailAddress'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Type'\t\t\t\t\t=> ''\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// \t\t\t\t),\n\t\t\t\t\t\t\t// ),\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// 'Reference1' \t\t\t\t=> 'Shpt 0001',\n\t\t\t\t\t\t\t'Reference1' \t\t\t\t=> '',\n\t\t\t\t\t\t\t'Reference2' \t\t\t\t=> '',\n\t\t\t\t\t\t\t'Reference3' \t\t\t\t=> '',\n\t\t\t\t\t\t\t// 'ForeignHAWB'\t\t\t\t=> 'ORDERID '.$arr_data['order_id'],\n\t\t\t\t\t\t\t'ForeignHAWB'\t\t\t\t=> 'AWB12321132dd2',\n\t\t\t\t\t\t\t'TransportType'\t\t\t\t=> 0,\n\t\t\t\t\t\t\t'ShippingDateTime' \t\t\t=> time(),\n\t\t\t\t\t\t\t'DueDate'\t\t\t\t\t=> time(),\n\t\t\t\t\t\t\t'PickupLocation'\t\t\t=> 'Reception',\n\t\t\t\t\t\t\t'PickupGUID'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// 'Comments'\t\t\t\t\t=> 'Shpt 0001',\n\t\t\t\t\t\t\t'Comments'\t\t\t\t\t=> 'Please handle the package with care',\n\t\t\t\t\t\t\t'AccountingInstrcutions' \t=> '',\n\t\t\t\t\t\t\t'OperationsInstructions'\t=> '',\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'Details' => array(\n\t\t\t\t\t\t\t\t\t\t\t// 'Dimensions' => array(\n\t\t\t\t\t\t\t\t\t\t\t// \t'Length'\t\t\t\t=> 10,\n\t\t\t\t\t\t\t\t\t\t\t// \t'Width'\t\t\t\t\t=> 10,\n\t\t\t\t\t\t\t\t\t\t\t// \t'Height'\t\t\t\t=> 10,\n\t\t\t\t\t\t\t\t\t\t\t// \t'Unit'\t\t\t\t\t=> 'cm',\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t// ),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'ActualWeight' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> $total_weight,\n\t\t\t\t\t\t\t\t\t\t\t\t'Unit'\t\t\t\t\t=> 'Kg'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'ProductGroup' \t\t\t=> 'EXP',\n\t\t\t\t\t\t\t\t\t\t\t'ProductType'\t\t\t=> 'PDX',\n\t\t\t\t\t\t\t\t\t\t\t'PaymentType'\t\t\t=> 'P',\n\t\t\t\t\t\t\t\t\t\t\t'PaymentOptions' \t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t'Services'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t// 'NumberOfPieces'\t\t=> sizeof($arr_data['get_order_details']),\n\t\t\t\t\t\t\t\t\t\t\t'NumberOfPieces'\t\t=> $create_label_quantity,\n\t\t\t\t\t\t\t\t\t\t\t'DescriptionOfGoods' \t=> 'Printlus Cards',\n\t\t\t\t\t\t\t\t\t\t\t'GoodsOriginCountry' \t=> 'SA',\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CashOnDeliveryAmount' \t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'InsuranceAmount'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CollectAmount'\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CashAdditionalAmount'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CashAdditionalAmountDescription' => '',\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CustomsValueAmount' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'Items' \t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t\n\t\t\t\t'ClientInfo' \t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountCountryCode'\t=> 'JO',\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountEntity'\t\t \t=> 'AMM',\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountNumber'\t\t \t=> '20016',\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountPin'\t\t \t=> '221321',\n\t\t\t\t\t\t\t\t\t\t\t// 'UserName'\t\t\t \t=> '[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t// 'Password'\t\t\t \t=> '123456789',\n\t\t\t\t\t\t\t\t\t\t\t// 'Version'\t\t\t \t=> '1.0'\n\t\t\t\t\t\t\t\t\t\t\t'AccountCountryCode' => 'SA',\n\t\t 'AccountEntity' => 'RUH',\n\t\t 'AccountNumber' => '60500178',\n\t\t 'AccountPin' => '165165',\n\t\t 'UserName' => '[email protected]',\n\t\t 'Password' => 'Pr1nt$@11$22$',\n\t\t 'Version' => 'v1'\n\t\t\t\t\t\t\t\t\t\t),\n\n\t\t\t\t// 'Transaction' \t\t\t=> array(\n\t\t\t\t// \t\t\t\t\t\t\t'Reference1'\t\t\t=> '001',\n\t\t\t\t// \t\t\t\t\t\t\t'Reference2'\t\t\t=> '', \n\t\t\t\t// \t\t\t\t\t\t\t'Reference3'\t\t\t=> '', \n\t\t\t\t// \t\t\t\t\t\t\t'Reference4'\t\t\t=> '', \n\t\t\t\t// \t\t\t\t\t\t\t'Reference5'\t\t\t=> '',\t\t\t\t\t\t\t\t\t\n\t\t\t\t//\t\t\t\t\t\t ),\n\t\t\t\t'LabelInfo'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'ReportID' \t\t\t\t=> 9201,\n\t\t\t\t\t\t\t\t\t\t\t'ReportType'\t\t\t=> 'URL',\n\t\t\t\t),\n\t\t);\n\t\t\n\t\t// $params['Shipments']['Shipment']['Details']['Items'][] = array(\n\t\t// \t'PackageType' \t=> 'Box',\n\t\t// \t'Quantity'\t\t=> 12,\n\t\t// \t'Weight'\t\t=> array(\n\t\t// \t\t\t'Value'\t\t=> 0.75,\n\t\t// \t\t\t'Unit'\t\t=> 'Kg',\t\t\n\t\t// \t),\n\t\t// \t'Comments'\t\t=> 'Please handle the package with careasas',\n\t\t// \t'Reference'\t\t=> ''\n\t\t// );\n\t\t\n\t\t// print_r($params);\n\t\t\n\t\ttry {\n\t\t\t$auth_call = $soapClient->CreateShipments($params);\n\t\t\t// echo '<pre>';\n\t\t\t// print_r($auth_call);\n\t\t\t// dd($auth_call);\n\t\t\tif($auth_call->HasErrors==false){\n\t\t\t\t$arr_create_shipment = [];\n\n\t\t\t\t$arr_create_shipment['order_id'] = $order_id;\n\t\t\t\t$arr_create_shipment['shipment_id'] = $auth_call->Shipments->ProcessedShipment->ID;\n\t\t\t\t$arr_create_shipment['ForeignHAWB'] = $auth_call->Shipments->ProcessedShipment->ForeignHAWB;\n\t\t\t\t$arr_create_shipment['LabelURL'] \t\t = $auth_call->Shipments->ProcessedShipment->ShipmentLabel->LabelURL;\n\t\t\t\t$arr_create_shipment['LabelFileContents'] = $auth_call->Shipments->ProcessedShipment->ShipmentLabel->LabelFileContents;\n\n\t\t\t\t$obj_create = $this->OrdersShipmentAramexModel->create($arr_create_shipment);\n\n\t\t\t\tif($obj_create){\n\t\t\t\t\t$obj_update = $this->BaseModel->where('id',$order_id)->update(['create_shipment'=>'1']);\n\t\t\t\t}\n\t\t\t\tSession::flash('success', 'Shipment created successfully.');\n\t\t\t\treturn redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id));\n\t\t\t}else{\n\t\t\t\tSession::flash('error', 'Something went wrong.');\n\t\t\t\treturn redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id));\n\t\t\t}\n\t\t\tdie();\n\t\t} catch (\\SoapFault $fault) {\n\t\t\t// die('Error : ' . $fault->faultstring);\n\t\t\t// dd(2);\n\n\t\t\tSession::flash('error', 'Something went wrong.');\n\t\t\treturn redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id));\n\t\t}\n }",
"public function setCanShipPartially($flag);",
"public function change_purse( $request ) {\n $params = $request->get_params();\n\n $customer_orders = get_posts( array(\n 'numberposts' => 1,\n 'meta_key' => '_customer_user',\n 'meta_value' => get_current_user_id(),\n 'post_type' => wc_get_order_types(),\n 'post_status' => 'wc-processing',\n 'order' => 'DESC'\n ) );\n\n if (!isset($customer_orders[0])) {\n return new WP_REST_Response([\n 'message' => 'No order with \"processing\" status found',\n 'status' => '400'\n ], 400);\n }\n\n $post_order = $customer_orders[0];\n $order = new WC_Order($post_order->ID);\n $items = $order->get_items();\n $product = null;\n\n foreach ($items as $item) {\n $data = $item->get_data();\n $product = wc_get_product($data['product_id']);\n $product_type = $product->get_type();\n\n if ($product_type == 'variable') {\n $variation = wc_get_product($data['variation_id']);\n $order->remove_item($item->get_id());\n $order->save(); // reduce_order_stock reduce stock from order saved in memory\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n\n wc_update_product_stock($variation->get_id(), $variation->get_stock_quantity() + 1);\n $variation->save();\n break;\n }\n $product = null;\n }\n\n if (!$product) {\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n }\n\n $product_data = $new_product->get_data();\n $product_attributes = $new_product->get_variation_attributes();\n\n return new WP_REST_Response([\n 'id' => $new_product->get_id(),\n 'price' => $product_data['price'],\n 'name' => $product_data['name'],\n 'short_description' => $product_data['short_description'],\n 'sku' => $product_data['sku'],\n 'images' => $this->get_images($new_product),\n 'colors' => isset($product_attributes['pa_colors']) ? $product_attributes['pa_colors'] : false,\n 'sizes' => isset($product_attributes['pa_sizes']) ? $product_attributes['pa_sizes'] : false,\n ], 200);\n\n }",
"public function postShipping(Request $request) {\n $cart = new Carts();\n $mycart = $cart->getCustomerCarts(Auth::guard('web')->user()->id);\n $name = $request->fname;\n $mycart->$name = $request->fvalue;\n $mycart->save();\n return response()->json([\n 'success' => '1',\n 'message' => 'Item save'\n ]);\n }"
] | [
"0.7959721",
"0.7912997",
"0.77393174",
"0.751726",
"0.6772215",
"0.6620744",
"0.6525505",
"0.65024745",
"0.62676543",
"0.6247491",
"0.62368566",
"0.61315304",
"0.5972473",
"0.59707576",
"0.59047747",
"0.5851072",
"0.58155936",
"0.5804312",
"0.57994425",
"0.5790574",
"0.5753458",
"0.574666",
"0.5744895",
"0.5720085",
"0.56902164",
"0.56754065",
"0.56743646",
"0.56709534",
"0.5649276",
"0.56173563",
"0.56150717",
"0.56108755",
"0.5587835",
"0.5584711",
"0.5564174",
"0.55518174",
"0.55496955",
"0.55426157",
"0.55042684",
"0.5494336",
"0.54922056",
"0.5491611",
"0.5487795",
"0.54849213",
"0.547701",
"0.5476686",
"0.5470381",
"0.54656327",
"0.54651505",
"0.546433",
"0.54621255",
"0.54574406",
"0.54488534",
"0.5445605",
"0.5440567",
"0.54404986",
"0.5436979",
"0.543169",
"0.5431288",
"0.54272187",
"0.5424266",
"0.5389496",
"0.53875846",
"0.537578",
"0.5371486",
"0.53703886",
"0.5360208",
"0.53504217",
"0.5345976",
"0.53146696",
"0.53070444",
"0.5301368",
"0.52968156",
"0.5289504",
"0.52887076",
"0.5286672",
"0.528529",
"0.5273868",
"0.5269028",
"0.52601373",
"0.52543133",
"0.5235838",
"0.5235756",
"0.52294105",
"0.522918",
"0.5225861",
"0.52244484",
"0.5205924",
"0.52050257",
"0.51998806",
"0.51980895",
"0.5197418",
"0.51969016",
"0.51943386",
"0.518853",
"0.51863104",
"0.5185378",
"0.5177756",
"0.5176163",
"0.51743793"
] | 0.60532016 | 12 |
Mark WC Vendors order as Shipped | function wcfm_wcvendors_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$product_id = $_POST['productid'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order = wc_get_order( $order_id );
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$vendors = WCV_Vendors::get_vendors_from_order( $order );
$vendor_ids = array_keys( $vendors );
if ( !in_array( $user_id, $vendor_ids ) ) {
_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );
die;
}
$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
// If not in the shippers array mark as shipped otherwise do nothing.
if( !in_array($user_id, $shippers)) {
$shippers[] = $user_id;
//$mails = $woocommerce->mailer()->get_emails();
//if ( !empty( $mails ) ) {
// $mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );
//}
//do_action('wcvendors_vendor_ship', $order_id, $user_id);
_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );
} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {
unset( $shippers[$key] ); // Remove user from the shippers array
}
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class="wcfm_dashboard_item_title" target="_blank" href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
update_post_meta( $order_id, 'wc_pv_shipped', $shippers );
} else {
$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function setShippingValues(Order $order): void;",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"public function notify_warehouse( $order ) {\n\t\t$order_info = $this->get_order_info($order);\n\t\t$supplier_codes = $order_info['suppliers'];\n\t\t// for each supplier code, loop and send email with product info\n\t\tforeach($supplier_codes as $code => $supplier_info) {\n\t\t\tdo_action('wc_dropship_manager_send_order',$order_info,$supplier_info);\n\t\t}\n\t}",
"function plgVmConfirmedOrder (VirtueMartCart $cart, $order) {\n\n\t\tif (!($method = $this->getVmPluginMethod ($order['details']['BT']->virtuemart_shipmentmethod_id))) {\n\t\t\treturn NULL; // Another method was selected, do nothing\n\t\t}\n\t\tif (!$this->selectedThisElement ($method->shipment_element)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\t$values['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;\n\t\t$values['order_number'] = $order['details']['BT']->order_number;\n\t\t$values['virtuemart_shipmentmethod_id'] = $order['details']['BT']->virtuemart_shipmentmethod_id;\n\t\t$values['shipment_name'] = $this->renderPluginName ($method);\n\t\t$values['order_weight'] = $this->getOrderWeight ($cart, $method->weight_unit);\n\t\t$values['shipment_weight_unit'] = $method->weight_unit;\n\n\t\t$costs = $this->getCosts($cart,$method,$cart->cartPrices);\n\t\tif(empty($costs)){\n\t\t\t$values['shipment_cost'] = 0;\n\t\t\t$values['shipment_package_fee'] = 0;\n\t\t} else {\n\t\t\t$values['shipment_cost'] = $method->shipment_cost;\n\t\t\t$values['shipment_package_fee'] = $method->package_fee;\n\t\t}\n\n\t\t$values['tax_id'] = $method->tax_id;\n\t\t$this->storePSPluginInternalData ($values);\n\n\t\treturn TRUE;\n\t}",
"public function adminSalesOrderCreateProcessDataBefore($observer)\n {\n if(Mage::getStoreConfig('carriers/shipper/active')) {\n $post = $observer->getRequestModel()->getPost();\n if(isset($post['order'])) {\n $data = $post['order'];\n\n $found = false;\n $customCarrierGroupData = array();\n $carriergroupId = isset($data['carriergroup_id']) ? $data['carriergroup_id'] : '';\n if (isset($data['shipping_amount'])) {\n $customCarrierGroupData[$carriergroupId] = array('customPrice' => $data['shipping_amount'], 'carriergroup' => $carriergroupId);\n $found = true;\n }\n\n if (isset($data['shipping_description'])) {\n if(array_key_exists($carriergroupId, $customCarrierGroupData)) {\n $shipArray = $customCarrierGroupData[$carriergroupId];\n $shipArray['customCarrier'] = $data['shipping_description'];\n $customCarrierGroupData[$carriergroupId] = $shipArray;\n }\n else {\n $customCarrierGroupData[$carriergroupId] = array('customCarrier' => $data['shipping_description'], 'carriergroup' => $carriergroupId);\n }\n $found = true;\n }\n\n if ($found) {\n $shippingAddress = $observer->getSession()->getQuote()->getShippingAddress();\n Mage::helper('shipperhq_shipper')->cleanDownRatesCollection($shippingAddress, 'shipperadmin', '');\n Mage::register('shqadminship_data', new Varien_Object($customCarrierGroupData));\n $storedLimitCarrier = $shippingAddress->getLimitCarrier();\n $shippingAddress->setLimitCarrier('shipperadmin');\n $rateFound = $shippingAddress->requestShippingRates();\n $shippingAddress->setLimitCarrier($storedLimitCarrier);\n } else {\n Mage::unregister('shqadminship_data');\n }\n }\n }\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"public function testUpdateExternalShipment()\n {\n }",
"function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"public function store(Request $request){\n $verEnvio = \\DB::table('orders')->where('order_id', $request->id_recipies)->first();\n if($verEnvio->status == 1){\n $shipping = new Shipping();\n $shipping->id_user = $request->delivery;\n $shipping->id_recipie = $request->id_recipies;\n $shipping->recipient_name = \"\";\n $shipping->save();\n \\DB::Table('orders')->where('order_id', $request->id_recipies)->update([\n \"status\"=> 2\n ]);\n }\n return ['result' => 'success'];\n }",
"public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }",
"public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }",
"protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }",
"public function orderUpdate()\n {\n $this->helper->logOrder('Beginning Order Update.');\n $stores = $this->storeManager->getStores();\n\n $enabledStores = [];\n\n foreach ($stores as $store) {\n if ($store->isActive() && $this->helper->isEnabled($store->getId())) {\n $enabledStores[] = $store->getId();\n }\n }\n\n if ($enabledStores) {\n $ordersToProcess = null;\n\n $ordersToProcess = $this->orderCollectionFactory\n ->create()\n ->addFieldToSelect('*')\n ->addFieldToFilter(\n 'store_id',\n [\n 'in' => [$enabledStores],\n ]\n )\n ->addFieldToFilter(\n 'state',\n [\n 'in' => [\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_PROCESSING,\n ],\n ]\n )\n ->addFieldToFilter('fulfilled_by_amazon', true)\n ->addFieldToFilter(\n 'amazon_order_status',\n [\n 'in' => [\n $this->helper::ORDER_STATUS_RECEIVED,\n $this->helper::ORDER_STATUS_PLANNING,\n $this->helper::ORDER_STATUS_PROCESSING,\n ],\n ]\n );\n\n if (!empty($ordersToProcess) && $ordersToProcess->count()) {\n $this->helper->logOrder('Beginning Order Update for ' . $ordersToProcess->count() . ' orders.');\n\n foreach ($ordersToProcess as $order) {\n $this->helper->logOrder('Updating order #' . $order->getIncrementId());\n\n $result = $this->outbound->getFulfillmentOrder($order);\n if ($result) {\n $fulfillmentOrderResult = $result->getGetFulfillmentOrderResult();\n\n // Amazon Statuses: RECEIVED / INVALID / PLANNING / PROCESSING / CANCELLED / COMPLETE\n // / COMPLETE_PARTIALLED / UNFULFILLABLE\n $amazonStatus = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getFulfillmentOrderStatus();\n\n $amazonOrderId = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getDisplayableOrderId();\n\n $id = $order->getIncrementId();\n if ($order->getIncrementId() == $amazonOrderId) {\n $this->helper->logOrder(\n 'Status of order #' . $order->getIncrementId() . ': ' . $amazonStatus\n );\n\n if ($amazonStatus) {\n switch ($amazonStatus) {\n case 'COMPLETE':\n case 'COMPLETE_PARTIALLED':\n $this->magentoOrderUpdate($order, $fulfillmentOrderResult);\n break;\n case 'INVALID':\n case 'CANCELLED':\n case 'UNFULFILLABLE':\n $this->cancelFBAShipment($order, $fulfillmentOrderResult);\n break;\n }\n }\n }\n }\n }\n\n $this->helper->logOrder(__('Get Order status called. Orders to process: ') . $ordersToProcess->count());\n } else {\n $this->helper->logOrder(__('Get Order status called. No orders to process'));\n }\n }\n }",
"public function setQuantityShippedAttribute($input)\n {\n $this->attributes['quantity_shipped'] = $input ? $input : null;\n }",
"function action_woocommerce_order_status_changed( $this_get_id, $this_status_transition_from, $this_status_transition_to, $instance ) {\n $options = get_option( 'dhl_parcel_options' );\n\n $dbh = new Database_Handler();\n $status = str_replace(\"wc-\", \"\", strtolower($options['ppoc_order_state_to_create_shipping_label ']) );\n $dhl_client = new DhlClient();\n if (!$dhl_client->isDHLParcelShipment($this_get_id)) { return; }\n $label = $dbh->get_labels_by_order_id($this_get_id,false);\n\n if( strcmp($status, $this_status_transition_to)==0 && !count($label)){\n //Reference incase its order_id and did not enter on the \"Edit order\" page.\n if ($options['ppoc_reference_field'] == \"order_id\"){\n if(!get_post_meta( $this_get_id, '_reference_field', true )){\n update_post_meta( $this_get_id, '_reference_field', $this_get_id );\n }\n }\n\n $json = $dhl_client->createDhlLabel($this_get_id);\n $json = get_object_vars($json);\n $tracking_code = $json['trackerCode'];\n $dbh->insert_labels($json['labelId'],false,$this_get_id,$tracking_code);\n\n if($options['ppoc_create_return_label']){\n $json = $dhl_client->createDhlReturnLabel($this_get_id);\n $json = get_object_vars($json);\n $tracking_code = $json['trackerCode'];\n $dbh->insert_labels($json['labelId'],true,$this_get_id,$tracking_code);\n }\n $dhl_client->createPickUpRequest($this_get_id);\n }\n\n}",
"public function estimated_shipping() {\n\n\t\t$this->api_record_event( $this->event_name['estimated_shipping'] );\n\t}",
"public function change_purse( $request ) {\n $params = $request->get_params();\n\n $customer_orders = get_posts( array(\n 'numberposts' => 1,\n 'meta_key' => '_customer_user',\n 'meta_value' => get_current_user_id(),\n 'post_type' => wc_get_order_types(),\n 'post_status' => 'wc-processing',\n 'order' => 'DESC'\n ) );\n\n if (!isset($customer_orders[0])) {\n return new WP_REST_Response([\n 'message' => 'No order with \"processing\" status found',\n 'status' => '400'\n ], 400);\n }\n\n $post_order = $customer_orders[0];\n $order = new WC_Order($post_order->ID);\n $items = $order->get_items();\n $product = null;\n\n foreach ($items as $item) {\n $data = $item->get_data();\n $product = wc_get_product($data['product_id']);\n $product_type = $product->get_type();\n\n if ($product_type == 'variable') {\n $variation = wc_get_product($data['variation_id']);\n $order->remove_item($item->get_id());\n $order->save(); // reduce_order_stock reduce stock from order saved in memory\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n\n wc_update_product_stock($variation->get_id(), $variation->get_stock_quantity() + 1);\n $variation->save();\n break;\n }\n $product = null;\n }\n\n if (!$product) {\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n }\n\n $product_data = $new_product->get_data();\n $product_attributes = $new_product->get_variation_attributes();\n\n return new WP_REST_Response([\n 'id' => $new_product->get_id(),\n 'price' => $product_data['price'],\n 'name' => $product_data['name'],\n 'short_description' => $product_data['short_description'],\n 'sku' => $product_data['sku'],\n 'images' => $this->get_images($new_product),\n 'colors' => isset($product_attributes['pa_colors']) ? $product_attributes['pa_colors'] : false,\n 'sizes' => isset($product_attributes['pa_sizes']) ? $product_attributes['pa_sizes'] : false,\n ], 200);\n\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function ship($parcel)\n {\n return TRUE;\n }",
"public function isAutoShipping(): bool;",
"public function send_order($order_id)\n {\n // Return if barcode exists\n if (get_post_meta($order_id, 'barcode', true)) {\n return;\n }\n\n $order = wc_get_order($order_id);\n\n // Return if the city is out of area\n $billing_info = $order->get_data()['billing'];\n if (!in_array(ucwords(sanitize_text_field($billing_info['city'])), $this->business_area)) {\n return;\n }\n\n $billing_info = array_map(function ($v) {\n return sanitize_text_field($v);\n }, $billing_info);\n\n // The short description of order items\n $description = [];\n foreach ($order->get_items() as $k => $item) {\n $product = $item->get_product_id();\n $description[] = get_the_excerpt($product);\n }\n $description = sanitize_text_field(implode(\"\\n\", $description));\n\n $info = $this->format_fields([\n 'createdBy' => null,\n 'type' => 'package',\n 'status' => 'in_warehouse',\n 'collectType' => 'pickup',\n 'collectedBy' => null,\n 'description' => $description,\n 'note' => $order->get_customer_note(),\n 'from' => $this->get_store_info_value('blogname'),\n 'fromAddress1' => $this->get_store_info_value('woocommerce_store_address'),\n 'fromAddress2' => $this->get_store_info_value('woocommerce_store_address_2'),\n 'fromCity' => $this->get_store_info_value('woocommerce_store_city'),\n 'fromPostCode' => $this->get_store_info_value('woocommerce_store_postcode'),\n 'fromTel' => $this->get_store_info_value('phone'),\n 'fromEmail' => $this->get_store_info_value('email'),\n 'to' => $billing_info['first_name'] . ' ' . $billing_info['last_name'],\n 'toAddress1' => $billing_info['address_1'],\n 'toAddress2' => $billing_info['address_2'],\n 'toCity' => $billing_info['city'],\n 'toPostCode' => $billing_info['postcode'],\n 'toTel' => $billing_info['phone'],\n 'toEmail' => $billing_info['email'],\n 'verified' => true,\n 'tomatoProduceId' => $order_id,\n ]);\n\n $curl = curl_init(TOMATOGO_URL);\n curl_setopt_array($curl, [\n CURLOPT_HEADER => false,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTPHEADER => ['Content-Type: application/json'],\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => json_encode($info),\n ]);\n $res = json_decode(curl_exec($curl));\n\n curl_close($curl);\n\n $barcode = sanitize_text_field($res->barcode);\n if ($barcode) {\n update_post_meta($order_id, 'barcode', $barcode);\n }\n }",
"public function send_order($order_info,$supplier_info) {\n\t\t$attachments = array();\n\t\t$attachments = apply_filters('wc_dropship_manager_send_order_attachments',$attachments,$order_info,$supplier_info); // create a pdf packing slip file\n\t\t$options = get_option( 'wc_dropship_manager' );\n\t\t$text = '';\n\n\t\t$hdrs = array();\n\t\t$hdrs['From'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['To'] = $supplier_info['order_email_addresses'].','.get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['CC'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['Subject'] = 'New Order #'.$order_info['id'].' From '.get_option( 'woocommerce_email_from_name' );\n\t\t$hdrs['Content-Type'] = 'multipart/mixed';\n\t\tif (strlen($supplier_info['account_number']) > 0)\n\t\t{\n\t\t\t$text .= get_option( 'woocommerce_email_from_name' ).' account number: '.$supplier_info['account_number'].'<br/>';\n\t\t}\n\t\t$text = $this->get_packingslip_html($order_info,$supplier_info);\n\t\t$text = $options['email_order_note'] . $text;\n\t\t$html = apply_filters('wc_dropship_manager_send_order_email_html',$text);\n\n\t\t // Filters for the email\n\t\tadd_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tadd_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tadd_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t\twp_mail( $hdrs['To'], $hdrs['Subject'], $html, $hdrs, $attachments );\n\n\t\t// Unhook filters\n\t\tremove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tremove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tremove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t}",
"public function shipping_tab() {\n global $wpdb, $post;\n\n $vendor_id = $post->post_author;\n\n $shipping_zone = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT locations.zone_id, locations.seller_id, locations.location_type as vendor_location_type, locations.location_code as vendor_location_code, wc_zones.location_code, wc_zones.location_type FROM {$wpdb->prefix}dokan_shipping_zone_locations as locations INNER JOIN {$wpdb->prefix}woocommerce_shipping_zone_locations as wc_zones ON locations.zone_id = wc_zones.zone_id INNER JOIN {$wpdb->prefix}dokan_shipping_zone_methods as dokan_methods ON dokan_methods.zone_id = locations.zone_id AND dokan_methods.seller_id = locations.seller_id WHERE locations.seller_id =%d AND locations.location_type != 'postcode' ORDER BY wc_zones.zone_id ASC\", $vendor_id\n ), ARRAY_A\n );\n\n $_overwrite_shipping = get_post_meta( $post->ID, '_overwrite_shipping', true );\n $dps_processing = get_user_meta( $vendor_id, '_dps_pt', true );\n $from = get_user_meta( $vendor_id, '_dps_form_location', true );\n $dps_country_rates = get_user_meta( $vendor_id, '_dps_country_rates', true );\n $shipping_policy = get_user_meta( $vendor_id, '_dps_ship_policy', true );\n $refund_policy = get_user_meta( $vendor_id, '_dps_refund_policy', true );\n $product_processing_time = get_post_meta( $post->ID, '_dps_processing_time', true );\n $processing_time = $dps_processing;\n\n if ( 'yes' === $_overwrite_shipping ) {\n $processing_time = ( $product_processing_time ) ? $product_processing_time : $dps_processing;\n }\n\n $country_obj = new WC_Countries();\n $countries = $country_obj->countries;\n $states = $country_obj->states;\n\n $shipping_countries = '';\n $shipping_states = '';\n $location_code = '';\n $check_countries = array();\n $check_states = array();\n\n if ( $shipping_zone ) {\n foreach ( $shipping_zone as $zone ) {\n $location_code = $zone['vendor_location_code'];\n\n if ( $zone['vendor_location_type'] === 'state' ) {\n $location_codes = explode( ':', $location_code );\n $country_code = isset( $location_codes[0] ) ? $location_codes[0] : '';\n $state_code = isset( $location_codes[1] ) ? $location_codes[1] : '';\n\n if ( isset( $states[ $country_code ][ $state_code ] ) && isset( $countries[ $country_code ] ) && ! in_array( $states[ $country_code ][ $state_code ], $check_states, true ) ) {\n $get_state_name = $states[ $country_code ][ $state_code ];\n\n $check_states[ $get_state_name ] = $get_state_name;\n $shipping_states .= $get_state_name . ' (' . $countries[ $country_code ] . '), ';\n }\n }\n\n if ( $zone['vendor_location_type'] === 'country' && $countries[ $location_code ] && ! in_array( $countries[ $location_code ], $check_countries, true ) ) {\n $location_code = $countries[ $location_code ];\n $check_countries[ $location_code ] = $location_code;\n $shipping_countries .= $location_code . ', ';\n }\n }\n }\n ?>\n\n <?php if ( $shipping_countries ) { ?>\n <p>\n <?php esc_html_e( 'Shipping Countries', 'dokan' ); ?>:\n <strong><?php echo rtrim( $shipping_countries, ', ' ); ?></strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $shipping_states ) { ?>\n <p>\n <?php esc_html_e( 'Shipping States', 'dokan' ); ?>:\n <strong><?php echo rtrim( $shipping_states, ', ' ); ?></strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $processing_time ) { ?>\n <p>\n <strong>\n <?php esc_html_e( 'Ready to ship in', 'dokan' ); ?> <?php echo dokan_get_processing_time_value( $processing_time ); ?>\n\n <?php\n if ( $from ) {\n echo __( 'from', 'dokan' ) . ' ' . $countries[ $from ];\n }\n ?>\n </strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $shipping_policy ) { ?>\n <p> </p>\n <strong><?php esc_html_e( 'Shipping Policy', 'dokan' ); ?></strong>\n <hr>\n <?php echo wpautop( $shipping_policy ); ?>\n <?php } ?>\n\n <?php if ( $refund_policy ) { ?>\n <hr>\n <p> </p>\n <strong><?php esc_html_e( 'Refund Policy', 'dokan' ); ?></strong>\n <hr>\n <?php echo wpautop( $refund_policy ); ?>\n <?php } ?>\n <?php\n }",
"public function sendStatusUpdateNotifications(OrderEvent $event)\n {\n $order = $event->getOrder();\n switch ($order->getStatus()) {\n\n case Order::STATUS_AWAITING_SEPA:\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_AWAITING_SEPA,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_NEW:\n // get payment\n $payment = $order->getPayments()->first();\n\n // is transport\n $isTransport = true;\n if (Shipping::TYPE_NOT_SHIPPED === $order->getShippingType()) {\n $isTransport = false;\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'invoiceUrl' => $this->router->generate('order_invoice_download', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $payment->getChargeId(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'expectedDeliveryDate' => null !== $order->getExpectedDeliveryDate() ? $order->getExpectedDeliveryDate()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'shippingLimitDate' => null !== $order->getShouldBeReadyAt() ? $order->getShouldBeReadyAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') . ' avant 17h' : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_CANCELED:\n // order has been canceled by the customer\n if (OrderEvent::ORIGIN_CUSTOMER === $event->getOrigin()) {\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n case Order::STATUS_TRANSIT:\n\n // get shipment\n $shipments = $order->getShipments();\n /** @var Shipment $shipment */\n $shipment = $shipments[0];\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'trackingUrl' => $shipment->getTrackingUrl(),\n 'trackingNumber' => $shipment->getParcelNumber(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_SHIPPED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_READY_FOR_PICKUP:\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_READY_FOR_PICKUP,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_REFUNDED:\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // get order refund id\n $refundId = 'n/a';\n $refunds = $order->getRefunds();\n if (0 < count($refunds)) {\n /** @var Refund $refund */\n $refund = $refunds[0];\n $refundId = $refund->getRefundId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'refundId' => $refundId,\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_REFUNDED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_DELIVERED:\n\n // send customer e-mail\n /* There is no longer any immediate notification sending when the order is delivered. The notification is made on D + 1 via the reminder system\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n //'ratingUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL) . '#rating'\n 'ratingUrl' => $this->router->generate('order_rating', array('token' => $order->getToken()), $this->router::ABSOLUTE_URL) . '#rating'\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATING,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n */\n break;\n\n case Order::STATUS_CLOSED:\n\n if ($order->getRating()->getEnabled() == True ) {\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderRateValue' => $order->getRating()->getRate(),\n 'orderRateValue' => $order->getRating()->getComment(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATE,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n\n\n\n case Order::STATUS_FILE_AVAILABLE:\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_AVAILABLE_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_REJECTED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_REJECTED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_VALIDATED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'BoolTransport' => $order->getQuotation()->getProject()->getType()->isShipping(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_VALIDATED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n }\n }",
"function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }",
"public function successAfter($observer) {\r\n $sellerDefaultCountry = '';\r\n $nationalShippingPrice = $internationalShippingPrice = 0;\r\n $orderIds = $observer->getEvent()->getOrderIds();\r\n $order = Mage::getModel('sales/order')->load($orderIds [0]);\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $getCustomerId = $customer->getId();\r\n $grandTotal = $order->getGrandTotal();\r\n $status = $order->getStatus();\r\n $itemCount = 0;\r\n $shippingCountryId = '';\r\n $items = $order->getAllItems();\r\n $orderEmailData = array();\r\n foreach ($items as $item) {\r\n\r\n $getProductId = $item->getProductId();\r\n $createdAt = $item->getCreatedAt();\r\n $is_buyer_confirmation_date = '0000-00-00 00:00:00';\r\n $paymentMethodCode = $order->getPayment()->getMethodInstance()->getCode();\r\n $products = Mage::helper('marketplace/marketplace')->getProductInfo($getProductId);\r\n $products_new = Mage::getModel('catalog/product')->load($item->getProductId());\r\n if($products_new->getTypeId() == \"configurable\")\r\n {\r\n $options = $item->getProductOptions() ;\r\n\r\n $sku = $options['simple_sku'] ;\r\n $getProductId = Mage::getModel('catalog/product')->getIdBySku($sku);\r\n }\r\n else{\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n\r\n\r\n $sellerId = $products->getSellerId();\r\n $productType = $products->getTypeID();\r\n /**\r\n * Get the shipping active status of seller\r\n */\r\n $sellerShippingEnabled = Mage::getStoreConfig('carriers/apptha/active');\r\n if ($sellerShippingEnabled == 1 && $productType == 'simple') {\r\n /**\r\n * Get the product national shipping price\r\n * and international shipping price\r\n * and shipping country\r\n */\r\n $nationalShippingPrice = $products->getNationalShippingPrice();\r\n $internationalShippingPrice = $products->getInternationalShippingPrice();\r\n $sellerDefaultCountry = $products->getDefaultCountry();\r\n $shippingCountryId = $order->getShippingAddress()->getCountry();\r\n }\r\n /**\r\n * Check seller id has been set\r\n */\r\n if ($sellerId) {\r\n $orderPrice = $item->getBasePrice() * $item->getQtyOrdered();\r\n $productAmt = $item->getBasePrice();\r\n $productQty = $item->getQtyOrdered();\r\n if ($paymentMethodCode == 'paypaladaptive') {\r\n $credited = 1;\r\n } else {\r\n $credited = 0;\r\n }\r\n\r\n /* check for checking if payment method is credit card or cash on delivery and if method\r\n is cash on delivery then it will check if the order status of previous orders are complete or not\r\n no need to disable sending email from admin*/\r\n\r\n /*-----------------Adding Failed Delivery Value--------------------------*/\r\n Mage::helper('progos_ordersedit')->getFailedDeliveryStatus($order);\r\n /*----------------------------------------------------------------------*/\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n $is_buyer_confirmation = 'No';\r\n $is_buyer_confirmation_date = $createdAt;\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n /*\r\n * Elabelz-2057\r\n */\r\n /*$product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();*/\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"):\r\n $counter = $counter + 1;\r\n endif;\r\n }\r\n if ($counter != 0) {\r\n $is_buyer_confirmation = 'Yes';\r\n $is_buyer_confirmation_yes = \"Accepted\";\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n $product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } else {\r\n $is_buyer_confirmation = 'No';\r\n $item_order_status = 'pending';\r\n $tel = $order->getBillingAddress()->getTelephone();\r\n $nexmoActivated = Mage::getStoreConfig('marketplace/nexmo/nexmo_activated');\r\n $nexmoStores = Mage::getStoreConfig('marketplace/nexmo/nexmo_stores');\r\n $nexmoStores = explode(',', $nexmoStores);\r\n $currentStore = Mage::app()->getStore()->getCode();\r\n #check nexmo sms module is active or not and check on which store its enabled\r\n $reservedOrderId = $order->getIncrementId();\r\n $mdlEmapi = Mage::getModel('restmob/quote_index');\r\n $id = $mdlEmapi->getIdByReserveId($reservedOrderId);\r\n if ($nexmoActivated == 1 && in_array($currentStore, $nexmoStores) && !$id) {\r\n # code...\r\n $data = Mage::helper('marketplace/marketplace')->sendVerify($tel);\r\n $data = $data['request_id'];\r\n\r\n }\r\n //$data = 0;\r\n\r\n }\r\n }\r\n\r\n\r\n // $orderPriceToCalculateCommision = $products_new->getPrice() * $item->getQtyOrdered();\r\n $shippingPrice = Mage::helper('marketplace/market')->getShippingPrice($sellerDefaultCountry, $shippingCountryId, $orderPrice, $nationalShippingPrice, $internationalShippingPrice, $productQty);\r\n /**\r\n * Getting seller commission percent\r\n */\r\n $sellerCollection = Mage::helper('marketplace/marketplace')->getSellerCollection($sellerId);\r\n $percentperproduct = $sellerCollection ['commission'];\r\n $commissionFee = $orderPrice * ($percentperproduct / 100);\r\n\r\n // Product price after deducting\r\n // $productAmt = $products_new->getPrice() - $commissionFee;\r\n\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n\r\n if($item->getProductType() == 'simple')\r\n {\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n /**\r\n * Storing commission information in database table\r\n */\r\n\r\n if ($commissionFee > 0 || $sellerAmount > 0) {\r\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($getProductId);\r\n $parent_product = Mage::getModel('catalog/product')->load($parentIds[0]);\r\n\r\n if ($parent_product->getSpecialPrice()) {\r\n $orderPrice_sp = $parent_product->getSpecialPrice() * $item->getQtyOrdered();\r\n $orderPrice_base = $parent_product->getPrice() * $item->getQtyOrdered();\r\n\r\n $commissionFee = $orderPrice_sp * ($percentperproduct / 100);\r\n $sellerAmount = $orderPrice_sp - $commissionFee;\r\n } else {\r\n $orderPrice_base = $item->getBasePrice() * $item->getQtyOrdered();\r\n $commissionFee = $orderPrice_base * ($percentperproduct / 100);\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n }\r\n\r\n $commissionDataArr = array(\r\n 'seller_id' => $sellerId,\r\n 'product_id' => $getProductId,\r\n 'product_qty' => $productQty,\r\n 'product_amt' => $productAmt,\r\n 'commission_fee' => $commissionFee,\r\n 'seller_amount' => $sellerAmount,\r\n 'order_id' => $order->getId(),\r\n 'increment_id' => $order->getIncrementId(),\r\n 'order_total' => $grandTotal,\r\n 'order_status' => $status,\r\n 'credited' => $credited,\r\n 'customer_id' => $getCustomerId,\r\n 'status' => 1,\r\n 'created_at' => $createdAt,\r\n 'payment_method' => $paymentMethodCode,\r\n 'item_order_status' => $item_order_status,\r\n 'is_buyer_confirmation' => $is_buyer_confirmation,\r\n 'sms_verify_code' => $data,\r\n 'is_buyer_confirmation_date'=> $is_buyer_confirmation_date,\r\n 'is_seller_confirmation_date'=> '0000-00-00 00:00:00',\r\n 'shipped_from_elabelz_date'=> '0000-00-00 00:00:00',\r\n 'successful_non_refundable_date'=> '0000-00-00 00:00:00',\r\n 'commission_percentage' => $sellerCollection ['commission']\r\n );\r\n\r\n $commissionId = $this->storeCommissionData($commissionDataArr);\r\n $orderEmailData [$itemCount] ['seller_id'] = $sellerId;\r\n $orderEmailData [$itemCount] ['product_qty'] = $productQty;\r\n $orderEmailData [$itemCount] ['product_id'] = $getProductId;\r\n $orderEmailData [$itemCount] ['product_amt'] = $productAmt;\r\n $orderEmailData [$itemCount] ['commission_fee'] = $commissionFee;\r\n $orderEmailData [$itemCount] ['seller_amount'] = $sellerAmount;\r\n $orderEmailData [$itemCount] ['increment_id'] = $order->getIncrementId();\r\n $orderEmailData [$itemCount] ['customer_firstname'] = $order->getCustomerFirstname();\r\n $orderEmailData [$itemCount] ['customer_email'] = $order->getCustomerEmail();\r\n $orderEmailData [$itemCount] ['product_id_simple'] = $getProductId;\r\n $orderEmailData [$itemCount] ['is_buyer_confirmation'] = $is_buyer_confirmation_yes;\r\n $orderEmailData [$itemCount] ['itemCount'] = $itemCount;\r\n $itemCount = $itemCount + 1;\r\n }\r\n }\r\n // if ($paymentMethodCode == 'paypaladaptive') {\r\n // $this->updateCommissionPA($commissionId);\r\n // }\r\n }\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n /*if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n $this->sendOrderEmail($orderEmailData);\r\n }*/\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"){\r\n $counter = $counter + 1;\r\n }\r\n }\r\n if ($counter != 0) {\r\n if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n\r\n $this->sendOrderEmail($orderEmailData);\r\n }\r\n }\r\n }\r\n\r\n //$this->enqueueDataToFareye($observer);\r\n\r\n }",
"public function email($order, $type) {\r\n\r\n switch ($type) {\r\n case 'shipping_confirmation':\r\n if ($order['status'] == 'shipped' && !empty($order['shipping_tracking_number'])) {\r\n // Send Shipping Confirmation email to customer\r\n $templateId = config('custom.emails.templates.shipping_confirmation');\r\n\r\n if (!empty($order['user_id'])) {\r\n $user = $order->user;\r\n }\r\n\r\n $sub = [\r\n 'customer_name' => !empty($order['user_id']) ? $user['first_name'] : $order['billing_name'],\r\n 'order_number' => $order['order_number'],\r\n 'shipping_carrier' => !empty($order['shipping_carrier']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.name') : '',\r\n 'shipping_plan' => !empty($order['shipping_plan']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.plans.' . $order['shipping_plan'] . '.plan') : '',\r\n 'tracking_url' => 'https://tools.usps.com/go/TrackConfirmAction?tLabels=' . $order['shipping_tracking_number'],\r\n 'tracking_number' => $order['shipping_tracking_number'],\r\n 'delivery_address' => [\r\n 'name' => $order['delivery_name'],\r\n 'phone' => $order['delivery_phone'],\r\n 'address_1' => $order['delivery_address_1'],\r\n 'address_2' => $order['delivery_address_2'],\r\n 'city' => $order['delivery_city'],\r\n 'state' => $order['delivery_state'],\r\n 'zipcode' => $order['delivery_zipcode']\r\n ]\r\n ];\r\n\r\n foreach ($order->inventoryItems as $item) {\r\n $tmp = [\r\n 'name' => $item->product['name'],\r\n 'url' => route('shop.product', [$item->product['uri'], $item->product['id']]),\r\n 'unit_price' => number_format($item->pivot['price'], 2),\r\n 'quantity' => $item->pivot['quantity'],\r\n 'price' => number_format($item->pivot['price'] * $item->pivot['quantity'], 2)\r\n ];\r\n\r\n if ($item->options()->count() > 0) {\r\n $tmp['options'] = [];\r\n\r\n foreach ($item->options()->get() as $option) {\r\n $tmp['options'][] = [\r\n 'attribute' => $option->attribute['name'],\r\n 'value' => $option['name']\r\n ];\r\n }\r\n }\r\n\r\n if ($item->product->defaultPhoto()->count() > 0) {\r\n $tmp['image'] = CustomHelper::image($item->product->defaultPhoto['name'], true);\r\n }\r\n\r\n $sub['items'][] = $tmp;\r\n }\r\n\r\n $recipients = [\r\n [\r\n 'address' => !empty($order['contact_email']) ? $order['contact_email'] : $user['email'],\r\n 'name' => $sub['customer_name'],\r\n 'substitution_data' => $sub\r\n ]\r\n ];\r\n\r\n SparkPostHelper::sendTemplate($templateId, $recipients);\r\n\r\n return back()->with('alert-success', 'You have successfully sent a Shipping Confirmation email to the customer.');\r\n } else {\r\n return back()->with('alert-danger', 'You need to change the status to Shipped and add a Tracking Number first in order to send this Shipping Confirmation email to the customer.');\r\n }\r\n\r\n break;\r\n }\r\n }",
"function setShipping($ship_key)\n {\n return 4.50;\n }",
"public function salesOrderShipmentSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n \n if (!$settings['shipment_notification_message']) {\n return;\n }\n $order = $observer->getEvent()->getShipment()->getOrder();\n \n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_id = $order->getIncrementId();\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n $shipment = $order->getShipmentsCollection()->getFirstItem();\n $shipId = $shipment->getIncrementId();\n\n // Check if a telephone number has been specified\n if(in_array('shippment', $final_array)){\n if ($telephoneNumber) {\n // Send the shipment notification to the specified telephone number\n $text = $settings['shipment_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{shipmentno}}', $shipId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n // Display a success or error message\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The shipment notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the shipment notification SMS.');\n }\n }\n } \n}",
"function add_shippify_order_action_button( $actions, $the_order ) {\n\n // esto me dio error en algunas ordenes... \n if (in_array(\"shippify\", get_post_meta( $the_order->id, '_shipping_method', true )) && (get_post_meta( $the_order->id, '_is_dispatched', true ) != 'yes') && !isset($_GET['post_status'])){ \n $actions['shippify_action'] = array(\n 'url' => wp_nonce_url( admin_url( 'edit.php?post_type=shop_order&myaction=woocommerce_shippify_dispatch&stablishedorder=' . $the_order->id ), 'woocommerce-shippify-dispatch'), \n 'name' => __( 'Dispatch', 'woocommerce-shippify' ),\n 'action' => \"view shippify\", // setting \"view\" for proper button CSS.\n );\n }\n return $actions;\n }",
"public function order_processing( $order_id ) {\n\t\t$order = new WC_Order( $order_id ); // load the order from woocommerce\n\t\t$this->notify_warehouse($order); // notify the warehouse to ship the order\n\t}",
"public function sendOrder(Mage_Sales_Model_Order $order)\n {\n try{\n\t\t\t$this->_eventType = 'placeOrder';\n\t\t\t$amount\t\t= number_format($order->getGrandTotal(),2);\n\t\t\t$samount\t= number_format($order->getSubtotal(),2);\n\t\t\t$tax \t\t= number_format($order->getBaseTaxAmount(),2);\n\t\t\t$shipping \t= number_format($order->getBaseShippingAmount(),2);\n\t\t\t$discounts \t= number_format($order->getDiscountAmount(),2);\n\t\t\t$shippingAddressData \t= $order->getShippingAddress()->getData();\n\t\t\t$billingAddressData \t= $order->getBillingAddress()->getData();\n\t\t\t$shippingMethod \t \t= $order->_data[\"shipping_description\"];\n\t\t\t$paymentMethod \t \t \t= $order->getPayment()->getMethodInstance()->getTitle();\n\t\t\t$customerId \t\t\t= $order->getCustomerId();\n\t\t\t$websiteId \t\t\t\t= 1;\n\t\t\t$balanceModel \t\t\t= Mage::getModel('enterprise_customerbalance/balance')\n\t\t \t\t\t\t \t->setCustomerId($customerId)\n\t\t \t\t\t\t \t->setWebsiteId($websiteId)\n\t\t \t\t\t\t\t->loadByCustomer();\t\n\t\t $storeCredit\t\t\t= ($balanceModel->getId())? number_format($balanceModel->getAmount(),2) :'0' ; \t\t\t\t\t\t\n $data = array(\n 'email' => $order->getCustomerEmail(),\n 'items' => $this->_getItems($order->getAllVisibleItems()),\n 'adjustments' => $this->_getAdjustments($order),\n 'message_id' => $this->getMessageId(),\n 'send_template' => 'Purchase Receipt',\n 'tenders' => $this->_getTenders($order),\n 'vars'\t=> array ( 'order#'=> $order->getIncrementId(),\n\t\t\t\t\t\t\t\t\t'subtotal'=> $samount,\n\t\t\t\t\t\t\t\t\t'shipping_and_handling'=> $shipping,\n\t\t\t\t\t\t\t\t\t'sale_tax'=> $tax,\n\t\t\t\t\t\t\t\t\t'billing_address'=> $shippingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_address'=> $billingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_method'=> $shippingMethod,\n\t\t\t\t\t\t\t\t\t'payment_method'=> $paymentMethod,\n\t\t\t\t\t\t\t\t\t'store_credit' => $storeCredit\n\t\t\t ),\n \t);\n /**\n * Send order data to purchase API\n */\n $responsePurchase = $this->apiPost('purchase', $data);\n\t\t\t\n\t\t\t/****Update product sku in following items for price alert****/\n $productSku = array();\n\t\t\tforeach ($order->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n $sailthru_userdata = $this->apiGet('user', array('id' => $order->getCustomerEmail()));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items']) && $productSku) {\n\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t$sailthru_followingItems = array_values($sailthru_followingItems);\n\t\t\t\t$sailthru_followingItems = array_diff($sailthru_followingItems,$productSku);\n\t\t\t\t$sailthru_followingItems = array_unique($sailthru_followingItems);\n\t\t\t\t$data = array(\n\t\t\t\t\t\t\"id\" => $order->getCustomerEmail(),\n\t\t\t\t\t\t\"vars\" => array(\"following_items\" => $sailthru_followingItems)\n\t\t\t\t\t\t);\n\t\t\t\t$response = $this->apiPost('user', $data);\n\t\t\t}\n /*************************************************/\n\t\t\t\n /**\n * Send customer data to user API\n */\n //$responseUser = Mage::getModel('sailthruemail/client_user')->sendCustomerData($customer);\n }catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }",
"public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n if (\"0\" == $this->scopeConfig->getValue('pickrr_magento2/general/automatic_shipment_enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE))\n return NULL;\n\n $order = $observer->getEvent()->getOrder();\n $payment = $order->getPayment();\n\n if($payment->getMethod() == \"cashondelivery\")\n $cod_amount = $order->getGrandTotal();\n else\n $cod_amount = 0.0;\n\n if ($order->getState() != Order::STATE_NEW && $order->getState() != Order::STATE_PENDING_PAYMENT )\n return NULL;\n\n $auth_token = $this->scopeConfig->getValue('pickrr_magento2/general/auth_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $pickup_time = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/pickup_time', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_name = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_name', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_phone_number = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_phone_number', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_pincode = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_pincode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_address = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_address', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $this->helper->createOrderShipment($auth_token, $order, $from_name, $from_phone_number, $from_pincode, $from_address, $pickup_time, $cod_amount);\n }",
"public function onCheckoutCartEstimatePost($observer)\n {\n $quote = Mage::helper('shipperhq_shipper')->getQuote();\n $quote->setIsMultiShipping(false);\n $shipping = $quote->getShippingAddress();\n $shipping->setIsCheckout(0);\n $shipping->save();\n }",
"public function update(Request $request, $id)\n {\n //\n $order = Order::find($id);\n\n if($request->shipped){\n $order->shipped = true;\n }\n\n if($request->unshipped){\n $order->shipped = false;\n }\n\n $order->save();\n\n toastr()->success('Item updated successfully.!');\n return redirect()->route('admin.orders.index');\n\n }",
"private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }",
"public function calculateQtyToShip();",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"public function updateBuyOrderStatusAndCreatePosition()\n {\n $orders = $this->orderService->getOpenBuyOrders();\n\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>updateBuyOrderStatusAndCreatePosition</info>';\n foreach ($orders as $order) {\n /** @var \\GDAX\\Types\\Response\\Authenticated\\Order $gdaxOrder */\n $gdaxOrder = $this->gdaxService->getOrder($order['order_id']);\n // Mocken\n\n $position_id = 0;\n $status = $gdaxOrder->getStatus();\n\n if ($status) {\n if ($status == 'done') {\n $position_id = $this->positionService->open($gdaxOrder->getId(), $gdaxOrder->getSize(), $gdaxOrder->getPrice());\n $this->msg[] = $this->timestamp . ' .... <info>Opend position</info>';\n }\n\n $this->orderService->updateOrderStatus($order['id'], $gdaxOrder->getStatus(), $position_id);\n } else {\n $this->orderService->updateOrderStatus($order['id'], $gdaxOrder->getMessage(), $position_id);\n }\n }\n }\n }",
"private function shipping_batch()\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// find the most recent unprocessed shipments\n\t\t$query = ee()->sync_db->where('processed !=', '1')->order_by('id', 'asc')->get('orders_shipping', 200);\n\n\t\t// create arrays for shipment ids and tracking numbers\n\t\t$ids_processed = array();\n\n\t\t// find our shipped status\n\t\t$status = Store\\Model\\Status::where('name', 'Shipped')->first();\n\n\t\t// load the order_map config file\n\t\tinclude_once dirname(dirname(__FILE__)).'/bmi_custom/config/order_map.php';\n\n\t\t// loop through each shipment\n\t\tforeach($query->result() as $shipment)\n\t\t{\n\t\t\t// add id to the processed array\n\t\t\t$ids_processed[] = $shipment->id;\n\n\t\t\tif(!empty($shipping_carriers[$shipment->carrier]))\n\t\t\t{\n\t\t\t\t$tracking = $shipping_carriers[$shipment->carrier] .'|'. $shipment->tracking_number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tracking = $shipment->tracking_number;\n\t\t\t}\t\n\n\t\t\t// update the status of each order with the tracking numbers\n\t\t\t$order_object = Store\\Model\\Order::find($shipment->order_id);\n\t\t\t$order_object->updateStatus($status, 0, $tracking);\n\n\t\t}\n\n\t\t// update the shipment records to indicate they've been processed\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('orders_shipping');\n\t\t}\t\n\t\t\n\t\t\n\t}",
"public function setShippingInvoiced($shippingInvoiced);",
"function jigoshop_upgrade_146() {\n\t\n\tJigoshop_Base::get_options()->add_option( 'jigoshop_show_checkout_shipping_fields', 'yes' );\n\t\n}",
"function wcfm_order_tracking_response( $item_id, $item, $order ) {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\t\t\r\n\t\t// See if product needs shipping \r\n\t\t$product = $item->get_product(); \r\n\t\t$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product ); \r\n\t\t\r\n\t\tif( $WCFMu->is_marketplace ) {\r\n\t\t\tif( $WCFMu->is_marketplace == 'wcvendors' ) {\r\n\t\t\t\tif( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {\r\n\t\t\t\t\tif( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;\r\n\t\t\t\t}\r\n\t\t\t} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\tglobal $WCMp;\r\n\t\t\t\tif( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( $needs_shipping ) {\r\n\t\t\t$traking_added = false;\r\n\t\t\t$package_received = false;\r\n\t\t\tforeach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {\r\n\t\t\t\tif( $meta->key == 'wcfm_tracking_url' ) {\r\n\t\t\t\t\t$traking_added = true;\r\n\t\t\t\t}\r\n\t\t\t\tif( $meta->key == 'wcfm_mark_as_recived' ) {\r\n\t\t\t\t\t$package_received = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo \"<p>\";\r\n\t\t\tprintf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\tif( $package_received ) {\r\n\t\t\t\tprintf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t} elseif( $traking_added ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"#\" class=\"wcfm_mark_as_recived\" data-orderitemid=\"<?php echo $item_id; ?>\" data-orderid=\"<?php echo $order->get_id(); ?>\" data-productid=\"<?php echo $item->get_product_id(); ?>\"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>\r\n\t\t\t\t<?php\r\n\t\t\t} else {\r\n\t\t\t\tprintf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t}\r\n\t\t\techo \"</p>\";\r\n\t\t}\r\n\t}",
"public function isShipped($id){\n $q = $this->slcOrdrFild(\"shipped\", $id);\n return $this->check($q, \"yes\");\n }",
"protected function setShipment(array $value)\n {\n $this->shipment = $value;\n }",
"public function saveOrder()\n {\n $this->validate();\n $this->_initKlarnaCheckout(false, false);\n\n try {\n if (($merchantCheckboxMethod = $this->_helper->getCheckoutConfig('merchant_checkbox')) != -1) {\n $this->_helper->dispatchMerchantCheckboxMethod(\n $merchantCheckboxMethod, array(\n 'quote' => $this->getQuote(),\n 'klarna_quote' => $this->getKlarnaQuote(),\n 'checked' => (bool)$this->getKlarnaCheckout()->getData('merchant_requested/additional_checkbox')\n )\n );\n }\n\n $checkboxes = $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes');\n if (!empty($checkboxes)) {\n $this->_helper->dispatchMultipleCheckboxesEvent(\n $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes'),\n $this->getQuote(),\n $this->getKlarnaQuote()\n );\n }\n } catch (Mage_Core_Exception $e) {\n Mage::logException($e);\n // Don't stop order from saving just because the checkbox processing failed\n }\n\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n Mage::dispatchEvent(\n 'kco_checkout_save_order_before', array(\n 'checkout' => $this\n )\n );\n\n /**\n * For older versions of Magento state cannot be removed as a requirement\n * for shipping which is necessary in some countries.\n *\n * This checks if the Magento version is below 1.7 and disabled address validation\n */\n if (version_compare(Mage::getVersion(), '1.7.0', '<')) {\n $this->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->getQuote()->isVirtual()) {\n $this->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }\n\n $service = Mage::getModel('sales/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n /** @var Mage_Sales_Model_Order $order */\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent(\n 'checkout_type_kco_save_order_after', array(\n 'order' => $order,\n 'quote' => $this->getQuote()\n )\n );\n\n if ($order->getCanSendNewEmailFlag()) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession\n ->setLastOrderId($order->getId())\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => array())\n );\n\n return $order;\n }",
"function quote($method = '') {\r\n\r\n\t\tglobal $order, $shipping_weight, $shipping_num_boxes, $transittime, $dispinsure, $packing;\r\n\r\n\t\tif ($this->dimensions_support > 0 && is_object($packing)) {\r\n\r\n\t\t\tif ($this->dimensions_support == 1) { // # only ready to ship items are set with dimensions\r\n\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\tif ($boxesToShip[$i]['item_length'] == 0) { // size wasn't set\r\n\t\t\t\t\t\tif ($boxesToShip[$i]['item_weight'] > 60) { // use module estimated dimesions when size not set\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 50) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 40) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 30) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 20) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 10) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 5) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_length'] = $length;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_width'] = $width;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_height'] = $height;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$numBoxes = $packing->getNumberOfBoxes();\r\n\r\n\t\t\tif (SHIPPING_UNIT_LENGTH == 'CM') { // must convert centimeters to inches before getting quote\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\t$boxesToShip[$i]['item_length'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_width'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_height'] *= 0.39370079;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // # The old method. tell us how many boxes plus the box weight\r\n\r\n\t\t\tif ($shipping_weight > 60) { // these are defined in inches and don't need converting\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t} elseif ($shipping_weight > 50) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t} elseif ($shipping_weight > 40) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t} elseif ($shipping_weight > 30) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t} elseif ($shipping_weight > 20) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t} elseif ($shipping_weight > 10) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t} elseif ($shipping_weight > 5) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t} else {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t}\r\n\r\n\t\t\t$package = array('item_weight' => $shipping_weight,\r\n\t\t\t\t'item_price' => round($order->info['subtotal'] / $shipping_num_boxes, 2),\r\n\t\t\t\t'item_length' => $length,\r\n\t\t\t\t'item_width' => $width,\r\n\t\t\t\t'item_height' => $height);\r\n\r\n\t\t\t$boxesToShip = array();\r\n\r\n\t\t\tfor ($i = 0; $i < $shipping_num_boxes; $i++) {\r\n\t\t\t\t$boxesToShip[] = $package;\r\n\t\t\t}\r\n\r\n\t\t\t$totalWeight = round($shipping_weight * $shipping_num_boxes, 2);\r\n\t\t\t$numBoxes = $shipping_num_boxes;\r\n\t\t}\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'KGS') { // # must convert kilograms to pounds before getting quote\r\n\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t$boxesToShip[$i]['item_weight'] *= 2.2046226;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($this->display_weight) {\r\n\t\t\t$shiptitle = sprintf(MODULE_SHIPPING_USPS_TEXT_WEIGHT_DISPLAY, $numBoxes, $totalWeight);\r\n\t\t} else {\r\n\t\t\t$shiptitle = '';\r\n\t\t}\r\n\t\t$this->dest_zip = str_replace(' ', '', $order->delivery['postcode']);\r\n\t\tif ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { // domestic quote\r\n\t\t\t$this->dest_zip = substr($this->dest_zip, 0, 5);\r\n\t\t\t$dmstcquotes = array();\r\n\t\t\tif( $this->display_transit ){\r\n\t\t\t\t$trnstime = $this->_getDmstcTransitTimes();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$error = false;\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getDmstcQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($dmstcquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailavail'] = ($dmstcquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineavail'] = ($dmstcquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($dmstcquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif( (MODULE_SHIPPING_USPS_DMSTC_RATE == 'Internet') && $quote['onlineavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['onlineconf'])) $title .= '<br />---' . $quote['onlineconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} elseif( $quote['retailavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['retailconf'])) $title .= '<br />---' . $quote['retailconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $dmstcquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( sizeof($this->dmstc_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'Domestic',\r\n\t\t\t\t\t'changes' => $this->dmstc_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t} else { // # international quote\r\n\t\t\t$maxinsurance_query = tep_db_query(\"SELECT DISTINCT(max_insurance) FROM USPS_intl_maxins WHERE insurable AND country_code = '\" . tep_db_input($order->delivery['country']['iso_code_2']) . \"' ORDER BY max_insurance\");\r\n\t\t\t$this->intl_maxinsure = array();\r\n\r\n\t\t\twhile ($x = tep_db_fetch_array($maxinsurance_query)) {\r\n\t\t\t\t$this->intl_maxinsure[] = $x['max_insurance'];\r\n\t\t\t}\r\n\r\n\t\t\t$intlquotes = array();\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getIntlQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($intlquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailavail'] = ($intlquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineavail'] = ($intlquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$intlquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($intlquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif ((MODULE_SHIPPING_USPS_INTL_RATE == 'Internet') && $quote['onlineavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t} elseif ($quote['retailavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $intlquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if there's been a change detected, log it..\r\n\t\t\tif( sizeof($this->intl_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'International',\r\n\t\t\t\t\t'changes' => $this->intl_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (is_array($uspsQuote)) {\r\n\t\t\tif (isset($uspsQuote['error'])) {\r\n\t\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'error' => $uspsQuote['error']);\r\n\t\t\t} else {\r\n\t\t\t\t$quotesort = array();\r\n\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t$quotesort[$method['id']] = $method['cost'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $this->shipping_method_sort_direction == 'desc' ){\r\n\t\t\t\t\tarsort($quotesort); // sort methods by cost high to low\r\n\t\t\t\t} else {\r\n\t\t\t\t\tasort($quotesort);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$methods = array();\r\n\t\t\t\tforeach ($quotesort as $key => $cost) {\r\n\t\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t\tif ($method['id'] == $key) $methods[] = $method;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->quotes = array('id' => $this->code,\r\n\t\t\t\t\t'module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'methods' => $methods);\r\n\t\t\t\tif ($this->tax_class > 0) {\r\n\t\t\t\t\t$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // quotes was empty\r\n\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);\r\n\t\t}\r\n\t\tif (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);\r\n\t\t\r\n// \t\tprint_r( $this->quotes );\r\n\t\t\r\n\t\treturn $this->quotes;\r\n\t}",
"function custom_template_single_shipping()\n {\n global $product;\n ?>\n <span class=\"shipping-cs-tag\">\n <span>Shipping:</span>\n <span>Free</span>\n </span>\n <?php\n }",
"public function resolveShippingState(OrderInterface $order);",
"public function place()\n {\n $this->_eventManager->dispatch('sales_order_payment_place_start', ['payment' => $this]);\n $order = $this->getOrder();\n\n $this->setAmountOrdered($order->getTotalDue());\n $this->setBaseAmountOrdered($order->getBaseTotalDue());\n $this->setShippingAmount($order->getShippingAmount());\n $this->setBaseShippingAmount($order->getBaseShippingAmount());\n\n $methodInstance = $this->getMethodInstance();\n $methodInstance->setStore($order->getStoreId());\n\n $orderState = Order::STATE_NEW;\n $orderStatus = $methodInstance->getConfigData('order_status');\n $isCustomerNotified = $order->getCustomerNoteNotify();\n\n // Do order payment validation on payment method level\n $methodInstance->validate();\n $action = $methodInstance->getConfigPaymentAction();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n \n if ($action) {\n if ($methodInstance->isInitializeNeeded()) {\n $stateObject = new DataObject();\n // For method initialization we have to use original config value for payment action\n $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);\n\n if ($paymentMethodCode !== Bitcoin::CODE) {\n $orderState = $stateObject->getData('state') ?: $orderState;\n $orderStatus = $stateObject->getData('status') ?: $orderStatus;\n }\n\n $isCustomerNotified = $stateObject->hasData('is_notified')\n ? $stateObject->getData('is_notified')\n : $isCustomerNotified;\n }\n else {\n $this->processAction($action, $order);\n\n if ($paymentMethodCode !== Bitcoin::CODE){\n $orderState = Order::STATE_PROCESSING;\n $orderState = $order->getState() ? $order->getState() : $orderState;\n $orderStatus = $order->getStatus() ? $order->getStatus() : $orderStatus;\n }\n \n }\n } else {\n $order->setState($orderState)->setStatus($orderStatus);\n }\n\n $isCustomerNotified = $isCustomerNotified ?: $order->getCustomerNoteNotify();\n\n if (!array_key_exists($orderStatus, $order->getConfig()->getStateStatuses($orderState))) {\n $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState);\n }\n\n $this->updateOrder($order, $orderState, $orderStatus, $isCustomerNotified);\n\n $this->_eventManager->dispatch('sales_order_payment_place_end', ['payment' => $this]);\n\n return $this;\n }",
"public function getNotShippedOrders(){\n\n $resource = $this->_productFactory->create()->getResource();\n $connection = $resource->getConnection();\n $select = $connection->select();\n $select->from(\n [\"main_table\"=>$resource->getTable('ves_vendor_sales_order')],\n ['*']\n )->join(\n [\n 'order_grid'=>$resource->getTable('sales_order')],\n 'main_table.order_id = order_grid.entity_id',\n [\n 'is_virtual'\n ]\n )->join(\n [\n 'order_item'=>$resource->getTable('sales_order_item')],\n 'main_table.entity_id=order_item.vendor_order_id',\n [\n 'is_virtual',\n 'locked_do_ship',\n 'parent_item_id',\n ]\n )->where(\n 'main_table.vendor_id = :vendor_id'\n )->where(\n 'order_grid.is_virtual = 0'\n )->where(\n 'order_item.locked_do_ship IS NULL'\n )->where(\n 'order_item.is_virtual = 0'\n )\n ->where(\n 'order_item.parent_item_id IS NULL'\n )->where(\n '(order_item.qty_ordered - order_item.qty_shipped - order_item.qty_refunded - order_item.qty_canceled) >= 1'\n )->group('main_table.order_id');\n $bind = ['vendor_id' => $this->getVendor()->getId()];\n\n $total = $connection->fetchALL($select,$bind);\n\n return count($total);\n }",
"public function saveGlsOrderStatus($observer) {\n $invoice = Mage::registry('current_invoice');\n $order = $invoice->getOrder();\n $glsShipments = Mage::getModel('synergeticagency_gls/shipment')->getCollection();\n $glsShipments->addFieldToFilter('order_id',array('eq' => $order->getId()));\n if($glsShipments->count()) {\n $helper = Mage::helper('synergeticagency_gls');\n $helper->setOrderStatus($order,$helper->__('Order with GLS-Shipment'));\n }\n }",
"function jigoshop_upgrade_120() {\n\n // update orders\n\t$args = array(\n\t\t'post_type'\t => 'shop_order',\n\t\t'numberposts' => -1,\n\t\t'post_status' => 'publish'\n\t);\n\n\t$posts = get_posts( $args );\n\n\tforeach( $posts as $post ) :\n $order_data = get_post_meta($post->ID, 'order_data', true);\n\n if (!empty($order_data['order_tax'])) :\n\n // means someone has posted a manual order. Need to update to new tax string\n if (strpos($order_data['order_tax'], ':') === false) :\n $order_data['order_tax_total'] = $order_data['order_tax'];\n $order_data['order_tax'] = jigoshop_tax::create_custom_tax($order_data['order_total'] - $order_data['order_tax_total'], $order_data['order_tax_total'], $order_data['order_shipping_tax'], $order_data['order_tax_divisor']);\n else :\n $tax_array = get_old_taxes_as_array($order_data['order_tax']);\n $order_data['order_tax'] = jigoshop_tax::array_implode($tax_array);\n endif;\n\n update_post_meta($post->ID, 'order_data', $order_data);\n\n endif;\n\n endforeach;\n \n}",
"function action_woocommerce_before_shipping_zone_object_save( $instance, $this_data_store ) {\n $shipping_methods = $instance->get_shipping_methods();\n foreach($shipping_methods as $shipping_method){\n if( isset($instance->get_changes()['zone_locations']) ){\n update_shipping_rules($shipping_method, $instance->get_changes()['zone_locations'], $instance->get_id());\n }\n\n }\n\n}",
"private function setSoldIndividually() {\n $this->product->set_sold_individually($this->wcData->isSoldIndividually());\n }",
"public function _updateOnHoldAndAvailableQty($product_id,$qtyShipped){\n\t\t$warehouseOr = Mage::getModel('inventoryplus/warehouse_order')->getCollection()\n ->addFieldToFilter('order_id', $this->_orderOb->getId())\n ->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t\t\t->setPageSize(1)\n\t\t\t\t\t\t\t->setCurPage(1)\n ->getFirstItem();\n\t\tif($warehouseOr->getId()){\t\t\t\t\t\n\t\t\t$OnHoldQty = $warehouseOr->getQty() - $qtyShipped;\n\t\t\t$warehouseId = $warehouseOr->getWarehouseId();\n\t\t\tif ($OnHoldQty >= 0) {\n\t\t\t\t$warehouseOr->setQty($OnHoldQty)\n\t\t\t\t\t\t->save();\n\t\t\t} else {\n\t\t\t\t$warehouseOr->setQty(0)\n\t\t\t\t\t\t->save();\n\t\t\t}\n\t\t\t$warehousePr = Mage::getModel('inventoryplus/warehouse_product')->getCollection()\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->addFieldToFilter('product_id', $product_id)\n\t\t\t\t\t\t\t->setPageSize(1)\n\t\t\t\t\t\t\t->setCurPage(1)\n ->getFirstItem();\n\t\t\tif($warehousePr->getId()){\n\t\t\t\t$newAvailQty = $warehousePr->getAvailableQty()\t+ $qtyShipped;\n\t\t\t\t$warehousePr->setAvailableQty($newAvailQty);\n\t\t\t\t$warehousePr->save();\n\t\t\t}\n\t\t}\n\t}",
"public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }",
"public function createTemandoShipment(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $order = $observer->getEvent()->getOrder();\n $shippingAddress = $order->getShippingAddress();\n $deprecateSkus = array();\n\n $shippingMethod = $order->getShippingMethod();\n $titleOptions = $this->_type->toOptionArray();\n $titles = array();\n foreach ($titleOptions as $value => $optionTitle) {\n $titles[$value] = $optionTitle['label'];\n }\n\n $quote = $this->_quoteRepository->get($order->getQuoteId());\n $quoteShippingAddress = $quote->getShippingAddress();\n\n $origin = $this->_originCollection->getOriginByInventory(\n $order->getAllVisibleItems(),\n $quoteShippingAddress->getPostcode()\n );\n //$origin = $this->_originCollection->getOriginByPostcode($quoteShippingAddress->getPostcode());\n $this->_shipment->setData('order_id', $order->getId());\n $this->_shipment->setData('order_increment_id', $order->getIncrementId());\n $this->_shipment->setData('origin_id', $origin->getId());\n\n $orderSkus = $this->_helper->getOrderSkus($order);\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::PENDING;\n\n $exclusiveOD = $this->_helper->orderContainsExclusively($order, \"OD\");\n foreach ($orderSkus as $sku => $details) {\n if ($details['stock_availability_code'] == \"OD\") {\n $hasStock = $origin->hasStock(array($sku => $details['qty']));\n if ($hasStock) {\n $deprecateSkus[$sku] = $details['qty'];\n } elseif ($exclusiveOD) {\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::BACK_ORDER;\n }\n } else {\n $deprecateSkus[$sku] = $details['qty'];\n }\n }\n $this->_shipment->setData('status', $shipmentStatus);\n $this->_shipment->setData('destination_contact_name', $shippingAddress->getName());\n $this->_shipment->setData('destination_company_name', $shippingAddress->getCompany());\n $streetAddress = $shippingAddress->getStreetLine(1);\n if ($shippingAddress->getStreetLine(2)) {\n $streetAddress .= \", \" . $shippingAddress->getStreetLine(2);\n }\n $this->_shipment->setData('destination_street', $streetAddress);\n $this->_shipment->setData('destination_city', $shippingAddress->getCity());\n $this->_shipment->setData('destination_postcode', $shippingAddress->getPostcode());\n $this->_shipment->setData('destination_region', $shippingAddress->getRegion());\n $this->_shipment->setData('destination_country', $shippingAddress->getCountryId());\n $this->_shipment->setData('destination_phone', $shippingAddress->getTelephone());\n $this->_shipment->setData('destination_email', $order->getCustomerEmail());\n\n //set customer selected quote data\n $temandoQuoteData = explode('_', $shippingMethod);\n $temandoQuoteId = $temandoQuoteData[2];\n\n $quoteDescription = '-';\n switch ($temandoQuoteData[2]) {\n default:\n $temandoQuote = $this->_quote->load($temandoQuoteId);\n $carrier = $this->_helper->getCarrierByTemandoId($temandoQuote->getCarrierId());\n $quoteDescription = $carrier->getCompanyName() . ' - ' . $temandoQuote->getDeliveryMethod();\n $totalPrice = $temandoQuote->getTotalPrice();\n break;\n }\n\n $this->_shipment->setData('customer_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('customer_selected_options', $shippingMethod);\n $this->_shipment->setData('customer_selected_quote_description', $quoteDescription);\n $this->_shipment->setData('admin_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('anticipated_cost', $totalPrice);\n\n if ($shippingAddress->getIsBusinessAddress()) {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::BUSINESS\n );\n } else {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::RESIDENTIAL\n );\n }\n\n if ($shippingAddress->getAuthorityToLeave()) {\n $this->_shipment->setData('destination_authority_to_leave', 1);\n } else {\n $this->_shipment->setData('destination_authority_to_leave', 0);\n }\n\n try {\n $this->_shipment->save();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment') . ' ' . $e->getMessage());\n }\n //register the quotes with the shipment\n //$this->registerQuotes($order);\n try {\n $this->_shipment->saveAllItems();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment items') . ' ' . $e->getMessage());\n }\n\n\n //how many boxes required?\n $this->saveBoxes($order);\n\n if ((count($deprecateSkus)) && ($origin->getErpId())) {\n $this->deprecateSkus($origin->getErpId(), $deprecateSkus);\n }\n //$this->_shipment->fetchQuotes();//or update existing quotes to use this shipment\n\n $this->clearSessionData();\n\n return $this->_shipment;\n }",
"public function update(Order $order)\n {\n if ($this->sgOrder->getUpdatePayment()) {\n $order->setIsPaid($this->sgOrder->getIsPaid());\n }\n\n if ($this->sgOrder->getUpdateShipping()) {\n $order->setIsShippingBlocked($this->sgOrder->getIsShippingBlocked());\n }\n }",
"function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}",
"public function setCashOnDelivery($value): void\n {\n $this->cash_on_delivery = $value;\n }",
"public function set_staff_free_order($value)\n {\n $this->staff_free_order = $value;\n if ($this->staff_free_order) {\n foreach ($this->order_configurations as $config) {\n $config->individual_cost = 0;\n $config->calculateSubtotal();\n }\n }\n }",
"public function salesOrderPlaceAfter($observer) {\n \n if (Mage::helper('core')->isModuleEnabled('Magestore_Inventorywarehouse'))\n return;\n if (Mage::registry('INVENTORY_CORE_ORDER_PLACE'))\n return;\n Mage::register('INVENTORY_CORE_ORDER_PLACE', true);\n $order = $observer->getOrder();\n $items = $order->getAllItems();\n $warehouseIds = null;\n $warehouseId = Mage::getModel('inventoryplus/warehouse')->getCollection()->getFirstItem()->getId();\n if (!$warehouseId) {\n Mage::log($observer->getOrder(), null, 'inventory_management.log');\n return;\n }\n foreach ($items as $item) {\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($item->getProductId()); \n $manageStock = $stockItem->getManageStock();\n if($stockItem->getUseConfigManageStock()){\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock',Mage::app()->getStore()->getStoreId()); \n }\n if(!$manageStock){\n continue;\n }\n \n if (in_array($item->getProductType(), array('configurable', 'bundle', 'grouped')))\n continue;\n $qtyOrdered = 0;\n if (!$item->getQtyOrdered() || $item->getQtyOrdered() == 0) {\n if ($item->getParentItemId()) {\n $qtyOrdered = Mage::getModel('sales/order_item')->load($item->getParentItemId())->getQtyOrdered();\n }\n } else {\n $qtyOrdered = $item->getQtyOrdered();\n }\n $warehouseProduct = Mage::getModel('inventoryplus/warehouse_product')->getCollection()\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->addFieldToFilter('product_id', $item->getProductId())\n ->getFirstItem();\n $currentQty = $warehouseProduct->getAvailableQty() - $qtyOrdered;\n try {\n $warehouseProduct->setAvailableQty($currentQty)\n ->save();\n Mage::getModel('inventoryplus/warehouse_order')->setOrderId($order->getId())\n ->setWarehouseId($warehouseId)\n ->setProductId($item->getProductId())\n ->setItemId($item->getId())\n ->setQty($qtyOrdered)\n ->save();\n } catch (Exception $e) {\n Mage::log($e->getMessage(), null, 'inventory_management.log');\n }\n }\n }",
"public function testBuy()\n {\n VCR::insertCassette('orders/buy.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $order->buy([\n 'carrier' => Fixture::usps(),\n 'service' => Fixture::uspsService(),\n ]);\n\n $shipmentsArray = $order['shipments'];\n\n foreach ($shipmentsArray as $shipment) {\n $this->assertNotNull($shipment->postage_label);\n }\n }",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"public function postOrderDelivery(OrderDeliveryRequest $request){\n $data = [\n 'ongkir_real'=>$request->input('ongkir_real'),\n 'kurir'=>$request->input('kurir'),\n 'no_resi'=>$request->input('no_resi'),\n 'delivery_date'=>xformatDate($request->input('delivery_date')),\n 'status'=>'on delivery',\n 'modified_by'=>Auth::user()->username\n ];\n $order = Order::where('id',Input::get('order_id'))->update($data);\n //ipansuryadiflash()->success('Success', 'Order delivery success...');\n return redirect()->route('admin.pages.order');\n }",
"public function saveOrderShipment() {\n\t\t$this->layout = 'ajax';\n $order_id = $this->Shipment->saveOrderShipment($this->request->data);\n\t\tif($order_id) {\n $data = $this->Shipment->Order->find('first', array(\n 'conditions' => array(\n 'Order.id' => $order_id\n )\n ));\n } else {\n $this->set('json', FALSE);\n $this->render('/Common/echo_json');\n }\n $this->set('data', $data);\n $this->render('ship_cell');\n\t}",
"public function updateOrder() {\n\n echo \"ok\";\n }",
"public function ajax_swedbank_pay_update_order() {\n\t\tcheck_ajax_referer( 'swedbank_pay_checkout', 'nonce' );\n\n\t\t// Get Order\n\t\t$order_id = absint( WC()->session->get( 'order_awaiting_payment' ) );\n\t\tif ( ! $order_id ) {\n\t\t\twp_send_json(\n\t\t\t\tarray(\n\t\t\t\t\t'result' => 'failure',\n\t\t\t\t\t'messages' => 'Order is not exists',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Get Order\n\t\t$order = wc_get_order( $order_id );\n\t\tif ( ! $order ) {\n\t\t\twp_send_json(\n\t\t\t\tarray(\n\t\t\t\t\t'result' => 'failure',\n\t\t\t\t\t'messages' => 'Order is not exists',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Mark order failed instead of cancelled\n\t\tif ( $order->get_payment_method() === $this->gateway->id && $order->has_status( 'cancelled' ) ) {\n\t\t\t$order->update_status( 'failed' );\n\t\t}\n\n\t\t// Prepare $_POST data\n\t\t$data = array();\n\t\tparse_str( $_POST['data'], $data );\n\t\t$_POST = $data;\n\t\tunset( $_POST['terms-field'], $_POST['terms'] );\n\n\t\t$_POST['payment_method'] = $this->gateway->id;\n\t\t$_POST['is_update'] = '1';\n\n\t\t// Update Checkout\n\t\t// @see WC_AJAX::update_order_review()\n\t\tif ( ! empty( $_POST['shipping_method'] ) && ! is_array( $_POST['shipping_method'] ) ) {\n\t\t\t$shipping = $_POST['shipping_method'];\n\t\t\t$_POST['shipping_method'] = array( $shipping );\n\t\t}\n\n\t\t$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );\n\t\tif ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {\n\t\t\tforeach ( $_POST['shipping_method'] as $i => $value ) {\n\t\t\t\t$chosen_shipping_methods[ $i ] = wc_clean( $value );\n\t\t\t}\n\t\t}\n\n\t\tWC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );\n\t\tWC()->session->set( 'chosen_payment_method', $this->gateway->id );\n\n\t\t// Update address data\n\t\tforeach ( $_POST as $key => $value ) {\n\t\t\tif ( ( strpos( $key, 'billing_' ) !== false ) || ( strpos( $key, 'shipping_' ) !== false ) ) {\n\t\t\t\tif ( is_callable( array( $order, \"set_{$key}\" ) ) ) {\n\t\t\t\t\t$order->{\"set_{$key}\"}( $value );\n\t\t\t\t}\n\n\t\t\t\tWC()->customer->set_props( array( $key => $value ) );\n\t\t\t}\n\t\t}\n\n\t\t// Recalculate cart\n\t\tWC()->customer->set_calculated_shipping( true );\n\t\tWC()->customer->save();\n\t\tWC()->cart->calculate_totals();\n\n\t\t// Recalculate order\n\t\t$order->set_cart_hash( WC()->cart->get_cart_hash() );\n\t\t$order->calculate_totals( true );\n\t\t$order->save();\n\n\t\t// Process checkout\n\t\t$_REQUEST['woocommerce-process-checkout-nonce'] = wp_create_nonce( 'woocommerce-process_checkout' );\n\t\t$_POST['_wpnonce'] = wp_create_nonce( 'woocommerce-process_checkout' );\n\t\tWC()->checkout()->process_checkout();\n\t}",
"public function setShippingCost($shippingCost);",
"public function store()\n\t{\n\t\t$order = new Order();\n\n\t\t$items = json_decode(Input::get('items', []), true);\n\n\t\tforeach($items as &$item) {\n\t\t\t$id = $item['reference']['id'];\n\t\t\t$model = Product::find($id);\n\t\t\t$item['name'] = $model->name;\n\t\t\t$item['unit_price'] = $model->price;\n\t\t\t$item['total_price_including_tax'] = ceil($model->price * $model->vatgroup->amount * $item['quantity']);\n\t\t\t$item['total_price_excluding_tax'] = ceil($model->price * $item['quantity']);\n\t\t\t$item['type'] = 'physical';\n\t\t\t$item['discount_rate'] = 0;\n\t\t\t$item['tax_rate'] = (int) abs((1 - $model->vatgroup->amount) * 100);\n\t\t}\n\n\t\t$order->items = $items;\n\n\t\t# determine shipping type\n\t\t$total = $order->getTotal();\n\t\t$weight = $order->getWeight();\n\t\tif ($weight <= 1000) {\n\t\t\t$shippingType = 'mail';\n\t\t\t$shippingCost = 39;\n\t\t}else {\n\t\t\t$shippingType = 'service-pack';\n\t\t\t$shippingCost = 99;\n\t\t}\n\n\t\t# free shipping?\n\t\tif ($total >= 800) {\n\t\t\t$shippingCost = 0;\n\t\t}\n\n\t\t# add shipping\n\t\t$items = $order->items;\n\t\t$items[] = [\n\t\t\t'discount_rate' => 0,\n\t\t\t'name' => $shippingType,\n\t\t\t'quantity' => 1,\n\t\t\t'reference' => null,\n\t\t\t'tax_rate' => 0,\n\t\t\t'total_price_excluding_tax' => $shippingCost,\n\t\t\t'total_price_including_tax' => $shippingCost,\n\t\t\t'total_tax_amount' => 0,\n\t\t\t'type' => 'shipping_fee',\n\t\t\t'unit_price' => $shippingCost,\n\t\t];\n\t\t$order->items = $items;\n\n\t\t# set user\n\t\t$order->user_id = Input::get('user_id');\n\n\t\t# set shipping & billing addresses\n\t\t$order->billing_address = [\n\t\t\t'given_name' => $order->user->firstname,\n\t\t\t'family_name' => $order->user->lastname,\n\t\t\t'street_address' => null,\n\t\t\t'postal_code' => null,\n\t\t\t'city' => null,\n\t\t\t'country' => null,\n\t\t\t'email' => $order->user->email,\n\t\t\t'phone' => null,\n\t\t];\n\t\t$order->shipping_address = $order->billing_address;\n\n\t\t# set locale etc\n\t\t$order->locale = 'nb-no';\n\t\t$order->purchase_country = 'no';\n\t\t$order->purchase_currency = 'nok';\n\n\t\t# set total\n\t\t$order->total_price_including_tax = $order->getTotal();\n\n\t\t$total = 0;\n\t\tforeach($order->items as $item) {\n\t\t\t$total += $item['total_price_excluding_tax'];\n\t\t}\n\t\t$order->total_price_excluding_tax = $total;\n\n\t\t# total tax amount\n\t\t$tax = 0;\n\t\tforeach($order->items as $item) {\n\t\t\t$tax += $item['total_price_including_tax'] - $item['total_price_excluding_tax'];\n\t\t}\n\t\t$order->total_tax_amount = $tax;\n\n\t\t$order->status = 'unprocessed';\n\n\t\t# save\n\t\t$order->save();\n\n\t\t# redirect to edit that order now\n\t\treturn Redirect::to(route('admin.orders.edit', $order->id));\n\t}",
"public function apply()\n {\n /** @var EavSetup $eavSetup */\n $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]);\n\n if (!$eavSetup->getAttribute(Product::ENTITY, 'am_shipping_type')) {\n $eavSetup->addAttribute(\n Product::ENTITY,\n 'am_shipping_type',\n [\n 'type' => 'varchar',\n 'backend' => '',\n 'frontend' => '',\n 'label' => 'Shipping Type',\n 'input' => 'select',\n 'class' => '',\n 'source' => '',\n 'global' => ScopedAttributeInterface::SCOPE_STORE,\n 'visible' => true,\n 'required' => false,\n 'user_defined' => false,\n 'default' => 0,\n 'searchable' => false,\n 'filterable' => false,\n 'comparable' => false,\n 'visible_on_front' => false,\n 'used_in_product_listing' => true,\n 'unique' => false,\n 'apply_to' => ''\n ]\n );\n }\n }",
"public function setShippingServiceName($name){\n $this->shippingServiceName = (string) $name;\n }",
"public function actualize()\n {\n\n $orders = $this->gdaxService->getOpenOrders();\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>actualize orders</info>';\n $this->orderService->fixUnknownOrdersFromGdax($orders);\n }\n }",
"public static function paidOrderFilter(Request $request, $order)\n {\n\terror_log(\"ORDER ID: \".$order);\n // Your code should be here:\n if ($order instanceof Order and $order->id) {\n\t $order->status = 2;\n\t\t$order->save();\n\n\t\t$commands = json_decode($order->product->execute);\n\t\tforeach ($commands as $cmd) {\n\t\t\tif ($cmd->type == \"group\") {\n\t\t\t\tif (\\DB::connection('mysql2')->table('players')->where('userName', $order->username)->exists()) {\n\t\t\t\t\t\\DB::connection('mysql2')->table('players')->where('userName', $order->username)->update(array('userGroup' => $cmd->execute));\n\t\t\t\t} else {\n\t\t\t\t\t\\DB::connection('mysql2')->table('players')->insert(['userName' => strtolower($order->username), 'userGroup' => $cmd->execute, 'permissions' => \"\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($cmd->type == \"money\") {\n\t\t\t\tif(\\DB::connection('mysql3')->table('user_money')->where('username', $order->username)->exists()) {\n\t\t\t\t\t\\DB::connection('mysql3')->table('user_money')->increment('money', $cmd->execute);\n\t\t\t\t} else {\n\t\t\t\t\t\\DB::connection('mysql3')->table('user_money')->insert(['username' => strtolower($order->username), 'money' => $cmd->execute]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n // Return TRUE if the order is saved as \"paid\" in the database or FALSE if some error occurs.\n // If you return FALSE, then you can repeat the failed paid requests on the unitpay website manually.\n return false;\n }",
"function wwt_perform_consignment_stocks_increase($status, $order) {\r\n $shippingMethod = get_shipping_method_with_id($order);\r\n $consignmentStocks = WWT_ConsignmentEntity::get_all();\r\n\r\n foreach ($consignmentStocks as $consignment) {\r\n $consignmentStockShippingMethods = explode(FIELDS_SEPARATOR, $consignment->paymentMethods);\r\n\r\n if (in_array($shippingMethod, $consignmentStockShippingMethods)) {\r\n $order->add_order_note(sprintf(__('Goods were taken from consignment stock [%s]. No main warehouse changes.', 'medinatur_v3'), $consignment->name));\r\n\r\n $products = $order->get_items();\r\n\r\n foreach ($products as $product) {\r\n $itemStockReduced = $product->get_meta( WWT_STOCK_REDUCED_FLAG, true );\r\n\r\n if (!$itemStockReduced) {\r\n $quantity = $product->get_quantity();\r\n $productId = $product->get_product_id();\r\n WWT_ConsignmentEntity::update_product($consignment->id, $productId, -$quantity);\r\n $logEntry = new WWT_ConsignmentLogEntity($consignment->id, NULL, $productId, -$quantity, sprintf(__('Amout reduced because of change in order %d.', 'woocommerce-warehouse-transactions'), $order->id), $order->id);\r\n $logEntry->save();\r\n $product->add_meta_data( WWT_STOCK_REDUCED_FLAG, $quantity, true );\r\n $product->save();\r\n }\r\n }\r\n\r\n $status = false;\r\n }\r\n }\r\n\r\n return $status;\r\n}",
"public function setShipAddress(?Address $address = null): Cart;"
] | [
"0.8012149",
"0.78245276",
"0.74902797",
"0.6935354",
"0.6845717",
"0.66986763",
"0.64345485",
"0.63858855",
"0.63169616",
"0.6295898",
"0.6274096",
"0.62528867",
"0.6143075",
"0.6106249",
"0.60485643",
"0.60382515",
"0.5964262",
"0.59186786",
"0.5904106",
"0.58712393",
"0.5858244",
"0.5747031",
"0.57151896",
"0.57102555",
"0.5691527",
"0.56827396",
"0.5665641",
"0.5610285",
"0.56015754",
"0.55954105",
"0.5546085",
"0.5526032",
"0.552551",
"0.5512851",
"0.5485841",
"0.54788405",
"0.5476867",
"0.54392177",
"0.54354286",
"0.5432376",
"0.5430343",
"0.5427573",
"0.542533",
"0.5422635",
"0.541725",
"0.54095596",
"0.54079354",
"0.5397499",
"0.539432",
"0.53905344",
"0.5385065",
"0.53836167",
"0.5359624",
"0.535937",
"0.53578776",
"0.5357414",
"0.53559583",
"0.5354378",
"0.53220904",
"0.53142834",
"0.5312263",
"0.5308863",
"0.53076637",
"0.5304612",
"0.5298269",
"0.529482",
"0.5288557",
"0.5285451",
"0.52799183",
"0.5276111",
"0.52646637",
"0.5264387",
"0.5263478",
"0.5255852",
"0.5254006",
"0.52494705",
"0.5249296",
"0.52340955",
"0.52263",
"0.5224173",
"0.5223898",
"0.52227694",
"0.52177244",
"0.5214193",
"0.5214053",
"0.52072436",
"0.5205741",
"0.5194265",
"0.5186975",
"0.5165368",
"0.5164985",
"0.51623225",
"0.5161521",
"0.5161467",
"0.51566476",
"0.5150505",
"0.5147391",
"0.5142487",
"0.5135414",
"0.5135316"
] | 0.80748504 | 0 |
Mark WC Product Vendors order as Fulfilled | function wcfm_wcpvendors_order_mark_fulfilled() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$product_id = $_POST['productid'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order = wc_get_order( $order_id );
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( $order_item_id ) {
if( wcfm_is_vendor() ) {
$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();
WC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );
WC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );
WC_Product_Vendors_Utils::clear_reports_transients();
$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';
$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class="wcfm_dashboard_item_title" target="_blank" href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
} else {
$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
}
echo "complete";
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"protected function _fcpoMarkOrderAsProblematic() {\n $this->_blOrderHasProblems = true;\n }",
"public function actualize()\n {\n\n $orders = $this->gdaxService->getOpenOrders();\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>actualize orders</info>';\n $this->orderService->fixUnknownOrdersFromGdax($orders);\n }\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"public function completeProductOrder($order_product_id)\n\t{\n\t\t$query1=$this->db->query(\"SELECT pyr.confirm_id as payer_confirm_id FROM `payer` pyr where pyr.order_product_id=\".$order_product_id);\n\t\t$result1=$query1->result_array();\n\t\t$query2=$this->db->query(\"SELECT pye.confirm_id as payee_confirm_id FROM `payee` pye where pye.order_product_id=\".$order_product_id);\n\t\t$result2=$query2->result_array();\n\t\tif(isset($result1[0]) && isset($result2[0]))\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =6 where order_product_id = \".$order_product_id);\n\t\telse\n\t\t$this->db->query(\"UPDATE `order_product` SET order_product_status_id =5 where order_product_id = \".$order_product_id);\n\t\t$this->sendcompleteProductOrderMail($order_product_id);\n\t\t\n\t}",
"public function change_purse( $request ) {\n $params = $request->get_params();\n\n $customer_orders = get_posts( array(\n 'numberposts' => 1,\n 'meta_key' => '_customer_user',\n 'meta_value' => get_current_user_id(),\n 'post_type' => wc_get_order_types(),\n 'post_status' => 'wc-processing',\n 'order' => 'DESC'\n ) );\n\n if (!isset($customer_orders[0])) {\n return new WP_REST_Response([\n 'message' => 'No order with \"processing\" status found',\n 'status' => '400'\n ], 400);\n }\n\n $post_order = $customer_orders[0];\n $order = new WC_Order($post_order->ID);\n $items = $order->get_items();\n $product = null;\n\n foreach ($items as $item) {\n $data = $item->get_data();\n $product = wc_get_product($data['product_id']);\n $product_type = $product->get_type();\n\n if ($product_type == 'variable') {\n $variation = wc_get_product($data['variation_id']);\n $order->remove_item($item->get_id());\n $order->save(); // reduce_order_stock reduce stock from order saved in memory\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n\n wc_update_product_stock($variation->get_id(), $variation->get_stock_quantity() + 1);\n $variation->save();\n break;\n }\n $product = null;\n }\n\n if (!$product) {\n $new_product = wc_get_product($params['id']);\n $order->add_product($new_product);\n $order->reduce_order_stock();\n $order->save();\n }\n\n $product_data = $new_product->get_data();\n $product_attributes = $new_product->get_variation_attributes();\n\n return new WP_REST_Response([\n 'id' => $new_product->get_id(),\n 'price' => $product_data['price'],\n 'name' => $product_data['name'],\n 'short_description' => $product_data['short_description'],\n 'sku' => $product_data['sku'],\n 'images' => $this->get_images($new_product),\n 'colors' => isset($product_attributes['pa_colors']) ? $product_attributes['pa_colors'] : false,\n 'sizes' => isset($product_attributes['pa_sizes']) ? $product_attributes['pa_sizes'] : false,\n ], 200);\n\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"function acadp_order_completed( $order ) {\n\n\t// update order details\n\tupdate_post_meta( $order['id'], 'payment_status', 'completed' );\n\tupdate_post_meta( $order['id'], 'transaction_id', $order['transaction_id'] );\n\n\t// If the order has featured\n\t$featured = get_post_meta( $order['id'], 'featured', true );\n\n\tif( ! empty( $featured ) ) {\n\t\t$post_id = get_post_meta( $order['id'], 'listing_id', true );\n\t\tupdate_post_meta( $post_id, 'featured', 1 );\n\t}\n\n\t// Hook for developers\n\tdo_action( 'acadp_order_completed', $order['id'] );\n\n\t// send emails\n\tacadp_email_listing_owner_order_completed( $order['id'] );\n\tacadp_email_admin_payment_received( $order['id'] );\n\n}",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }",
"public function check_manual_order_for_pre_order_products( $order_id ) {\n\t\t// Make sure we are in the administration panel and we're saving an order\n\t\tif ( ! is_admin() || ! isset( $_POST['post_type'] ) || 'shop_order' != $_POST['post_type'] )\n\t\t\treturn;\n\n\t\t$order = new WC_Order( $order_id );\n\n\t\t// Check if the order hasn't been processed already\n\t\tif ( WC_Pre_Orders_Order::order_contains_pre_order( $order ) )\n\t\t\treturn;\n\n\t\t// Order has not been processed yet (or doesn't contain pre orders)\n\t\t$contains_pre_orders = false;\n\n\t\tforeach ( $order->get_items() as $item ) {\n\t\t\tif ( 'line_item' == $item['type'] ) {\n\t\t\t\t$product = get_product( $item['item_meta']['_product_id'][0] );\n\n\t\t\t\tif ( 'yes' == $product->wc_pre_orders_enabled ) {\n\t\t\t\t\t// Set correct flags for this order, making it a pre order\n\t\t\t\t\tupdate_post_meta( $order_id, '_wc_pre_orders_is_pre_order', 1 );\n\t\t\t\t\tupdate_post_meta( $order_id, '_wc_pre_orders_when_charged', $product->wc_pre_orders_when_to_charge );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function set_vendor_product_commission_paid( $vendor_id, $product_id, $order_id )\n\t{\n\t\tglobal $wpdb;\n\n\t\t$table_name = $wpdb->prefix . \"pv_commission\";\n\n\t\t$query = \"UPDATE `{$table_name}` SET `status` = 'paid' WHERE vendor_id = $vendor_id AND order_id = $order_id AND product_id = $product_id\";\n\t\t$result = $wpdb->query( $query );\n\n\t\treturn $result;\n\t}",
"private function maybe_install() {\n\t\tglobal $woocommerce;\n\n\t\t$installed_version = get_option( 'wc_pre_orders_version' );\n\n\t\t// install\n\t\tif ( ! $installed_version ) {\n\n\t\t\t// add 'pre-order' shop order status term\n\t\t\t$woocommerce->init_taxonomy();\n\t\t\tif ( ! get_term_by( 'slug', 'pre-ordered', 'shop_order_status' ) )\n\t\t\t\twp_insert_term( 'pre-ordered', 'shop_order_status' );\n\n\t\t\t// install default settings\n\t\t\tforeach ( $this->get_settings() as $setting ) {\n\n\t\t\t\tif ( isset( $setting['default'] ) )\n\t\t\t\t\tupdate_option( $setting['id'], $setting['default'] );\n\t\t\t}\n\t\t}\n\n\t\t// upgrade - installed version lower than plugin version?\n\t\tif ( -1 === version_compare( $installed_version, WC_Pre_Orders::VERSION ) ) {\n\n\t\t\t$this->upgrade( $installed_version );\n\n\t\t\t// new version number\n\t\t\tupdate_option( 'wc_pre_orders_version', WC_Pre_Orders::VERSION );\n\t\t}\n\t}",
"private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid(\n null,\n $this->connector->accountURL,\n $this->orderURL\n );\n\n $post = $this->connector->post($this->orderURL, $sign);\n if (strpos($post['header'], \"200 OK\") !== false) {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if (array_key_exists('certificate', $post['body'])) {\n $this->certificateURL = $post['body']['certificate'];\n }\n $this->updateAuthorizations();\n } else {\n //@codeCoverageIgnoreStart\n $this->log->error(\"Failed to fetch order for {$this->basename}\");\n //@codeCoverageIgnoreEnd\n }\n }",
"public function test_product_stocks_deduct_when_order_is_placed()\n {\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $product->orders()->create(['quantity' => 5]);\n\n $product->refresh();\n\n $this->assertTrue($product->available_stock === 45);\n }",
"function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}",
"public function markCartsAdditionalProducts(Order $draftOrder): bool;",
"function completeOrder($orderId, $pack, $deli, $cost, $delicost, $plain, $salted, $masala, $garlic, $chilli, $strawberry) {\n\t\t$data = array('box_type' => $pack, 'delivery_type'=>$deli, 'cost'=>$cost, 'delivery_cost'=>$delicost, 'order_status'=>'3', \n\t\t'plain'=>$plain, 'salted'=>$salted, 'masala'=>$masala, 'garlic'=>$garlic, 'chilli'=>$chilli, 'strawberry'=>$strawberry);\n\t\t$this -> db -> where('id', $orderId);\n\t\t$result = $this -> db -> update('registrations', $data);\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}",
"function payment_complete( $order ){\n\n if( $order->status == 'processing' ){\n\n $order->update_status( 'completed' );\n\n add_post_meta( $order->id, '_paid_date', current_time('mysql'), true );\n\n $this_order = array(\n 'ID' => $order->id,\n 'post_date' => current_time( 'mysql', 0 ),\n 'post_date_gmt' => current_time( 'mysql', 1 )\n );\n wp_update_post( $this_order );\n \n if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', true, $order->id ) ) {\n $order->reduce_order_stock(); // Payment is complete so reduce stock levels\n }\n\n do_action( 'woocommerce_payment_complete', $order->id );\n }\n }",
"function completeOrder($order)\n{\n\t//$order->addStatusToHistory(Mage_Sales_Model_Order::STATE_COMPLETE);\n\n\tif ($order->getState() != Mage_Sales_Model_Order::STATE_COMPLETE)\n\t{\n\t\tif(abs($order->getGrandTotal() - $order->getBaseTotalPaid()) < 0.00001) {\n\t\t\t$order->setData('state', Mage_Sales_Model_Order::STATE_COMPLETE);\n\t\t\t$order->setStatus(\"complete\");\n\n\t\t\t$order->addStatusHistoryComment('Pedido finalizado pela distribuidora.');\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$order->save();\n\t\t\t\tdebug('Pedido '.$order->getId().' finalizado.');\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tdebug('Pedido não finalizado: ' . $e->getMessage());\n\t\t\t}\n\t\t}\n\t} else {\n\t\techo 'O pedido já foi finalizado'.\"\\n\";\n\t}\n}",
"function markPurchased($opm_productid,$accountid) {\n \n \t$this->load->model('accounts_model');\n\n\t\tif (checkPerms('can_mark_purchased',true)) {\n\n\t\t\t\n\t\t\tif ($this->accounts_model->markProductPurchased($opm_productid,$accountid)) {\n\t\t\t\t\n\t\t\t\t// fetch account name for history entry\n\t\t\t\t\n\t\t\t\t$account = $this->accounts_model->fetchAccount($accountid);\n\t\t\t\t\n\t\t\t\t$message = $account->account . \" purchased this product (entered by \" . $this->userinfo->username . \")\";\n\t\t\t\t\n\t\t\t\t$this->opm->addHistoryItem($opm_productid,$message);\n\t\t\t\t\n\t\t\t\t$this->opm->displayAlert(\"Product marked Purchased by \" . $account->account . \".\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\n\t\t\t\t$this->opm->displayError(\"Error saving status\",\"/products/view/\" . $opm_productid);\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\n }",
"function may_be_complete_order( $next_step_id, $order_id ) {\n\n\t\twcf()->logger->log( 'Entering: ' . __CLASS__ . '::' . __FUNCTION__ );\n\n\t\t$template_type = get_post_meta( $next_step_id, 'wcf-step-type', true );\n\n\t\tif ( 'thankyou' === $template_type ) {\n\n\t\t\t$order = wc_get_order( $order_id );\n\n\t\t\twcf_pro()->order->may_be_normalize_status( $order );\n\t\t}\n\t}",
"public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }",
"public function notify_warehouse( $order ) {\n\t\t$order_info = $this->get_order_info($order);\n\t\t$supplier_codes = $order_info['suppliers'];\n\t\t// for each supplier code, loop and send email with product info\n\t\tforeach($supplier_codes as $code => $supplier_info) {\n\t\t\tdo_action('wc_dropship_manager_send_order',$order_info,$supplier_info);\n\t\t}\n\t}",
"protected function approveExistProduct(\n \\Magento\\Catalog\\Model\\Product $product,\n \\Vnecoms\\Vendors\\Model\\Vendor $vendor\n ) {\n $updateCollection = $this->_objectManager->create('Vnecoms\\VendorsProduct\\Model\\ResourceModel\\Product\\Update\\Collection');\n $updateCollection->addFieldToFilter('product_id', $product->getId())\n ->addFieldToFilter('status', ProductUpdate::STATUS_PENDING);\n \n foreach ($updateCollection as $update) {\n $productData = unserialize($update->getProductData());\n $checkIsCategories = false;\n foreach ($productData as $attributeCode => $value) {\n $product->setData($attributeCode, $value);\n if($attributeCode == \"category_ids\"){\n $checkIsCategories = true;\n }\n }\n $update->setStatus(ProductUpdate::STATUS_APPROVED)->setId($update->getUpdateId())->save();\n $product->setStoreId($update->getStoreId())->save();\n\n if($checkIsCategories){\n $this->getCategoryLinkManagement()->assignProductToCategories(\n $product->getSku(),\n $product->getCategoryIds()\n );\n }\n }\n /*Send update product notification email*/\n $this->productHelper->sendUpdateProductApprovedEmailToVendor($product, $vendor, $updateCollection);\n }",
"function dispatch_licenses(){\n\t\n//1get all unfinished orders which are paid\n//2fetch all available licences\n\n//if 1 > 0 \n\t//loop for (unfinished orders)\n \t\t//compare ordered product id with available licences\n\t\t//if available\n\t\t\t//fetch email of buyer + send email + add buyer to database\n\t\t//else \n\t\t\t//mail not available to admin\n\t//loop end\n\t\n}",
"public function update(Request $request, $order_id, $product_id): \\Illuminate\\Http\\JsonResponse\n {\n $order = Order::findOrFail($order_id);\n if ($request->status) {\n $order->products()->updateExistingPivot($product_id, ['individual_order_status' => $request->status]);\n $counter = 0;\n foreach ($order->products as $product) {\n if ($product->pivot->individual_order_status == 'confirmed') {\n ++$counter;\n }\n }\n if ($counter == count($order->products)) {\n $order->order_status = 'confirmed';\n $user = User::findOrFail($order->user_id);\n Mail::to($user->email)->send(new PurchaseInvoiceInformation($order));\n } else {\n $order->order_status = 'processing';\n }\n $order->save();\n }\n return (new OrdersResource($order))->response();\n }",
"public function handleVendor(){ \n $login = $this->hlp->logn();\n $vStr = \"vendorfee\";\n $vFee = intval($this->configuration->valueGetter($vStr));\n \n if (!$this->listings->isVendor($login)) {\n if ($this->wallet->getBalance($login) >= $vFee){ \n $this->wallet->moveAndStore($vStr, $login, \"profit\", $vFee);\n $this->listings->becomeVendor($login);\n $this->flashMessage(\"Váš účet má nyní vendor status\");\n $this->redirect(\"Listings:in\");\n } else {\n $this->flashMessage(\"You don't have sufficient funds!\");\n $this->redirect(\"Listings:in\");\n } \n } else {\n $this->redirect(\"Listings:in\");\n }\n }",
"public function testUpdateOrderCustomFields()\n {\n }",
"public function updating(Order $order): void\n\t{\n\t\tif ($order->status == 'pending') {\n\t\t\t$order->booster_id = null;\n\t\t}\n\t}",
"function add_voucher($order_id){\n\t$order = wc_get_order( $order_id );\n\terror_log($order_id);\n\t//echo \"<script language='javascript'>alert('$order_id');</script>\";\n\t//$order = new WC_Order($order_id);\n\t$items = $order->get_items();\n\t$customer = $order->get_user_id();\n\terror_log($customer);\n\t//echo \"<script language='javascript'>alert('$customer');</script>\";\n\tforeach ( $items as $item ) {\n $product_name = $item->get_name();\n $product_id = $item->get_product_id();\n $product_variation_id = $item->get_variation_id();\n\t}\n\t\n\t/* query */\n\t$mylink = $wpdb->get_row( \"\n\tSELECT * FROM $table_name WHERE art_id = $product_id AND used_by = '' ORDER BY created ASC LIMIT 1\n\t\" );\n\t\n\tif ($mylink !== null) {\n\t\n\t\t/* write to db */\n\t\t$wpdb->update( \n\t\t\t$table_name, \n\t\t\tarray( \n\t\t\t\t'used_by' => $customer,\t// string\n\t\t\t\t'order_id' => $order_id\t// integer (number) \n\t\t\t), \n\t\t\tarray( 'ID' => $mylink->id ), \n\t\t\tarray( \n\t\t\t\t'%d',\t// value1\n\t\t\t\t'%d'\t// value2\n\t\t\t), \n\t\t\tarray( '%d' ) \n\t\t);\n\t\t\n\t\t\n\t\t/* send mail */\n\t\n\t\n\t}\n}",
"public function postUpdateHandler (Order $order, LifecycleEventArgs $event)\n {\n $changeSet = $event->getEntityManager()->getUnitOfWork()->getEntityChangeSet($event->getEntity());\n\n // If the sku has changed search for orders and run them through the approval process\n if (isset($changeSet['status']))\n {\n if ($changeSet['status'][1]->getId() == OrderStatusUtility::PENDING_FULFILLMENT_ID)\n $this->handleOrderShipmentLogic($order);\n }\n }",
"private function ThanksForYourOrder()\n\t\t{\n\t\t\t// Reload all fo the information about the order as there's a good chance\n\t\t\t// a fair bit of it has changed now\n\t\t\t$this->SetOrderData();\n\n\t\t\t$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');\n\t\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\n\t\t\t$GLOBALS['HideError'] = \"none\";\n\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = '';\n\t\t\t$GLOBALS['HideAwaitingPayment'] = \"none\";\n\n\t\t\t$GLOBALS['HideStoreCreditUse'] = 'none';\n\n\t\t\tif($this->pendingData['storecreditamount'] > 0) {\n\t\t\t\t$GLOBALS['HideStoreCreditUse'] = '';\n\t\t\t\t$GLOBALS['StoreCreditUsed'] = CurrencyConvertFormatPrice($this->pendingData['storecreditamount']);\n\n\t\t\t\t$GLOBALS['StoreCreditBalance'] = CurrencyConvertFormatPrice($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerStoreCredit($this->pendingData['customerid']));\n\t\t\t\t$GLOBALS['ISC_LANG']['OrderCreditDeducted'] = sprintf(GetLang('OrderCreditDeducted'), GetConfig('CurrencyToken') . $GLOBALS['StoreCreditUsed']);\n\t\t\t}\n\n\t\t\t// If it was an offline payment method, show the post-purchase message and hide other messages\n\t\t\tif(is_object($this->paymentProvider) && $this->paymentProvider->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE && method_exists($this->paymentProvider, 'GetOfflinePaymentMessage')) {\n\t\t\t\t$defaultCurrency = GetDefaultCurrency();\n\t\t\t\t$GLOBALS['OrderTotal'] = FormatPrice($this->pendingData['gatewayamount'], false, true, false, $defaultCurrency, true);\n\n\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t$GLOBALS['PaymentMessage'] = $this->paymentProvider->GetOfflinePaymentMessage();\n\t\t\t\t$GLOBALS['SNIPPETS']['OfflinePaymentMessage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"OfflinePaymentMessage\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Was the order declined?\n\t\t\t\tif($this->pendingData['status'] == 6) {\n\t\t\t\t\t$GLOBALS['HideError'] = '';\n\t\t\t\t\t$GLOBALS['ErrorMessage'] = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = 'none';\n\t\t\t\t\t$GLOBALS['ISC_LANG']['ThanksForYourOrder'] = GetLang('YourPaymentWasDeclined');\n\t\t\t\t}\n\t\t\t\t// Order is still awaiting payment\n\t\t\t\telse if($this->pendingData['status'] == 7) {\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideAwaitingPayment'] = \"\";\n\t\t\t\t}\n\t\t\t\t// Otherwise, order was successful\n\t\t\t\telse {\n\t\t\t\t\t// Is it a physical or digital order?\n\t\t\t\t\tif($this->pendingData['isdigital'] == 100) {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no download link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HidePhysicalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no view order link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->CreateCupons();\n\t\t\t\n\t\t\t// Include the conversion code for each analytics module\n\t\t\t$GLOBALS['ConversionCode'] = '';\n\t\t\t$analyticsModules = GetAvailableModules('analytics', true, true);\n\t\t\tforeach($analyticsModules as $module) {\n\t\t\t\t$module['object']->SetOrderData($this->pendingData);\n\t\t\t\t$trackingCode = $module['object']->GetConversionCode();\n\t\t\t\tif($trackingCode != '') {\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= \"\n\t\t\t\t\t\t<!-- Start conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\t\".$trackingCode.\"\n\t\t\t\t\t\t<!-- End conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the conversion tracking code for affiliates\n\t\t\tforeach($this->pendingData['orders'] as $order) {\n\t\t\t\tif(strlen(GetConfig('AffiliateConversionTrackingCode')) > 0) {\n\t\t\t\t\t$converted_code = GetConfig('AffiliateConversionTrackingCode');\n\t\t\t\t\t$subTotalColumn = 'subtotal_ex_tax';\n\t\t\t\t\t$totalColumn = 'total_inc_tax';\n\t\t\t\t\tif(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {\n\t\t\t\t\t\t$subTotalColumn = 'subtotal_inc_tax';\n\t\t\t\t\t}\n\n\t\t\t\t\t$discountedSubTotal = $_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL'];\n\t\t\t\t\tunset($_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL']);\n\n\t\t\t\t\t$replacements = array(\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL%%' => $order[$subTotalColumn] / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_IN_CENTS%%' => ($order[$subTotalColumn] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED%%' => $discountedSubTotal / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED_IN_CENTS%%' => ($discountedSubTotal / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_AMOUNT%%' => $order['total_inc_tax'] / 1,\n\t\t\t\t\t\t'%%ORDER_AMOUNT_IN_CENTS%%' => ($order['total_inc_tax'] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_ID%%' => $order['orderid'],\n\t\t\t\t\t);\n\t\t\t\t\t$converted_code = str_ireplace(array_keys($replacements), $replacements, $converted_code);\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= $converted_code;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// leave this in for outdated templates: hide the product updates div\n\t\t\t$GLOBALS['HideProductUpdates'] = \"none\";\n\n\t\t\tif(method_exists($this->paymentProvider, 'ShowOrderConfirmation')) {\n\t\t\t\t$GLOBALS['OrderConfirmationDetails'] = $this->paymentProvider->ShowOrderConfirmation($this->pendingData);\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Show the order confirmation screen\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetLang('ThanksForYourOrder'));\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"order\");\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\t}",
"public function testUpdateOrder()\n {\n }",
"public function execute()\n {\n\n $inline = $this->getRequest()->getParam('inline', 0);\n $vendorIds = $this->getRequest()->getParam('vendor_id');\n $status = $this->getRequest()->getParam('status', '');\n $reason = $this->getRequest()->getParam('reason', '');\n\n $shop_disable = 2;\n if ($status == \\Ced\\CsMarketplace\\Model\\Vendor::VENDOR_APPROVED_STATUS) {\n $shop_disable = 1;\n }\n if ($status == \\Ced\\CsMarketplace\\Model\\Vendor::VENDOR_DISAPPROVED_STATUS) {\n $shop_disable = 2;\n }\n\n if ($inline) {\n $vendorIds = [$vendorIds];\n } else {\n $vendorIds = explode(',', $vendorIds);\n }\n\n if (!is_array($vendorIds)) {\n $this->messageManager->addErrorMessage(__('Please select vendor(s)'));\n } else {\n try {\n $model = $this->_validateMassStatus($vendorIds, $status);\n if ($reason) {\n $model->saveMassAttribute($vendorIds, ['code' => 'reason', 'value' => $reason]);\n } else {\n $model->saveMassAttribute($vendorIds, ['code' => 'reason', 'value' => '']);\n }\n $model->saveMassAttribute($vendorIds, ['code' => 'status', 'value' => $status]);\n\n $shop_model = $this->vshopFactory->create();\n $shop_model->saveShopStatus($vendorIds, $shop_disable);\n $this->messageManager->addSuccessMessage(\n __('Total of %1 record(s) have been updated.', count($vendorIds))\n );\n } catch (\\Exception $e) {\n $this->messageManager->addErrorMessage(\n __(' %1 An error occurred while updating the vendor(s) status.', $e->getMessage())\n );\n }\n }\n $this->_redirect('*/*/index');\n }",
"function uc_order_edit_products_add_blank($form, &$form_state) {\n $form_state['refresh_products'] = TRUE;\n $form_state['rebuild'] = TRUE;\n\n $order = $form_state['build_info']['args'][0];\n\n $product = new stdClass();\n $product->qty = 1;\n $product->order_id = $order->order_id;\n uc_order_product_save($order->order_id, $product);\n\n $order->products[] = $product;\n\n uc_order_log_changes($order->order_id, array('add' => t('Added new product line to order.')));\n}",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"protected function isValidOrder()\n {\n return true;\n }",
"public function redeem_coupon_after_order($order_id)\n {\n $order = new WC_Order($order_id);\n\n foreach($order->get_used_coupons() as $coupon_code){\n // Retrieving the coupon ID\n $coupon_post = get_page_by_title($coupon_code, OBJECT, 'shop_coupon');\n $coupon_id = $coupon_post->ID;\n $is_api_coupon = get_post_meta($coupon_id, 'is_wpm_generated_coupon', true);\n\n if($is_api_coupon == '1') {\n $this->validateCouponWithAPI($coupon_code, 'Redeem');\n update_post_meta($coupon_id, 'is_wpm_generated_coupon', 'used');\n }\n }\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"public function validateOrder();",
"public function action_order(Order $order, $status) {\n // dd($status);\n if($status == 3){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n if ($order->status == 2) {\n $product = Product::find($product_id);\n $product->update(['remaining_quantity' => $product->remaining_quantity + $count, 'sold_count' => $product->sold_count - $count]);\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['remaining_quantity' => $m_option->remaining_quantity + $count, 'sold_count' => $m_option->sold_count - $count]);\n }\n }\n \n\n // $product->save();\n }\n }\n\n if($status == 2){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n $product = Product::find($product_id);\n $product->sold_count = $product->sold_count + $count;\n $product->save();\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['sold_count' => (int)$m_option->sold_count + $count]);\n }\n }\n }\n\n $order->update(['status' => (int)$status]);\n\n\n return redirect()->back();\n }",
"public function orderUpdate()\n {\n $this->helper->logOrder('Beginning Order Update.');\n $stores = $this->storeManager->getStores();\n\n $enabledStores = [];\n\n foreach ($stores as $store) {\n if ($store->isActive() && $this->helper->isEnabled($store->getId())) {\n $enabledStores[] = $store->getId();\n }\n }\n\n if ($enabledStores) {\n $ordersToProcess = null;\n\n $ordersToProcess = $this->orderCollectionFactory\n ->create()\n ->addFieldToSelect('*')\n ->addFieldToFilter(\n 'store_id',\n [\n 'in' => [$enabledStores],\n ]\n )\n ->addFieldToFilter(\n 'state',\n [\n 'in' => [\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_PROCESSING,\n ],\n ]\n )\n ->addFieldToFilter('fulfilled_by_amazon', true)\n ->addFieldToFilter(\n 'amazon_order_status',\n [\n 'in' => [\n $this->helper::ORDER_STATUS_RECEIVED,\n $this->helper::ORDER_STATUS_PLANNING,\n $this->helper::ORDER_STATUS_PROCESSING,\n ],\n ]\n );\n\n if (!empty($ordersToProcess) && $ordersToProcess->count()) {\n $this->helper->logOrder('Beginning Order Update for ' . $ordersToProcess->count() . ' orders.');\n\n foreach ($ordersToProcess as $order) {\n $this->helper->logOrder('Updating order #' . $order->getIncrementId());\n\n $result = $this->outbound->getFulfillmentOrder($order);\n if ($result) {\n $fulfillmentOrderResult = $result->getGetFulfillmentOrderResult();\n\n // Amazon Statuses: RECEIVED / INVALID / PLANNING / PROCESSING / CANCELLED / COMPLETE\n // / COMPLETE_PARTIALLED / UNFULFILLABLE\n $amazonStatus = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getFulfillmentOrderStatus();\n\n $amazonOrderId = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getDisplayableOrderId();\n\n $id = $order->getIncrementId();\n if ($order->getIncrementId() == $amazonOrderId) {\n $this->helper->logOrder(\n 'Status of order #' . $order->getIncrementId() . ': ' . $amazonStatus\n );\n\n if ($amazonStatus) {\n switch ($amazonStatus) {\n case 'COMPLETE':\n case 'COMPLETE_PARTIALLED':\n $this->magentoOrderUpdate($order, $fulfillmentOrderResult);\n break;\n case 'INVALID':\n case 'CANCELLED':\n case 'UNFULFILLABLE':\n $this->cancelFBAShipment($order, $fulfillmentOrderResult);\n break;\n }\n }\n }\n }\n }\n\n $this->helper->logOrder(__('Get Order status called. Orders to process: ') . $ordersToProcess->count());\n } else {\n $this->helper->logOrder(__('Get Order status called. No orders to process'));\n }\n }\n }",
"private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }",
"function uc_product_content_uc_checkout_complete($order, $account) {\n $source_nid = '';\n \n foreach ($order->products as $item) {\n if (isset($item->data['product_content_source_nid'])) {\n $source_nid = $item->data['product_content_source_nid'];\n }\n }\n \n // if we're dealing with product_checkout products, store an association of node to order\n // and lock the node from user editing, now that the order is complete\n if ($source_nid != '') {\n $node = node_load($source_nid);\n \n // make the magic happen\n // store the order number\n $node->order_id = $order->order_id;\n \n // store the originator uid\n $node->originator = $node->uid;\n \n // give the node to the superuser so that only admins can edit it\n // FUTURE: make a config option or make a module like node_access a depencency\n $node->uid = 1;\n \n node_save($node);\n }\n}",
"protected function _fcpoSetOrderStatus() {\n $blIsAmazonPending = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoAmazonPayOrderIsPending');\n $blOrderOk = $this->_fcpoValidateOrderAgainstProblems();\n\n if ($blIsAmazonPending) {\n $this->_setOrderStatus('PENDING');\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $this->save();\n } elseif ($blOrderOk === true) {\n // updating order trans status (success status)\n $this->_setOrderStatus('OK');\n } else {\n $this->_setOrderStatus('ERROR');\n }\n }",
"public function testGetCustomerOrderBundleProduct(): void\n {\n $qty = 1;\n $bundleSku = 'bundle-product-single-dropdown-option';\n /** @var CustomerPlaceOrder $bundleProductOrderFixture */\n $bundleProductOrderFixture = Bootstrap::getObjectManager()->create(CustomerPlaceOrder::class);\n $bundleProductOrderFixture->placeOrderWithBundleProduct(\n ['email' => '[email protected]', 'password' => 'password'],\n ['sku' => $bundleSku, 'quantity' => $qty]\n );\n $customerOrderResponse = $this->getCustomerOrderQueryBundleProduct();\n $customerOrderItems = $customerOrderResponse[0];\n $this->assertEquals(\"Pending\", $customerOrderItems['status']);\n $bundledItemInTheOrder = $customerOrderItems['items'][0];\n $this->assertEquals(\n 'bundle-product-single-dropdown-option-simple1',\n $bundledItemInTheOrder['product_sku']\n );\n $this->assertArrayHasKey('bundle_options', $bundledItemInTheOrder);\n $bundleOptionsFromResponse = $bundledItemInTheOrder['bundle_options'];\n $this->assertNotEmpty($bundleOptionsFromResponse);\n $this->assertEquals(1, count($bundleOptionsFromResponse));\n $expectedBundleOptions =\n [\n ['__typename' => 'ItemSelectedBundleOption',\n 'label' => 'Drop Down Option 1',\n 'values' => [\n [\n 'product_name' => 'Simple Product1',\n 'product_sku' => 'simple1',\n 'price' => [\n 'value' => 1,\n 'currency' => 'USD'\n ]\n ]\n ]\n ],\n ];\n $this->assertEquals($expectedBundleOptions, $bundleOptionsFromResponse);\n }",
"private function sync_pedido()\n {\n //listar os pedidos\n $this->get_pedidos();\n //verificar se existe em shopify\n\n //update no shopfy\n }",
"public function saveOrder()\n {\n $this->validate();\n $this->_initKlarnaCheckout(false, false);\n\n try {\n if (($merchantCheckboxMethod = $this->_helper->getCheckoutConfig('merchant_checkbox')) != -1) {\n $this->_helper->dispatchMerchantCheckboxMethod(\n $merchantCheckboxMethod, array(\n 'quote' => $this->getQuote(),\n 'klarna_quote' => $this->getKlarnaQuote(),\n 'checked' => (bool)$this->getKlarnaCheckout()->getData('merchant_requested/additional_checkbox')\n )\n );\n }\n\n $checkboxes = $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes');\n if (!empty($checkboxes)) {\n $this->_helper->dispatchMultipleCheckboxesEvent(\n $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes'),\n $this->getQuote(),\n $this->getKlarnaQuote()\n );\n }\n } catch (Mage_Core_Exception $e) {\n Mage::logException($e);\n // Don't stop order from saving just because the checkbox processing failed\n }\n\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n Mage::dispatchEvent(\n 'kco_checkout_save_order_before', array(\n 'checkout' => $this\n )\n );\n\n /**\n * For older versions of Magento state cannot be removed as a requirement\n * for shipping which is necessary in some countries.\n *\n * This checks if the Magento version is below 1.7 and disabled address validation\n */\n if (version_compare(Mage::getVersion(), '1.7.0', '<')) {\n $this->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->getQuote()->isVirtual()) {\n $this->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }\n\n $service = Mage::getModel('sales/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n /** @var Mage_Sales_Model_Order $order */\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent(\n 'checkout_type_kco_save_order_after', array(\n 'order' => $order,\n 'quote' => $this->getQuote()\n )\n );\n\n if ($order->getCanSendNewEmailFlag()) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession\n ->setLastOrderId($order->getId())\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => array())\n );\n\n return $order;\n }",
"public function massBergenStatusAction()\r\n {\r\n $orderIds = $this->getRequest()->getPost('order_ids', array());\r\n $countUnbergenStatus = 0;\r\n\r\n foreach ($orderIds as $orderId) {\r\n $order = Mage::getModel('sales/order')->load($orderId);\r\n if ($order && $order->getData('sync_bergen_status')!=1) {\r\n $order->setData('sync_bergen_status',1)->save();\r\n }\r\n $countUnbergenStatus++;\r\n }\r\n if ($countUnbergenStatus) {\r\n $this->_getSession()->addSuccess($this->__('%s order(s) have been ready for bergen.', $countUnbergenStatus));\r\n }\r\n $this->_redirect('*/*/');\r\n }",
"public function complete( $order ){\n\t\t$order->complete();\n\t}",
"public function isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted);\n }",
"public function applyPromotion()\n {\n $this->promotion->setOrder($this);\n }",
"private function SetOrderData()\n\t\t{\n\t\t\t// doesn't factor in cookies stored by Interspire Shopping Cart, so we have to pass back the\n\t\t\t// order token manually from those payment providers. We do this by taking the\n\t\t\t// cart ID passed back from the provider which stores the order's unique token.\n\t\t\tif(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t\t$this->orderToken = $_COOKIE['SHOP_ORDER_TOKEN'];\n\t\t\t}\n\t\t\telse if(isset($_REQUEST['provider'])) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $_REQUEST['provider']);\n\n\t\t\t\tif(in_array(\"GetOrderToken\", get_class_methods($this->paymentProvider))) {\n\t\t\t\t\t$this->orderToken = $this->paymentProvider->GetOrderToken();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tob_end_clean();\n\t\t\t\t\theader(sprintf(\"Location:%s\", $GLOBALS['ShopPath']));\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Load the pending orders from the database\n\t\t\t$this->pendingData = LoadPendingOrdersByToken($this->orderToken, true);\n\t\t\tif(!$this->orderToken || $this->pendingData === false) {\n\t\t\t\t$this->BadOrder();\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($this->paymentProvider === null) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $this->pendingData['paymentmodule']);\n\t\t\t}\n\n\t\t\tif($this->paymentProvider) {\n\t\t\t\t$this->paymentProvider->SetOrderData($this->pendingData);\n\t\t\t}\n\t\t}",
"public function check_order_complete()\n\t{\n\t\tforeach ( $this->completed_statuses as $completed ) {\n\t\t\tadd_action( 'woocommerce_order_status_' . $completed, array( 'TGS_Commission', 'log_commission_due' ) );\n\t\t}\n\t}",
"private function magentoOrderUpdate(\n \\Magento\\Sales\\Model\\Order $order,\n \\FBAOutboundServiceMWS_Model_GetFulfillmentOrderResult $fulfillmentOrderResult\n ) {\n $this->createShipment($order, $fulfillmentOrderResult);\n }",
"public function setOrder(Request $request) {\n $carts = $request->all();\n $hasError = false;\n for($i = 0; $i<count($carts); $i++) {\n $product = Product::find($carts[$i]['product']['id']);\n if($product) {\n $order = Order::create([\n 'domain_id'=>$product->domain()->first()->id,\n 'buyer_id'=>Auth::guard('api')->id(),\n 'product_id'=> $product->id,\n 'status' => 'pending',\n 'paid' => false,\n 'delivered' => false,\n 'received' => false,\n 'quantity' => (int)$carts[$i]['quantity'],\n 'price' => (int)$carts[$i]['quantity'] * $product->price\n ]);\n if(!$order) {\n $hasError = true; \n }\n }\n }\n if(!$hasError) {\n return response()->json([\n \"data\" => true\n ],200);\n }else{\n return response()->json(['error' => 'Resource not found'],404);\n }\n }",
"public static function MarkOrderProcessAsCompleted()\n {\n $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS] = true;\n }",
"public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }",
"function setSyncItemsCodeProduct()\n {\n }",
"function order_success()\n{\n\n}",
"public function FinishOrder()\n\t\t{\n\t\t\t// Orders are still incomplete, so we need to validate them\n\t\t\tif($this->pendingData['status'] == ORDER_STATUS_INCOMPLETE) {\n\t\t\t\t// Verify the pending order\n\t\t\t\t$newStatus = VerifyPendingOrder($this->orderToken);\n\n\t\t\t\t// Order was declined and we're rejecting all declined payments\n\t\t\t\tif($newStatus == ORDER_STATUS_DECLINED) {\n\t\t\t\t\t$Msg = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$this->BadOrder(GetLang('YourPaymentWasDeclined'), $Msg);\n\t\t\t\t}\n\t\t\t\t// This order is valid\n\t\t\t\telseif($newStatus !== false) {\n\n\t\t\t\t\t$prodOrdered = array();\n\t\t\t\t\t$items = getCustomerQuote()->getItems();\n\t\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t\t$productId = $item->getProductId();\n\t\t\t\t\t\tif($productId > 0) {\n\t\t\t\t\t\t\t$prodOrdered[] = $productId;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$_SESSION['ProductJustOrdered'] = implode(',',$prodOrdered);\n\t\t\t\t\t}\n\t\t\t\t\tif(CompletePendingOrder($this->orderToken, $newStatus)) {\n\t\t\t\t\t\t// Order was saved. Show the confirmation screen and email an invoice to the customer\n\t\t\t\t\t\t$this->ThanksForYourOrder();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If we're still here, either the order didnt complete or the order was invalid\n\t\t\t\t$this->BadOrder();\n\t\t\t}\n\t\t\t// Order is already complete - there's a good chance the customer has refreshed the page,\n\t\t\t// or they've come back from somewhere like PayPal who in the mean time has already sent\n\t\t\t// us a ping back to validate and begin processing the order - show the thank you page\n\t\t\telse if($this->pendingData['status'] == ORDER_STATUS_DECLINED) {\n\t\t\t\t\t$Msg = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$this->BadOrder(GetLang('YourPaymentWasDeclined'), $Msg);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->ThanksForYourOrder();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}",
"protected function getVendorOrders() {\n\n\t\t$this->load->model('sale/vdi_order');\n\t\t$data = array();\n\n if (isset($this->request->request['filter_order_status'])) {\n //check input - should be list of integers\n if (1 === preg_match('/^[0-9,\\s]+$/',\n $this->request->request['filter_order_status'])) {\n $data['filter_order_status'] = $this->request->request['filter_order_status'];\n }\n }\n\n $result = array();\n $orderCount = $this->model_sale_vdi_order->getTotalOrders($data);\n $result['total_order_count'] = $orderCount;\n\n if (!isset($this->request->request['metaonly']) ||\n (\"true\" !== $this->request->request['metaonly'])) {\n $orders = $this->model_sale_vdi_order->getOrdersByOrderProductStatus($data);\n $result['orders'] = $orders;\n }\n\n\t\treturn $result;\n\t}",
"public static function maybe_mark_complete() {\n\t\t// The install notice still exists so don't complete the profiler.\n\t\tif ( ! class_exists( 'WC_Admin_Notices' ) || \\WC_Admin_Notices::has_notice( 'install' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data = get_option( self::PROFILE_DATA_OPTION, array() );\n\t\t// Don't make updates if the profiler is completed, but task list is potentially incomplete.\n\t\tif ( isset( $onboarding_data['completed'] ) && $onboarding_data['completed'] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$onboarding_data['completed'] = true;\n\t\tupdate_option( self::PROFILE_DATA_OPTION, $onboarding_data );\n\t\tupdate_option( 'woocommerce_task_list_hidden', 'yes' );\n\t}",
"protected function addOrderCustomFields(): void\n {\n $custom_field_set_id = md5('Viacash custom_field_set');\n\n $this->container->get('custom_field_set.repository')->upsert(\n [\n [\n 'id' => $custom_field_set_id,\n 'name' => 'custom_viacash',\n 'config' => [\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Viacash\", \"en-GB\" => \"Viacash\"]),\n \"translated\" => true\n ],\n 'active' => true,\n 'global' => false,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field_set_relation.repository')->upsert(\n [\n [\n 'id' => md5('Viacash custom_field_set_relation'),\n 'customFieldSetId' => $custom_field_set_id,\n 'entityName' => 'order',\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_checkout_token'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_checkout_token',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Checkout-Token\", \"en-GB\" => \"Viacash Checkout-Token\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 1\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_slip_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_slip_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Slip-ID\", \"en-GB\" => \"Viacash Slip-ID\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 2\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_division_id'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_division_id',\n 'type' => 'text',\n 'config' => [\n 'type' => 'text',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Interne Barzahlen Divisions-Nummer\", \"en-GB\" => \"Internal Viacash division number\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"text\",\n \"customFieldPosition\" => 3\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_is_sandboxed'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_is_sandboxed',\n 'type' => 'switch',\n 'config' => [\n 'type' => 'switch',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Barzahlen Sandbox-Transaktion\", \"en-GB\" => \"Viacash sandboxed transaction\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"switch\",\n \"customFieldPosition\" => 4\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_refundable_amount'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_refundable_amount',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\n \"de-DE\" => \"Verbleibender per Barzahlen erstattbarer Betrag\",\n \"en-GB\" => \"Remaining amount that can be refunded with Viacash\",\n ]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n\n $this->container->get('custom_field.repository')->upsert(\n [\n [\n 'id' => md5('custom_viacash_validity_days'),\n 'customFieldSetId' => $custom_field_set_id,\n 'name' => 'custom_viacash_validity_days',\n 'type' => 'number',\n 'config' => [\n 'type' => 'number',\n \"label\" => $this->injectFallbackLanguage([\"de-DE\" => \"Gültigkeitsdauer des Zahlscheins in Tagen\", \"en-GB\" => \"Days of payslip validity.\"]),\n \"translated\" => true,\n \"componentName\" => \"sw-field\",\n \"customFieldType\" => \"number\",\n \"customFieldPosition\" => 5\n ],\n 'active' => true,\n ],\n ],\n Context::createDefaultContext()\n );\n }",
"public function installVendorForms()\n {\n $allowedAttributes = [\n 'public_name',\n 'shop_url',\n 'created_at',\n 'status',\n 'group',\n 'name',\n 'gender',\n 'profile_picture',\n 'email',\n 'contact_number',\n 'company_name',\n 'about',\n 'company_logo',\n 'company_banner',\n 'company_address',\n 'support_number',\n 'support_email',\n ];\n\n $typeId = $this->vendorModel->getEntityTypeId();\n\n $vendorAttributes = $this->attributeFactory->create()->getCollection()\n ->addFieldToFilter('entity_type_id', ['eq' => $typeId])\n //->addFieldToFilter('attribute_code',['in'=>$allowedAttributes))\n ->setOrder('attribute_id', 'ASC');\n\n foreach ($vendorAttributes as $attribute) {\n $sortOrder = array_keys($allowedAttributes, $attribute->getAttributeCode());\n $sortOrder = isset($sortOrder[0]) ? $sortOrder[0] : 0;\n $visibility = in_array($attribute->getAttributeCode(), $allowedAttributes) ? 1 : 0;\n $data[] = [\n 'attribute_id' => $attribute->getId(),\n 'attribute_code' => $attribute->getAttributeCode(),\n 'is_visible' => $visibility,\n 'sort_order' => $sortOrder,\n 'store_id' => 0\n ];\n }\n\n if (!empty($data)) {\n $this->form->insertMultiple($data);\n }\n }",
"public function order_processing( $order_id ) {\n\t\t$order = new WC_Order( $order_id ); // load the order from woocommerce\n\t\t$this->notify_warehouse($order); // notify the warehouse to ship the order\n\t}",
"public function store(Request $request)\n {\n // dd($request->all());\n\n // validate form data\n $request->validate([\n 'shipping_fullname' => 'required',\n 'shipping_state' => 'required',\n 'shipping_city' => 'required',\n 'shipping_address' => 'required',\n 'shipping_phone' => 'required',\n 'shipping_zipcode' => 'required',\n 'payment_method' => 'required',\n ]);\n\n $order = new ProductOrder(); // create new productorder\n\n $order->product_order_number = uniqid('ProductOrderNumber-'); // Unique order number\n\n $order->shipping_fullname = $request->input('shipping_fullname'); // Coming from checkout form\n $order->shipping_state = $request->input('shipping_state'); // Coming from checkout form\n $order->shipping_city = $request->input('shipping_city'); // Coming from checkout form\n $order->shipping_address = $request->input('shipping_address'); // Coming from checkout form\n $order->shipping_phone = $request->input('shipping_phone'); // Coming from checkout form\n $order->shipping_zipcode = $request->input('shipping_zipcode'); // Coming from checkout form\n\n \n if(!$request->has('billing_fullname')) \n {\n $order->billing_fullname = $request->input('shipping_fullname'); // Coming from checkout form\n $order->billing_state = $request->input('shipping_state'); // Coming from checkout form\n $order->billing_city = $request->input('shipping_city'); // Coming from checkout form\n $order->billing_address = $request->input('shipping_address'); // Coming from checkout form\n $order->billing_phone = $request->input('shipping_phone'); // Coming from checkout form\n $order->billing_zipcode = $request->input('shipping_zipcode'); // Coming from checkout form\n }\n else \n {\n $order->billing_fullname = $request->input('billing_fullname');\n $order->billing_state = $request->input('billing_state');\n $order->billing_city = $request->input('billing_city');\n $order->billing_address = $request->input('billing_address');\n $order->billing_phone = $request->input('billing_phone');\n $order->billing_zipcode = $request->input('billing_zipcode');\n }\n\n $order->grand_total = \\Cart::session(auth()->id())->getTotal(); // Coming from the cart session\n $order->item_count = \\Cart::session(auth()->id())->getContent()->count(); \n // Coming from the cart session\n\n $order->user_id = auth()->id(); // Coming from the logged in user id\n\n $order->save(); // data save in orders table\n\n //Collect order items from the cart\n $cartItems = \\Cart::session(auth()->id())->getContent();\n\n foreach($cartItems as $item) \n {\n\n //Collect order items from the cart\n //$order coming from order table\n //items coming from $cartItems as well as cart table\n\n $order->items()->attach($item->id, ['price'=> $item->price, 'quantity'=> $item->quantity]); \n \n }\n\n //payment\n \n // if(request('payment_method') == 'paypal') {\n //redirect to paypal\n // return redirect()->route('paypal.checkout', $order->id);\n\n // }\n\n if(request('payment_method') == 'ssl-commerz') {\n\n // $tempid=$order->id;\n \n //$name=$request->input('shipping_fullname');\n\n // $data = DB::select('select shipping_fullname from product_orders where ('id', $tempid)');\n // $data = DB::table('product_orders')->where('id',$tempid)->get();\n $articles = ['Article 1','Article 2','Article 3'];\n return redirect()->route('example2',['articles' => $articles]);\n /*\n $data = array (\n 'title'=>'My App yo',\n 'Description'=>'This is New Application',\n 'author'=>'foo'\n );\n */\n //redirect to SSL-PAY\n // return redirect()->route('example2');\n // return redirect('/example2', compact('name'));\n // return redirect()->route('example2', compact('data'));\n // return redirect('/example2',compact('name'));\n \n // return \"SSL test\";\n\n }\n\n\n //empty cart\n \\Cart::session(auth()->id())->clear();\n\n //Sent email to customer\n\n //take user to thank you\n\n\n // dd('order created' , $order);\n return \"order completed, thank you for your order\";\n\n // return redirect()->route('home')->withMessage('Order has been placed');\n\n }",
"public function manageOrderProducts()\n {\n }",
"private function completeImportProduct()\n {\n if (!empty($this->data['new_features'])) {\n $feature_types_model = $this->getModel('typeFeatures');\n /**\n * @var shopTypeFeaturesModel $feature_types_model\n */\n foreach ($this->data['new_features'] as $feature) {\n if (!empty($feature['types'])) {\n $feature_types_model->updateByFeature($feature['id'], $feature['types'], false);\n }\n }\n }\n $this->fixSkuName();\n }",
"public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }",
"function wisync_order_complete( $order_id, $status ) {\n\n\tglobal $wpdb;\n\t// Set the table name we're using\n\t$table_name = $wpdb->prefix . 'wisync';\n\n\t// Get the order using the order_id\n\t$order = new WC_Order( $order_id );\n\n\t// Get the order data out of the object as an associative array\n\t$order_data = $order->get_data();\n\n\t// Make an array to store the order data we need for i.LEVEL\n\t$order_array = array();\n\n\t// Set the Customer_id (Customer id)\n\t$order_array['Customer_id'] = $order->get_customer_id();\n\t// Set the Warehouse_id (Warehouse id indicates the warehouse from which the stock for the order should be taken. Default 0 for main warehouse. Use multiplewarehouse resource (if active on your system) for details of available warehouses.)\n\t$order_array['Warehouse_id'] = 0;\n\t// Set the Order_Ref (Order reference can be passed in. If passed it will be used with the Order_Source to check uniqueness)\n\t$order_array['Order_Ref'] = $order_data['order_key'];\n\t// Set the Order_source (Order source)\n\t// $order_array['Order_Source'] = get_site_url();\n\t$order_array['Order_Source'] = 'WooCommerce';\n\t// Set the Order_Date (Creation date of the order)\n\t// $order_array['Order_Date'] = $order->get_date_completed()->format('Y-m-d H:i:s');\n\t$order_array['Order_Date'] = $order->get_date_completed();\n\t// Set the Marketplace_Status (Web/marketplace order status)\n\t$order_array['Marketplace_Status'] = $order->get_status();\n\t// Set the Name (Delivery customer name)\n\t$order_array['Name'] = $order->get_shipping_first_name() .' '. $order->get_shipping_last_name();\n\t// Set the Address1 (Delivery address line 1)\n\t$order_array['Address1'] = $order->get_shipping_address_1();\n\t// Set the Address2 (Delivery address line 2)\n\t$order_array['Address2'] = $order->get_shipping_address_2();\n\t// Set the Town (Delivery address line 3)\n\t$order_array['Town'] = $order->get_shipping_city();\n\t// Set the County (Delivery address line 4)\n\t$order_array['County'] = $order->get_shipping_state();\n\t// Set the Postcode (Delivery postcode)\n\t$order_array['Postcode'] = $order->get_shipping_postcode();\n\t// Set the Gross (Total order value including Taxes and delivery)\n\t$order_array['Gross'] = floatval( $order->get_subtotal() );\n\t// $order_array['Gross'] = floatval( $order->get_total() - $order->get_shipping_total() );\n\t// Set the VAT (Total VAT value for the order)\n\t$order_array['VAT'] = floatval( $order->get_total_tax() );\n\t// Set the VAT_Code (VAT code)\n\t$order_array['VAT_Code'] = $order->get_taxes();\n\t// Set the currency (Order currency code)\n\t$order_array['Currency'] = $order->get_currency();\n\t// Set the Country (Delivery address country code)\n\t$order_array['Country_Code'] = $order->get_shipping_country();\n\n\t/*---------------------*/\n\t/*-- Handle Customer --*/\n\t/*---------------------*/\n\n\t// Get the customer's billing details in the order\n\t$order_array['RetailCustomer']['Forename'] = $order->get_billing_first_name();\n\t$order_array['RetailCustomer']['Surname'] = $order->get_billing_last_name();\n\t$order_array['RetailCustomer']['Company_Name'] = $order->get_billing_company();\n\t$order_array['RetailCustomer']['Address1'] = $order->get_billing_address_1();\n\t$order_array['RetailCustomer']['Address2'] = $order->get_billing_address_2();\n\t$order_array['RetailCustomer']['Town'] = $order->get_billing_city();\n\t$order_array['RetailCustomer']['County'] = $order->get_billing_state();\n\t$order_array['RetailCustomer']['Country_Code'] = $order->get_billing_country();\n\t$order_array['RetailCustomer']['Postcode'] = $order->get_billing_postcode();\n\t$order_array['RetailCustomer']['Telephone'] = $order->get_billing_phone();\n\t$order_array['RetailCustomer']['Email'] = $order->get_billing_email();\n\t$order_array['RetailCustomer']['Comments'] = $order->get_customer_note();\n\t$order_array['RetailCustomer']['Accounts_Ref'] = $order->get_transaction_id();\n\n\t/*------------------*/\n\t/*-- Handle Items --*/\n\t/*------------------*/\n\n\t// Make an array to store order items\n\t$items_array = array();\n\n\t// Get the items in the order\n\t$items = $order->get_items();\n\n\tforeach ( $items as $item ) {\n\n\t\t// Pass the item to be converted into a JSON object\n\t\t$item_json = build_array_of_ordered_items( $item );\n\n\t\t// Push the json object to the items_array\n\t\tarray_push( $items_array, $item_json);\n\n\t}\n\n\t// Add the items array to the order array\n\t$order_array['Items'] = $items_array;\n\n\t// JSON encode the order_array\n\t$order_json = json_encode($order_array);\n\n\t// Query the database to get API login details\n\t$login = $wpdb->get_row( \"SELECT * FROM $table_name WHERE id = 1\", ARRAY_A );\n\n\t$order_upload = post_order( $login, $order_json );\n\n\tif ( $order_upload ) {\n\n\t\twisync_admin_notice__success( 'Order recorded at i.LEVEL' );\n\n\t}\n\n}",
"public function setShippingValues(Order $order): void;",
"public function updateOrder() {\n\n echo \"ok\";\n }",
"public function upgrade(\n \\Magento\\Framework\\Setup\\ModuleDataSetupInterface $setup,\n \\Magento\\Framework\\Setup\\ModuleContextInterface $context\n ) {\n $setup->startSetup();\n\n if(version_compare($context->getVersion(), '1.0.14', '<')) {\n // Intallation of required statuses\n $availableStatuses = [\n OrderInterface::STATUS_DUPLICATE => __('Dotpay payment possible duplicate'),\n OrderInterface::STATUS_REFUND_NEW => __('Dotpay payment refund initialized'),\n OrderInterface::STATUS_REFUNDED => __('Dotpay payment refunded'),\n OrderInterface::STATUS_REFUND_FAILED => __('Dotpay payment refund failed'),\n ];\n $statusData = [];\n foreach ($availableStatuses as $code => $label) {\n $statusData[] = [\n 'status' => $code,\n 'label' => $label,\n ];\n }\n try {\n $setup->getConnection()->insertArray(\n $setup->getTable('sales_order_status'),\n ['status', 'label'],\n $statusData\n );\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n // Installation of required order states\n $stateData = [\n [\n 'status' => OrderInterface::STATUS_DUPLICATE,\n 'state' => \\Magento\\Sales\\Model\\Order::STATE_PROCESSING,\n 'is_default' => 1,\n 'visible_on_front' => 1,\n ], [\n 'status' => OrderInterface::STATUS_REFUND_NEW,\n 'state' => \\Magento\\Sales\\Model\\Order::STATE_CLOSED,\n 'is_default' => 1,\n 'visible_on_front' => 1,\n ], [\n 'status' => OrderInterface::STATUS_REFUNDED,\n 'state' => \\Magento\\Sales\\Model\\Order::STATE_CLOSED,\n 'is_default' => 1,\n 'visible_on_front' => 1,\n ], [\n 'status' => OrderInterface::STATUS_REFUND_FAILED,\n 'state' => \\Magento\\Sales\\Model\\Order::STATE_CLOSED,\n 'is_default' => 1,\n 'visible_on_front' => 1,\n ],\n ];\n\n try {\n $setup->getConnection()->insertArray(\n $setup->getTable('sales_order_status_state'),\n ['status', 'state', 'is_default', 'visible_on_front'],\n $stateData\n );\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n }\n\n $setup->endSetup();\n }",
"public function updated(Order $order)\n {\n foreach (OrderProduct::where('order_id',$order->id)->get() as $orderProduct) {\n $product = Product::find($orderProduct->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($orderProduct->product_id);\n $product->save();\n }\n }",
"public function testUpdateVendorComplianceSurveyCustomFields()\n {\n }",
"public function markCartsProductsAsFirst(Order $draftOrder): bool;",
"public function submitOrderToAmazon(Varien_Event_Observer $observer)\n {\n $helper = Mage::helper('amazon_mcf');\n $order = $observer->getOrder();\n\n // Do we have any items to submit to Amazon?\n $amazonItemInOrder = false;\n foreach ($order->getAllItems() as $item) {\n if ($item->getProduct()->getAmazonMcfEnabled()) {\n $order->setFulfilledByAmazon(true);\n $amazonItemInOrder = true;\n break;\n }\n }\n\n if (!$helper->isEnabled() || !$amazonItemInOrder) {\n return;\n }\n\n /**\n * @var Amazon_MCF_Model_Service_Outbound $service\n */\n $service = Mage::getSingleton('amazon_mcf/service_outbound');\n $response = $service->createFulfillmentOrder($order);\n\n if (!empty($response)) {\n $order->setAmazonOrderStatus(\n Amazon_MCF_Helper_Data::ORDER_STATUS_RECEIVED\n );\n } else {\n $order->setAmazonOrderStatus(\n Amazon_MCF_Helper_Data::ORDER_STATUS_ATTEMPTED\n );\n $order->setAmazonOrderSubmissionCount(1);\n }\n }",
"public function set_staff_free_order($value)\n {\n $this->staff_free_order = $value;\n if ($this->staff_free_order) {\n foreach ($this->order_configurations as $config) {\n $config->individual_cost = 0;\n $config->calculateSubtotal();\n }\n }\n }",
"function save_custom_field( $post_id ) {\r\n $user = wp_get_current_user();\r\n $_warehouse_flag = isset( $_POST['_warehouse_flag'] ) ? $_POST['_warehouse_flag'] : '';\r\n $product = wc_get_product( $post_id );\r\n \r\n if($_warehouse_flag==1){\r\n\t $product->update_meta_data( '_warehouse_flag', 'A' );\r\n }\r\n if($_warehouse_flag==2){\r\n\t $product->update_meta_data( '_warehouse_flag', 'V' );\r\n }\r\n $_enable_warehouse = isset( $_POST['_enable_warehouse'] ) ? $_POST['_enable_warehouse'] : '0';\r\n \r\n \r\n $product->update_meta_data( '_enable_warehouse', $_enable_warehouse );\r\n if($_enable_warehouse==1){\r\n\t $categories = [ 'Warehouse Product'];\r\n\t wp_set_object_terms( $post_id, $categories, 'warehouses' );\r\n }\r\n else{\r\n\t $categories = [ 'Warehouse Product'];\r\n\t wp_set_object_terms( $post_id, null, 'warehouses' );\r\n }\r\n \r\n $product->save();\r\n \r\n \r\n}",
"function complete()\n\t{\n\t\tglobal $db;\n\n\t\t$sqls = array();\n\t\t$complete = @$_POST['complete'];\n\t\tif (!strlen($complete)) { $complete = NO; }\n\n\t\t// set the customer status'\n\t\twhile (list($customerID,$status) = each($this->customer_status))\n\t\t{\n\t\t\t$sqls[] = \"UPDATE preorder_customers SET prc_status=$status WHERE prc_preorderID=$this->preorderID AND prc_customerID=$customerID\";\n\t\t}\n\n\t\tif ($complete)\n\t\t{\n\t\t\t// change the status to complete\n\t\t\t$sqls[] = \"UPDATE preorders SET pre_status=\".PRE_COMPLETED.\" WHERE pre_preorderID=$this->preorderID\";\n\t\t}\n\n\t\twhile (list($a,$sql) = each($sqls))\n\t\t{\n\t\t\tmysql_query($sql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t}\n\n\t\treturn ($complete?'Preorder completed':'Saved preorder information');\n\t}",
"public function update( \\Aimeos\\MW\\Observer\\Publisher\\Iface $order, $action, $value = null )\n\t{\n\t\tif( ( $value & \\Aimeos\\MShop\\Order\\Item\\Base\\Base::PARTS_PRODUCT ) === 0 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t\\Aimeos\\MW\\Common\\Base::checkClass( '\\\\Aimeos\\\\MShop\\\\Order\\\\Item\\\\Base\\\\Iface', $order );\n\n\t\t$productIds = [];\n\t\tforeach( $order->getProducts() as $pr ) {\n\t\t\t$productIds[] = $pr->getProductId();\n\t\t}\n\n\t\t$productManager = \\Aimeos\\MShop\\Factory::createManager( $this->getContext(), 'product' );\n\n\t\t$search = $productManager->createSearch();\n\t\t$search->setConditions( $search->compare( '==', 'product.id', $productIds ) );\n\t\t$checkItems = $productManager->searchItems( $search );\n\n\t\t$notAvailable = [];\n\t\t$now = date( 'Y-m-d H-i-s' );\n\n\t\tforeach( $order->getProducts() as $position => $orderProduct )\n\t\t{\n\t\t\tif( !array_key_exists( $orderProduct->getProductId(), $checkItems ) )\n\t\t\t{\n\t\t\t\t$notAvailable[$position] = 'gone.notexist';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$product = $checkItems[$orderProduct->getProductId()];\n\n\t\t\tif( $product->getStatus() <= 0 )\n\t\t\t{\n\t\t\t\t$notAvailable[$position] = 'gone.status';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$start = $product->getDateStart();\n\t\t\t$end = $product->getDateEnd();\n\n\t\t\tif( ( ( $start !== null ) && ( $start >= $now ) ) || ( ( $end !== null ) && ( $now > $end ) ) ) {\n\t\t\t\t$notAvailable[$position] = 'gone.timeframe';\n\t\t\t}\n\t\t}\n\n\t\tif( count( $notAvailable ) > 0 )\n\t\t{\n\t\t\t$code = array( 'product' => $notAvailable );\n\t\t\t$msg = $this->getContext()->getI18n()->dt( 'mshop', 'Products in basket not available' );\n\t\t\tthrow new \\Aimeos\\MShop\\Plugin\\Provider\\Exception( $msg, -1, null, $code );\n\t\t}\n\n\t\treturn true;\n\t}",
"public function vendor_accept_order($info)\n {\n $this->load->model('bitcoin_model');\n $this->load->model('bip32_model');\n $this->load->model('accounts_model');\n\n if ($info['initiating_user'] == 'buyer') {\n // Buyer public key is in $info.buyerpubkey array, also ID in update fields.\n\n $buyer_public_key = $info['buyer_public_key'];\n $this->update_order($info['order']['id'], $info['update_fields']);\n foreach ($info['update_fields'] as $key => $field) {\n $info['order'][$key] = $field;\n }\n $info['update_fields'] = array();\n } else {\n $buyer_public_key = $info['order']['public_keys']['buyer'];\n }\n\n // Add vendors public key no matter what we're doing!\n $vendor_public_key = $this->bip32_model->add_child_key(array(\n 'user_id' => $info['order']['vendor']['id'],\n 'user_role' => 'Vendor',\n 'order_id' => $info['order']['id'],\n 'order_hash' => '',\n 'parent_extended_public_key' => $info['vendor_public_key']['parent_extended_public_key'],\n 'provider' => $info['vendor_public_key']['provider'],\n 'extended_public_key' => $info['vendor_public_key']['extended_public_key'],\n 'public_key' => $info['vendor_public_key']['public_key'],\n 'key_index' => $info['vendor_public_key']['key_index']\n ));\n\n // Get vendors public key, stored by that function.\n $admin_public_key = $this->bip32_model->get_next_admin_child();\n\n if ($admin_public_key == FALSE) {\n return 'An error occured, which prevented your order being created. Please notify an administrator.';\n } else {\n $admin_public_key = $this->bip32_model->add_child_key(array(\n 'user_id' => '0',\n 'user_role' => 'Admin',\n 'order_id' => $info['order']['id'],\n 'order_hash' => '',\n 'parent_extended_public_key' => $admin_public_key['parent_extended_public_key'],\n 'provider' => 'Manual',\n 'extended_public_key' => $admin_public_key['extended_public_key'],\n 'public_key' => $admin_public_key['public_key'],\n 'key_index' => $admin_public_key['key_index']\n ));\n $public_keys = array($buyer_public_key['public_key'], $vendor_public_key['public_key'], $admin_public_key['public_key']);\n $sorted_keys = RawTransaction::sort_multisig_keys($public_keys);\n $multisig_details = RawTransaction::create_multisig('2', $sorted_keys);\n\n // If no errors, we're good to create the order!\n if ($multisig_details !== FALSE) {\n $this->bitcoin_model->log_key_usage('order', $this->bw_config->bip32_mpk, $admin_public_key['key_index'], $admin_public_key['public_key'], $info['order']['id']);\n\n $info['update_fields']['vendor_public_key'] = $vendor_public_key['id'];\n $info['update_fields']['admin_public_key'] = $admin_public_key['id'];\n $info['update_fields']['buyer_public_key'] = $buyer_public_key['id'];\n $info['update_fields']['address'] = $multisig_details['address'];\n $info['update_fields']['redeemScript'] = $multisig_details['redeemScript'];\n $info['update_fields']['selected_payment_type_time'] = time();\n $info['update_fields']['progress'] = 2;\n $info['update_fields']['time'] = time();\n\n if ($info['order_type'] == 'escrow') {\n $info['update_fields']['vendor_selected_escrow'] = '1';\n $info['update_fields']['extra_fees'] = ((($info['order']['price'] + $info['order']['shipping_costs']) / 100) * $this->bw_config->escrow_rate);\n } else {\n $info['update_fields']['vendor_selected_escrow'] = '0';\n $info['update_fields']['vendor_selected_upfront'] = '1';\n $info['update_fields']['extra_fees'] = ((($info['order']['price'] + $info['order']['shipping_costs']) / 100) * $this->bw_config->upfront_rate);\n }\n\n if ($this->update_order($info['order']['id'], $info['update_fields']) == TRUE) {\n $this->bitcoin_model->add_watch_address($multisig_details['address'], 'order');\n\n $subject = 'Confirmed Order #' . $info['order']['id'];\n $message = \"Your order with {$info['order']['vendor']['user_name']} has been confirmed.\\n\" . (($info['order_type'] == 'escrow') ? \"Escrow payment was chosen. Once you pay to the address, the vendor will ship the goods. You can raise a dispute if you have any issues.\" : \"You must make payment up-front to complete this order. Once the full amount is sent to the address, you must sign a transaction paying the vendor.\");\n $this->order_model->send_order_message($info['order']['id'], $info['order']['buyer']['user_name'], $subject, $message);\n\n $subject = 'New Order #' . $info['order']['id'];\n $message = \"A new order from {$info['order']['buyer']['user_name']} has been confirmed.\\n\" . (($info['order_type'] == 'escrow') ? \"Escrow was chosen for this order. Once paid, you will be asked to sign the transaction to indicate the goods have been dispatched.\" : \"Up-front payment was chosen for this order based on your settings for one of the items. The buyer will be asked to sign the transaction paying you immediately after payment, which you can sign and broadcast to mark the order as dispatched.\");\n $this->order_model->send_order_message($info['order']['id'], $info['order']['vendor']['user_name'], $subject, $message);\n\n $msg = ($info['initiating_user'] == 'buyer')\n ? 'This order has been automatically accepted, visit the orders page to see the payment address!'\n : 'You have accepted this order! Visit the orders page to see the monero address!';\n $this->current_user->set_return_message($msg, 'success');\n return TRUE;\n } else {\n return 'There was an error creating your order.';\n }\n } else {\n return 'Unable to create address.';\n }\n }\n }",
"public function test_order_with_successful_response()\n {\n $token = $this->authenticate();\n\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $response = $this->post(\n '/api/order',\n [\n 'product_id' => $product->id,\n 'quantity' => 1,\n ],\n [\n 'Authorization' => sprintf('Bearer %s', $token),\n 'Accept' => 'application/json',\n ]\n );\n\n $response->assertStatus(201)\n ->assertExactJson(['message' => 'You have sucessfully ordered this product.']);\n }",
"private function calculateOrderAmount()\n {\n if ($this->getOffer() instanceof Offer) {\n //recalculates the new amount\n $this->getOffer()->calculateInvoiceAmount();\n Shopware()->Models()->persist($this->getOffer());\n }\n }",
"public static function fetch_order_status() {\n $order_id = wc_get_order( $_POST['order_id'] );\n $order_key = OmisePluginHelperWcOrder::get_order_key_by_id( $order_id );\n\n if ( ! wp_verify_nonce( $_POST['nonce'], $order_key ) ) {\n die ( 'Busted!');\n }\n\n wp_send_json_success( array( 'order_status' => $order_id->get_status() ) );\n }",
"protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }",
"public function bergenStatusAction()\r\n {\r\n if ($order = $this->_initOrder()) {\r\n try {\r\n $order->setData('sync_bergen_status',1)->save();\r\n $this->_getSession()->addSuccess(\r\n $this->__('The order has been ready for bergen.')\r\n );\r\n }\r\n catch (Mage_Core_Exception $e) {\r\n $this->_getSession()->addError($e->getMessage());\r\n }\r\n catch (Exception $e) {\r\n $this->_getSession()->addError($this->__('The order was not ready for bergen.'));\r\n }\r\n }\r\n $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));\r\n }",
"public function createPurchaseOrder(Request $request)\n {\n $data = $request->input();\n\n $suppliers = array();\n\n foreach ($data as $key => $value) {\n $bestSupplier = ProductSuppliers::getBestSupplierForProduct($key);\n\n if(array_key_exists($bestSupplier['entity'], $suppliers))\n array_push($suppliers[$bestSupplier['entity']], $bestSupplier);\n else\n $suppliers[$bestSupplier['entity']] = [$bestSupplier];\n }\n\n foreach($suppliers as $supplier) {\n $documentLines = [];\n\n for($i = 0; $i < count($supplier); $i++) {\n $product = [\n 'description' => $supplier[$i]['description'],\n 'quantity' => $data[$supplier[$i]['product']],\n 'unitPrice' => number_format(floatval($supplier[$i]['price']), 2),\n 'deliveryDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\")+1, date(\"Y\"))),\n 'unit' => 'UN',\n 'itemTaxSchema' => 'ISENTO',\n 'purchasesItem' => $supplier[$i]['product'],\n 'documentLineStatus' => 'OPEN'\n ];\n\n array_push($documentLines, $product);\n }\n\n try {\n $result = JasminConnect::callJasmin('/purchases/orders', '', 'GET');\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $seriesNumber = count(json_decode($result->getBody(), true)) + 1;\n\n try {\n $body = [\n 'documentType' => 'ECF',\n 'company' => 'TP-INDUSTRIES',\n 'serie' => '2019',\n 'seriesNumber' => $seriesNumber,\n 'documentDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'postingDate' => date(\"Y-m-d\", mktime(0, 0, 0, date(\"m\") , date(\"d\"), date(\"Y\"))),\n 'SellerSupplierParty' => $supplier[0]['entity'],\n 'SellerSupplierPartyName' => $supplier[0]['name'],\n 'accountingParty' => $supplier[0]['entity'],\n 'exchangeRate' => 1,\n 'discount' => 0,\n 'loadingCountry' => $supplier[0]['country'],\n 'unloadingCountry' => 'PT',\n 'currency' => 'EUR',\n 'paymentMethod' => 'NUM',\n 'paymentTerm' => '01',\n 'documentLines' => $documentLines\n ];\n\n JasminConnect::callJasmin('/purchases/orders', '', 'POST', $body);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }\n\n return $data;\n }",
"protected function _set_update_complete()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $software = new Software($this->package);\n\n if ($software->is_installed()) {\n $version = $software->get_version();\n $release = $software->get_release();\n } else {\n $version = 0;\n $release = 0;\n }\n\n $payload = $this->request('SetUpdateComplete', '&version=' . $version . '&release=' . $release);\n }",
"public function handleOrderComplete(Event $event)\n {\n $orderModel = $event->params['order'];\n\n if ($orderModel instanceof Commerce_OrderModel && $orderModel->isPaid()) {\n try {\n self::sendOrderCompleteMessage($orderModel);\n } catch (\\Exception $exception) {\n /** @var \\Craft\\Commerce_OrderStatusModel $orderStatus */\n $orderStatus = craft()->commerce_orderStatuses->getOrderStatusByHandle('failed');\n\n if ($orderStatus) {\n $orderModel->orderStatusId = $orderStatus->id;\n\n craft()->commerce_orders->saveOrder($orderModel);\n } else {\n throw $exception;\n }\n }\n }\n }",
"function update_sales_order_version($order)\n{\n foreach ($order as $so_num => $so_ver) {\n $sql= 'UPDATE '.TB_PREF.'sales_orders SET version=version+1 WHERE order_no='. db_escape($so_num).\n\t' AND version='.$so_ver . \" AND trans_type=30\";\n db_query($sql, 'Concurrent editing conflict while sales order update');\n }\n}"
] | [
"0.66662884",
"0.6451834",
"0.63869214",
"0.6166922",
"0.59090817",
"0.59000254",
"0.58038867",
"0.56576085",
"0.56402695",
"0.5597151",
"0.5570989",
"0.5551745",
"0.5549113",
"0.5529215",
"0.5507449",
"0.5482616",
"0.5479839",
"0.54728526",
"0.5471566",
"0.5453172",
"0.5442421",
"0.5424943",
"0.54234374",
"0.54147094",
"0.5401136",
"0.5384468",
"0.53829247",
"0.537667",
"0.53687406",
"0.5355456",
"0.5351823",
"0.5349033",
"0.53248346",
"0.5315449",
"0.53094673",
"0.5293374",
"0.52891874",
"0.5272186",
"0.5264527",
"0.5252019",
"0.52468807",
"0.5243847",
"0.5241153",
"0.52363896",
"0.52310914",
"0.5203432",
"0.52031916",
"0.519202",
"0.5191353",
"0.5190772",
"0.51858115",
"0.5185037",
"0.51682997",
"0.51649725",
"0.51610494",
"0.51583195",
"0.5153846",
"0.515316",
"0.51531106",
"0.5144833",
"0.5142963",
"0.51359475",
"0.5126561",
"0.51262164",
"0.5099641",
"0.5099048",
"0.507997",
"0.5079777",
"0.5078316",
"0.5077232",
"0.50763357",
"0.5067762",
"0.50617164",
"0.50590503",
"0.505376",
"0.5051612",
"0.50502646",
"0.5047479",
"0.50351816",
"0.50296634",
"0.5029419",
"0.5028297",
"0.50263935",
"0.50247043",
"0.50146925",
"0.5008217",
"0.5002838",
"0.49983218",
"0.49970824",
"0.49883744",
"0.49845952",
"0.49823526",
"0.49811116",
"0.49773163",
"0.49766314",
"0.4970315",
"0.49650154",
"0.49611872",
"0.49579078",
"0.4950147"
] | 0.7994449 | 0 |
Mark WC Marketplace order as Shipped | function wcfm_wcmarketplace_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = absint( $_POST['productid'] );
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$vendor = get_wcmp_vendor($user_id);
$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);
$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);
if (!in_array($user_id, $shippers)) {
$shippers[] = $user_id;
//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];
//if (!empty($mails)) {
//$customer_email = get_post_meta($order_id, '_billing_email', true);
//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );
//}
do_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);
array_push($shippers, $user_id);
}
$wpdb->query("UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id");
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class="wcfm_dashboard_item_title" target="_blank" href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
add_comment_meta( $comment_id, '_vendor_id', $user_id );
update_post_meta($order_id, 'dc_pv_shipped', $shippers);
} else {
$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"public function setShippingValues(Order $order): void;",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"public function isAutoShipping(): bool;",
"public function testUpdateExternalShipment()\n {\n }",
"public function ship($parcel)\n {\n return TRUE;\n }",
"function quote($method = '') {\r\n\r\n\t\tglobal $order, $shipping_weight, $shipping_num_boxes, $transittime, $dispinsure, $packing;\r\n\r\n\t\tif ($this->dimensions_support > 0 && is_object($packing)) {\r\n\r\n\t\t\tif ($this->dimensions_support == 1) { // # only ready to ship items are set with dimensions\r\n\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\tif ($boxesToShip[$i]['item_length'] == 0) { // size wasn't set\r\n\t\t\t\t\t\tif ($boxesToShip[$i]['item_weight'] > 60) { // use module estimated dimesions when size not set\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 50) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 40) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 30) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 20) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 10) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 5) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_length'] = $length;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_width'] = $width;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_height'] = $height;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$numBoxes = $packing->getNumberOfBoxes();\r\n\r\n\t\t\tif (SHIPPING_UNIT_LENGTH == 'CM') { // must convert centimeters to inches before getting quote\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\t$boxesToShip[$i]['item_length'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_width'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_height'] *= 0.39370079;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // # The old method. tell us how many boxes plus the box weight\r\n\r\n\t\t\tif ($shipping_weight > 60) { // these are defined in inches and don't need converting\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t} elseif ($shipping_weight > 50) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t} elseif ($shipping_weight > 40) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t} elseif ($shipping_weight > 30) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t} elseif ($shipping_weight > 20) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t} elseif ($shipping_weight > 10) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t} elseif ($shipping_weight > 5) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t} else {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t}\r\n\r\n\t\t\t$package = array('item_weight' => $shipping_weight,\r\n\t\t\t\t'item_price' => round($order->info['subtotal'] / $shipping_num_boxes, 2),\r\n\t\t\t\t'item_length' => $length,\r\n\t\t\t\t'item_width' => $width,\r\n\t\t\t\t'item_height' => $height);\r\n\r\n\t\t\t$boxesToShip = array();\r\n\r\n\t\t\tfor ($i = 0; $i < $shipping_num_boxes; $i++) {\r\n\t\t\t\t$boxesToShip[] = $package;\r\n\t\t\t}\r\n\r\n\t\t\t$totalWeight = round($shipping_weight * $shipping_num_boxes, 2);\r\n\t\t\t$numBoxes = $shipping_num_boxes;\r\n\t\t}\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'KGS') { // # must convert kilograms to pounds before getting quote\r\n\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t$boxesToShip[$i]['item_weight'] *= 2.2046226;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($this->display_weight) {\r\n\t\t\t$shiptitle = sprintf(MODULE_SHIPPING_USPS_TEXT_WEIGHT_DISPLAY, $numBoxes, $totalWeight);\r\n\t\t} else {\r\n\t\t\t$shiptitle = '';\r\n\t\t}\r\n\t\t$this->dest_zip = str_replace(' ', '', $order->delivery['postcode']);\r\n\t\tif ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { // domestic quote\r\n\t\t\t$this->dest_zip = substr($this->dest_zip, 0, 5);\r\n\t\t\t$dmstcquotes = array();\r\n\t\t\tif( $this->display_transit ){\r\n\t\t\t\t$trnstime = $this->_getDmstcTransitTimes();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$error = false;\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getDmstcQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($dmstcquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailavail'] = ($dmstcquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineavail'] = ($dmstcquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($dmstcquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif( (MODULE_SHIPPING_USPS_DMSTC_RATE == 'Internet') && $quote['onlineavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['onlineconf'])) $title .= '<br />---' . $quote['onlineconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} elseif( $quote['retailavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['retailconf'])) $title .= '<br />---' . $quote['retailconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $dmstcquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( sizeof($this->dmstc_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'Domestic',\r\n\t\t\t\t\t'changes' => $this->dmstc_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t} else { // # international quote\r\n\t\t\t$maxinsurance_query = tep_db_query(\"SELECT DISTINCT(max_insurance) FROM USPS_intl_maxins WHERE insurable AND country_code = '\" . tep_db_input($order->delivery['country']['iso_code_2']) . \"' ORDER BY max_insurance\");\r\n\t\t\t$this->intl_maxinsure = array();\r\n\r\n\t\t\twhile ($x = tep_db_fetch_array($maxinsurance_query)) {\r\n\t\t\t\t$this->intl_maxinsure[] = $x['max_insurance'];\r\n\t\t\t}\r\n\r\n\t\t\t$intlquotes = array();\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getIntlQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($intlquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailavail'] = ($intlquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineavail'] = ($intlquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$intlquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($intlquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif ((MODULE_SHIPPING_USPS_INTL_RATE == 'Internet') && $quote['onlineavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t} elseif ($quote['retailavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $intlquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if there's been a change detected, log it..\r\n\t\t\tif( sizeof($this->intl_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'International',\r\n\t\t\t\t\t'changes' => $this->intl_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (is_array($uspsQuote)) {\r\n\t\t\tif (isset($uspsQuote['error'])) {\r\n\t\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'error' => $uspsQuote['error']);\r\n\t\t\t} else {\r\n\t\t\t\t$quotesort = array();\r\n\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t$quotesort[$method['id']] = $method['cost'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $this->shipping_method_sort_direction == 'desc' ){\r\n\t\t\t\t\tarsort($quotesort); // sort methods by cost high to low\r\n\t\t\t\t} else {\r\n\t\t\t\t\tasort($quotesort);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$methods = array();\r\n\t\t\t\tforeach ($quotesort as $key => $cost) {\r\n\t\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t\tif ($method['id'] == $key) $methods[] = $method;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->quotes = array('id' => $this->code,\r\n\t\t\t\t\t'module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'methods' => $methods);\r\n\t\t\t\tif ($this->tax_class > 0) {\r\n\t\t\t\t\t$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // quotes was empty\r\n\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);\r\n\t\t}\r\n\t\tif (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);\r\n\t\t\r\n// \t\tprint_r( $this->quotes );\r\n\t\t\r\n\t\treturn $this->quotes;\r\n\t}",
"public function place()\n {\n $this->_eventManager->dispatch('sales_order_payment_place_start', ['payment' => $this]);\n $order = $this->getOrder();\n\n $this->setAmountOrdered($order->getTotalDue());\n $this->setBaseAmountOrdered($order->getBaseTotalDue());\n $this->setShippingAmount($order->getShippingAmount());\n $this->setBaseShippingAmount($order->getBaseShippingAmount());\n\n $methodInstance = $this->getMethodInstance();\n $methodInstance->setStore($order->getStoreId());\n\n $orderState = Order::STATE_NEW;\n $orderStatus = $methodInstance->getConfigData('order_status');\n $isCustomerNotified = $order->getCustomerNoteNotify();\n\n // Do order payment validation on payment method level\n $methodInstance->validate();\n $action = $methodInstance->getConfigPaymentAction();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n \n if ($action) {\n if ($methodInstance->isInitializeNeeded()) {\n $stateObject = new DataObject();\n // For method initialization we have to use original config value for payment action\n $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);\n\n if ($paymentMethodCode !== Bitcoin::CODE) {\n $orderState = $stateObject->getData('state') ?: $orderState;\n $orderStatus = $stateObject->getData('status') ?: $orderStatus;\n }\n\n $isCustomerNotified = $stateObject->hasData('is_notified')\n ? $stateObject->getData('is_notified')\n : $isCustomerNotified;\n }\n else {\n $this->processAction($action, $order);\n\n if ($paymentMethodCode !== Bitcoin::CODE){\n $orderState = Order::STATE_PROCESSING;\n $orderState = $order->getState() ? $order->getState() : $orderState;\n $orderStatus = $order->getStatus() ? $order->getStatus() : $orderStatus;\n }\n \n }\n } else {\n $order->setState($orderState)->setStatus($orderStatus);\n }\n\n $isCustomerNotified = $isCustomerNotified ?: $order->getCustomerNoteNotify();\n\n if (!array_key_exists($orderStatus, $order->getConfig()->getStateStatuses($orderState))) {\n $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState);\n }\n\n $this->updateOrder($order, $orderState, $orderStatus, $isCustomerNotified);\n\n $this->_eventManager->dispatch('sales_order_payment_place_end', ['payment' => $this]);\n\n return $this;\n }",
"function add_shippify_order_action_button( $actions, $the_order ) {\n\n // esto me dio error en algunas ordenes... \n if (in_array(\"shippify\", get_post_meta( $the_order->id, '_shipping_method', true )) && (get_post_meta( $the_order->id, '_is_dispatched', true ) != 'yes') && !isset($_GET['post_status'])){ \n $actions['shippify_action'] = array(\n 'url' => wp_nonce_url( admin_url( 'edit.php?post_type=shop_order&myaction=woocommerce_shippify_dispatch&stablishedorder=' . $the_order->id ), 'woocommerce-shippify-dispatch'), \n 'name' => __( 'Dispatch', 'woocommerce-shippify' ),\n 'action' => \"view shippify\", // setting \"view\" for proper button CSS.\n );\n }\n return $actions;\n }",
"function plgVmConfirmedOrder (VirtueMartCart $cart, $order) {\n\n\t\tif (!($method = $this->getVmPluginMethod ($order['details']['BT']->virtuemart_shipmentmethod_id))) {\n\t\t\treturn NULL; // Another method was selected, do nothing\n\t\t}\n\t\tif (!$this->selectedThisElement ($method->shipment_element)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\t$values['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;\n\t\t$values['order_number'] = $order['details']['BT']->order_number;\n\t\t$values['virtuemart_shipmentmethod_id'] = $order['details']['BT']->virtuemart_shipmentmethod_id;\n\t\t$values['shipment_name'] = $this->renderPluginName ($method);\n\t\t$values['order_weight'] = $this->getOrderWeight ($cart, $method->weight_unit);\n\t\t$values['shipment_weight_unit'] = $method->weight_unit;\n\n\t\t$costs = $this->getCosts($cart,$method,$cart->cartPrices);\n\t\tif(empty($costs)){\n\t\t\t$values['shipment_cost'] = 0;\n\t\t\t$values['shipment_package_fee'] = 0;\n\t\t} else {\n\t\t\t$values['shipment_cost'] = $method->shipment_cost;\n\t\t\t$values['shipment_package_fee'] = $method->package_fee;\n\t\t}\n\n\t\t$values['tax_id'] = $method->tax_id;\n\t\t$this->storePSPluginInternalData ($values);\n\n\t\treturn TRUE;\n\t}",
"function setShipping($ship_key)\n {\n return 4.50;\n }",
"public function setShippingCost($shippingCost);",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function setShipAddress(?Address $address = null): Cart;",
"function custom_template_single_shipping()\n {\n global $product;\n ?>\n <span class=\"shipping-cs-tag\">\n <span>Shipping:</span>\n <span>Free</span>\n </span>\n <?php\n }",
"public function estimated_shipping() {\n\n\t\t$this->api_record_event( $this->event_name['estimated_shipping'] );\n\t}",
"public function onCheckoutCartEstimatePost($observer)\n {\n $quote = Mage::helper('shipperhq_shipper')->getQuote();\n $quote->setIsMultiShipping(false);\n $shipping = $quote->getShippingAddress();\n $shipping->setIsCheckout(0);\n $shipping->save();\n }",
"public function setQuantityShippedAttribute($input)\n {\n $this->attributes['quantity_shipped'] = $input ? $input : null;\n }",
"public function orderUpdate()\n {\n $this->helper->logOrder('Beginning Order Update.');\n $stores = $this->storeManager->getStores();\n\n $enabledStores = [];\n\n foreach ($stores as $store) {\n if ($store->isActive() && $this->helper->isEnabled($store->getId())) {\n $enabledStores[] = $store->getId();\n }\n }\n\n if ($enabledStores) {\n $ordersToProcess = null;\n\n $ordersToProcess = $this->orderCollectionFactory\n ->create()\n ->addFieldToSelect('*')\n ->addFieldToFilter(\n 'store_id',\n [\n 'in' => [$enabledStores],\n ]\n )\n ->addFieldToFilter(\n 'state',\n [\n 'in' => [\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_PROCESSING,\n ],\n ]\n )\n ->addFieldToFilter('fulfilled_by_amazon', true)\n ->addFieldToFilter(\n 'amazon_order_status',\n [\n 'in' => [\n $this->helper::ORDER_STATUS_RECEIVED,\n $this->helper::ORDER_STATUS_PLANNING,\n $this->helper::ORDER_STATUS_PROCESSING,\n ],\n ]\n );\n\n if (!empty($ordersToProcess) && $ordersToProcess->count()) {\n $this->helper->logOrder('Beginning Order Update for ' . $ordersToProcess->count() . ' orders.');\n\n foreach ($ordersToProcess as $order) {\n $this->helper->logOrder('Updating order #' . $order->getIncrementId());\n\n $result = $this->outbound->getFulfillmentOrder($order);\n if ($result) {\n $fulfillmentOrderResult = $result->getGetFulfillmentOrderResult();\n\n // Amazon Statuses: RECEIVED / INVALID / PLANNING / PROCESSING / CANCELLED / COMPLETE\n // / COMPLETE_PARTIALLED / UNFULFILLABLE\n $amazonStatus = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getFulfillmentOrderStatus();\n\n $amazonOrderId = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getDisplayableOrderId();\n\n $id = $order->getIncrementId();\n if ($order->getIncrementId() == $amazonOrderId) {\n $this->helper->logOrder(\n 'Status of order #' . $order->getIncrementId() . ': ' . $amazonStatus\n );\n\n if ($amazonStatus) {\n switch ($amazonStatus) {\n case 'COMPLETE':\n case 'COMPLETE_PARTIALLED':\n $this->magentoOrderUpdate($order, $fulfillmentOrderResult);\n break;\n case 'INVALID':\n case 'CANCELLED':\n case 'UNFULFILLABLE':\n $this->cancelFBAShipment($order, $fulfillmentOrderResult);\n break;\n }\n }\n }\n }\n }\n\n $this->helper->logOrder(__('Get Order status called. Orders to process: ') . $ordersToProcess->count());\n } else {\n $this->helper->logOrder(__('Get Order status called. No orders to process'));\n }\n }\n }",
"public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }",
"function wcfm_order_tracking_response( $item_id, $item, $order ) {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\t\t\r\n\t\t// See if product needs shipping \r\n\t\t$product = $item->get_product(); \r\n\t\t$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product ); \r\n\t\t\r\n\t\tif( $WCFMu->is_marketplace ) {\r\n\t\t\tif( $WCFMu->is_marketplace == 'wcvendors' ) {\r\n\t\t\t\tif( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {\r\n\t\t\t\t\tif( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;\r\n\t\t\t\t}\r\n\t\t\t} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\tglobal $WCMp;\r\n\t\t\t\tif( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( $needs_shipping ) {\r\n\t\t\t$traking_added = false;\r\n\t\t\t$package_received = false;\r\n\t\t\tforeach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {\r\n\t\t\t\tif( $meta->key == 'wcfm_tracking_url' ) {\r\n\t\t\t\t\t$traking_added = true;\r\n\t\t\t\t}\r\n\t\t\t\tif( $meta->key == 'wcfm_mark_as_recived' ) {\r\n\t\t\t\t\t$package_received = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo \"<p>\";\r\n\t\t\tprintf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\tif( $package_received ) {\r\n\t\t\t\tprintf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t} elseif( $traking_added ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"#\" class=\"wcfm_mark_as_recived\" data-orderitemid=\"<?php echo $item_id; ?>\" data-orderid=\"<?php echo $order->get_id(); ?>\" data-productid=\"<?php echo $item->get_product_id(); ?>\"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>\r\n\t\t\t\t<?php\r\n\t\t\t} else {\r\n\t\t\t\tprintf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t}\r\n\t\t\techo \"</p>\";\r\n\t\t}\r\n\t}",
"private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }",
"function hide_shipping_when_free_is_available( $rates, $package ) {\n \t\n \tglobal $woocommerce;\n\t\n\t//Stop promotion after 1st June\n\t//if( '20160601' > date(\"Ymd\") ) {\n\t\n\t$products = $woocommerce->cart->get_cart(); //Returns the contents of the cart in an array with the 'data' element.\n\t$count_pub41 = 0;\n\t$only_pub41 = true;\n\t\n\tforeach( $products as $product ) {\n\t\t//All extended meta data is stored in a 'data' array, stores the WC_Product_Simple Object which contains\n\t\t//information about the product\n\t\t\n\t\t$_product = $product['data'];\n\t\t$SKU = $_product->get_sku();\n\n\t\tif ($SKU == 'PUB41') {\n\t\t\t$count_pub41 = $product['quantity'];\n\t\t}\n\t\telse if (!$_product->is_virtual()) {\n\t\t\t$only_pub41 = false;\n\t\t}\n\t}\n \n\tif ( $count_pub41 >= 1 AND $only_pub41 ) {\n\t\t//$rates['free_shipping'] = new WC_Shipping_Rate('free_shipping', 'Free Shipping', 0, array(), '');\n\t\tunset( $rates['flat_rate'] );\n\t\tunset( $rates['eca_shipping_express'] );\n\t\t//unset( $rates['eca_shipping']);\n\t\t$rates['eca_shipping']->cost = 0;\n\t}\n\t//}\n\t\n\treturn $rates;\n}",
"public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }",
"public function resolveShippingState(OrderInterface $order);",
"function get_item_shipping() {\n\t}",
"public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }",
"public function setCanShipPartially($flag);",
"public function setAutoShipping(bool $auto): ShippableInterface;",
"function wc_add_notice_free_shipping() {\n\n $order_min_amount = get_free_shipping_minimum();\n\n $cart = WC()->cart->subtotal;\n $remaining = $order_min_amount - $cart;\n $f_str = \"\";\n if ( $cart < 1 ) {\n $f_str .= sprintf( __( '<strong>Free delivery</strong> from %s.', 'thegrapes' ), wc_price($order_min_amount));\n } else if ( $order_min_amount > $cart ){\n $f_str .= sprintf( __( 'Spend %s more to get <strong>free delivery</strong>.', 'thegrapes' ), wc_price($remaining));\n } else {\n $f_str .= '<strong>' . __( 'You have free delivery.', 'thegrapes' ) . '</strong>';\n }\n return $f_str;\n\n}",
"public function saveOrder()\n {\n $this->validate();\n $this->_initKlarnaCheckout(false, false);\n\n try {\n if (($merchantCheckboxMethod = $this->_helper->getCheckoutConfig('merchant_checkbox')) != -1) {\n $this->_helper->dispatchMerchantCheckboxMethod(\n $merchantCheckboxMethod, array(\n 'quote' => $this->getQuote(),\n 'klarna_quote' => $this->getKlarnaQuote(),\n 'checked' => (bool)$this->getKlarnaCheckout()->getData('merchant_requested/additional_checkbox')\n )\n );\n }\n\n $checkboxes = $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes');\n if (!empty($checkboxes)) {\n $this->_helper->dispatchMultipleCheckboxesEvent(\n $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes'),\n $this->getQuote(),\n $this->getKlarnaQuote()\n );\n }\n } catch (Mage_Core_Exception $e) {\n Mage::logException($e);\n // Don't stop order from saving just because the checkbox processing failed\n }\n\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n Mage::dispatchEvent(\n 'kco_checkout_save_order_before', array(\n 'checkout' => $this\n )\n );\n\n /**\n * For older versions of Magento state cannot be removed as a requirement\n * for shipping which is necessary in some countries.\n *\n * This checks if the Magento version is below 1.7 and disabled address validation\n */\n if (version_compare(Mage::getVersion(), '1.7.0', '<')) {\n $this->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->getQuote()->isVirtual()) {\n $this->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }\n\n $service = Mage::getModel('sales/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n /** @var Mage_Sales_Model_Order $order */\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent(\n 'checkout_type_kco_save_order_after', array(\n 'order' => $order,\n 'quote' => $this->getQuote()\n )\n );\n\n if ($order->getCanSendNewEmailFlag()) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession\n ->setLastOrderId($order->getId())\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => array())\n );\n\n return $order;\n }",
"public function setSameAsBillingShippingAddress()\n {\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();\n $this->browser->find($this->accountInformationBlock)->hover();\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes');\n }",
"public function isShipped($id){\n $q = $this->slcOrdrFild(\"shipped\", $id);\n return $this->check($q, \"yes\");\n }",
"function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}",
"public function order_processing( $order_id ) {\n\t\t$order = new WC_Order( $order_id ); // load the order from woocommerce\n\t\t$this->notify_warehouse($order); // notify the warehouse to ship the order\n\t}",
"public function calculateQtyToShip();",
"public function adminSalesOrderCreateProcessDataBefore($observer)\n {\n if(Mage::getStoreConfig('carriers/shipper/active')) {\n $post = $observer->getRequestModel()->getPost();\n if(isset($post['order'])) {\n $data = $post['order'];\n\n $found = false;\n $customCarrierGroupData = array();\n $carriergroupId = isset($data['carriergroup_id']) ? $data['carriergroup_id'] : '';\n if (isset($data['shipping_amount'])) {\n $customCarrierGroupData[$carriergroupId] = array('customPrice' => $data['shipping_amount'], 'carriergroup' => $carriergroupId);\n $found = true;\n }\n\n if (isset($data['shipping_description'])) {\n if(array_key_exists($carriergroupId, $customCarrierGroupData)) {\n $shipArray = $customCarrierGroupData[$carriergroupId];\n $shipArray['customCarrier'] = $data['shipping_description'];\n $customCarrierGroupData[$carriergroupId] = $shipArray;\n }\n else {\n $customCarrierGroupData[$carriergroupId] = array('customCarrier' => $data['shipping_description'], 'carriergroup' => $carriergroupId);\n }\n $found = true;\n }\n\n if ($found) {\n $shippingAddress = $observer->getSession()->getQuote()->getShippingAddress();\n Mage::helper('shipperhq_shipper')->cleanDownRatesCollection($shippingAddress, 'shipperadmin', '');\n Mage::register('shqadminship_data', new Varien_Object($customCarrierGroupData));\n $storedLimitCarrier = $shippingAddress->getLimitCarrier();\n $shippingAddress->setLimitCarrier('shipperadmin');\n $rateFound = $shippingAddress->requestShippingRates();\n $shippingAddress->setLimitCarrier($storedLimitCarrier);\n } else {\n Mage::unregister('shqadminship_data');\n }\n }\n }\n }",
"function action_woocommerce_before_shipping_zone_object_save( $instance, $this_data_store ) {\n $shipping_methods = $instance->get_shipping_methods();\n foreach($shipping_methods as $shipping_method){\n if( isset($instance->get_changes()['zone_locations']) ){\n update_shipping_rules($shipping_method, $instance->get_changes()['zone_locations'], $instance->get_id());\n }\n\n }\n\n}",
"public function setShippingAmount($amount);",
"function sundaysea_update_shipping()\n {\n if (is_null(WC()->cart)) {\n return;\n }\n\n // Constants\n if (!defined('WOOCOMMERCE_CART')) {\n define('WOOCOMMERCE_CART', true);\n }\n\n // Update Shipping\n if (!empty($_POST['calc_shipping'])) {\n\n try {\n WC()->shipping->reset_shipping();\n\n $country = wc_clean($_POST['calc_shipping_country']);\n $state = isset($_POST['calc_shipping_state']) ? wc_clean($_POST['calc_shipping_state']) : '';\n $postcode = apply_filters('woocommerce_shipping_calculator_enable_postcode', true) ? wc_clean($_POST['calc_shipping_postcode']) : '';\n $city = apply_filters('woocommerce_shipping_calculator_enable_city', false) ? wc_clean($_POST['calc_shipping_city']) : '';\n\n if ($postcode && !WC_Validation::is_postcode($postcode, $country)) {\n throw new Exception(__('Please enter a valid postcode/ZIP.', 'woocommerce'));\n } elseif ($postcode) {\n $postcode = wc_format_postcode($postcode, $country);\n }\n\n if ($country) {\n WC()->customer->set_location($country, $state, $postcode, $city);\n WC()->customer->set_shipping_location($country, $state, $postcode, $city);\n } else {\n WC()->customer->set_to_base();\n WC()->customer->set_shipping_to_base();\n }\n\n WC()->customer->calculated_shipping(true);\n\n wc_add_notice(__('Shipping costs updated.', 'woocommerce'), 'notice');\n\n do_action('woocommerce_calculated_shipping');\n\n } catch (Exception $e) {\n\n if (!empty($e))\n wc_add_notice($e->getMessage(), 'error');\n }\n }\n\n // Check cart items are valid\n do_action('woocommerce_check_cart_items');\n\n // Calc totals\n WC()->cart->calculate_totals();\n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"public function setCanShipPartiallyItem($flag);",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"public function setShipping($shipping);",
"public function setShippingRates(Order $draftOrder): bool;",
"public function getQtyShipped() {\n return $this->item->getQtyShipped();\n }",
"public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }",
"public function createTemandoShipment(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $order = $observer->getEvent()->getOrder();\n $shippingAddress = $order->getShippingAddress();\n $deprecateSkus = array();\n\n $shippingMethod = $order->getShippingMethod();\n $titleOptions = $this->_type->toOptionArray();\n $titles = array();\n foreach ($titleOptions as $value => $optionTitle) {\n $titles[$value] = $optionTitle['label'];\n }\n\n $quote = $this->_quoteRepository->get($order->getQuoteId());\n $quoteShippingAddress = $quote->getShippingAddress();\n\n $origin = $this->_originCollection->getOriginByInventory(\n $order->getAllVisibleItems(),\n $quoteShippingAddress->getPostcode()\n );\n //$origin = $this->_originCollection->getOriginByPostcode($quoteShippingAddress->getPostcode());\n $this->_shipment->setData('order_id', $order->getId());\n $this->_shipment->setData('order_increment_id', $order->getIncrementId());\n $this->_shipment->setData('origin_id', $origin->getId());\n\n $orderSkus = $this->_helper->getOrderSkus($order);\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::PENDING;\n\n $exclusiveOD = $this->_helper->orderContainsExclusively($order, \"OD\");\n foreach ($orderSkus as $sku => $details) {\n if ($details['stock_availability_code'] == \"OD\") {\n $hasStock = $origin->hasStock(array($sku => $details['qty']));\n if ($hasStock) {\n $deprecateSkus[$sku] = $details['qty'];\n } elseif ($exclusiveOD) {\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::BACK_ORDER;\n }\n } else {\n $deprecateSkus[$sku] = $details['qty'];\n }\n }\n $this->_shipment->setData('status', $shipmentStatus);\n $this->_shipment->setData('destination_contact_name', $shippingAddress->getName());\n $this->_shipment->setData('destination_company_name', $shippingAddress->getCompany());\n $streetAddress = $shippingAddress->getStreetLine(1);\n if ($shippingAddress->getStreetLine(2)) {\n $streetAddress .= \", \" . $shippingAddress->getStreetLine(2);\n }\n $this->_shipment->setData('destination_street', $streetAddress);\n $this->_shipment->setData('destination_city', $shippingAddress->getCity());\n $this->_shipment->setData('destination_postcode', $shippingAddress->getPostcode());\n $this->_shipment->setData('destination_region', $shippingAddress->getRegion());\n $this->_shipment->setData('destination_country', $shippingAddress->getCountryId());\n $this->_shipment->setData('destination_phone', $shippingAddress->getTelephone());\n $this->_shipment->setData('destination_email', $order->getCustomerEmail());\n\n //set customer selected quote data\n $temandoQuoteData = explode('_', $shippingMethod);\n $temandoQuoteId = $temandoQuoteData[2];\n\n $quoteDescription = '-';\n switch ($temandoQuoteData[2]) {\n default:\n $temandoQuote = $this->_quote->load($temandoQuoteId);\n $carrier = $this->_helper->getCarrierByTemandoId($temandoQuote->getCarrierId());\n $quoteDescription = $carrier->getCompanyName() . ' - ' . $temandoQuote->getDeliveryMethod();\n $totalPrice = $temandoQuote->getTotalPrice();\n break;\n }\n\n $this->_shipment->setData('customer_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('customer_selected_options', $shippingMethod);\n $this->_shipment->setData('customer_selected_quote_description', $quoteDescription);\n $this->_shipment->setData('admin_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('anticipated_cost', $totalPrice);\n\n if ($shippingAddress->getIsBusinessAddress()) {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::BUSINESS\n );\n } else {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::RESIDENTIAL\n );\n }\n\n if ($shippingAddress->getAuthorityToLeave()) {\n $this->_shipment->setData('destination_authority_to_leave', 1);\n } else {\n $this->_shipment->setData('destination_authority_to_leave', 0);\n }\n\n try {\n $this->_shipment->save();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment') . ' ' . $e->getMessage());\n }\n //register the quotes with the shipment\n //$this->registerQuotes($order);\n try {\n $this->_shipment->saveAllItems();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment items') . ' ' . $e->getMessage());\n }\n\n\n //how many boxes required?\n $this->saveBoxes($order);\n\n if ((count($deprecateSkus)) && ($origin->getErpId())) {\n $this->deprecateSkus($origin->getErpId(), $deprecateSkus);\n }\n //$this->_shipment->fetchQuotes();//or update existing quotes to use this shipment\n\n $this->clearSessionData();\n\n return $this->_shipment;\n }",
"public function saveOrderShipment() {\n\t\t$this->layout = 'ajax';\n $order_id = $this->Shipment->saveOrderShipment($this->request->data);\n\t\tif($order_id) {\n $data = $this->Shipment->Order->find('first', array(\n 'conditions' => array(\n 'Order.id' => $order_id\n )\n ));\n } else {\n $this->set('json', FALSE);\n $this->render('/Common/echo_json');\n }\n $this->set('data', $data);\n $this->render('ship_cell');\n\t}",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"private function shipping_batch()\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// find the most recent unprocessed shipments\n\t\t$query = ee()->sync_db->where('processed !=', '1')->order_by('id', 'asc')->get('orders_shipping', 200);\n\n\t\t// create arrays for shipment ids and tracking numbers\n\t\t$ids_processed = array();\n\n\t\t// find our shipped status\n\t\t$status = Store\\Model\\Status::where('name', 'Shipped')->first();\n\n\t\t// load the order_map config file\n\t\tinclude_once dirname(dirname(__FILE__)).'/bmi_custom/config/order_map.php';\n\n\t\t// loop through each shipment\n\t\tforeach($query->result() as $shipment)\n\t\t{\n\t\t\t// add id to the processed array\n\t\t\t$ids_processed[] = $shipment->id;\n\n\t\t\tif(!empty($shipping_carriers[$shipment->carrier]))\n\t\t\t{\n\t\t\t\t$tracking = $shipping_carriers[$shipment->carrier] .'|'. $shipment->tracking_number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tracking = $shipment->tracking_number;\n\t\t\t}\t\n\n\t\t\t// update the status of each order with the tracking numbers\n\t\t\t$order_object = Store\\Model\\Order::find($shipment->order_id);\n\t\t\t$order_object->updateStatus($status, 0, $tracking);\n\n\t\t}\n\n\t\t// update the shipment records to indicate they've been processed\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('orders_shipping');\n\t\t}\t\n\t\t\n\t\t\n\t}",
"public function saveShippingAction()\n {\n if (!$this->_isActive()) {\n parent::saveShippingAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getPost('shipping', array());\n $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);\n $result = $this->getOnepage()->saveShipping($data, $customerAddressId);\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(\n Mage::helper('core')->jsonEncode($result)\n );\n }\n }",
"public function savePostAction() {\n $isNeedCreateLabel = '';\n try {\n $updateOrderId = $this->getRequest ()->getParam ( 'order_id' );\n /**\n * Get marketplace commission details\n */\n $collection = Mage::getModel ( 'marketplace/commission' )->getCollection ()->addFieldToFilter ( 'seller_id', Mage::getSingleton ( 'customer/session' )->getId () )->addFieldToFilter ( 'order_id', $updateOrderId )->getFirstItem ();\n /**\n * Checking manage order enable for seller\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Checking for seller order management enable or not\n */\n if (count ( $collection ) <= 0 || $orderStatusFlag != 1) {\n $this->_getSession ()->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n return;\n }\n /**\n * Get shipment info\n */\n $data = $this->getRequest ()->getParam ( 'shipment' );\n $shipment = $this->_initShipment ();\n if (! $shipment) {\n $this->_forward ( 'noRoute' );\n return;\n }\n /**\n * Register shipment\n */\n $shipment->register ();\n $comment = '';\n if (! empty ( $data ['comment_text'] )) {\n $shipment->addComment ( $data ['comment_text'], isset ( $data ['comment_customer_notify'] ), isset ( $data ['is_visible_on_front'] ) );\n if (isset ( $data ['comment_customer_notify'] )) {\n $comment = $data ['comment_text'];\n }\n }\n $shipment->setEmailSent ( true );\n /**\n * Set customer notify.\n */\n $shipment->getOrder ()->setCustomerNoteNotify ( true );\n $responseAjax = new Varien_Object ();\n $isNeedCreateLabel = isset ( $data ['create_shipping_label'] ) && $data ['create_shipping_label'];\n if ($isNeedCreateLabel && $this->_createShippingLabel ( $shipment )) {\n $responseAjax->setOk ( true );\n }\n /**\n * Save shipment\n */\n $this->_saveShipment ( $shipment );\n\n /**\n * Send shipment email\n */\n $shipment->sendEmail ( true, $comment );\n /**\n * Initilize shipment label\n */\n $shipmentCreatedMessage = $this->__ ( 'The shipment has been created.' );\n $labelCreatedMessage = $this->__ ( 'The shipping label has been created.' );\n $savedQtys = $this->_getItemQtys ();\n Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $savedQtys, $updateOrderId, 0 );\n $this->_getSession ()->addSuccess ( $isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage : $shipmentCreatedMessage );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Thorugh the exception error message.\n */\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( $e->getMessage () );\n } else {\n /**\n * When error occured, redirect to the view order page.\n */\n $this->_getSession ()->addError ( $e->getMessage () );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n } catch ( Exception $e ) {\n Mage::logException ( $e );\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( /**\n * Through error when create shipping label.\n */\n Mage::helper ( 'sales' )->__ ( 'An error occurred while creating shipping label.' ) );\n } else {\n $this->_getSession ()->addError ( $this->__ ( 'Cannot save shipment.' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }\n if ($isNeedCreateLabel) {\n $this->getResponse ()->setBody ( $responseAjax->toJson () );\n } else {\n /**\n * Redirect to the view order page.\n */\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }",
"public function testUpdateOrder()\n {\n }",
"public function enable_free_shipping() {\n\t\treturn 'yes' === $this->free_shipping;\n\t}",
"public function update(Request $request, $id)\n {\n //\n $order = Order::find($id);\n\n if($request->shipped){\n $order->shipped = true;\n }\n\n if($request->unshipped){\n $order->shipped = false;\n }\n\n $order->save();\n\n toastr()->success('Item updated successfully.!');\n return redirect()->route('admin.orders.index');\n\n }",
"public function execute(\n CartInterface $cart,\n AddressInterface $billingAddress,\n bool $useForShipping\n ): void {\n try {\n $this->billingAddressManagement->assign($cart->getId(), $billingAddress, $useForShipping);\n } catch (NoSuchEntityException $e) {\n throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e);\n } catch (LocalizedException $e) {\n throw new GraphQlInputException(__($e->getMessage()), $e);\n }\n }",
"public function store(Request $request){\n $verEnvio = \\DB::table('orders')->where('order_id', $request->id_recipies)->first();\n if($verEnvio->status == 1){\n $shipping = new Shipping();\n $shipping->id_user = $request->delivery;\n $shipping->id_recipie = $request->id_recipies;\n $shipping->recipient_name = \"\";\n $shipping->save();\n \\DB::Table('orders')->where('order_id', $request->id_recipies)->update([\n \"status\"=> 2\n ]);\n }\n return ['result' => 'success'];\n }",
"public function updateOrder() {\n\n echo \"ok\";\n }",
"public function salesOrderPlaceAfter($observer)\n {\n try{\n //if order tracking is set\n //$sfEnabled = Mage::getStoreConfig('shoppingfeeder/service/enable');\n $sfEnabled = true;\n $sfTracking = Mage::getStoreConfig('shoppingfeeder/service/tracking');\n $fbTracking = Mage::getStoreConfig('shoppingfeeder/fb_track_config/fb_track');\n if (($sfEnabled && $sfTracking) || (!is_null($fbTracking) && $fbTracking))\n {\n /* @var Mage_Sales_Model_Order $order */\n $order = $observer->getEvent()->getOrder();\n\n //Mage::log('salesOrderPlaceAfter Order ID: '.$order->getRealOrderId());\n\n //set the order for JS tracking code\n $orderItems = array();\n foreach ($order->getAllItems() as $item)\n {\n $orderItems[] = '\\''.$item->getProductId().'\\'';\n }\n $orderInfo = array(\n 'items' => $orderItems,\n 'value' => $order->getGrandTotal()\n );\n Mage::getSingleton('core/session')->setSfdrOrderForJsTracking($orderInfo);\n\n //only notify ShoppingFeeder if required\n if ($sfEnabled && $sfTracking)\n {\n $this->_notifyShoppingFeeder($order);\n }\n }\n }\n catch (Exception $e)\n {\n Mage::log('_notifyShoppingFeeder Order ID: '.$order->getRealOrderId().' FAILED! Message: '.$e->getMessage());\n }\n }",
"public function getCartShippingMethod()\n {\n }",
"protected function _fcpoSetOrderStatus() {\n $blIsAmazonPending = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoAmazonPayOrderIsPending');\n $blOrderOk = $this->_fcpoValidateOrderAgainstProblems();\n\n if ($blIsAmazonPending) {\n $this->_setOrderStatus('PENDING');\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $this->save();\n } elseif ($blOrderOk === true) {\n // updating order trans status (success status)\n $this->_setOrderStatus('OK');\n } else {\n $this->_setOrderStatus('ERROR');\n }\n }",
"public function setShippingMethod(ShippingMethodInterface $shipping_method);",
"public function salesOrderShipmentSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n \n if (!$settings['shipment_notification_message']) {\n return;\n }\n $order = $observer->getEvent()->getShipment()->getOrder();\n \n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_id = $order->getIncrementId();\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n $shipment = $order->getShipmentsCollection()->getFirstItem();\n $shipId = $shipment->getIncrementId();\n\n // Check if a telephone number has been specified\n if(in_array('shippment', $final_array)){\n if ($telephoneNumber) {\n // Send the shipment notification to the specified telephone number\n $text = $settings['shipment_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{shipmentno}}', $shipId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n // Display a success or error message\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The shipment notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the shipment notification SMS.');\n }\n }\n } \n}",
"public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }",
"public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }",
"public function updateBuyOrderStatusAndCreatePosition()\n {\n $orders = $this->orderService->getOpenBuyOrders();\n\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>updateBuyOrderStatusAndCreatePosition</info>';\n foreach ($orders as $order) {\n /** @var \\GDAX\\Types\\Response\\Authenticated\\Order $gdaxOrder */\n $gdaxOrder = $this->gdaxService->getOrder($order['order_id']);\n // Mocken\n\n $position_id = 0;\n $status = $gdaxOrder->getStatus();\n\n if ($status) {\n if ($status == 'done') {\n $position_id = $this->positionService->open($gdaxOrder->getId(), $gdaxOrder->getSize(), $gdaxOrder->getPrice());\n $this->msg[] = $this->timestamp . ' .... <info>Opend position</info>';\n }\n\n $this->orderService->updateOrderStatus($order['id'], $gdaxOrder->getStatus(), $position_id);\n } else {\n $this->orderService->updateOrderStatus($order['id'], $gdaxOrder->getMessage(), $position_id);\n }\n }\n }\n }",
"public function test_product_stocks_deduct_when_order_is_placed()\n {\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $product->orders()->create(['quantity' => 5]);\n\n $product->refresh();\n\n $this->assertTrue($product->available_stock === 45);\n }",
"function bill_transition_placed_pending($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n\n $productiondata = produce_prepay($bill);\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n\n // Notify end user.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n // Feedback customer with mail confirmation.\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->billItems),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid, 'view' => 'bill', 'billid' => $bill->id, 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Delayed Transaction Activating Operations on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'PENDING';\n $bill->save(true);\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}",
"public function calculate_shipping( $package = [] ) {\n // First, we need to do some checks to make sure that this shipping method\n // is enabled and this users country is included / allowed. If one of these\n // is not true, just return false.\n // Is this shipping type enabled? If not, do nothing.\n $enabled = $this->get_option( 'enabled' );\n\n if ( $enabled == 'no' ) { return false; }\n if ( ! $this->is_tiered_allowed( $package ) ) { return false; }\n\n\n // If we get to this point, we can add this shipping method to the front\n // end and calculate the shipping rate!\n\n global $woocommerce;\n\n // Get all items from cart.\n $items = $woocommerce->cart->get_cart();\n $cart_total_items = 0;\n\n // Sum non-virtual (i.e. shippable) items\n foreach ( $items as $item ) {\n $product = wc_get_product( $item['product_id'] );\n if ( !$product->is_virtual() ) {\n $cart_total_items += $item['quantity'];\n }\n }\n\n // Set the base shipping fee.\n $shipping = $cart_total_items > 0 ? $this->get_option('basefee') : 0;\n\n // Override base fee with tiered fee if cart items are over the tier quantity.\n if ( $cart_total_items > $this->get_option( 'quantity' ) ) {\n\n // If the tier fee should be progressive, calculate the multiplier and add the tier fee * multiplier.\n if ( $this->get_option( 'progressive' ) == 'yes' ) {\n $multiplier = ceil( $cart_total_items / $this->get_option( 'quantity' ) ) - 1;\n $shipping += $this->get_option( 'tierfee' ) * $multiplier;\n }\n\n // If the tier fee is flat, simply add the tier fee.\n else {\n $shipping += $this->get_option( 'tierfee' );\n }\n }\n\n // Set the shipping rate.\n $rate = [\n 'label' => $this->title,\n 'cost' => $shipping,\n 'calc_tax' => 'per_item'\n ];\n\n $this->add_rate( $rate );\n }",
"public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n if (\"0\" == $this->scopeConfig->getValue('pickrr_magento2/general/automatic_shipment_enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE))\n return NULL;\n\n $order = $observer->getEvent()->getOrder();\n $payment = $order->getPayment();\n\n if($payment->getMethod() == \"cashondelivery\")\n $cod_amount = $order->getGrandTotal();\n else\n $cod_amount = 0.0;\n\n if ($order->getState() != Order::STATE_NEW && $order->getState() != Order::STATE_PENDING_PAYMENT )\n return NULL;\n\n $auth_token = $this->scopeConfig->getValue('pickrr_magento2/general/auth_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $pickup_time = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/pickup_time', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_name = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_name', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_phone_number = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_phone_number', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_pincode = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_pincode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_address = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_address', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $this->helper->createOrderShipment($auth_token, $order, $from_name, $from_phone_number, $from_pincode, $from_address, $pickup_time, $cod_amount);\n }",
"public function show_shipping() {\n\t\tif ( ! wc_shipping_enabled() || ! $this->get_cart_contents() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'yes' === get_option( 'woocommerce_shipping_cost_requires_address' ) ) {\n\t\t\tif ( ! $this->get_customer()->has_calculated_shipping() ) {\n\t\t\t\tif ( ! $this->get_customer()->get_shipping_country() || ( ! $this->get_customer()->get_shipping_state() && ! $this->get_customer()->get_shipping_postcode() ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn apply_filters( 'woocommerce_cart_ready_to_calc_shipping', true );\n\t}",
"public function isShipping()\n {\n return $this->product->isShipping();\n }",
"public function setShippingServiceName($name){\n $this->shippingServiceName = (string) $name;\n }",
"public function set_staff_free_order($value)\n {\n $this->staff_free_order = $value;\n if ($this->staff_free_order) {\n foreach ($this->order_configurations as $config) {\n $config->individual_cost = 0;\n $config->calculateSubtotal();\n }\n }\n }"
] | [
"0.78274375",
"0.73035306",
"0.72957855",
"0.6953338",
"0.6892787",
"0.667168",
"0.6615628",
"0.6483965",
"0.6479015",
"0.6428056",
"0.63306314",
"0.62906265",
"0.62633115",
"0.6199688",
"0.61819476",
"0.6040608",
"0.60170656",
"0.6007457",
"0.6005998",
"0.5998495",
"0.59858423",
"0.59788126",
"0.58806103",
"0.5840483",
"0.5778392",
"0.57629",
"0.5761527",
"0.5754946",
"0.57525736",
"0.57326025",
"0.5729109",
"0.57066",
"0.5685298",
"0.5670554",
"0.56390935",
"0.5597521",
"0.5596521",
"0.5596091",
"0.556513",
"0.5546263",
"0.55419606",
"0.5539379",
"0.55298656",
"0.5506918",
"0.5497543",
"0.5497237",
"0.5494012",
"0.5481048",
"0.5464429",
"0.5463017",
"0.5461829",
"0.54512274",
"0.545077",
"0.54429364",
"0.5429041",
"0.54191643",
"0.5414635",
"0.5411442",
"0.5399881",
"0.5395494",
"0.5388469",
"0.5384941",
"0.5384436",
"0.5378745",
"0.5372223",
"0.5366437",
"0.5362644",
"0.5362162",
"0.5357278",
"0.5354049",
"0.535197",
"0.5349332",
"0.534501",
"0.5343573",
"0.5337563",
"0.53364664",
"0.53309464",
"0.53271294",
"0.5326049",
"0.53158367",
"0.5314281",
"0.53116465",
"0.5309501",
"0.530261",
"0.5301272",
"0.5296204",
"0.5289482",
"0.52856016",
"0.5283848",
"0.527612",
"0.5275612",
"0.52730435",
"0.5264292",
"0.526423",
"0.5254318",
"0.5251164",
"0.52341604",
"0.52260023",
"0.52194834",
"0.52173936"
] | 0.77424556 | 1 |
Mark WCfM Marketplace order as Shipped | function wcfm_wcfmmarketplace_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = absint( $_POST['productid'] );
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$wpdb->query("UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id");
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class="wcfm_dashboard_item_title" target="_blank" href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
add_comment_meta( $comment_id, '_vendor_id', $user_id );
} else {
$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"public function setShippingValues(Order $order): void;",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }",
"public function testUpdateExternalShipment()\n {\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"public function place()\n {\n $this->_eventManager->dispatch('sales_order_payment_place_start', ['payment' => $this]);\n $order = $this->getOrder();\n\n $this->setAmountOrdered($order->getTotalDue());\n $this->setBaseAmountOrdered($order->getBaseTotalDue());\n $this->setShippingAmount($order->getShippingAmount());\n $this->setBaseShippingAmount($order->getBaseShippingAmount());\n\n $methodInstance = $this->getMethodInstance();\n $methodInstance->setStore($order->getStoreId());\n\n $orderState = Order::STATE_NEW;\n $orderStatus = $methodInstance->getConfigData('order_status');\n $isCustomerNotified = $order->getCustomerNoteNotify();\n\n // Do order payment validation on payment method level\n $methodInstance->validate();\n $action = $methodInstance->getConfigPaymentAction();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n \n if ($action) {\n if ($methodInstance->isInitializeNeeded()) {\n $stateObject = new DataObject();\n // For method initialization we have to use original config value for payment action\n $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);\n\n if ($paymentMethodCode !== Bitcoin::CODE) {\n $orderState = $stateObject->getData('state') ?: $orderState;\n $orderStatus = $stateObject->getData('status') ?: $orderStatus;\n }\n\n $isCustomerNotified = $stateObject->hasData('is_notified')\n ? $stateObject->getData('is_notified')\n : $isCustomerNotified;\n }\n else {\n $this->processAction($action, $order);\n\n if ($paymentMethodCode !== Bitcoin::CODE){\n $orderState = Order::STATE_PROCESSING;\n $orderState = $order->getState() ? $order->getState() : $orderState;\n $orderStatus = $order->getStatus() ? $order->getStatus() : $orderStatus;\n }\n \n }\n } else {\n $order->setState($orderState)->setStatus($orderStatus);\n }\n\n $isCustomerNotified = $isCustomerNotified ?: $order->getCustomerNoteNotify();\n\n if (!array_key_exists($orderStatus, $order->getConfig()->getStateStatuses($orderState))) {\n $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState);\n }\n\n $this->updateOrder($order, $orderState, $orderStatus, $isCustomerNotified);\n\n $this->_eventManager->dispatch('sales_order_payment_place_end', ['payment' => $this]);\n\n return $this;\n }",
"function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function quote($method = '') {\r\n\r\n\t\tglobal $order, $shipping_weight, $shipping_num_boxes, $transittime, $dispinsure, $packing;\r\n\r\n\t\tif ($this->dimensions_support > 0 && is_object($packing)) {\r\n\r\n\t\t\tif ($this->dimensions_support == 1) { // # only ready to ship items are set with dimensions\r\n\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\tif ($boxesToShip[$i]['item_length'] == 0) { // size wasn't set\r\n\t\t\t\t\t\tif ($boxesToShip[$i]['item_weight'] > 60) { // use module estimated dimesions when size not set\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 50) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 40) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 30) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 20) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 10) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 5) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_length'] = $length;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_width'] = $width;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_height'] = $height;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$numBoxes = $packing->getNumberOfBoxes();\r\n\r\n\t\t\tif (SHIPPING_UNIT_LENGTH == 'CM') { // must convert centimeters to inches before getting quote\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\t$boxesToShip[$i]['item_length'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_width'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_height'] *= 0.39370079;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // # The old method. tell us how many boxes plus the box weight\r\n\r\n\t\t\tif ($shipping_weight > 60) { // these are defined in inches and don't need converting\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t} elseif ($shipping_weight > 50) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t} elseif ($shipping_weight > 40) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t} elseif ($shipping_weight > 30) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t} elseif ($shipping_weight > 20) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t} elseif ($shipping_weight > 10) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t} elseif ($shipping_weight > 5) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t} else {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t}\r\n\r\n\t\t\t$package = array('item_weight' => $shipping_weight,\r\n\t\t\t\t'item_price' => round($order->info['subtotal'] / $shipping_num_boxes, 2),\r\n\t\t\t\t'item_length' => $length,\r\n\t\t\t\t'item_width' => $width,\r\n\t\t\t\t'item_height' => $height);\r\n\r\n\t\t\t$boxesToShip = array();\r\n\r\n\t\t\tfor ($i = 0; $i < $shipping_num_boxes; $i++) {\r\n\t\t\t\t$boxesToShip[] = $package;\r\n\t\t\t}\r\n\r\n\t\t\t$totalWeight = round($shipping_weight * $shipping_num_boxes, 2);\r\n\t\t\t$numBoxes = $shipping_num_boxes;\r\n\t\t}\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'KGS') { // # must convert kilograms to pounds before getting quote\r\n\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t$boxesToShip[$i]['item_weight'] *= 2.2046226;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($this->display_weight) {\r\n\t\t\t$shiptitle = sprintf(MODULE_SHIPPING_USPS_TEXT_WEIGHT_DISPLAY, $numBoxes, $totalWeight);\r\n\t\t} else {\r\n\t\t\t$shiptitle = '';\r\n\t\t}\r\n\t\t$this->dest_zip = str_replace(' ', '', $order->delivery['postcode']);\r\n\t\tif ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { // domestic quote\r\n\t\t\t$this->dest_zip = substr($this->dest_zip, 0, 5);\r\n\t\t\t$dmstcquotes = array();\r\n\t\t\tif( $this->display_transit ){\r\n\t\t\t\t$trnstime = $this->_getDmstcTransitTimes();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$error = false;\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getDmstcQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($dmstcquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailavail'] = ($dmstcquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineavail'] = ($dmstcquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($dmstcquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif( (MODULE_SHIPPING_USPS_DMSTC_RATE == 'Internet') && $quote['onlineavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['onlineconf'])) $title .= '<br />---' . $quote['onlineconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} elseif( $quote['retailavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['retailconf'])) $title .= '<br />---' . $quote['retailconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $dmstcquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( sizeof($this->dmstc_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'Domestic',\r\n\t\t\t\t\t'changes' => $this->dmstc_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t} else { // # international quote\r\n\t\t\t$maxinsurance_query = tep_db_query(\"SELECT DISTINCT(max_insurance) FROM USPS_intl_maxins WHERE insurable AND country_code = '\" . tep_db_input($order->delivery['country']['iso_code_2']) . \"' ORDER BY max_insurance\");\r\n\t\t\t$this->intl_maxinsure = array();\r\n\r\n\t\t\twhile ($x = tep_db_fetch_array($maxinsurance_query)) {\r\n\t\t\t\t$this->intl_maxinsure[] = $x['max_insurance'];\r\n\t\t\t}\r\n\r\n\t\t\t$intlquotes = array();\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getIntlQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($intlquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailavail'] = ($intlquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineavail'] = ($intlquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$intlquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($intlquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif ((MODULE_SHIPPING_USPS_INTL_RATE == 'Internet') && $quote['onlineavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t} elseif ($quote['retailavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $intlquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if there's been a change detected, log it..\r\n\t\t\tif( sizeof($this->intl_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'International',\r\n\t\t\t\t\t'changes' => $this->intl_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (is_array($uspsQuote)) {\r\n\t\t\tif (isset($uspsQuote['error'])) {\r\n\t\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'error' => $uspsQuote['error']);\r\n\t\t\t} else {\r\n\t\t\t\t$quotesort = array();\r\n\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t$quotesort[$method['id']] = $method['cost'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $this->shipping_method_sort_direction == 'desc' ){\r\n\t\t\t\t\tarsort($quotesort); // sort methods by cost high to low\r\n\t\t\t\t} else {\r\n\t\t\t\t\tasort($quotesort);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$methods = array();\r\n\t\t\t\tforeach ($quotesort as $key => $cost) {\r\n\t\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t\tif ($method['id'] == $key) $methods[] = $method;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->quotes = array('id' => $this->code,\r\n\t\t\t\t\t'module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'methods' => $methods);\r\n\t\t\t\tif ($this->tax_class > 0) {\r\n\t\t\t\t\t$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // quotes was empty\r\n\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);\r\n\t\t}\r\n\t\tif (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);\r\n\t\t\r\n// \t\tprint_r( $this->quotes );\r\n\t\t\r\n\t\treturn $this->quotes;\r\n\t}",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }",
"function plgVmConfirmedOrder (VirtueMartCart $cart, $order) {\n\n\t\tif (!($method = $this->getVmPluginMethod ($order['details']['BT']->virtuemart_shipmentmethod_id))) {\n\t\t\treturn NULL; // Another method was selected, do nothing\n\t\t}\n\t\tif (!$this->selectedThisElement ($method->shipment_element)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\t$values['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;\n\t\t$values['order_number'] = $order['details']['BT']->order_number;\n\t\t$values['virtuemart_shipmentmethod_id'] = $order['details']['BT']->virtuemart_shipmentmethod_id;\n\t\t$values['shipment_name'] = $this->renderPluginName ($method);\n\t\t$values['order_weight'] = $this->getOrderWeight ($cart, $method->weight_unit);\n\t\t$values['shipment_weight_unit'] = $method->weight_unit;\n\n\t\t$costs = $this->getCosts($cart,$method,$cart->cartPrices);\n\t\tif(empty($costs)){\n\t\t\t$values['shipment_cost'] = 0;\n\t\t\t$values['shipment_package_fee'] = 0;\n\t\t} else {\n\t\t\t$values['shipment_cost'] = $method->shipment_cost;\n\t\t\t$values['shipment_package_fee'] = $method->package_fee;\n\t\t}\n\n\t\t$values['tax_id'] = $method->tax_id;\n\t\t$this->storePSPluginInternalData ($values);\n\n\t\treturn TRUE;\n\t}",
"function wcfm_order_tracking_response( $item_id, $item, $order ) {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\t\t\r\n\t\t// See if product needs shipping \r\n\t\t$product = $item->get_product(); \r\n\t\t$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product ); \r\n\t\t\r\n\t\tif( $WCFMu->is_marketplace ) {\r\n\t\t\tif( $WCFMu->is_marketplace == 'wcvendors' ) {\r\n\t\t\t\tif( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {\r\n\t\t\t\t\tif( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;\r\n\t\t\t\t}\r\n\t\t\t} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\tglobal $WCMp;\r\n\t\t\t\tif( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( $needs_shipping ) {\r\n\t\t\t$traking_added = false;\r\n\t\t\t$package_received = false;\r\n\t\t\tforeach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {\r\n\t\t\t\tif( $meta->key == 'wcfm_tracking_url' ) {\r\n\t\t\t\t\t$traking_added = true;\r\n\t\t\t\t}\r\n\t\t\t\tif( $meta->key == 'wcfm_mark_as_recived' ) {\r\n\t\t\t\t\t$package_received = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo \"<p>\";\r\n\t\t\tprintf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\tif( $package_received ) {\r\n\t\t\t\tprintf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t} elseif( $traking_added ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"#\" class=\"wcfm_mark_as_recived\" data-orderitemid=\"<?php echo $item_id; ?>\" data-orderid=\"<?php echo $order->get_id(); ?>\" data-productid=\"<?php echo $item->get_product_id(); ?>\"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>\r\n\t\t\t\t<?php\r\n\t\t\t} else {\r\n\t\t\t\tprintf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t}\r\n\t\t\techo \"</p>\";\r\n\t\t}\r\n\t}",
"public function ship($parcel)\n {\n return TRUE;\n }",
"function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function isAutoShipping(): bool;",
"public function estimated_shipping() {\n\n\t\t$this->api_record_event( $this->event_name['estimated_shipping'] );\n\t}",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"function add_shippify_order_action_button( $actions, $the_order ) {\n\n // esto me dio error en algunas ordenes... \n if (in_array(\"shippify\", get_post_meta( $the_order->id, '_shipping_method', true )) && (get_post_meta( $the_order->id, '_is_dispatched', true ) != 'yes') && !isset($_GET['post_status'])){ \n $actions['shippify_action'] = array(\n 'url' => wp_nonce_url( admin_url( 'edit.php?post_type=shop_order&myaction=woocommerce_shippify_dispatch&stablishedorder=' . $the_order->id ), 'woocommerce-shippify-dispatch'), \n 'name' => __( 'Dispatch', 'woocommerce-shippify' ),\n 'action' => \"view shippify\", // setting \"view\" for proper button CSS.\n );\n }\n return $actions;\n }",
"public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }",
"public function saveOrder()\n {\n $this->validate();\n $this->_initKlarnaCheckout(false, false);\n\n try {\n if (($merchantCheckboxMethod = $this->_helper->getCheckoutConfig('merchant_checkbox')) != -1) {\n $this->_helper->dispatchMerchantCheckboxMethod(\n $merchantCheckboxMethod, array(\n 'quote' => $this->getQuote(),\n 'klarna_quote' => $this->getKlarnaQuote(),\n 'checked' => (bool)$this->getKlarnaCheckout()->getData('merchant_requested/additional_checkbox')\n )\n );\n }\n\n $checkboxes = $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes');\n if (!empty($checkboxes)) {\n $this->_helper->dispatchMultipleCheckboxesEvent(\n $this->getKlarnaCheckout()->getData('merchant_requested/additional_checkboxes'),\n $this->getQuote(),\n $this->getKlarnaQuote()\n );\n }\n } catch (Mage_Core_Exception $e) {\n Mage::logException($e);\n // Don't stop order from saving just because the checkbox processing failed\n }\n\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n Mage::dispatchEvent(\n 'kco_checkout_save_order_before', array(\n 'checkout' => $this\n )\n );\n\n /**\n * For older versions of Magento state cannot be removed as a requirement\n * for shipping which is necessary in some countries.\n *\n * This checks if the Magento version is below 1.7 and disabled address validation\n */\n if (version_compare(Mage::getVersion(), '1.7.0', '<')) {\n $this->getQuote()->getBillingAddress()->setShouldIgnoreValidation(true);\n if (!$this->getQuote()->isVirtual()) {\n $this->getQuote()->getShippingAddress()->setShouldIgnoreValidation(true);\n }\n }\n\n $service = Mage::getModel('sales/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n /** @var Mage_Sales_Model_Order $order */\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent(\n 'checkout_type_kco_save_order_after', array(\n 'order' => $order,\n 'quote' => $this->getQuote()\n )\n );\n\n if ($order->getCanSendNewEmailFlag()) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession\n ->setLastOrderId($order->getId())\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => array())\n );\n\n return $order;\n }",
"public function onCheckoutCartEstimatePost($observer)\n {\n $quote = Mage::helper('shipperhq_shipper')->getQuote();\n $quote->setIsMultiShipping(false);\n $shipping = $quote->getShippingAddress();\n $shipping->setIsCheckout(0);\n $shipping->save();\n }",
"public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }",
"public function orderUpdate()\n {\n $this->helper->logOrder('Beginning Order Update.');\n $stores = $this->storeManager->getStores();\n\n $enabledStores = [];\n\n foreach ($stores as $store) {\n if ($store->isActive() && $this->helper->isEnabled($store->getId())) {\n $enabledStores[] = $store->getId();\n }\n }\n\n if ($enabledStores) {\n $ordersToProcess = null;\n\n $ordersToProcess = $this->orderCollectionFactory\n ->create()\n ->addFieldToSelect('*')\n ->addFieldToFilter(\n 'store_id',\n [\n 'in' => [$enabledStores],\n ]\n )\n ->addFieldToFilter(\n 'state',\n [\n 'in' => [\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_PROCESSING,\n ],\n ]\n )\n ->addFieldToFilter('fulfilled_by_amazon', true)\n ->addFieldToFilter(\n 'amazon_order_status',\n [\n 'in' => [\n $this->helper::ORDER_STATUS_RECEIVED,\n $this->helper::ORDER_STATUS_PLANNING,\n $this->helper::ORDER_STATUS_PROCESSING,\n ],\n ]\n );\n\n if (!empty($ordersToProcess) && $ordersToProcess->count()) {\n $this->helper->logOrder('Beginning Order Update for ' . $ordersToProcess->count() . ' orders.');\n\n foreach ($ordersToProcess as $order) {\n $this->helper->logOrder('Updating order #' . $order->getIncrementId());\n\n $result = $this->outbound->getFulfillmentOrder($order);\n if ($result) {\n $fulfillmentOrderResult = $result->getGetFulfillmentOrderResult();\n\n // Amazon Statuses: RECEIVED / INVALID / PLANNING / PROCESSING / CANCELLED / COMPLETE\n // / COMPLETE_PARTIALLED / UNFULFILLABLE\n $amazonStatus = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getFulfillmentOrderStatus();\n\n $amazonOrderId = $fulfillmentOrderResult->getFulfillmentOrder()\n ->getDisplayableOrderId();\n\n $id = $order->getIncrementId();\n if ($order->getIncrementId() == $amazonOrderId) {\n $this->helper->logOrder(\n 'Status of order #' . $order->getIncrementId() . ': ' . $amazonStatus\n );\n\n if ($amazonStatus) {\n switch ($amazonStatus) {\n case 'COMPLETE':\n case 'COMPLETE_PARTIALLED':\n $this->magentoOrderUpdate($order, $fulfillmentOrderResult);\n break;\n case 'INVALID':\n case 'CANCELLED':\n case 'UNFULFILLABLE':\n $this->cancelFBAShipment($order, $fulfillmentOrderResult);\n break;\n }\n }\n }\n }\n }\n\n $this->helper->logOrder(__('Get Order status called. Orders to process: ') . $ordersToProcess->count());\n } else {\n $this->helper->logOrder(__('Get Order status called. No orders to process'));\n }\n }\n }",
"public function savePostAction() {\n $isNeedCreateLabel = '';\n try {\n $updateOrderId = $this->getRequest ()->getParam ( 'order_id' );\n /**\n * Get marketplace commission details\n */\n $collection = Mage::getModel ( 'marketplace/commission' )->getCollection ()->addFieldToFilter ( 'seller_id', Mage::getSingleton ( 'customer/session' )->getId () )->addFieldToFilter ( 'order_id', $updateOrderId )->getFirstItem ();\n /**\n * Checking manage order enable for seller\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Checking for seller order management enable or not\n */\n if (count ( $collection ) <= 0 || $orderStatusFlag != 1) {\n $this->_getSession ()->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n return;\n }\n /**\n * Get shipment info\n */\n $data = $this->getRequest ()->getParam ( 'shipment' );\n $shipment = $this->_initShipment ();\n if (! $shipment) {\n $this->_forward ( 'noRoute' );\n return;\n }\n /**\n * Register shipment\n */\n $shipment->register ();\n $comment = '';\n if (! empty ( $data ['comment_text'] )) {\n $shipment->addComment ( $data ['comment_text'], isset ( $data ['comment_customer_notify'] ), isset ( $data ['is_visible_on_front'] ) );\n if (isset ( $data ['comment_customer_notify'] )) {\n $comment = $data ['comment_text'];\n }\n }\n $shipment->setEmailSent ( true );\n /**\n * Set customer notify.\n */\n $shipment->getOrder ()->setCustomerNoteNotify ( true );\n $responseAjax = new Varien_Object ();\n $isNeedCreateLabel = isset ( $data ['create_shipping_label'] ) && $data ['create_shipping_label'];\n if ($isNeedCreateLabel && $this->_createShippingLabel ( $shipment )) {\n $responseAjax->setOk ( true );\n }\n /**\n * Save shipment\n */\n $this->_saveShipment ( $shipment );\n\n /**\n * Send shipment email\n */\n $shipment->sendEmail ( true, $comment );\n /**\n * Initilize shipment label\n */\n $shipmentCreatedMessage = $this->__ ( 'The shipment has been created.' );\n $labelCreatedMessage = $this->__ ( 'The shipping label has been created.' );\n $savedQtys = $this->_getItemQtys ();\n Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $savedQtys, $updateOrderId, 0 );\n $this->_getSession ()->addSuccess ( $isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage : $shipmentCreatedMessage );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Thorugh the exception error message.\n */\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( $e->getMessage () );\n } else {\n /**\n * When error occured, redirect to the view order page.\n */\n $this->_getSession ()->addError ( $e->getMessage () );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n } catch ( Exception $e ) {\n Mage::logException ( $e );\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( /**\n * Through error when create shipping label.\n */\n Mage::helper ( 'sales' )->__ ( 'An error occurred while creating shipping label.' ) );\n } else {\n $this->_getSession ()->addError ( $this->__ ( 'Cannot save shipment.' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }\n if ($isNeedCreateLabel) {\n $this->getResponse ()->setBody ( $responseAjax->toJson () );\n } else {\n /**\n * Redirect to the view order page.\n */\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }",
"public function setShippingCost($shippingCost);",
"public function calculateQtyToShip();",
"function setShipping($ship_key)\n {\n return 4.50;\n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"function bill_transition_placed_pending($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n\n $productiondata = produce_prepay($bill);\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n\n // Notify end user.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n // Feedback customer with mail confirmation.\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->billItems),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid, 'view' => 'bill', 'billid' => $bill->id, 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Delayed Transaction Activating Operations on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'PENDING';\n $bill->save(true);\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}",
"public function setShipAddress(?Address $address = null): Cart;",
"public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }",
"public function updateBuyOrderStatusAndCreatePosition()\n {\n $orders = $this->orderService->getOpenBuyOrders();\n\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>updateBuyOrderStatusAndCreatePosition</info>';\n foreach ($orders as $order) {\n /** @var \\GDAX\\Types\\Response\\Authenticated\\Order $gdaxOrder */\n $gdaxOrder = $this->gdaxService->getOrder($order['order_id']);\n // Mocken\n\n $position_id = 0;\n $status = $gdaxOrder->getStatus();\n\n if ($status) {\n if ($status == 'done') {\n $position_id = $this->positionService->open($gdaxOrder->getId(), $gdaxOrder->getSize(), $gdaxOrder->getPrice());\n $this->msg[] = $this->timestamp . ' .... <info>Opend position</info>';\n }\n\n $this->orderService->updateOrderStatus($order['id'], $gdaxOrder->getStatus(), $position_id);\n } else {\n $this->orderService->updateOrderStatus($order['id'], $gdaxOrder->getMessage(), $position_id);\n }\n }\n }\n }",
"public function salesOrderShipmentSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n \n if (!$settings['shipment_notification_message']) {\n return;\n }\n $order = $observer->getEvent()->getShipment()->getOrder();\n \n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_id = $order->getIncrementId();\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n $shipment = $order->getShipmentsCollection()->getFirstItem();\n $shipId = $shipment->getIncrementId();\n\n // Check if a telephone number has been specified\n if(in_array('shippment', $final_array)){\n if ($telephoneNumber) {\n // Send the shipment notification to the specified telephone number\n $text = $settings['shipment_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{shipmentno}}', $shipId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n // Display a success or error message\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The shipment notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the shipment notification SMS.');\n }\n }\n } \n}",
"public function testUpdateOrder()\n {\n }",
"public function updateOrder() {\n\n echo \"ok\";\n }",
"public function actualize()\n {\n\n $orders = $this->gdaxService->getOpenOrders();\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>actualize orders</info>';\n $this->orderService->fixUnknownOrdersFromGdax($orders);\n }\n }",
"public function setQuantityShippedAttribute($input)\n {\n $this->attributes['quantity_shipped'] = $input ? $input : null;\n }",
"protected function _fcpoSetOrderStatus() {\n $blIsAmazonPending = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoAmazonPayOrderIsPending');\n $blOrderOk = $this->_fcpoValidateOrderAgainstProblems();\n\n if ($blIsAmazonPending) {\n $this->_setOrderStatus('PENDING');\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $this->save();\n } elseif ($blOrderOk === true) {\n // updating order trans status (success status)\n $this->_setOrderStatus('OK');\n } else {\n $this->_setOrderStatus('ERROR');\n }\n }",
"public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n if (\"0\" == $this->scopeConfig->getValue('pickrr_magento2/general/automatic_shipment_enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE))\n return NULL;\n\n $order = $observer->getEvent()->getOrder();\n $payment = $order->getPayment();\n\n if($payment->getMethod() == \"cashondelivery\")\n $cod_amount = $order->getGrandTotal();\n else\n $cod_amount = 0.0;\n\n if ($order->getState() != Order::STATE_NEW && $order->getState() != Order::STATE_PENDING_PAYMENT )\n return NULL;\n\n $auth_token = $this->scopeConfig->getValue('pickrr_magento2/general/auth_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $pickup_time = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/pickup_time', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_name = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_name', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_phone_number = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_phone_number', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_pincode = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_pincode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_address = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_address', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $this->helper->createOrderShipment($auth_token, $order, $from_name, $from_phone_number, $from_pincode, $from_address, $pickup_time, $cod_amount);\n }",
"public function setShippingAmount($amount);",
"public function salesOrderPlaceAfter($observer)\n {\n try{\n //if order tracking is set\n //$sfEnabled = Mage::getStoreConfig('shoppingfeeder/service/enable');\n $sfEnabled = true;\n $sfTracking = Mage::getStoreConfig('shoppingfeeder/service/tracking');\n $fbTracking = Mage::getStoreConfig('shoppingfeeder/fb_track_config/fb_track');\n if (($sfEnabled && $sfTracking) || (!is_null($fbTracking) && $fbTracking))\n {\n /* @var Mage_Sales_Model_Order $order */\n $order = $observer->getEvent()->getOrder();\n\n //Mage::log('salesOrderPlaceAfter Order ID: '.$order->getRealOrderId());\n\n //set the order for JS tracking code\n $orderItems = array();\n foreach ($order->getAllItems() as $item)\n {\n $orderItems[] = '\\''.$item->getProductId().'\\'';\n }\n $orderInfo = array(\n 'items' => $orderItems,\n 'value' => $order->getGrandTotal()\n );\n Mage::getSingleton('core/session')->setSfdrOrderForJsTracking($orderInfo);\n\n //only notify ShoppingFeeder if required\n if ($sfEnabled && $sfTracking)\n {\n $this->_notifyShoppingFeeder($order);\n }\n }\n }\n catch (Exception $e)\n {\n Mage::log('_notifyShoppingFeeder Order ID: '.$order->getRealOrderId().' FAILED! Message: '.$e->getMessage());\n }\n }",
"public function createTemandoShipment(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $order = $observer->getEvent()->getOrder();\n $shippingAddress = $order->getShippingAddress();\n $deprecateSkus = array();\n\n $shippingMethod = $order->getShippingMethod();\n $titleOptions = $this->_type->toOptionArray();\n $titles = array();\n foreach ($titleOptions as $value => $optionTitle) {\n $titles[$value] = $optionTitle['label'];\n }\n\n $quote = $this->_quoteRepository->get($order->getQuoteId());\n $quoteShippingAddress = $quote->getShippingAddress();\n\n $origin = $this->_originCollection->getOriginByInventory(\n $order->getAllVisibleItems(),\n $quoteShippingAddress->getPostcode()\n );\n //$origin = $this->_originCollection->getOriginByPostcode($quoteShippingAddress->getPostcode());\n $this->_shipment->setData('order_id', $order->getId());\n $this->_shipment->setData('order_increment_id', $order->getIncrementId());\n $this->_shipment->setData('origin_id', $origin->getId());\n\n $orderSkus = $this->_helper->getOrderSkus($order);\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::PENDING;\n\n $exclusiveOD = $this->_helper->orderContainsExclusively($order, \"OD\");\n foreach ($orderSkus as $sku => $details) {\n if ($details['stock_availability_code'] == \"OD\") {\n $hasStock = $origin->hasStock(array($sku => $details['qty']));\n if ($hasStock) {\n $deprecateSkus[$sku] = $details['qty'];\n } elseif ($exclusiveOD) {\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::BACK_ORDER;\n }\n } else {\n $deprecateSkus[$sku] = $details['qty'];\n }\n }\n $this->_shipment->setData('status', $shipmentStatus);\n $this->_shipment->setData('destination_contact_name', $shippingAddress->getName());\n $this->_shipment->setData('destination_company_name', $shippingAddress->getCompany());\n $streetAddress = $shippingAddress->getStreetLine(1);\n if ($shippingAddress->getStreetLine(2)) {\n $streetAddress .= \", \" . $shippingAddress->getStreetLine(2);\n }\n $this->_shipment->setData('destination_street', $streetAddress);\n $this->_shipment->setData('destination_city', $shippingAddress->getCity());\n $this->_shipment->setData('destination_postcode', $shippingAddress->getPostcode());\n $this->_shipment->setData('destination_region', $shippingAddress->getRegion());\n $this->_shipment->setData('destination_country', $shippingAddress->getCountryId());\n $this->_shipment->setData('destination_phone', $shippingAddress->getTelephone());\n $this->_shipment->setData('destination_email', $order->getCustomerEmail());\n\n //set customer selected quote data\n $temandoQuoteData = explode('_', $shippingMethod);\n $temandoQuoteId = $temandoQuoteData[2];\n\n $quoteDescription = '-';\n switch ($temandoQuoteData[2]) {\n default:\n $temandoQuote = $this->_quote->load($temandoQuoteId);\n $carrier = $this->_helper->getCarrierByTemandoId($temandoQuote->getCarrierId());\n $quoteDescription = $carrier->getCompanyName() . ' - ' . $temandoQuote->getDeliveryMethod();\n $totalPrice = $temandoQuote->getTotalPrice();\n break;\n }\n\n $this->_shipment->setData('customer_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('customer_selected_options', $shippingMethod);\n $this->_shipment->setData('customer_selected_quote_description', $quoteDescription);\n $this->_shipment->setData('admin_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('anticipated_cost', $totalPrice);\n\n if ($shippingAddress->getIsBusinessAddress()) {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::BUSINESS\n );\n } else {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::RESIDENTIAL\n );\n }\n\n if ($shippingAddress->getAuthorityToLeave()) {\n $this->_shipment->setData('destination_authority_to_leave', 1);\n } else {\n $this->_shipment->setData('destination_authority_to_leave', 0);\n }\n\n try {\n $this->_shipment->save();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment') . ' ' . $e->getMessage());\n }\n //register the quotes with the shipment\n //$this->registerQuotes($order);\n try {\n $this->_shipment->saveAllItems();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment items') . ' ' . $e->getMessage());\n }\n\n\n //how many boxes required?\n $this->saveBoxes($order);\n\n if ((count($deprecateSkus)) && ($origin->getErpId())) {\n $this->deprecateSkus($origin->getErpId(), $deprecateSkus);\n }\n //$this->_shipment->fetchQuotes();//or update existing quotes to use this shipment\n\n $this->clearSessionData();\n\n return $this->_shipment;\n }",
"public function submitOrderToAmazon(Varien_Event_Observer $observer)\n {\n $helper = Mage::helper('amazon_mcf');\n $order = $observer->getOrder();\n\n // Do we have any items to submit to Amazon?\n $amazonItemInOrder = false;\n foreach ($order->getAllItems() as $item) {\n if ($item->getProduct()->getAmazonMcfEnabled()) {\n $order->setFulfilledByAmazon(true);\n $amazonItemInOrder = true;\n break;\n }\n }\n\n if (!$helper->isEnabled() || !$amazonItemInOrder) {\n return;\n }\n\n /**\n * @var Amazon_MCF_Model_Service_Outbound $service\n */\n $service = Mage::getSingleton('amazon_mcf/service_outbound');\n $response = $service->createFulfillmentOrder($order);\n\n if (!empty($response)) {\n $order->setAmazonOrderStatus(\n Amazon_MCF_Helper_Data::ORDER_STATUS_RECEIVED\n );\n } else {\n $order->setAmazonOrderStatus(\n Amazon_MCF_Helper_Data::ORDER_STATUS_ATTEMPTED\n );\n $order->setAmazonOrderSubmissionCount(1);\n }\n }",
"public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }",
"public function execute(\n CartInterface $cart,\n AddressInterface $billingAddress,\n bool $useForShipping\n ): void {\n try {\n $this->billingAddressManagement->assign($cart->getId(), $billingAddress, $useForShipping);\n } catch (NoSuchEntityException $e) {\n throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e);\n } catch (LocalizedException $e) {\n throw new GraphQlInputException(__($e->getMessage()), $e);\n }\n }",
"function get_item_shipping() {\n\t}",
"function wc_add_notice_free_shipping() {\n\n $order_min_amount = get_free_shipping_minimum();\n\n $cart = WC()->cart->subtotal;\n $remaining = $order_min_amount - $cart;\n $f_str = \"\";\n if ( $cart < 1 ) {\n $f_str .= sprintf( __( '<strong>Free delivery</strong> from %s.', 'thegrapes' ), wc_price($order_min_amount));\n } else if ( $order_min_amount > $cart ){\n $f_str .= sprintf( __( 'Spend %s more to get <strong>free delivery</strong>.', 'thegrapes' ), wc_price($remaining));\n } else {\n $f_str .= '<strong>' . __( 'You have free delivery.', 'thegrapes' ) . '</strong>';\n }\n return $f_str;\n\n}",
"public function sendOrder(Mage_Sales_Model_Order $order)\n {\n try{\n\t\t\t$this->_eventType = 'placeOrder';\n\t\t\t$amount\t\t= number_format($order->getGrandTotal(),2);\n\t\t\t$samount\t= number_format($order->getSubtotal(),2);\n\t\t\t$tax \t\t= number_format($order->getBaseTaxAmount(),2);\n\t\t\t$shipping \t= number_format($order->getBaseShippingAmount(),2);\n\t\t\t$discounts \t= number_format($order->getDiscountAmount(),2);\n\t\t\t$shippingAddressData \t= $order->getShippingAddress()->getData();\n\t\t\t$billingAddressData \t= $order->getBillingAddress()->getData();\n\t\t\t$shippingMethod \t \t= $order->_data[\"shipping_description\"];\n\t\t\t$paymentMethod \t \t \t= $order->getPayment()->getMethodInstance()->getTitle();\n\t\t\t$customerId \t\t\t= $order->getCustomerId();\n\t\t\t$websiteId \t\t\t\t= 1;\n\t\t\t$balanceModel \t\t\t= Mage::getModel('enterprise_customerbalance/balance')\n\t\t \t\t\t\t \t->setCustomerId($customerId)\n\t\t \t\t\t\t \t->setWebsiteId($websiteId)\n\t\t \t\t\t\t\t->loadByCustomer();\t\n\t\t $storeCredit\t\t\t= ($balanceModel->getId())? number_format($balanceModel->getAmount(),2) :'0' ; \t\t\t\t\t\t\n $data = array(\n 'email' => $order->getCustomerEmail(),\n 'items' => $this->_getItems($order->getAllVisibleItems()),\n 'adjustments' => $this->_getAdjustments($order),\n 'message_id' => $this->getMessageId(),\n 'send_template' => 'Purchase Receipt',\n 'tenders' => $this->_getTenders($order),\n 'vars'\t=> array ( 'order#'=> $order->getIncrementId(),\n\t\t\t\t\t\t\t\t\t'subtotal'=> $samount,\n\t\t\t\t\t\t\t\t\t'shipping_and_handling'=> $shipping,\n\t\t\t\t\t\t\t\t\t'sale_tax'=> $tax,\n\t\t\t\t\t\t\t\t\t'billing_address'=> $shippingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_address'=> $billingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_method'=> $shippingMethod,\n\t\t\t\t\t\t\t\t\t'payment_method'=> $paymentMethod,\n\t\t\t\t\t\t\t\t\t'store_credit' => $storeCredit\n\t\t\t ),\n \t);\n /**\n * Send order data to purchase API\n */\n $responsePurchase = $this->apiPost('purchase', $data);\n\t\t\t\n\t\t\t/****Update product sku in following items for price alert****/\n $productSku = array();\n\t\t\tforeach ($order->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n $sailthru_userdata = $this->apiGet('user', array('id' => $order->getCustomerEmail()));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items']) && $productSku) {\n\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t$sailthru_followingItems = array_values($sailthru_followingItems);\n\t\t\t\t$sailthru_followingItems = array_diff($sailthru_followingItems,$productSku);\n\t\t\t\t$sailthru_followingItems = array_unique($sailthru_followingItems);\n\t\t\t\t$data = array(\n\t\t\t\t\t\t\"id\" => $order->getCustomerEmail(),\n\t\t\t\t\t\t\"vars\" => array(\"following_items\" => $sailthru_followingItems)\n\t\t\t\t\t\t);\n\t\t\t\t$response = $this->apiPost('user', $data);\n\t\t\t}\n /*************************************************/\n\t\t\t\n /**\n * Send customer data to user API\n */\n //$responseUser = Mage::getModel('sailthruemail/client_user')->sendCustomerData($customer);\n }catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }",
"public function setSameAsBillingShippingAddress()\n {\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();\n $this->browser->find($this->accountInformationBlock)->hover();\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes');\n }",
"function hide_shipping_when_free_is_available( $rates, $package ) {\n \t\n \tglobal $woocommerce;\n\t\n\t//Stop promotion after 1st June\n\t//if( '20160601' > date(\"Ymd\") ) {\n\t\n\t$products = $woocommerce->cart->get_cart(); //Returns the contents of the cart in an array with the 'data' element.\n\t$count_pub41 = 0;\n\t$only_pub41 = true;\n\t\n\tforeach( $products as $product ) {\n\t\t//All extended meta data is stored in a 'data' array, stores the WC_Product_Simple Object which contains\n\t\t//information about the product\n\t\t\n\t\t$_product = $product['data'];\n\t\t$SKU = $_product->get_sku();\n\n\t\tif ($SKU == 'PUB41') {\n\t\t\t$count_pub41 = $product['quantity'];\n\t\t}\n\t\telse if (!$_product->is_virtual()) {\n\t\t\t$only_pub41 = false;\n\t\t}\n\t}\n \n\tif ( $count_pub41 >= 1 AND $only_pub41 ) {\n\t\t//$rates['free_shipping'] = new WC_Shipping_Rate('free_shipping', 'Free Shipping', 0, array(), '');\n\t\tunset( $rates['flat_rate'] );\n\t\tunset( $rates['eca_shipping_express'] );\n\t\t//unset( $rates['eca_shipping']);\n\t\t$rates['eca_shipping']->cost = 0;\n\t}\n\t//}\n\t\n\treturn $rates;\n}",
"public function adminSalesOrderCreateProcessDataBefore($observer)\n {\n if(Mage::getStoreConfig('carriers/shipper/active')) {\n $post = $observer->getRequestModel()->getPost();\n if(isset($post['order'])) {\n $data = $post['order'];\n\n $found = false;\n $customCarrierGroupData = array();\n $carriergroupId = isset($data['carriergroup_id']) ? $data['carriergroup_id'] : '';\n if (isset($data['shipping_amount'])) {\n $customCarrierGroupData[$carriergroupId] = array('customPrice' => $data['shipping_amount'], 'carriergroup' => $carriergroupId);\n $found = true;\n }\n\n if (isset($data['shipping_description'])) {\n if(array_key_exists($carriergroupId, $customCarrierGroupData)) {\n $shipArray = $customCarrierGroupData[$carriergroupId];\n $shipArray['customCarrier'] = $data['shipping_description'];\n $customCarrierGroupData[$carriergroupId] = $shipArray;\n }\n else {\n $customCarrierGroupData[$carriergroupId] = array('customCarrier' => $data['shipping_description'], 'carriergroup' => $carriergroupId);\n }\n $found = true;\n }\n\n if ($found) {\n $shippingAddress = $observer->getSession()->getQuote()->getShippingAddress();\n Mage::helper('shipperhq_shipper')->cleanDownRatesCollection($shippingAddress, 'shipperadmin', '');\n Mage::register('shqadminship_data', new Varien_Object($customCarrierGroupData));\n $storedLimitCarrier = $shippingAddress->getLimitCarrier();\n $shippingAddress->setLimitCarrier('shipperadmin');\n $rateFound = $shippingAddress->requestShippingRates();\n $shippingAddress->setLimitCarrier($storedLimitCarrier);\n } else {\n Mage::unregister('shqadminship_data');\n }\n }\n }\n }",
"public function order_processing( $order_id ) {\n\t\t$order = new WC_Order( $order_id ); // load the order from woocommerce\n\t\t$this->notify_warehouse($order); // notify the warehouse to ship the order\n\t}",
"public function saveOrderShipment() {\n\t\t$this->layout = 'ajax';\n $order_id = $this->Shipment->saveOrderShipment($this->request->data);\n\t\tif($order_id) {\n $data = $this->Shipment->Order->find('first', array(\n 'conditions' => array(\n 'Order.id' => $order_id\n )\n ));\n } else {\n $this->set('json', FALSE);\n $this->render('/Common/echo_json');\n }\n $this->set('data', $data);\n $this->render('ship_cell');\n\t}",
"function custom_template_single_shipping()\n {\n global $product;\n ?>\n <span class=\"shipping-cs-tag\">\n <span>Shipping:</span>\n <span>Free</span>\n </span>\n <?php\n }",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"public function isShipped($id){\n $q = $this->slcOrdrFild(\"shipped\", $id);\n return $this->check($q, \"yes\");\n }",
"public function placeOrderAction() {\n\t\tif ($this->_checkPk ()) {\n\t\t\t$this->_redirect ( \"checkout/cart\" );\n\t\t\treturn $this;\n\t\t}\n\t\tif ($this->getRequest ()->isPost ()) {\n\t\t\t$post = $this->getRequest ()->getPost ();\n\t\t\tMage::getSingleton ( 'customer/session' )->setExprsFormData ( $post );\n\t\t\t\n\t\t\t$translate = Mage::getSingleton ( 'core/translate' );\n\t\t\t/* @var $translate Mage_Core_Model_Translate */\n\t\t\t$translate->setTranslateInline ( false );\n\t\t\ttry {\n\t\t\t\t$quote = $this->getQuote ();\n\t\t\t\t$postObject = new Varien_Object ();\n\t\t\t\t$postObject->setData ( $post );\n\t\t\t\t\n\t\t\t\t$error = false;\n\t\t\t\t\n\t\t\t\tif (! Zend_Validate::is ( trim ( $post ['longaccesstoken'] ), 'NotEmpty' )) {\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t\tif (! Zend_Validate::is ( trim ( $post ['cards'] ), 'NotEmpty' )) {\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t\tif (! $quote->getIsVirtual ()) {\n\t\t\t\t\t\n\t\t\t\t\tif (! Zend_Validate::is ( trim ( $post ['address'] ), 'NotEmpty' ) && ! $post ['shipping']) {\n\t\t\t\t\t\t$error = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($error) {\n\t\t\t\t\tthrow new Exception ();\n\t\t\t\t} else {\n\t\t\t\t\t$precheckoutData = Mage::helper ( 'masterpass' )->postExpressCheckoutData ( $post );\n\t\t\t\t\t$precheckoutData = json_decode ( json_encode ( ( array ) $precheckoutData ), 1 );\n\t\t\t\t\tif (empty ( $precheckoutData )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// remove longaccesstoken\n\t\t\t\t\t\t// save long access token\n\t\t\t\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t\t\t\t$longAccessToken = null;\n\t\t\t\t\t\t$customerData->setData ( 'longtoken', $longAccessToken );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$customerData->save ();\n\t\t\t\t\t\tMage::getSingleton ( 'core/session' )->addError ( Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' ) );\n\t\t\t\t\t\t$this->_redirect ( 'checkout/cart' );\n\t\t\t\t\t\treturn $this;\n\t\t\t\t\t}\n\t\t\t\t\tif (! empty ( $precheckoutData ['Checkout'] )) {\n\t\t\t\t\t\t$this->savePrecheckoutData ( $precheckoutData );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t\t\t\t$customerData->save ();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset ( $precheckoutData ['Errors'] ['Error'] ['Source'] )) {\n\t\t\t\t\t\t\tif ($precheckoutData ['Errors'] ['Error'] ['Source'] == \"3DS Needed\") {\n\t\t\t\t\t\t\t\tthrow new Mage_Core_Exception ( \"3DS Needed\" );\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} catch ( Mage_Core_Exception $e ) {\n\t\t\t\tif ($e->getMessage () == \"3DS Needed\") {\n\t\t\t\t\tMage::getSingleton ( 'core/session' )->setExpSecure ( true );\n\t\t\t\t} else {\n\t\t\t\t\tMage::getSingleton ( 'core/session' )->setExpSecure ( false );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset ( $postback_data )) {\n\t\t\t\t\t$TransactionStatus = 'Failure';\n\t\t\t\t\tMage::helper ( 'masterpass' )->postTransaction ( $postback_data, $TransactionStatus, self::APPROVAL_CODE );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_redirect ( 'masterpass/masterpasspairing/precheckout' );\n\t\t\t}\n\t\t} else {\n\t\t\t$generic_error_message = Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' );\n\t\t\tMage::getSingleton ( 'core/session' )->addError ( $generic_error_message );\n\t\t\t$this->_redirect ( 'masterpass/masterpasspairing/precheckout' );\n\t\t}\n\t}",
"private function shipping_batch()\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// find the most recent unprocessed shipments\n\t\t$query = ee()->sync_db->where('processed !=', '1')->order_by('id', 'asc')->get('orders_shipping', 200);\n\n\t\t// create arrays for shipment ids and tracking numbers\n\t\t$ids_processed = array();\n\n\t\t// find our shipped status\n\t\t$status = Store\\Model\\Status::where('name', 'Shipped')->first();\n\n\t\t// load the order_map config file\n\t\tinclude_once dirname(dirname(__FILE__)).'/bmi_custom/config/order_map.php';\n\n\t\t// loop through each shipment\n\t\tforeach($query->result() as $shipment)\n\t\t{\n\t\t\t// add id to the processed array\n\t\t\t$ids_processed[] = $shipment->id;\n\n\t\t\tif(!empty($shipping_carriers[$shipment->carrier]))\n\t\t\t{\n\t\t\t\t$tracking = $shipping_carriers[$shipment->carrier] .'|'. $shipment->tracking_number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tracking = $shipment->tracking_number;\n\t\t\t}\t\n\n\t\t\t// update the status of each order with the tracking numbers\n\t\t\t$order_object = Store\\Model\\Order::find($shipment->order_id);\n\t\t\t$order_object->updateStatus($status, 0, $tracking);\n\n\t\t}\n\n\t\t// update the shipment records to indicate they've been processed\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('orders_shipping');\n\t\t}\t\n\t\t\n\t\t\n\t}",
"public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }",
"public function flagAsContracted()\n {\n $request = $this->newRequest(static::$token);\n $token = $this->quotation_token;\n\n $request->flagAsContracted($this, $token);\n }",
"protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }",
"public function setCanShipPartially($flag);",
"public function notify_warehouse( $order ) {\n\t\t$order_info = $this->get_order_info($order);\n\t\t$supplier_codes = $order_info['suppliers'];\n\t\t// for each supplier code, loop and send email with product info\n\t\tforeach($supplier_codes as $code => $supplier_info) {\n\t\t\tdo_action('wc_dropship_manager_send_order',$order_info,$supplier_info);\n\t\t}\n\t}",
"function sundaysea_update_shipping()\n {\n if (is_null(WC()->cart)) {\n return;\n }\n\n // Constants\n if (!defined('WOOCOMMERCE_CART')) {\n define('WOOCOMMERCE_CART', true);\n }\n\n // Update Shipping\n if (!empty($_POST['calc_shipping'])) {\n\n try {\n WC()->shipping->reset_shipping();\n\n $country = wc_clean($_POST['calc_shipping_country']);\n $state = isset($_POST['calc_shipping_state']) ? wc_clean($_POST['calc_shipping_state']) : '';\n $postcode = apply_filters('woocommerce_shipping_calculator_enable_postcode', true) ? wc_clean($_POST['calc_shipping_postcode']) : '';\n $city = apply_filters('woocommerce_shipping_calculator_enable_city', false) ? wc_clean($_POST['calc_shipping_city']) : '';\n\n if ($postcode && !WC_Validation::is_postcode($postcode, $country)) {\n throw new Exception(__('Please enter a valid postcode/ZIP.', 'woocommerce'));\n } elseif ($postcode) {\n $postcode = wc_format_postcode($postcode, $country);\n }\n\n if ($country) {\n WC()->customer->set_location($country, $state, $postcode, $city);\n WC()->customer->set_shipping_location($country, $state, $postcode, $city);\n } else {\n WC()->customer->set_to_base();\n WC()->customer->set_shipping_to_base();\n }\n\n WC()->customer->calculated_shipping(true);\n\n wc_add_notice(__('Shipping costs updated.', 'woocommerce'), 'notice');\n\n do_action('woocommerce_calculated_shipping');\n\n } catch (Exception $e) {\n\n if (!empty($e))\n wc_add_notice($e->getMessage(), 'error');\n }\n }\n\n // Check cart items are valid\n do_action('woocommerce_check_cart_items');\n\n // Calc totals\n WC()->cart->calculate_totals();\n }",
"public function setShippingPrice() {\n if ($this->price > 200) {\n $this->shippingPrice = 0;\n }\n }",
"private function ConfirmOrder()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// The current quote cannot be finalized - don't let it proceed\n\t\tif(!$this->getQuote()->canBeFinalized()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// ensure that the applied coupon still valid\n\t\ttry {\n\t\t\t$this->getQuote()->reapplyCoupons(true);\n\t\t}\n\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t$GLOBALS['CheckoutErrorMsg'] = $e->getMessage();\n\t\t}\n\n\t\t$GLOBALS['EnterCouponCode'] = isc_html_escape(GetLang('EnterCouponCode'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . \" - \" . GetLang('ConfirmYourOrder'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"checkout_confirm\");\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}",
"public function resolveShippingState(OrderInterface $order);",
"public function saveShippingAction()\n {\n if (!$this->_isActive()) {\n parent::saveShippingAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getPost('shipping', array());\n $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);\n $result = $this->getOnepage()->saveShipping($data, $customerAddressId);\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(\n Mage::helper('core')->jsonEncode($result)\n );\n }\n }",
"public function store(Request $request){\n $verEnvio = \\DB::table('orders')->where('order_id', $request->id_recipies)->first();\n if($verEnvio->status == 1){\n $shipping = new Shipping();\n $shipping->id_user = $request->delivery;\n $shipping->id_recipie = $request->id_recipies;\n $shipping->recipient_name = \"\";\n $shipping->save();\n \\DB::Table('orders')->where('order_id', $request->id_recipies)->update([\n \"status\"=> 2\n ]);\n }\n return ['result' => 'success'];\n }",
"public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }",
"public function salesOrderPlaceAfter($observer) {\n \n if (Mage::helper('core')->isModuleEnabled('Magestore_Inventorywarehouse'))\n return;\n if (Mage::registry('INVENTORY_CORE_ORDER_PLACE'))\n return;\n Mage::register('INVENTORY_CORE_ORDER_PLACE', true);\n $order = $observer->getOrder();\n $items = $order->getAllItems();\n $warehouseIds = null;\n $warehouseId = Mage::getModel('inventoryplus/warehouse')->getCollection()->getFirstItem()->getId();\n if (!$warehouseId) {\n Mage::log($observer->getOrder(), null, 'inventory_management.log');\n return;\n }\n foreach ($items as $item) {\n $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($item->getProductId()); \n $manageStock = $stockItem->getManageStock();\n if($stockItem->getUseConfigManageStock()){\n $manageStock = Mage::getStoreConfig('cataloginventory/item_options/manage_stock',Mage::app()->getStore()->getStoreId()); \n }\n if(!$manageStock){\n continue;\n }\n \n if (in_array($item->getProductType(), array('configurable', 'bundle', 'grouped')))\n continue;\n $qtyOrdered = 0;\n if (!$item->getQtyOrdered() || $item->getQtyOrdered() == 0) {\n if ($item->getParentItemId()) {\n $qtyOrdered = Mage::getModel('sales/order_item')->load($item->getParentItemId())->getQtyOrdered();\n }\n } else {\n $qtyOrdered = $item->getQtyOrdered();\n }\n $warehouseProduct = Mage::getModel('inventoryplus/warehouse_product')->getCollection()\n ->addFieldToFilter('warehouse_id', $warehouseId)\n ->addFieldToFilter('product_id', $item->getProductId())\n ->getFirstItem();\n $currentQty = $warehouseProduct->getAvailableQty() - $qtyOrdered;\n try {\n $warehouseProduct->setAvailableQty($currentQty)\n ->save();\n Mage::getModel('inventoryplus/warehouse_order')->setOrderId($order->getId())\n ->setWarehouseId($warehouseId)\n ->setProductId($item->getProductId())\n ->setItemId($item->getId())\n ->setQty($qtyOrdered)\n ->save();\n } catch (Exception $e) {\n Mage::log($e->getMessage(), null, 'inventory_management.log');\n }\n }\n }",
"public function setPaymentInfoToQuote()\n {\n $expercashCode = Mage::getModel('expercash/expercashmpf')->getCode();\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n\n if ($quote->isVirtual()) {\n $quote->getBillingAddress()->setPaymentMethod($expercashCode);\n } else {\n $quote->getShippingAddress()->setPaymentMethod($expercashCode);\n }\n\n // shipping totals may be affected by payment method\n if (!$quote->isVirtual() && $quote->getShippingAddress()) {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n }\n\n $payment = $quote->getPayment();\n $payment->importData(array('method' => $expercashCode));\n $quote->save();\n }",
"public function setCanShipPartiallyItem($flag);",
"public function setShippingRates(Order $draftOrder): bool;",
"public function test_product_stocks_deduct_when_order_is_placed()\n {\n $product = Product::factory()->create(['available_stock' => 50]);\n\n $product->orders()->create(['quantity' => 5]);\n\n $product->refresh();\n\n $this->assertTrue($product->available_stock === 45);\n }",
"public function setAutoShipping(bool $auto): ShippableInterface;",
"public function getCartShippingMethod()\n {\n }"
] | [
"0.77678424",
"0.7331125",
"0.7266354",
"0.6888803",
"0.67891973",
"0.6565327",
"0.64468884",
"0.6426397",
"0.64220524",
"0.64009774",
"0.63673973",
"0.6310734",
"0.61712736",
"0.61693716",
"0.61505574",
"0.6112471",
"0.6097632",
"0.60953647",
"0.6080662",
"0.605693",
"0.6004989",
"0.59561723",
"0.59424216",
"0.5939528",
"0.5884265",
"0.58832514",
"0.58553666",
"0.57321966",
"0.5731827",
"0.5730442",
"0.56858116",
"0.5678199",
"0.56735003",
"0.56711924",
"0.56636405",
"0.5644969",
"0.56428814",
"0.5637468",
"0.56308836",
"0.5628811",
"0.5628108",
"0.5609516",
"0.56074667",
"0.56036353",
"0.5599224",
"0.55883336",
"0.5551794",
"0.5534795",
"0.55319995",
"0.5507239",
"0.55035454",
"0.5502798",
"0.54933447",
"0.54754436",
"0.5472731",
"0.546507",
"0.5462537",
"0.54625154",
"0.54543936",
"0.54496694",
"0.5449364",
"0.54385936",
"0.5437359",
"0.54325664",
"0.54270184",
"0.54247344",
"0.5420592",
"0.54204834",
"0.5411964",
"0.54093087",
"0.5399169",
"0.53884774",
"0.53871495",
"0.53857446",
"0.5383997",
"0.5383919",
"0.5379819",
"0.5377135",
"0.5359958",
"0.5356623",
"0.53490275",
"0.5341534",
"0.5336024",
"0.5334933",
"0.53234375",
"0.5321759",
"0.53209037",
"0.53116953",
"0.5302928",
"0.53001547",
"0.52985865",
"0.5295956",
"0.52932864",
"0.5289461",
"0.5286008",
"0.52835226",
"0.52827054",
"0.5282694",
"0.52824616",
"0.52818316"
] | 0.79052174 | 0 |
Mark Dokan order as Shipped | function wcfm_dokan_order_mark_shipped() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
if ( !empty( $_POST['orderid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = $_POST['productid'];
$tracking_url = $_POST['tracking_url'];
$tracking_code = $_POST['tracking_code'];
$order_item_id = $_POST['orderitemid'];
$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );
if( wcfm_is_vendor() ) {
$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );
$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class="wcfm_dashboard_item_title" target="_blank" href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );
$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );
$comment_id = $order->add_order_note( $wcfm_messages, '1');
} else {
$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href="%s">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');
}
// Update Shipping Tracking Info
$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
do_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setShipped($id){\n $this->upd(\"orders\", array(\"shipped\" => \"yes\"), array(\"order_id\" => $id));\n }",
"function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}",
"public function markAsExpressShipping(Order $draftOrder): bool;",
"public function markAsDomesticShipping(Order $draftOrder): bool;",
"public function setShipped()\n {\n return $this->setMarkedAs($this->getShippedValue());\n }",
"public function asShipped()\n {\n return $this->markAs($this->getShippedValue());\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function ship(Order $oOrder, Buyer $oBuyer): string;",
"public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }",
"public function isShipped()\n {\n return $this->markedAs($this->getShippedValue());\n }",
"private function shipOrder(string $orderNumber): void\n {\n $order = $this->fetchOrderModel($orderNumber);\n $order->setIsInProcess(true);\n /** @var Transaction $transaction */\n $transaction = Bootstrap::getObjectManager()->create(Transaction::class);\n\n $items = [];\n foreach ($order->getItems() as $orderItem) {\n $items[$orderItem->getId()] = $orderItem->getQtyOrdered();\n }\n\n $shipment = Bootstrap::getObjectManager()->get(ShipmentFactory::class)->create($order, $items);\n $shipment->register();\n $transaction->addObject($shipment)->addObject($order)->save();\n }",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function setPendingShipped($value)\n {\n return $this->set(self::pending_shipped, $value);\n }",
"public function setShippingValues(Order $order): void;",
"public function markShipped( $pick = true )\n {\n return $this->request->handleWithExceptions(function () use ($pick) {\n\n $response = $this->request->client->post(\"orders/shipments/{$this->url_friendly_id}/mark-shipped\", [\n\n 'json' => [\n\n 'pick' => $pick,\n ],\n ]);\n\n\n return json_decode((string)$response->getBody());\n });\n }",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }",
"public function createTemandoShipment(\\Magento\\Framework\\Event\\Observer $observer)\n {\n $order = $observer->getEvent()->getOrder();\n $shippingAddress = $order->getShippingAddress();\n $deprecateSkus = array();\n\n $shippingMethod = $order->getShippingMethod();\n $titleOptions = $this->_type->toOptionArray();\n $titles = array();\n foreach ($titleOptions as $value => $optionTitle) {\n $titles[$value] = $optionTitle['label'];\n }\n\n $quote = $this->_quoteRepository->get($order->getQuoteId());\n $quoteShippingAddress = $quote->getShippingAddress();\n\n $origin = $this->_originCollection->getOriginByInventory(\n $order->getAllVisibleItems(),\n $quoteShippingAddress->getPostcode()\n );\n //$origin = $this->_originCollection->getOriginByPostcode($quoteShippingAddress->getPostcode());\n $this->_shipment->setData('order_id', $order->getId());\n $this->_shipment->setData('order_increment_id', $order->getIncrementId());\n $this->_shipment->setData('origin_id', $origin->getId());\n\n $orderSkus = $this->_helper->getOrderSkus($order);\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::PENDING;\n\n $exclusiveOD = $this->_helper->orderContainsExclusively($order, \"OD\");\n foreach ($orderSkus as $sku => $details) {\n if ($details['stock_availability_code'] == \"OD\") {\n $hasStock = $origin->hasStock(array($sku => $details['qty']));\n if ($hasStock) {\n $deprecateSkus[$sku] = $details['qty'];\n } elseif ($exclusiveOD) {\n $shipmentStatus = \\Temando\\Temando\\Model\\System\\Config\\Source\\Shipment\\Status::BACK_ORDER;\n }\n } else {\n $deprecateSkus[$sku] = $details['qty'];\n }\n }\n $this->_shipment->setData('status', $shipmentStatus);\n $this->_shipment->setData('destination_contact_name', $shippingAddress->getName());\n $this->_shipment->setData('destination_company_name', $shippingAddress->getCompany());\n $streetAddress = $shippingAddress->getStreetLine(1);\n if ($shippingAddress->getStreetLine(2)) {\n $streetAddress .= \", \" . $shippingAddress->getStreetLine(2);\n }\n $this->_shipment->setData('destination_street', $streetAddress);\n $this->_shipment->setData('destination_city', $shippingAddress->getCity());\n $this->_shipment->setData('destination_postcode', $shippingAddress->getPostcode());\n $this->_shipment->setData('destination_region', $shippingAddress->getRegion());\n $this->_shipment->setData('destination_country', $shippingAddress->getCountryId());\n $this->_shipment->setData('destination_phone', $shippingAddress->getTelephone());\n $this->_shipment->setData('destination_email', $order->getCustomerEmail());\n\n //set customer selected quote data\n $temandoQuoteData = explode('_', $shippingMethod);\n $temandoQuoteId = $temandoQuoteData[2];\n\n $quoteDescription = '-';\n switch ($temandoQuoteData[2]) {\n default:\n $temandoQuote = $this->_quote->load($temandoQuoteId);\n $carrier = $this->_helper->getCarrierByTemandoId($temandoQuote->getCarrierId());\n $quoteDescription = $carrier->getCompanyName() . ' - ' . $temandoQuote->getDeliveryMethod();\n $totalPrice = $temandoQuote->getTotalPrice();\n break;\n }\n\n $this->_shipment->setData('customer_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('customer_selected_options', $shippingMethod);\n $this->_shipment->setData('customer_selected_quote_description', $quoteDescription);\n $this->_shipment->setData('admin_selected_quote_id', $temandoQuoteId);\n $this->_shipment->setData('anticipated_cost', $totalPrice);\n\n if ($shippingAddress->getIsBusinessAddress()) {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::BUSINESS\n );\n } else {\n $this->_shipment->setData(\n 'destination_type',\n \\Temando\\Temando\\Model\\System\\Config\\Source\\Origin\\Type::RESIDENTIAL\n );\n }\n\n if ($shippingAddress->getAuthorityToLeave()) {\n $this->_shipment->setData('destination_authority_to_leave', 1);\n } else {\n $this->_shipment->setData('destination_authority_to_leave', 0);\n }\n\n try {\n $this->_shipment->save();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment') . ' ' . $e->getMessage());\n }\n //register the quotes with the shipment\n //$this->registerQuotes($order);\n try {\n $this->_shipment->saveAllItems();\n } catch (\\Exception $e) {\n $this->_logger->debug(__('Failed to save shipment items') . ' ' . $e->getMessage());\n }\n\n\n //how many boxes required?\n $this->saveBoxes($order);\n\n if ((count($deprecateSkus)) && ($origin->getErpId())) {\n $this->deprecateSkus($origin->getErpId(), $deprecateSkus);\n }\n //$this->_shipment->fetchQuotes();//or update existing quotes to use this shipment\n\n $this->clearSessionData();\n\n return $this->_shipment;\n }",
"function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function setShipping($ship_key)\n {\n return 4.50;\n }",
"public function store(Request $request){\n $verEnvio = \\DB::table('orders')->where('order_id', $request->id_recipies)->first();\n if($verEnvio->status == 1){\n $shipping = new Shipping();\n $shipping->id_user = $request->delivery;\n $shipping->id_recipie = $request->id_recipies;\n $shipping->recipient_name = \"\";\n $shipping->save();\n \\DB::Table('orders')->where('order_id', $request->id_recipies)->update([\n \"status\"=> 2\n ]);\n }\n return ['result' => 'success'];\n }",
"public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }",
"public function updateShippingAddress() {\n Log::debug(\"Entering updateShipping\");\n DB::transaction(function () {\n $order = $this->getOrderData();\n if (isset($order)) {\n // If set shipping addres same as billing\n if (isset($_POST['useBillingAddress'])) {\n $useBilling = $_POST['useBillingAddress'];\n if ($useBilling == \"1\") {\n $order->shipping_address = $order->billing_address;\n }\n // Not using billing address\n } else {\n // update the existing billing adress or create a new one\n $address = $order->shippingAddress;\n // if no existing address or changing from billing address\n if (!isset($address) || $order->billing_address == $order->shipping_address)\n $address = new Address();\n\n $address = $this->fillOrderAddress($address);\n $address->save();\n $order->shipping_address = $address->id;\n }\n $order->save();\n }\n });\n }",
"function wdm_add_shipping_method_to_order_email( $order, $is_admin_email ) {\r\n\t\tglobal $wpdb;\r\n\t\t$wpdb->show_errors();\r\n\t\t$table_name = $wpdb->prefix.FOXPOST_TABLE_NAME;\r\n\t\t$fp_datas = $wpdb->get_results(\"SELECT id, terminal_id, status FROM \".$table_name.\" WHERE order_id='\".$order->id.\"'\");\r\n\t\t$apt_id = $fp_datas[0]->terminal_id;\r\n\r\n\t\t$apts = getTerminals();\r\n\t\t$apt_str = 'Ismeretlen';\r\n\t\tforeach($apts as $apt){\r\n\t\t\tif($apt_id == $apt['fp_place_id']){\r\n\t\t\t\t$apt_str = $apt['fp_name'];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo '<p><h4>Választott terminál: <u> ' . $apt_str . '</h4></u></p>';\r\n\t}",
"public function isShipped($id){\n $q = $this->slcOrdrFild(\"shipped\", $id);\n return $this->check($q, \"yes\");\n }",
"public function estimated_shipping() {\n\n\t\t$this->api_record_event( $this->event_name['estimated_shipping'] );\n\t}",
"public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n if (\"0\" == $this->scopeConfig->getValue('pickrr_magento2/general/automatic_shipment_enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE))\n return NULL;\n\n $order = $observer->getEvent()->getOrder();\n $payment = $order->getPayment();\n\n if($payment->getMethod() == \"cashondelivery\")\n $cod_amount = $order->getGrandTotal();\n else\n $cod_amount = 0.0;\n\n if ($order->getState() != Order::STATE_NEW && $order->getState() != Order::STATE_PENDING_PAYMENT )\n return NULL;\n\n $auth_token = $this->scopeConfig->getValue('pickrr_magento2/general/auth_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $pickup_time = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/pickup_time', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_name = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_name', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_phone_number = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_phone_number', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_pincode = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_pincode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_address = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_address', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $this->helper->createOrderShipment($auth_token, $order, $from_name, $from_phone_number, $from_pincode, $from_address, $pickup_time, $cod_amount);\n }",
"public function saveOrderShipment() {\n\t\t$this->layout = 'ajax';\n $order_id = $this->Shipment->saveOrderShipment($this->request->data);\n\t\tif($order_id) {\n $data = $this->Shipment->Order->find('first', array(\n 'conditions' => array(\n 'Order.id' => $order_id\n )\n ));\n } else {\n $this->set('json', FALSE);\n $this->render('/Common/echo_json');\n }\n $this->set('data', $data);\n $this->render('ship_cell');\n\t}",
"public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }",
"public function testUpdateExternalShipment()\n {\n }",
"public function postOrderDelivery(OrderDeliveryRequest $request){\n $data = [\n 'ongkir_real'=>$request->input('ongkir_real'),\n 'kurir'=>$request->input('kurir'),\n 'no_resi'=>$request->input('no_resi'),\n 'delivery_date'=>xformatDate($request->input('delivery_date')),\n 'status'=>'on delivery',\n 'modified_by'=>Auth::user()->username\n ];\n $order = Order::where('id',Input::get('order_id'))->update($data);\n //ipansuryadiflash()->success('Success', 'Order delivery success...');\n return redirect()->route('admin.pages.order');\n }",
"public function onCheckoutCartEstimatePost($observer)\n {\n $quote = Mage::helper('shipperhq_shipper')->getQuote();\n $quote->setIsMultiShipping(false);\n $shipping = $quote->getShippingAddress();\n $shipping->setIsCheckout(0);\n $shipping->save();\n }",
"public function salesOrderShipmentSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n \n if (!$settings['shipment_notification_message']) {\n return;\n }\n $order = $observer->getEvent()->getShipment()->getOrder();\n \n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_id = $order->getIncrementId();\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n $shipment = $order->getShipmentsCollection()->getFirstItem();\n $shipId = $shipment->getIncrementId();\n\n // Check if a telephone number has been specified\n if(in_array('shippment', $final_array)){\n if ($telephoneNumber) {\n // Send the shipment notification to the specified telephone number\n $text = $settings['shipment_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{shipmentno}}', $shipId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n // Display a success or error message\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The shipment notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the shipment notification SMS.');\n }\n }\n } \n}",
"public function isAutoShipping(): bool;",
"function ShipToAddress()\r\n\t{\r\n\t\r\n\t}",
"public function ship($parcel)\n {\n return TRUE;\n }",
"function plgVmConfirmedOrder (VirtueMartCart $cart, $order) {\n\n\t\tif (!($method = $this->getVmPluginMethod ($order['details']['BT']->virtuemart_shipmentmethod_id))) {\n\t\t\treturn NULL; // Another method was selected, do nothing\n\t\t}\n\t\tif (!$this->selectedThisElement ($method->shipment_element)) {\n\t\t\treturn FALSE;\n\t\t}\n\t\t$values['virtuemart_order_id'] = $order['details']['BT']->virtuemart_order_id;\n\t\t$values['order_number'] = $order['details']['BT']->order_number;\n\t\t$values['virtuemart_shipmentmethod_id'] = $order['details']['BT']->virtuemart_shipmentmethod_id;\n\t\t$values['shipment_name'] = $this->renderPluginName ($method);\n\t\t$values['order_weight'] = $this->getOrderWeight ($cart, $method->weight_unit);\n\t\t$values['shipment_weight_unit'] = $method->weight_unit;\n\n\t\t$costs = $this->getCosts($cart,$method,$cart->cartPrices);\n\t\tif(empty($costs)){\n\t\t\t$values['shipment_cost'] = 0;\n\t\t\t$values['shipment_package_fee'] = 0;\n\t\t} else {\n\t\t\t$values['shipment_cost'] = $method->shipment_cost;\n\t\t\t$values['shipment_package_fee'] = $method->package_fee;\n\t\t}\n\n\t\t$values['tax_id'] = $method->tax_id;\n\t\t$this->storePSPluginInternalData ($values);\n\n\t\treturn TRUE;\n\t}",
"function storefront_free_shipping()\n {\n ?>\n <span class=\"free-shipping\">Free shipping worldwide</span>\n <?php\n }",
"public function setShippingAmount($amount);",
"public function place()\n {\n $this->_eventManager->dispatch('sales_order_payment_place_start', ['payment' => $this]);\n $order = $this->getOrder();\n\n $this->setAmountOrdered($order->getTotalDue());\n $this->setBaseAmountOrdered($order->getBaseTotalDue());\n $this->setShippingAmount($order->getShippingAmount());\n $this->setBaseShippingAmount($order->getBaseShippingAmount());\n\n $methodInstance = $this->getMethodInstance();\n $methodInstance->setStore($order->getStoreId());\n\n $orderState = Order::STATE_NEW;\n $orderStatus = $methodInstance->getConfigData('order_status');\n $isCustomerNotified = $order->getCustomerNoteNotify();\n\n // Do order payment validation on payment method level\n $methodInstance->validate();\n $action = $methodInstance->getConfigPaymentAction();\n $payment = $order->getPayment();\n $paymentMethodCode = $payment->getMethodInstance()->getCode();\n \n if ($action) {\n if ($methodInstance->isInitializeNeeded()) {\n $stateObject = new DataObject();\n // For method initialization we have to use original config value for payment action\n $methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);\n\n if ($paymentMethodCode !== Bitcoin::CODE) {\n $orderState = $stateObject->getData('state') ?: $orderState;\n $orderStatus = $stateObject->getData('status') ?: $orderStatus;\n }\n\n $isCustomerNotified = $stateObject->hasData('is_notified')\n ? $stateObject->getData('is_notified')\n : $isCustomerNotified;\n }\n else {\n $this->processAction($action, $order);\n\n if ($paymentMethodCode !== Bitcoin::CODE){\n $orderState = Order::STATE_PROCESSING;\n $orderState = $order->getState() ? $order->getState() : $orderState;\n $orderStatus = $order->getStatus() ? $order->getStatus() : $orderStatus;\n }\n \n }\n } else {\n $order->setState($orderState)->setStatus($orderStatus);\n }\n\n $isCustomerNotified = $isCustomerNotified ?: $order->getCustomerNoteNotify();\n\n if (!array_key_exists($orderStatus, $order->getConfig()->getStateStatuses($orderState))) {\n $orderStatus = $order->getConfig()->getStateDefaultStatus($orderState);\n }\n\n $this->updateOrder($order, $orderState, $orderStatus, $isCustomerNotified);\n\n $this->_eventManager->dispatch('sales_order_payment_place_end', ['payment' => $this]);\n\n return $this;\n }",
"public function setQuantityShippedAttribute($input)\n {\n $this->attributes['quantity_shipped'] = $input ? $input : null;\n }",
"function show_estimated_ship_date_under_view_order_for_subscriptions( $order_id ) {\n $order = wc_get_order( $order_id );\n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"protected function setShipment(array $value)\n {\n $this->shipment = $value;\n }",
"public function adminSalesOrderCreateProcessDataBefore($observer)\n {\n if(Mage::getStoreConfig('carriers/shipper/active')) {\n $post = $observer->getRequestModel()->getPost();\n if(isset($post['order'])) {\n $data = $post['order'];\n\n $found = false;\n $customCarrierGroupData = array();\n $carriergroupId = isset($data['carriergroup_id']) ? $data['carriergroup_id'] : '';\n if (isset($data['shipping_amount'])) {\n $customCarrierGroupData[$carriergroupId] = array('customPrice' => $data['shipping_amount'], 'carriergroup' => $carriergroupId);\n $found = true;\n }\n\n if (isset($data['shipping_description'])) {\n if(array_key_exists($carriergroupId, $customCarrierGroupData)) {\n $shipArray = $customCarrierGroupData[$carriergroupId];\n $shipArray['customCarrier'] = $data['shipping_description'];\n $customCarrierGroupData[$carriergroupId] = $shipArray;\n }\n else {\n $customCarrierGroupData[$carriergroupId] = array('customCarrier' => $data['shipping_description'], 'carriergroup' => $carriergroupId);\n }\n $found = true;\n }\n\n if ($found) {\n $shippingAddress = $observer->getSession()->getQuote()->getShippingAddress();\n Mage::helper('shipperhq_shipper')->cleanDownRatesCollection($shippingAddress, 'shipperadmin', '');\n Mage::register('shqadminship_data', new Varien_Object($customCarrierGroupData));\n $storedLimitCarrier = $shippingAddress->getLimitCarrier();\n $shippingAddress->setLimitCarrier('shipperadmin');\n $rateFound = $shippingAddress->requestShippingRates();\n $shippingAddress->setLimitCarrier($storedLimitCarrier);\n } else {\n Mage::unregister('shqadminship_data');\n }\n }\n }\n }",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"private function shipping_batch()\n\t{\n\t\t// load the sync db\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t// find the most recent unprocessed shipments\n\t\t$query = ee()->sync_db->where('processed !=', '1')->order_by('id', 'asc')->get('orders_shipping', 200);\n\n\t\t// create arrays for shipment ids and tracking numbers\n\t\t$ids_processed = array();\n\n\t\t// find our shipped status\n\t\t$status = Store\\Model\\Status::where('name', 'Shipped')->first();\n\n\t\t// load the order_map config file\n\t\tinclude_once dirname(dirname(__FILE__)).'/bmi_custom/config/order_map.php';\n\n\t\t// loop through each shipment\n\t\tforeach($query->result() as $shipment)\n\t\t{\n\t\t\t// add id to the processed array\n\t\t\t$ids_processed[] = $shipment->id;\n\n\t\t\tif(!empty($shipping_carriers[$shipment->carrier]))\n\t\t\t{\n\t\t\t\t$tracking = $shipping_carriers[$shipment->carrier] .'|'. $shipment->tracking_number;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tracking = $shipment->tracking_number;\n\t\t\t}\t\n\n\t\t\t// update the status of each order with the tracking numbers\n\t\t\t$order_object = Store\\Model\\Order::find($shipment->order_id);\n\t\t\t$order_object->updateStatus($status, 0, $tracking);\n\n\t\t}\n\n\t\t// update the shipment records to indicate they've been processed\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('orders_shipping');\n\t\t}\t\n\t\t\n\t\t\n\t}",
"public function saveAction()\n {\n $data = $this->getRequest()->getPost('shipment');\n if (!empty($data['comment_text'])) {\n Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);\n }\n\n try {\n $shipment = $this->_initShipment();\n\n if (!$shipment) {\n $this->_forward('noRoute');\n return;\n }\n\n $shipment->register();\n $comment = '';\n if (!empty($data['comment_text'])) {\n $shipment->addComment(\n $data['comment_text'],\n isset($data['comment_customer_notify']),\n isset($data['is_visible_on_front'])\n );\n if (isset($data['comment_customer_notify'])) {\n $comment = $data['comment_text'];\n }\n }\n\n if (!empty($data['send_email'])) {\n $shipment->setEmailSent(true);\n }\n\n $shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));\n $responseAjax = new Varien_Object();\n $isNeedCreateLabel = isset($data['create_shipping_label']) && $data['create_shipping_label'];\n\n if ($isNeedCreateLabel && $this->_createShippingLabel($shipment)) {\n $responseAjax->setOk(true);\n }\n\n $this->_saveNewPostWaybill($shipment);\n\n $this->_saveShipment($shipment);\n\n $shipment->sendEmail(!empty($data['send_email']), $comment);\n\n $shipmentCreatedMessage = $this->__('The shipment has been created.');\n $labelCreatedMessage = $this->__('The shipping label has been created.');\n\n $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage\n : $shipmentCreatedMessage);\n Mage::getSingleton('adminhtml/session')->getCommentText(true);\n\n } catch (Mage_Core_Exception $e) {\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage($e->getMessage());\n } else {\n $this->_getSession()->addError($e->getMessage());\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n } catch (Exception $e) {\n Mage::logException($e);\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage(\n Mage::helper('sales')->__('An error occurred while creating shipping label.'));\n } else {\n $this->_getSession()->addError($this->__('Cannot save shipment.'));\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n\n }\n if ($isNeedCreateLabel) {\n $this->getResponse()->setBody($responseAjax->toJson());\n } else {\n $this->_redirect('*/sales_order/view', array('order_id' => $shipment->getOrderId()));\n }\n }",
"public function setShippingCost($shippingCost);",
"function quote($method = '') {\r\n\r\n\t\tglobal $order, $shipping_weight, $shipping_num_boxes, $transittime, $dispinsure, $packing;\r\n\r\n\t\tif ($this->dimensions_support > 0 && is_object($packing)) {\r\n\r\n\t\t\tif ($this->dimensions_support == 1) { // # only ready to ship items are set with dimensions\r\n\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\tif ($boxesToShip[$i]['item_length'] == 0) { // size wasn't set\r\n\t\t\t\t\t\tif ($boxesToShip[$i]['item_weight'] > 60) { // use module estimated dimesions when size not set\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 50) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 40) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 30) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 20) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 10) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t\t\t\t} elseif ($boxesToShip[$i]['item_weight'] > 5) {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_length'] = $length;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_width'] = $width;\r\n\t\t\t\t\t\t$boxesToShip[$i]['item_height'] = $height;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$numBoxes = $packing->getNumberOfBoxes();\r\n\r\n\t\t\tif (SHIPPING_UNIT_LENGTH == 'CM') { // must convert centimeters to inches before getting quote\r\n\t\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t\t$boxesToShip[$i]['item_length'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_width'] *= 0.39370079;\r\n\t\t\t\t\t$boxesToShip[$i]['item_height'] *= 0.39370079;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // # The old method. tell us how many boxes plus the box weight\r\n\r\n\t\t\tif ($shipping_weight > 60) { // these are defined in inches and don't need converting\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER60);\r\n\t\t\t} elseif ($shipping_weight > 50) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER50);\r\n\t\t\t} elseif ($shipping_weight > 40) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER40);\r\n\t\t\t} elseif ($shipping_weight > 30) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER30);\r\n\t\t\t} elseif ($shipping_weight > 20) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER20);\r\n\t\t\t} elseif ($shipping_weight > 10) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER10);\r\n\t\t\t} elseif ($shipping_weight > 5) {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_OVER5);\r\n\t\t\t} else {\r\n\t\t\t\tlist($length, $width, $height) = explode(', ', MODULE_SHIPPING_USPS_PKG_SIZE_LESS5);\r\n\t\t\t}\r\n\r\n\t\t\t$package = array('item_weight' => $shipping_weight,\r\n\t\t\t\t'item_price' => round($order->info['subtotal'] / $shipping_num_boxes, 2),\r\n\t\t\t\t'item_length' => $length,\r\n\t\t\t\t'item_width' => $width,\r\n\t\t\t\t'item_height' => $height);\r\n\r\n\t\t\t$boxesToShip = array();\r\n\r\n\t\t\tfor ($i = 0; $i < $shipping_num_boxes; $i++) {\r\n\t\t\t\t$boxesToShip[] = $package;\r\n\t\t\t}\r\n\r\n\t\t\t$totalWeight = round($shipping_weight * $shipping_num_boxes, 2);\r\n\t\t\t$numBoxes = $shipping_num_boxes;\r\n\t\t}\r\n\t\tif (SHIPPING_UNIT_WEIGHT == 'KGS') { // # must convert kilograms to pounds before getting quote\r\n\t\t\tfor ($i = 0; $i < sizeof($boxesToShip); $i++) {\r\n\t\t\t\t$boxesToShip[$i]['item_weight'] *= 2.2046226;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($this->display_weight) {\r\n\t\t\t$shiptitle = sprintf(MODULE_SHIPPING_USPS_TEXT_WEIGHT_DISPLAY, $numBoxes, $totalWeight);\r\n\t\t} else {\r\n\t\t\t$shiptitle = '';\r\n\t\t}\r\n\t\t$this->dest_zip = str_replace(' ', '', $order->delivery['postcode']);\r\n\t\tif ($order->delivery['country']['id'] == SHIPPING_ORIGIN_COUNTRY) { // domestic quote\r\n\t\t\t$this->dest_zip = substr($this->dest_zip, 0, 5);\r\n\t\t\t$dmstcquotes = array();\r\n\t\t\tif( $this->display_transit ){\r\n\t\t\t\t$trnstime = $this->_getDmstcTransitTimes();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$error = false;\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getDmstcQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($dmstcquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailavail'] = ($dmstcquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineavail'] = ($dmstcquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$dmstcquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($dmstcquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif( (MODULE_SHIPPING_USPS_DMSTC_RATE == 'Internet') && $quote['onlineavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['onlineconf'])) $title .= '<br />---' . $quote['onlineconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t} elseif( $quote['retailavail'] ){\r\n\t\t\t\t\t\t$title = $quote['name']; //$this->types[$quote['id']];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_confirmation && tep_not_null($quote['retailconf'])) $title .= '<br />---' . $quote['retailconf'];\r\n\t\t\t\t\t\tif ($this->display_transit && ($trnstime !== false)) {\r\n\t\t\t\t\t\t\t$time = '';\r\n\t\t\t\t\t\t\tif ((strpos($quote['id'], 'First') !== false) || (strpos($quote['id'], 'Priority') !== false)) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['priority'];\r\n\t\t\t\t\t\t\t} elseif (strpos($quote['id'], 'Express') !== false) {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['express'];\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$time = $trnstime['parcel'];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( $time != '' ){\r\n\t\t\t\t\t\t\t\t$title .= '<br />' . $time;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->dmstc_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->dmstc_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array(\r\n\t\t\t\t\t\t\t'id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $dmstcquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif( sizeof($this->dmstc_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'Domestic',\r\n\t\t\t\t\t'changes' => $this->dmstc_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t} else { // # international quote\r\n\t\t\t$maxinsurance_query = tep_db_query(\"SELECT DISTINCT(max_insurance) FROM USPS_intl_maxins WHERE insurable AND country_code = '\" . tep_db_input($order->delivery['country']['iso_code_2']) . \"' ORDER BY max_insurance\");\r\n\t\t\t$this->intl_maxinsure = array();\r\n\r\n\t\t\twhile ($x = tep_db_fetch_array($maxinsurance_query)) {\r\n\t\t\t\t$this->intl_maxinsure[] = $x['max_insurance'];\r\n\t\t\t}\r\n\r\n\t\t\t$intlquotes = array();\r\n\t\t\tforeach ($boxesToShip as $package) {\r\n\t\t\t\t$pkgQuote = $this->_getIntlQuote($package, $method);\r\n\t\t\t\tif (isset($pkgQuote['error'])) {\r\n\t\t\t\t\t$uspsQuote = $pkgQuote;\r\n\t\t\t\t\t$error = true;\r\n\t\t\t\t\tbreak; // stop if an error is returned\r\n\t\t\t\t}\r\n\t\t\t\tforeach ($pkgQuote as $quote) { // combine quotes for package with the quotes for other packages\r\n\t\t\t\t\tif (isset($intlquotes[$quote['id']])) { // already set for this mail type?\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailavail'] = ($intlquotes[$quote['id']]['retailavail'] && $quote['retailavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineavail'] = ($intlquotes[$quote['id']]['onlineavail'] && $quote['onlineavail']);\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailrate'] += $quote['retailrate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlinerate'] += $quote['onlinerate'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['retailinsval'] += $quote['retailinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['onlineinsval'] += $quote['onlineinsval'];\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count']++;\r\n\t\t\t\t\t} else { // create combined quote since it didn't exist\r\n\t\t\t\t\t\t$intlquotes[$quote['id']] = $quote;\r\n\t\t\t\t\t\t$intlquotes[$quote['id']]['count'] = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!$error) {\r\n\t\t\t\t$methods = array();\r\n\t\t\t\t$transtypes = array();\r\n\t\t\t\tforeach ($intlquotes as $quote) {\r\n\t\t\t\t\tif ($quote['count'] != $numBoxes) continue; // skip methods that don't work for all packages\r\n\t\t\t\t\tif ((MODULE_SHIPPING_USPS_INTL_RATE == 'Internet') && $quote['onlineavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['onlineinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['onlineinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['onlinerate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t} elseif ($quote['retailavail']) {\r\n\t\t\t\t\t\t$title = $quote['name'];\r\n\t\t\t\t\t\tif ($this->display_insurance && ($quote['retailinsval'] > 0)) $title .= '<br />---' . MODULE_SHIPPING_USPS_TEXT_INSURED . '$' . (ceil($quote['retailinsval'] * 100) / 100);\r\n\t\t\t\t\t\tif ($this->display_transit && tep_not_null($quote['transtime'])) {\r\n\t\t\t\t\t\t\t$title .= '<br />' . MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $quote['transtime'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (MODULE_SHIPPING_USPS_HANDLING_TYPE == 'Per Shipment') {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + $this->intl_handling[$quote['id']];\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$cost = $quote['retailrate'] + ($this->intl_handling[$quote['id']] * $numBoxes);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$methods[] = array('id' => $quote['id'],\r\n\t\t\t\t\t\t\t'title' => $title,\r\n\t\t\t\t\t\t\t'cost' => $cost);\r\n\t\t\t\t\t}\r\n\t\t\t\t} // end foreach $intlquotes\r\n\t\t\t\tif (empty($methods)) { // no quotes valid for all packages\r\n\t\t\t\t\t$uspsQuote = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$uspsQuote = $methods;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if there's been a change detected, log it..\r\n\t\t\tif( sizeof($this->intl_type_change) > 0 ){\r\n\t\t\t\t$this->logTypeChange(array(\r\n\t\t\t\t\t'type' => 'International',\r\n\t\t\t\t\t'changes' => $this->intl_type_change,\r\n\t\t\t\t));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (is_array($uspsQuote)) {\r\n\t\t\tif (isset($uspsQuote['error'])) {\r\n\t\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'error' => $uspsQuote['error']);\r\n\t\t\t} else {\r\n\t\t\t\t$quotesort = array();\r\n\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t$quotesort[$method['id']] = $method['cost'];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif( $this->shipping_method_sort_direction == 'desc' ){\r\n\t\t\t\t\tarsort($quotesort); // sort methods by cost high to low\r\n\t\t\t\t} else {\r\n\t\t\t\t\tasort($quotesort);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$methods = array();\r\n\t\t\t\tforeach ($quotesort as $key => $cost) {\r\n\t\t\t\t\tforeach ($uspsQuote as $method) {\r\n\t\t\t\t\t\tif ($method['id'] == $key) $methods[] = $method;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$this->quotes = array('id' => $this->code,\r\n\t\t\t\t\t'module' => $this->title . $shiptitle,\r\n\t\t\t\t\t'methods' => $methods);\r\n\t\t\t\tif ($this->tax_class > 0) {\r\n\t\t\t\t\t$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else { // quotes was empty\r\n\t\t\t$this->quotes = array('module' => $this->title . $shiptitle,\r\n\t\t\t\t'error' => MODULE_SHIPPING_USPS_TEXT_ERROR);\r\n\t\t}\r\n\t\tif (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);\r\n\t\t\r\n// \t\tprint_r( $this->quotes );\r\n\t\t\r\n\t\treturn $this->quotes;\r\n\t}",
"public function setSameAsBillingShippingAddress()\n {\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->hover();\n $this->browser->find($this->accountInformationBlock)->hover();\n $this->_rootElement->find($this->sameAsBilling, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes');\n }",
"public function setShipping($shipping);",
"function coordinator_mark_as_paid() {\n $this->SearchPagination->setup();\n $this->layout = \"coordinator/index\";\n $deliveryDates = $this->Delivery->getDeliveryDatesList(true); \n $nextDelivery = $this->Delivery->findByNextDelivery(true); \n $this->set('nextDelivery', $nextDelivery);\n $condition = array();\n $condition += array('User.organization_id' => $this->currentUser['User']['organization_id']);\n if (!empty($this->params['url']['id'])) {\n $condition += array('Order.id' => $this->params['url']['id']);\n }\n if (!empty($this->params['url']['user_name'])) {\n $condition += $this->User->findByNameCondition($this->params['url']['user_name']);\n \n }\n if (!empty($this->params['url']['delivery_date'])) {\n if ($this->params['url']['delivery_date'] > 0) {\n $condition += array('Order.delivery_id' => $this->params['url']['delivery_date']);\n } \n } else {\n $condition += array('Order.delivery_id' => $nextDelivery['Delivery']['id']);\n }\n $this->paginate = array(\n 'conditions' => $condition, 'limit' => $this->Order->find('count', array('conditions' => $condition))\n );\n $this->set('delivery_dates', $deliveryDates);\n $this->set('orders', $this->paginate());\t \n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"public function setShipmentLabel(string $label = null): ShippableInterface;",
"public function createShipment() {\n\t\t// create a Shipment object\n\t\ttry {\n\t\t $this->Shipment = new Ship\\Shipment( $this->shipmentData ); \n\t\t}\n\t\t// catch any exceptions \n\t\tcatch(\\Exception $e) {\n\t\t exit( WC_Shipping_Labels_Error( $e->getMessage() ) ); \n\t\t}\n\t}",
"function add_shippify_order_action_button( $actions, $the_order ) {\n\n // esto me dio error en algunas ordenes... \n if (in_array(\"shippify\", get_post_meta( $the_order->id, '_shipping_method', true )) && (get_post_meta( $the_order->id, '_is_dispatched', true ) != 'yes') && !isset($_GET['post_status'])){ \n $actions['shippify_action'] = array(\n 'url' => wp_nonce_url( admin_url( 'edit.php?post_type=shop_order&myaction=woocommerce_shippify_dispatch&stablishedorder=' . $the_order->id ), 'woocommerce-shippify-dispatch'), \n 'name' => __( 'Dispatch', 'woocommerce-shippify' ),\n 'action' => \"view shippify\", // setting \"view\" for proper button CSS.\n );\n }\n return $actions;\n }",
"public function update(Request $request, $id)\n {\n //\n $order = Order::find($id);\n\n if($request->shipped){\n $order->shipped = true;\n }\n\n if($request->unshipped){\n $order->shipped = false;\n }\n\n $order->save();\n\n toastr()->success('Item updated successfully.!');\n return redirect()->route('admin.orders.index');\n\n }",
"public function setCashOnDelivery($value): void\n {\n $this->cash_on_delivery = $value;\n }",
"public function setShipAddress(?Address $address = null): Cart;",
"public function resolveShippingState(OrderInterface $order);",
"function useMemberShippingAddress($data, $form, $request) {\n\t\t$order = ShoppingCart::curr();\n\t\t$order->SeparateBillingAddress = false;\n\t\t$order->write();\n\t\t$this->saveDataToSession($data);\n\t\tController::curr()->redirectBack();\n\t}",
"public function notime_shipping_save_shipment_id($event) {\n\n if(!Mage::getStoreConfig('carriers/notime/active', Mage::app()->getStore()->getId())) return;\n\n $_quote = $event->getQuote();\n\n $request = Mage::app()->getRequest();\n $shipmentId = trim($request->getPost('notime_shipment_id'));\n\n if($shipmentId == '') { return; }\n\n try {\n\n $resource = Mage::getSingleton('core/resource');\n $writeConnection = $resource->getConnection('core_write');\n\n $writeConnection->delete(\n \"notime_shipping\",\n \"quote_id=\".$_quote->getId()\n );\n $writeConnection->insert(\n \"notime_shipping\",\n array(\"quote_id\" => $_quote->getId(),\"shipment_id\" => $shipmentId, \"status\" => 0)\n );\n\n } catch (Exception $e) {\n mage::log('Error when processing shipping method:'.$e->getMessage(), false, 'notime_shipping.log');\n }\n }",
"public function save_shipment()\n\n\t{\n\n\t\t$shipping_id=$this->input->post('shipping_id');\n\n\t\t$update_shipping_detail=$this->shipping->update_data_single_cond(array(\n\n\n\n\t\t\t'post_status'=>'draft',\n\n\t\t\t'status'=>'active'\n\n\t\t),$shipping_id,'id','shipping_details');\n\n\t\tif($this->session->userdata('cus_id'))\n\n\t\t{\n\n\t\t\tredirect(base_url().'shipping/dashboard');\n\n\t\t}\n\n\t\telse\n\n\t\t{\n\n\t\t\t$custid=$this->session->userdata('new_register_cus_id');\n\n\t\t\t$cust= $this->shipping->get_data_with_single_cond($custid,'shipping_customer','customer_id');\n\n\t\t\t$status=$cust[0]['status'];\n\n\t\t\tif($status==0)\n\n\t\t\t{\n\n\t\t\t\tredirect(base_url().'login?message=gdkfjhheruchHAJshdjs');\n\n\t\t\t}\n\n\n\n\t\t\telse\n\n\t\t\t{\n\n\t\t\t\t$this->session->set_userdata('cus_id', $custid);\n\n\t\t\t\tredirect(base_url().'shipping/dashboard');\n\n\t\t\t}\n\n\t\t}\n\n\t}",
"public function setShippingAddressAction()\n {\n $data = $this->Request()->getParams();\n //we need to set this because of a bug in the shopware models\n if (!isset($data['stateId'])) {\n $data['stateId'] = 0;\n }\n\n /** @var Shopware\\Models\\Customer\\Customer $customerModel */\n $customerModel = Shopware()->Models()->find('Shopware\\Models\\Customer\\Customer', $data['userId']);\n\n if ($shippingAddressModel = $customerModel->getShipping()) {\n $shippingAddressModel->fromArray($data);\n\n Shopware()->Models()->persist($shippingAddressModel);\n Shopware()->Models()->flush();\n\n $this->view->assign(['shippingAddressId' => $shippingAddressModel->getId()]);\n }\n }",
"public function calculateQtyToShip();",
"public function actionNovaPostaShipping()\n {\n echo 35.46;\n }",
"public function setAutoShipping(bool $auto): ShippableInterface;",
"public function postShipping(Request $request) {\n $cart = new Carts();\n $mycart = $cart->getCustomerCarts(Auth::guard('web')->user()->id);\n $name = $request->fname;\n $mycart->$name = $request->fvalue;\n $mycart->save();\n return response()->json([\n 'success' => '1',\n 'message' => 'Item save'\n ]);\n }",
"public function createShipment(LocalOrder $order)\n {\n // Initialize the order shipment object\n /** @var \\Magento\\Sales\\Model\\Order\\Shipment $shipment */\n $shipment = $this->convertOrder->toShipment($order);\n\n // Loop through order items\n foreach ($order->getAllItems() as $orderItem) {\n // Check if order item has qty to ship or is virtual\n if (!$orderItem->getQtyToShip() || $orderItem->getIsVirtual()) {\n continue;\n }\n // Read the item qty for shipping\n $qtyShipped = $orderItem->getQtyToShip();\n // Create shipment item with qty\n $shipmentItem = $this->convertOrder->itemToShipmentItem($orderItem);\n $shipmentItem->setQty($qtyShipped);\n\n // Add shipment item to shipment\n $shipment->addItem($shipmentItem);\n }\n\n // Register shipment\n $shipment->register();\n\n $shipment->getOrder()->setIsInProcess(true);\n\n try {\n // Save created shipment and order\n $shipment->save();\n $shipment->getOrder()->save();\n //send notification code\n $order->addStatusHistoryComment(\n __('The shipment has been create from' . ' Magento-Odoo Integration module')\n )\n ->save();\n } catch (\\Exception $e) {\n $this->logException($e);\n }\n return $shipment;\n }",
"public function calculate_shipping($package){\n \n $calc = $this->distance * $this->priceperkm;\n $cost = round( $calc, 2 );\n \n if($cost < $this->minimumprice) {\n $cost = $this->minimumprice;\n }\n \n// Calculating the % of the unloading variable\n global $woocommerce;\n $cartsubtotal = $woocommerce->cart->cart_contents_total;\n $unloadingtotal = ( $this->unloadingprice / 100 ) * $cartsubtotal;\n \n $cost2 = $cost + $unloadingtotal;\n \n \n \n// Sending the final rate to the user \n $this->add_rate( \n array(\n 'id' => $this->id,\n 'label' => $this->title,\n 'cost' => $cost\n )\n );\n \n $this->add_rate(\n array(\n 'id' => $this->id2,\n 'label' => $this->title2,\n 'cost' => $cost2\n ) \n );\n }",
"public function processAfterShipment(Varien_Event_Observer $observer)\n {\n $event = $observer->getEvent();\n $shipment = $event->getShipment();\n $order = $shipment->getOrder();\n $payment = $order->getPayment();\n $paymentInstance = $payment->getMethodInstance();\n\n // for Postpayment make an invoice\n if($paymentInstance->getCode() == 'capayable_postpayment') {\n\n // Return if there are still items to be shipped\n foreach ($order->getAllItems() as $item) {\n if ($item->getQtyToShip() > 0 && !$item->getLockedDoShip()) {\n return false;\n }\n }\n $this->sendInvoice($order);\n }\n }",
"public function savePostAction() {\n $isNeedCreateLabel = '';\n try {\n $updateOrderId = $this->getRequest ()->getParam ( 'order_id' );\n /**\n * Get marketplace commission details\n */\n $collection = Mage::getModel ( 'marketplace/commission' )->getCollection ()->addFieldToFilter ( 'seller_id', Mage::getSingleton ( 'customer/session' )->getId () )->addFieldToFilter ( 'order_id', $updateOrderId )->getFirstItem ();\n /**\n * Checking manage order enable for seller\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Checking for seller order management enable or not\n */\n if (count ( $collection ) <= 0 || $orderStatusFlag != 1) {\n $this->_getSession ()->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n return;\n }\n /**\n * Get shipment info\n */\n $data = $this->getRequest ()->getParam ( 'shipment' );\n $shipment = $this->_initShipment ();\n if (! $shipment) {\n $this->_forward ( 'noRoute' );\n return;\n }\n /**\n * Register shipment\n */\n $shipment->register ();\n $comment = '';\n if (! empty ( $data ['comment_text'] )) {\n $shipment->addComment ( $data ['comment_text'], isset ( $data ['comment_customer_notify'] ), isset ( $data ['is_visible_on_front'] ) );\n if (isset ( $data ['comment_customer_notify'] )) {\n $comment = $data ['comment_text'];\n }\n }\n $shipment->setEmailSent ( true );\n /**\n * Set customer notify.\n */\n $shipment->getOrder ()->setCustomerNoteNotify ( true );\n $responseAjax = new Varien_Object ();\n $isNeedCreateLabel = isset ( $data ['create_shipping_label'] ) && $data ['create_shipping_label'];\n if ($isNeedCreateLabel && $this->_createShippingLabel ( $shipment )) {\n $responseAjax->setOk ( true );\n }\n /**\n * Save shipment\n */\n $this->_saveShipment ( $shipment );\n\n /**\n * Send shipment email\n */\n $shipment->sendEmail ( true, $comment );\n /**\n * Initilize shipment label\n */\n $shipmentCreatedMessage = $this->__ ( 'The shipment has been created.' );\n $labelCreatedMessage = $this->__ ( 'The shipping label has been created.' );\n $savedQtys = $this->_getItemQtys ();\n Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $savedQtys, $updateOrderId, 0 );\n $this->_getSession ()->addSuccess ( $isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage : $shipmentCreatedMessage );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Thorugh the exception error message.\n */\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( $e->getMessage () );\n } else {\n /**\n * When error occured, redirect to the view order page.\n */\n $this->_getSession ()->addError ( $e->getMessage () );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n } catch ( Exception $e ) {\n Mage::logException ( $e );\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( /**\n * Through error when create shipping label.\n */\n Mage::helper ( 'sales' )->__ ( 'An error occurred while creating shipping label.' ) );\n } else {\n $this->_getSession ()->addError ( $this->__ ( 'Cannot save shipment.' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }\n if ($isNeedCreateLabel) {\n $this->getResponse ()->setBody ( $responseAjax->toJson () );\n } else {\n /**\n * Redirect to the view order page.\n */\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }",
"public function saveShippingAction()\n {\n if (!$this->_isActive()) {\n parent::saveShippingAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n if ($this->getRequest()->isPost()) {\n $data = $this->getRequest()->getPost('shipping', array());\n $customerAddressId = $this->getRequest()->getPost('shipping_address_id', false);\n $result = $this->getOnepage()->saveShipping($data, $customerAddressId);\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(\n Mage::helper('core')->jsonEncode($result)\n );\n }\n }",
"public function updateOrder() {\n\n echo \"ok\";\n }",
"public function index(Request $request, Order $order, ShippingAddress $ship)\n {\n $order->user_id = auth()->user()->id;\n $order->paymentMethod = $request->paymentMethod;\n $order->itemsPrice = $request->itemsPrice;\n $order->shippingPrice = $request->shippingPrice;\n $order->taxPrice = $request->taxPrice;\n $order->totalPrice = $request->totalPrice;\n $order->isPaid = $request->isPaid;\n $order->paidAt = $request->paidAt;\n $order->isDelivered = $request->isDelivered;\n $order->deliveredAt = $request->deliveredAt;\n $order->save();\n dd($order);\n }",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"public function setShippingServiceName($name){\n $this->shippingServiceName = (string) $name;\n }",
"private function updateBackorderShipment() {\n unset($this->newShipment['Shipment']['id']);\n $this->newShipment['Shipment']['order_id'] = $this->ofb['Backorder']['id'];\n $this->Shipment->save($this->newShipment, false);\n\n //update the $this->ofb array to reflect the new shipment\n $this->ofb['Backorder']['Shipment'][0] = $this->newShipment['Shipment'];\n $this->ofb['Backorder']['Shipment'][0]['id'] = $this->Shipment->id;\n $this->ofb['Backorder']['Shipment'][0]['order_id'] = $this->ofb['Backorder']['id'];\n }",
"public function store(Request $request)\n {\n //dd($request->all());\n\n $this->validate($request, [\n 'shipper_code' => ['required', 'string', 'max:50'],\n 'shipper_name' => ['max:500']\n ]);\n\n $shipping = new Shipping([\n 'shipper_code' => $request->get('shipper_code'),\n 'shipper_name' => $request->get('shipper_name'),\n 'contact' => $request->get('contact'),\n 'gst_id' => $request->get('gst_id'),\n 'address1' => $request->get('address1'),\n 'city' => $request->get('city'),\n 'state' => $request->get('state'),\n 'country' => $request->get('country'),\n 'postcode' => $request->get('postcode'),\n 'telephone' => $request->get('telephone'),\n 'mobile' => $request->get('mobile'),\n 'fax' => $request->get('fax'),\n 'email' => $request->get('email'),\n 'credit_limit' => $request->get('credit_limit'),\n 'term_day' => $request->get('term_day'),\n 'invoice_format' => $request->get('invoice_format'),\n 'deleted_by' => ''\n ]);\n\n $code = $request->get('shipper_code');\n $name = $request->get('shipper_name');\n\n $checkshippercode = Shipping::where('shipper_code','=',$code)->exists();\n $checkshippername = Shipping::where('shipper_name','=',$name)->exists();\n\n if($checkshippercode == 'true')\n {\n return back()->with('error', 'Shipper code already existed.');\n }\n elseif($checkshippername == 'true')\n {\n return back()->with('error', 'Shipper name already existed.');\n }\n else\n {\n $destination = Destination::distinct()\n ->where('deleted_by','=','')\n ->orderBy('destination_code')\n ->get(['destination_code']);\n\n foreach($destination as $row){\n $data2 = array(\n 'shipper_code' => $code,\n 'destination_code' => $row['destination_code'],\n 'created_by' => '',\n 'created_on' => now()\n );\n\n DB::table('charges')->insert($data2);\n }\n\n $account = new Account([\n 'shipper_code' => $request->get('shipper_code'),\n 'shipper_name' => $request->get('shipper_name'),\n 'details' => 'Account created',\n 'amount' => '0.00',\n 'acc_bal' => '0.00',\n 'update_time' => now()\n ]);\n\n $log = new Log([\n 'status' => ''.strtoupper(auth()->user()->username).' create shipper account ['.$request->get('shipper_name').'].'\n ]);\n $log->save();\n\n //return $destination;\n $account->save();\n $shipping->save();\n return redirect()->route('shipping.index')->with('success', 'Shipping Account added successfully.');\n }\n\n }",
"protected function _fcpoMarkOrderAsProblematic() {\n $this->_blOrderHasProblems = true;\n }",
"public function setShippingMethod(ShippingMethodInterface $shipping_method);",
"public function save_shippingAction() {\r\n\t\t$shipping_method = $this->getRequest()->getPost('shipping_method', '');\r\n\t\t$payment_method = $this->getRequest()->getPost('payment_method', false);\r\n\t\t$old_shipping_method = $this->getOnepage()->getQuote()->getShippingAddress()->getShippingMethod();\r\n\t\t$billing_data = $this->getRequest()->getPost('billing', false);\r\n\t\tif($billing_data['country_id']){\r\n\t\t\tMage::getModel('checkout/session')->getQuote()->getBillingAddress()->setData('country_id',$billing_data['country_id'])->save();\r\n\t\t}\r\n\t\t// if ($shipping_method && $shipping_method != '' && $shipping_method != $old_shipping_method) {\r\n\t\t\tMage::helper('onestepcheckout')->saveShippingMethod($shipping_method);\r\n\t\t\t$this->getOnepage()->saveShippingMethod($shipping_method);\r\n\t\t// }\r\n\t\t\r\n\t\t// if ($payment_method != '') {\r\n\t\t\ttry{\r\n\t\t\t\t$payment = $this->getRequest()->getPost('payment', array());\r\n\t\t\t\t$payment['method'] = $payment_method;\r\n\t\t\t\t$this->getOnepage()->savePayment($payment);\r\n\t\t\t\tMage::helper('onestepcheckout')->savePaymentMethod($payment);\r\n\t\t\t}\r\n\t\t\tcatch(Exception $e) {\r\n\t\t\t\t//\r\n\t\t\t}\r\n\t\t// }\r\n\t\t\r\n\t\t// $paymentHtml = $this->_getPaymentMethodsHtml();\r\n\t\t// $reviewHtml = $this->_getReviewTotalHtml();\r\n\t\t// $result = array('payment' => $paymentHtml, \r\n\t\t\t\t\t\t\t\t\t\t// 'review' => $reviewHtml);\r\n\t\t// $this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t\t$this->loadLayout(false);\r\n\t\t$this->renderLayout();\r\n\t}",
"public function setShippingRates(Order $draftOrder): bool;",
"public function editOrderShipment($order_id = null) {\n\t\t$this->Order = ClassRegistry::init('Order');\n\t\t$this->layout = 'ajax';\n if ($this->request->is('post') || $this->request->is('put')) {\n if ($this->Shipment->save($this->request->data)) {\n $this->Session->setFlash(__('The shipment has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The shipment could not be saved. Please, try again.'));\n }\n } else {\n $options = array('conditions' => array('Shipment.order_id' => $order_id));\n\t\t\t$this->request->data = $this->Shipment->find('first', $options);\n\t\t\tif($this->request->data == array()){\n\t\t\t\tthrow new NotFoundException('no shipment found');\n\t\t\t}\n $this->request->data = $this->Shipment->find('first', $options);\n\t\t\t$myAddresses = ($this->User->getSecureList($this->Auth->user('id'), 'myAddresses'));\n\t\t\t$connectedAddresses = ($this->User->getSecureList($this->Auth->user('id'), 'connectedAddresses'));\n\t\t\t$thirdParty = ($this->User->getSecureList($this->Auth->user('id'), 'thirdParty'));\n\t\t\t$pageHeading = $title_for_layout = 'Shipping Address Edit';\n\t\t\t$carrier = $this->Order->carrier;\n\t\t\t$UPS = $this->Order->method['UPS'];\n\t\t\t$FedEx = $this->Order->method['FedEx'];\n\t\t\t$Other = $this->Order->method['Other'];\n\t\t\t$method = array($this->Order->method[$this->request->data['Shipment']['carrier']]);\n\t\t\t$shipmentBillingOptions = $this->getShipmentBillingOptions();\n\n\t\t\t$this->setBasicAddressSelects();\n\t\t\t$this->set(compact(\n\t\t\t\t\t'myAddresses', \n\t\t\t\t\t'connectedAddresses', \n\t\t\t\t\t'pageHeading', \n\t\t\t\t\t'title_for_layout', \n\t\t\t\t\t'carrier', \n\t\t\t\t\t'method',\n\t\t\t\t\t'UPS',\n\t\t\t\t\t'FedEx',\n\t\t\t\t\t'Other',\n\t\t\t\t\t'shipmentBillingOptions',\n\t\t\t\t\t'thirdParty'));\n }\n }",
"public function execute(\n CartInterface $cart,\n AddressInterface $billingAddress,\n bool $useForShipping\n ): void {\n try {\n $this->billingAddressManagement->assign($cart->getId(), $billingAddress, $useForShipping);\n } catch (NoSuchEntityException $e) {\n throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e);\n } catch (LocalizedException $e) {\n throw new GraphQlInputException(__($e->getMessage()), $e);\n }\n }",
"public function get_drop_shipment_order($Dropshipping)\n {\n if (!empty($Dropshipping)) {\n\n foreach ($Dropshipping as $item_id => $value) {\n\n\n\n $item = $value['item'];\n\n $w = $item->get_width();\n\n $l = $item->get_length();\n\n $h = $item->get_height();\n\n $wt = $item->get_weight();\n\n $wtoz = $item->get_weight() * 16;\n\n $qty = $value['qty'];\n\n $parcel = null;\n\n for ($z = 0; $z < $qty; $z++) {\n\n $parcel = $this->create_parcel_from_array(\n array(\n 'width' => $w,\n 'length' => $l,\n 'height' => $h,\n 'weightoz' => $wtoz\n )\n );\n\n $drop_shipments[] = $parcel;\n\n $domestic = in_array($package['destination']['country'], $this->domestic) ? true : false;\n \n if ($domestic) {\n\n\n\n $requestdrop['Rate'] = $this->create_domestic_drop_rate($package, $value['vendor_name'], $value['vendor_address'], $value['vendor_city'], $value['vendor_st'], $value['vendor_zip'], $l, $w, $h, $wt, $wtoz);\n } else {\n\n\n\n $requestdrop['Rate'] = $this->create_non_domestic_drop_rate($package, $value['vendor_name'], $value['vendor_address'], $value['vendor_city'], $value['vendor_st'], $value['vendor_zip'], $l, $w, $h, $wt, $wtoz);\n }\n }\n }\n }\n }",
"public function ___orderSaved(PadOrder $order) {\n }",
"public function shipping_tab() {\n global $wpdb, $post;\n\n $vendor_id = $post->post_author;\n\n $shipping_zone = $wpdb->get_results(\n $wpdb->prepare(\n \"SELECT locations.zone_id, locations.seller_id, locations.location_type as vendor_location_type, locations.location_code as vendor_location_code, wc_zones.location_code, wc_zones.location_type FROM {$wpdb->prefix}dokan_shipping_zone_locations as locations INNER JOIN {$wpdb->prefix}woocommerce_shipping_zone_locations as wc_zones ON locations.zone_id = wc_zones.zone_id INNER JOIN {$wpdb->prefix}dokan_shipping_zone_methods as dokan_methods ON dokan_methods.zone_id = locations.zone_id AND dokan_methods.seller_id = locations.seller_id WHERE locations.seller_id =%d AND locations.location_type != 'postcode' ORDER BY wc_zones.zone_id ASC\", $vendor_id\n ), ARRAY_A\n );\n\n $_overwrite_shipping = get_post_meta( $post->ID, '_overwrite_shipping', true );\n $dps_processing = get_user_meta( $vendor_id, '_dps_pt', true );\n $from = get_user_meta( $vendor_id, '_dps_form_location', true );\n $dps_country_rates = get_user_meta( $vendor_id, '_dps_country_rates', true );\n $shipping_policy = get_user_meta( $vendor_id, '_dps_ship_policy', true );\n $refund_policy = get_user_meta( $vendor_id, '_dps_refund_policy', true );\n $product_processing_time = get_post_meta( $post->ID, '_dps_processing_time', true );\n $processing_time = $dps_processing;\n\n if ( 'yes' === $_overwrite_shipping ) {\n $processing_time = ( $product_processing_time ) ? $product_processing_time : $dps_processing;\n }\n\n $country_obj = new WC_Countries();\n $countries = $country_obj->countries;\n $states = $country_obj->states;\n\n $shipping_countries = '';\n $shipping_states = '';\n $location_code = '';\n $check_countries = array();\n $check_states = array();\n\n if ( $shipping_zone ) {\n foreach ( $shipping_zone as $zone ) {\n $location_code = $zone['vendor_location_code'];\n\n if ( $zone['vendor_location_type'] === 'state' ) {\n $location_codes = explode( ':', $location_code );\n $country_code = isset( $location_codes[0] ) ? $location_codes[0] : '';\n $state_code = isset( $location_codes[1] ) ? $location_codes[1] : '';\n\n if ( isset( $states[ $country_code ][ $state_code ] ) && isset( $countries[ $country_code ] ) && ! in_array( $states[ $country_code ][ $state_code ], $check_states, true ) ) {\n $get_state_name = $states[ $country_code ][ $state_code ];\n\n $check_states[ $get_state_name ] = $get_state_name;\n $shipping_states .= $get_state_name . ' (' . $countries[ $country_code ] . '), ';\n }\n }\n\n if ( $zone['vendor_location_type'] === 'country' && $countries[ $location_code ] && ! in_array( $countries[ $location_code ], $check_countries, true ) ) {\n $location_code = $countries[ $location_code ];\n $check_countries[ $location_code ] = $location_code;\n $shipping_countries .= $location_code . ', ';\n }\n }\n }\n ?>\n\n <?php if ( $shipping_countries ) { ?>\n <p>\n <?php esc_html_e( 'Shipping Countries', 'dokan' ); ?>:\n <strong><?php echo rtrim( $shipping_countries, ', ' ); ?></strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $shipping_states ) { ?>\n <p>\n <?php esc_html_e( 'Shipping States', 'dokan' ); ?>:\n <strong><?php echo rtrim( $shipping_states, ', ' ); ?></strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $processing_time ) { ?>\n <p>\n <strong>\n <?php esc_html_e( 'Ready to ship in', 'dokan' ); ?> <?php echo dokan_get_processing_time_value( $processing_time ); ?>\n\n <?php\n if ( $from ) {\n echo __( 'from', 'dokan' ) . ' ' . $countries[ $from ];\n }\n ?>\n </strong>\n </p>\n <hr>\n <?php } ?>\n\n <?php if ( $shipping_policy ) { ?>\n <p> </p>\n <strong><?php esc_html_e( 'Shipping Policy', 'dokan' ); ?></strong>\n <hr>\n <?php echo wpautop( $shipping_policy ); ?>\n <?php } ?>\n\n <?php if ( $refund_policy ) { ?>\n <hr>\n <p> </p>\n <strong><?php esc_html_e( 'Refund Policy', 'dokan' ); ?></strong>\n <hr>\n <?php echo wpautop( $refund_policy ); ?>\n <?php } ?>\n <?php\n }",
"public function __construct() {\r\n add_action( 'wp_ajax_wcfm_wcvendors_order_mark_shipped', array( &$this, 'wcfm_wcvendors_order_mark_shipped' ) );\r\n \r\n // WC Product Vendors Mark as Fulfilled\r\n add_action( 'wp_ajax_wcfm_wcpvendors_order_mark_fulfilled', array( &$this, 'wcfm_wcpvendors_order_mark_fulfilled' ) );\r\n \r\n // WC Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcmarketplace_order_mark_shipped' ) );\r\n \r\n // WCfM Marketplace Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_wcfmmarketplace_order_mark_shipped', array( &$this, 'wcfm_wcfmmarketplace_order_mark_shipped' ) );\r\n \r\n // Dokan Mark as Shipped\r\n add_action( 'wp_ajax_wcfm_dokan_order_mark_shipped', array( &$this, 'wcfm_dokan_order_mark_shipped' ) );\r\n \r\n // WCFM Mark as Received\r\n add_action( 'wp_ajax_wcfm_mark_as_recived', array( &$this, 'wcfm_mark_as_recived' ) );\r\n \r\n if( apply_filters( 'wcfm_is_allow_shipping_tracking', true ) ) {\r\n\t\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\t\tadd_filter( 'wcfm_orders_actions', array( &$this, 'wcfmu_shipping_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t} else {\r\n\t\t\t\tadd_filter( 'dokan_orders_actions', array( &$this, 'wcfmu_dokan_shipment_tracking_orders_actions' ), 20, 3 );\r\n\t\t\t\tadd_filter( 'wcmarketplace_orders_actions', array( &$this, 'wcfmu_wcmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcfmmarketplace_orders_actions', array( &$this, 'wcfmu_wcfmmarketplace_shipping_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcvendors_orders_actions', array( &$this, 'wcfmu_wcvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t\tadd_filter( 'wcpvendors_orders_actions', array( &$this, 'wcfmu_wcpvendors_shipment_tracking_orders_actions' ), 20, 4 );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Vendor Order Shippment Tracking\r\n\t\tadd_filter( 'woocommerce_order_item_display_meta_key', array( &$this, 'wcfm_tracking_url_display_label' ) );\r\n\t\tadd_action( 'woocommerce_order_item_meta_end', array( &$this, 'wcfm_order_tracking_response' ), 20, 3 );\r\n \r\n // Shipment Tracking message type\r\n\t\tadd_filter( 'wcfm_message_types', array( &$this, 'wcfm_shipment_tracking_message_types' ), 75 );\r\n\t\t\r\n\t}",
"function custom_template_single_shipping()\n {\n global $product;\n ?>\n <span class=\"shipping-cs-tag\">\n <span>Shipping:</span>\n <span>Free</span>\n </span>\n <?php\n }",
"function order_success()\n{\n\n}",
"public function setShippingMethod() {\n\t\t$json = array();\n\t\t$json['status'] = false;\n\t\t\n\t\tif (isset($this->request->post['code'])) {\n\t\t\t$code=$this->request->post['code'];\n\t\t\t$shipping_method=$this->session->data['shipping_methods'][$code]; \n\t\t\tif ($shipping_method) {\n\t\t\t\tunset($this->session->data['shipping_method']);\n\t\t\t\t$this->session->data['shipping_method'] = $shipping_method;\n\t\t\t\t\n\t\t\t\t$json['status'] = true;\n\t\t\t\t$json['delivery'] = $shipping_method['delivery'];\n\n\t\t\t} else {\n\t\t\t\t$json['error'] = 'Неизвестный способ доставки';\n\t\t\t}\n\t\t} else {\n\t\t\t$json['error'] = 'Не указан тип доставки';\n\t\t}\n\t\t$this->response->addHeader('Content-Type: application/json');\n\t\t$this->response->setOutput(json_encode($json));\n\t}",
"public function actionCreateshipment()\n\t{\n\t\tif($_POST && isset($_POST['id']))\n\t\t{\n\t\t\t$shop=isset($_POST['shopName'])?$_POST['shopName']:\"NA\";\n\t\t\t$path='shipment/'.$shop.'/'.Data::getKey($_POST['id']).'.log';\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create shipment data\n\t\t\t Data::createLog(\"order shipment in walmart\".PHP_EOL.json_encode($_POST),$path);\n\t\t\t\t$objController=Yii::$app->createController('walmart/walmartorderdetail');\n\t\t\t\t$objController[0]->actionCurlprocessfororder();\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tData::createLog(\"order shipment error \".json_decode($_POST),$path,'a',true);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tData::createLog(\"order shipment error wrong post\");\n\t\t}\n\t}",
"private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }",
"public function updateTransaction($tid, $args, $shippingConfirmed){}",
"function get_item_shipping() {\n\t}"
] | [
"0.7431695",
"0.74207926",
"0.7234685",
"0.70458853",
"0.6996642",
"0.69393206",
"0.6919671",
"0.6882646",
"0.6828139",
"0.68119454",
"0.6557791",
"0.64496154",
"0.6401753",
"0.6335188",
"0.6334433",
"0.6252315",
"0.6167029",
"0.611768",
"0.60541797",
"0.6018588",
"0.59834313",
"0.5952987",
"0.5949846",
"0.59187585",
"0.591746",
"0.5913608",
"0.5884216",
"0.5875998",
"0.5863245",
"0.5853549",
"0.5844409",
"0.57934403",
"0.5777586",
"0.5751352",
"0.57501745",
"0.5741067",
"0.5726435",
"0.57180727",
"0.5699893",
"0.5693269",
"0.56907004",
"0.5681661",
"0.56807846",
"0.566266",
"0.56494486",
"0.5643567",
"0.56341904",
"0.56174475",
"0.56162125",
"0.5606671",
"0.5602042",
"0.5583358",
"0.5576075",
"0.5573643",
"0.5568462",
"0.5568317",
"0.55621886",
"0.55572456",
"0.5550619",
"0.553005",
"0.55274045",
"0.5516226",
"0.5514484",
"0.55121166",
"0.55052435",
"0.54817855",
"0.5475588",
"0.5472522",
"0.54658896",
"0.5458985",
"0.5450533",
"0.5438312",
"0.54274064",
"0.5423956",
"0.5421714",
"0.5419863",
"0.5416453",
"0.54140717",
"0.5413085",
"0.54108644",
"0.53873914",
"0.53597844",
"0.5351715",
"0.53473717",
"0.534606",
"0.5340591",
"0.53330755",
"0.53230244",
"0.5316899",
"0.5316895",
"0.5309854",
"0.530786",
"0.53073776",
"0.529457",
"0.5293768",
"0.52917606",
"0.5291704",
"0.5287792",
"0.5285403",
"0.52844256"
] | 0.75513273 | 0 |
Mark Order item as Received | function wcfm_mark_as_recived() {
global $WCFM, $WCFMu, $woocommerce, $wpdb;
if ( !empty( $_POST['orderitemid'] ) ) {
$order_id = $_POST['orderid'];
$order = wc_get_order( $order_id );
$product_id = $_POST['productid'];
$order_item_id = $_POST['orderitemid'];
//$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');
// Keep Tracking URL as Order Item Meta
$sql = "INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta";
$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';
$sql .= ' VALUES ( %s, %s, %s )';
$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );
$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );
$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );
// WCfM Marketplace Table Update
if( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {
$wpdb->query("UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id");
}
// Notification
$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );
$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );
// Vendor Notification
if( $vendor_id ) {
$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );
}
// WC Order Note
$comment_id = $order->add_order_note( $wcfm_messages, '1');
do_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );
}
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }",
"function setReceived($received) \n {\n if ($received == true) \n\t { \n \t$this->setValueByFieldName('cashtransaction_recd','1');\n \t }\n \t else \n \t {\n\t \t$this->setValueByFieldName('cashtransaction_recd','0');\n \t } \n \t\t\t\n }",
"protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }",
"public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }",
"public function isRedelivered();",
"protected function setReceivedTransactionStatuses(): void\n {\n $txId = $this->postData['brq_transactions'];\n $statusCode = $this->postData['brq_statuscode'];\n\n if (empty($txId) || empty($statusCode)) {\n return;\n }\n\n $payment = $this->order->getPayment();\n\n $receivedTxStatuses = $payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS_STATUSES) ?? [];\n $receivedTxStatuses[$txId] = $statusCode;\n\n $payment->setAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS_STATUSES, $receivedTxStatuses);\n }",
"public function onSendMail(OrderItemStateEvent $event) {\n $line = $event->getOrderItem();\n if ($line->get('field_estado')->value == 'enviado') {\n $order = $line->getOrder();\n if ($this->checkOrderSent($order)) {\n $commerce_order = new OrderController($order);\n /** @var User $proveedor */\n $proveedor = User::load($this->account->id());\n $lines = $commerce_order->getOrderItemsProvider($proveedor);\n\n $mail = Mail::load(Mail::TYPE_SENT_ORDER_PROVIDER);\n if ($mail instanceof Mail) {\n $subject = $mail->getSubject();\n $body = $mail->getBody();\n\n if ($customer = $order->getCustomer()) {\n $langcode = $customer->getPreferredLangcode();\n }\n else {\n $langcode = $this->languageManager->getDefaultLanguage()->getId();\n }\n\n $to = $order->getEmail();\n\n $profiles = $order->collectProfiles();\n $envio = '';\n if (isset($profiles['shipping']) && $profiles['shipping'] instanceof Profile) {\n $envio = [\n '#theme' => 'correo_informacion_envio',\n '#profile' => $profiles['shipping'],\n ];\n $envio = \\Drupal::service('renderer')->render($envio);\n }\n\n $token_service = \\Drupal::token();\n $subject = $token_service->replace($subject, [\n 'commerce_order' => $order\n ]);\n $body = $token_service->replace($body, [\n 'commerce_order' => $order\n ]);\n $body = str_replace('[datos_envio]', $envio, $body);\n\n $resumen = [\n '#theme' => 'correo_resumen_pedido_proveedor',\n '#order_items' => $lines,\n ];\n $resumen = \\Drupal::service('renderer')->render($resumen);\n $body = str_replace('[resumen]', $resumen, $body);\n $params = [\n 'from' => $order->getStore()->getEmail(),\n 'subject' => $subject,\n 'body' => ['#markup' => Markup::create($body)],\n ];\n\n $this->mailManager->mail('commerce', 'receipt', $to, $langcode, $params);\n\n \\Drupal::logger('correo')->info('Pedido #' . $order->id() . ' enviado a ' . $to);\n\n }\n }\n $this->checkOrderCompleted($order);\n }\n }",
"public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }",
"function wcfm_order_tracking_response( $item_id, $item, $order ) {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\t\t\r\n\t\t// See if product needs shipping \r\n\t\t$product = $item->get_product(); \r\n\t\t$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product ); \r\n\t\t\r\n\t\tif( $WCFMu->is_marketplace ) {\r\n\t\t\tif( $WCFMu->is_marketplace == 'wcvendors' ) {\r\n\t\t\t\tif( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {\r\n\t\t\t\t\tif( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;\r\n\t\t\t\t}\r\n\t\t\t} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\tglobal $WCMp;\r\n\t\t\t\tif( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( $needs_shipping ) {\r\n\t\t\t$traking_added = false;\r\n\t\t\t$package_received = false;\r\n\t\t\tforeach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {\r\n\t\t\t\tif( $meta->key == 'wcfm_tracking_url' ) {\r\n\t\t\t\t\t$traking_added = true;\r\n\t\t\t\t}\r\n\t\t\t\tif( $meta->key == 'wcfm_mark_as_recived' ) {\r\n\t\t\t\t\t$package_received = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo \"<p>\";\r\n\t\t\tprintf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\tif( $package_received ) {\r\n\t\t\t\tprintf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t} elseif( $traking_added ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"#\" class=\"wcfm_mark_as_recived\" data-orderitemid=\"<?php echo $item_id; ?>\" data-orderid=\"<?php echo $order->get_id(); ?>\" data-productid=\"<?php echo $item->get_product_id(); ?>\"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>\r\n\t\t\t\t<?php\r\n\t\t\t} else {\r\n\t\t\t\tprintf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t}\r\n\t\t\techo \"</p>\";\r\n\t\t}\r\n\t}",
"public function markSentItems(array $orders) {\n $ordersTable = Intelivemetrics_Unityreports_Model_Utils::getTableName('unityreports/orders');\n $now = date('Y-m-d H:i:s');\n try {\n foreach ($orders as $order) {\n $query = \"INSERT INTO $ordersTable (increment_id,sents,last_sent_at) VALUES ('{$order['increment_id']}',1,'{$now}')\n ON DUPLICATE KEY UPDATE sents = sents+1,last_sent_at='{$now}';\";\n $this->_getDb()->query($query);\n }\n } catch (Exception $ex) {\n Mage::helper('unityreports')->debug($ex->getMessage());\n }\n }",
"public function setSent();",
"public function postMarkPaymentReceived(Request $request, $order_id)\n {\n $order = Order::scope()->findOrFail($order_id);\n\n $order->is_payment_received = 1;\n $order->order_status_id = 1;\n\n $order->save();\n\n session()->flash('message', trans(\"Controllers.order_payment_status_successfully_updated\"));\n\n return response()->json([\n 'status' => 'success',\n ]);\n }",
"public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }",
"public function salesOrderSaveAfter($observer)\n\t{\n\t\t// Get the settings\n\t\t$settings = Mage::helper('smsnotifications/data')->getSettings();\n\n\t\t// Get the new order object\n\t\t$order = $observer->getEvent()->getOrder();\n\n\t\t// Get the old order data\n\t\t$oldOrder = $order->getOrigData();\n\n\t\t// If the order status hasn't changed, don't do anything\n\t\tif($oldOrder['status'] === $order->getStatus()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the order status has changed, check if a notification should be sent\n\t\t// for the new status. If not, don't do anything\n\t\tif($order->getStatus() !== $settings['order_notification_status']) {\n\t\t\treturn;\n\t\t}\n\n\t\tMage::log('sending', null, 'm.txt');\n\n\t\t// Generate the body for the notification\n\t\t$store_name = Mage::app()->getStore()->getFrontendName();\n\t\t$customer_name = $order->getCustomerFirstname();\n\t\t$customer_name .= ' ' . $order->getCustomerLastname();\n\t\t$order_amount = $order->getBaseCurrencyCode();\n\t\t$order_amount .= ' ' . $order->getBaseGrandTotal();\n\n\t\t$body = sprintf('%s: %s has just placed an order for %s', $store_name, $customer_name, $order_amount);\n\n\t\t// If no recipients have been set, we can't do anything\n\t\tif(!count($settings['order_noficication_recipients'])) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the order notification by SMS\n\t\t$result = Mage::helper('smsnotifications/data')->sendSms($body, $settings['order_noficication_recipients']);\n\n\t\t// Check if the sending was successful\n\t\tif(!$result) {\n\t\t\t// If an error occured, notify the administrator\n\t\t\tMage::helper('smsnotifications/data')->sendAdminEmail(sprintf('%s was unable to send one or more order notifications to the specified number(s). Please check your configuration to make sure that your Twilio API settings are correct!', Mage::helper('smsnotifications/data')->app_name));\n\t\t}\n\t}",
"function deliverOrder($orderNum)\n\t\t{\n\t\t\t$db = dbConnect::getInstance();\n \t\t $mysqli = $db->getConnection();\n\t\t\t $query = \" update check_tb set status = '2' where id='\".$orderNum.\"' \"; \n $res=$mysqli->query($query) or die (mysqli_error($mysqli));\n $mysqli->query(\"CREATE EVENT updateStatus\".$orderNum.\" ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 MINUTE DO \n \tupdate check_tb set status = '1' where id='\".$orderNum.\"' ;\n \t\") or die (mysqli_error($mysqli));\n\t\t\tif($res)\n\t\t\t{\n\n\t\t\t\treturn true;\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\t\n\t\t\t}\n\t\t}",
"function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}",
"private function setOrderAsPending($order){\r\n $this->log('Setting as pending order #'.$order->get_order_number());\r\n //Since the default status of the order is pending, we only add a note here.\r\n $this->addOrderNote($order, 'La orden se encuentra pendiente.');\r\n }",
"public function setPendingReceived($value)\n {\n return $this->set(self::pending_received, $value);\n }",
"function hook_commerce_adyen_capture_received(\\Commerce\\Adyen\\Payment\\Transaction\\Payment $transaction, \\stdClass $order) {\n /* @var \\EntityDrupalWrapper $message */\n $message = entity_metadata_wrapper('message', message_create('commerce_adyen', [\n 'arguments' => [\n '@message' => t('Capture request for %order_number order has been received.', [\n '%order_number' => $order->order_number,\n ]),\n ],\n ]));\n\n $message->message_commerce_order = $order->order_id;\n $message->save();\n}",
"public function sendStatusUpdateNotifications(OrderEvent $event)\n {\n $order = $event->getOrder();\n switch ($order->getStatus()) {\n\n case Order::STATUS_AWAITING_SEPA:\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_AWAITING_SEPA,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_NEW:\n // get payment\n $payment = $order->getPayments()->first();\n\n // is transport\n $isTransport = true;\n if (Shipping::TYPE_NOT_SHIPPED === $order->getShippingType()) {\n $isTransport = false;\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'invoiceUrl' => $this->router->generate('order_invoice_download', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $payment->getChargeId(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'expectedDeliveryDate' => null !== $order->getExpectedDeliveryDate() ? $order->getExpectedDeliveryDate()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'shippingLimitDate' => null !== $order->getShouldBeReadyAt() ? $order->getShouldBeReadyAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') . ' avant 17h' : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_CANCELED:\n // order has been canceled by the customer\n if (OrderEvent::ORIGIN_CUSTOMER === $event->getOrigin()) {\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n case Order::STATUS_TRANSIT:\n\n // get shipment\n $shipments = $order->getShipments();\n /** @var Shipment $shipment */\n $shipment = $shipments[0];\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'trackingUrl' => $shipment->getTrackingUrl(),\n 'trackingNumber' => $shipment->getParcelNumber(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_SHIPPED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_READY_FOR_PICKUP:\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_READY_FOR_PICKUP,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_REFUNDED:\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // get order refund id\n $refundId = 'n/a';\n $refunds = $order->getRefunds();\n if (0 < count($refunds)) {\n /** @var Refund $refund */\n $refund = $refunds[0];\n $refundId = $refund->getRefundId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'refundId' => $refundId,\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_REFUNDED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_DELIVERED:\n\n // send customer e-mail\n /* There is no longer any immediate notification sending when the order is delivered. The notification is made on D + 1 via the reminder system\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n //'ratingUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL) . '#rating'\n 'ratingUrl' => $this->router->generate('order_rating', array('token' => $order->getToken()), $this->router::ABSOLUTE_URL) . '#rating'\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATING,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n */\n break;\n\n case Order::STATUS_CLOSED:\n\n if ($order->getRating()->getEnabled() == True ) {\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderRateValue' => $order->getRating()->getRate(),\n 'orderRateValue' => $order->getRating()->getComment(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATE,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n\n\n\n case Order::STATUS_FILE_AVAILABLE:\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_AVAILABLE_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_REJECTED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_REJECTED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_VALIDATED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'BoolTransport' => $order->getQuotation()->getProject()->getType()->isShipping(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_VALIDATED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n }\n }",
"public function cancel()\n {\n $this->canceled = true;\n\n $this->save();\n\n $this->user->notify(new OrderCanceled($this));\n\n }",
"public function amountRecived(Request $request) {\n $driver_orders = unserialize(base64_decode($request->orders));\n \n foreach ($driver_orders as $driver_order) {\n if ($driver_order->order->status == 'Delivered') {\n $order = Order::find($driver_order->order->id);\n $order->status = 'Amount received from driver';\n $order->save();\n }\n }\n \n $driver = Driver::where('id', $request->driver_id)->with('user')->first();\n \n return back()->with('success','Recived '.$request->amount.' from'.' '.$driver->user->name);\n }",
"protected static function on_change_order_state($order)\n {\n \n }",
"function setOrderCancelled($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}",
"function setOrderSend($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}",
"function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"final public function notifyOrderUpdated(): void\n {\n $this->dirtyIndex = true;\n }",
"function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}",
"function it_exchange_abandoned_carts_mark_email_clicked_through( $email_id, $cart_id ) {\n\t$cart_emails = get_post_meta( $cart_id, '_it_exchange_abandoned_cart_emails_sent', true );\n\n\t// Make sure this email hasn't already been credited for reengaging the custumer.\n\tforeach( (array) $cart_emails as $key => $email ) {\n\t\tif ( ! empty( $email['email_id'] ) && $email['email_id'] == $email_id && ! empty( $email['clickedthrough'] ) ) {\n\t\t\treturn;\n\t\t} else if ( ! empty( $email['email_id'] ) && $email['email_id'] == $email_id ) {\n\t\t\t$cart_emails[$key]['clickedthrough'] = time();\n\t\t\tupdate_post_meta( $cart_id, '_it_exchange_abandoned_cart_emails_sent', $cart_emails );\n\t\t}\n\t}\n\n\t// If we made it this far the abadoned cart's sent_email has been flagged as reengaged and we need to increment the clickthroughs for the email.\n\t$clickedthrough = (int) get_post_meta( $email_id, '_it_exchange_abandoned_cart_emails_clickedthrough', true );\n\tupdate_post_meta( $email_id, '_it_exchange_abandoned_cart_emails_clickedthrough', ( $clickedthrough + 1 ) );\n}",
"function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"function action_woocommerce_send_sms_order_pending($order_id) {\n // $log = new WC_Logger();\n // if(get_qt_options( 'enable_sms_completed_order' ) && get_qt_options( 'enable_sms_completed_order' ) == \"on\") {\n // $sms = new SMS_Sender();\n // $message = $sms->generateMessage( get_qt_options('sms_completed_order_pattern'), 'order', $order_id );\n // $response = $sms->sendSMS( $message );\n // $log->log( 'action_woocommerce_send_sms_order_pending', print_r( $response, true ) );\n // }\n}",
"protected function setReceivedPaymentFromBuckaroo()\n {\n if (empty($this->postData['brq_transactions'])) {\n return;\n }\n\n $payment = $this->order->getPayment();\n\n if (!$payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS)) {\n $payment->setAdditionalInformation(\n self::BUCKAROO_RECEIVED_TRANSACTIONS,\n [$this->postData['brq_transactions'] => floatval($this->postData['brq_amount'])]\n );\n } else {\n $buckarooTransactionKeysArray = $payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS);\n\n $buckarooTransactionKeysArray[$this->postData['brq_transactions']] =\n floatval($this->postData['brq_amount']);\n\n $payment->setAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS, $buckarooTransactionKeysArray);\n }\n }",
"private function sellTrasactionPendingAddsMoney(){\n\n }",
"public function setAsSent()\n {\n $this->sentAt = new \\DateTime();\n }",
"function action_woocommerce_send_sms_order_hold($order_id) {\n # code...\n}",
"public static function clientBidRequestadmindnotice(User $user,Order $order)\n {\n\n $notification = new Notification;\n $notification->user_id = $user->id;\n $notification->order_id = $order->order_id;\n $notification->type = 'writer_bid_request';\n $notification->message ='New Client Bid request on order '.$order->order_no;\n\n $notification->save();\n\n Mail::queue('emails.bid_request',['user'=>$user, 'order'=>$order], function($m)use ($user, $order)\n {\n $m->from('[email protected]', 'ARA');\n\n $m->to($user->email, $user->first_name)->subject('You have a new Bid request on Order '.$order->order_no);\n\n });\n }",
"public function notify()\n\t{\n\t\t// Check the sender is 2Checkout\n\t\t$key = Context::get('md5_hash');\n\n\t\t$sale_id = Context::get('sale_id');\n\t\t$vendor_id = $this->sid;\n\t\t$invoice_id = Context::get('invoice_id');\n\t\t$secret_word = $this->secret_word;\n\t\t$expected_key = strtoupper(md5($sale_id . $vendor_id . $invoice_id . $secret_word));\n\n\t\tif(strtoupper($key) != $expected_key)\n\t\t{\n\t\t\tShopLogger::log(\"Invalid 2checkout IPN message received - key \" . $key . ' ' . print_r($_REQUEST, TRUE));\n\t\t\treturn;\n\t\t}\n\n\t\t$message_type = Context::get('message_type');\n\t\tif($message_type != 'ORDER_CREATED')\n\t\t{\n\t\t\tShopLogger::log(\"Unsupported IPN 2checkout message received: \" . print_r($_REQUEST, TRUE));\n\t\t\treturn;\n\t\t}\n\n\t\t$cart_srl = Context::get('vendor_order_id');\n\t\t$transaction_id = $sale_id; // Hopefully, this is order number\n\n\t\t$order_repository = new OrderRepository();\n\n\t\t// Check if order has already been created for this transaction\n\t\t$order = $order_repository->getOrderByTransactionId($transaction_id);\n\t\tif(!$order) // If not, create it\n\t\t{\n\t\t\t$cart = new Cart($cart_srl);\n\t\t\t$this->createNewOrderAndDeleteExistingCart($cart, $transaction_id);\n\n // get created order\n $model = getModel('shop');\n $orderRepository = $model->getOrderRepository();\n $order_srl = Context::get('order_srl');\n $order = $orderRepository->getOrderBySrl($order_srl);\n\t\t}\n\n // generate invoice\n $args = new StdClass();\n $args->order_srl = $order->order_srl;\n $args->module_srl = $order->module_srl;\n $invoice = new Invoice($args);\n $invoice->save();\n if ($invoice->invoice_srl) {\n if (isset($order->shipment))\n $order->order_status = Order::ORDER_STATUS_COMPLETED;\n else\n $order->order_status = Order::ORDER_STATUS_PROCESSING;\n try {\n $order->save();\n }\n catch(Exception $e) {\n return new Object(-1, $e->getMessage());\n }\n } else {\n throw new ShopException('Something whent wrong when adding invoice');\n }\n\t}",
"function deliver(ITip\\Message $iTipMessage) {\n if ($iTipMessage->message->VEVENT->SEQUENCE && !$iTipMessage->message->VEVENT->SEQUENCE->getValue()) {\n $iTipMessage->message->VEVENT->SEQUENCE->setValue(0);\n } else if(!$iTipMessage->message->VEVENT->SEQUENCE) {\n $iTipMessage->message->VEVENT->SEQUENCE =0;\n }\n\n parent::deliver($iTipMessage);\n }",
"function it_exchange_abandoned_carts_mark_email_opened( $email_id, $cart_id ) {\n\t$cart_emails = get_post_meta( $cart_id, '_it_exchange_abandoned_cart_emails_sent', true );\n\n\t// Make sure this email hasn't already been counted.\n\tforeach( (array) $cart_emails as $key => $email ) {\n\t\tif ( ! empty( $email['email_id'] ) && $email['email_id'] == $email_id && ! empty( $email['opened'] ) ) {\n\t\t\treturn;\n\t\t} else if ( ! empty( $email['email_id'] ) && $email['email_id'] == $email_id ) {\n\t\t\t$cart_emails[$key]['opened'] = time();\n\t\t\tupdate_post_meta( $cart_id, '_it_exchange_abandoned_cart_emails_sent', $cart_emails );\n\t\t}\n\t}\n\n\t// If we made it this far the abadoned cart's sent_email has been flagged as open and we need to increment the opens for the email.\n\t$opened = (int) get_post_meta( $email_id, '_it_exchange_abandoned_cart_emails_opened', true );\n\tupdate_post_meta( $email_id, '_it_exchange_abandoned_cart_emails_opened', ( $opened + 1 ) );\n\n\t// Lets also credit any future purchases to this email\n\tupdate_post_meta( $cart_id, '_it_exchange_abandoned_cart_conversion_source', $email_id );\n\n}",
"public function handleDeliveryEvent(object $message): void;",
"public function sendCart(Mage_Sales_Model_Quote $quote, $email = null, $eventType = null)\n {\n try{\n\n if ($eventType){\n $this->_eventType = $eventType;\n }\n\n if (!$email) {\n if(!$email = $quote->getCustomerEmail()) {\n Mage::logException(\"Unable to post purchase: customer email is not defined.\");\n return false;\n }\n }\n\n $data = array(\n 'email' => $email,\n 'items' => $this->_getItems($quote->getAllVisibleItems()),\n 'incomplete' => 1,\n 'reminder_time' => '+' . Mage::helper('sailthruemail')->getReminderTime() . ' min',\n 'reminder_template' => Mage::getStoreConfig('sailthru/email/abandoned_cart_template', $quote->getStoreId()),\n 'message_id' => $this->getMessageId()\n );\n\n $response = $this->apiPost('purchase', $data);\n\n if (array_key_exists('error',$response)){\n return $this->handleError($response, $quote, $email);\n }\n \n\t\t\t/*****Add product sku in following items for price alert*****/\n $productSku = array();\n\t\t\t/*$sailthru_userdata = $this->apiGet('user', array('id' => $email));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items'])) {\n\t\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t\t$productSku = array_values($sailthru_followingItems);\n\t\t\t}*/\n\t\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n\t\t\t#if($productSku) {\n\t\t\t$productSku = array_unique($productSku);\n\t\t\t$data = array(\n\t\t\t\t\t\"id\" => $email,\n\t\t\t\t\t\"vars\" => array(\"following_items\" => $productSku)\n\t\t\t\t\t);\n\t\t\t$response = $this->apiPost('user', $data);\n\t\t\tif (array_key_exists('error',$response)){\n\t\t\t\treturn $this->handleError($response, $quote, $email);\n\t\t\t}\n\t\t\t#}\n\t\t\t/********************************************************/\n\n\t\t\t\n\t\t\t\n Mage::getSingleton('checkout/session')->setSailthuAbandonedCartId($quote->getId());\n \n return true;\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }",
"public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }",
"public function test_it_marks_order_as_processing()\n {\n $event = new OrderPaid(\n $order = factory(Order::class)->create([\n 'user_id' => factory(User::class)->create()\n ])\n );\n\n $listener = new MarkOrderProcessing();\n\n $listener->handle($event);\n\n $this->assertEquals(Order::PROCESSING, $order->fresh()->status);\n }",
"public function testOrderReceiptDisabled() {\n $order_type = OrderType::load($this->order->bundle());\n $order_type->setSendReceipt(FALSE);\n $order_type->save();\n\n $this->order->getState()->applyTransitionById('place');\n $this->order->save();\n\n $this->assertCount(0, $this->getMails());\n }",
"function jx_mark_delivered_status_for_courier_traspost()\r\n\t{\r\n\t\t$user=$this->erpm->auth();\r\n\t\t\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t\r\n\t\t$send_log_id=$this->input->post('send_log_id');\r\n\t\t$invoices_list=$this->input->post('delivered');\r\n\t\t$received_by=$this->input->post('received_by');\r\n\t\t$received_on=$this->input->post('received_on');\r\n\t\t$contact_no=$this->input->post('contact_no');\r\n\t\t\r\n\t\tif($invoices_list)\r\n\t\t{\r\n\t\t\tforeach($invoices_list as $i=>$incoice)\r\n\t\t\t{\r\n\t\t\t\t$param=array();\r\n\t\t\t\t$param['sent_log_id']=$send_log_id;\r\n\t\t\t\t$param['invoice_no']=$incoice;\r\n\t\t\t\t$param['status']=3;\r\n\t\t\t\t$param['received_by']=$received_by[$i];\r\n\t\t\t\t$param['received_on']=$received_on[$i];\r\n\t\t\t\t$param['contact_no']=$contact_no[$i];\r\n\t\t\t\t$param['logged_on']=cur_datetime();\r\n\t\t\t\t$param['logged_by']=$user['userid'];\r\n\t\t\t\t\r\n\t\t\t\t$already=$this->db->query(\"select count(*) as ttl from pnh_invoice_transit_log where invoice_no=? and status=3\",array($incoice))->row()->ttl;\r\n\t\t\t\tif(!$already)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->db->insert('pnh_invoice_transit_log',$param);\r\n\t\t\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Selected invoices status to be updated\");\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Selected invoices status already updated\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tredirect($_SERVER['HTTP_REFERER']);\r\n\t}",
"public function notifyNewOrder(Varien_Event_Observer $observer)\n {\n //Mage::log($observer->getEvent());\n\n //Check to see if module is enabled\n if (!Mage::helper('twilio')->isEnabled() || !Mage::helper('twilio')->sendSmsForNewOrders()) {\n Mage::log(\"Magento Twilio module is not enabled or should not send SMS for new orders.\");\n return;\n }\n\n //Send SMS via twilio\n // try {\n // \t$sms = $this->account->messages->sendMessage(\n // \t\t$this->twilioNumber,\n // \t\t$this->smsNotificationNumber,\n // \t\t$this->message\n // \t);\n // } catch (Exception $e) {\n // \tMage::logException($e);\n // }\n\n //Send SMS via twilio\n try {\n $sms = $this->account->messages->create(\n array(\n 'To' => $this->twilioNumber,\n 'From' => $this->smsNotificationNumber,\n 'Body' => $this->message,\n 'StatusCallback' => Mage::helper('twilio')->getStatusCallbackUrl() //TODO: Verify this is set first\n )\n );\n } catch (Exception $e) {\n\n }\n\n return $this;\n }",
"function action_woocommerce_send_sms_order_completed($order_id) {\n $log = new WC_Logger();\n if(get_qt_options( 'enable_sms_completed_order' ) && get_qt_options( 'enable_sms_completed_order' ) == \"on\") {\n $sms = new SMS_Sender();\n $message = $sms->generateMessage( get_qt_options('sms_completed_order_pattern'), 'order', $order_id );\n $response = $sms->sendSMS( $message );\n $log->log( 'action_woocommerce_send_sms_order_completed', print_r( $response, true ) );\n }\n}",
"public static function clientBidRequest(User $user,Order $order)\n {\n\n $notification = new Notification;\n $notification->user_id = $user->id;\n $notification->order_id = $order->order_id;\n $notification->type = 'writer_bid_request';\n $notification->message ='New Client Bid request on order '.$order->order_no;\n\n $notification->save();\n\n Mail::queue('emails.bid_request',['user'=>$user, 'order'=>$order], function($m)use ($user, $order)\n {\n $m->from('[email protected]', 'ARA');\n\n $m->to($user->email, $user->first_name)->subject('You have a new Bid request on Order '.$order->order_no);\n\n });\n }",
"function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}",
"public function onBidirectionalSendOrderOperation(\\Enlight_Hook_HookArgs $arguments)\n {\n $request = $arguments->getSubject()->Request();\n $parameter = $request->getParams();\n\n /* @var \\Shopware\\Models\\Order\\Order $order */\n $order = Shopware()->Models()->find('Shopware\\Models\\Order\\Order', $parameter['id']);\n if ($this->usesBidirectionalUpdates($order->getPayment()->getName())) {\n $this->orderStatusChangeHandler->informRatepayOfOrderStatusChange($order);\n }\n }",
"public static function MarkOrderProcessAsCompleted()\n {\n $_SESSION[self::SESSION_KEY_NAME_ORDER_SUCCESS] = true;\n }",
"function receipt ($bool=true) {\n $this->receipt = ($bool);\n }",
"function action_woocommerce_send_sms_order_refunded($order_id) {\n # code...\n}",
"public function getReceived()\n {\n return $this->received;\n }",
"public function markWearReceived(RequestVars $post) {\n $deltager = $this->ajaxWearCrud($post);\n if (!strtotime($deltager->checkin_time)) {\n throw new FrameworkException(\"<strong>Fejl:</strong> deltageren (ID: {$deltager->id}) er ikke tjekket ind.\");\n }\n\n $wear_items = $deltager->getWear();\n if (!$wear_items) {\n throw new FrameworkException(\"<strong>Fejl:</strong> deltageren (ID: {$deltager->id}) har ikke bestilt wear.\");\n }\n $handout = array();\n foreach ($wear_items as $item) {\n if ($item->received == 't') {\n throw new FrameworkException(\"<strong>Fejl:</strong> deltageren (ID: {$deltager->id}) har allerede fået udleveret noget af sit wear.\");\n }\n $item->received = 't';\n $item->update();\n $handout[] = '<strong>' . e($item->getWearName()) . \": {$item->antal} stk. i str. {$item->size}</strong> ({$item->getDeltager()->getBrugerKategori()->navn})\";\n }\n $this->log(\"Deltager #{$deltager->id} har fået wear udleveret af {$this->getLoggedInUser()->user}\", 'Wear', $this->getLoggedInUser());\n return e($deltager->getName()) . \" (ID: {$deltager->id}) markeret wear modtaget - hvis det er en fejl, så tryk på Undo-knappen. Wear, der skal udleveres:<ul><li>\" . implode('</li><li>', $handout) . '</li></ul>';\n }",
"public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }",
"public function setDataReceived($rec)\n\t{\n\t\t$this->body()->data_received = $rec;\n\t}",
"public function submitOrderToAmazon(Varien_Event_Observer $observer)\n {\n $helper = Mage::helper('amazon_mcf');\n $order = $observer->getOrder();\n\n // Do we have any items to submit to Amazon?\n $amazonItemInOrder = false;\n foreach ($order->getAllItems() as $item) {\n if ($item->getProduct()->getAmazonMcfEnabled()) {\n $order->setFulfilledByAmazon(true);\n $amazonItemInOrder = true;\n break;\n }\n }\n\n if (!$helper->isEnabled() || !$amazonItemInOrder) {\n return;\n }\n\n /**\n * @var Amazon_MCF_Model_Service_Outbound $service\n */\n $service = Mage::getSingleton('amazon_mcf/service_outbound');\n $response = $service->createFulfillmentOrder($order);\n\n if (!empty($response)) {\n $order->setAmazonOrderStatus(\n Amazon_MCF_Helper_Data::ORDER_STATUS_RECEIVED\n );\n } else {\n $order->setAmazonOrderStatus(\n Amazon_MCF_Helper_Data::ORDER_STATUS_ATTEMPTED\n );\n $order->setAmazonOrderSubmissionCount(1);\n }\n }",
"function on_backorder() {\n\t\treturn ($this->_item_availability->available_to_promise <= $this->backorder_quantity);\n\t}",
"public function pendingOrderState()\n {\n $stateExist = false;\n $states = OrderState::getOrderStates((int)$this->context->language->id);\n foreach ($states as $state) {\n if (in_array($this->lang('Awaiting Mollie payment'), $state)) {\n $stateExist = true;\n break;\n }\n }\n if (!$stateExist) {\n $orderState = new OrderState();\n $orderState->send_email = false;\n $orderState->color = '#4169E1';\n $orderState->hidden = false;\n $orderState->delivery = false;\n $orderState->logable = false;\n $orderState->invoice = false;\n $orderState->module_name = $this->name;\n $orderState->name = array();\n $languages = Language::getLanguages(false);\n foreach ($languages as $language) {\n $orderState->name[$language['id_lang']] = $this->lang('Awaiting Mollie payment');\n }\n if ($orderState->add()) {\n $source = _PS_MODULE_DIR_ . 'mollie/views/img/logo_small.png';\n $destination = _PS_ROOT_DIR_ . '/img/os/' . (int)$orderState->id . '.gif';\n @copy($source, $destination);\n }\n Configuration::updateValue(Mollie::MOLLIE_PENDING, (int) $orderState->id);\n }\n\n return true;\n }",
"public function incrementRemindersSent()\n {\n $this->reminders_sent = $this->reminders_sent + 1;\n $this->save();\n }",
"public function getOrderItemStatus() {\n\t\treturn $this->orderItemStatus;\n\t}",
"protected function doActionSendTracking()\n {\n \\XLite\\Core\\Mailer::sendOrderTrackingInformationCustomer($this->getOrder());\n\n \\XLite\\Core\\TopMessage::addInfo('Tracking information has been sent');\n }",
"public function resume_order_tracking() {\n global $wp, $wpdb;\n \n $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;\n if ($order_id) {\n WC_Gokeep_JS::get_instance()->resume_order( WC()->order_factory->get_order($order_id) );\n }\n }",
"public function getReceived() {\n\t\treturn $this->received;\n\t}",
"public function taskCharged($order,$item)\n\t{\n\t\t// find price\n\t\t$price = MDealPrice::model()->findByPk($item->itemId);\n\t\t// find deal\n\t\t$deal = $price->deal;\n\t\t\n\t\t// send email if tipped\n\t\tif(wm()->get('deal.helper')->dealStatus($deal) == 'tipped')\n\t\t\tapp()->mailer->send($item->order->user, 'chargedEmail', array('deal' => $deal));\n\t}",
"public function change_email_sent()\n {\n $this->_render();\n }",
"function action_woocommerce_send_sms_order_cancelled($order_id) {\n # code... \n}",
"public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }",
"public function setStatusDelivery($param) {\n $CB16PEDIDO = CB16PEDIDO::find()->where(\"CB16_ID = \".$param['pedido'].\" and CB16_STATUS >= 30\")->all()[0];\n if ($CB16PEDIDO) {\n $CB16PEDIDO->setAttribute('CB16_STATUS_DELIVERY', $param['new_status']);\n $CB16PEDIDO->save(); \n }\n }",
"public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }",
"public function send() {\n // listing was reported\n }",
"private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }",
"public function confirmOrder()\n {\n $order = Order::query()->findOrFail(request()->input('order'));\n\n if ($order->orderStatus->slug !== OrderStatus::PROCESSED) {\n return redirect()->back();\n }\n\n $order->delivery_tracking = request()->input('delivery_tracking');\n\n $order->setStatusSent();\n\n $order->save();\n\n $order->user->notify(new OrderSent($order));\n\n return redirect(backpack_url('order?status=2')) //http://lucilevilaine.local/admin/order?status=2\n ->with('success', 'La commande a bien été confirmé');\n }",
"protected function declineOrder($order, $orderItems) \n {\n Artisan::call('order:push', [\n 'order_number' => $order->order_number,\n 'merchant_id' => $orderItems[0]->merchant_id,\n 'order_command' => 'decline',\n ]); \n }",
"public function markReadedMessage($userId)\n {\n $this->model->receiveChat($userId)->update(['readed' => true]);\n }",
"public function createAbandonedCartEmail($quote,$email)\n {\n try{\n $this->_eventType = 'abandonedCart';\n\n $storeId = $quote->getStoreId();\n $reminderTemplate = Mage::getStoreConfig('sailthru/email/abandoned_cart_template', $storeId);\n\n $newTemplate = array(\n 'template' => $reminderTemplate,\n 'content_html' => $this->_getContent(),\n 'subject' => Mage::getStoreConfig('sailthru/email/abandoned_subject', $storeId),\n 'from_name' => Mage::getStoreConfig('sailthru/email/abandoned_cart_sender_name', $storeId),\n 'from_email' => Mage::getStoreConfig('sailthru/email/abandoned_cart_sender_email', $storeId),\n 'is_link_tracking' => 1,\n 'is_google_analytics' => 1\n );\n\n $templateResponse = $this->apiPost('template', $newTemplate);\n\n //Send Purchase Data\n $data = array(\n 'email' => $email,\n 'incomplete' => 1,\n 'items' => $this->_getItems($quote->getAllVisibleItems()),\n 'reminder_template' => $reminderTemplate\n );\n $response = $this->apiPost(\"purchase\", $data);\n return true;\n } catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }",
"public static function rac_change_cart_list_mailstatus() {\n check_ajax_referer('mailstatus-cartlist', 'rac_security');\n\n if (isset($_POST['row_id']) && isset($_POST['status'])) {\n $status = $_POST['status'];\n update_post_meta($_POST['row_id'], 'rac_cart_sending_status', $status);\n echo '1';\n }\n exit();\n }",
"public function sendOrder(Mage_Sales_Model_Order $order)\n {\n try{\n\t\t\t$this->_eventType = 'placeOrder';\n\t\t\t$amount\t\t= number_format($order->getGrandTotal(),2);\n\t\t\t$samount\t= number_format($order->getSubtotal(),2);\n\t\t\t$tax \t\t= number_format($order->getBaseTaxAmount(),2);\n\t\t\t$shipping \t= number_format($order->getBaseShippingAmount(),2);\n\t\t\t$discounts \t= number_format($order->getDiscountAmount(),2);\n\t\t\t$shippingAddressData \t= $order->getShippingAddress()->getData();\n\t\t\t$billingAddressData \t= $order->getBillingAddress()->getData();\n\t\t\t$shippingMethod \t \t= $order->_data[\"shipping_description\"];\n\t\t\t$paymentMethod \t \t \t= $order->getPayment()->getMethodInstance()->getTitle();\n\t\t\t$customerId \t\t\t= $order->getCustomerId();\n\t\t\t$websiteId \t\t\t\t= 1;\n\t\t\t$balanceModel \t\t\t= Mage::getModel('enterprise_customerbalance/balance')\n\t\t \t\t\t\t \t->setCustomerId($customerId)\n\t\t \t\t\t\t \t->setWebsiteId($websiteId)\n\t\t \t\t\t\t\t->loadByCustomer();\t\n\t\t $storeCredit\t\t\t= ($balanceModel->getId())? number_format($balanceModel->getAmount(),2) :'0' ; \t\t\t\t\t\t\n $data = array(\n 'email' => $order->getCustomerEmail(),\n 'items' => $this->_getItems($order->getAllVisibleItems()),\n 'adjustments' => $this->_getAdjustments($order),\n 'message_id' => $this->getMessageId(),\n 'send_template' => 'Purchase Receipt',\n 'tenders' => $this->_getTenders($order),\n 'vars'\t=> array ( 'order#'=> $order->getIncrementId(),\n\t\t\t\t\t\t\t\t\t'subtotal'=> $samount,\n\t\t\t\t\t\t\t\t\t'shipping_and_handling'=> $shipping,\n\t\t\t\t\t\t\t\t\t'sale_tax'=> $tax,\n\t\t\t\t\t\t\t\t\t'billing_address'=> $shippingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_address'=> $billingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_method'=> $shippingMethod,\n\t\t\t\t\t\t\t\t\t'payment_method'=> $paymentMethod,\n\t\t\t\t\t\t\t\t\t'store_credit' => $storeCredit\n\t\t\t ),\n \t);\n /**\n * Send order data to purchase API\n */\n $responsePurchase = $this->apiPost('purchase', $data);\n\t\t\t\n\t\t\t/****Update product sku in following items for price alert****/\n $productSku = array();\n\t\t\tforeach ($order->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n $sailthru_userdata = $this->apiGet('user', array('id' => $order->getCustomerEmail()));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items']) && $productSku) {\n\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t$sailthru_followingItems = array_values($sailthru_followingItems);\n\t\t\t\t$sailthru_followingItems = array_diff($sailthru_followingItems,$productSku);\n\t\t\t\t$sailthru_followingItems = array_unique($sailthru_followingItems);\n\t\t\t\t$data = array(\n\t\t\t\t\t\t\"id\" => $order->getCustomerEmail(),\n\t\t\t\t\t\t\"vars\" => array(\"following_items\" => $sailthru_followingItems)\n\t\t\t\t\t\t);\n\t\t\t\t$response = $this->apiPost('user', $data);\n\t\t\t}\n /*************************************************/\n\t\t\t\n /**\n * Send customer data to user API\n */\n //$responseUser = Mage::getModel('sailthruemail/client_user')->sendCustomerData($customer);\n }catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }",
"public function setUserReceived($value)\n {\n return $this->set(self::user_received, $value);\n }",
"protected function _fcpoSetOrderStatus() {\n $blIsAmazonPending = $this->_oFcpoHelper->fcpoGetSessionVariable('fcpoAmazonPayOrderIsPending');\n $blOrderOk = $this->_fcpoValidateOrderAgainstProblems();\n\n if ($blIsAmazonPending) {\n $this->_setOrderStatus('PENDING');\n $this->oxorder__oxfolder = new oxField('ORDERFOLDER_PROBLEMS', oxField::T_RAW);\n $this->save();\n } elseif ($blOrderOk === true) {\n // updating order trans status (success status)\n $this->_setOrderStatus('OK');\n } else {\n $this->_setOrderStatus('ERROR');\n }\n }",
"public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }",
"public function addOrderedItemsToStock($order)\r\n {\r\n \t$nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\r\n \t$isCustomStockManagementEnabled = Mage::getModel('paymentsensegateway/direct')->getConfigData('customstockmanagementenabled');\r\n\t\t\r\n \tif($nVersion >= 1410 &&\r\n \t\t$isCustomStockManagementEnabled)\r\n \t{\r\n\t \t$items = $order->getAllItems();\r\n\t\t\tforeach ($items as $itemId => $item)\r\n\t\t\t{\r\n\t\t\t\t// ordered quantity of the item from stock\r\n\t\t\t\t$quantity = $item->getQtyOrdered();\r\n\t\t\t\t$productId = $item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\r\n\t\t\t\t$stockManagement = $stock->getManageStock();\r\n\t\t\t\t\r\n\t\t\t\tif($stockManagement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stock->setQty($stock->getQty() + $quantity);\r\n\t\t\t\t\t$stock->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n }",
"function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse m fjernes nr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }",
"function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}",
"public function trackOrder($trackingNo);",
"public static function delivery_time_changed(User $user, Order $order)\n {\n $notification = new Notification;\n $notification->user_id = $user->id;\n $notification->order_id = $order->id;\n $notification->type = 'Deadline update';\n $notification->message ='Deadline has been updated';\n\n $notification->save();\n\n Mail::queue('emails.time_updated_order',['user'=>$user, 'order'=>$order], function($m)use ($user, $order)\n {\n $m->from('[email protected]', 'ARA');\n\n $m->to($user->email, $user->first_name)->subject('Deadline updated on Order '.$order->order_no);\n\n });\n\n\n //We send an sms notification to the User for the time update;\n $txt = 'Greetings '.$user->first_name.' Order '.$order->order_no.' deadline has been updated to '.$order->deadline.' Kindly have a look at it and take not of the the chagnes. Academicresearchasistants.com';\n $send_sms =self::sendSMSnotice($user,$txt);\n }",
"public function isSent() {\n\treturn $this->status != self::$WAITING;\n }",
"public function update($order, $item)\n {\n //echo $order;\n //echo $item;\n //$item = Request::json('item');\n $part = Request::json('part');\n $packs = Request::json('packs');\n \n \n //check if-match header\n $etag = Request::header('if-match');\n \n //compare the etags to determine if standing order was previously modified\n if($etag == null || $etag!== $this->standingOrders->getEtag($order)){\n return Error::show(1);\n }\n \n \n //move forward with the update\n $update = $this->standingOrders->changeItemDetails($order, $item, $part, $packs);\n \n if(isset($update)){\n return Response::json(array(\n 'message' => $update\n )); \n }\n else{\n return Response::json(array(\n 'error' => \"update could not be completed\"\n ));\n } \n }",
"public function sendNotifycation($type,$user_id,$item,$is_request = false)\n {\n $aActualUser = Engine_Api::_()->getItem('user',$user_id); \n }",
"public function saved(Item $item) {\n if ($item->quantity <= $item->minimum_quantity && !$item->depleted) {\n $item->depleted = true;\n $item->save();\n\n // send email to manager\n $managerRole = Role::where('name', 'manager')->first();\n $manager = $managerRole->users->first();\n\n Mail::to($manager->email)->send(new InventoryDepletionMail(), compact('item'));\n }\n }",
"public function execute() {\n $request = $this->getRequest()->getParams();\n \n $order_id = strip_tags($request[\"orderId\"]);\n $order = $this->objectManagement->create('Magento\\Sales\\Model\\Order')->loadByIncrementId($order_id);\n $validateOrder = $this->validateWebhook($request, $order);\n\n $transactionId = $request['referenceId'];\n\n $mageOrderStatus = $order->getStatus();\n\n if($mageOrderStatus === 'pending') {\n\n if(!empty($validateOrder['status']) && $validateOrder['status'] === true) {\n if($request['txStatus'] == 'SUCCESS') {\n $request['additional_data']['cf_transaction_id'] = $transactionId;\n $this->logger->info(\"Cashfree Notify processing started for cashfree transaction_id(:$transactionId)\");\n $this->processPayment($transactionId, $order);\n $this->logger->info(\"Cashfree Notify processing complete for cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'FAILED' || $request['txStatus'] == 'CANCELLED') {\n $orderStatus = self::STATE_CANCELED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } elseif($request['txStatus'] == 'USER_DROPPED') {\n $orderStatus = self::STATE_CLOSED;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n } else {\n $orderStatus = self::STATE_PENDING_PAYMENT;\n $this->processWebhookStatus($orderStatus, $order);\n $this->logger->info(\"Cashfree Notify change magento order status to (:$orderStatus) cashfree transaction_id(:$transactionId)\");\n return;\n }\n } else {\n $errorMsg = $validateOrder['errorMsg'];\n $this->logger->info(\"Cashfree Notify processing payment for cashfree transaction_id(:$transactionId) is failed due to ERROR(: $errorMsg)\");\n return;\n }\n } else {\n $this->logger->info(\"Order has been already in processing state for cashfree transaction_id(:$transactionId)\");\n return;\n }\n }",
"function backorders_require_notification() {\n\t\tif ($this->data['backorders']=='notify') return true;\n\t\treturn false;\n\t}",
"public function broadcastOn()\n {\n return new Channel('order');\n }",
"function checkOrderStatus($orderItem, $status){\n $statusCode = getOrderStatusCode($status);\n return $orderItem->status == $statusCode;\n}",
"public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n\n $formData = $this->input->post(NULL, TRUE);\n\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"bid_available\"){\n //Get data to store\n $data = array(\n 'guildPhoneNumber' => $formData['guildPhoneNumber'],\n 'deliveryRequestId' => $formData['deliveryRequestId'],\n 'driverPhoneNumber' => $formData['driverPhoneNumber'],\n 'driverName' => $formData['driverName'],\n 'estimatedDeliveryTime' => $formData['estimatedDeliveryTime']\n );\n\n //Store bid in DB and exit\n $this->save_bid($data);\n }\n else if($name === \"complete\"){\n $driverPhoneNumber = $formData['driverPhoneNumber'];\n\n $this->load->model('bids_model');\n $this->bids_model->set_delivered($driverPhoneNumber);\n }\n }",
"public function salesOrderInvoiceSaveAfter(Varien_Event_Observer $observer) {\n \t$invoice = $observer->getEvent()->getInvoice();\n \tif(!$invoice->getOrigData($invoice->getIdFieldName()) && Mage::helper('avatax')->isObjectActionable($invoice)) {\n\t\t Mage::getModel('avatax_records/queue')\n\t\t \t->setEntity($invoice)\n\t\t \t->setType(OnePica_AvaTax_Model_Records_Queue::QUEUE_TYPE_INVOICE)\n\t\t \t->setStatus(OnePica_AvaTax_Model_Records_Queue::QUEUE_STATUS_PENDING)\n\t\t \t->save();\n \t}\n }",
"public function buy(Request $request){\n $order = ModelsOrder::whereId($request->id)->first();\n if($order):\n //then return status to false\n $order->update([\n 'status' => 1,\n ]);\n return back()->withMsg('done');\n endif;\n return back()->withError('this item didnot found');\n }",
"private function processNotificationsToBeSent()\n {\n if (array_key_exists('status', $this->originalAttributeValues))\n {\n if ($this->status == Task::STATUS_AWAITING_ACCEPTANCE &&\n $this->requestedByUser->id != Yii::app()->user->userModel->id)\n {\n TasksNotificationUtil::submitTaskNotificationMessage($this,\n TasksNotificationUtil::TASK_STATUS_BECOMES_AWAITING_ACCEPTANCE,\n Yii::app()->user->userModel);\n }\n elseif ($this->status == Task::STATUS_REJECTED &&\n $this->owner->id != Yii::app()->user->userModel->id)\n {\n TasksNotificationUtil::submitTaskNotificationMessage($this,\n TasksNotificationUtil::TASK_STATUS_BECOMES_REJECTED,\n Yii::app()->user->userModel);\n }\n elseif ($this->status == Task::STATUS_COMPLETED)\n {\n TasksNotificationUtil::submitTaskNotificationMessage($this,\n TasksNotificationUtil::TASK_STATUS_BECOMES_COMPLETED,\n Yii::app()->user->userModel);\n }\n }\n if ($this->isNewModel)\n {\n if ($this->owner->id != $this->requestedByUser->id && $this->owner->id != Yii::app()->user->userModel->id)\n {\n TasksNotificationUtil::submitTaskNotificationMessage($this,\n TasksNotificationUtil::TASK_NEW);\n }\n }\n elseif (array_key_exists('owner', $this->originalAttributeValues))\n {\n if ($this->requestedByUser->id != Yii::app()->user->userModel->id)\n {\n TasksNotificationUtil::submitTaskNotificationMessage($this,\n TasksNotificationUtil::TASK_OWNER_CHANGE);\n }\n if ($this->owner->id != Yii::app()->user->userModel->id)\n {\n TasksNotificationUtil::submitTaskNotificationMessage($this,\n TasksNotificationUtil::TASK_NEW);\n }\n }\n }",
"public function sendOrderChange($senderOrg, $order, $changed = [], $deleted = [], $additionalParams = [])\n {\n /** @var Mailer $mailer */\n /** @var Message $message */\n $mailer = Yii::$app->mailer;\n $mailer->htmlLayout = '@mail_views/order';\n // send email\n $subject = Yii::t('message', 'frontend.controllers.order.change_in_order', ['ru' => \"Измененения в заказе №\"]) . $order->id;\n\n $searchModel = new OrderContentSearch();\n $params['OrderContentSearch']['order_id'] = $order->id;\n $dataProvider = $searchModel->search($params);\n $dataProvider->pagination = false;\n\n /**\n * Отправка сообщения в чат\n */\n if ($senderOrg->id == $order->client_id) {\n $senderUser = $order->createdBy;\n } else {\n $senderUser = $order->acceptedBy ?? User::findOne(1);\n }\n\n if (!empty($changed) || !empty($deleted) || !empty($additionalParams)) {\n $systemMessage = \\Yii::$app->view->renderFile('@mail_views/chat/order_change.php', [\n 'changed' => $changed,\n 'deleted' => $deleted,\n 'additionalParams' => $additionalParams\n ]);\n\n $this->sendSystemMessage($senderUser, $order->id, $systemMessage, false, $subject);\n $recipient_org_id = $senderOrg->id == $order->client_id ? $order->vendor_id : $order->client_id;\n Notice::init('Chat')->updateCountMessageAndDialog($recipient_org_id, $order, $subject);\n }\n\n $orgs[] = $order->vendor_id;\n $orgs[] = $order->client_id;\n foreach ($order->recipientsList as $recipient) {\n $email = $recipient->email;\n foreach ($orgs as $org) {\n $notification = $recipient->getEmailNotification($org);\n if ($notification)\n if ($notification->order_changed && !empty($email)) {\n $mailer->compose('@mail_views/orderChange', compact(\"subject\", \"senderOrg\", \"order\", \"dataProvider\", \"recipient\", \"changed\", \"deleted\"))\n ->setTo($email)\n ->setSubject($subject)\n ->send();\n }\n $notification = $recipient->getSmsNotification($org);\n if ($notification)\n if ($recipient->profile->phone && $notification->order_changed) {\n $text = Yii::$app->sms->prepareText('sms.order_changed', [\n 'client_name' => $senderOrg->name,\n 'url' => $order->getUrlForUser($recipient, Yii::$app->params['app_version'])\n ]);\n Yii::$app->sms->send($text, $recipient->profile->phone, $order->id);\n }\n }\n }\n\n }"
] | [
"0.64777887",
"0.6158849",
"0.5981303",
"0.5977248",
"0.5903778",
"0.57888186",
"0.5784632",
"0.57198447",
"0.563626",
"0.5581515",
"0.5546358",
"0.5473458",
"0.54663837",
"0.54459774",
"0.54220086",
"0.5407221",
"0.54020214",
"0.5385952",
"0.5376946",
"0.5348169",
"0.5345237",
"0.53449976",
"0.53396285",
"0.5326104",
"0.53135383",
"0.5308295",
"0.52983046",
"0.52853835",
"0.5284306",
"0.5278579",
"0.52478373",
"0.52402735",
"0.52363384",
"0.52276117",
"0.5226662",
"0.52220947",
"0.52147794",
"0.5212103",
"0.51872444",
"0.51800966",
"0.5173384",
"0.51721936",
"0.5163089",
"0.51522654",
"0.5143709",
"0.51365066",
"0.5135145",
"0.51325315",
"0.5130759",
"0.5118115",
"0.5113344",
"0.5098735",
"0.50982296",
"0.5087298",
"0.5084727",
"0.50840336",
"0.5077295",
"0.50645185",
"0.5060587",
"0.50583917",
"0.5036727",
"0.5034061",
"0.5033668",
"0.50278723",
"0.50203997",
"0.5016855",
"0.500832",
"0.49975377",
"0.49953443",
"0.49825397",
"0.49789986",
"0.4973692",
"0.49725965",
"0.4972003",
"0.49705258",
"0.49691266",
"0.49469197",
"0.49459758",
"0.49342385",
"0.49244937",
"0.4922287",
"0.491981",
"0.49142563",
"0.49028182",
"0.48961896",
"0.4887404",
"0.48815015",
"0.48687345",
"0.4866817",
"0.4866152",
"0.48654142",
"0.48634082",
"0.4857895",
"0.48484814",
"0.48484752",
"0.48446226",
"0.48399383",
"0.48371804",
"0.48345926",
"0.4831471"
] | 0.6721483 | 0 |
Order item meta Tracking URL label | function wcfm_tracking_url_display_label( $display_key ) {
global $WCFM, $WCFMu;
if( $display_key == 'wcfm_tracking_code' ) {
$display_key = __( 'Tracking Code', 'wc-frontend-manager-ultimate' );
}
if( $display_key == 'wcfm_tracking_url' ) {
$display_key = __( 'Tracking URL', 'wc-frontend-manager-ultimate' );
}
if( $display_key == 'wcfm_mark_as_recived' ) {
$display_key = __( 'Item(s) Received', 'wc-frontend-manager-ultimate' );
}
return $display_key;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_label() {\n\t\treturn __( 'Other URL', 'the-events-calendar' );\n\t}",
"public function getMetaUrl() {\n return (isset($this->metaUrl) && $this->metaUrl!='') ? $this->metaUrl : url('');\n }",
"public function getHTTPLink()\n\t{\n\t\treturn 'http://open.spotify.com/track/' . toSpotifyId($this->id);\n\t}",
"public function getDescription(): string\n {\n return 'TYPO3 includes native URL handling. Every product record has its own speaking URL path called \"slug\" which can be edited in TYPO3 Backend. However, it is necessary that all products have a URL pre-filled. This is done by evaluating the title.';\n }",
"public function getTrackingLink( $strTracking ) \r\n {\r\n // original link is still unknown\r\n return 'http://trackthepack.com/track/'.$strTracking;\r\n }",
"function getUrl() {\n\t\treturn $this->repoObj->lobUrltitle;\n\t}",
"public function display_html_tracking_item_for_meta_box( $order_id, $item ) {\n\t\t\t$formatted = $this->get_formatted_tracking_item( $order_id, $item );\n\t\t\t?>\n\t\t\t<div class=\"tracking-item\" id=\"tracking-item-<?php echo esc_attr( $item['tracking_id'] ); ?>\">\n\t\t\t\t<p class=\"tracking-content\">\n\t\t\t\t\t<strong><?php echo esc_html( $formatted['formatted_tracking_provider'] ); ?></strong>\n\t\t\t\t\t<?php if ( strlen( $formatted['formatted_tracking_link'] ) > 0 ) : ?>\n\t\t\t\t\t\t- <?php echo sprintf( '<a href=\"%s\" target=\"_blank\" title=\"' . esc_attr( __( 'Click here to track your shipment', 'woocommerce-shipment-tracking' ) ) . '\">' . __( 'Track', 'woocommerce-shipment-tracking' ) . '</a>', esc_url( $formatted['formatted_tracking_link'] ) ); ?>\n\t\t\t\t\t<?php endif; ?>\n\t\t\t\t\t<br/>\n\t\t\t\t\t<em><?php echo esc_html( $item['tracking_number'] ); ?></em>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"meta\">\n\t\t\t\t\t<?php /* translators: 1: shipping date */ ?>\n\t\t\t\t\t<?php echo esc_html( sprintf( __( 'Shipped on %s', 'woocommerce-shipment-tracking' ), date_i18n( 'Y-m-d', $item['date_shipped'] ) ) ); ?>\n\t\t\t\t\t<a href=\"#\" class=\"delete-tracking\" rel=\"<?php echo esc_attr( $item['tracking_id'] ); ?>\"><?php _e( 'Delete', 'woocommerce-shipment-tracking' ); ?></a>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<?php\n\t}",
"function meta_urls()\n\t{\n\t\treturn array(\n\t\t\t_t( 'Site Feed' ) => URL::get( 'atom_feed', array( 'index' => '1' ) ),\n\t\t\t_t( 'Comments Feed' ) => URL::get( 'atom_feed_comments' ),\n\t\t\t'Habari' => 'http://habariproject.org/',\n\t\t);\n\t}",
"public function orderLink($in){\n\treturn( '<a href=\"https://www.google.com/dfp/'.DFP_NETWORK_ID.'?#delivery/OrderDetail/orderId='.$in.'\" target=\"_new\">'.$in.'</a>' );\n }",
"function get_generic_link() {\n\t\treturn $this->url;\n\t}",
"public function getItemLinkUrl()\n {\n return $this->escapeXssInUrl($this->getEntity()->getData('list_item_url'));\n }",
"public function displayName()\n {\n return Settings::get(\n 'octoshop_products_label',\n trans('offline.sitesearch::lang.settings.octoshop_itemurl_badge')\n );\n }",
"public static function getTrackingUrl($orderToken)\n {\n return Configs::TRACKING_URL . \"#/{$orderToken}\";\n }",
"function url_meta() {\n add_meta_box('url_meta', 'URL', 'url_callback', 'external_post', 'normal', 'high');\n add_meta_box('url_meta', 'URL', 'url_callback', 'external_tool', 'normal', 'high');\n}",
"public function lineItemLink($in){\n\treturn( '<a href=\"https://www.google.com/dfp/'.DFP_NETWORK_ID.'?#delivery/LineItemDetail/lineItemId='.$in.'\" target=\"_new\">'.$in.'</a>' );\n }",
"function getLabelField() \n {\n return \"navbarlink_textKey\";\n }",
"function order_action_print_label_action( $order ) {\n\n $dbh = new Database_Handler();\n\n $label = $dbh->get_labels_by_order_id($order->get_id(),false);\n\n $label = get_object_vars($label);\n $label_id = $label['label_id'];\n get_label( $order->get_id(), $label_id, false );\n\n}",
"public function getUrl()\n {\n return parent::getUrl().'v3/openOrders';\n }",
"function pull_quote_url_meta() {\n add_meta_box('pull_quote_url_meta', 'Pull Quote URL', 'pull_quote_url_callback', 'discussion', 'normal', 'high');\n}",
"public function getTrackingUrlTemplate()\n {\n return isset($this->tracking_url_template) ? $this->tracking_url_template : '';\n }",
"public function get_tracking_code(): string {\n global $OUTPUT, $USER;\n\n $settings = $this->record->get_property('settings');\n\n $template = new \\stdClass();\n $template->siteid = $settings['siteid'];\n $template->siteurl = $settings['siteurl'];\n $custompiwikjs = (isset($settings['piwikjsurl']) && !empty($settings['piwikjsurl']));\n $template->piwikjsurl = $custompiwikjs ? $settings['piwikjsurl'] : $settings['siteurl'];\n $template->imagetrack = $settings['imagetrack'];\n\n $template->userid = false;\n\n if (!empty($settings['userid']) && !empty($settings['usefield']) && !empty($USER->{$settings['usefield']})) {\n $template->userid = $USER->{$settings['usefield']};\n }\n\n $template->doctitle = \"\";\n\n if (!empty($this->record->get_property('cleanurl'))) {\n $template->doctitle = \"_paq.push(['setDocumentTitle', '\" . $this->trackurl() . \"']);\\n\";\n }\n\n return $OUTPUT->render_from_template('watool_matomo/tracking_code', $template);\n }",
"public function getName()\n {\n return 'object_url';\n }",
"function carton_add_order_item_meta( $item_id, $meta_key, $meta_value, $unique = false ){\n\treturn add_metadata( 'order_item', $item_id, $meta_key, $meta_value, $unique );\n}",
"public function getNoteUrl() : string\n {\n return $this->noteUrl;\n }",
"public function getLink() {\n if($this->items!==false) {\n $item = @current($this->items);\n return 'http://twitter.com/'.$item->user->screen_name.'/status/'.$item->id_str;\n }\n return false;\n }",
"public function getDisplayNameAttribute()\n {\n if($this->is_active) {return '<a href=\"'.$this->url.'\" class=\"display-location\">'.$this->name.'</a>';}\n else {return '<s><a href=\"'.$this->url.'\" class=\"display-location text-muted\">'.$this->name.'</a></s>';}\n }",
"function get_the_wpc_button_label( $args ) {\n\n if ( empty( $args['label'] ) && empty( $args[ $args['link_type'] . '_link' ] ) ) {\n return '';\n }\n\n $href = $args[ $args['link_type'] . '_link' ];\n $label = ! empty ( $args['label'] ) ? $args['label'] : '';\n\n if ( 'link' === $args['link_type'] ) {\n $label = $href['title'];\n }\n\n return $label;\n}",
"public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }",
"public function kind_icon_url ()\n {\n switch ($this->kind)\n {\n case History_item_deleted:\n return '{icons}indicators/deleted';\n case History_item_restored:\n return '{icons}indicators/restored';\n case History_item_hidden:\n return '{icons}indicators/hidden';\n case History_item_hidden_update:\n return '{icons}indicators/hidden_update';\n case History_item_locked:\n return '{icons}indicators/locked';\n default:\n return parent::kind_icon_url ();\n }\n }",
"public function show($orderItem)\n {\n }",
"public function getShopNowUrl()\n {\n return $this->getData('show_now_url');\n }",
"protected function set_meta_desc()\r\r\n {\r\r\n define('_KEYWORDS',_BUY_ONLINE);\r\r\n define('_DESCRIPTION',_BUY_ONLINE);\r\r\n define('_TITLE_PAGE',_BUY_ONLINE);\r\r\n }",
"public function get_transaction_url( $order ) {\r\n \r\n $this->view_transaction_url = MDL_COINCHECK_API_BASE. '?cmd=_view-a-trans&id=%s';\r\n \r\n return parent::get_transaction_url( $order );\r\n }",
"public function kind_icon_url ()\n {\n switch ($this->kind)\n {\n case History_item_published:\n return '{icons}indicators/released';\n case History_item_abandoned:\n return '{icons}buttons/abandon';\n case History_item_queued:\n return '{icons}buttons/queue';\n case History_item_unpublished:\n return '{icons}buttons/unpublish';\n default:\n return parent::kind_icon_url ();\n }\n }",
"function getURL() \n {\n return $this->getValueByFieldName( 'navbarlink_url' );\n }",
"function link_to_item($text = null, $props = array(), $action = 'show', $item = null)\n{\n if (!$item) {\n $item = get_current_record('item');\n }\n if (empty($text)) {\n $text = metadata($item, 'display_title');\n }\n return link_to($item, $action, $text, $props);\n}",
"public function __toString()\n {\n return $this->getUrl();\n }",
"public function __toString()\n {\n return $this->getUrl();\n }",
"function my_custom_checkout_field_display_admin_order_meta($order){\n echo '<p><strong>'.__('Shipping Method').':</strong> ' . get_post_meta( $order->id, 'shippingMethod', true ) . '</p>';\n }",
"public function getMetaTitle();",
"public function getGearItemDBURL($wowGearSummary)\t\t\t{ return $this->itemDBAdapter->buildItemURL($wowGearSummary->getId()); }",
"protected function _getSiteTitleLink(): string\n {\n $action = $this->_action();\n\n $link = $action->getConfig('scaffold.site_title_link');\n if (empty($link)) {\n $link = '';\n }\n\n return $link;\n }",
"function Link()\n\t{\tif ($this->details[\"hblink\"])\n\t\t{\tif (strstr($this->details[\"hblink\"], \"http://\") || strstr($this->details[\"hblink\"], \"https://\"))\n\t\t\t{\treturn $this->details[\"hblink\"];\n\t\t\t} else\n\t\t\t{\treturn SITE_URL . $this->details[\"hblink\"];\n\t\t\t}\n\t\t}\n\t}",
"public function iconUrl(): string\n {\n return $this->pluck('trophyTitleIconUrl');\n }",
"public function get_formatted_tracking_item( $order_id, $tracking_item ) {\n\t\t$formatted = array();\n\n\t\tif ( version_compare( WC_VERSION, '3.0', '<' ) ) {\n\t\t\t$postcode = get_post_meta( $order_id, '_shipping_postcode', true );\n\t\t} else {\n\t\t\t$order = new WC_Order( $order_id );\n\t\t\t$postcode = $order->get_shipping_postcode();\n\t\t}\n\n\t\t$formatted['formatted_tracking_provider'] = '';\n\t\t$formatted['formatted_tracking_link'] = '';\n\n\t\tif ( empty( $postcode ) ) {\n\t\t\t$postcode = get_post_meta( $order_id, '_shipping_postcode', true );\n\t\t}\n\n\t\t$formatted['formatted_tracking_provider'] = '';\n\t\t$formatted['formatted_tracking_link'] = '';\n\n\t\tif ( $tracking_item['custom_tracking_provider'] ) {\n\t\t\t$formatted['formatted_tracking_provider'] = $tracking_item['custom_tracking_provider'];\n\t\t\t$formatted['formatted_tracking_link'] = $tracking_item['custom_tracking_link'];\n\t\t} else {\n\n\t\t\t$link_format = '';\n\n\t\t\tforeach ( $this->get_providers() as $providers ) {\n\t\t\t\tforeach ( $providers as $provider => $format ) {\n\t\t\t\t\tif ( sanitize_title( $provider ) === $tracking_item['tracking_provider'] ) {\n\t\t\t\t\t\t$link_format = $format;\n\t\t\t\t\t\t$formatted['formatted_tracking_provider'] = $provider;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( $link_format ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( $link_format ) {\n\t\t\t\t$formatted['formatted_tracking_link'] = sprintf( $link_format, $tracking_item['tracking_number'], urlencode( $postcode ) );\n\t\t\t}\n\t\t}\n\n\t\treturn $formatted;\n\t}",
"public function getLink() {\n\t\treturn '<a rel=\"statistics\" href=\"'.self::$DISPLAY_URL.'/'.$this->id().'\">'.$this->name().'</a>';\n\t}",
"function addCategoryLink($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedLinkIdOnMarketplace_'.rand(1000, 9999); \n}",
"public function getTrackerUrl($trackingCode, $orderId=null);",
"function order_action_print_return_label_action( $order ) {\n\n $dbh = new Database_Handler();\n $label = $dbh->get_labels_by_order_id($order->get_id(),true);\n if($label == null || empty($label)){\n $dhl_client = new DhlClient();\n $json = $dhl_client->createDhlReturnLabel($order->get_id());\n $json = get_object_vars($json);\n $tracking_code = $json['trackerCode'];\n $dbh->insert_labels($json['labelId'],true,$order->get_id(),$tracking_code);\n $label = $dbh->get_labels_by_order_id($order->get_id(),true);\n }\n $label = get_object_vars($label);\n $label_id = $label['label_id'];\n get_label( $order->get_id(), $label_id, true );\n}",
"function get_url(string $label, string|int|WP_Post|null $source = null): string\n{\n\t$content = ($source === 'sub') ? get_sub_field($label) : get_field($label, $source);\n\t$content = wp_strip_all_tags($content);\n\treturn esc_url($content);\n}",
"public function meta_author_url()\n\t{\n\t\treturn $this->get_context_meta_value( __FUNCTION__ );\n\t}",
"public function getItemAddToCartUrl($item)\n {\n return Mage::helper('cminds_multiwishlist')->getAddToCartUrl($item);\n }",
"public function __toString() {\n return $this->listUrl;\n }",
"function display_sku_as_meta_data( $item, $order ) {\n\t\t\t$product = BEWPI_WC_Order_Compatibility::get_product( $order, $item );\n\t\t\t$sku = $product && BEWPI_WC_Product_Compatibility::get_prop( $product, 'sku' ) ? BEWPI_WC_Product_Compatibility::get_prop( $product, 'sku' ) : '-';\n\t\t\t?>\n\t\t\t<br>\n\t\t\t<ul>\n\t\t\t\t<li>\n\t\t\t\t\t<strong><?php esc_html_e( 'SKU:', 'woocommerce-pdf-invoices' ); ?></strong> <?php echo esc_html( $sku ); ?>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t\t<?php\n\t\t}",
"public function getPrimaryLabelUrl(): string\n {\n if (is_array($this->documents)) {\n foreach ($this->documents as $document) {\n if ($document['type'] === 'label') {\n return $document['link'];\n }\n }\n }\n\n // If new type of documents is not declared, use old url\n return $this->label['label_printer'];\n }",
"function column_orderinfo($item) {\n\t\t$actions = array(\n\t\t\t'edit' => sprintf('<a href=\"?page=%s&edit=%s\">Edit</a>', $_REQUEST['page'], $item['id']),\n\t\t\t'delete' => sprintf('<a href=\"?page=%s&delete=%s\">Delete</a>', $_REQUEST['page'], $item['id'])\n\t\t);\n\t\treturn sprintf('%1$s %2$s', $item['orderinfo'], $this->row_actions($actions));\n\t}",
"public function get_label() {\n\t\t\treturn __( 'Costumapi', 'text-domain' );\n\t\t}",
"function my_custom_checkout_field_display_admin_order_meta($order){\n echo '<p><strong>'.__('Phone 2').':</strong> <br/>' . get_post_meta( $order->get_id(), 'billing_phone_new', true ) . '</p>';\n}",
"protected function _getOrdersTrackingCode()\n {\n if (!Mage::helper('webgriffe_servergoogleanalytics')->isEnabled()) {\n return parent::_getOrdersTrackingCode();\n }\n\n return '';\n }",
"function wpcp_add_custom_data_to_order($item, $cart_item_key, $values, $order)\n{\n foreach ($item as $cart_item_key => $values) {\n if (isset($values['wpcp_location'])) {\n $item->add_meta_data(__('wpcp_location', 'wpcp'), $values['wpcp_location'], true);\n }\n }\n}",
"public function get_title() {\n return esc_html__( 'Onsale Product', 'Alita-extensions' );\n }",
"protected function setMetaTitle() {\r\n\t\t$partStg = trim($this->settings['news']['semantic']['general']['metaTitle']);\r\n\t\tif (is_int(strpos($partStg, '+'))) {\r\n\t\t\t$parts = t3lib_div::trimExplode('+', $partStg);\r\n\t\t\tforeach ($parts as $part) {\r\n\t\t\t\t$action = 'get' . ucfirst($part);\r\n\t\t\t\t$value = $this->newsItem->$action();\r\n\t\t\t\tif ($value !== '') {\r\n\t\t\t\t\t$data[] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->metaTitle = implode(': ', $data);\r\n\t\t} elseif (is_int(strpos($partStg, '//'))) {\r\n\t\t\t$parts = t3lib_div::trimExplode('//', $partStg);\r\n\t\t\tforeach ($parts as $part) {\r\n\t\t\t\t$action = 'get' . ucfirst($part);\r\n\t\t\t\t$data = $this->newsItem->$action();\r\n\t\t\t\tif ($data !== '') {\r\n\t\t\t\t\t$this->metaTitle = $data;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$action = 'get' . ucfirst($partStg);\r\n\t\t\t$this->metaTitle = $this->newsItem->$action();\r\n\t\t}\r\n\t}",
"function commerce_store_ui_entity_property_info_alter(&$info) {\n $info['commerce_store']['properties']['edit_url'] = array(\n 'label' => t('Edit URL'),\n 'description' => t(\"The URL of the store's edit page.\"),\n 'getter callback' => 'commerce_store_get_properties',\n 'type' => 'uri',\n );\n}",
"public function getSpotifyURI()\n\t{\n\t\treturn 'spotify:track:' . toSpotifyId($this->id);\n\t}",
"public function getOfficialLink();",
"public function getAdditionalInformationUrl()\n {\n if (array_key_exists(\"additionalInformationUrl\", $this->_propDict)) {\n return $this->_propDict[\"additionalInformationUrl\"];\n } else {\n return null;\n }\n }",
"public function getUrl() {\n return urlencode($this->name);\n }",
"public function link() { return site_url().'/'.$this->post->post_name; }",
"protected function get_label($value, $item) \n\t{ \n\t\treturn ( isset($value->as) ? $value->as : $item );\n\t}",
"public function getLuUrl()\n {\n return Mage::getStoreConfig(self::GENERAL_SETTINGS_PATH . 'lu_url', $this->getStoreId());\n }",
"public function getMetaAsRawString()\n\t{\n\t\t$meta = '';\n\t\t$title = $this->getTitleLineString();\n\t\t\n\t\tarray_shift($this->items);\n\t\t\n\t\tforeach ((array) $this->items as $type => $items) {\n\t\t\tforeach ((array) $items as $key => $item) {\n\t\t\t\t$meta .= \"<meta $type=\\\"{$key}\\\" content=\\\"{$item}\\\"/>\\n\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $title . $this->getOgHeadLineString() . $meta;\n\t}",
"public function getLink(): string;",
"public function getLink(): string;",
"public function __toString()\n\t{\n\t\treturn $this->getUrl(TRUE);\n\t}",
"public function getLinkOrderUrl()\n {\n return $this->getUrl('dil_checkout/order/link');\n }",
"public function getCustomUrl() : string;",
"public static function getInfo()\n {\n return [\n 'name' => __('carrier_sdek'),\n 'tracking_url' => 'https://new.cdek.ru/tracking?order_id=%s',\n ];\n }",
"public function getUrl()\n {\n return Mage::getUrl('magna_news', array('news_id' => $this->getId(), '_secure' => true));\n }",
"function getURL()\n {\n if (!empty($this->url)) {\n return $this->url;\n }\n if (!empty($this->canonical)) {\n return $this->canonical;\n }\n if (!$this->getSlug() && ($this->getID())) {\n return \\Idno\\Core\\site()->config()->url . 'moves/' . $this->getID() . '/' . $this->getPrettyURLTitle();\n } else {\n return parent::getURL();\n }\n }",
"public function getUrl()\n\t{\n\t\treturn App\\Purifier::decodeHtml($this->get('linkto'));\n\t}",
"private function getSelfUrl() : string\n {\n return \"/models/\" . $this->getId();\n }",
"function carton_update_order_item_meta( $item_id, $meta_key, $meta_value, $prev_value = '' ) {\n\treturn update_metadata( 'order_item', $item_id, $meta_key, $meta_value, $prev_value );\n}",
"public function getCarrierTrackingUrl()\n {\n return $this->carrierTrackingUrl;\n }",
"function getLink()\n {\n $url = $this->getPaypal();\n $link = 'https://'.$url.'/cgi-bin/webscr?';\n foreach($this->VARS as $item => $sub){\n $link .= $sub[0].'='.$sub[1].'&';\n }\n return $link;\n }",
"public function get_url() {\r\n\t\treturn $this->feed->get_url().\"/\".$this->id.\"/\".urlencode(strtolower($this->title));\r\n\t}",
"public static function my_custom_checkout_field_display_admin_order_meta($order){\r\n\t \r\n\t $customer_id = new Customer_ID_Model();\r\n\t $results = $customer_id->getUserProfile();\r\n\r\n\t $user_id = get_post_meta( $order->id, '_customer_user', true );\r\n\r\n\t foreach($results as $result){\r\n\t $user_image = $result->profile;\r\n\t }\r\n\t \r\n\t if (empty($user_image)) {\r\n\t $aid = get_user_meta( $user_id, 'get_avatar', true );\r\n\t $user_img = wp_get_attachment_image_src( $aid, $size = 'small', $icon = false)['0'];\r\n\t } else {\r\n\t $user_img = $user_image;\r\n\t }\r\n\t?>\r\n\t <p><strong>Government Issued ID:</strong></p>\r\n\t <span style=\"margin:20px 0 20px 0\" class=\"image mr-half inline-block\">\r\n\t <a href=\"<?php echo $user_img;?>\" data-lightbox=\"government issued id\" data-title=\"Customer Goverment Issued ID\"><img alt=\"\" src=\"<?php echo $user_img;?>\" class=\"avatar-photo avatar avatar-32 wp-user-avatar wp-user-avatar-32 alignnone photo avatar-default\" width=\"200\" height=\"140\"></a>\r\n\t </span>\r\n\t<?php \r\n }",
"public function getEditMetaDataLink()\n {\n return $this->get('EditMetaDataLink');\n }",
"public function getLink() {}",
"function order_action_print_label( $actions ) {\n global $theorder;\n\n // add custom action\n $dbh = new Database_Handler();\n $label = $dbh->get_labels_by_order_id($theorder->get_id(),false);\n if($label != null){\n $actions['print_label'] = __( 'Print shipping label', 'dhl_parcel_iberia_woocommerce_plugin' );\n $actions['print_return_label'] = __( 'Create and/or print return shipping label', 'dhl_parcel_iberia_woocommerce_plugin' );\n }\n return $actions;\n}",
"public function getOrderPlaceRedirectUrl()\n {\n return Mage::getUrl('pagseguro/payment/request');\n }",
"public function getDetailClickURL($model) {\n\t\treturn \"\";\n\t}",
"public function getUrlPrefix()\n {\n return Mage::getStoreConfig('catalog/dailydeal/url_prefix');\n }",
"function setOrderSend($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}",
"function trackback_url($deprecated_echo = \\true)\n {\n }",
"public function getTabLabel() {\r\n return Mage::helper('amlanding')->__('Links');\r\n }",
"public function __toString()\n {\n return '/creativestofollow';\n }",
"protected function column_uri( $item ) {\n\t\treturn esc_html( $item['uri_decoded'] ) . $this->column_actions( $item );\n\t}",
"public function getAdditionalInformation()\n {\n return 'Site: ' . ($this->site != null ? $this->site->getLabel() : '');\n }",
"public function getLink():string;",
"function build_variation_for_navigation_link($entity, $kind)\n {\n }"
] | [
"0.6307633",
"0.6083533",
"0.5896094",
"0.5883927",
"0.5879578",
"0.5864549",
"0.573474",
"0.5727756",
"0.57075554",
"0.5677518",
"0.5675195",
"0.5670191",
"0.5635197",
"0.56229335",
"0.55955774",
"0.55494887",
"0.5531778",
"0.55034",
"0.54773784",
"0.54507685",
"0.5442676",
"0.5410481",
"0.53978205",
"0.5391008",
"0.5387644",
"0.5370213",
"0.53651005",
"0.53586346",
"0.5349643",
"0.53365344",
"0.5329157",
"0.53256226",
"0.5323158",
"0.53192776",
"0.5304149",
"0.52996075",
"0.5299083",
"0.5299083",
"0.52979636",
"0.52967876",
"0.5293533",
"0.5286659",
"0.5273157",
"0.52726114",
"0.5267665",
"0.5265971",
"0.526498",
"0.5252388",
"0.52448833",
"0.5239738",
"0.52324605",
"0.52306724",
"0.52297896",
"0.522431",
"0.5223311",
"0.5212066",
"0.52044654",
"0.5203505",
"0.5200427",
"0.5194441",
"0.51815975",
"0.5177054",
"0.517598",
"0.5175858",
"0.5175839",
"0.5171312",
"0.51699615",
"0.51591486",
"0.51589423",
"0.51587725",
"0.51577556",
"0.51540685",
"0.51540685",
"0.51449984",
"0.51440966",
"0.5141291",
"0.51398724",
"0.51370794",
"0.51353353",
"0.5134942",
"0.51234853",
"0.5123323",
"0.51232743",
"0.5118833",
"0.5117974",
"0.5116027",
"0.51151925",
"0.5111395",
"0.50981206",
"0.50952417",
"0.50942343",
"0.5089373",
"0.50891674",
"0.5081572",
"0.5080902",
"0.50806886",
"0.50791854",
"0.5075149",
"0.5065637",
"0.5064556"
] | 0.60635555 | 2 |
Order Tracking reponse at View Order by Customer | function wcfm_order_tracking_response( $item_id, $item, $order ) {
global $WCFM, $WCFMu;
// See if product needs shipping
$product = $item->get_product();
$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product );
if( $WCFMu->is_marketplace ) {
if( $WCFMu->is_marketplace == 'wcvendors' ) {
if( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {
if( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;
} else {
if( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;
}
} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {
global $WCMp;
if( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;
}
}
if( $needs_shipping ) {
$traking_added = false;
$package_received = false;
foreach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {
if( $meta->key == 'wcfm_tracking_url' ) {
$traking_added = true;
}
if( $meta->key == 'wcfm_mark_as_recived' ) {
$package_received = true;
}
}
echo "<p>";
printf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );
if( $package_received ) {
printf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );
} elseif( $traking_added ) {
?>
<a href="#" class="wcfm_mark_as_recived" data-orderitemid="<?php echo $item_id; ?>" data-orderid="<?php echo $order->get_id(); ?>" data-productid="<?php echo $item->get_product_id(); ?>"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>
<?php
} else {
printf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );
}
echo "</p>";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n //we keep completed and refunded orders for 3 days in tracking section\n //so added below conditions\n // ->whereRaw('((status = ' . ORDER_COMPLETED .') OR (status = ' . ORDER_REFUNDED . '))')\n // ->where('updated_at', '<=', $time)\n \n //$time = date('Y-m-d, H:i:s', strtotime('-3 days'));\n $time = date('Y-m-d, H:i:s', strtotime('-3 minutes'));\n $orders = Order::where('customer_id', $this->current_customer->id)\n ->whereRaw('((status = ' . ORDER_COMPLETED .') OR (status = ' . ORDER_REFUNDED . '))')\n ->where('updated_at', '<=', $time)\n ->orderBy('created_at', 'desc')\n ->paginate(5);\n \n return $this->view('customer.orderList', compact('orders')); \n }",
"function orders() {\n\t \treturn $this->hook(\"/{$this->subject_slug}/v1/orders.xml?api_key={$this->api_key}\",\"order\");\n\t}",
"public function show(CustomerOrder $customerOrder)\n {\n //\n }",
"public function show(CustomerOrder $customerOrder)\n {\n //\n }",
"public function myOrder()\n {\n $orders = Order::where('served_by',auth()->user()->id)->get();\n return view('user.waiter.order.my-order',[\n 'orders' => $orders\n ]);\n }",
"public function order_delivered()\n { $orders = Order::with(['customer'])->where(['order_status'=>'delivered'])->orderBy('id','desc')->get()->toArray();\n return view('back.order.order_delivered')->withOrders($orders);\n }",
"public function show(Order $order)\n { \n //\n }",
"public function viewAction()\n {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n if (!$orderId) {\n $this->_redirect('sales/order/history');\n return;\n }\n\n $order = Mage::getModel('oscommerce/oscommerce')->loadOrderById($orderId);\n if ($order && $this->_canViewOrder($order['order'])) {\n Mage::register('current_oscommerce_order', $order);\n $this->loadLayout();\n if ($navigationBlock = $this->getLayout()->getBlock('customer_account_navigation')) {\n $navigationBlock->setActive('oscommerce/order/view');\n }\n \n $this->renderLayout();\n }\n else {\n $this->_redirect('sales/order/history');\n }\n }",
"public function show(Order $order)\n {\n //\n\n }",
"public function viewAction()\n {\n $this->loadLayout();\n $id = $this->getRequest()->getParam('id');\n $model = Mage::getModel('oggetto_oneclick/order')->load($id);\n Mage::register('order', $model);\n $this->renderLayout();\n }",
"function user_orders()\n {\n $data['fetch_category'] = $this->Admin_model->category();\n $data['fetch_sub_category'] = $this->Admin_model->sub_category();\n $data['accepted_projects'] = $this->Admin_model->accepted_projects();\n\n $data['fetch_tags'] = $this->Admin_model->fetch_tags();\n $data['basic_info'] = $this->Admin_model->basic_info();\n\n //...........for view page.................//\n $data['fetch_user_orders'] = $this->Admin_model->fetch_user_orders();\n\n $this->load->view('include/header', $data);\n $this->load->view('user_orders', $data);\n $this->load->view('include/footer', $data);\n }",
"public function view_orders()\n {\n $data['title'] = 'Orders';\n // Backend validation to check only restaurant should access view_orders section.\n if ($this->session->userdata('user_type') != null) {\n if ($this->session->userdata('user_type') == 0) {\n $user_id = $this->session->userdata('user_id');\n\n $data['orders'] = $this->food_model->get_orders($user_id);\n\n // Extracting name of users who ordered\n $data['uname'] = [];\n for ($x = 0; $x <= count($data['orders']) - 1; $x++) {\n $name = $this->food_model->get_name($data['orders'][$x]['people_id']);\n array_push($data['uname'], $name);\n }\n\n // Extracting email of user who ordered\n $data['email'] = [];\n for ($x = 0; $x <= count($data['orders']) - 1; $x++) {\n $name = $this->food_model->get_email($data['orders'][$x]['people_id']);\n array_push($data['email'], $name);\n }\n\n $this->load->view('templates/header');\n $this->load->view('foods/view_orders', $data);\n $this->load->view('templates/footer');\n } else {\n print_r('Sorry a user cannot view orders, :(');\n }\n } else {\n redirect('users/login');\n }\n }",
"function orders()\n\t\t{\n\t\t\tif ( ! $this->data['user'])\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('You must login to view orders.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t// The load/save/delete cart data functions require the flexi cart ADMIN library.\n\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t// Get an array of all saved orders. \n\t\t\t// Using a flexi cart SQL function, set the order the order data so that dates are listed newest to oldest.\n\t\t\t$this->flexi_cart_admin->sql_where($this->flexi_cart_admin->db_column('order_summary', 'user'), $this->data['user']->id);\n\t\t\t$this->flexi_cart_admin->sql_order_by($this->flexi_cart_admin->db_column('order_summary', 'date'), 'desc');\n\t\t\t$this->data['order_data'] = $this->flexi_cart_admin->get_db_order_query()->result_array();\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('public/dashboard/orders_view', $this->data);\n\t\t}",
"private function orders()\n {\n //$query=\"SELECT a.orderid, a.OrderNo,ordersource,b.customername,a.customerid FROM `order` as a left join customer as b on a.customerid= b.customerid \";\n\t\t\t$query=\"SELECT a.*,b.customername from `order` as a left join customer as b on a.customerid= b.customerid \";\n\t\t\t$r = $this->mysqli->query($query) or die($this->mysqli->error.__LINE__);\n\t\t\tif($r->num_rows > 0)\n {\n\t\t\t\t$result = array();\n\t\t\t\twhile($row = $r->fetch_assoc()){\n\t\t\t\t\t$result[] = $row;\n\t\t\t\t }\n \n\t\t\t $this->response($this->json($result), 200); // send user details\n }\n\t\t}",
"public function history()\n\t{\n $orders = $this->history->get_history();\n foreach($orders as $order)\n {\n if($order->added_by=='customer')\n {\n $agency_id = $this->Common->get_details('agency_orders',array('order_id'=>$order->order_id))->row()->agency_id;\n $agency_check = $this->Common->get_details('agencies',array('agency_id'=>$agency_id));\n if($agency_check->num_rows()>0)\n {\n $order->agency = $agency_check->row()->agency_name;\n }\n else\n {\n $order->agency = '';\n }\n }\n }\n $data['orders'] = $orders;\n\t\t$this->load->view('admin/bill/history',$data);\n\t}",
"public function clientorders(){\n\n //orders information\n $this->loadData(Orders::getOrder($_SESSION[\"userId\"]), \"oOrders1\");\n if(Orders::getOrder($_SESSION[\"userId\"])){\n //last order information\n foreach ($this->oOrders1 as $order1){ \n $this->loadData(OrdersproductsDetails::getOrderProductD($order1->id), \"oOrders\");\n //load list of orders each time\n $this->loadView(\"views/cmsOrders.php\", 1, \"list\"); \n } \n } \n \n //load list of orders\n //$this->loadView(\"views/cmsOrders.php\", 1, \"list\"); \n //user information\n $this->loadData(User::getCurrent(), \"oCurUser\");\n //load the header\n $this->loadView(\"views/header.php\", 1 ,\"header\"); \n //load the admin final view\n $this->loadLastView(\"views/cmsClient.php\"); \n $this->loadLastView(\"views/main.php\"); \n }",
"public function show(Order $order)\n {\n\n }",
"public function view_order()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$this->data['heading'] = 'View Order';\n\t\t\t$user_id = $this->uri->segment(4, 0);\n\t\t\t$deal_id = $this->uri->segment(5, 0);\n\t\t\t$this->data['ViewList'] = $this->order_model->view_orders($user_id, $deal_id);\n\t\t\t$this->load->view('admin/order/view_orders', $this->data);\n\t\t}\n\t}",
"public function orders($customerId)\n {\n return view($this->_config['view'], compact('customerId'));\n }",
"public function trackOrder($trackingNo);",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(Order $order)\n {\n //\n }",
"public function show(order $order)\n {\n //\n }",
"public function admin_order()\n {\n /*return view('admin_order');*/\n $orders = Scrap_order::get();\n return view('admin_order', ['orders' => $orders]);\n }",
"function __getOrders(){\n \t\t\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\t\t\n\t\t$customer_id = ($this->uri->segment(4)) ? $this->uri->segment(4) : $this->session->userdata['pos_customer_id'];\n\t\t\n\t\t\n\t\t//get results\n\t\t$this->data['reg_blocks'][] = 'orders';\n\t\t$this->data['blocks']['orders'] = $this->orders_model->getCustomerOrderhistory($customer_id);\n\t\t$this->data['debug'][] = $this->orders_model->debug_data;\n\t\t\n\t\t\n\t\t$orderhistory = array();\n\t\tif(count($this->data['blocks']['orders']) > 0)\n\t\t{\n\t\t\tforeach($this->data['blocks']['orders'] as $orders)\n\t\t\t{\n\t\t\t\t$odate=date('Y-m-d',strtotime($orders['order_time']));\n\t\t\t\t$orderhistory[$odate][]=$orders;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$customerorderdetails='';\n\t\tif(count($orderhistory) > 0)\n\t\t{\n\t\t\tforeach($orderhistory as $odate=>$orderitems)\n\t\t\t{\n\t\t\t\t$datetitle=date('l, jS F Y',strtotime($odate));\n\t\t\t\t$customerorderdetails.='<div class=\"row\">\n\t\t\t\t<div class=\"col-md-12 alphabet\">'.$datetitle.'</div>';\n\t\t\t\tif(count($orderitems) > 0)\n\t\t\t\t{\n\t\t\t\t\tforeach($orderitems as $oitems)\n\t\t\t\t\t{\n\t\t\t\t\t\t$o_time=$datetitle=date('H:i',strtotime($oitems['order_time']));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$company = ($oitems['type'] == 'shop') ? $oitems['partner_branch'] : $this->data['settings_company']['company_name'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$branch = ($company == $this->data['settings_company']['company_name']) ? '('.$company .')': (($company != $this->session->userdata['partner_branch_name']) ? '('.$company .')' : ''); \n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$amount = ($oitems['changed_amount']!='') ? $oitems['changed_amount'] : $oitems['total_amount'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$customerorderdetails.='<div class=\"order-list row\">\n\t\t\t\t\t\t<div class=\"col-md-9\">\n\t\t\t\t\t\t<p><a href=\"'.$this->data['vars']['site_url'].'admin/orders/'.$oitems['id'].'\"><span class=\"green-text\"> #'.$oitems['id'].' '.$branch.'</span></a> kr '.$amount.'\n\t\t\t\t\t\t</p>\n\t\t\t\t\t </div> \n\t\t\t\t\t <div class=\"col-md-3 text-right\">\n\t\t\t\t\t\t<p>'.$o_time.'</p>\n\t\t\t\t\t </div>\n\t\t\t\t\t\t</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$customerorderdetails.='</div>';\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$this->data['lists']['customerorderdetails']=$customerorderdetails;\n\t\t\n\t\t $subscription = $this->payments_model->getSaldostatus($customer_id);\n\t\t\n\t\t\n\t\t$data=$this->customer_model->getCustomerinfo($customer_id);\n\n\t\t\n\t\n\t\tif(intval($subscription) > 0)\n\t\t{\n\t\t\n\t\t\t$this->data['lists']['subscription']=' <input onclick=\"checkAbonnement();\" type=\"radio\" value=\"Ja\" class=\"form-control\" checked name=\"subscribe\" > Ja \n\t\t\t <input type=\"radio\" value=\"Nei\" onclick=\"checkAbonnement();\" class=\"form-control\" name=\"subscribe\" >Nei';\n\t\t\t \n\t\t\t if($data['invoicestatus'] == '1')\n\t\t\t {\n\t\t\t\t$this->data['lists']['subscription1']=' <input onclick=\"checkfaktura();\" type=\"radio\" value=\"Ja\" class=\"form-control\" checked name=\"subscribe1\" > Ja \n\t\t\t <input type=\"radio\" value=\"Nei\" onclick=\"checkfaktura();\" class=\"form-control\" name=\"subscribe1\" >Nei';\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t$this->data['lists']['subscription1']=' <input onclick=\"checkfaktura();\" type=\"radio\" value=\"Ja\" class=\"form-control\" name=\"subscribe1\" > Ja <input type=\"radio\" value=\"Nei\" checked onclick=\"checkfaktura();\" class=\"form-control\" name=\"subscribe1\" >Nei';\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data['lists']['subscription']=' <input type=\"radio\" onclick=\"checkAbonnement();\" value=\"Ja\" class=\"form-control\" name=\"subscribe\" > Ja \n\t\t\t <input type=\"radio\" value=\"Nei\" checked onclick=\"checkAbonnement();\" class=\"form-control\" name=\"subscribe\" >Nei';\n\t\t\t \n\t\t\t if($data['invoicestatus'] == '1')\n\t\t\t {\n\t\t\t\t$this->data['lists']['subscription1']=' <input onclick=\"checkfaktura();\" type=\"radio\" value=\"Ja\" class=\"form-control\" checked name=\"subscribe1\" > Ja \n\t\t\t <input type=\"radio\" value=\"Nei\" onclick=\"checkfaktura();\" class=\"form-control\" name=\"subscribe1\" >Nei';\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t$this->data['lists']['subscription1']=' <input onclick=\"checkfaktura();\" type=\"radio\" value=\"Ja\" class=\"form-control\" name=\"subscribe1\" > Ja <input type=\"radio\" value=\"Nei\" checked onclick=\"checkfaktura();\" class=\"form-control\" name=\"subscribe1\" >Nei';\n\t\t\t }\n\t\t}\n\t\t\n\t\t\tif($data['autofil_invoice'] == '')\n\t\t\t{\n\t\t\t\t$this->data['lists']['fakturaoption']='<select name=\"autofil_faktura_sel\" onchange=\"checkFakturaValue(this.value);\" id=\"autofil_faktura_sel\"><option value=\"Ja\">Ja</option><option selected value=\"Nei\" >Nei</option></select>';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->data['lists']['fakturaoption']='<select name=\"autofil_faktura_sel\" onchange=\"checkFakturaValue(this.value);\" id=\"autofil_faktura_sel\"><option selected value=\"Ja\">Ja</option><option value=\"Nei\" >Nei</option></select>';\n\t\t\t}\n\t\t\t\n\n\t\t\n\t\tif(count($this->data['blocks']['orders'])> 0){\n\t\t\t$this->data['visible']['wi_customer_orders'] = 1;\n\t\t}\n\t\telse{\n\t\t\t$this->data['visible']['wi_orders_none'] = 1;\n\t\t}\n\t }",
"public function orders()\n\t{\n $me = Auth::user();\n $adverts = Advert::where('owner_id', '=', $me->id)->paginate(20);\n\n return View::make('adverts.orders', [\n 'me' => $me,\n 'adverts' => $adverts,\n ]);\n\t}",
"public function woocommerce_reports_customer_overview_customer_orders($orders) {\n\t}",
"public function orderInfo($increment_id){\n $result = $this->data['client']->salesOrderInfo($this->data['session'], $increment_id);\n \n return $result;\n}",
"public function order_show()\n {\n //\n $orders = Order::all();\n \n return view('productions.order_show',['orders' => $orders,]);\n }",
"public function showOrderList() {\n\n $orders = history::orderBy('customer_id')->orderBy('command_at','desc')->paginate(10);\n return view('admin.orderList',compact('orders'));\n }",
"public function orders()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //get the user's orders\n $buyorders = TradesModel::OpenOrders('buy');\n $sellorders = TradesModel::OpenOrders('sell');\n\n $this->View->RenderPage_sidebar('dashboard/orders', ['buyorders' => $buyorders, 'sellorders' => $sellorders]);\n }",
"public function index()\n {\n $customerOrder = CustomerOrder::all();\n return view('customerOrder')->with($customerOrder);\n }",
"public function viewOrders(){\n\n $orders=UserOrder::with('get_order_details.get_product_details.get_images')->where('status','<>','cancelled')->get();\n\n return view('frontend.view_orders',['configurations'=>$this->configuration,'orders'=>$orders]);\n }",
"public function order()\n {\n //加载用户下订单页面\n return view('Home/Order/order') ;\n }",
"public function index()\n {\n $orders = Auth::user()->orders;\n\n return view('customer.dashboard.order.index', compact('orders'));\n }",
"public function vieworderAction() {\n /**\n * Initilize customer and seller group id\n */\n $customerGroupId = $sellerGroupId = $customerStatus = '';\n /**\n * Get customerid,groupid and seller status.\n */\n $customerGroupId = Mage::getSingleton ( 'customer/session' )->getCustomerGroupId ();\n $sellerGroupId = Mage::helper ( 'marketplace' )->getGroupId ();\n $customerStatus = Mage::getSingleton ( 'customer/session' )->getCustomer ()->getCustomerstatus ();\n $returnFlag = 0;\n /**\n * Check the seller login.\n */\n if (! Mage::getSingleton ( 'customer/session' )->isLoggedIn () && $customerGroupId != $sellerGroupId) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You must have a Seller Account to access this page' ) );\n $returnFlag = 1;\n }\n /**\n * Checking whether customer approved or not\n */\n if ($customerStatus != 1) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'Admin Approval is required. Please wait until admin confirms your Seller Account' ) );\n $returnFlag = 1;\n }\n if ($returnFlag == 1) {\n $this->_redirect ( 'marketplace/seller/login' );\n return false;\n }\n /**\n * Get the order id from the parms value.\n */\n $orderId = $this->getRequest ()->getParam ( 'orderid' );\n /**\n * Get the product details based on the orderid.\n */\n $orderPrdouctIds = Mage::helper ( 'marketplace/vieworder' )->getOrderProductIds ( Mage::getSingleton ( 'customer/session' )->getId (), $orderId );\n if (count ( $orderPrdouctIds ) <= 0) {\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n /**\n * Get ordered collection.\n */\n $collection = Mage::getModel ( 'marketplace/commission' )->getCollection ()->addFieldToFilter ( 'seller_id', Mage::getSingleton ( 'customer/session' )->getId () )->addFieldToFilter ( 'order_id', $orderId )->getFirstItem ();\n /**\n * Check orderid from the order collection.\n */\n if (count ( $collection ) >= 1 && $collection->getOrderId () == $orderId) {\n /**\n * load and render layout\n */\n $this->loadLayout ();\n $this->getLayout ()->getBlock ( 'head' )->setTitle ( $this->__ ( 'View Order' ) );\n $this->renderLayout ();\n } else {\n /**\n * Check the errors, when internal error occured in view order.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }",
"function orders(){\r\n \tif($this->session->userdata('logged_in')){\r\n\t\t\t//Header Data\r\n\t\t\t$session_data = $this->session->userdata('logged_in');\r\n\t\t\tif($session_data['username'] === \"admin\"){\r\n\t\t\t\t$headerData['title']=\"Admin - Orders\";\r\n\t\t\t\t$headerData['nav']='orders';\r\n\t\t\t\t//Page Data\r\n\t\t\t\t$this->load->model('order_model');\r\n\t\t\t\t$orders = $this->order_model->getAll();\r\n\t\t\t\t$data['orders']=$orders;\r\n\t\t\t\t//Views\r\n\t\t\t\t$this->load->view('templates/admin_header.php',$headerData);\r\n\t\t\t\t$this->load->view('admin/order_list.php',$data);\r\n\t\t\t\t$this->load->view('templates/admin_footer.php');\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tredirect('candystore', 'refresh');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\tredirect('/user/login', 'refresh');\r\n\t\t}\r\n }",
"public function show(Order $orders)\n {\n //\n }",
"public function view_orders()\n\n {\n $itemData['item'] = Product::getorderItem();\n\n $data = ['itemData' => $itemData];\n\n return view('admin.orders')->with($data);\n }",
"public function optionsAction() {\n\n $request = $this->getRequest();\n $orderId = (integer) $request->getParam('orderId', 0);\n\n $order = null;\n //try to find according to customerId\n if ($orderId > 0) {\n try {\n $order = new Yourdelivery_Model_Order($orderId);\n } catch (Yourdelivery_Exception_Database_Inconsistency $e) {\n \n }\n }\n \n $this->view->order = $order;\n }",
"public function show(Order $order)\n {\n $user = $order->whereHas('client')->with('client')->get();\n\n return $this->showAll('order',$user);\n }",
"public function customer() {\n $this->access_lib->_is(\"adm,mgr\");\n\n $data['header'] = $this->header;\n\n $this->load->view('report_customer_v', $data);\n }",
"public function activeOrders()\n {\n }",
"public function show(orders $orders)\n {\n //\n }",
"public function show($id)\n {\n $cont = new RestController();\n $order = $cont->getRequest('Orders(' . $id . ')?$expand=OrderFieldValue($expand=OrderField),' .\n 'OrderProduct($expand=Product),OrderProductPackage($expand=ProductPackage($expand=Product),Products($expand=Product),Country),' .\n 'ClientAlias($expand=Contact,Country,Client($select=Id,CINumber,ClientManager_Id;$expand=ClientManager($select=FullName))),' .\n 'User($select=FullName,UserName),' .\n 'ApprovedBy($select=UserName),'.\n 'Invoice,Contracts($expand=Product($select=Name),User($select=FullName,UserName),Manager($select=FullName,UserName),Country($select=CountryCode))');\n if ($order instanceof View) {\n return $order;\n }\n if(!empty($order->OrderProductPackage)){\n //getting the addons products because we can't do it in the query\n foreach ($order->OrderProductPackage as $k => $val) {\n $product = $cont->getRequest(\"Products(\" . $val->ProductPackage->Product_Id . \")\");\n if (!$product instanceof View) {\n $order->OrderProductPackage[$k]->ProductPackage->Product = $product;\n }\n }\n }\n\n //get the contracts that came from this order\n $contractsResult = $cont->getRequest(\"Orders($id)/action.Contracts\".'?$expand=User($select=Id,FullName),Manager($select=Id,FullName),OriginalOrder($select=Id),Product($select=Name),Country($select=CountryCode)');\n if(!$contractsResult instanceof View){\n $order->Contract = $contractsResult->value;\n }else{\n $order->Contract = null;\n }\n if(!$this->isOwner($order)){\n return view('errors.denied');\n }\n //merge order products and order product packages , so we support both old and new orders\n $order->OrderProductPackage = array_merge($order->OrderProductPackage,$order->OrderProduct);\n $paymenTerms = $cont->getEnumProperties(['ContractTerms']);\n $paymenTerms = isset($paymenTerms['ContractTerms']) ? $paymenTerms['ContractTerms'] : [];\n\n //put the hashcode for a js\n JavaScriptFacade::put(['Hashcode' => $order->HashCode,'paymentTerms' => $paymenTerms]);\n //add the months corresponding to each OrderProduct payment term\n\n $contractTerms = $cont->getEnumProperties(['ContractTerms']);\n\n foreach ($order->OrderProduct as $k => $val) {\n $paymentTerms = array_search($val->PaymentTerms, $contractTerms['ContractTerms']);\n $order->OrderProduct[$k]->Months = $paymentTerms;\n }\n\n $clientManagers = UsersController::listByRoles(['Client Manager']);\n\n $order->OrderFieldValue = $this->groupOrderFieldValues($order->OrderFieldValue);\n return view('orders.show',compact('order', 'cont','clientManagers'));\n }",
"public function index()\n {\n $orders = Order::where('status','=',Order::NEW)->with(\"client\")->get();\n return $this->showAll('orders',$orders);\n }",
"public function index() {\n $this->show_order();\n }",
"public function getOrdersForCustomer($customerId);",
"public function index() {\n $orders = $this->order->findWhere([\n 'audience_id' => auth()->guard('audience')->user()->id\n ]);\n\n return view($this->_config['view'], compact('orders'));\n }",
"public function actionOrders(){\n\t\t$orders = $this->_getOrderModel()->getAllOrder();\n\t\t\n\t\t$viewParams = array(\n\t\t\t'orders' => $orders\n\t\t);\n\t\t\n\t\treturn $this -> responseView('DTUI_ViewPublic_EntryPoint_Orders','dtui_order_list',$viewParams);\n\t}",
"function viewCustDelivery(){\n $data['customerList']=$this->deliveryAndPickupModel->viewDelivery();\n $this->load->view('deliveryAndPickupView/delivery', $data);\n\t}",
"public function order_inserted_data($order_id)\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_admin_auth();\n\t\t$CI->load->library('Lorder');\n\t\t$content = $CI->lorder->order_html_data($order_id);\t\n\t\t$this->template->full_admin_html_view($content);\n\t}",
"public function orders()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n $orderModel = new OrderModel();\n\n $orders = $orderModel->ordersByUserId(Session::get('userId'));\n\n $this->data['ordersInfo'] = $orders;\n\n if ($orders) {\n\n $productArrays = array();\n\n foreach ($orders as $order) {\n\n $productArrays[$order['id']] = json_decode($order['products'], true);\n }\n\n $this->data['idsAndAmountsByOrder'] = $productArrays;\n\n foreach ($productArrays as $product) {\n\n foreach ($product as $productId => $amount) {\n\n $productIdAndAmount[$productId] = $amount;\n }\n }\n\n $dataForIdsString = array_keys($productIdAndAmount);\n\n $idsString = implode(', ', $dataForIdsString);\n\n if ($idsString) {\n\n $productModel = new ProductModel();\n\n $productsInfo = $productModel->getProductsByIds($idsString);\n\n $this->data['productsInfo'] = $productsInfo;\n }\n\n }\n \n $this->render('orders');\n }",
"public function index()\n {\n return view('marchant.orders.order');\n }",
"public function view_order_report(){\n\t\t$data['order_table'] = $this->db->query('select * from order_table')->result();\n\t\t$this->load->view('admin/view_order_report',$data);\n\t}",
"public function show() //(Order $order)\n {\n $data = Orders::all();\n return view('seller/viewOrders', ['orders'=>$data]);\n \n }",
"public function listOrder()\n {\n //\n $orders = Order::where('user_id','=',Auth::user()->id)->get();\n //dd($orders);\n return view('orders.list-order',compact('orders'));\n }",
"public function trackOrder()\n {\n $tasks = TaskModel::orderBy('id', 'desc')->get();\n return view('FrontEnd.trackOrder', compact('tasks'));\n }",
"public function show(Orders $orders)\n {\n //\n }",
"public function show(Orders $orders)\n {\n //\n }",
"public function show(Orders $orders)\n {\n //\n }",
"public function index()\n {\n\t\t$orders = Order::where('group', Auth::user()->group)->orderBy('created_at', 'asc')->with('payment', 'customer')->get()->all();\n\t\t\n return view('order.index', ['orders' => $orders]);\n }",
"public function index()\n {\n $this->paginate = [\n 'limit' => 15,\n 'order' => [\n 'Orders.Created' => 'Desc'\n ]\n ];\n\n $query = $this->Orders->find('all')\n ->where(['User_IdUser = ' => $this->Auth->user('idUser')]);\n $query = $this->paginate($query);\n $this->set('orders',$query);\n }",
"public function order()\n {\n return view('purchasing/orderpembelian/order');\n }",
"public function dashboard() {\n\t\tif( Session::get(\"logged_in_as\") !== \"customer\" ) {\n\t\t\treturn Router::redirect(\"login\");\n\t\t}\n\t\t$order_model = new OrdersModel($this->db);\n\t\t$username = Session::get(\"logged_in_username\");\n\t\tif( @$_POST ) {\n\t\t\t$order_id = (int) $_POST[\"order_id\"];\n\t\t\t$order_model->delete($order_id);\n\t\t}\n\t\t// $orders = $order_model->get_order_by(\"user\", $username);\n\t\t$orders = $order_model->get(\"booked_by\", $username);\n\t\t$res = [];\n\t\t$vehicle_model = new VehicleModel($this->db);\n\t\tforeach( $orders as $order) {\n\t\t\t$res[$order[\"id\"]] = $order;\n\t\t\t$res[$order[\"id\"]][\"vehicle\"] = $vehicle_model->get_vehicle_by(\"id\", $order[\"vehicle_id\"]);\n\t\t\t$res[$order[\"id\"]][\"vehicle\"][\"meta\"] = $vehicle_model->get_vehicle_meta($order[\"vehicle_id\"]);\n\t\t}\n\t\t$props = [\"orders\" => $res];\n\t\treturn $this->render(\"customer/dashboard.twig\", $props);\n\t}",
"public function orders_view($app, $collection_id = null, $order_id = null) {\n\t\t//View order\n\t\t$order = Elementorder::getOrderWithElements($order_id);\n\n\t\treturn $app->toJSON($order, true, $order ? self::CODE_OK : self::CODE_NOTFOUND);\n\t}",
"protected function list_orders() {\r\n // Get response\r\n $dt = new DataTableResponse( $this->user );\r\n\r\n $website_order = new WebsiteOrder();\r\n\r\n // Set Order by\r\n $dt->order_by( '`website_order_id`', '`total_cost`', '`status`', '`date_created`' );\r\n $dt->add_where( ' AND `website_id` = ' . (int) $this->user->account->id );\r\n $dt->search( array( '`website_order_id`' => false ) );\r\n\r\n // Get items\r\n $website_orders = $website_order->list_all( $dt->get_variables() );\r\n $dt->set_row_count( $website_order->count_all( $dt->get_count_variables() ) );\r\n\r\n // Set initial data\r\n $data = false;\r\n\r\n /**\r\n * @var WebsiteOrder $order\r\n */\r\n if ( is_array( $website_orders ) )\r\n foreach ( $website_orders as $order ) {\r\n switch ( $order->status ) {\r\n case WebsiteOrder::STATUS_DECLINED:\r\n $status = 'Declined';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PURCHASED:\r\n $status = 'Purchased';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_PENDING:\r\n $status = 'Pending';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_DELIVERED:\r\n $status = 'Delivered';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_RECEIVED:\r\n $status = 'Received';\r\n break;\r\n\r\n case WebsiteOrder::STATUS_SHIPPED:\r\n $status = 'Shipped';\r\n break;\r\n\r\n default:\r\n $status = 'Error';\r\n break;\r\n }\r\n\r\n $date = new DateTime( $order->date_created );\r\n\r\n $link_text = '';\r\n if ( $order->is_ashley_express() ) {\r\n $link_text = \" - Express Delivery\";\r\n }\r\n\r\n $data[] = array(\r\n '<a href=\"' . url::add_query_arg( 'woid', $order->id, '/shopping-cart/orders/view/' ) . '\" title=\"' . _('View') . '\">' . $order->id . '</a>' . $link_text\r\n , $order->name\r\n , '$' . number_format( $order->total_cost, 2 )\r\n , $status\r\n , $date->format('F jS, Y')\r\n );\r\n }\r\n\r\n // Send response\r\n $dt->set_data( $data );\r\n\r\n return $dt;\r\n }",
"public function actionOrder()\r\n {\r\n $searchModel = new LogisticsOrderSearch();\r\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\r\n if (Yii::$app->request->get('download_type', '0')) {\r\n return $this->_downloadExcel($dataProvider);\r\n }\r\n \r\n $driver = new Driver();\r\n $driverList = $driver->getDriverDropList();\r\n \r\n //统计代码\r\n $count['order_num'] = $searchModel->getEmployeeOrderNum($searchModel->search(Yii::$app->request->queryParams));\r\n $count['goods_num'] = $searchModel->getEmployeeGoodsNum($searchModel->search(Yii::$app->request->queryParams));\r\n $count['price'] = $searchModel->getEmployeePrice($searchModel->search(Yii::$app->request->queryParams));\r\n $count['price_count'] = $searchModel->getEmployeePriceCount($searchModel->search(Yii::$app->request->queryParams));\r\n $count['same_city_order'] = $searchModel->getEmployeeSameCityOrder($searchModel->search(Yii::$app->request->queryParams));\r\n $count['same_city_goods'] = $searchModel->getEmployeeSameCityGoods($searchModel->search(Yii::$app->request->queryParams));\r\n $count['same_city_price'] = $searchModel->getEmployeeSameCityPrice($searchModel->search(Yii::$app->request->queryParams));\r\n $count['same_city_price_count'] = $searchModel->getEmployeeSameCityPriceCount($searchModel->search(Yii::$app->request->queryParams));\r\n\r\n return $this->render('order', [\r\n 'searchModel' => $searchModel,\r\n 'dataProvider' => $dataProvider,\r\n 'menus' => $this->_getMenus(),\r\n 'count' => $count,\r\n 'driverList' => $driverList\r\n ]);\r\n \r\n }",
"public function actionWalmartorderinfo()\n {\n $status = false;\n if (isset($_GET['status'])) {\n $status = $_GET['status'];\n }\n $merchant_id = MERCHANT_ID;\n $test = false;\n $prev_date = date('Y-m-d', strtotime(date('Y-m-d') . ' -2 month'));\n $config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi($config['consumer_id'], $config['secret_key']);\n if ($status) {\n $orderdata = $walmartHelper->getOrders(['status' => $status, 'limit' => '100', 'createdStartDate' => $prev_date], Walmartapi::GET_ORDERS_SUB_URL, $test);\n } else {\n $orderdata = $walmartHelper->getOrders(['limit' => '100', 'createdStartDate' => $prev_date], Walmartapi::GET_ORDERS_SUB_URL, $test);\n }\n\n print_r($orderdata);\n die;\n }",
"public function orders($request, $response) {\n $params = array( 'title' => 'All Orders',\n\t\t 'current_url' => $request->getUri()->getPath());\n return $this->render($response, ADMIN_VIEW.'/Order/orders.twig',$params);\n }",
"public function viewAllOrders()\n {\n $customers = [];\n $orders = Order::paginate(30);\n if ($orders->count()) {\n foreach ($orders as $order) {\n $allCustomerId[] = $order->userId;\n }\n // to remove duplicates\n $customerId = array_unique($allCustomerId);\n // to renumber the array index after using array_unique() i.e after using array_unique() the array may look like\n // index => value\n // 0 => 1\n // 2 => 3\n // 7 => 9\n // to fix this we use array_values()\n // which will give the result\n // index => value\n // 0 => 1\n // 1 => 3\n // 2 => 9\n $arrangedCustomerId = array_values($customerId);\n for ($i = 0; $i < count($arrangedCustomerId); $i++) {\n $customers[$i] = User::whereId($arrangedCustomerId[$i])->first();\n }\n }\n return view('admin.orders.viewAllOrders', compact('orders', 'customers'));\n }",
"public function getCustomerOrders()\n {\n $customer = auth()->user();\n $orders = Order::where('customer_id', $customer->getKey())->get();\n\n return response()->json($orders->transform(function($order) use ($customer) {\n return [\n 'order_id' => $order->order_id,\n 'total_amount' => $order->total_amount,\n 'created_on' => $order->created_on,\n 'shipped_on' => $order->shipped_on,\n 'name' => $customer->name,\n ];\n }));\n }",
"function getOrder()\n{\n\n}",
"public function viewAction() {\n\n try {\n \n $pageHeading = \"Order-Information\";\n $this->view->page_heading = $pageHeading;\n $this->view->data_page = \"tables\";\n \n $orderId = $this->_request->getParam('id');\n $objOrderService = new Base_Model_Lib_Order_Service_Order();\n $objOrderEntity = new Base_Model_Lib_Order_Entity_Order();\n $orderInformation = $objOrderService->getOrder($orderId);\n $this->view->orderInformation = $orderInformation;\n \n $status = $this->_request->getParam('status');\n $newStatus = $this->_request->getParam('new-status');\n $this->view->status = $status;\n $this->view->newStatus = $newStatus;\n \n if ($this->_request->isPost()) {\n \n $selectedOrderId = $this->getRequest()->getPost('txtOrderId'); \n $orderStatus = $this->getRequest()->getPost('bthUpdateOrder');\n if($orderStatus == 'Cancel_Refund'){\n $orderStatus = 'Cancelled'; \n } else {\n $orderStatus = $orderStatus;\n }\n \n if($orderStatus != 'Delete'){\n $logMessage = \"The order status has changed as '$orderStatus' for the order #$selectedOrderId by $currentUserName\";\n $operationType = \"STATUS_CHANGED\";\n $objOrderEntity->setId($selectedOrderId);\n $objOrderEntity->setStatus($orderStatus);\n $objOrderService->order = $objOrderEntity;\n $objOrderService->updateOrderStatus();\n \n } else {\n $logMessage = \"The order #$selectedOrderId has been deleted by $currentUserName\";\n $operationType = \"DELETE_RECORD\"; \n $objOrderEntity->setId($selectedOrderId);\n $objOrderService->order = $objOrderEntity;\n $objOrderService->deleteItem();\n }\n \n \n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n $currentUserName = $this->getCurrentUserInfo()->getFirstName();\n $objUserOperationService = new Base_Model_Lib_User_Service_UserOperation();\n $objUserOperationEntity = new Base_Model_Lib_User_Entity_UserOperation();\n $objUserOperationEntity->setUserId($this->getCurrentUserId());\n $objUserOperationEntity->setTableName(\"tbl_orders\");\n $objUserOperationEntity->setKeyId($orderId);\n $objUserOperationEntity->setOperationType($operationType);\n $objUserOperationEntity->setOperationDate($this->getSystemDateTime());\n $objUserOperationEntity->setMessage($logMessage);\n $objUserOperationService->userOperation = $objUserOperationEntity;\n $objUserOperationService->addUserOperation();\n //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n if($orderStatus != 'Delete'){\n $this->_redirect('/admin/order/view/id/'.$orderId.'/?status=edited&new-status='.$orderStatus);\n } else {\n $this->_redirect('/admin/order/?status=deleted');\n }\n \n }\n \n \n } catch (Exception $ex) {\n throw new Exception('<ERROR>' . $ex->getMessage() . \"\\n\");\n }\n }",
"protected function doActionSendTracking()\n {\n \\XLite\\Core\\Mailer::sendOrderTrackingInformationCustomer($this->getOrder());\n\n \\XLite\\Core\\TopMessage::addInfo('Tracking information has been sent');\n }",
"public function index()\n {\n $orders = Order::buyer(auth()->id())->paginate(10);\n $salescount = Order::salescount(auth()->id());\n\n return view('frontend.order.index', compact('orders', 'salescount'));\n }",
"public function index()\n {\n if(\\Auth::user()->type =='admin'){\n $orders = Order::all()->sortByDesc(\"created_at\");\n } else {\n $orders = Order::where('user_id', \\Auth::user()->id)->get();\n }\n \n return view('order.index', ['orders'=>$orders]);\n }",
"public function order_tracking($ordercode=\"\")\r\n\t{\r\n\t\t// echo $ordercode;die();\r\n\t\t$ordercode = $this->input->get('ordercode');\r\n\t\tif (!empty($_SESSION['olouserid'])) {\r\n\t\t\t$response = [];\r\n\t\t\t$orders = $this->orderlib->getOrderDetails($ordercode);\r\n\t\t\t// print_r($orders); die();\r\n\r\n\t\t\tif (!empty($orders)) {\r\n\t\t\t\t$data['order'] = $orders[0];\r\n\t\t\t\t$response['status_view'] = $this->load->view('order-status-view', $data, TRUE);\r\n\r\n\t\t\t\t$response['rd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t$response['rd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t$response['vd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t$response['vd_lg'] = $orders[0]['vendor_longitude'];\r\n\r\n\t\t\t\tif ($orders[0]['ride_type'] == 1) {\r\n\t\t\t\t\tif ($orders[0]['rider_response'] >= 0 && $orders[0]['rider_response'] <= 2) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t} else if ($orders[0]['rider_response'] == 3) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['rider_latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['rider_longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t} else if ( $orders[0]['rider_response'] == 4) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t} else if ($orders[0]['rider_response'] == 5) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['rider_latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['rider_longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t} else if ($orders[0]['rider_response'] == 6) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if ($orders[0]['ride_type'] == 2){\r\n\t\t\t\t\tif ($orders[0]['delivery_rider_response'] >= 0 && $orders[0]['delivery_rider_response'] <= 2) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t} else if ($orders[0]['delivery_rider_response'] == 3) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['rider_latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['rider_longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t} else if ( $orders[0]['delivery_rider_response'] == 4) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t} else if ($orders[0]['delivery_rider_response'] == 5) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['rider_latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['rider_longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t} else if ($orders[0]['delivery_rider_response'] == 6) {\r\n\t\t\t\t\t\t$response['rd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['rd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t\t$response['vd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t\t$response['vd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if ($orders[0]['ride_type'] == 0 && $orders[0]['rider_response'] == 6 && $orders[0]['delivery_rider_response'] == 0){\r\n\t\t\t\t\t$response['rd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t$response['rd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t\t$response['vd_lt'] = $orders[0]['vendor_latitude'];\r\n\t\t\t\t\t$response['vd_lg'] = $orders[0]['vendor_longitude'];\r\n\t\t\t\t} else if ($orders[0]['ride_type'] == 0 && $orders[0]['rider_response'] == 6 && $orders[0]['delivery_rider_response'] == 6){\r\n\t\t\t\t\t$response['rd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t$response['rd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t\t$response['vd_lt'] = $orders[0]['latitude'];\r\n\t\t\t\t\t$response['vd_lg'] = $orders[0]['longitude'];\r\n\t\t\t\t} \r\n\r\n\t\t\t\t$response['status'] = 1;\r\n\t\t\t} else {\r\n\t\t\t\t$response['status'] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$response['status'] = 2;\r\n\t\t}\r\n\t\techo json_encode($response);\r\n\t}",
"public function show(Order $order)\n {\n $this->authorize('view',$order);\n return $this->helper->get($order->id);\n }",
"public function show(Order $order)\n {\n \n $this->authorize('view', $order);\n\n if ($order->status == 'inprogress') {\n\n /*first call deadlines from general traits */\n $writerDeadline = $this->setDeadline($order)[1];\n\n /* secondly call the messages from writer traits*/\n $messages = $this->writerMessages($order);\n\n /* History with customer*/\n $historyOrders = Order::where(['writer_id'=>auth()->id(),'user_id'=>$order->user_id])\n ->orderBy('created_at','DESC')->get();\n\n /* writer calculated time extensions*/\n $writerExtensions = $this->extension($order);\n // dd($writerExtensions);\n\n /* then use them to call show*/\n\n $inprogressOrder = $order;\n\n return view('writer.order.inprogress.show', compact('inprogressOrder',\n 'messages','writerDeadline','historyOrders','writerExtensions'));\n\n } else\n\n return redirect(route('writer.inprogress.index'));\n }",
"public function index()\n {\n $orders = Order::with('customer','spec', 'product', 'variation', 'address')->latest()->paginate(10);\n\n return view('admin.orders-list')\n ->withOrders($orders);\n\n }",
"function get_order()\n{\n\n}",
"public function TrackOrder() {\r\n\t\r\n\t\t$id=$_SESSION['olouserid'];\r\n\t\t \r\n\t\t$this->load->library ( 'zyk/UserLib' );\r\n\t\tif(!empty($id)){\r\n\t\t\t$orders = $this->userlib->getOngoingOrders($id);\r\n\t\t\t//\techo '<pre>';\tprint_r($orders); echo '</pre>'; exit;\r\n\t\t\t//$order = $this->userlib->getlastOrder($id);\r\n\t\t\t//$logs= $this->userlib->getlastOrderComment($order[0]['orderid']);\r\n\t\t\t//$bill = $this->userlib->getBill($id);\r\n \r\n\t\t\t\r\n\t\t$this->load->library('zyk/OrderLib');\r\n\t\t$allorders = $this->orderlib->getOrderDetails($orders[0]['orderid']);\r\n \r\n\r\n\t\t$this->load->library('zyk/SearchLib','searchlib');\r\n \t\tif($allorders[0]['package_id'] > 0)\r\n \t\t{ \r\n \t\t\t$this->load->library('zyk/OrderLib');\r\n $Userpackages = $this->orderlib->getUserpackageDetails($allorders[0]['userid'],$allorders[0]['package_id']); \r\n \t}\r\n\r\n /*echo \"<pre>\";\r\n print_r($Userpackages);\r\n exit();*/\r\n\t\t\t\t\r\n\r\n\t\t\t$this->template->set('userpackage', $Userpackages); \r\n\t\t\t$this->template->set('orders',$orders);\r\n\t\t\t//$this->template->set('logs',$logs);\r\n\t\t\t//$this->template->set('bill',$bill);\r\n\t\t\t$this->template->set ( 'description', '' );\r\n\t\t\t//$this->template->set ( 'page', 'home' );\r\n\t\t\t$this->template->set_theme('default_theme');\r\n\t\t\t$this->template->set_layout ('default')\r\n\t\t\t->title ( 'bikeDoctor' )\r\n\t\t\t->set_partial ( 'header', 'partials/header' )\r\n\t\t\t->set_partial ( 'footer', 'partials/footer' );\r\n\t\t\t$this->template->build ('order/ongoing-orders');\r\n\t\t}else{\r\n\t\t\tredirect(base_url ());\r\n\t\t}\r\n\t}",
"public function index()\n\t{\n\t\tif($this->session->userdata('email')){\n\t\t\t$email = $this->session->userdata('email');\n\t\t\t//Do Orders stuff with a logged in user HERE\n\t\t\t////////////////////////////////////////////\n\t\t\t$this->load->model('orders_model');\n\t\t\t$recent_orders = $this->orders_model->recent_orders($email);\n\t\t\t$this->load->view('orders_view',array('recent_orders' => $recent_orders));\n//\t\t\tif(!$recent_orders){\n//\t\t\t\techo \"You have no recnet orders\";\n//\t\t\t}\n//\t\t\telse{\n//\t\t\t\tforeach($recent_orders as $oid => $order){\n//\t\t\t\t\techo \"Order Number: \". $oid. \"-----\";\n//\t\t\t\t\tif($order['is_shipped']){\n//\t\t\t\t\t\techo \"Your order is shipped------\";\n//\t\t\t\t\t}\n//\t\t\t\t\telse{\n//\t\t\t\t\t\techo \"Your order is NOT shipped---------\";\n//\t\t\t\t\t}\n//\t\t\t\t\techo \"Your order contains item #s : \";\n//\t\t\t\t\tforeach($order['items'] as $item){\n//\t\t\t\t\t\techo $item['upc']. \", \";\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$this->session->set_flashdata('goto_url',current_url());\n\t\t\tredirect(site_url('login'));\n\t\t}\n\t}",
"public function index(Order $order)\n {\n //\n }",
"public function confirmOrder()\n {\n return view('frontend.OrderConfirmationDetails.order-confirmation-detail');\n }",
"public function getOrdersDispatched(Request $request)\n {\n $id = $request->id;\n $aOrdersInPorgress = Order::with('user', 'order_item.menu_item')\n ->where('restaurant_id', '=', $id)\n ->where('status', '=', 2)\n ->where('accepted', '=', 1)\n ->orderBy('delivery_time', 'asc')\n ->get();\n return response()->json($aOrdersInPorgress);\n }"
] | [
"0.6910204",
"0.6828715",
"0.6736852",
"0.6736852",
"0.6660666",
"0.6559032",
"0.6478324",
"0.647588",
"0.6418024",
"0.63953376",
"0.6389475",
"0.638926",
"0.63804114",
"0.63533354",
"0.634991",
"0.6349003",
"0.63457763",
"0.63166857",
"0.63079536",
"0.6300312",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6294646",
"0.6283784",
"0.6270306",
"0.62685937",
"0.6255533",
"0.6253532",
"0.6250303",
"0.6244804",
"0.62445396",
"0.62377477",
"0.6218672",
"0.6203061",
"0.6194815",
"0.6194739",
"0.6171602",
"0.6169205",
"0.6143474",
"0.613633",
"0.6133965",
"0.61294574",
"0.6118657",
"0.6114367",
"0.6100844",
"0.6059809",
"0.6048919",
"0.6045269",
"0.60412204",
"0.60260737",
"0.60220987",
"0.6009917",
"0.60096264",
"0.6007422",
"0.6000555",
"0.599658",
"0.599526",
"0.5989906",
"0.59830236",
"0.597415",
"0.59632385",
"0.59632385",
"0.59632385",
"0.5949084",
"0.5948562",
"0.59460855",
"0.5941658",
"0.5938317",
"0.592988",
"0.592835",
"0.59277934",
"0.59254915",
"0.59185904",
"0.5916761",
"0.5909645",
"0.5905297",
"0.59050775",
"0.59010774",
"0.58935624",
"0.5892448",
"0.58825606",
"0.5878377",
"0.5868145",
"0.586395",
"0.5863879",
"0.5861094",
"0.5855115",
"0.58521956",
"0.5850559"
] | 0.0 | -1 |
Waits until file is free to write into... | private function log_msg($type, $msg)
{
if (!file_exists(self::LOG_FILE))
{
file_put_contents(self::LOG_FILE, "\r\n");
}
$file = fopen(self::LOG_FILE, 'a+');
if ($file)
{
$block = true;
if (flock($file, LOCK_EX, $block))
{
fwrite($file, sprintf("[%s] %s: %s\r\n", @date("c"), $type, $msg));
}
fclose($file);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function waitForFile($file, $error)\n {\n if (!$error) {\n $handle = fopen(\"mp3/\".$file, \"r\");\n if (is_resource($handle)) {\n fclose($handle);\n }\n else {\n $i = 0;\n while (!is_resource($handle) && $i<10) {\n $i++;\n $handle = fopen(\"mp3/\".$file, \"r\");\n usleep(100000);\n }\n fclose($handle);\n }\n }\n }",
"public function writelock($wait = -1) {}",
"function waitfor($file)\r\n\t{\r\n\t\treturn parent::waitFor($file);\r\n\t}",
"function write($filename)\n\t{\n\t\t// open, but do not truncate leaving data in place for others\n\t\t$fp = fopen($this->folder . $filename . '.html', 'c'); \n\t\tif ($fp === false) \n\t\t{\n error_log(\"Couldn't open \" . $filename . ' cache for updating!');\n }\n\t\t// exclusive lock, but don't block it so others can still read\n\t\tflock($fp, LOCK_EX | LOCK_NB); \n // truncate it now we've got our exclusive lock\n\t\tftruncate($fp, 0);\n\t\tfwrite($fp, ob_get_contents());\n\t\tflock($fp, LOCK_UN); // release lock\n\t\tfclose($fp);\n\t\t// finally send browser output\n\t\tob_end_flush();\n\t}",
"public function writeAndClose();",
"public function hasWritePending();",
"function __sleep() {\r\n fclose($this->fp);\r\n return array('filename');\r\n }",
"public function stream_write(string $data)\n\t{\n\t\t$len = strlen($data);\n\t\t$res = fwrite($this->tempHandle, $data, $len);\n\n\t\tif ($res !== $len) { // disk full?\n\t\t\t$this->writeError = true;\n\t\t}\n\n\t\treturn $res;\n\t}",
"function _file_save($head, $olen, $nlen = 0)\n {\n if ($nlen == 0) $nlen = strlen($head);\n if ($nlen == $olen)\n {\n\t// shorter\n\tflock($this->fd, LOCK_EX);\n\tfseek($this->fd, 0, SEEK_SET);\n\tfwrite($this->fd, $head, $nlen);\n\tflock($this->fd, LOCK_UN);\n }\n else\n {\n\t// longer, buffer required\n\t$stat = fstat($this->fd);\n\t$fsize = $stat['size'];\n\n\t// buf required (4096?) 应该不会 nlen - olen > 4096 吧\n\t$woff = 0;\n\t$roff = $olen;\n\n\t// read first buffer\n\tflock($this->fd, LOCK_EX);\n\tfseek($this->fd, $roff, SEEK_SET);\n\t$buf = fread($this->fd, 4096);\n\n\t// seek to start\n\tfseek($this->fd, $woff, SEEK_SET);\n\tfwrite($this->fd, $head, $nlen);\n\t$woff += $nlen;\n\n\t// seek to woff & write the data\n\tdo\n\t {\n\t $buf2 = $buf;\n\t $roff += 4096;\n\t if ($roff < $fsize) \n\t {\n\t\tfseek($this->fd, $roff, SEEK_SET);\n\t\t$buf = fread($this->fd, 4096);\n\t }\n\n\t // save last buffer\n\t $len2 = strlen($buf2);\n\t fseek($this->fd, $woff, SEEK_SET);\n\t fwrite($this->fd, $buf2, $len2);\n\t $woff += $len2;\n\t }\n\twhile ($roff < $fsize);\n\tftruncate($this->fd, $woff);\n\tflock($this->fd, LOCK_UN);\n }\n }",
"static function flock_put_contents($fn, $cnt, $block=false) {\n $ret = false;\n if( $f = fopen($fn, 'c+') ) {\n $app = $block & FILE_APPEND and $block ^= $app;\n if( $block ? self::do_flock($f, LOCK_EX) : flock($f, LOCK_EX | LOCK_NB) ) {\n if(is_array($cnt) || is_object($cnt)) $cnt = serialize($cnt);\n if($app) fseek($f, 0, SEEK_END);\n if(false !== ($ret = fwrite($f, $cnt))) ftruncate($f, ftell($f));\n flock($f, LOCK_UN);\n }\n fclose($f);\n }\n return $ret;\n }",
"public function writeunlock() {}",
"public function writeLockFile(): bool\n {\n try {\n $this->io->write(\n sprintf(\"\\n <info>Writing new lock data to %s<info>\", $this->file->getPath())\n );\n $this->file->write($this->lockedData);\n\n return true;\n } catch (\\Throwable $exception) {\n $this->io->error($exception->getMessage());\n\n return false;\n }\n }",
"function finish_writing()\n {\n eval(PUBSUB_MUTATE);\n $this->_finished_writing = true;\n $this->_shutdown_if_necessary();\n return 1;\n }",
"function writeToFile($filename){\n\t\tif(!file_exists($filename)){\n\t\t\t// File is created with class Files in order to maintain file permissions\n\t\t\tFiles::TouchFile($filename,$err,$err_str);\n\t\t\tif($err){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot do touch on $filename ($err_msg)\");\n\t\t\t}\n\t\t}\n\n\t\t$total_length = $this->getLength();\n\t\t$chunk_size = 1024 * 1024; // 1MB\n\t\t$bytes_written = 0;\n\n\t\tif($total_length===0){\n\t\t\tFiles::EmptyFile($filename,$err,$err_str);\n\t\t\tif($err){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot empty file $filename ($err_msg)\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t$f = fopen($filename,\"w\");\n\t\tif($f === false){\n\t\t\tthrow new Exception(get_class($this).\": cannot open $filename for writing\");\n\t\t}\n\t\twhile($bytes_written < $total_length){\n\t\t\t$length = min($chunk_size,$total_length - $bytes_written);\n\t\t\t$chunk = $this->substr($bytes_written,$length);\n\t\t\t$_bytes = fwrite($f,$chunk,$length);\n\t\t\tif($_bytes !== $length){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot write to $filename\");\n\t\t\t}\n\t\t\t$bytes_written += $length;\n\t\t}\n\t\tfclose($f);\n\t}",
"public static function SingleProcessWrite (\n\t\t$fullPath, \n\t\t$content, \n\t\t$writeMode = 'w', \n\t\t$lockWaitMilliseconds = 100, \n\t\t$maxLockWaitMilliseconds = 5000, \n\t\t$oldLockMillisecondsTolerance = 30000\n\t);",
"public function OutputWaiting($fileId) {\n\t\t$handle = fopen(ProcMonitor::GetFName($fileId),\"r\");\n\t\t$fstat = fstat($handle);\n\t\tfclose($handle);\n\n\t\tif ($fstat['size'] > ProcMonitor::GetBytesRead($fileId)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"private function htWriteFile() {\r\n global $php_errormsg;\r\n $filename = $this->FILE;\r\n // On WIN32 box this should -still- work OK,\r\n // but it'll generate the tempfile in the system\r\n // temporary directory (usually c:\\windows\\temp)\r\n // YMMV\r\n $tempfile = tempnam( \"/tmp\", \"fort\" );\r\n $name = \"\";\r\n $pass = \"\";\r\n $count = 0;\r\n $fd;\r\n $myerror = \"\";\r\n if ( $this->EMPTY ) {\r\n $this->USERCOUNT = 0;\r\n }\r\n if ( !copy( $filename, $tempfile ) ) {\r\n $this->error( \"FATAL cannot create backup file [$tempfile] [$php_errormsg]\", 1 );\r\n }\r\n $fd = fopen( $tempfile, \"w\" );\r\n if ( empty( $fd ) ) {\r\n $myerror = $php_errormsg; // In case the unlink generates\r\n // a new one - we don't care if\r\n // the unlink fails - we're\r\n // already screwed anyway\r\n unlink( $tempfile );\r\n $this->error( \"FATAL File [$tempfile] access error [$myerror]\", 1 );\r\n }\r\n for ( $count = 0; $count <= $this->USERCOUNT; $count++ ) {\r\n $name = $this->USERS[$count][\"user\"];\r\n $pass = $this->USERS[$count][\"pass\"];\r\n if ( ($name != \"\") && ($pass != \"\") ) {\r\n fwrite( $fd, \"$name:$pass\\n\" );\r\n }\r\n }\r\n fclose( $fd );\r\n if ( !copy( $tempfile, $filename ) ) {\r\n $myerror = $php_errormsg; // Stash the error, see above\r\n unlink( $tempfile );\r\n $this->error( \"FATAL cannot copy file [$filename] [$myerror]\", 1 );\r\n }\r\n // Update successful\r\n unlink( $tempfile );\r\n if ( file_exists( $tempfile ) ) {\r\n // Not fatal but it should be noted\r\n $this->error( \"Could not unlink [$tempfile] : [$php_errormsg]\", 0 );\r\n }\r\n // Update the information in memory with the\r\n // new file contents.\r\n $this->initialize( $filename );\r\n return TRUE;\r\n }",
"public function testFileFunctions() {\n $filename = 'public://' . $this->randomMachineName();\n file_put_contents($filename, str_repeat('d', 1000));\n\n // Open for rw and place pointer at beginning of file so select will return.\n $handle = fopen($filename, 'c+');\n $this->assertNotFalse($handle, 'Able to open a file for appending, reading and writing.');\n\n // Attempt to change options on the file stream: should all fail.\n $this->assertFalse(@stream_set_blocking($handle, 0), 'Unable to set to non blocking using a local stream wrapper.');\n $this->assertFalse(@stream_set_blocking($handle, 1), 'Unable to set to blocking using a local stream wrapper.');\n $this->assertFalse(@stream_set_timeout($handle, 1), 'Unable to set read time out using a local stream wrapper.');\n $this->assertEquals(-1 /*EOF*/, @stream_set_write_buffer($handle, 512), 'Unable to set write buffer using a local stream wrapper.');\n\n // This will test stream_cast().\n $read = [$handle];\n $write = NULL;\n $except = NULL;\n $this->assertEquals(1, stream_select($read, $write, $except, 0), 'Able to cast a stream via stream_select.');\n\n // This will test stream_truncate().\n $this->assertEquals(1, ftruncate($handle, 0), 'Able to truncate a stream via ftruncate().');\n fclose($handle);\n $this->assertEquals(0, filesize($filename), 'Able to truncate a stream.');\n\n // Cleanup.\n unlink($filename);\n }",
"function file_write($file, $data, $flags = 0) {\n if (($bytes = file_put_contents($file, $data, $flags)) !== strlen($data)) {\n error('Failed to write ' . spy($data) . ' to ' . spy($file) . '.');\n }\n\n return $bytes;\n}",
"public function waitingForFile(){\n return !empty($this->check_for_file);\n }",
"function writeFile($res,$loc){\n $f = fopen($loc,'r+');\n fwrite($f,$res);\n ftruncate($f,strlen($res));\n fclose($f);\n}",
"public function flush() {\n\t\tfflush($this->fp);\n\t}",
"public function onWriteAvailable()\n\t{\n\t\tif (($written = @fwrite($this->stream, $this->writeBuffer)) === false) {\n\t\t\t$this->closeWithError(\"Could not write data to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tif ($written === 0) {\n\t\t\t$this->closeWithError(\"Broken pipe or closed connection.\");\n\t\t\treturn;\n\t\t}\n\n\t\t$this->writeBuffer = substr($this->writeBuffer, $written) ?: \"\";\n\n\t\tif (empty($this->writeBuffer)) {\n\t\t\t$this->flushing = false;\n\t\t\t$this->loop->removeWriteStream($this->stream);\n\t\t}\n\t}",
"public function fileEnd(): void;",
"protected function _closeFile() {}",
"protected function _closeFile() {}",
"public function hasFinishWrite(){\n return $this->_has(3);\n }",
"public function wait(): void;",
"private function waitForUnlocking()\n\t{\n\t\t$times = self::LOCK_TTL;\n\t\t$i = 0;\n\t\twhile ($this->isExecutionLocked() && $i < $times)\n\t\t{\n\t\t\tsleep(1);\n\t\t\t$i++;\n\t\t}\n\t}",
"public function writeFile()\n {\n $this->eof();\n\n return parent::writeFile();\n }",
"function write_time_file($wait){\n\t\t$myFile= \"/home/hvn0220437/supercleaner.info/public_html/time.txt\";\n\t\t$fh = fopen($myFile, 'w+') or die(\"Cannot write time file\");\t\t\n\t\t$doneTime = date('d')*24*60*60+date('H')*60*60 + date('i')*60 + date('s');\n\t\t$newOutput = $doneTime.\"+\".$wait;\n\t\tfwrite($fh, $newOutput);\n\t\tfclose($fh);\n\t}",
"function fileNeedsProcessing() ;",
"function writeToFile ( $evenLogFullPath , $eventLine )\r\n\t{\r\n\t\t$stream = @fopen( $evenLogFullPath , 'a', false) ;\r\n\t\t$res = fwrite($stream, $eventLine);\r\n\t\tif ( ! $res )\r\n\t\t{\r\n\t\t\t// sleep a little and try again... \r\n\t\t\tusleep ( 50 + rand ( 0,50 ));\r\n\t\t\t$res = fwrite($stream, $eventLine);\r\n\t\t}\r\n\t\tif (is_resource($stream) ) {\r\n fclose($stream);\r\n\t\t}\r\n\t\t\r\n\t\treturn $res;\r\n\t}",
"public function processWrite()\n {\n if (!$this->hasPendingWrite()) {\n return;\n }\n\n if (!$this->pendingWriteBuffer) {\n $this->pendingWriteBuffer .= array_shift($this->pendingWrites)->toRawData();\n }\n\n $this->log('Writing data to client, buffer contents: ' . $this->pendingWriteBuffer, Loggable::LEVEL_DEBUG);\n\n $bytesWritten = fwrite($this->socket, $this->pendingWriteBuffer);\n\n if ($bytesWritten === false) {\n $this->log('Data write failed', Loggable::LEVEL_ERROR);\n $this->trigger('error', $this, 'Data write failed');\n\n $this->disconnect();\n } else if ($bytesWritten > 0) {\n $this->pendingWriteBuffer = (string) substr($this->pendingWriteBuffer, $bytesWritten);\n }\n }",
"public function openForAppend(): void\n {\n $this->content->seek(0, SEEK_END);\n $this->lastAccessed = time();\n }",
"public function wait()\n {\n register_shutdown_function(array($this, 'close'));\n while (count($this->ch->callbacks)) {\n $this->ch->wait();\n }\n }",
"public function close_cache_file()\n {\n $this->log(1,__FUNCTION__,\"Closing cache file, transferred {$this->tsize} bytes, {$this->tcount} buffers, {$this->dretry} retries\");\n if (!$this->cache_fp) {\n $this->log(1,__FUNCTION__,\"URL not cached, file pointer empty\");\n return;\n }\n\n $cl = $this->server_reply_headers['Content-Length'];\n $sz = ftell($this->cache_fp) - $this->cache_header_size;\n if ($sz != $cl) {\n $this->log(1,__FUNCTION__,\"Not fully downloaded [$sz/$cl]\");\n }\n else if (fflush($this->cache_fp) === FALSE || fclose($this->cache_fp) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot close written cache file: [{$this->cache_filename}]\");\n }\n else if (rename($this->temp_cache_filename, $this->cache_filename) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot rename temporary cache file: [{$this->temp_cache_filename}] to [{$this->cache_filename}]\");\n }\n else {\n $this->add_video($sz); // Add video to the db\n $this->add_to_stats(); // Calc stats\n $this->cache_fp = null;\n $this->log(1,__FUNCTION__,\"Close cached file: \".$this->cache_filename);\n }\n\n $this->close_temporary_transfer($this->cache_request); // Delete from temporary\n $this->stop_caching();\n }",
"function writeover($filename,$data,$method=\"rb+\",$iflock=1,$check=1,$chmod=1){\n\t$check && strpos($filename,'..')!==false && exit('Forbidden');\n\ttouch($filename);\n\t$handle=fopen($filename,$method);\n\tif($iflock){\n\t\tflock($handle,LOCK_EX);\n\t}\n\tfwrite($handle,$data);\n\tif($method==\"rb+\") ftruncate($handle,strlen($data));\n\tfclose($handle);\n\t$chmod && @chmod($filename,0777);\n}",
"function beginReadWrite();",
"public function fileNeedsProcessing() {}",
"function gzfile_put_contents($file, $text, $mode = 'w+') {\n if (($fp = @fopen($file.'.lock', 'w+')) === FALSE) {\n return FALSE;\n }\n fwrite($fp, '.lock');\n fclose($fp);\n if (($fp = gzopen($file, $mode)) === FALSE) {\n return FALSE;\n }\n if (!empty($text) && !gzwrite($fp, $text)) {\n gzclose($fp);\n return FALSE;\n }\n gzclose($fp);\n unlink($file.'.lock');\n return TRUE;\n}",
"function writeDataChunks()\n {\n if ($this->dbg)\n echo (\"writeDataChunks \" . $this->bytesToSend . \" which is \" .\n $this->bytesToSend/$this->byteRateAdjusted . \" sec <br/>\");\n $fp = fopen($this->fileName, \"rb\");\n if (!$fp) die;\n $i = 0;\n while ($this->byteToSendStart >= $this->chunkSizeArray[$i])\n $this->byteToSendStart -= $this->chunkSizeArray[$i++];\n while ($this->bytesToSend)\n {\n $seekPos = $this->chunkPosArray[$i] + $this->byteToSendStart;\n if ($this->dbg)\n echo (\"fseek to \" . $seekPos . \" <br/>\");\n fseek($fp, $seekPos, SEEK_SET);\n $toSend = $this->bytesToSend;\n $maxSend = $this->chunkSizeArray[$i] - $this->byteToSendStart;\n if ($toSend > $maxSend)\n $toSend = $maxSend;\n $str = fread($fp, $toSend);\n if ($this->dbg)\n echo (\"read \" . $toSend . \" and got \" . strlen($str) . \" <br/>\");\n else\n echo ($str);\n $this->bytesToSend -= $toSend;\n $this->byteToSendStart = 0;\n $i++;\n }\n fclose($fp);\n if ($this->dbg) echo (\"finished writing from \" . $this->fileName . \"<br/>\");\n }",
"function file_append($file, $data, $delimiter = '') {\n return file_write($file, $data . $delimiter, FILE_APPEND);\n}",
"function write_cache(&$var, $filename) {\n $filename = DIR_FS_CACHE . $filename;\n $success = false;\n\n// try to open the file\n if ($fp = @fopen($filename, 'w')) {\n// obtain a file lock to stop corruptions occuring\n flock($fp, 2); // LOCK_EX\n// write serialized data\n fputs($fp, serialize($var));\n// release the file lock\n flock($fp, 3); // LOCK_UN\n fclose($fp);\n $success = true;\n }\n\n return $success;\n }",
"function loop_write($file, $txt, $num){\n\n for ($x=1;$x<=$num;$x++){\n fwrite($file,$txt);\n }\n\n}",
"function write_time_output_file($wait){\n\t\t$myFile= \"/home/hvn0220437/supercleaner.info/public_html/output.txt\";\n\t\t$fh = fopen($myFile, 'a') or die(\"Cannot append output file\");\t\t\n\t\t$time = date('H:i:s');\n\t\t$newOutput = \"[ \".$time.\" ]\".\" Tạm dừng. Lần tiếp theo sau \".$wait.\" phút<br>\";\n\t\tfwrite($fh, $newOutput);\n\t\tfclose($fh);\n\t}",
"function logFileTest() {\r\n\tprint 'Testing writing to logfile...<br />';\r\n\t$message = \"------ Testing ------\\r\\n\";\r\n\t$message .= \"Date: \".date('d m y H:i:s').\"\\r\\n\";\r\n\t$message .= \"Message: This is a test\\r\\n\";\r\n\t\t\r\n\t$fp = fopen('NGOData.log', 'a');\r\n\r\n\tif (flock($fp, LOCK_EX)) { // do an exclusive lock\r\n\t\tfwrite($fp, $message);\r\n\t\tprint 'Wrote message: '.$message.'<br />';\r\n\t\tflock($fp, LOCK_UN); // release the lock\r\n\t\tprint 'released lock...<br />';\r\n\t} else {\r\n\t\t// cannot get lock\r\n\t\tprint 'Cannot get lock on file!';\r\n\t}\r\n\r\n\tfclose($fp);\r\n}",
"function biometricfile($id) {\r\n\t//produce random file code\r\n\t$Name = rand(100,999);\r\n\t$Attempts = 0;\r\n\t//find a filename that doesn't exist\r\n\twhile (file_exists(\"fingerlog\" . $Name . \".txt\") AND ++$Attempts < 1000)\r\n\t\t$Name = rand(100,999);\r\n\t\r\n\t//if available file found, create file\r\n\tif ($Attempts < 1000)\r\n\t{\r\n\t\t//create file for writing\r\n\t\t$newID = fopen(\"fingerlog\" . $Name . \".txt\", \"w\");\r\n\t\t//wrtie $Identity into file\r\n\t\tfwrite($newID, $id);\r\n\t\t//close file\r\n\t\tfclose($newID);\r\n\t\t//postcondition assumption: account creation will consume and delete file\r\n\t\treturn $Name;\r\n\t}\r\n\telse\r\n\t\treturn -1;\r\n}",
"public function _lockedFilewrite($filename, $mode, $contents = '', $timeLimit = 300000, $staleAge = 5)\n {\n $lockDir = $filename . '.lock';\n\n /* Make sure if the user disconnects that this doesn't fail */\n ignore_user_abort(true);\n\n if (is_dir($lockDir)) {\n if ((time() - filemtime($lockDir)) > $staleAge) {\n rmdir($lockDir);\n }\n }\n\n $locked = @mkdir($lockDir);\n\n if ($locked === false) {\n $timeStart = microtimeFloat();\n\n do {\n if ((microtimeFloat() - $timeStart) > $timeLimit) {\n break;\n }\n\n\n $locked = @mkdir($lockDir);\n } while ($locked === false);\n }\n\n $success = false;\n\n if ($locked === true) {\n $fp = @fopen($filename, $mode);\n\n if (@fwrite($fp, $data)) {\n $success = true;\n }\n\n @fclose($fp);\n\n rmdir($lockDir);\n }\n\n ignore_user_abort(0);\n\n return $success;\n }",
"protected function add_ready_file( $file ) {\r\n\t\t\t$file['isvalid'] = true;\r\n\t\t\t$file['issaved'] = true;\r\n\t\t\t\r\n\t\t\t$this->Files_ready[] = $file;\r\n\t\t\t$this->Files_ready_count++;\r\n\t\t}",
"public function drain(): void;",
"function flush() ;",
"function flush() ;",
"function ccio_appendData($filename, $data) {\r\n\t//$fh = fopen($filename, \"ab\");\r\n\t$fh = fopen($filename, \"at\");\r\n\tfwrite($fh, $data);\t\t\r\n\tfclose($fh);\r\n\treturn TRUE;\r\n}",
"public function flushesExpiredFiles(UnitTester $I)\n {\n\n $create_file = function () {\n $file_contents = str_repeat(\"0123456789\", 1000);\n\n $uploaded_file_path = \"{$this->temp_dir}/\" . self::FILENAME;\n\n file_put_contents($uploaded_file_path, $file_contents);\n\n return new UploadedFile(\n new Stream($uploaded_file_path),\n strlen($file_contents),\n UPLOAD_ERR_OK,\n self::FILENAME,\n self::MEDIA_TYPE\n );\n };\n\n $uploaded_file = $create_file();\n\n // bootstrap a mock service for test:\n\n $service = new MockTempFileService($this->filesystem, \"tmp\", 1, 100); // always flush after 1 minute\n\n $service->time = time(); // fake time\n\n // collect the uploaded file as a temporary file:\n\n $uuid = $service->collect($uploaded_file);\n\n $I->assertInstanceOf(TempFile::class, $service->recover($uuid), \"can recover temporary file\");\n\n // advance time by 1 minute:\n\n $service->time += 61;\n\n // trigger flushing by collecting another file:\n\n $another_file = $create_file();\n\n $service->collect($another_file);\n\n // recover the uploaded file:\n\n $exception = null;\n\n try {\n $service->recover($uuid);\n } catch (TempFileRecoveryException $exception) {\n // caught!\n }\n\n $I->assertInstanceOf(TempFileRecoveryException::class, $exception);\n\n $I->assertCount(2, $this->filesystem->listPaths(\"tmp\"), \"temp dir contains only one json/tmp file pair\");\n }",
"public function flush(int $file_ino) {\n // no-op, stateless io.\n return null;\n }",
"function addToRecoveryFile($task)\n{\n\t$file = '../recovery.txt';\n\t$myfile = file_put_contents($file, $task .\"\\r\\n\" , FILE_APPEND | LOCK_EX);\n\techo \"Server Offline, Task will start when server is started!\";\n\tdie();\n}",
"public function wait($wait = -1) {}",
"function add($str){\nglobal $gbfile;\n $tmp = trim($str);\n $fp=fopen($gbfile,'a+'); \n flock($fp, LOCK_EX); \n fwrite($fp, $tmp. \"\\n\"); \n flock($fp, LOCK_UN); \n fclose($fp); \n}",
"private function waitForLock($key) {\n $tries = 20;\n $cnt = 0;\n do {\n // 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..\n usleep ( 250 );\n $cnt ++;\n } while ( $cnt <= $tries && $this->isLocked ( $key ) );\n if ($this->isLocked ( $key )) {\n // 5 seconds passed, assume the owning process died off and remove it\n $this->removeLock ( $key );\n }\n }",
"public function testWriteFile() {\n\t\t$filename = 'test.json';\n\t\t$filestream = 'maryhad';\n\t\ttextus_put_file($filename, $filestream);\n\t}",
"function src_tarpit() {\n\t$h = fopen('/dev/random', 'rb');\n\n\t$len = 8192;\n\t$sleep = 5;\n\t$max_time = 60 * 5;\n\n\t$wait = 0;\n\n\twhile ($wait < $max_time) {\n\t\t$contents = fread($h, $len);\n\t\techo $contents;\n\t\tflush();\n\t\tsleep($sleep);\n\t\t$wait += $sleep;\n\t}\n}",
"function write_file($my_file,$new_content){\n\treturn file_put_contents($my_file,$new_content);\n}",
"private function waitForLock($key) {\n $tries = 20;\n $cnt = 0;\n do {\n // 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..\n usleep(250);\n $cnt ++;\n } while ($cnt <= $tries && $this->isLocked());\n if ($this->isLocked()) {\n // 5 seconds passed, assume the owning process died off and remove it\n $this->removeLock($key);\n }\n }",
"public function writeCompletely($stream) {\n\t\t$written = 0;\n\t\twhile (!$this->complete) {\n\t\t\t$written += $this->writeTo($stream);\n\t\t}\n\t\t//echo \"\\nWritten \" . $written . ' bytes ';\n\t\treturn $written;\n\t}",
"protected function closeFile() {}",
"function checkFile($file) {\n if (file_exists($file))\n unlink($file);\n \n\t $handle = fopen($file, 'w+');\n\n if(handle){\n return true;\n } else {\n echo \"Unable to open stdout for writing.\\n\";\n return false;\n }\n\n }",
"function file_write ($filename, $data) {\r\n $fd = fopen($filename, 'w') or die(\"Can't open file $filename for write!\");\r\n fwrite($fd, $data);\r\n fclose($fd);\r\n }",
"private function writeFile($stub)\n {\n $this->files->put($this->path, $stub);\n }",
"public function acquire() {\r\n\t\tif( $this->use_file_lock ) {\r\n\t\t\tif ( empty( $this->filename ) ) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif( false == ( $this->filepointer = @fopen( $this->filename, \"w+\" ) ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif( false == flock( $this->filepointer, LOCK_EX ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif ( ! sem_acquire( $this->sem_id ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->is_acquired = true;\r\n\t\treturn true;\r\n\t}",
"public function flushFile()\n {\n $this->em->flush();\n }",
"public function setWriteTimeout(float $timeout): void\n {\n }",
"public function writeBlocking($buf)\n {\n $write = [$this->stream];\n\n $null = null;\n // fwrite to a socket may be partial, so loop until we\n // are done with the entire buffer\n $failedAttempts = 0;\n $bytesWritten = 0;\n $bytesToWrite = strlen($buf);\n while ($bytesWritten < $bytesToWrite) {\n // wait for stream to become available for writing\n $writable = $this->select($write, $this->sendTimeoutSec, $this->sendTimeoutUsec, false);\n if (false === $writable) {\n throw new \\Kafka\\Exception\\Socket('Could not write ' . $bytesToWrite . ' bytes to stream');\n }\n if (0 === $writable) {\n $res = $this->getMetaData();\n if (! empty($res['timed_out'])) {\n throw new \\Kafka\\Exception('Timed out writing ' . $bytesToWrite . ' bytes to stream after writing ' . $bytesWritten . ' bytes');\n } else {\n throw new \\Kafka\\Exception\\Socket('Could not write ' . $bytesToWrite . ' bytes to stream');\n }\n }\n \n if ($bytesToWrite - $bytesWritten > self::MAX_WRITE_BUFFER) {\n // write max buffer size\n $wrote = fwrite($this->stream, substr($buf, $bytesWritten, self::MAX_WRITE_BUFFER));\n } else {\n // write remaining buffer bytes to stream\n $wrote = fwrite($this->stream, substr($buf, $bytesWritten));\n }\n \n if ($wrote === -1 || $wrote === false) {\n throw new \\Kafka\\Exception\\Socket('Could not write ' . strlen($buf) . ' bytes to stream, completed writing only ' . $bytesWritten . ' bytes');\n } elseif ($wrote === 0) {\n // Increment the number of times we have failed\n $failedAttempts++;\n if ($failedAttempts > $this->maxWriteAttempts) {\n throw new \\Kafka\\Exception\\Socket('After ' . $failedAttempts . ' attempts could not write ' . strlen($buf) . ' bytes to stream, completed writing only ' . $bytesWritten . ' bytes');\n }\n } else {\n // If we wrote something, reset our failed attempt counter\n $failedAttempts = 0;\n }\n $bytesWritten += $wrote;\n }\n return $bytesWritten;\n }",
"function flush() {\n fflush($this->fp);\n }",
"static function send_buffer()\n {\n self::log_debug('Start sending buffer ...');\n\n $requests_sent = 0;\n $buffer_file = self::$log_dir . self::$log_file_buffer;\n $buffer_file_tmp = self::$log_dir . self::$log_file_buffer . '.' . rand(1, 100000) . '.tmp';\n\n try {\n\n if (!is_file($buffer_file)) {\n self::log_debug('Buffer file does not exists, nothing found to sent.');\n return false;\n }\n\n // take the current buffer and put it inside a unique tmp buffer\n rename($buffer_file, $buffer_file_tmp);\n\n // read and process the tmp buffer\n $fh = fopen($buffer_file_tmp, \"r\");\n if ($fh) {\n while (!feof($fh)) {\n $data_serialized = fgets($fh);\n\n if ($data_serialized == false) {\n continue;\n }\n\n $data = unserialize($data_serialized);\n \n if (self::send($data['e'], $data['m'], $data['d'])) {\n $requests_sent++;\n }\n }\n fclose($fh);\n }\n unlink($buffer_file_tmp);\n\n self::log_debug('Queue was sent successfully! Sent ' . $requests_sent . ' requests.');\n } catch (Exception $e) {\n self::log_error($e->getMessage());\n }\n }",
"private function flush()\n {\n $this->writeBlock();\n return $this->io->flush();\n }",
"protected function isStreamFinished()\n {\n return gzeof($this->file);\n }",
"function flush();",
"function createLockFile($file=null){\n $lockFile = ($file!='') ? $file : LOCKFILE;\n if(file_exists($lockFile)){\n print \"detected lockfile at {$lockFile} ... exiting\\n\";\n exit;\n } else {\n // Write a lockfile so we prevent other runs while we are running\n file_put_contents($lockFile, 1);\n }\n}",
"abstract function flush();",
"protected function _completeFlush() {\r\n\r\n }",
"function file_write($filename, $content)\n\t{\n\t\t$handle = @fopen($filename, 'w');\n\t\t$result = @fwrite($handle, $content, strlen($content));\n\t\t@fclose($handle);\n\t\treturn $result;\n\t}",
"public function isWriteCompleted(): bool {\n return $this->_builder->isWriteCompleted();\n }",
"public function readunlock() {}",
"function write_file($opt, $contents)\n{\n if (is_writable($opt)) \n {\n if (!$open = fopen($opt, \"w\")) \n {\n exit_program(\"Cannot write to file\\n\", code_error::error_write_file);\n }\n }\n else \n {\n $open = fopen($opt, \"x\");\n }\n fwrite($open, $contents);\n fclose($open);\n return;\n\n}",
"function writeFile($filename)\n{\n\t$fp_input = fopen(\"php://input\", \"r\");\n\n\t/* Open a file for writing */\n\t$fp = fopen($filename, \"w\");\n\t\n\t/* Read 8 KB at a time and write to the file */\n\twhile ($data = fread($fp_input, 1024 * 8))\n\t\tfwrite($fp, $data);\n\n\t/* Close the streams */\n\tfclose($fp);\n\tfclose($fp_input);\n}",
"public function transferEnd() {\n fclose($this->_transferFile);\n\n /* Reset the values */\n $this->_transferStarted = FALSE;\n $this->_transferFile = NULL;\n }",
"function writeMsgInFile($fileFullPath, $lineToWrite)\n{\n // Open the file\n $myFile = fopen($fileFullPath, 'a');\n\n // Write one the file\n fwrite($myFile, $lineToWrite . \"\\n\");\n\n // Close the file\n fclose($myFile);\n}",
"private function write_cache() {\n if (!file_exists(CACHE_DIR))\n mkdir(CACHE_DIR, 0755, TRUE);\n\n if (is_dir(CACHE_DIR) && is_writable(CACHE_DIR)) {\n if (function_exists(\"sem_get\") && ($mutex = @sem_get(2013, 1, 0644 | IPC_CREAT, 1)) && @sem_acquire($mutex))\n file_put_contents($this->cache_file, $this->html . $this->debug) . sem_release($mutex);\n /**/\n else if (($mutex = @fopen($this->cachefile, \"w\")) && @flock($mutex, LOCK_EX))\n file_put_contents($this->cache_file, $this->html . $this->debug) . flock($mutex, LOCK_UN);\n /**/\n }\n }",
"protected function _write() {}",
"function yt_file_write( $handle, $string ) {\n\n\t$func = 'f' . 'write';\n\treturn $func( $handle, $string );\n \n}",
"public function writeFile($data);",
"public function waitWithBackoff()\n {\n $waitTime = $this->calculateSleepTime();\n if ($waitTime > 1000000) {\n sleep((int) ($waitTime / 1000000));\n } else {\n usleep($waitTime);\n }\n }",
"private function closeFile( \\SplFileObject &$file ) {\n if( !$this->gzip && !$file->flock( LOCK_UN ) ) {\n $file = NULL;\n\n throw new \\Exception( 'Could not unlock file' );\n }\n\n $file = NULL;\n }",
"public static function send($_file,$_kbps=0) {\n\t\t$_file=F3::resolve($_file);\n\t\tif (!file_exists($_file)) {\n\t\t\tF3::http404();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (PHP_SAPI!='cli' && !F3::$global['QUIET'] && !headers_sent()) {\n\t\t\theader(F3::HTTP_Content.': application/octet-stream');\n\t\t\theader(F3::HTTP_Disposition.': '.\n\t\t\t\t'attachment; filename='.basename($_file));\n\t\t\theader(F3::HTTP_Length.': '.filesize($_file));\n\t\t\tF3::httpCache(0);\n\t\t\tob_end_flush();\n\t\t}\n\t\t$_max=ini_get('max_execution_time');\n\t\t$_ctr=1;\n\t\t$_handle=fopen($_file,'r');\n\t\t$_time=time();\n\t\twhile (!feof($_handle) && !connection_aborted()) {\n\t\t\tif ($_kbps>0) {\n\t\t\t\t// Throttle bandwidth\n\t\t\t\t$_ctr++;\n\t\t\t\t$_elapsed=microtime(TRUE)-$_time;\n\t\t\t\tif (($_ctr/$_kbps)>$_elapsed)\n\t\t\t\t\tusleep(1e6*($_ctr/$_kbps-$_elapsed));\n\t\t\t}\n\t\t\t// Send 1KiB and reset timer\n\t\t\techo fread($_handle,1024);\n\t\t\tset_time_limit($_max);\n\t\t}\n\t\tfclose($_handle);\n\t\treturn TRUE;\n\t}",
"public function put(\n $handle\n ) {\n $total = 0;\n while( $buffer = $this->handler->read() ) {\n $length = strlen( $buffer );\n $attempts = 0;\n $written = 0;\n while( $written < $length ) {\n $result = fwrite( $handle, substr( $buffer, $written ) );\n if( $result === false ) {\n throw new \\Exception( 'Unable to write output.' );\n }\n else if( $result === 0 ) {\n $attempts += 1;\n if( $attempts > 1000 ) {\n throw new \\Exception( 'Unable to write output.' );\n }\n }\n $written += $result;\n }\n $total += $written;\n }\n return $total;\n }",
"function fileWrite( $fileName, $myMode, $myStr )\n{\n $isOpen = fopen( $fileName, $myMode ) ;\n if ( $isOpen )\n {\n fwrite( $isOpen, $myStr ) ;\n fclose( $isOpen ) ;\n return TRUE ;\n }\n else\n {\n return FALSE ;\n }\n}",
"protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }",
"function write($data) {\n if (!@fwrite($this->_handler, $data, strlen($data))) {\n \tFire_Error::throwError(sprintf('Failed to write %s data to %s file.',\n \t $data,\n \t $this->_file\n \t ), __FILE__, __LINE__\n \t);\n }\n }",
"public function transferEnd() {\n fclose( $this->_transferFile );\n $this->_transferStarted = FALSE;\n $this->_transferSize = NULL;\n $this->_transferFile = NULL;\n\n if ($this->removeAfterTransfer) {\n unlink( $this->filePath );\n }\n }",
"function fn_is_writable($file_path)\n{\n clearstatcache(true, $file_path);\n $is_writable = is_writable($file_path);\n\n // is_writable() is not always a reliable way to determine whether\n // file or directory are really writable for current PHP process,\n // so we should perform an additional check\n if ($is_writable) {\n if (is_dir($file_path)) { // For directories we try to create an empty file into it\n $test_filepath = $file_path . DIRECTORY_SEPARATOR . uniqid(mt_rand(0, 10000));\n\n if (@touch($test_filepath)) {\n @unlink($test_filepath);\n } else {\n $is_writable = false;\n }\n } elseif (is_file($file_path)) { // For files we try to modify the file by appending \"nothing\" to it\n if (false === @file_put_contents($file_path, null, FILE_APPEND)) {\n $is_writable = false;\n }\n }\n }\n\n return $is_writable;\n}"
] | [
"0.6201736",
"0.5795209",
"0.56660914",
"0.56402797",
"0.5508758",
"0.54255587",
"0.53226495",
"0.5296417",
"0.52627105",
"0.52532315",
"0.5236741",
"0.51701003",
"0.5168335",
"0.5158054",
"0.5145762",
"0.51428515",
"0.5134936",
"0.5091132",
"0.5072809",
"0.5044906",
"0.50401187",
"0.5025453",
"0.5000722",
"0.4995226",
"0.49201676",
"0.49201676",
"0.49057582",
"0.49047425",
"0.48877424",
"0.4883748",
"0.48716575",
"0.48715585",
"0.48701838",
"0.48428982",
"0.48373106",
"0.48286343",
"0.48277175",
"0.48174405",
"0.48082754",
"0.4801348",
"0.4800606",
"0.47974524",
"0.47715944",
"0.47544786",
"0.47526625",
"0.47459814",
"0.47376883",
"0.4734931",
"0.47239608",
"0.47138608",
"0.47134593",
"0.47130474",
"0.47130474",
"0.47018147",
"0.47001058",
"0.46928495",
"0.46922943",
"0.4680168",
"0.46788096",
"0.46722335",
"0.46698195",
"0.4666264",
"0.4659922",
"0.4657255",
"0.46566525",
"0.46454462",
"0.46390706",
"0.46313328",
"0.46283638",
"0.46280396",
"0.46255565",
"0.46190038",
"0.46150854",
"0.4604066",
"0.46039233",
"0.45925218",
"0.4581533",
"0.45813966",
"0.45738885",
"0.45703682",
"0.45657697",
"0.45542797",
"0.45488238",
"0.45423317",
"0.45423263",
"0.4542012",
"0.4531861",
"0.45303738",
"0.4526501",
"0.45241588",
"0.45210102",
"0.45110482",
"0.45058265",
"0.4504094",
"0.44966617",
"0.44943848",
"0.44909072",
"0.44887456",
"0.4486673",
"0.44738883",
"0.4467572"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.