query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
function execute the query
public function execute($option = array()){ $this->_cursor = $this->_dbh->prepare($this->_sql); if($option){ for($i = 0;$i < count($option);$i++){ $this->_cursor->bindParam($i+1,$option[$i]); } } $this->_cursor->execute(); return $this->_cursor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeQuery($query);", "public function execute($query);", "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}", "abstract public function execute($query);", "abstract function executeQuery($cons);", "abstract public function query();", "public function query();", "public function query();", "public function query();", "public function executeStatement()\n {\n \n }", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function query()\n\t{\n\t\t\n\t}", "abstract public function execute() ;", "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}", "abstract function execute();", "abstract function execute();", "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 execute($sql);", "public function execute($sql);", "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 }", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "abstract public function execute();", "public function executeQuery($sql)\r\n\t{\r\n\t\t//return qocqal_query($sql);\r\n\t}", "protected abstract function executeQuery($query);", "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 }", "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 }", "public function execute($query)\n {\n }", "public static function query();", "public function run(){\n $sql = $this->sql();\n return $this->query($sql,$this->args);\n }", "private function func_execute () {\n $this -> connection = parent::func_query ($this -> query, $this -> query_data);\n }", "function executeqry($query){\n \n$conn= self::connect();\n \n $stid = oci_parse($conn, $query);\n oci_execute($stid);\n \n oci_close($conn);\n \n return $stid; \n }", "public abstract function execute();", "public abstract function execute();", "public abstract function execute();", "function db_execute($query)\n {\n /*\n * Execute the Query\n */\n $this->varifysql($query[\"SQL\"]);\n return $this->get_conn()->query($query[\"SQL\"], PDO::FETCH_ASSOC);\n }", "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}", "public abstract function execute($sql);", "abstract public function execute($sql);", "protected abstract function executeQuery(Result $result);", "public function execute()\n\t{\n\t\t$this->arrParams = func_get_args();\n\n\t\tif (is_array($this->arrParams[0]))\n\t\t{\n\t\t\t$this->arrParams = array_values($this->arrParams[0]);\n\t\t}\n\n\t\treturn $this->query();\n\t}", "abstract public function query($sql);", "function query() {}", "protected function execute()\n{\n\t$this->result = $this->db->query($this->getSql());\n\t$this->position = 0;\n\t$this->data = array();\n\n\treturn $this->result;\n}", "public function executeQuery($sql)\r\n\t{\r\n\t\t//return mysql_query($sql);\r\n\t}", "public function ExecuteQuery($query){\n\t\treturn $this->db_con->query($query);\n\t}", "function query($query){\r\n if($this->query = $this->connection->prepare($query)){\r\n $this->query->execute();\r\n //cek kalo error\r\n if ($this->query->errno){\r\n die(\"otak anda error: \". $this->query->error);\r\n }\r\n }else{\r\n die(\"Error execution: \". $this->query->error);\r\n }\r\n }", "function execute();", "abstract public function exec($query='');", "public function execute () {\n $this->query->execute();\n }", "private function execute() {\n $query = $this->db->query($this->sql);\n return $query->result();\n }", "abstract function execute ();", "public function query($sql);", "public function query($sql);", "public function query($sql);", "public function query($sql);", "abstract public function query($sql, $execute =FALSE);", "public function execute() {\r\n // $this->connecxao = parent::getConnect();\r\n $stmt = $this->connecxao->prepare($this->getQuery());\r\n $this->transition = $stmt->execute($this->getBinds());\r\n $this->error = $stmt->errorInfo();\r\n\r\n if ($this->error[0] == \"00000\") {\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n $this->data = $stmt;\r\n } else {\r\n $this->setMsgError(\"Code Aplic Error: \" . $this->error[0] . \"<br />Code BD Error: \" . $this->error[1] . \"<br />Msg BD Error: \" . $this->error[2]);\r\n }\r\n }", "public function execute() { \n return $this -> stmt -> execute();\n }", "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 }", "public function query()\n {\n }", "public function query()\n {\n }", "public function execute()\n {\n return $this->query($this->sSql);\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}", "function execute_query($q)\n{\n\tglobal $spebs_db;\n\t$res = $spebs_db -> query($q);\n\tif($spebs_db->errno != 0)\n\t{\n\t\terror_log(\"QUERY EXECUTE error \".$spebs_db->errno.\": \".$spebs_db->error.\" (Q = \\\"$q\\\")\");\n\t\treturn false;\n\t}\n\treturn $res;\n}", "function db_exe_query($str){ \n $result=$this->con->query($str);\n return $result;\n }", "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 }", "abstract protected function _query($sql);", "function tep_db_query($query){\n\t\tglobal $db;\n\t\treturn($db->Execute($query));\n\t}", "public function executeQuery($query){\n\t\n $resultQuery = mysqli_query($this->link, $query) or die (\"Requete => PROBLEME\");\n return $resultQuery;\n }", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}", "public function execute() {}" ]
[ "0.81854355", "0.78660095", "0.77936774", "0.7739099", "0.7710987", "0.767431", "0.76351625", "0.76351625", "0.76351625", "0.7603696", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75695926", "0.75577104", "0.75406706", "0.75167674", "0.7502783", "0.7502783", "0.7481372", "0.7476657", "0.7476657", "0.7468759", "0.74501073", "0.74501073", "0.74501073", "0.74501073", "0.744111", "0.7433898", "0.7422946", "0.7409315", "0.73867846", "0.7371627", "0.7363634", "0.7344232", "0.7343896", "0.73178744", "0.73178744", "0.73178744", "0.73165846", "0.7313893", "0.7303027", "0.72961396", "0.72919303", "0.72909653", "0.7276046", "0.7240871", "0.72357553", "0.72183776", "0.7217658", "0.72163194", "0.7206824", "0.71994376", "0.71934384", "0.71844375", "0.7180284", "0.7175649", "0.7175649", "0.7175649", "0.7175649", "0.71638256", "0.71454924", "0.7134183", "0.7128016", "0.7125239", "0.7125239", "0.71129507", "0.7112588", "0.7110854", "0.71071076", "0.70867956", "0.7082245", "0.7053703", "0.7050853", "0.70486873", "0.70486873", "0.70486873", "0.70486873", "0.70486873", "0.70486873", "0.70464516", "0.70464516", "0.70464516", "0.70464516", "0.70464516", "0.70464516", "0.70464516", "0.70464516", "0.70464516", "0.70464516" ]
0.0
-1
function load data on table
public function loadAllRows($option = array()){ if(!$option){ if(!$result = $this->execute()) return false; } else{ if(!$result = $this->execute($option)) return false; } return $result->fetchAll(PDO::FETCH_OBJ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadRow() {}", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "public function dataTable();", "private function _loadDataToTemporaryTable(){\n\n }", "protected function loadData(){\n\t\t//SELECT from \".self::TABLE_NAME.\"_data WHERE \".self::TABLE_NAME.\"_id=\".$this->id.\"\n\t\t\n\t\t//return the data\n\t\treturn array();\n\t}", "abstract public function loadData();", "public function loadData(){\r\n\t\t\t $pseudo = addslashes($this -> getPseudo()) ;\r\n\r\n\t\t if(! empty($pseudo)){\r\n\t\t\t$q = \"select * from UserTab where User_pseudo='\".$pseudo.\"'\";\r\n\t\t\t$r = execute($q);\r\n\t\t\twhile( $l = mysql_fetch_assoc($r) ){\r\n\t\t\t\t$this -> setFields($l);//Affectation aux champs de l'objet UserTab \r\n\t\t\t}\r\n\t\t }\r\n\r\n\t }", "public function getTableData()\n\t{\n\t}", "abstract public function loadColumns();", "function loadData()\n\t{\n\t\tstatic $data;\n\t\t\n\t\tif(!$data)\n\t\t\t$data=self::getData();\n\n\t\tif(isset($data[$this->id]))\n\t\t\t$this->setValues((array)$data[$this->id]);\t\t\t\n\t}", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }", "function tableData(){\n\t\t$entity_type = in(\"entity_type\");\t\t\n\t\t$table = $entity_type()->getTable();\n\t\t$test = in('test');\n\n\t\t// Table's primary key\n\t\t$primaryKey = 'id';\n\n\t\t// Array of database columns which should be read and sent back to DataTables.\n\t\t// The `db` parameter represents the column name in the database, while the `dt`\n\t\t// parameter represents the DataTables column identifier. In this case simple\n\t\t// indexes\n\t\t$columns = array(\n\t\t\tarray( \t'db' => 'id',\n\t\t\t\t\t'dt' => 0 \n\t\t\t\t ),\n\t\t\tarray( \t'db' => 'created', \n\t\t\t\t\t'dt' => 1, \n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t),\n\t\t\tarray( \t'db' => 'updated',\n\t\t\t\t\t'dt' => 2,\n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t ),\n\t\t);\n\t\t\n\t\t$additional_columns = self::getAdditionalFields( $entity_type );\n\t\t\n\t\t$columns = array_merge( $columns, $additional_columns );\n\n\t\t// SQL server connection information\n\t\t$sql_details = array(\n\t\t\t'user' => 'root',\n\t\t\t'pass' => '7777',\n\t\t\t'db' => 'ci3',\n\t\t\t'host' => 'localhost'\n\t\t);\n\t\n\t\trequire( 'theme/admin/scripts/ssp.class.php' );\t\t\n\t\t$date_from = in(\"date_from\");\n\t\t$date_to = in(\"date_to\");\n\t\t$extra_query = null;\n\t\tif( !empty( $date_from ) ){\n\t\t\t$stamp_from = strtotime( $date_from );\n\t\t\t$extra_query .= \"created > $stamp_from\";\n\t\t}\n\t\tif( !empty( $date_to ) ){\n\t\t\t$stamp_to = strtotime( $date_to.\" +1 day\" ) - 1;\n\t\t\tif( !empty( $extra_query ) ) $extra_query .= \" AND \";\n\t\t\t$extra_query .= \"created < $stamp_to\";\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\techo json_encode(\n\t\t\tSSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, $extra_query )\n\t\t);\n\t}", "public function getData()\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->load->database();\n\n\t\t$aColumns = explode(\", \", $this->select);\n\t\t$searchColumns = $aColumns;\n\t\t$sTable = $this->table;\n\n\t\t//id table\n\t\t$idColumn = $aColumns[count($aColumns)-1];\n\t\t$idColumn = explode(\".\", $idColumn);\n\t\tif(count($idColumn)>1){\n\t\t\t$idColumn = $idColumn[1];\n\t\t}else{\n\t\t\t$idColumn = $idColumn[0];\n\t\t}\n\n\t\t//column ordenar al final\n\t\tfor ($i=0; $i < count($aColumns) ; $i++) {\n\t\t\t$result = explode(\" AS \", $aColumns[$i]);\n\t\t\tif(count($result)>1){\n\t\t\t\t$aColumns[$i] = trim($result[1]);\n\t\t\t}\n\t\t}\n\n\t\t//columnas para buscar\n\t\tfor ($i=0; $i < count($searchColumns) ; $i++) {\n\t\t\t$result = explode(\" AS \", $searchColumns[$i]);\n\t\t\tif(count($result)>1){\n\t\t\t\t$searchColumns[$i] = trim($result[0]);\n\t\t\t}\n\t\t}\n\n\t\t// Paging\n\t\t$limit = \"\";\n\t\tif(isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1')\n\t\t{\t\t\n\t\t\tif((int)$_GET['iDisplayStart']!=0){\n\t\t\t\t$limit .= \" LIMIT \".(int)$_GET['iDisplayLength'].\" OFFSET \".(int)$_GET['iDisplayStart'].\" \";\n\t\t\t}else{\n\t\t\t\t$limit .= \" LIMIT \".(int)$_GET['iDisplayLength'];\n\t\t\t}\n\t\t}\n \n\t\t// Ordering\n\t\t$text_order_by_datatable = \"\";\n\t\tif(isset($_GET['iSortCol_0']))\n\t\t{\n\t\t\tfor($i=0; $i<intval($_GET['iSortingCols']); $i++)\n\t\t\t{\n\t\t\t\t$coma = ($i<intval($_GET['iSortingCols'])-1)?\", \":\"\";\n\t\t\t\tif($_GET['bSortable_'.intval($_GET['iSortCol_'.$i])] == 'true')\n\t\t\t\t{\n\t\t\t\t\t$text_order_by_datatable.=\" \".$searchColumns[(int)$_GET['iSortCol_'.$i]].\" \".strtoupper($_GET['sSortDir_'.$i]).$coma;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$text_order_by = \"\";\n\t\tif( !empty($text_order_by_datatable) && !empty($this->order_by) )\n\t\t{\n\t\t\t$text_order_by_datatable .= \", \";\n\t\t}\n\n\t\t$text_order_by_datatable = ($this->order_by!=\"\")?$text_order_by_datatable.$this->order_by:$text_order_by_datatable;\n\t\t$text_order_by .= (!empty($text_order_by_datatable)) ? \" ORDER BY \".$text_order_by_datatable : \" \";\n\t\t/* Multi column filtering */\n\t\t$where = \"\";\n\t\t$text_where_datatable = \"\";\n\t\tfor ( $i = 0 ; $i < count($searchColumns) ; $i++ )\n\t\t{\n\t\t\tif ( ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" ) && $_GET['sSearch'] != '' )\n\t\t\t{\n\t\t\t\tif($i==0){ $type=\"\"; }else{ $type=\" OR \"; }\n\t\t\t\t$text_where_datatable .= $type.$searchColumns[$i].\" LIKE '%\".$_GET['sSearch'].\"%' \";\n\t\t\t}\n\t\t}\n\t\tif($text_where_datatable!=\"\"){\n\t\t\t$text_where_datatable =\" (\".$text_where_datatable.\") \";\n\t\t}\n\n\t\t//where\n\t\tfor ($i=0; $i < count($this->where); $i++) {\n\t\t\tif($i==0 && $text_where_datatable!=\"\"){ $type=\" AND \"; }elseif($i==0 && $where==\"\"){ $type=\"\"; }else{ $type=\" AND \"; }\n\t\t\t$operador = \" \";\n\t\t\tif( !empty($this->where[$i][1]) )\n\t\t\t{\n\t\t\t\tif(!strpos($this->where[$i][0], \"=\")){\n\t\t\t\t\t$operador = \" = \";\n\t\t\t\t}\n\t\t\t\tif(!is_numeric($this->where[$i][1]) && strlen($this->where[$i][1])==1){\n\t\t\t\t\t$this->where[$i][1] = \"'\".$this->where[$i][1].\"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$text_where_datatable.=$type.$this->where[$i][0].$operador.$this->where[$i][1].\" \";\n\t\t}\n\t\t$where = ($text_where_datatable!=\"\")?\" WHERE \".$text_where_datatable : \"\";\n\t\t\n $like = '';\n $text_like_datatable = '';\n for ($i=0; $i < count($this->like); $i++) {\n\t\t\tif($i==0 && $text_like_datatable!=\"\"){ $type=\" AND \"; }elseif($i==0 && $like==\"\"){ $type=\"\"; }else{ $type=\" AND \"; }\n\t\t\t$operador = \" \";\n\t\t\tif(!strpos($this->like[$i][0], \"=\")){\n\t\t\t\t$operador = \" like \";\n\t\t\t}\n\t\t\tif(!is_numeric($this->like[$i][1]) && strlen($this->like[$i][1])==1){\n\t\t\t\t$this->like[$i][1] = \"'\".$this->like[$i][1].\"'\";\n\t\t\t}\n\t\t\t$text_like_datatable.=$type.$this->like[$i][0].$operador.$this->like[$i][1].\" \";\n\t\t}\n if($where!='')\n {\n $like = ($text_like_datatable!=\"\")?\" AND \".$text_like_datatable : \"\";\n }else{\n $like = ($text_like_datatable!=\"\")?\" WHERE \".$text_like_datatable : \"\";\n }\n\n //group by\n $text_group_by = ( !empty($this->group_by) ) ? \" GROUP BY \".$this->group_by.\" \" : $this->group_by;\n \n \n\t\t//join\n\t\t$join = \"\";\n\t\tfor ($i=0; $i < count($this->join); $i++) {\n\t\t\tif(!isset($this->join[$i][2])){ $type_join=\"INNER\"; }else{ $type_join=$this->join[$i][2]; }\n\t\t\t$join.=\" \".$type_join.\" JOIN \".$this->join[$i][0].\" ON \".$this->join[$i][1].\" \";\n\t\t}\n\n\n\n\t\t$sql = \"SELECT \".$this->select.\" FROM \".$sTable.$join.$where.$like.$text_group_by.$text_order_by.$limit;\n\t\t//echo $sql;die;\n\t\t$rResult = $CI->db->query($sql);\n\n\t\t// Total data set length\n\t\t$iTotal = count($rResult->result());\n\n\t\t// Data set length after filtering\n\t\t$new_query = $CI->db->query(\"SELECT COUNT(*) AS found_rows FROM \".$sTable.$join.$where.$limit);\n\t\tif(count($new_query->row())>0){\n\t\t\t$iFilteredTotal = $new_query->row()->found_rows;\n\t\t}else{\n\t\t\t$iFilteredTotal = $iTotal;\n\t\t}\n\n\t\t// Output\n\t\t$output = array(\n\t\t\t'sEcho' => intval($_GET['sEcho']),\n\t\t\t'iTotalRecords' => $iTotal,\n\t\t\t'iTotalDisplayRecords' => $iFilteredTotal,\n\t\t\t'url' => urldecode($_SERVER['REQUEST_URI']),\n\t\t\t'aaData' => array()\n\t\t);\n\t\tforeach($rResult->result_array() as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\tfor($i=0; $i<count($aColumns); $i++)\n\t\t\t{\n\t\t\t\t$key = explode(\".\", $aColumns[$i]);\n\t\t\t\t$key = (count($key)>1) ? trim($key[1]) : trim($key[0]);\n\t\t\t\t$row[] = $aRow[$key];\n\t\t\t\tif (trim($key) == trim($idColumn)) { $row['DT_RowId'] = $aRow[$key]; } // Sets DT_RowId\n\t\t\t}\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\n\t\t//url export\n\t\t$url= urldecode($_SERVER['REQUEST_URI']);\n\t\t$output['links'] = \"$url\";\n\t\treturn $_GET['callback'].'('.json_encode( $output ).');';\n\t}", "function load_table_data($fields = '') {\n\t$output = array();\n\tif (is_array($this->line_items) && is_array($fields)) {\n\t foreach ($this->line_items as $key => $row) {\n\t\t$row_data = array();\n\t\tforeach ($fields as $idx => $element) {\n\t\t $row_data['r' . $idx] = $this->line_items[$key][$element->fieldname];\n\t\t}\n\t\t$output[] = $row_data;\n\t }\n\t}\n\treturn $output;\n }", "public function datatables()\n\t{\n\t\t//menunda loading (bisa dihapus, hanya untuk menampilkan pesan processing)\n\t\t// sleep(2);\n\n\t\t//memanggil fungsi model datatables\n\t\t$list = $this->m_guestbook->get_datatables();\n\t\t$data = array();\n\t\t$no = $this->input->post('start');\n\n\t\t//mencetak data json\n\t\tforeach ($list as $field) {\n\t\t\t$no++;\n\t\t\t$row = array();\n\t\t\t$row[] = $no;\n\t\t\t$row[] = $field['nama'];\n\t\t\t$row[] = $field['nim'];\n\t\t\t$row[] = $field['email'];\n\t\t\t$row[] = $field['date'];\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\t//mengirim data json\n\t\t$output = array(\n\t\t\t\"draw\" => $this->input->post('draw'),\n\t\t\t\"recordsTotal\" => $this->m_guestbook->count_all(),\n\t\t\t\"recordsFiltered\" => $this->m_guestbook->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n\n\t\t//output dalam format JSON\n\t\techo json_encode($output);\n\t}", "public function initTable(){\n\t\t\t\n\t\t}", "private function loadTable()\n {\n $unites = $this->Unite->all([], 'uniid DESC');\n $i = 1;\n $html = '';\n\n foreach ($unites as $unite) {\n $html .= '<tr>' .\n '<td>' . $i ++ . '</td>' .\n '<td>' . $unite->unilibelle . '</td>' .\n '<td>' . $unite->uniabv . '</td>' .\n '<td>';\n if (in_array('113', $this->session->stkdroits)) {\n $html .= '<a data-toggle=\"modal\" href=\"#editeUnite\" onclick=\"laodForEditUnite(' . $unite->uniid . '); return false\" title=\"editer\"><i class=\"fa fa-edit\" style=\"color: #05AE0E;\"></i></a>';\n } else {\n $html .= '<a href=\"javascript: void(0)\" class=\"disabled\" title=\"editer\"><i class=\"fa fa-edit\"></i></a>';\n }\n if (in_array('112', $this->session->stkdroits)) {\n $html .= '<a data-toggle=\"modal\" href=\"#deletUnite\" onclick=\"laodDataForDeleteUnite(' . $unite->uniid . '); return false;\" title=\"supprimer\"><i class=\"fa fa-remove\" style=\"color: #FF3B30;\"></i></a>';\n }else {\n $html .= '<a href=\"javascript: void(0)\" class=\"disabled\" title=\"editer\"><i class=\"fa fa-remove\"></i></a>';\n }\n $html .= '</td>' .\n '</tr>';\n }\n\n return $html;\n }", "protected function _readTable() {}", "protected function _readTable() {}", "private function populate_rows() {\n\t\t\t$this->load->model('users_table');\n\t\t\t$data = $this->users_table->get_entries(); //echo $data[0]->Ime; //echo $data[0]->Prezime;\n\n\t return $data;\n\t\t}", "public function refreshTable();", "public function load()\n {\n if (count($this->table)) {\n $this->value = array_pop($this->table);\n }\n }", "public function load_data(Request $request)\n\t{\t\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->BaseModel->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['email']) && $arr_search_column['email']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('email', 'LIKE',\"%\".$arr_search_column['email'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['status']) && $arr_search_column['status']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('status',$arr_search_column['status']);\n\t\t// }\n\n\t\t// if(isset($arr_search_column['role']) && $arr_search_column['role']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('role',$arr_search_column['role']);\n\t\t// }\n\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\t\t\t\t// $view_link_url = $this->module_url_path.'/view/'.base64_encode($data->id);\n\t\t\t\t$view_link_url = \"javascript:void(0)\";\n\t\t\t\t$built_delete_href = $this->module_url_path.'/delete_country/'.base64_encode($data->id);\n\t\t\t\t$arr_roles = [];\n\n\t\t\t\t// $action_button_html = '<a title=\"\" href=\"'.$view_link_url.'\" data-original-title=\"View\" data-id=\"'.$data->id.'\" id=\"open_edit_modal\"><i class=\"fa fa-cog\" title=\"View\"></i></a> <a href='.$built_delete_href.' title=\"delete\" onclick=\"return confirm_action(this,event,\\'Do you really want to delete this Country ?\\')\"><i class=\"fa fa-trash\"></i></a>';\n\t\t\t\t$action_button_html = '<a title=\"\" href=\"'.$view_link_url.'\" data-original-title=\"View\" data-id=\"'.$data->id.'\" id=\"open_edit_modal\"><i class=\"fa fa-cog\" title=\"View\"></i></a> ';\n\n\t\t\t\tif($data->status != null && $data->status == \"0\")\n\t\t\t\t{\n\t\t\t\t\t$action_button_html .= '<a href=\"'.$this->module_url_path.'/unblock/'.base64_encode($data->id).'\" onclick=\"return confirm_action(this,event,\\'Do you really want to activate this Country ?\\')\"><i class=\"fa fa-eye-slash\" title=\"Blocked\"></i></a>&nbsp&nbsp&nbsp ';\n\t\t\t\t}\n\t\t\t\telseif($data->status != null && $data->status == \"1\")\n\t\t\t\t{\n\t\t\t\t\t$action_button_html .= '<a href=\"'.$this->module_url_path.'/block/'.base64_encode($data->id).'\" onclick=\"return confirm_action(this,event,\\'Do you really want to inactivate this Country ?\\')\"><i class=\"fa fa-eye\" title=\"Active\"></i></a> &nbsp&nbsp&nbsp';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$id \t \t\t\t= isset($data->id)? base64_encode($data->id):'';\n\t\t\t\t$country_id \t\t\t= isset($data->country_id)? $data->country_id :'';\n\t\t\t\t$country_english_name \t= isset($data->country_english_name)? $data->country_english_name :'';\n\t\t\t\t$country_arabic_name \t= isset($data->country_arabic_name)? $data->country_arabic_name :'';\n\t\t\t\t$created_at \t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'-';\n\t\t\t\t\n\t\t\t\t$i = $key+1;\n\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->country_id \t= $country_id;\n\t\t\t\t$build_result->data[$key]->country_english_name = $country_english_name;\n\t\t\t\t$build_result->data[$key]->country_arabic_name = $country_arabic_name;\n\t\t\t\t$build_result->data[$key]->built_action_btns = $action_button_html;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "function _load()\n\t{\n\t\tif($this->primary_key)\n\t\t{\n\t\t\t$row = $this->db->get_where($this->table_name, array(\n\t\t\t\t$this->primary_key => $this->{$this->primary_key},\n\t\t\t))->result();\n\t\t\t\n\t\t\tif(count($row))\n\t\t\t\t$this->load_db_values($row[0]);\n\t\t}\n\t}", "public function load($data);", "public function get_data(){\n // $id = 2;\n // $stmt = $this->verivied()->prepare(\"SELECT * FROM emptab WHERE id= :id\");\n // $stmt->bindParam(':id', $id);\n // $stmt->execute();\n // $data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n // return $data;\n // select by id;\n $data1 = $this->Xgen->select('id,nama')->from('emptab')->where('id = :id', 4)->go();\n // select all;\n //$data = $this->Xgen->select('id,nama')->from('emptab')->go();\n // inser data\n // $data = $this->Xgen->insert_query('emptab',[\n // 'nama' => 'bxel'\n // ])->go();\n //update data\n //$data = $this->Xgen->update_query('emptab', ['nama' => 'new name'])->where('id = :id', 4)->go();\n //DELETE\n //$data1 = $this->Xgen->delete('emptab','id = :id',4)->go();\n\n }", "public function loadTable() {\n $data = JenisProduk::All();\n return view('jenisproduk.partials.tables', ['data' => $data]);\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\t}", "public function loadRow($rowData)\n\t{\n\t\t\n }", "public function load_data(Request $request)\n\t{\t\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->BaseModel->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['email']) && $arr_search_column['email']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('email', 'LIKE',\"%\".$arr_search_column['email'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['status']) && $arr_search_column['status']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('status',$arr_search_column['status']);\n\t\t// }\n\n\t\t// if(isset($arr_search_column['role']) && $arr_search_column['role']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('role',$arr_search_column['role']);\n\t\t// }\n\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\t\t\t\t$edit_link_url = $this->module_url_path.'/edit_email_template/'.base64_encode($data->id);\n\t\t\t\t$delete_link_url = $this->module_url_path.'/delete_email_template/'.base64_encode($data->id);\n\t\t\t\t// $view_link_url = \"javascript:void(0)\";\n\t\t\t\t\n\t\t\t\t$arr_roles = $arr_product_options = [];\n\n\t\t\t\t$id \t\t\t\t\t= isset($data->id)? $data->id :'';\n\t\t\t\t$template_name \t\t\t= isset($data->template_name)? $data->template_name :'';\n\t\t\t\t$template_subject \t\t= isset($data->template_subject)? $data->template_subject :'';\n\t\t\t\t$created_at \t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'';\n\t\t\t\n\t\t\t\t$action_button_html = '<a title=\"\" href=\"'.$edit_link_url.'\" data-original-title=\"Edit\" ><i class=\"fa fa-cog\" title=\"Edit\"></i></a> <a title=\"\" href=\"'.$delete_link_url.'\" data-original-title=\"Delete\" data-id=\"'.$data->id.'\" onclick=\"return confirm_action(this,event,\\'Do you really want to delete this Template ?\\')\" ><i class=\"fa fa-trash\" title=\"Delete\"></i></a>';\n\n\t\t\t\n\t\t\t\t$i = $key+1;\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->template_name \t= $template_name;\n\t\t\t\t$build_result->data[$key]->template_subject \t= $template_subject;\n\t\t\t\t$build_result->data[$key]->created_at \t= $created_at;\n\t\t\t\t$build_result->data[$key]->built_action_btns = $action_button_html;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }", "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this->table[$id])) {\n return;\n }\n\n ob_get_clean();\n ob_start();\n header(\"Content-Type: application/json\");\n\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $settings = $this->settings[$id];\n\n if (isset($_POST['pageNum'])) {\n $settings['pageNum'] = $_POST['pageNum'];\n }\n\n if (isset($_POST['searchTxt'])) {\n $settings['searchTxt'] = $_POST['searchTxt'];\n }\n\n if (isset($_POST['sortKey'])) {\n $settings['sortKey'] = $_POST['sortKey'];\n }\n\n if (isset($_POST['sortDir'])) {\n $settings['sortDir'] = $_POST['sortDir'];\n }\n\n $this->settings[$id] = $settings;\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n $this->buildRows($id, $rows);\n\n exit;\n }", "protected function load()\n\t{\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "abstract public function datatables();", "protected function load(){\r\n\t\r\n\t$qq1 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" = \".(int)$this->id);\r\n\t$this->profileData = count($qq1)>0 ? $qq1[0]: null; \r\n\t\r\n\tif($this->metaUse){\r\n\t\t$qq2 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaTypesTableName.\" WHERE active = 1 ORDER BY public_ord, id\");\r\n\t\t$this->metaData = count($qq2)>0 ? $qq2: array(); \r\n\t}\r\n}", "private function populateDummyTable() {}", "public function load_data($data) {\n if(!is_array($data) || sizeof($data) <= 0)\n return;\n\n $columns_info = array();\n\n foreach($this->get_columns_information() as $column) \n $columns_info[] = $column['column_name'];\n\n foreach($data as $column => $value)\n if(in_array($column, $columns_info))\n $this->$column = $this->{'_' . $column} = $value;\n\n $this->new_register = false;\n }", "public function reloadTableData(){\r\n\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t \t$data[\"formlist\"] = $this->AB->list_of_admission_form();\r\n\t\t$user_id = $this->session->userdata(\"user_id\");\r\n\t\t$data[\"myttl\"] = $this->AB->getUserUploadedForm($user_id);\r\n\t\t$data[\"ttl\"] = $this->AB->getUserUploadedForm($user_id=NULL);\r\n\t\t$this->load->view('gs_admission/issuance/form_list',$data);\r\n\t\t}", "public function loadById($id){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"SELECT * FROM TB_USUARIOS WHERE IDUSUARIO = :ID\",array(':ID'=>$id));\n\t\t\n\t\tif (isset($results[0])) {\n\n\t\t\t$this->setData($results[0]);\n\t\t}\n\t}", "public function loadFromName($name) {\n $data = $this->table->select(array('name'=>$name))->current();\n if (is_object($data))\n $this->data = $data->getArrayCopy();\n }", "function tampil_data($tabel)\n {\n $row = $this->db->prepare(\"SELECT * FROM sms\");\n $row->execute();\n return $hasil = $row->fetchAll();\n }", "public function _load()\n {\n $query = new Query(\n \"SELECT *\n FROM `\" . Leder::TABLE . \"`\n WHERE `arrangement_fra` = '#fra'\n AND `arrangement_til` = '#til'\",\n [\n 'fra' => $this->getArrangementFraId(),\n 'til' => $this->getArrangementTilId()\n ]\n );\n\n $res = $query->getResults();\n while( $row = Query::fetch($res) ) {\n $this->add(\n Leder::loadFromDatabaseRow( $row )\n );\n }\n }", "function loadlist() {\n//\t\t$this->db->where(\"active\",true);\n\t\t$rows=null;\n\t\tif($q=$this->db->get($this->table_name)){\n\t\t\tforeach($q->result() as $r) {\n\t\t\t\t$rows[]=$r;\n\t\t\t}\n\t\t}\n\t\treturn $rows;\n\t}", "public function getAllData($table){\n $sql = \"select * from $table\";\n $this->execute($sql);\n if($this->num_rows() == 0){\n $data = 0;\n }\n else {\n while($datas = $this->getData()){\n $data[] = $datas;\n }\n }\n return $data;\n }", "public function laratablesRowData()\n\t\t{\n\t\t\t// Storage::download('coapath/' . $this->coa_name);\n\t\t//\tdd(Storage::disk('s3'));\n\t\t\treturn ['coa_path' =>'https://s3-us-west-1.amazonaws.com/'.$this->coa_name];\n/*\n\t\treturn [\n\t\t\t\t'coa_path' => Storage::disk('s3')\n\t\t\t];*/\n\t\t}", "function data_table(){\n $aColumns = array( 'guid','code','code','name','date','total_types','total_weight','total_amount','decomposition_status','guid','item_id','decomposition_status' );\t\n\t$start = \"\";\n $end=\"\";\n\n if ( $this->input->get_post('iDisplayLength') != '-1' )\t{\n $start = $this->input->get_post('iDisplayStart');\n $end=\t $this->input->get_post('iDisplayLength'); \n }\t\n $decomposition=\"\";\n if ( isset( $_GET['iSortCol_0'] ) )\n {\t\n for ( $i=0 ; $i<intval($this->input->get_post('iSortingCols') ) ; $i++ )\n {\n if ( $_GET[ 'bSortable_'.intval($this->input->get_post('iSortCol_'.$i)) ] == \"true\" )\n {\n $decomposition.= $aColumns[ intval( $this->input->get_post('iSortCol_'.$i) ) ].\" \".$this->input->get_post('sSortDir_'.$i ) .\",\";\n }\n }\n\n $decomposition = substr_replace( $decomposition, \"\", -1 );\n\n }\n\t\t\n $like = array();\n\tif ( $_GET['sSearch'] != \"\" )\n {\n $like =array(\n 'po_no'=> $this->input->get_post('code'),\n );\n\n }\n $this->load->model('items')\t ;\n $rResult1 = $this->items->get($end,$start,$like,$this->session->userdata['branch_id']);\n $iFilteredTotal =$this->items->count($this->session->userdata['branch_id']);\n $iTotal =$iFilteredTotal;\n $output1 = array(\n \"sEcho\" => intval($_GET['sEcho']),\n \"iTotalRecords\" => $iTotal,\n \"iTotalDisplayRecords\" => $iFilteredTotal,\n \"aaData\" => array()\n );\n\t\t\n foreach ($rResult1 as $aRow )\n {\n $row = array();\n for ( $i=0 ; $i<count($aColumns) ; $i++ )\n {\n if ( $aColumns[$i] == \"id\" )\n {\n $row[] = ($aRow[ $aColumns[$i] ]==\"0\") ? '-' : $aRow[ $aColumns[$i] ];\n }\n else if ( $aColumns[$i]== 'date' )\n {\n /* General output */\n $row[] = date('d-m-Y',$aRow[$aColumns[$i]]);\n }\n else if ( $aColumns[$i] != ' ' )\n {\n /* General output */\n $row[] = $aRow[$aColumns[$i]];\n }\n\n }\n\n $output1['aaData'][] = $row;\n }\n\techo json_encode($output1);\n }", "public function get_data(){\n\t\t// by using given function\n\t\tif($this->func_data_total && function_exists($this->func_data_total)){\n\t\t\t$this->items_total = call_user_func_array($this->func_data_total, array());\n\t\t// by using direct SQL request\n\t\t}else{\n\t\t\t$total = $this->db->fetch_all(\n\t\t\t\tsprintf(\n\t\t\t\t\t'SELECT COUNT(*) as cnt'\n\t\t\t\t\t\t.' FROM %s'\n\t\t\t\t\t\t.'%s',\n\t\t\t\t\t$this->sql['table'], // TABLE\n\t\t\t\t\t$this->sql['where'] // WHERE\n\t\t\t\t),\n\t\t\t\t'obj'\n\t\t\t);\n\t\t\t$this->items_total = $total[0]->cnt;\n\t\t}\n\t\t\n\t\t// Getting data\n\t\t// by using given function\n\t\tif($this->func_data_get && function_exists($this->func_data_get)){\n\t\t\t$param = array($this->sql['offset'], $this->sql['limit']);\n\t\t\tif($this->order_by) $param[] = current($this->order_by);\n\t\t\tif($this->order_by) $param[] = key($this->order_by);\n\t\t\t$this->rows = call_user_func_array($this->func_data_get, $param);\n\t\t// by using direct SQL request\n\t\t}else{\n\t\t $columns = array();\n\t\t foreach ( $this->columns_names as $columns_name ) {\n\t\t\t $columns[] = $this->sql['table'] . '.' . $columns_name;\n }\n\t\t\t$this->rows = $this->db->fetch_all(\n\t\t\t\tsprintf(\n\t\t\t\t\t'SELECT %s'\n\t\t\t\t\t\t.' FROM %s'\n\t\t\t\t\t\t.'%s'\n\t\t\t\t\t\t.' ORDER BY %s %s'\n\t\t\t\t\t\t.' LIMIT %s%d',\n\t\t\t\t\timplode(', ', $columns), // COLUMNS\n\t\t\t\t\t$this->sql['table'], // TABLE\n\t\t\t\t\t$this->sql['where'], // WHERE\n\t\t\t\t\tkey($this->order_by), current($this->order_by), // ORDER BY\n\t\t\t\t\t$this->sql['offset'].',', $this->sql['limit'] // LIMIT\t\n\t\t\t\t),\n\t\t\t\t$this->sql['get_array'] === true ? 'array' : 'obj'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Adding actions to each row \n\t\tforeach($this->rows as &$row){\n\t\t\tif(is_object($row)) $row->actions = array_flip(array_keys($this->actions));\n\t\t\tif(is_array($row)) $row['actions'] = array_flip(array_keys($this->actions));\n\t\t} unset($row);\n\n\t\t$this->items_count = count((array)$this->rows);\n\t\t\n\t\t// Execute given function to prepare data\n\t\tif($this->func_data_prepare && function_exists($this->func_data_prepare))\n\t\t\tcall_user_func_array($this->func_data_prepare, array(&$this)); // Changing $this in function\n\t\telse{\n\t\t\t$this->preapre_data__default();\n\t\t}\n\t\t\n\t\treturn $this;\n\t\t\n\t}", "public function loadFromDB()\n {\n }", "public function tabel_data()\n {\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_users\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $user_id_array [] = $data['id'];\n }\n }\n\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_lbb\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $lbb_id_array [] = $data['id'];\n }\n }\n\n foreach ($user_id_array as $user_id){\n foreach ($lbb_id_array as $lbb_id){\n $rating = \"0\";\n $tampil = $this->koneksi()->prepare(\"SELECT rating FROM tb_rating WHERE user_id=:user_id AND lbb_id=:lbb_id\");\n $tampil->bindParam(':user_id', $user_id);\n $tampil->bindParam(':lbb_id', $lbb_id);\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $rating = $data['rating'];\n }\n }\n $tabel_data [$user_id] [$lbb_id] = $rating;\n }\n }\n\n return $tabel_data;\n }", "private function _readSubTableData() {}", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "public function loadWFData($table, $filename){\n //$filename = \"/Users/aprateek/Desktop/sms_cat_healthcare_speciality.csv\";\n error_log(\"Filenaem=\".$filename);\n $pd = array_map('str_getcsv', file($filename));\n $headers=array();\n foreach ($pd[0] as $head){\n $headers[]=trim($head);\n }\n if (count($headers) == 0){\n throw new Exception(\"The csv file has missing or malformed header\");\n }\n error_log(\"Head=\".SmsWfUtils::flatten($headers));\n \n try {\n $this->t_crtinsupd(\"DROP TABLE IF EXISTS \".$table.\";\");\n $create_stmt = \"CREATE TABLE IF NOT EXISTS \".$table.\" (\";\n foreach($headers as $head){\n $create_stmt .= self::esc($head).\" TEXT ,\";\n }\n $create_stmt = substr($create_stmt, 0, strlen($create_stmt) -1);\n $create_stmt .= \");\";\n error_log(\"create stmt=\".$create_stmt);\n $this->t_crtinsupd($create_stmt);\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while creating schema \".$e->getMessage());\n }\n \n try {\n foreach(array_splice($pd, 1) as $row){\n $insert_stmt=\"insert into \".$table.\" values (\";\n $data = array();\n for ($i=0; $i<count($pd[0]);$i++){\n $header = self::esc(trim($pd[0][$i]));\n $data[$header] = self::esc(trim($row[$i]));\n $insert_stmt .= \"'\".self::esc(trim($row[$i])).\"',\";\n }\n $insert_stmt = substr($insert_stmt, 0, strlen($insert_stmt) -1);\n $insert_stmt .= \");\";\n error_log(\"insert_stmt=\".$insert_stmt);\n $this->t_crtinsupd($insert_stmt);\n }\n }\n catch(Exception $e){\n throw new Exception(\"Error encountered while saving data \".$e->getMessage());\n }\n }", "function LoadData()\n{\n $data=array();\n $dosen=Yii::app()->request->getParam('id_dosen',0);\n $pj=Yii::app()->request->getParam('pengajuan',0);\n $sql=\"select unsur_pel_pendidikan.ID_UNSUR_PELPEND,subun_pelpend.SUBPELPEND,tbl_dosen.NAMA_DOSEN,\n tbl_dosen.NIP_DOSEN, tbl_jabatan.NAMA_JABATAN, tbl_golongan.GOLONGAN, tbl_golongan.PANGKAT, \n tbl_jurusan.NAMA_JURUSAN, tbl_jurusan.NAMA_PIMPINAN, tbl_jurusan.NIP_PIMPINAN, tbl_jurusan.PANGKAT AS PJ, tbl_jurusan.GOLONGAN AS GJ,\n tbl_fakultas.NAMA_FAKULTAS, unsur_pel_pendidikan.KEGIATAN_PELPEND, unsur_pel_pendidikan.TEMPAT_PELPEND, \n unsur_pel_pendidikan.SEMESTER, unsur_pel_pendidikan.NILAI_PELPEND, unsur_pel_pendidikan.BUKTI_PELPEND, \n unsur_pel_pendidikan.PENGAJUAN_KE from unsur_pel_pendidikan inner join subun_pelpend on \n unsur_pel_pendidikan.ID_SUBPELPEND=subun_pelpend.ID_SUBPELPEND join tbl_dosen on\n unsur_pel_pendidikan.ID_DOSEN=tbl_dosen.ID_DOSEN join tbl_jabatan on tbl_dosen.ID_JABATAN=tbl_jabatan.ID_JABATAN \n join tbl_golongan on tbl_dosen.ID_GOLONGAN=tbl_golongan.ID_GOLONGAN join tbl_jurusan on \n tbl_dosen.ID_JURUSAN=tbl_jurusan.ID_JURUSAN join tbl_fakultas on tbl_jurusan.ID_FAKULTAS=tbl_fakultas.ID_FAKULTAS \n where unsur_pel_pendidikan.ID_DOSEN='$dosen' and unsur_pel_pendidikan.PENGAJUAN_KE='$pj' \";\n $hasil = Yii::app()->db->createCommand($sql)->queryAll();\n $i = 0;\n while ($fetchdata = $hasil)\n {\n\t$i++; // membuat counter 1, 2, 3, ... untuk ditampilkan\n // array_unshift($fetchdata,$i);\n\t//$data[] = $fetchdata;\t\n }\n return $data;\n}", "function retriveDataRow(){\r\n\t\t$coal_name = $this->getName();\r\n\t\tmysql_query(\"SET NAMES 'latin2'\");\r\n\t\tif(gettype($this->data) == 'boolean' && !is_null($coal_name)){\r\n\t\t\t$query = \"SELECT * FROM \". TBL_COALITION .\r\n \" WHERE nazwa = '$coal_name'\";\r\n\t\t\tif($result = mysql_query($query)){\r\n\t\t\t\tif(mysql_num_rows($result) == 0){\r\n\t\t\t\t\t$this->data = NULL;\r\n\t\t\t\t\t$this->coalition = NULL;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\r\n\t\t\t\t\t$this->data = $row;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$this->data = NULL;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function doLoad()\n {\n $this->DataSourceInstance->doLoad();\n }", "public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }", "abstract function loadDbData($compid);", "private function _display_data_table(){\n\t\t\t$fields = array();\n\t\t\t$query = \"DESCRIBE `\".$this->class_settings['database_name'].\"`.`\".$this->table_name.\"`\";\n\t\t\t$query_settings = array(\n\t\t\t\t'database'=>$this->class_settings['database_name'],\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'DESCRIBE',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n\t\t\t$sql_result = execute_sql_query($query_settings);\n\t\t\t\n\t\t\tif($sql_result && is_array($sql_result)){\n\t\t\t\tforeach($sql_result as $sval)\n\t\t\t\t\t$fields[] = $sval;\n\t\t\t}else{\n\t\t\t\t//REPORT INVALID TABLE ERROR\n\t\t\t\t$err = new cError(000001);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t\n\t\t\t\t$err->class_that_triggered_error = 'cCountry_list.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_display_data_table';\n\t\t\t\t$err->additional_details_of_error = 'executed query '.str_replace(\"'\",\"\",$query).' on line 208';\n\t\t\t\treturn $err->error();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//INHERIT FORM CLASS TO GENERATE TABLE\n\t\t\t$form = new cForms();\n\t\t\t$form->setDatabase( $this->class_settings['database_connection'] , $this->table_name , $this->class_settings['database_name'] );\n\t\t\t$form->uid = $this->class_settings['user_id']; //Currently logged in user id\n\t\t\t$form->pid = $this->class_settings['priv_id']; //Currently logged in user privilege\n\t\t\t\n\t\t\t$this->datatable_settings['current_module_id'] = $this->class_settings['current_module'];\n\t\t\t\n\t\t\t$form->datatables_settings = $this->datatable_settings;\n\t\t\t\n\t\t\t$returning_html_data = $form->myphp_dttables($fields);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'display-datatable',\n\t\t\t);\n\t\t}", "public function loadDataFromRow(array $data)\r\n\t{\r\n\t\t// Heredo de parent\r\n\t\tparent::loadDataFromRow($data);\r\n\r\n\t\t// Extiendo su funcionalidad\r\n\t\t$this->setInterest($this->fkinterest);\r\n\t}", "private function loadData($f_bool_Tmp=true){\r\n\t\tglobal $TABLETMP,$TABLEAFILIADOS;\r\n\t\tif ($f_bool_Tmp){\r\n\t\t\t$sqlquery=\"SELECT * FROM `$TABLETMP`; \";\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$sqlquery=\"SELECT * FROM `$TABLEAFILIADOS`; \";\r\n\t\t}\r\n\t\t$sqlr_result=mysql_query($sqlquery) or die(\"Error al sacar los datos de la tabla. \".mysql_error());\r\n\t\treturn $sqlr_result;\r\n\t}", "private function prepare_data(){\r\n\t\t\t$this->data_table['cols'] = array();\r\n\t\t\t\r\n\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\tswitch($column_info['type']){\r\n\t\t\t\t\tcase 'number':\r\n\t\t\t\t\tcase 'float':\r\n\t\t\t\t\tcase 'currency':\r\n\t\t\t\t\t\t$column_info['type'] = 'number';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t$column_info['type'] = 'string';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['cols'][] = array_merge(array('id' => $column_id), $column_info);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$rows_count = sizeof(reset($this->data));\r\n\t\t\t\r\n\t\t\tfor($i = 0; $i < $rows_count; $i++){\r\n\t\t\t\t$c = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($this->columns as $column_id => $column_info){\r\n\t\t\t\t\t$value = $this->data[$column_id][$i];\r\n\t\t\t\t\t$c[] = array('v' => $value);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->data_table['rows'][] = array('c' => $c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->data_table = json_encode($this->data_table);\r\n\t\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM ano_letivo WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "public function loadId($id){\n\t\t$model=new Model();\n\t\t$resultado=$model->select(\"SELECT * FROM tb_usuarios WHERE idusuario = :ID\",array(\":ID\"=>$id));\n\t\tif (count($resultado)>0) {\n\t\t\t$this->setData($resultado[0]);\n\t\t}\n\t}", "private function table_data(){\n $data = array();\n\n global $wpdb;\n\n $data = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}lic_activations ORDER BY ID ASC\", ARRAY_A);\n \n return $data;\n }", "public function dataTable()\r\n {\r\n\r\n /*$model = DB::table('mst_news as n')\r\n ->join('mst_news_lang as nl','nl.news_id','n.id')\r\n ->select(\r\n 'n.id',\r\n 'n.view_count',\r\n 'n.active',\r\n 'n.created_at',\r\n 'n.created_by',\r\n 'nl.title'\r\n )\r\n ->where('nl.code',\"IND\")\r\n ->where('n.is_deleted',0)\r\n ->orderBy('n.created_at','desc')\r\n ->get();*/\r\n $model = VNews::query();\r\n $model->orderBy('created_at','desc');\r\n\r\n return DataTables::of($model)\r\n ->addColumn('action', function($model){\r\n return view('master.news.action', [\r\n 'model' => $model,\r\n 'url_show'=> route('news.show', base64_encode($model->id) ),\r\n 'url_edit'=> route('news.edit', base64_encode($model->id) ),\r\n 'url_destroy'=> route('news.destroy', base64_encode($model->id) )\r\n ]);\r\n })\r\n ->editColumn('created_at', function($model){\r\n return date('d M Y H:i', strtotime($model->created_at)).' WIB';\r\n })\r\n ->editColumn('created_by', function($model){\r\n $uti = new Utility;\r\n return $uti->getUser($model->created_by);\r\n })\r\n ->editColumn('active', function($model){\r\n return $model->active == 1 ? \"<span class='label label-primary'>Active</span>\":\"<span class='label label-danger'>Inactive</span>\";\r\n })\r\n ->addIndexColumn()\r\n ->rawColumns(['action','created_by','created_at','active'])\r\n ->make(true);\r\n }", "private function load() {\r\n\t\t$sql_statement = 'SELECT no.contract_id, no.termination_date FROM '. TBL_NOTICE .' AS no WHERE no.notice_id = '. (int) $this->notice_id;\r\n\t\t$query = db_query($sql_statement);\r\n\r\n\t\tif(db_num_results($query) == 1) {\r\n\t\t\t$data = db_fetch_array($query);\r\n\t\t\t\t\r\n\t\t\t$this->contract_id = $data['contract_id'];\r\n\t\t\t$this->termination_date = $data['termination_date'];\r\n\t\t}\r\n\t}", "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest()->getPost()))\r\n\t\t;\r\n\t\treturn $table;\r\n\t}", "public function loadData(): void\n {\n $data = $_POST['FldName'] ?? $_GET['FldName'] ?? '';\n switch ($data) {\n case 'Location':\n $countryId = (isset($_POST['CountryId']) && $_POST['CountryId'] !== '') ? $_POST['CountryId'] : null;\n $sql = 'SELECT L.Id, L.Name LocName FROM Locations L';\n if ($countryId !== null) {\n $sql .= ' LEFT JOIN Locations_Countries LC ON L.Id = LC.LocationId\n\t\t\t\t\tWHERE CountryId = :countryId';\n }\n $sql .= ' ORDER BY Name ASC';\n $stmt = $this->db->prepare($sql);\n if ($countryId !== null) {\n $stmt->bindParam(':countryId', $countryId);\n }\n $stmt->execute();\n while ($row = $stmt->fetch()) {\n echo '<option value=\"'.$row['Id'].'\">'.$row['LocName'].'</option>';\n }\n break;\n case 'KeywordName':\n $query = (isset($_GET['Name']) && $_GET['Name'] !== '') ? $_GET['Name'] : '';\n $limit = (isset($_GET['count']) && preg_match('/^[0-9]+$/', $_GET['count']) === 1) ? $_GET['count'] : 50;\n $offset = (isset($_GET['start']) && preg_match('/^[0-9]+$/', $_GET['start']) === 1) ? $_GET['start'] : 0;\n $sql = \"SELECT Id, Name FROM Keywords WHERE Name LIKE '%'||:query||'%' ORDER BY Name ASC LIMIT :limit OFFSET :offset\";\n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(':query', $query);\n $stmt->bindParam(':limit', $limit);\n $stmt->bindParam(':offset', $offset);\n $stmt->execute();\n $arr = $stmt->fetchAll();\n echo json_encode($arr);\n break;\n case 'ScientificName':\n $query = (isset($_POST['Val']) && $_POST['Val'] !== '') ? $_POST['Val'] : '';\n $colName = (isset($_POST['ColName']) && preg_match('/^\\w+$/', $_POST['ColName']) === 1) ? $_POST['ColName'] : 'NameDe';\n $limit = (isset($_POST['count']) && preg_match('/[0-9]+/', $_POST['count']) !== false) ? $_POST['count'] : 50;\n $offset = (isset($_POST['start']) && preg_match('/[0-9]+/', $_POST['start']) !== false) ? $_POST['start'] : 0;\n $sql = \"SELECT Id, NameDe, NameEn, NameLa, ThemeId FROM ScientificNames WHERE $colName LIKE '%'||:query||'%' LIMIT :limit OFFSET :offset\";\n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(':query', $query);\n $stmt->bindParam(':limit', $limit);\n $stmt->bindParam(':offset', $offset);\n $stmt->execute();\n $arr = $stmt->fetchAll();\n $arr = ['identifier' => 'Id', 'items' => $arr];\n echo json_encode($arr);\n break;\n }\n }", "public function data()\n {\n $orders=libro::all();\n foreach ($orders as $key => $value) {\n \n if(count(autor::find($value->id_autor)))\n $value->id_autor=autor::find($value->id_autor)->nombre;\n else $value->id_autor='No asignado';\n \n }\n return \\Datatables::of($orders)->addColumn('action', 'libro.partials.vista')->make(true) ; \n }", "function cargar_data($sender, $param)\n {\n $id=$this->Request['id'];\n $sql=\"SELECT id,tipo,denominacion,monto\n FROM organizacion.personas_cargos_asignaciones WHERE(cargo='$id') order by tipo ASC \";\n $resultado=cargar_data($sql, $sender);\n $this->DataGrid->DataSource=$resultado;\n $this->DataGrid->dataBind();\n }", "function RoomstatRecordLoad( &$data ) {\n\t\t$table = BIT_DB_PREFIX.\"task_roomstat\";\n\t\t\n\t\t$pDataHash['data_store']['office'] = $data[0];\n\t\t$pDataHash['data_store']['terminal'] = $data[1];\n\t\t$pDataHash['data_store']['title'] = $data[2];\n\t\tif ( $data[3] == '[null]' )\n\t\t\t$pDataHash['data_store']['head'] = '';\n\t\telse\n\t\t\t$pDataHash['data_store']['head'] = $data[3];\n\t\tif ( $data[4] == '[null]' )\n\t\t\t$pDataHash['data_store']['announce'] = '';\n\t\telse\n\t\t\t$pDataHash['data_store']['announce'] = $data[4];\n\t\t$pDataHash['data_store']['ter_type'] = $data[5];\n\t\t$pDataHash['data_store']['led'] = $data[6];\n\t\tif ( $data[7] != '[null]' ) $pDataHash['data_store']['ledhead'] = $data[7];\n\t\tif ( $data[8] != '[null]' ) $pDataHash['data_store']['beacon'] = $data[8];\n\t\tif ( $data[9] != '[null]' ) $pDataHash['data_store']['camera'] = $data[9];\n\t\tif ( $data[10] != '[null]' ) $pDataHash['data_store']['serving'] = $data[10];\n\t\tif ( $data[11] != '[null]' ) $pDataHash['data_store']['act1'] = $data[11];\n\t\tif ( $data[12] != '[null]' ) $pDataHash['data_store']['fro_'] = $data[12];\n\t\tif ( $data[13] != '[null]' ) $pDataHash['data_store']['alarm'] = $data[13];\n\t\tif ( $data[14] != '[null]' ) $pDataHash['data_store']['curmode'] = $data[14];\n\t\tif ( $data[15] != '[null]' ) $pDataHash['data_store']['x1'] = $data[15];\n\t\tif ( $data[16] != '[null]' ) $pDataHash['data_store']['x2'] = $data[16];\n\t\tif ( $data[17] != '[null]' ) $pDataHash['data_store']['x3'] = $data[17];\n\t\tif ( $data[18] != '[null]' ) $pDataHash['data_store']['x4'] = $data[18];\n\t\tif ( $data[19] != '[null]' ) $pDataHash['data_store']['x5'] = $data[19];\n\t\tif ( $data[20] != '[null]' ) $pDataHash['data_store']['x6'] = $data[20];\n\t\tif ( $data[21] != '[null]' ) $pDataHash['data_store']['x7'] = $data[21];\n\t\tif ( $data[22] != '[null]' ) $pDataHash['data_store']['x8'] = $data[22];\n\t\tif ( $data[23] != '[null]' ) $pDataHash['data_store']['x9'] = $data[23];\n\t\tif ( $data[24] != '[null]' ) $pDataHash['data_store']['x10'] = $data[24];\n\t\tif ( $data[25] != '[null]' ) $pDataHash['data_store']['status'] = $data[25];\n\t\tif ( $data[26] != '[null]' ) $pDataHash['data_store']['logon'] = $data[26];\n\t\tif ( $data[27] != '[null]' ) $pDataHash['data_store']['ter_location'] = $data[27];\n\t\tif ( $data[28] != '[null]' ) $pDataHash['data_store']['ticketprint'] = $data[28];\n\t\tif ( $data[29] != '[null]' ) $pDataHash['data_store']['reportprint'] = $data[29];\n\t\tif ( $data[30] != '[null]' ) $pDataHash['data_store']['booking'] = $data[30];\n\t\tif ( $data[31] != '[null]' ) $pDataHash['data_store']['book'] = $data[31];\n\t\t$result = $this->mDb->associateInsert( $table, $pDataHash['data_store'] );\n\t}", "public function __invoke(): LoadsTables;", "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atenci&oacute;n</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }", "function LoadData($conn)\r\n{\r\n\tglobal $x_vencimiento_id;\r\n\t$sSql = \"SELECT * FROM `vencimiento`\";\r\n\t$sWhere = \"\";\r\n\t$sGroupBy = \"\";\r\n\t$sHaving = \"\";\r\n\t$sOrderBy = \"\";\r\n\tif ($sWhere <> \"\") { $sWhere .= \" AND \"; }\r\n\t$sTmp = (get_magic_quotes_gpc()) ? stripslashes($x_vencimiento_id) : $x_vencimiento_id;\r\n\t$sWhere .= \"(`vencimiento_id` = \" . addslashes($sTmp) . \")\";\r\n\t$sSql .= \" WHERE \" . $sWhere;\r\n\tif ($sGroupBy <> \"\") {\r\n\t\t$sSql .= \" GROUP BY \" . $sGroupBy;\r\n\t}\r\n\tif ($sHaving <> \"\") {\r\n\t\t$sSql .= \" HAVING \" . $sHaving;\r\n\t}\r\n\tif ($sOrderBy <> \"\") {\r\n\t\t$sSql .= \" ORDER BY \" . $sOrderBy;\r\n\t}\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\tif (phpmkr_num_rows($rs) == 0) {\r\n\t\t$bLoadData = false;\r\n\t}else{\r\n\t\t$bLoadData = true;\r\n\t\t$row = phpmkr_fetch_array($rs);\r\n\r\n\t\t// Get the field contents\r\n\t\t$GLOBALS[\"x_vencimiento_id\"] = $row[\"vencimiento_id\"];\r\n\t\t$GLOBALS[\"x_credito_id\"] = $row[\"credito_id\"];\r\n\t\t$GLOBALS[\"x_vencimiento_status_id\"] = $row[\"vencimiento_status_id\"];\r\n\t\t$GLOBALS[\"x_fecha_vencimiento\"] = $row[\"fecha_vencimiento\"];\r\n\t\t$GLOBALS[\"x_importe\"] = $row[\"importe\"];\r\n\t\t$GLOBALS[\"x_interes\"] = $row[\"interes\"];\r\n\t\t$GLOBALS[\"x_interes_moratorio\"] = $row[\"interes_moratorio\"];\r\n\t}\r\n\tphpmkr_free_result($rs);\r\n\treturn $bLoadData;\r\n}", "function loadDetails(){\r\n\r\n \t$DBH = connect();\r\n\t\t \r\n\t $query = $DBH->prepare(\"SELECT `DeliveryDate`,`Status`,`TrackingNum` FROM `packages` WHERE `UserProfileID` = :profileID ;\");\r\n\r\n\t $query->bindValue(':profileID',$_SESSION['$profileID']);\r\n\r\n\t $query->execute();\r\n\r\n\t $sth = $query->fetchAll(PDO::FETCH_NUM);\r\n\t \r\n\t //if there are details to enter to the table\r\n\t if (!empty($sth)){\r\n\r\n\t\t foreach ($sth as $row){\r\n\t\t \t\t\r\n echo \"<tr id='table1' class='tb'> \r\n \t\t\r\n <td>$row[0]</td>\r\n <td>$row[1]</td>\r\n <td>$row[2]</td>\r\n \r\n\r\n </tr> \"; \r\n\t }\r\n\t }\r\n\t //if there are not details to enter into the table\r\n\t else{\r\n\t \techo \"<tr class ='tb'><td></td><td></td><td></td></tr>\r\n\t \t\t <tr id='table1' class='tb'> \r\n\r\n\t <td></td>\r\n\t <td> <div id='alertNoPack' class='alert alert-info'>\r\n \t\t\t\t\t\t\t\t\t<strong>Add a package! </strong> click the Add button to start managing your packages.\r\n \t\t\t\t\t\t\t\t\t</div>\r\n \t\t\t\t\t\t\t\t</td>\r\n\t <td></td>\r\n\t </tr> \r\n\r\n\t \";\r\n\r\n\t } \r\n\r\n\r\n\r\n /*\r\n \r\n else{\r\n \techo \"Nothing to display\";\r\n }*/\r\n\t}", "public function load($id){\n\t\t$sql = 'SELECT * FROM aluno WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->getRow($sqlQuery);\n\t}", "function LoadData($conn)\r\n{\r\n\tglobal $x_entidad_id;\r\n\t\r\n\tphpmkr_free_result($rs);\r\n\treturn $bLoadData;\r\n}", "function get_load_data($bill){\n $CoID = $this->session->userdata('CoID') ;\n $WorkYear = $this->session->userdata('WorkYear') ;\n\n $sql =\"\n SELECT \n SaleMast.BillNo,\n SaleMast.BillDate,\n SaleMast.GodownID,\n SaleMast.BrokerID,\n SaleMast.BillAmt,\n SaleMast.LRNo,\n SaleMast.DeliDate,\n SaleMast.DebtorID,\n SaleMast.MudiBazar,\n SaleMast.EWayBillNo,\n SaleMast.PartyCode,\n SaleMast.CPName,\n SaleMast.Area,\n SaleMast.SaleType,\n SaleMast.HelMajuri,\n SaleMast.OtherChrgs,\n Godown.GodownDesc,\n ACMastDets.ACTitle As 'BrokerTitle'\n FROM SaleMast,Godown,ACMastDets\n WHERE SaleMast.CoID = '$CoID'\n and SaleMast.WorkYear = '$WorkYear'\n and SaleMast.BillNo = '$bill'\n and SaleMast.GodownID = Godown.GodownID\n and SaleMast.BrokerID = ACMastDets.ACCode\n and SaleMast.CoID = ACMastDets.CoID \n and SaleMast.WorkYear = ACMastDets.WorkYear\n \";\n $query = $this->db->query($sql);\n $result = $query->result();\n return $result;\n \n }", "public function load($id){\r\n\t\t$sql = 'SELECT * FROM tbl_empleado WHERE id_empleado = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($id);\r\n\t\treturn $this->getRow($sqlQuery);\r\n\t}", "function LoadData($conn)\r\n{\r\n\tglobal $x_credito_id;\r\n\t$sSql = \"SELECT * FROM `credito`\";\r\n\t$sWhere = \"\";\r\n\t$sGroupBy = \"\";\r\n\t$sHaving = \"\";\r\n\t$sOrderBy = \"\";\r\n\tif ($sWhere <> \"\") { $sWhere .= \" AND \"; }\r\n\t$sTmp = (get_magic_quotes_gpc()) ? stripslashes($x_credito_id) : $x_credito_id;\r\n\t$sWhere .= \"(`credito_id` = \" . addslashes($sTmp) . \")\";\r\n\t$sSql .= \" WHERE \" . $sWhere;\r\n\tif ($sGroupBy <> \"\") {\r\n\t\t$sSql .= \" GROUP BY \" . $sGroupBy;\r\n\t}\r\n\tif ($sHaving <> \"\") {\r\n\t\t$sSql .= \" HAVING \" . $sHaving;\r\n\t}\r\n\tif ($sOrderBy <> \"\") {\r\n\t\t$sSql .= \" ORDER BY \" . $sOrderBy;\r\n\t}\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\tif (phpmkr_num_rows($rs) == 0) {\r\n\t\t$bLoadData = false;\r\n\t}else{\r\n\t\t$bLoadData = true;\r\n\t\t$row = phpmkr_fetch_array($rs);\r\n\r\n\t\t// Get the field contents\r\n\t\t$GLOBALS[\"x_credito_id\"] = $row[\"credito_id\"];\r\n\t\t$GLOBALS[\"x_credito_tipo_id\"] = $row[\"credito_tipo_id\"];\r\n\t\t$GLOBALS[\"x_solicitud_id\"] = $row[\"solicitud_id\"];\r\n\t\t$GLOBALS[\"x_credito_status_id\"] = $row[\"credito_status_id\"];\r\n\t\t$GLOBALS[\"x_fecha_otrogamiento\"] = $row[\"fecha_otrogamiento\"];\r\n\t\t$GLOBALS[\"x_importe\"] = $row[\"importe\"];\r\n\t\t$GLOBALS[\"x_tasa\"] = $row[\"tasa\"];\r\n\t\t$GLOBALS[\"x_plazo\"] = $row[\"plazo\"];\r\n\t\t$GLOBALS[\"x_fecha_vencimiento\"] = $row[\"fecha_vencimiento\"];\r\n\t\t$GLOBALS[\"x_tasa_moratoria\"] = $row[\"tasa_moratoria\"];\r\n\t\t$GLOBALS[\"x_medio_pago_id\"] = $row[\"medio_pago_id\"];\r\n\t\t$GLOBALS[\"x_referencia_pago\"] = $row[\"referencia_pago\"];\r\n\t}\r\n\tphpmkr_free_result($rs);\r\n\treturn $bLoadData;\r\n}", "function loadDataToTableDef($table_def, $db_table, $key_val_id)\n{\n\tfor ($i=0;$i<sizeof($table_def);$i++)\n\t{\n\t\t//$table_def[$i][0] is either an array of hirzontal table defs or a table def\n\t\tif (isset($table_def[$i][0]['db_field']))\n\t\t{\n\t\t\t$table_def[$i] = selectSingleTableDataFromID($db_table, $key_val_id, $table_def[$i]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$horizontal_html_table = array();\n\t\t\tfor ($j=0;$j<sizeof($table_def[$i]);$j++)\n\t\t\t{\n\t\t\t\t//this is a horizontal table array\n\t\t\t\t\t\n\t\t\t\t\t$table_def[$i][$j] = selectSingleTableDataFromID($db_table, $key_val_id, $table_def[$i][$j]);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\treturn $table_def;\n}", "protected function process_load($data)\n\t{\n\t\t$parsed_data = array();\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (strpos($key, ':'))\n\t\t\t{\n\t\t\t\tlist($table, $field) = explode(':', $key);\n\t\t\t\tif ($table == $this->_table_name)\n\t\t\t\t{\n\t\t\t\t\t$parsed_data[$field] = $value;\n\t\t\t\t}\n\t\t\t\telseif ($field)\n\t\t\t\t{\n\t\t\t\t\t$this->_lazy[inflector::singular($table)][$field] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$parsed_data[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t$this->_data = $parsed_data;\n\t}", "private function table_data()\n {\n $data = array();\n $args = array( \n 'post_type' => 'sutabu_ppdb',\n 'post_status' => 'publish',\n 'orderby' => 'title', \n 'order' => 'ASC', \n );\n\n $the_query = new WP_Query( $args );\n\n if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post();\n $data[] = array(\n 'id' => $dt->ID,\n 'perusahaan' => the_title(),\n 'total_ken' => the_content(),\n 'total_pen' => 'ok',\n 'tanggal' => 'ok'\n ); \n endwhile; endif;\n wp_reset_postdata();\n\n return $data;\n }", "public function actionAjaxPriceLoad()\n\t{\n $service_id=$_REQUEST['val'];\n //echo $service_id;die;\n\t\t$res=ServicePrice::model()->with('serviceType','additionalAttrs')->findAll(array(\"condition\"=>\"service_id=\".$service_id));\n\t\t//$a=$res->serviceType['service_name'];\n\t\t// /echo \"<pre>\";print_r($a);die;\n\t\t//echo \"<pre>\";print_r($res);die;\n\t\t/*$baseUrl = Yii::app()->baseUrl; \n $cs = Yii::app()->getClientScript(); \n \t$cs->registerScriptFile($baseUrl.'/themes/back/js/config.js');\n \t$cs->registerScriptFile($baseUrl.'/themes/back/js/script.js');*/\n\t\techo \"\n \n\t\n <table class='datatable'>\n\t\t\t\n\t\t\t\t\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t <th>Sr No</th>\n\t\t\t\t\t\t<th class='sort'>Service Type</th>\n\t\t\t\t\t\t<th>No of Beds</th>\n\t\t\t\t\t\t<th>No of Baths</th>\n\t\t\t\t\t\t<th>Property size</th>\n\t\t\t\t\t\t<th>Area</th>\n\t\t\t\t\t\t<th>No of Desk</th>\n\t\t\t\t\t\t<th>Price</th>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t</thead> \";\n\t\t\t\techo \" <tbody> \";\n\t\t\t\t\t $i=1; \n\t\t\t\t\t foreach($res as $r ) { \t\t\t\t \t\n\t\t\t\t \n\t\t\t\t \t echo \"<tr class='gradeX'>\";\n\t\t\t\t\t echo\"<td>\".$i++; \"</td>\";\n\t\t\t\t\t\techo\"<td>\".$r->serviceType['service_name'].\"</td>\";\n\t\t\t\t\t\techo \"<td>\".$r['no_of_beds'].\"</td>\";\n\t\t\t\t\t\techo\"<td>\".$r['no_of_baths'].\"</td>\";\n\t\t\t\t\t\techo\"<td>\".$r['property_size'].\"</td>\";\n\t\t\t\t\t\techo\"<td>\".$r['area'].\"</td>\";\n\t\t\t\t\t\techo\"<td>\".$r['no_of_desk'].\"</td>\";\n\t\t\t\t\t\techo\"<td>\".$r['price'].\"$\".\"</td>\";\n\t\t\t\t\t\t//echo\"<td>\"..\"</td>\";\n\t\t\t\t\t\t\n\t\t\t\t\techo\"</tr>\";\n\t\t\t\t\t} \n\t\t\t\techo \"</tbody>\n\t\t\t</table>\";$baseUrl = Yii::app()->baseUrl; \n $cs = Yii::app()->getClientScript(); \n \t$cs->registerScriptFile($baseUrl.'/themes/back/js/config.js');\n \t$cs->registerScriptFile($baseUrl.'/themes/back/js/script.js');die;\n\t\t\n\t\t\n\t}", "public function datatable_rekening_tabungan_setup()\n\t{\n\t\t$aColumns = array( '','mfi_cif.cif_no','mfi_cif.nama','product_name','account_saving_no','');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"WHERE (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_rekening_tabungan_setup($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_rekening_tabungan_setup($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_rekening_tabungan_setup(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$rembug='';\n\t\t\tif($aRow['cm_name']!=\"\"){\n\t\t\t\t$rembug=' <a href=\"javascript:void(0);\" class=\"btn mini green-stripe\">'.$aRow['cm_name'].'</a>';\n\t\t\t}\n\t\t\t$row = array();\n\t\t\t$row[] = '<input type=\"checkbox\" value=\"'.$aRow['account_saving_id'].'\" id=\"checkbox\" class=\"checkboxes\" >';\n\t\t\t$row[] = $aRow['cif_no'];\n\t\t\t$row[] = $aRow['nama'].$rembug;\n\t\t\t$row[] = $aRow['product_name'];\n\t\t\t$row[] = $aRow['account_saving_no'];\n\t\t\t$row[] = '<div align=\"center\"><a href=\"javascript:;\" class=\"btn mini purple\" account_saving_id=\"'.$aRow['account_saving_id'].'\" id=\"link-edit\"><i class=\"icon-edit\"></i> Edit</a></div>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}", "function loadTable($header, $body){\n \n echo \"<div id='container'>\";\n echo \"<div class='demo_jui'>\";\n echo \"<table cellpadding='0' cellspacing='0' border='0' class='display' id='example'>\";\n echo \"<thead>\";\n echo \"<tr>\";\n for($i=0;$i<sizeof($header);$i++){ \n echo \"<th class='center'>{$header[$i]}</th>\";\n }\n echo \"<th class='center'></th>\";\n echo \"<th class='center'></th>\";\n echo \"</tr>\";\n echo \"</thead>\";\n echo \"<tbody>\";\n for($i=0;$i<sizeof($body);$i++){\n echo \"<tr class='gradeB'>\";\n for($j=0;$j<sizeof($body[$i]);$j++){\n echo \"<td class='center' name='identity{$j}'>{$body[$i][$j]}</td>\" ;\n }\n echo \"<td class='center'><form id ='edit' action=''><input type='hidden' name ='edit' id='edit' value='{$body[$i][0]}'/><input type='hidden' value='Edit' /></form></td>\";\n echo \"<td class='center'><form id ='delete' action='Delete.jsp'><input type='hidden' name ='delete' id='delete' value='{$body[$i][$j]}'/><input type='submit' value='Delete' /></form></td>\";\n echo \"</tr>\";\n \n }\n echo \"</tbody>\"; \n echo \"</table>\";\n echo \"</div>\";\n echo \"</div>\";\n }", "public function load($id){\r\n\t\t$sql = 'SELECT * FROM contenidos WHERE id = ?';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\t$sqlQuery->setNumber($id);\r\n \r\n\t\treturn $this->getRow($sqlQuery);\r\n\t}", "function newskomentar_listdata($tbl_newskomentar){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar\");\n\t\treturn $sql;\n}", "public function load() {\n $importItemsTempManager = ImportItemsTempManager::getInstance();\n $categoryHierarchyManager = CategoryHierarchyManager::getInstance();\n $categoryManager = CategoryManager::getInstance();\n $companyManager = CompanyManager::getInstance();\n $company_id = $_REQUEST['company_id'];\n $companyDto = $companyManager->selectByPK($company_id);\n $this->addParam('companyDto', $companyDto);\n $used_columns_indexes_array = array(2/* name */, 1/* model */, 9/* brand */, 3/* dealer price $ */, 4/* $dealer price amd */, 5/* vat $ */, 6/* vat amd */, 7/* warranty */); //explode(',', $_REQUEST['used_columns_indexes']);\n\n $customerLogin = $this->getCustomerLogin();\n $priceRowsDtos = $importItemsTempManager->getUserCurrentPriceNewRows($customerLogin);\n foreach ($priceRowsDtos as $dto) {\n $itemModel = $dto->getModel();\n if (empty($itemModel)) {\n $model = $importItemsTempManager->findModelFromItemTitle($dto->getDisplayName());\n if (!empty($model)) {\n $dto->setSupposedModel($model);\n }\n } else {\n $dto->setSupposedModel($itemModel);\n }\n }\n\n\n $columnNames = ImportPriceManager::getColumnNamesMap($used_columns_indexes_array);\n\n $rootDto = $categoryManager->getRoot();\n $firstLevelCategoriesHierarchyDtos = $categoryHierarchyManager->getCategoryChildren($rootDto->getId());\n $firstLevelCategoriesNamesDtos = $categoryHierarchyManager->getCategoriesNamesByParentCategoryId($rootDto->getId());\n\n\n $firstLevelCategoriesIds = array();\n foreach ($firstLevelCategoriesHierarchyDtos as $key => $category) {\n $firstLevelCategoriesIds[] = $category->getChildId();\n }\n $firstLevelCategoriesNames = array();\n foreach ($firstLevelCategoriesNamesDtos as $key => $category) {\n $firstLevelCategoriesNames[] = $category->getDisplayName();\n }\n\n $this->addParam('columnNames', $columnNames);\n $this->addParam('priceRowsDtos', $priceRowsDtos);\n $this->addParam('firstLevelCategoriesNames', $firstLevelCategoriesNames);\n $this->addParam('firstLevelCategoriesIds', $firstLevelCategoriesIds);\n\n if (isset($_REQUEST['new_items_row_ids'])) {\n $this->addParam('new_items_row_ids', explode(',', $_REQUEST['new_items_row_ids']));\n }\n }", "protected function importData()\n\t{\n\t\tinclude_once \"Services/ADN/AD/classes/class.adnPersonalData.php\";\n\t\t$data = adnPersonalData::getData($this->filter, $this->mode);\n\t\t$this->setData($data);\n\t\t//$this->setMaxCount(sizeof($users));\n\t}", "public function loadInfo()\n\t{\n\t\t$this->_info = $this->_adapter->describeTable($this->_identifier);\n\t}", "abstract public function get_rows();", "function load($table_id){\n\t\tglobal $misc;\n $array= array();\n \n\t\t// Creates a new database access object.\n\t\t$driver = $misc->getDatabaseAccessor(\"phppgadmin\");\n\t\t$sql = \"SELECT page_column_id,column_name, page_order,\"\n\t\t\t. \" on_page, display_name, remote_table,remote_column \"\n\t\t\t. \"FROM crudgen.page_columns \"\n\t\t\t. \"WHERE page_tables_id={$table_id} ORDER BY page_order ASC\";\n\n\t\t$rs = $driver->selectSet($sql);\n\n\t\twhile(!$rs->EOF){\n\t\t\t$tmpfield = new Columns();\n\t\t\t$tmpfield->id = $rs->fields['page_column_id'];\n\t\t\t$tmpfield->name = $rs->fields['column_name'];\n\t\t\t$tmpfield->order =$rs->fields['page_order'];\n\t\t\t$tmpfield->on_page = $rs->fields['on_page'];\n\t\t\t$tmpfield->display_name = $rs->fields['display_name'];\n\t\t\t$tmpfield->remote_table= $rs->fields['remote_table'];\n\t\t\t$tmpfield->remote_field=$rs->fields['remote_column'];\n\t\t\t$array[] = $tmpfield;\n\t\t\t$rs->moveNext();\n\t\t}\n return $array;\n\t}", "function datatable(){\n \n $page = $_POST['page']; // get the requested page\n\t\t$limit = $_POST['rows']; // get how many rows we want to have into the grid\n\t\t$sidx = $_POST['sidx']; // get index row - i.e. user click to sort\n\t\t$sord = $_POST['sord']; // get the direction\n\t\tif(!$sidx) $sidx =1;\n\n\t\t$fields_arrayPackage = array(\n\t\t\t'j.radiographer_first_id','j.radiographer_first_name','u.first_name','j.radiographer_first_createOn as createOn','u1.first_name as firstname','j.radiographer_first_updateOn as updateOn'\n\t\t);\n\t\t$join_arrayPackage = array(\n\t\t\t'users AS u' => 'u.id = j.radiographer_first_createBy',\n\t\t\t'users AS u1' => 'u1.id = j.radiographer_first_updateBy',\n\t\t);\n\t\t$where_arrayPackage = array('j.radiographer_first_show_status' =>'1');\n\t\t$orderPackage = $sidx.' '. $sord;\n\n\t\t$count = $this->mcommon->join_records_counts($fields_arrayPackage, 'jr_radiographer_first as j', $join_arrayPackage, $where_arrayPackage, '', $orderPackage);\n\n\t\tif( $count >0 ) {\n\t\t\t$total_pages = ceil($count/$limit);\n\t\t} else {\n\t\t\t$total_pages = 0;\n\t\t}\n\t\tif ($page > $total_pages) $page=$total_pages;\n\t\t$start = $limit*$page - $limit; // do not put $limit*($page - 1)\n\n\t\t$responce->page = $page;\n\t\t$responce->total = $total_pages;\n\t\t$responce->records = $count;\n\t\t$dataTable_Details = $this->mcommon->join_records_all($fields_arrayPackage, 'jr_radiographer_first as j', $join_arrayPackage, $where_arrayPackage, '', $orderPackage,'object');\n\n\t\tif (isset($dataTable_Details) && !empty($dataTable_Details)) {\n\t\t\t$i=0;\n\t foreach ($dataTable_Details->result() as $dataDetail) {\n\t \t$responce->rows[$i]['id'] = $dataDetail->radiographer_first_id;\n\t \t//$responce->rows[$i]['cell']= array($dataDetail->ndtContractor_id);\n\t \t$responce->rows[$i]['cell']['edit_radiographer_first_id'] = get_buttons_new_only_Edit($dataDetail->radiographer_first_id,'master/Radiographer1/');\n\t \t$responce->rows[$i]['cell']['delete_radiographer_first_id'] = get_buttons_new_only_Delete($dataDetail->radiographer_first_id,'master/Radiographer1/');\n\t \t$responce->rows[$i]['cell']['radiographer_first_name'] = $dataDetail->radiographer_first_name;\n\t \t$responce->rows[$i]['cell']['first_name'] = $dataDetail->first_name;\n\t \t$responce->rows[$i]['cell']['createOn'] = get_date_timeformat($dataDetail->createOn);\n\t \t$responce->rows[$i]['cell']['firstname'] = $dataDetail->firstname;\n\t \t$responce->rows[$i]['cell']['updateOn'] = get_date_timeformat($dataDetail->updateOn);\n\t \t\t$i++;\n\t }\n\t //$responce->userData['page'] = $responce->page;\n\t //$responce->userData['totalPages'] = $responce->total;\n\t $responce->userData->totalrecords = $responce->records;\n\t } \n\t\techo json_encode($responce);\n }", "private function _fetch_table()\n {\n if (!isset($this->table))\n {\n $this->table = $this->_get_table_name(get_class($this));\n }\n }", "public function datatable_insurance_setup()\n\t{\n\t\t/* Array of database columns which should be read and sent back to DataTables. Use a space where\n\t\t * you want to insert a non-database field (for example a counter or static image)\n\t\t */\n\t\t$aColumns = array( '','mfi_account_insurance.account_insurance_no', 'mfi_cif.nama', 'mfi_product_insurance.product_name','mfi_account_insurance.status_rekening');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"WHERE (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch']).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"WHERE \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_insurance_setup($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_insurance_setup($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_insurance_setup(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\n\t\t\t$row[] = '<input type=\"checkbox\" value=\"'.$aRow['account_insurance_id'].'\" id=\"checkbox\" class=\"checkboxes\" >';\n\t\t\t$row[] = $aRow['account_insurance_no'];\n\t\t\t$row[] = $aRow['nama'];\n\t\t\t$row[] = $aRow['product_name'];\n\t\t\t$row[] = $aRow['status_rekening'];\n\t\t\t\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}" ]
[ "0.7289456", "0.7276894", "0.7203309", "0.6939697", "0.6935157", "0.67964447", "0.67687416", "0.67539597", "0.6640695", "0.6482271", "0.6473478", "0.6467698", "0.6443425", "0.6409087", "0.64024234", "0.63966", "0.63871753", "0.63666385", "0.63610893", "0.63512236", "0.6332777", "0.63324165", "0.6330095", "0.63207215", "0.63129383", "0.62978685", "0.62587464", "0.6257991", "0.6249517", "0.62333673", "0.6226347", "0.62183", "0.6191582", "0.6188734", "0.61874545", "0.61581737", "0.61465", "0.6124942", "0.6123724", "0.611827", "0.6114327", "0.6080688", "0.6066222", "0.6064678", "0.6047986", "0.60467905", "0.60394466", "0.60362566", "0.60348755", "0.60190433", "0.60183173", "0.6006265", "0.599966", "0.5985207", "0.5976297", "0.59753776", "0.5971446", "0.5968546", "0.5962707", "0.5960118", "0.5959686", "0.5944559", "0.592853", "0.59281063", "0.5917072", "0.5912307", "0.59095144", "0.5900822", "0.58981377", "0.58959484", "0.5890177", "0.58894396", "0.5877844", "0.5872957", "0.5867573", "0.5864798", "0.5863197", "0.58609", "0.5855439", "0.5851258", "0.5850109", "0.5847671", "0.5837232", "0.5831051", "0.581807", "0.58140236", "0.58126104", "0.58100843", "0.57994765", "0.5796225", "0.57933503", "0.5775274", "0.5773988", "0.5770636", "0.57701993", "0.5769238", "0.57663083", "0.5766009", "0.5760909", "0.57602894", "0.5746612" ]
0.0
-1
function load 1 data on tabele
public function loadRows($option = array()){ if(!$option){ if(!$result = $this->execute()) return false; } else{ if(!$result = $this->execute($option)) return false; } return $result->fetch(PDO::FETCH_OBJ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadData(){\r\n\t\t\t $pseudo = addslashes($this -> getPseudo()) ;\r\n\r\n\t\t if(! empty($pseudo)){\r\n\t\t\t$q = \"select * from UserTab where User_pseudo='\".$pseudo.\"'\";\r\n\t\t\t$r = execute($q);\r\n\t\t\twhile( $l = mysql_fetch_assoc($r) ){\r\n\t\t\t\t$this -> setFields($l);//Affectation aux champs de l'objet UserTab \r\n\t\t\t}\r\n\t\t }\r\n\r\n\t }", "abstract public function loadData();", "public function getloadTab($patientId,$careplanId,Request $request)\r\n {\r\n $dataView['data']=''; \r\n try{ \r\n $id = encrypt_decrypt('decrypt',$careplanId);\r\n $patient_id = encrypt_decrypt('decrypt',$patientId);\r\n } catch (\\Exception $e) {\r\n abort(404);\r\n exit;\r\n }\r\n if ($request->ajax()) {\r\n if ($request->has('tab') && $request->input('tab') == 'team') {\r\n $carePlanDetail = $this->careplan->getCareplanDetail($id);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.careteam_tab')->with('carePlanDetail', $carePlanDetail)->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'otherinfo') {\r\n $patient = $this->patient->patientDetail($patientId, true);\r\n $otherContacts = $patient['patient_other_info']['otherContacts'];\r\n $dataView['data'] = View::make('patients.caseload.care_plan.other_info_tab')->with('otherContacts', $otherContacts)->render();\r\n \r\n }\r\n if ($request->has('tab') && $request->input('tab') == 'emergency_contact') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.emergency_contact_info_tab')->with('patient', $patient['patient_info'])->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'diagnosis_goals') {\r\n\r\n $careplanId = encrypt_decrypt('decrypt',$careplanId);\r\n $diagnosisList = $this->careplan->getCareplanDiagnosis($careplanId);\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.diagnosis_goal_tab')->with('diagnosisList', $diagnosisList)->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'medication') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $previous_medications = $this->medication->medicationList($patient_id);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.medication_tab')->with('previous_medications', $previous_medications)->with('patient', $patient['patient_info'])->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'allergy') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $previous_allergies = $this->allergy->allergyLists($patient_id);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.allergy_tab')->with('previous_allergies', $previous_allergies)->with('patient', $patient['patient_info'])->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'vital') {\r\n\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $vitalList = $this->assessment->getVitalListForCareplan($careplanId, $patientId);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.vital_tab')->with('vitalList', $vitalList)->with('patient', $patient['patient_info'])->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'assessments') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $assessmentList = $this->assessment->getLists($patient_id,$id);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.assessments_tab')->with('assessmentList', $assessmentList)->with('patient', $patient['patient_info'])->with('id', $id)->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'checkpoints') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $checkpointList = $this->checkpoint->getLists($patient_id,$id);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.checkpoints_tab')->with('checkpointList', $checkpointList)->with('patient', $patient['patient_info'])->with('id', $id)->render();\r\n \r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'barriers') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $barrierList = $this->assessment->getBarrierListForCareplan($careplanId, $patientId);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.barriers_tab')->with('barrierList', $barrierList)->with('patient', $patient['patient_info'])->render();\r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'intervention') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $interventionList = $this->intervention->getLists($patient_id,$id);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.interventions_tab')->with('interventionList', $interventionList)->with('patient', $patient['patient_info'])->with('id', $id)->render();\r\n }\r\n\r\n if ($request->has('tab') && $request->input('tab') == 'notes') {\r\n $patient = $this->patient->patientDetail($patientId, false);\r\n $carePlanDetail = $this->careplan->getCareplanDetail($id);\r\n $dataView['data'] = View::make('patients.caseload.care_plan.notes_tab')->with('carePlanDetail', $carePlanDetail)->render();\r\n }\r\n }\r\n return response()->json(['html'=>$dataView],200);\r\n }", "public function tampilDataGalang(){\n\t\t\n\t}", "function loadData()\n\t{\n\t\tstatic $data;\n\t\t\n\t\tif(!$data)\n\t\t\t$data=self::getData();\n\n\t\tif(isset($data[$this->id]))\n\t\t\t$this->setValues((array)$data[$this->id]);\t\t\t\n\t}", "public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\t}", "function resultdata($tabel_name,$param='',$method='get',$status=FALSE){\n $this->Main_model->tabel_name($tabel_name);\n $this->Main_model->set_parameter($param);\n $result = $this->Main_model->response_result($method,$status);\n $this->response($result);\n }", "function resultdata($tabel_name,$param='',$method='get',$status=FALSE){\n $this->Main_model->tabel_name($tabel_name);\n $this->Main_model->set_parameter($param);\n $result = $this->Main_model->response_result($method,$status);\n $this->response($result);\n }", "function loadDataBarang_pr1($idgroup_barang=\"\") {\n\t\t$grid = new GridConnector($this->db->conn_id);\n $grid->render_sql(\"select a.id,a.idgroup_barang,a.nmbarang,b.nmjenis from v_master_barang_detail a inner join ref_jenis_barang b on a.idjns_item = b.idjenis where a.is_active = '1' and a.sts_jual = '1' and a.idgroup_barang like '%\".$idgroup_barang.\"%' group by a.idgroup_barang\",\"id\",\"idgroup_barang,nmbarang,nmjenis\");\n\t}", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "function horarios()\n {\n $this->view2->__construct($this->dataView,$this->dataTable);\n $this->view2->show();\n }", "public function tabel_barangkeluar()\n {\n $data['list_data'] = $this->M_kasir->select('tb_barang_keluar');\n $data['avatar'] = $this->M_kasir->get_data_gambar('tb_upload_gambar_user',$this->session->userdata('name'));\n $this->load->view('kasir/tabel/tabel_barangkeluar',$data);\n }", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "function jabatan_data()\n\t{\t\t\n\t\t$data['j'] = $this->M_master->data_jabatan();\t\n\t\t$data['title'] = 'Data Jabatan';\t\t\n\t\t$data['isi'] = 'contents/jabatan_data';\n\t\t$this->load->view('wrapper', $data);\n\t}", "public function datatables()\n\t{\n\t\t//menunda loading (bisa dihapus, hanya untuk menampilkan pesan processing)\n\t\t// sleep(2);\n\n\t\t//memanggil fungsi model datatables\n\t\t$list = $this->m_guestbook->get_datatables();\n\t\t$data = array();\n\t\t$no = $this->input->post('start');\n\n\t\t//mencetak data json\n\t\tforeach ($list as $field) {\n\t\t\t$no++;\n\t\t\t$row = array();\n\t\t\t$row[] = $no;\n\t\t\t$row[] = $field['nama'];\n\t\t\t$row[] = $field['nim'];\n\t\t\t$row[] = $field['email'];\n\t\t\t$row[] = $field['date'];\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\t//mengirim data json\n\t\t$output = array(\n\t\t\t\"draw\" => $this->input->post('draw'),\n\t\t\t\"recordsTotal\" => $this->m_guestbook->count_all(),\n\t\t\t\"recordsFiltered\" => $this->m_guestbook->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n\n\t\t//output dalam format JSON\n\t\techo json_encode($output);\n\t}", "function cargarTablaCombo($idCombo){\n #$namePro =$this->_admin->listar($query); //echo $namePro[0][0].\"<br>\";\n $query = \"SELECT * FROM `combo` WHERE codigo_padre = '\".$idCombo.\"'\";\n $data =$this->_admin->listar($query);\n //$data[0][0] = $namePro[0][0];\n echo json_encode($data);\n }", "function cargar_data($sender, $param)\n {\n $id=$this->Request['id'];\n $sql=\"SELECT id,tipo,denominacion,monto\n FROM organizacion.personas_cargos_asignaciones WHERE(cargo='$id') order by tipo ASC \";\n $resultado=cargar_data($sql, $sender);\n $this->DataGrid->DataSource=$resultado;\n $this->DataGrid->dataBind();\n }", "function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }", "function load_exam_data(){\n\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\t\t\n\t\t$act_mode \t = mysqli_real_escape_string($con,$_POST['act_mode']);\n\t\t$txteid \t\t = mysqli_real_escape_string($con,$_POST['txteid']);\n\n\t\t$sql = \"SELECT * FROM exam WHERE examID='$txteid';\";\n $resultget = mysqli_query($con,$sql) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n echo json_encode($recget);\n\n\t}", "public function listtabelTAPAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('TATA PERSURATAN');\n }", "public function listdataTAPAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('TATA PERSURATAN');\n }", "function load_data_for_preview_in_pfac($id){\n\t\t\n\t\t$settings = $this->grab_db_settings();\n\t\t$connection = DBFunctions::db_connect($settings->db_settings);\n\t\t$param_array1 = array('first_name', 'last_name', 'date_of_birth', 'nationality', 'club', 'player_Cat_id', 'height', 'weight', 'position', 'comment', \n\t\t\t\t\t\t\t 'photo_url', 'cv_url', 'video_url', 'webpage_url', 'player_web_page');\t\t\t\t\t\t\t\t\t\t\n\t\t$param_array2 = array('club', 'appearances', 'goals');\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tunset($settings);\t\t\n\t\treturn array_merge(\n\t\t\t\t\t\t\tarray($this->retrive_history_details_for_single_pfac_in_preview($id, $param_array2)),\t\t\n\t\t\t\t\t\t\t$this->retrive_general_details_for_single_pfac_in_preview($id, $param_array1)\n\t\t\t\t\t\t );\t\t\n\t}", "public function tabel_data()\n {\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_users\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $user_id_array [] = $data['id'];\n }\n }\n\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_lbb\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $lbb_id_array [] = $data['id'];\n }\n }\n\n foreach ($user_id_array as $user_id){\n foreach ($lbb_id_array as $lbb_id){\n $rating = \"0\";\n $tampil = $this->koneksi()->prepare(\"SELECT rating FROM tb_rating WHERE user_id=:user_id AND lbb_id=:lbb_id\");\n $tampil->bindParam(':user_id', $user_id);\n $tampil->bindParam(':lbb_id', $lbb_id);\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $rating = $data['rating'];\n }\n }\n $tabel_data [$user_id] [$lbb_id] = $rating;\n }\n }\n\n return $tabel_data;\n }", "public function get_data(){\n // $id = 2;\n // $stmt = $this->verivied()->prepare(\"SELECT * FROM emptab WHERE id= :id\");\n // $stmt->bindParam(':id', $id);\n // $stmt->execute();\n // $data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n // return $data;\n // select by id;\n $data1 = $this->Xgen->select('id,nama')->from('emptab')->where('id = :id', 4)->go();\n // select all;\n //$data = $this->Xgen->select('id,nama')->from('emptab')->go();\n // inser data\n // $data = $this->Xgen->insert_query('emptab',[\n // 'nama' => 'bxel'\n // ])->go();\n //update data\n //$data = $this->Xgen->update_query('emptab', ['nama' => 'new name'])->where('id = :id', 4)->go();\n //DELETE\n //$data1 = $this->Xgen->delete('emptab','id = :id',4)->go();\n\n }", "function load(){\n\t\t\tif (isset($this->params['id'])){\n\t\t\t\tif (isset($_GET['pag'])){\n\t\t\t\t\t$_GET['pag']=filter_input(INPUT_GET, 'pag', FILTER_SANITIZE_STRING);\n\t\t\t\t}else{\n\t\t\t\t\t$_GET['pag']=1;\n\t\t\t\t}\n \t\t/*$idCategoria=filter_input(INPUT_POST, 'idCategoria', FILTER_SANITIZE_STRING);\n\t\t\t\t$pagina=filter_input(INPUT_POST, 'pagina', FILTER_SANITIZE_STRING);*/\n\t\t\t\t$res=$this->model->comprobarExisteCategoria($this->params['id']);\n\t\t\t\tif($res==true){\n\t\t\t\t\t$contGames=$this->model->contadorPaginasGamesCategoria($this->params['id']);\n\t\t\t\t\tif($_GET['pag']<=$contGames[0][\"maxPaginas\"]){\n\t\t\t\t\t\t$games=$this->model->gamesCategoria($this->params['id'],$_GET['pag']);\n\t\t\t $games=utf8_string_array_encode($games);\n\t\t\t $parametros = array_merge($this->menu, $games, $contGames);\n\t\t \t$this->view= new vCategoria($parametros);\n\t\t\t\t\t}else{\n\t\t\t\t\t\theader(\"Location: \".APP_W.'categoria/load/id/'.$this->params['id']);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\theader(\"Location: \".APP_W);\n\t\t\t\t}\n \t}\n }", "protected function loadRow() {}", "public function reloadTableData(){\r\n\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t \t$data[\"formlist\"] = $this->AB->list_of_admission_form();\r\n\t\t$user_id = $this->session->userdata(\"user_id\");\r\n\t\t$data[\"myttl\"] = $this->AB->getUserUploadedForm($user_id);\r\n\t\t$data[\"ttl\"] = $this->AB->getUserUploadedForm($user_id=NULL);\r\n\t\t$this->load->view('gs_admission/issuance/form_list',$data);\r\n\t\t}", "public function load_data($id=null){\r\n \t//$this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \t//$data=$this->Apimodel->getSub($id);//submiss,soal\r\n\t \t// $data['problem']=$this->Apimodel->getProblem();\r\n\t \t$ids = $this->Apimodel->submitProblem(1,'1-4.cpp');\r\n\t \techo('<pre>');\r\n\t\tprint_r($ids);\r\n\t\techo('</pre>');\r\n\r\n\r\n\t}", "function tampil_detail(){\n\n\t\t$id_pengiriman\t =\t$this->uri->segment(3);\n\t\t$data['record'] =\t$this->M_pengiriman->detail($id_pengiriman)->result();\n\t\t$data['record2'] =\t$this->M_pengiriman->detail($id_pengiriman)->row_array();\n\t\t$this->template->content->view('Pengiriman/Detail',$data);\n\t\t$this->template->publish();\n\n\t}", "function get_tab_data_if_any($data)\n{\n\tif(!empty($data['b'])){\n\t\t$data['activetab'] = decryptValue($data['b']);\n\t}\n\tif(!empty($data['s'])){\n\t\t$data['currentlink'] = decryptValue($data['s']);\n\t}\n\t\n\treturn $data;\n}", "private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }", "public function load($data);", "public function tampil() {\n\t\t$data['dataPetani'] = $this->M_dpetani->select_all();\n\t\t$this->load->view('datapetani/list_data', $data);\n\t}", "public function listtabelAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('%');\n }", "public function onLoad($param)\n {\n parent::onLoad($param);\n if(!$this->IsPostBack)\n {\n $sql=\"select * from presupuesto.bancos order by nombre\";\n $bancos=cargar_data($sql,$this);\n $this->drop_bancos->DataSource=$bancos;\n $this->drop_bancos->dataBind();\n }\n }", "function cargar_dato($dato)\t\t\t\r\n {\r\n $ncampos=5;\r\n\tif($ncampos==count($dato))\r\n\t{\r\n\t $this->id_aplicacion=$dato[0];\r\n\t $this->nombre_subaplicacion=$dato[1]; \r\n $this->file_subaplicacion=$dato[2];\r\n $this->imagen_subaplicacion=$dato[3];\r\n $this->orden_subaplicacion=$dato[4];\r\n\t} \r\n }", "function getTablas() {\n $tablas['departamento']['id'] = 'departamento';\n $tablas['departamento']['nombre'] = 'Departamentos';\n\n $tablas['departamento_region']['id'] = 'departamento_region';\n $tablas['departamento_region']['nombre'] = 'Departamentos (Region)';\n\n $tablas['municipio']['id'] = 'municipio';\n $tablas['municipio']['nombre'] = 'Municipios';\n\n $tablas['operador']['id'] = 'operador';\n $tablas['operador']['nombre'] = 'Operador';\n\n $tablas['pais']['id'] = 'pais';\n $tablas['pais']['nombre'] = 'Paises';\n\n $tablas['ciudad']['id'] = 'ciudad';\n $tablas['ciudad']['nombre'] = 'Ciudades';\n\n $tablas['familias']['id'] = 'familias';\n $tablas['familias']['nombre'] = 'Familias';\n\n $tablas['monedas']['id'] = 'monedas';\n $tablas['monedas']['nombre'] = 'Monedas';\n\n $tablas['cuentas_financiero']['id'] = 'cuentas_financiero';\n $tablas['cuentas_financiero']['nombre'] = 'Cuentas';\n\n $tablas['cuentas_financiero_ut']['id'] = 'cuentas_financiero_ut';\n $tablas['cuentas_financiero_ut']['nombre'] = 'Cuentas UT';\n\n $tablas['cuentas_financiero_tipo']['id'] = 'cuentas_financiero_tipo';\n $tablas['cuentas_financiero_tipo']['nombre'] = 'Tipos de Cuentas';\n\n $tablas['extracto_movimiento']['id'] = 'extracto_movimiento';\n $tablas['extracto_movimiento']['nombre'] = 'Movimientos';\n\n $tablas['centropoblado']['id'] = 'centropoblado';\n $tablas['centropoblado']['nombre'] = 'Centros Poblados';\n\n $tablas['encuesta_tipo']['id'] = 'encuesta_tipo';\n $tablas['encuesta_tipo']['nombre'] = 'Tipo de Encuesta';\n\n $tablas['actividades_tipo']['id'] = 'actividades_tipo';\n $tablas['actividades_tipo']['nombre'] = 'Planes de Actividades';\n\n $tablas['tipohallazgo']['id'] = 'tipohallazgo';\n $tablas['tipohallazgo']['nombre'] = 'Tipo Hallazgo';\n\n asort($tablas);\n return $tablas;\n }", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "function view() {\n\t\tif (!is_blank($this->params['cod_curso'])){\n $cod_curso = $this->params['cod_curso'];\n $cod_programa = $this->TSubgrupo->programa($cod_curso);\n $this->vista->set('cod_programa', $cod_programa);\n }\n \n\t\t$this->vista->addJS(\"jquery.dataTable\");\n\t\t\n\t\t$estudiantes = null;\n\t\tif($this->TPrograma->esta_activo($cod_programa))\n {\n\t\t\t$estudiantes = $this->TSubgrupo->inscritosActivos($cod_curso);\n\t\t}\n else\n {\n\t\t\t$estudiantes = $this->TSubgrupo->inscritosEgresados($cod_curso);\n }\n \n\t\t$this->vista->set('nombre_curso', $this->TSubgrupo->nombre($cod_curso));\n\t\t$this->vista->set('estudiantes', $estudiantes);\n\t\t$this->vista->display();\n\t }", "public function loadFromId(){\r\n\t\t$id = $this -> getUserId();\r\n\t\tif(is_numeric($id))\r\n\t\t\t$this -> loadFromQuery(\"select * from UserTab where UserId=\".$id);\r\n\t }", "public function listdataAsetAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('ASET');\n }", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function getPageData() {\n\t\t//$stat = Statistic::select(array('statistic.id', 'statistic.created_at','category.category_name', 'statistic.ip_address'))\n\t\t//->join('category','statistic.category_id','=','category.id'); \n\t\t$stat = StatView::select(array('id','date','category_name', 'ip_address'));\n\n\t\treturn Datatables::of($stat) \n\t\t-> add_column('actions','<a href=\"{{{ URL::to(\\'admin/blogs/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-xs btn-danger iframe\">{{{ Lang::get(\\'button.delete\\') }}}</a>') \n -> remove_column('id') -> make();\n\n\t}", "public function reloadData(){\n $this->load->model('ModelPendaftaran');\n\n //QUERY ARTIKEL ADMIN\n $data = $this->ModelPendaftaran->queryAllData();\n echo json_encode($data);\n }", "protected function loadData(){\n\t\t//SELECT from \".self::TABLE_NAME.\"_data WHERE \".self::TABLE_NAME.\"_id=\".$this->id.\"\n\t\t\n\t\t//return the data\n\t\treturn array();\n\t}", "function loadPerfil(){\n\t\t$r = $this->dper->getPerfilById($this->id);\n\t\tif($r != -1){\n\t\t\t$this->nombre = $r[\"nombre\"];\n\t\t}else{\n\t\t\t$this->nombre = \"\";\n\t\t}\n\t}", "public function data_tahun_ajaran()\n\t{\n\t\t$data['data'] = $this->m_aka->data_tahun_ajaran(); \n\t\t$data['pagination'] = $this->pagination->create_links();\n\t\t$data['content'] = 'mata_kuliah/data_tahun_ajaran';\n\t\t$this->load->view('content', $data);\n\t}", "public function load_data_laba_rugi() {\n\n $id = $this->input->post('event_id');\n\n $events_master = \"SELECT id, hpp_category, hpp_subcategory\n\t\t\t\t\t\t\t\t FROM events_master\n ORDER BY sort_category, sort_subcategory ASC\";\n \n $hpp = $this->db->query(\"SELECT SUM(item_qty*item_price) AS 'total_hpp'\n FROM events_hpp\n WHERE event_id = \" . $id . \"\n GROUP BY event_id\");\n\n $income = $this->db->query(\"SELECT SUM(nominal) AS 'total_income'\n FROM events_income\n WHERE event_id = \" . $id . \"\n GROUP BY event_id\");\n\n if ($hpp->num_rows() > 0) {\n $hpp = $hpp->row_array();\n $hpp = $hpp['total_hpp'];\n } else {\n $hpp = 0;\n }\n\n if ($income->num_rows() > 0) {\n $income = $income->row_array();\n $income = $income['total_income'];\n } else {\n $income = 0;\n }\n\n\t\t$attr = array(\n\t\t\t\t\t\t'event'\t\t\t=> $this->db->query(\"SELECT id, title, event_category\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM events\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE id = \" . $id)->row_array(),\n 'eventsMaster'\t=> $this->db->query($events_master)->result(),\n 'hpp' => $hpp,\n 'income' => $income\n );\n \n $this->load->view('analisa/report-laba-rugi', $attr);\n\n }", "public function tab1(){\n $this->layout = new \\stdClass();\n $this->model->rewriteActionConfigField('hide_menubar', 1);\n\n $this->layout->header[] = $this->components->getFauxTopbar(array(\n 'mode' => 'route_back','btn_title'=>false,'title' => '{#add_proof#}','route_back' => 'Tasklist/Default/'));\n\n /* reject note */\n $reject_note = $this->getData('reject_note', 'string');\n\n if($reject_note){\n $box4[] = $this->getComponentText($reject_note, array('style' => 'ern_reject_note'));\n $this->layout->scroll[] = $this->components->getSummaryBox('{#latest_reject_note_from_your_adult#}',$box4);\n }\n\n /* box 1 -- cart */\n $box1[] = $this->components->getCartHeader($this->data);\n\n $cart = $this->getData('cart', 'array');\n\n foreach($cart as $product){\n $box1[] = $this->components->getProductListItem($product,array('no_controls' => true));\n }\n \n $data = $this->getData('task_data', 'array');\n\n if(isset($data['nickname'])){\n $nickname = $data['nickname'];\n } elseif(isset($data['username'])){\n $nickname = $data['username'];\n } else {\n $nickname = '{#unknown#}';\n }\n\n $tasks = $this->getData('tasks_info', 'array');\n $this->layout->header[] = $this->components->getLargeProgress($tasks);\n\n $this->layout->scroll[] = $this->components->getSummaryBox('{#towards#}',$box1);\n\n /* Note */\n $choreType[] = $this->components->getComponentText(\n '{#' . $tasks['category_name'] . '#}',\n array(),\n array('margin' => '5 15 5 15'\n )\n );\n\n $this->layout->scroll[] = $this->components->getSummaryBox('{#chore_type#}',$choreType);\n\n /* box 3 -- summary */\n $box3[] = $this->components->getTaskSummary($this->data);\n $this->layout->scroll[] = $this->components->getSummaryBox('{#how#}',$box3);\n\n $box5[] = $this->getComponentText($tasks['comments'],array('style' => 'mtask_summary_header_content'));\n $this->layout->scroll[] = $this->components->getSummaryBox('{#parent_comment_to_deal#}',$box5);\n\n\n /* image placeholder */\n $image = $this->model->getSavedVariable('proofimage') ? $this->model->getSavedVariable('proofimage') : 'invisible-divider.png';\n $this->layout->scroll[] = $this->getComponentImage($image, array(\n 'variable' => 'proofimage'\n ));\n\n /* add photo button */\n $this->layout->scroll[] = $this->getComponentText('{#add_a_photo#}', array('style' => 'steps_hint','uppercase' => true));\n $this->layout->scroll[] = $this->getComponentText('{#add_a_photo#}',array('style' => 'attach_image_btn',\n 'onclick' => $this->getOnclickImageUpload('proofimage',array('sync_upload' => 1,'max_dimensions' => '450'))));\n\n /* date */\n/* $this->layout->scroll[] = $this->components->getHintedCalendar(\n '{#date#}',\n 'proof_date',\n time(),\n array('header' => false)\n );*/\n\n /* submit to */\n //$this->layout->scroll[] = $this->getComponentText('{#submit_to#}', array('style' => 'steps_hint','uppercase' => true));\n// $this->layout->scroll[] = $this->getComponentText($nickname, array('style' => 'proof_field_static'));\n\n /* description */\n $this->layout->scroll[] = $this->components->getHintedField(\n '{#description#}',\n 'description',\n 'textarea'\n );\n\n $this->layout->scroll[] = $this->getComponentSpacer('30');\n\n\n\n\n $onclick = $this->components->getOnclickShowDiv('cancel_div',\n array('background' => 'blur','tap_to_close' => true),\n array('left' => '50','right' => '50','bottom' => $this->screen_height/2 - 200));\n $btns[] = $this->components->getComponentText('{#cancel#}',array('style' => 'mtask_cancel_btn','onclick' => $onclick,'uppercase' => true));\n\n $onclick_save = $this->components->getOnclickSubmit('mytasks/saveproof/'.$data['taskid']);\n $btns[] = $this->components->getComponentText('{#send#}',array('style' => 'mtask_send_btn_half','onclick' => $onclick_save,'uppercase' => true));\n\n\n\n $this->layout->footer[] = $this->getComponentRow($btns);\n return $this->layout;\n\n }", "public function loadById($id){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"SELECT * FROM TB_USUARIOS WHERE IDUSUARIO = :ID\",array(':ID'=>$id));\n\t\t\n\t\tif (isset($results[0])) {\n\n\t\t\t$this->setData($results[0]);\n\t\t}\n\t}", "function tampil_data($tabel)\n {\n $row = $this->db->prepare(\"SELECT * FROM sms\");\n $row->execute();\n return $hasil = $row->fetchAll();\n }", "private function loadTable()\n {\n $unites = $this->Unite->all([], 'uniid DESC');\n $i = 1;\n $html = '';\n\n foreach ($unites as $unite) {\n $html .= '<tr>' .\n '<td>' . $i ++ . '</td>' .\n '<td>' . $unite->unilibelle . '</td>' .\n '<td>' . $unite->uniabv . '</td>' .\n '<td>';\n if (in_array('113', $this->session->stkdroits)) {\n $html .= '<a data-toggle=\"modal\" href=\"#editeUnite\" onclick=\"laodForEditUnite(' . $unite->uniid . '); return false\" title=\"editer\"><i class=\"fa fa-edit\" style=\"color: #05AE0E;\"></i></a>';\n } else {\n $html .= '<a href=\"javascript: void(0)\" class=\"disabled\" title=\"editer\"><i class=\"fa fa-edit\"></i></a>';\n }\n if (in_array('112', $this->session->stkdroits)) {\n $html .= '<a data-toggle=\"modal\" href=\"#deletUnite\" onclick=\"laodDataForDeleteUnite(' . $unite->uniid . '); return false;\" title=\"supprimer\"><i class=\"fa fa-remove\" style=\"color: #FF3B30;\"></i></a>';\n }else {\n $html .= '<a href=\"javascript: void(0)\" class=\"disabled\" title=\"editer\"><i class=\"fa fa-remove\"></i></a>';\n }\n $html .= '</td>' .\n '</tr>';\n }\n\n return $html;\n }", "public function listtabelSDMAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('SDM');\n }", "function LoadData()\n{\n $data=array();\n $dosen=Yii::app()->request->getParam('id_dosen',0);\n $pj=Yii::app()->request->getParam('pengajuan',0);\n $sql=\"select unsur_pel_pendidikan.ID_UNSUR_PELPEND,subun_pelpend.SUBPELPEND,tbl_dosen.NAMA_DOSEN,\n tbl_dosen.NIP_DOSEN, tbl_jabatan.NAMA_JABATAN, tbl_golongan.GOLONGAN, tbl_golongan.PANGKAT, \n tbl_jurusan.NAMA_JURUSAN, tbl_jurusan.NAMA_PIMPINAN, tbl_jurusan.NIP_PIMPINAN, tbl_jurusan.PANGKAT AS PJ, tbl_jurusan.GOLONGAN AS GJ,\n tbl_fakultas.NAMA_FAKULTAS, unsur_pel_pendidikan.KEGIATAN_PELPEND, unsur_pel_pendidikan.TEMPAT_PELPEND, \n unsur_pel_pendidikan.SEMESTER, unsur_pel_pendidikan.NILAI_PELPEND, unsur_pel_pendidikan.BUKTI_PELPEND, \n unsur_pel_pendidikan.PENGAJUAN_KE from unsur_pel_pendidikan inner join subun_pelpend on \n unsur_pel_pendidikan.ID_SUBPELPEND=subun_pelpend.ID_SUBPELPEND join tbl_dosen on\n unsur_pel_pendidikan.ID_DOSEN=tbl_dosen.ID_DOSEN join tbl_jabatan on tbl_dosen.ID_JABATAN=tbl_jabatan.ID_JABATAN \n join tbl_golongan on tbl_dosen.ID_GOLONGAN=tbl_golongan.ID_GOLONGAN join tbl_jurusan on \n tbl_dosen.ID_JURUSAN=tbl_jurusan.ID_JURUSAN join tbl_fakultas on tbl_jurusan.ID_FAKULTAS=tbl_fakultas.ID_FAKULTAS \n where unsur_pel_pendidikan.ID_DOSEN='$dosen' and unsur_pel_pendidikan.PENGAJUAN_KE='$pj' \";\n $hasil = Yii::app()->db->createCommand($sql)->queryAll();\n $i = 0;\n while ($fetchdata = $hasil)\n {\n\t$i++; // membuat counter 1, 2, 3, ... untuk ditampilkan\n // array_unshift($fetchdata,$i);\n\t//$data[] = $fetchdata;\t\n }\n return $data;\n}", "public function loadView ()\n {\n $data['category'][0] = $this->utility->getFieldsCategory('Programming model');\n $data['category'][1] = $this->utility->getFieldsCategory('General testing characteristics');\n $data['category'][2] = $this->utility->getFieldsCategory('Concurrent testing characteristics');\n $data['category'][3] = $this->utility->getFieldsCategory('Testing tool support');\n\n $data['name'][0] = 'Study identification';\n $data['name'][1] = 'Programming model';\n $data['name'][2] = 'General testing characteristics';\n $data['name'][3] = 'Concurrent testing characteristics';\n $data['name'][4] = 'Testing tool support';\n\n $count = 0;\n foreach($data['category'] as $fields) {\n $count2 = 0;\n foreach($fields as $field) {\n $data['category'][$count][$count2]['typeheadJS'] = $this->technique->singleTableInfo (ucfirst($field['html_id']));\n\n $tempExample = $this->technique->singleTableInfo (ucfirst($field['html_id']));\n $countExample = 0;\n $example = \"\";\n\n foreach ($tempExample as $value) {\n if (strcasecmp($value, \"No Information\") != 0 && strcasecmp($value, \"Not informed\") != 0) {\n $example .= ucfirst($value) . ', ';\n if ($countExample++ >= 3) break;\n }\n }\n $data['category'][$count][$count2]['example']=rtrim($example,\", \");\n\n $count2++;\n }\n $count++;\n }\n // echo \"<pre>\";\n // print_r($data);\n // echo \"</pre>\";\n \n $this->load->view('insert/insert_page', $data);\n }", "public function tab1(){\n $this->layout = new \\stdClass();\n \n if($this->model->getConfigParam('actionimage1')){\n $this->layout->scroll[] = $this->getComponentImage($this->model->getConfigParam('actionimage1'),\n [],\n ['margin' => '120 80 10 80']);\n $margin = 20;\n } else {\n $margin = 140;\n }\n\n $this->layout->scroll[] = $this->getComponentText('{#collect_location_matching#}', array(), array(\n 'padding' => $margin.' 40 10 40',\n 'text-align' => 'center',\n 'font-size' => '27',\n 'font-ios' => 'Lato-Light',\n 'font-android' => 'Lato-Light',\n ));\n\n $onclick[] = $this->getOnclickLocation(['sync_open' => 1]);\n $onclick[] = $this->getOnclickOpenAction('people',false,['sync_open' => 1]);\n\n $this->layout->footer[] = $this->getComponentSpacer('20');\n $this->layout->footer[] = $this->uiKitButtonHollow('{#enable_location#}',[\n 'onclick' => $onclick\n ]);\n $this->layout->footer[] = $this->getComponentSpacer('20');\n\n\n\n return $this->layout;\n }", "protected function LoadData()\n\t{\n\t\t$head = $this->GetProject()->GetHeadCommit();\n\t\t$this->tpl->assign(\"head\",$head);\n\n\t\t$this->tpl->assign('page', $this->params['page']);\n\t\t$skip = $this->params['page'] * 100;\n\n\t\t$headlist = $this->GetProject()->GetHeadList()->GetOrderedHeads('-committerdate', 101, $skip);\n\t\tif (isset($headlist) && (count($headlist) > 0)) {\n\t\t\tif (count($headlist) > 100) {\n\t\t\t\t$headlist = array_slice($headlist, 0, 100);\n\t\t\t\t$this->tpl->assign('hasmoreheads', true);\n\t\t\t}\n\t\t\t$this->tpl->assign(\"headlist\", $headlist);\n\t\t}\n\t}", "function LoadData($conn)\r\n{\r\n\tglobal $x_entidad_id;\r\n\t\r\n\tphpmkr_free_result($rs);\r\n\treturn $bLoadData;\r\n}", "public function index(){ \n \t$data['query1'] = $this->MBahagia->tampil_data();\n \t$data['query2'] = $this->MCamplong->tampil_data();\n \t$data['query3'] = $this->MPanglima->tampil_data();\n \t$data['query4'] = $this->MPKPRI->tampil_data();\n \t$data['query5'] = $this->MRahmat->tampil_data();\n\n \t\n \t$this->global['pageTitle'] = 'RichiSoft | Local Database';\n\t\t$this->loadViews(\"ViewTables/TableSlave\", $this->global, $data, NULL);\n\t}", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "function getData($db, &$intRows, $strDataID = \"\")\n{\n global $words;\n global $intDefaultWidth;\n global $strEmptyOption;\n global $arrData;\n global $bolIsEmployee;\n global $bolPrint;\n $intMaxShow = 4; // tambahan yang perlu dimunculkan\n $intAdd = 10; // maksimum tambahan\n $intRows = 0;\n $intShown = 0;\n $strResult = \"\";\n $dtNow = getdate();\n $strReadonly = ($bolIsEmployee) ? \"readonly\" : \"\";\n if ($strDataID != \"\") {\n $strSQL = \"SELECT t1.*, t2.employee_id, t2.employee_name FROM hrd_trip_payment AS t1 \";\n $strSQL .= \"LEFT JOIN hrd_employee AS t2 ON t2.id = t1.id_employee \";\n $strSQL .= \"WHERE t1.id = '$strDataID' \";\n $resM = $db->execute($strSQL);\n if ($rowM = $db->fetchrow($resM)) {\n $arrData['dataEmployee'] = $rowM['employee_id'];\n $arrData['dataemployee_name'] = $rowM['employee_name'];\n $arrData['dataNo'] = $rowM['no'];\n $arrData['dataCode'] = $rowM['code'];\n $arrData['dataMonth'] = $rowM['month_code'];\n $arrData['dataYear'] = $rowM['year_code'];\n $arrData['dataMethod'] = $rowM['method'];\n $arrData['dataAccount'] = $rowM['accountNo'];\n $arrData['dataBudget'] = $rowM['budgetCode'];\n $arrData['dataPayment'] = $rowM['paymentDate'];\n $arrData['dataDate'] = $rowM['request_date'];\n $arrData['dataStatus'] = $rowM['status'];\n $strSQL = \"SELECT * FROM hrd_trip_payment_other WHERE id_trip_payment = '\" . $rowM['id'] . \"' \";\n $resDb = $db->execute($strSQL);\n while ($rowDb = $db->fetchrow($resDb)) {\n $intRows++;\n $intShown++;\n if ($intRows == 1) // cek pilihan currency\n {\n $arrData['dataCurrType'] = ($rowDb['amountOther'] != 0) ? 1 : 0;\n }\n $fltAmount = ($arrData['dataCurrType'] == 0) ? $rowDb['amount'] : $rowDb['amountOther'];\n $arrData['dataTotalOther'] += $fltAmount;\n if ($bolPrint) {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\">\\n\";\n $strResult .= \" <td align=right>$intRows&nbsp;</td>\";\n $strResult .= \" <td>&nbsp;\" . $rowDb['note'] . \"</td>\";\n $strResult .= \" <td nowrap align=right>\" . standardFormat($fltAmount) . \"&nbsp;</td>\";\n $strResult .= \"</tr>\\n\";\n } else {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\">\\n\";\n $strResult .= \" <td align=right><input type=hidden name=detailID$intRows value=\\\"\" . $rowDb['id'] . \"\\\">$intRows&nbsp;</td>\";\n $strResult .= \" <td><input type=text size=50 maxlength=90 name=detailNote$intRows value=\\\"\" . $rowDb['note'] . \"\\\"></td>\";\n $strResult .= \" <td nowrap><input type=text size=15 maxlength=20 name=detailCost$intRows value=\\\"\" . (float)$rowDb['amount'] . \"\\\" class=numeric onChange=\\\"onCostChanged($intRows);\\\" class='numeric'></td>\";\n $strResult .= \" <td nowrap><input type=text size=15 maxlength=20 name=detailCostOther$intRows value=\\\"\" . (float)$rowDb['amountOther'] . \"\\\" class=numeric onChange=\\\"onCostChanged($intRows, 'Other');\\\" class='numeric'></td>\";\n $strAction = \" onChange = \\\"chkDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td align=center><input type=checkbox name='chkID$intRows' $strAction></td>\\n\";\n $strResult .= \"</tr>\\n\";\n }\n }\n writeLog(ACTIVITY_VIEW, MODULE_PAYROLL, \"\", 0);\n }\n }\n $arrData['dataTotal'] += $arrData['dataTotalOther'];\n // tambahkan dengan data kosong\n if (!$bolPrint) {\n for ($i = 1; $i <= $intAdd; $i++) {\n $intRows++;\n if ($intRows <= $intMaxShow) {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\">\\n\";\n $intShown++;\n $strDisabled = \"\";\n } else {\n $strResult .= \"<tr valign=top id=\\\"detailRows$intRows\\\" style=\\\"display:none\\\">\\n\";\n $strDisabled = \"disabled\";\n }\n $strResult .= \" <td align=right>$intRows&nbsp;</td>\";\n $strResult .= \" <td><input type=text size=50 maxlength=90 name=detailNote$intRows value=''></td>\";\n $strResult .= \" <td nowrap align=right><input type=text size=15 maxlength=20 name=detailCost$intRows $strDisabled value=0 class=numeric onChange=\\\"onCostChanged($intRows);\\\" class='numeric'></td>\";\n $strAction = \" onChange = \\\"chkDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td nowrap align=right><input type=text size=15 maxlength=20 name=detailCostOther$intRows $strDisabled value=0 class=numeric onChange=\\\"onCostChanged($intRows, 'Other');\\\" class='numeric'></td>\";\n $strAction = \" onChange = \\\"chkDeleteChanged($intRows);\\\" \";\n $strResult .= \" <td align=center><input type=checkbox name='chkID$intRows' $strAction></td>\\n\";\n $strResult .= \"</tr>\\n\";\n }\n }\n // tambahkan hidden data\n $strResult .= \"<input type=hidden name=maxDetail value=$intRows>\";\n $strResult .= \"<input type=hidden name=numShow value=$intShown>\";\n return $strResult;\n}", "function loadDataBarang_md41($idgroup_barang=\"\") {\n\t\t$grid = new GridConnector($this->db->conn_id);\n $grid->render_sql(\"select id,idgroup_barang,nmbarang,idsatuan from v_master_barang_detail where is_active = '1' and sts_jual = '1' and idgroup_barang like '%\".$idgroup_barang.\"%' group by idgroup_barang\",\"id\",\"idgroup_barang,nmbarang,idsatuan\");\n\t}", "public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }", "function cl_tabrecregrasjm() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tabrecregrasjm\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function data_detail($root, $id)\n{\n\t$sql = 'SELECT nim, nama, alamat FROM' .MHS. 'WHERE nim='.$id;\n\t$res = mysql_query($sql);\n\tif ($res)\n\t{\n\t\tif (mysql_num_rows($res))\n\t\t{\n\t\t?>\n\t\t<div class=\"tabel\">\n\t\t<table border=1 width=700 cellpadding=4 cellspacing=0>\n\t\t\t<?php\n\t\t\t$row = mysql_fetch_row($res);\n\t\t\t?>\n\t\t\t<tr>\n\t\t\t\t<td>NIM</td>\n\t\t\t\t<td><?php echo $row[0];?></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Nama</td>\n\t\t\t\t<td><?php echo $row[1];?></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>Alamat</td>\n\t\t\t\t<td><?php echo $row[2];?></td>\n\t\t\t</tr>\n\t\t</table>\n\t\t</div>\n\t\t<?php\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 'Data tidak ditemukan';\n\t\t}\n\t\t@mysql_close($res);\n\t}\n}", "public function loadDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n\n $filter = new Service_Api_Filter_Content();\n\n $filter->id = $this->_getParam('id');\n $filter->mimeType = $this->_getParam('mimeType');\n $filter->limit = $this->_getParam('limit');\n $filter->offset = $this->_getParam('offset');\n $filter->search = $this->_getParam('search');\n $filter->sources = $this->_getParam('sources');\n $filter->format = $this->_getParam('dim');\n $filter->properties = $this->_getParam('properties');\n $contents = $contentService->contentsRead($filter);\n $this->view->data = $contents;\n }", "function load_page($args=''){//$page,$maxrows,$order,$ordertype,$capa,\n\t\t$r= getResponse();\t\t\n\t\tsetLocaleMode();\n\t\tif (!xvalidaAcceso($r,PAGE_PRIV)){\n\t\t\t$r->assign($capa,inner,'Acceso denegado');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t//$r->alert($args);\n\t\t$c = new connection();\n\t\t$c->open();\n\t\t\n\t\t\n\t\t$sa_paquetes = $c->sa_v_paquetes;\n\t\t$query = new query($c);\n\t\t$query->add($sa_paquetes);\n\t\t$paginador = new fastpaginator('xajax_load_page',$args,$query);\n\t\t$arrayFiltros=array(\n\t\t\t'Empresa'=>array(\n\t\t\t\t'change'=>'h_empresa',\n\t\t\t\t'addevent'=>\"obj('empresa').value='';\"\n\t\t\t),\n\t\t\t'busca'=>array(\n\t\t\t\t'title'=>'B&uacute;squeda',\n\t\t\t\t'event'=>'restablecer();'\n\t\t\t),\n\t\t\t'fecha'=>array(\n\t\t\t\t'title'=>'Fecha'\n\t\t\t)\n\t\t);\n\t\t$argumentos = $paginador->getArrayArgs();\n\t\t$aplica_iva=($argumentos['iva']==1);\n\t\t$id_empresa=$argumentos['h_empresa'];\n\t\t$query->where(new criteria(sqlEQUAL,$sa_paquetes->id_empresa,$id_empresa));\n\t\t\n\t\tif($id_empresa==null){\n\t\t\t$r->assign($paginador->layer,inner,'Seleccione una Empresa');\n\t\t\treturn $r;\n\t\t}\n\t\t\n\t\t$rec=$paginador->run();\n\t\tif($rec){\n\t\t\tforeach($rec as $v){\n\t\t\t\t//buscando las unidades basicas del paquete\n\t\t\t\t$unidades=$c->sa_v_informe_tempario_unidades->doSelect($c, new criteria(sqlEQUAL,'id_paquete',$v->id_paquete))->getAssoc('id_paq_unidad','nombre_unidad_basica');\n\t\t\t\t$lista_unidades=implode(',',$unidades);\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"40%\" /><thead>';\n\t\t\t\t\n\t\t\t\t$html.='<tr><td>PAQUETE</td><td>Descripci&oacute;n</td><td>Unidades</td></tr></thead><tbody>';\n\t\t\t\t$html.='<tr><td>'.$v->codigo_paquete.'</td><td>'.$v->descripcion_paquete.'</td><td>'.$lista_unidades.'</td></tr></tbody></table>';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$html.='<table class=\"order_table\"><col width=\"20%\" /><col width=\"40%\" /><col width=\"20%\" /><thead><tr><td>Codigo</td><td>Descripci&oacute;n</td><td>Unidad</td><td>Cantidad</td><td style=\"display:none;\">Precio</td><td style=\"display:none;\">Importe</td></tr></thead><tbody>';\n\t\t\t\t//cargando los detalles de tempario\n\t\t\t\t$sa_v_paq_tempario=$c->sa_paq_tempario;\n\t\t\t\t$sa_tempario= new table('sa_v_tempario','',$c);\n\t\t\t\t$join= $sa_tempario->join($sa_v_paq_tempario,$sa_tempario->id_tempario,$sa_v_paq_tempario->id_tempario);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_tempario->id_paquete,$v->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $temp){\n\t\t\t\t\t\t$html.='<tr><td>'.$temp->codigo_tempario.'</td><td>'.$temp->descripcion_tempario.'</td><td>'.$temp->descripcion_modo.'</td><td>N/A</td><td style=\"display:none;\">'.$temp->precio.'</td><td style=\"display:none;\">'.$temp->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sa_v_paq_repuestos=$c->sa_paquete_repuestos;\n\t\t\t\t$iv_articulos= new table('iv_articulos','',$c);\n\t\t\t\t$join= $iv_articulos->join($sa_v_paq_repuestos,$iv_articulos->id_articulo,$sa_v_paq_repuestos->id_articulo);\n\t\t\t\t$qdet=new query($c);\n\t\t\t\t$qdet->add($join);\n\t\t\t\t$qdet->where(new criteria(sqlEQUAL,$sa_v_paq_repuestos->id_paquete,$rec->id_paquete));\n\t\t\t\t//$r->alert($qdet->getSelect());\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\t$recdet=$qdet->doSelect();\n\t\t\t\tif($recdet){\n\t\t\t\t\tforeach($recdet as $rep){\n\t\t\t\t\t\t$html.='<tr><td>'.$rep->codigo_articulo.'</td><td>'.$rep->descripcion.'</td><td>'.$rep->unidad.'</td><td>'.$rep->cantidad.'</td><td style=\"display:none;\">'.$rep->precio.'</td><td style=\"display:none;\">'.$rep->precio.'</td></tr>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$html.='</tbody></table><br />';\n\t\t\t}\n\t\t}\n\t\t$html.='<br />Informe Generado el '.date(DEFINEDphp_DATETIME12).' - Empresa: '.$argumentos['Empresa'].'<strong>'.$tiva.'</strong>';\n\t\t$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div>');\n\t\t\n\t\t/*if($argumentos['busca']!=''){\n\t\t\t$query->where(\n\t\t\t\tnew criteria(sqlOR, array(\n\t\t\t\t\tnew criteria(' like ',$sa_paquetes->descripcion_paquete,\"'%\".$argumentos['busca'].\"%'\")//,\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->chasis,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$sa_paquetes->color,\"'%\".$argumentos['busca'].\"%'\"),\n\t\t\t\t\t//new criteria(' like ',$c->pg_empresa->nombre_empresa,\"'%\".$argumentos['busca'].\"%'\")\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t}\n\t\tif($argumentos['fecha']!=''){\n\t\t\t$query->where(new criteria(' = ',\"DATE_FORMAT(\".$sa_paquetes->fecha_rev.\",'%d-%m-%Y')\",\"'\".$argumentos['fecha'].\"'\"));\t\t\t\n\t\t}\n\t\tif($argumentos['h_empresa']!=''){\n\t\t\t$query->where(new criteria(sqlEQUAL,\"id_empresa\",\"'\".$argumentos['h_empresa'].\"'\"));\t\t\t\n\t\t}else{\n\t\t\t$arrayFiltros['Empresa']['hidden']=1;\n\t\t}*/\n\t\t//$r->alert($argumentos['h_empresa']);\n\t\t\n\t\t//$rec=$paginador->run();\n\t\t\n\t\t/*if($rec){\n\t\t\tif($rec->getNumRows()==0){\n\t\t\t\t$html.='<div class=\"order_empty\">No se han encontrado registros</div>';\n\t\t\t}else{\n\t\t\t\t$html.='<table class=\"order_table\"><thead><tr class=\"xajax_order_title\">\n\t\t\t\t\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->id_paquete,'ID').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->codigo_paquete,'C&oacute;digo').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->descripcion_paquete,'Descripci&oacute;n').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->nombre_empresa_sucursal,'Empresa').'</td>\n\t\t\t\t<td>'.$paginador->get($sa_paquetes->fecha_rev,'Fecha').'</td>\n\t\t\t\t</tr></thead><tbody>';\n\t\t\t\t$class='';\n\t\t\t\tforeach($rec as $v){\n\t\t\t\t\tif ($rec->parcial == '1')\n\t\t\t\t\t\t$parcial = 'Si';\n\t\t\t\t\telse\n\t\t\t\t\t\t$parcial = 'No';\n\t\t\t\t\t$html.='<tr class=\"'.$class.'\">\n\t\t\t\t\t\n\t\t\t\t\t<td align=\"center\">'.$rec->id_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->codigo_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->descripcion_paquete.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->nombre_empresa_sucursal.'</td>\n\t\t\t\t\t<td align=\"center\">'.$rec->fecha_rev.'</td>\n\t\t\t\t\t</tr>';\n\t\t\t\t\tif($class==''){\n\t\t\t\t\t\t$class='impar';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$class='';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$html.='</tbody></table>';\n\t\t\t}\n\t\t\t\n\t\t}*/\n\t\t\n\t\t$r->assign($paginador->layer,inner,$html);\n\t\t\n\t\t\n\t\t//$r->assign('paginador',inner,'<hr><div class=\"ifilter\">Mostrando '.$paginador->count.' resultados de un total de '.$paginador->totalrows.' '.$paginador->getPages(false).'</div><div class=\"ifilter\">'.$paginador->getRemoveFilters('datos',$arrayFiltros).'</div>');\n\n\t\t$r->assign('campoFecha','value',$fec);\n\t\t\n\t\t$r->script($paginador->fillJS('datos'));\n\t\n\t\t$c->close();\n\t\treturn $r;\n\t}", "static public function mostrarTabla(){\n\n \t$item = null;\n $valor = null;\n\n \t$empresa = ControladorEmpresa::ctrMostrarEmpresa($item, $valor);\n\n \techo '{\n\t\t\t\"data\": [';\n\n\t\t\tfor($i = 0; $i < count($empresa)-1; $i++){\n\n\t\t\t\t\n\t\t\t\t echo '[\n\t\t\t \"'.($i+1).'\",\n\t\t\t \"'.$empresa[$i][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[$i][\"empresa\"].'\",\n\t\t\t \"'.$empresa[$i][\"direccion\"].'\",\n\t\t\t \"'.$empresa[$i][\"telefono\"].'\",\n\t\t\t \"'.$empresa[$i][\"celular\"].'\",\n\t\t\t \"'.$empresa[$i][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[$i][\"responsable\"].'\",\n\t\t\t \"'.$empresa[$i][\"email\"].'\"\n\n\t\t\t ],';\n\n\t\t\t}\n\n\t\t\t echo'[\n\t\t\t \"'.count($empresa).'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ruta_imagen\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"empresa\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"direccion\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"telefono\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"celular\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"ciudad\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"responsable\"].'\",\n\t\t\t \"'.$empresa[count($empresa)-1][\"email\"].'\" \n\t\t\t ]\n\t\t\t]\n\t\t}';\n\n\n }", "function display_emp_personal_data()\n{\n if (isset($_GET['id'])) {\n $emp_data = select_employee_personal_data(escaped_str($_GET['id'])); ?>\n <div class=\"personal-data\">\n <p class=\"h3\">Date personale ale angajatului: <i class=\"text-black-strong\">\n <?= $emp_data['surname'] . \" \" . $emp_data['name'] . \" \" . $emp_data['middle'] . \" \" ?></i>\n <a class=\"small red\" href=\"angajat_edit.php?id=<?= $_GET['id'] ?>\"\n title=\"Editeaza datele personale ale angajatului\">editeaza</a></p>\n <hr>\n <?php for ($i = 1; $i <= 9; $i++) { ?>\n <p class=\"col-xs-12 col-sm-6 col-md-4 col-lg-4 text-muted\">- <?= $emp_data[$i][1] ?> <i\n class=\"text-black-strong\"><?= $emp_data[$i][0] ?> </i></p>\n <?php } ?>\n <div class=\"clearfix\"></div>\n <hr>\n </div>\n <?php\n } else {\n echo \"<h2>Alege un angajat pentrua vedea detalii</h2>\";\n }\n return;\n}", "public function Individualgetdata();", "function load_data()\n \t{\n \t\t\n \t\t$return=parent::load_data();\t\n \t\t$this->images_array=t3lib_div::trimExplode(',',$this->images);\n \t\t$this->teaserImagesArray=t3lib_div::trimExplode(',',$this->teaserimages);\n \t\treturn $return;\n \t}", "public function loadTable() {\n $data = JenisProduk::All();\n return view('jenisproduk.partials.tables', ['data' => $data]);\n }", "function get_exam_data_table()\n\t\t{\n\t\t\t$data['list']=$_POST['list'];\n\t\t\t$data['student_name']=$_POST['student_name'];\n\t\t\t$data['exam_name']=$_POST['exam_name'];\n\t\t\t$this->load->view('backend/parents/get_data_table',$data);\t\t \n\t\t}", "public function ambildata()\r\n\t{\r\n\t\t$list = $this->News_model->get_datatables();\r\n\t\t$data = array();\r\n\t\t$no = $_POST['start'];\r\n\t\tforeach ($list as $d) {\r\n\t\t\t$status = $d->status;\r\n\t\t\t// If Status\r\n\t\t\tif ($status == '1') {\r\n\t\t\t\t$status = \"<a class='btn btn-primary btn-xs disabled'> Aktif </a>\";\r\n\t\t\t} else { $status = \"<a class='btn btn-default btn-xs disabled'> Tidak Aktif </a>\"; }\r\n\t\t\t// End Status\r\n\r\n\t\t\t$no++;\r\n\t\t\t$row \t= array();\r\n\t\t\t$row[] \t= $d->judul;\r\n\t\t\t$row[] \t= $status;\r\n\t\t\t$row[] \t= date('d F Y h:i:s',strtotime($d->datepost));\r\n\t\t\t$row[]\t= $d->category_name;\r\n $row[]\t= $d->relasi;\r\n \t\t\t// $row[]\t= $d->namabu; \r\n\r\n\r\n\t\t\t// Action\r\n\t\t\t// 'news/'.date('Y',strtotime($n->datepost)).'/'.date('m',strtotime($n->datepost)).'/'.$n->slug\r\n $row[] \t= \t\"\r\n <a href='\".site_url('news/'.date('Y',strtotime($d->datepost)).'/'.date('m',strtotime($d->datepost)).'/'.$d->slug).\"' class='btn btn-primary btn-xs' target='_blank'><i class='fa fa-eye'></i> View </a>\r\n\r\n <a href='\".site_url('back/news/edit/'.$d->id).\"' class='btn btn-primary btn-xs'><i class='fa fa-pencil'></i> Edit </a> <a href='\".site_url('back/news/delete/'.$d->id).\"' class='btn btn-danger btn-xs' onclick=\\\"return confirm('Are you sure you want to delete this item?');\\\"> <i class='fa fa-trash'></i> Hapus </a>\r\n\r\n \";\r\n $data[] = $row;\r\n }\r\n\r\n $output = array(\r\n \"draw\" => $_POST['draw'],\r\n \"recordsTotal\" => $this->News_model->count_all(),\r\n \"recordsFiltered\" => $this->News_model->count_filtered(),\r\n \"data\" => $data,\r\n );\r\n //output to json format\r\n echo json_encode($output);\r\n }", "public function load_data_laba_rugi_bulanan() {\n\n $month = $this->input->post('month');\n\n $total_hpp = $this->db->query(\"SELECT SUM(item_qty*item_price) AS 'total_hpp'\n FROM events_hpp\n JOIN events ON events.id = events_hpp.event_id\n WHERE DATE_FORMAT(event_date, '%Y-%m') = '\" . $month . \"'\n GROUP BY DATE_FORMAT(event_date, '%Y-%m') = '\" . $month . \"'\");\n\n if ($total_hpp->num_rows() > 0) {\n $total_hpp = $total_hpp->row_array();\n $total_hpp = $total_hpp['total_hpp'];\n } else {\n $total_hpp = 0;\n }\n\n $total_pendapatan = $this->db->query(\"SELECT SUM(nominal) AS 'total_pendapatan'\n FROM events_income\n JOIN events ON events.id = events_income.event_id\n WHERE DATE_FORMAT(event_date, '%Y-%m') = '\" . $month . \"'\n GROUP BY DATE_FORMAT(event_date, '%Y-%m') = '\" . $month . \"'\");\n\n if ($total_pendapatan->num_rows() > 0) {\n $total_pendapatan = $total_pendapatan->row_array();\n $total_pendapatan = $total_pendapatan['total_pendapatan'];\n } else {\n $total_pendapatan = 0;\n }\n\n $event = $this->db->query(\"SELECT id, event_date, title\n FROM events\n WHERE DATE_FORMAT(event_date, '%Y-%m') = '\" . $month . \"'\");\n\n $attr = array(\n 'month' => $month,\n 'total_hpp' => $total_hpp,\n 'total_pendapatan' => $total_pendapatan,\n 'event' => $event->result()\n );\n\n $this->load->view('analisa/report-laba-rugi-bulanan', $attr);\n\n }", "public function loadFromName($name) {\n $data = $this->table->select(array('name'=>$name))->current();\n if (is_object($data))\n $this->data = $data->getArrayCopy();\n }", "public function tampil()\n\t{\t\n\t\t\n\t\t$this->session->set_userdata(\"judul\",\"Data Master\");\n\t\t$ba = [\n\t\t'judul' => \"Data Master\",\n\t\t'subjudul' => \"Pasien\",\n\t\t];\n\t\t$d = [\n\t\t'gelar' => $this->pasien->get_enum(\"srk_pasien\", \"psn_gelar\"),\n\t\t'jk' => $this->pasien->get_enum(\"srk_pasien\", \"psn_jk\"),\n\t\t'jkitas' => $this->pasien->get_enum(\"srk_pasien\", \"psn_jkitas\"),\n\t\t];\n\t\t$this->load->helper('url');\n\t\t$this->load->view('background_atas', $ba);\n\t\t$this->load->view('pasien',$d);\n\t\t$this->load->view('background_bawah');\n\t}", "public function setDataGrid() {\n $province_id = $this->input->post('province_id');\n $datos = $this->conn->getData($province_id);\n die(\"{data:\" . json_encode($datos) . \"}\");\n }", "protected function load(){\r\n\t\r\n\t$qq1 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" = \".(int)$this->id);\r\n\t$this->profileData = count($qq1)>0 ? $qq1[0]: null; \r\n\t\r\n\tif($this->metaUse){\r\n\t\t$qq2 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaTypesTableName.\" WHERE active = 1 ORDER BY public_ord, id\");\r\n\t\t$this->metaData = count($qq2)>0 ? $qq2: array(); \r\n\t}\r\n}", "public function fetch_tab2($conn,$tab,$userid,$item_id){\r\n $q=\"select * from \".$tab.\" WHERE (this_user_works_under= \".$userid.\" OR user_id = \". $userid.\") AND item_id= \".$item_id ;\r\n $stat=$conn->prepare($q);\r\n $stat->execute();\r\n $data = $stat->fetchAll(PDO::FETCH_ASSOC); \r\n return $data; \r\n }", "function ajaxGetPoiTab($id,$tab,$table)\t{\n\t\t$content = $this->getPoiContent($id,$tab, $table);\n\n\t\t$objResponse = new tx_xajax_response($GLOBALS['TSFE']->metaCharset);\n\t\t$objResponse->addAssign('poi', 'innerHTML', $content);\n\t\treturn $objResponse->getXML();\n\t}", "private function loadData($type, $id = null)\n\t{\n\t\tif ($this->wholeDataLoaded) return;\n\t\t$data = null;\n\n\t\tswitch ($type){\n\t\t\tcase EBlazonDataType::ALL:\n\t\t\t\t\t$data = $this->blazonTable->getAll();\n\t\t\t\t\t$this->wholeDataLoaded = $this->noOverlaysLoaded = $this->overlaysLoaded = true;\n\t\t\t\tbreak;\n\t\t\tcase EBlazonDataType::OVERLAY:\n\t\t\t\tif (!$this->overlaysLoaded) {\n\t\t\t\t\t$data = $this->blazonTable->getAllOverlays();\n\t\t\t\t\t$this->overlaysLoaded = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase EBlazonDataType::NO_OVERLAY:\n\t\t\t\tif (!$this->noOverlaysLoaded) {\n\t\t\t\t\t$data = $this->blazonTable->getAllNotOverlay();\n\t\t\t\t\t$this->noOverlaysLoaded = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase EBlazonDataType::SINGLE:\n\t\t\t\t$data[0] = $this->blazonTable->getById($id);\n\t\t\t\tif ($data[0] == false) $data = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ($data !== null && $data !== false){\n\t\t\tforeach ($data as $blazonData)\n\t\t\t\t$this->addItem2Cache($blazonData);\n\t\t}\n\t}", "public function readerdata()\n {\n \n if ($_GET['type'] == \"cierres\"){\n $xr8_data = $this->Querys->metalesRead();\n }else if ($_GET['type'] == \"one\"){\n $xr8_data = $this->Querys->metalesReadOne();\n }else if ($_GET['type'] == \"entregas\"){\n $xr8_data = $this->Querys->metalesReadEntregas();\n }else {\n $xr8_data = array(\"Error\" => 101);\n }\n\n\n $this->output->set_content_type('application/json')->set_output(json_encode($xr8_data));\n }", "function GetTabPrestation($projet)\n {\n //Ajout d'une catégorie de prestationj\n $btnNew = new Button(BUTTON);\n $btnNew->Value = $this->Core->GetCode(\"Devis.NewCategory\");\n $btnNew->OnClick = \"DevisAction.ShowAddCategory(\". $projet->IdEntite.\");\";\n\n $html .= $btnNew->Show();\n\n //Recuperation des articles\n $category = new DevisPrestationCategory($this->Core);\n $category->AddArgument(new Argument(\"Apps\\Devis\\Entity\\DevisPrestationCategory\", \"ProjetId\", EQUAL, $projet->IdEntite ));\n $categorys = $category->GetByArg();\n\n if(count($categorys) > 0)\n {\n //Ligne D'entete\n $html .= \"<div class='category'>\";\n $html .= \"<div class='blueTree'><b>\".$this->Core->GetCode(\"Devis.Libelle\").\"</b></div>\";\n\n $html .= \"</div>\"; \n\n foreach($categorys as $category)\n {\n $html .= \"<div class='category'>\";\n $html .= \"<div >\".$category->Libelle->Value.\"</div>\";\n\n //Lien pour afficher le détail\n $icEdit = new EditIcone();\n $icEdit->OnClick = \"DevisAction.ShowAddCategory(\". $projet->IdEntite.\", \".$category->IdEntite.\");\";\n $html .= \"<div >\".$icEdit->Show().\"</div>\";\n\n //Ajout de prestation\n $icAdd = new AddIcone($this->Core);\n $icAdd->Title = $this->Core->GetCode(\"Devis.AddPrestation\");\n $icAdd->OnClick = \"DevisAction.ShowAddPrestation(\".$category->IdEntite.\");\";\n\n $html .= \"<div >\".$icAdd->Show();\n $html .= $this->GetPrestation($category); \n\n $html .= \"</div>\";\n\n //Suppression\n $icDelete = new DeleteIcone();\n $icDelete->OnClick = \"DevisAction.DeleteCategory(this, '\".$category->IdEntite.\"')\";\n $html .= \"<div >\".$icDelete->Show().\"</div>\";\n\n $html .= \"</div>\";\n }\n }\n\n return new Libelle($html);\n }", "public function loadQa_Data() {\n $_return = array();\n \n $limit = sprintf('%s,%s', ($this->page - 1) * self::pageLite, self::pageLite);\n \n $sql = sprintf(\"SELECT ql.uid,ql.readi,ql.title,ql.datetime,ql.ansi AS commi,cl.username AS usn FROM `qa_question_list` ql LEFT JOIN client cl ON cl.uid = ql.uid ORDER BY `datetime` DESC,`vote` DESC LIMIT %s;\", $limit);\n \n $re = $this->mysql->query($sql);\n while ($_resultSet = mysql_fetch_array($re)) {\n $_resultSet['ush'] = G::getHeadimg($_resultSet['uid'], 45);\n $_return[] = $_resultSet;\n }\n \n return $_return;\n }", "public function load_field(){\r\n $this->layout=\"ajax\";\r\n $module=$_POST['module'];\r\n $this->loadModel($module);\r\n $field_names= Set::extract('/COLUMNS/Field',$this->$module->query(\"DESCRIBE {$this->$module->useTable}\"));\r\n $field= array_combine($field_names, $field_names);\r\n $this->set(compact('field'));\r\n }", "function home()\n {\n $data=$this->model->getProfes();\n $this->addData($data);\n //rebuilding with new data\n $this->view->__construct($this->dataView,$this->dataTable);\n $this->view->show();\n \t\t}", "public function read_data()\n {\n if ($this->input->is_ajax_request() == true) {\n // ambil data dari table\n $list = $this->model->get_datatables();\n $data = [];\n $no = $_POST['start'];\n foreach ($list as $field) {\n\n $no++;\n $row = [];\n\n // tombol action\n $btnAction = \"<button type=\\\"button\\\" data-toggle=\\\"modal\\\" data-target=\\\"#detail-pengaduan\\\" class='btn btn-sm btn-info btn-hapus' data-id=\\\"$field->id\\\" data-tgl=\\\"\" . date('d F Y', strtotime($field->tgl_pengaduan)) . \"\\\" data-jenis=\\\"$field->jenis\\\" data-judul=\\\"$field->judul_pengaduan\\\" data-isi=\\\"$field->isi_pengaduan\\\" data-status=\\\"$field->status_pengaduan\\\"><i class=\\\"fas fa-fw fa-edit\\\"></i> Detail</button>\n <button type=\\\"button\\\" data-toggle=\\\"modal\\\" data-target=\\\"#hapus-pengaduan\\\" class='btn btn-sm btn-danger btn-hapus' data-id=\\\"$field->id\\\"><i class=\\\"fas fa-fw fa-trash-alt\\\"></i> Hapus</button>\";\n\n $status = $field->status_pengaduan;\n\n $row[] = $no;\n $row[] = date('d M Y', strtotime($field->tgl_pengaduan));\n $row[] = $field->jenis;\n $row[] = ($status == 0 ? '<span class=\"badge-warning p-1 rounded-sm\">antrian</span>' : ($status == 1 ? '<span class=\"badge-blue p-1 rounded-sm\">proses</span>' : ($status == 2 ? '<span class=\"badge-success p-1 rounded-sm\">selesai</span>' : '<span class=\"badge-danger p-1 rounded-sm\">batal</span>')));\n $row[] = $btnAction;\n $data[] = $row;\n }\n\n $output = [\n \"draw\" => $_POST['draw'],\n \"recordsTotal\" => $this->model->count_all(),\n \"recordsFiltered\" => $this->model->count_filtered(),\n \"data\" => $data,\n ];\n //output dalam format JSON\n echo json_encode($output);\n } else {\n exit('Maaf data tidak bisa ditampilkan');\n }\n }", "function rowpage() {\n $dir = APPPATH . 'controllers/';\n $this->load->library('directoryinfo');\n $arr = $this->directoryinfo->readDirectory($dir, array(\"Auth.php\", \"Ajax.php\"));\n $arr = array($arr);\n // $sortedarray2 = $this->directoryinfo->readDirectory($dirmodule, true);\n // $arr = array_merge(array($sortedarray1), $sortedarray2);\n// echo \"<pre>\";\n// print_r($arr);\n// die();\n $dataselect = array();\n foreach ($arr as $key => $row) {\n $module = mb_strtolower($key, 'UTF-8');\n foreach ($row as $key1 => $row1) {\n $class = mb_strtolower($key1, 'UTF-8');\n foreach ($row1 as $row2) {\n $method = mb_strtolower($row2, 'UTF-8');\n if ($module) {\n $page = $module . \"/\" . $class . \"/\" . $method;\n } else {\n $page = $class . \"/\" . $method;\n }\n $dataselect[$page] = $page;\n }\n }\n }\n $arr_page = $this->page_model->where(array(\"deleted\" => 0))->as_array()->get_all();\n $page_ava = array_map(function($item) {\n return $item['link'];\n }, $arr_page);\n $this->data['page_ava'] = $page_ava;\n $this->data['link'] = $dataselect;\n echo $this->blade->view()->make('ajax/ajaxpage', $this->data)->render();\n }", "public function getTabularItems()\n {\n return SATabularListM::model()->findAll(array('order'=>'tabularlist_block'),array('tabularlist_aktif'=>TRUE));\n // return Yii::app()->db->createCommand('SELECT tabularlist_id, tabularlist_block FROM tabularlist_m WHERE tabularlist_aktif=TRUE')->queryAll();\n }", "public function get_data();", "public function tab1(){\n $this->layout = new \\stdClass();\n return $this->layout;\n\n }", "function listPage_tableField(){\n $this->data_view['tableField'] = array(\n array('name'=>'id','title'=>'Mã'),\n array('name'=>'image','title'=>'Hình','type'=>'image','linkDetail'=>true),\n array('name'=>'title','title'=>'Tên','linkDetail'=>true),\n array('name'=>'c_title','title'=>'Loại'),\n array('name'=>'price','title'=>'Giá','type'=>'number'),\n array('name'=>'price_promotion','title'=>'Giá giảm','type'=>'number','hidden'=>true),\n array('name'=>'views','title'=>'Lượt xem','type'=>'number'),\n array('name'=>'is_active','title'=>'Trạng thái','type'=>'status'),\n array('name'=>'is_stock','title'=>'Còn hàng','type'=>'status','hidden'=>true),\n array('name'=>'is_special','title'=>'Nổi bật','type'=>'status','hidden'=>true)\n );\n }", "public function listdataSDMAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('SDM');\n }", "protected function loadFormData() \n {\n\t\t\techo '<br/> **************************************************************';\n\t\t echo '<br/> model VISTA -> funcion loadFormData\t\t\t\t ';\n\t\t echo '<br/> ************************************************************** <br/>';\n //Compruebe la sesión de datos de formularios previamente introducidos.\n $data = JFactory::getApplication()->getUserState('com_codigorecibo.edit.vista.data', array());\n if (empty($data)) \n {\n $data = $this->getItem();\n echo '///////////////////////////////////////////////////////////////////';\n echo '<br/>DENTRO model vista -> data en funcion loadFormData '.$data;\n echo '<pre>';\n print_r($data);\n echo '</pre>';\n echo '/////////////////////////////////////////////////////////////////////';\n // Prime some default values.\n //getstate cojo el id del registro indicando la vista en la que estoy\n\t\t\t\t\t\t\t\t\t//~ if ($this->getState('vista.id') == 0) \n\t\t\t\t\t\t\t\t\t//~ {\n\t\t\t\t\t\t\t\t\t\t//~ $id = $this->getState('vista.id');\n\t\t\t\t\t\t\t\t\t\t//~ echo '<br/> estado Model Vista --> funcion load --> '.$estado;\n\t\t\t\t\t\t\t\t\t\t//~ \n\t\t\t\t\t\t\t\t\t//~ }\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n }\n //data = los datos del registro\n $view = $_GET['view'];\n $layout =$_GET['layout'];\n echo '<br/>DEVUELVE = '.$view.'--'.$layout.' ------- model vista -> data en funcion loadFormData '.$data;\n //~ echo '<pre>';\n //~ print_r($this);\n //~ echo '</pre>';\n \n return $data;\n }", "function loadSimple($id){\r\n //$sql = $GLOBALS[\"db\"]->query('SELECT j_compte.*,j_partie.vitesse,j_partie.type FROM j_compte,j_partie WHERE j_compte.id = '.$id.' AND j_compte.partie = j_partie.id');\r\n if($id>0 AND $id != \"\"){\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_compte WHERE id = '.$id);\r\n $donnees = mysql_fetch_array($sql);\r\n }\r\n if($donnees['partie'] != 0 ){\r\n $sql = $GLOBALS[\"db\"]->query('SELECT * FROM j_partie WHERE id = '.$donnees['partie']);\r\n $donneesPartie = mysql_fetch_array($sql);\r\n }\r\n $this->id = $donnees['id'];\r\n $this->login = $donnees['login'];\r\n $this->mdp = $donnees['mdp'];\r\n $this->email = $donnees['email'];\r\n $this->skin = $donnees['skin'];\r\n $this->etat = $donnees['etat'];\r\n $this->points = $donnees['points'];\r\n $this->date_inscription = $donnees['date_inscription'];\r\n $this->date_dern_action = $donnees['date_dern_action'];\r\n $this->description = $donnees['description'];\r\n $this->age = $donnees['age'];\r\n $this->sexe = $donnees['sexe'];\r\n $this->alliance = $donnees['alliance'];\r\n $this->guilde = $donnees['guilde'];\r\n $this->avatar = $donnees['avatar'];\r\n $this->idVille = unserialize($donnees['idVille']);\r\n $this->idHero = unserialize($donnees['idHero']);\r\n $this->bois = $donnees['bois'];\r\n $this->ors = $donnees['ors'];\r\n $this->boisMax = $donnees['boisMax'];\r\n $this->orsMax = $donnees['orsMax'];\r\n $this->augOrsParMinute = $donnees['augOrsParMinute'];\r\n $this->augBoisParMinute = $donnees['augBoisParMinute'];\r\n $this->position = $donnees['position'];\r\n $this->partie = $donnees['partie'];\r\n $this->etatPartie = $donnees['etatPartie'];\r\n\r\n $this->tuto = unserialize($donnees['tuto']);\r\n\r\n $this->typePartie = $donneesPartie['type'];\r\n $this->vitesse = $donneesPartie['vitesse'];\r\n\r\n $GLOBALS['skin'] = $this->skin;\r\n $GLOBALS['ors'] = $this->ors;\r\n $GLOBALS['bois'] = $this->bois;\r\n $GLOBALS['idjoueur'] = $this->id;\r\n $GLOBALS['alliance'] = $this->alliance;\r\n $GLOBALS['typePartie'] = $this->typePartie;\r\n $GLOBALS['partie'] = $this->partie;\r\n $GLOBALS['vitesse'] = $this->vitesse;\r\n\r\n $_SESSION['typePartie'] = $this->typePartie;\r\n $_SESSION['partie'] = $this->partie;\r\n $_SESSION['alliance'] = $this->alliance;\r\n $_SESSION['etat'] = $this->etat;\r\n }", "public function loadData(): void\n {\n $data = $_POST['FldName'] ?? $_GET['FldName'] ?? '';\n switch ($data) {\n case 'Location':\n $countryId = (isset($_POST['CountryId']) && $_POST['CountryId'] !== '') ? $_POST['CountryId'] : null;\n $sql = 'SELECT L.Id, L.Name LocName FROM Locations L';\n if ($countryId !== null) {\n $sql .= ' LEFT JOIN Locations_Countries LC ON L.Id = LC.LocationId\n\t\t\t\t\tWHERE CountryId = :countryId';\n }\n $sql .= ' ORDER BY Name ASC';\n $stmt = $this->db->prepare($sql);\n if ($countryId !== null) {\n $stmt->bindParam(':countryId', $countryId);\n }\n $stmt->execute();\n while ($row = $stmt->fetch()) {\n echo '<option value=\"'.$row['Id'].'\">'.$row['LocName'].'</option>';\n }\n break;\n case 'KeywordName':\n $query = (isset($_GET['Name']) && $_GET['Name'] !== '') ? $_GET['Name'] : '';\n $limit = (isset($_GET['count']) && preg_match('/^[0-9]+$/', $_GET['count']) === 1) ? $_GET['count'] : 50;\n $offset = (isset($_GET['start']) && preg_match('/^[0-9]+$/', $_GET['start']) === 1) ? $_GET['start'] : 0;\n $sql = \"SELECT Id, Name FROM Keywords WHERE Name LIKE '%'||:query||'%' ORDER BY Name ASC LIMIT :limit OFFSET :offset\";\n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(':query', $query);\n $stmt->bindParam(':limit', $limit);\n $stmt->bindParam(':offset', $offset);\n $stmt->execute();\n $arr = $stmt->fetchAll();\n echo json_encode($arr);\n break;\n case 'ScientificName':\n $query = (isset($_POST['Val']) && $_POST['Val'] !== '') ? $_POST['Val'] : '';\n $colName = (isset($_POST['ColName']) && preg_match('/^\\w+$/', $_POST['ColName']) === 1) ? $_POST['ColName'] : 'NameDe';\n $limit = (isset($_POST['count']) && preg_match('/[0-9]+/', $_POST['count']) !== false) ? $_POST['count'] : 50;\n $offset = (isset($_POST['start']) && preg_match('/[0-9]+/', $_POST['start']) !== false) ? $_POST['start'] : 0;\n $sql = \"SELECT Id, NameDe, NameEn, NameLa, ThemeId FROM ScientificNames WHERE $colName LIKE '%'||:query||'%' LIMIT :limit OFFSET :offset\";\n $stmt = $this->db->prepare($sql);\n $stmt->bindParam(':query', $query);\n $stmt->bindParam(':limit', $limit);\n $stmt->bindParam(':offset', $offset);\n $stmt->execute();\n $arr = $stmt->fetchAll();\n $arr = ['identifier' => 'Id', 'items' => $arr];\n echo json_encode($arr);\n break;\n }\n }", "public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\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}", "function more_data(){\t \t \n\t\t$page = $this->input->post('page');\n\t\tif(empty($page)){ $page=0; }\n\t\t$offset = 10*$page;\n\t\t$limit = 10;\n\t\t$user__list = $this->InteractModal->all__active_users_limit('client',$limit, $offset);\n\t\t$count_record = $this->InteractModal->count_users('client');\n\t\t$page_data['user__list']= $user__list;\n\t\t$page_data['page']= $page;\n\t\t$this->load->view('common/client_load_more', $page_data);\t\n\t\t\t\t\n\t\t\t\n\t}", "function LoadData($conn)\r\n{\r\n\tglobal $x_credito_id;\r\n\t$sSql = \"SELECT * FROM `credito`\";\r\n\t$sWhere = \"\";\r\n\t$sGroupBy = \"\";\r\n\t$sHaving = \"\";\r\n\t$sOrderBy = \"\";\r\n\tif ($sWhere <> \"\") { $sWhere .= \" AND \"; }\r\n\t$sTmp = (get_magic_quotes_gpc()) ? stripslashes($x_credito_id) : $x_credito_id;\r\n\t$sWhere .= \"(`credito_id` = \" . addslashes($sTmp) . \")\";\r\n\t$sSql .= \" WHERE \" . $sWhere;\r\n\tif ($sGroupBy <> \"\") {\r\n\t\t$sSql .= \" GROUP BY \" . $sGroupBy;\r\n\t}\r\n\tif ($sHaving <> \"\") {\r\n\t\t$sSql .= \" HAVING \" . $sHaving;\r\n\t}\r\n\tif ($sOrderBy <> \"\") {\r\n\t\t$sSql .= \" ORDER BY \" . $sOrderBy;\r\n\t}\r\n\t$rs = phpmkr_query($sSql,$conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: ' . $sSql);\r\n\tif (phpmkr_num_rows($rs) == 0) {\r\n\t\t$bLoadData = false;\r\n\t}else{\r\n\t\t$bLoadData = true;\r\n\t\t$row = phpmkr_fetch_array($rs);\r\n\r\n\t\t// Get the field contents\r\n\t\t$GLOBALS[\"x_credito_id\"] = $row[\"credito_id\"];\r\n\t\t$GLOBALS[\"x_credito_tipo_id\"] = $row[\"credito_tipo_id\"];\r\n\t\t$GLOBALS[\"x_solicitud_id\"] = $row[\"solicitud_id\"];\r\n\t\t$GLOBALS[\"x_credito_status_id\"] = $row[\"credito_status_id\"];\r\n\t\t$GLOBALS[\"x_fecha_otrogamiento\"] = $row[\"fecha_otrogamiento\"];\r\n\t\t$GLOBALS[\"x_importe\"] = $row[\"importe\"];\r\n\t\t$GLOBALS[\"x_tasa\"] = $row[\"tasa\"];\r\n\t\t$GLOBALS[\"x_plazo\"] = $row[\"plazo\"];\r\n\t\t$GLOBALS[\"x_fecha_vencimiento\"] = $row[\"fecha_vencimiento\"];\r\n\t\t$GLOBALS[\"x_tasa_moratoria\"] = $row[\"tasa_moratoria\"];\r\n\t\t$GLOBALS[\"x_medio_pago_id\"] = $row[\"medio_pago_id\"];\r\n\t\t$GLOBALS[\"x_referencia_pago\"] = $row[\"referencia_pago\"];\r\n\t}\r\n\tphpmkr_free_result($rs);\r\n\treturn $bLoadData;\r\n}" ]
[ "0.65471524", "0.6047831", "0.59868556", "0.59704965", "0.5948991", "0.5943037", "0.59404165", "0.59404165", "0.59041655", "0.5886582", "0.5884342", "0.5864381", "0.58333427", "0.58153254", "0.580147", "0.5780677", "0.5776188", "0.57651263", "0.5762851", "0.57624966", "0.574984", "0.5747296", "0.5742372", "0.57285273", "0.56870437", "0.5675992", "0.56698495", "0.56550133", "0.56528366", "0.56127596", "0.56109124", "0.559878", "0.5597839", "0.55971175", "0.55824333", "0.55647177", "0.55565315", "0.55561537", "0.55559266", "0.55553204", "0.5551999", "0.55503887", "0.55487233", "0.55466926", "0.55401844", "0.5533201", "0.55154645", "0.5512995", "0.5497113", "0.54938495", "0.5493142", "0.5488696", "0.5487608", "0.54760915", "0.546938", "0.5449855", "0.54497886", "0.5446228", "0.5442613", "0.5436077", "0.54356384", "0.54329383", "0.5428006", "0.54273134", "0.54200095", "0.541922", "0.5418635", "0.54142433", "0.54082257", "0.5407592", "0.540423", "0.5399482", "0.53980607", "0.53979313", "0.5394924", "0.539324", "0.5389495", "0.5388634", "0.5387257", "0.5381749", "0.5381581", "0.53791493", "0.5376804", "0.5373198", "0.53689545", "0.536474", "0.5364258", "0.53638744", "0.53601027", "0.5356928", "0.53562313", "0.53543067", "0.5354229", "0.53505784", "0.53503877", "0.53493994", "0.5347088", "0.534217", "0.53417915", "0.53413516", "0.5327131" ]
0.0
-1
Get Comments recive id
public function GetCommentsData($_id, $_start, $_end) { //Get Database $_database = $this->ConnectDatabase(); //Create Data $_data = array($_id, $_start, $_end); //Call and return Database Function return $this->CallDatabase( $_database, $_data, function($_pdo, $_parameters) { //Create Query $_query = $_pdo->prepare("SELECT cm.id id, cm.description description, cm.ratting rate, cm.created date, cm.type `type`, us.nick_name user_nick, us.url_profile user_url_perfil FROM Comments cm LEFT JOIN Users us ON us.id = cm.id_user WHERE cm.id_partner = ? AND (cm.created BETWEEN ? AND ?) AND cm.type = 'ticket_comment' "); //Execute Query $_query->execute($_parameters); // echo $_query->debugDumpParams(); $_data = array(); while ($_row = $_query->fetch(PDO::FETCH_ASSOC)) { $_row['user_url_perfil'] = strlen($_row['user_url_perfil']) > 1 ? $this->image_client_path . $_row['user_url_perfil'] : null; $_row['date'] = $this->ConvertDataClient($_row['date']); array_push($_data, $_row); } $this->_response["status"] = true; $this->_response["error"] = null; $this->_response["data"] = $_data; return $this->_response; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getId()\n {\n return $this->_commentId;\n }", "public function getIdComment()\n {\n return $this->idComment;\n }", "public function getIdComment()\n {\n return $this->idComment;\n }", "public function getCommentId()\n {\n return $this->comment_id;\n }", "function get_comment_ID()\n {\n }", "public function getCommentId() {\n\t\treturn ($this->commentId);\n\t}", "public function id(): int\n {\n return $this->comment->id;\n }", "public function getCommentID()\n {\n return $this->commentID;\n }", "public function getCommentId()\n {\n return $this->_getValue('oepaypal_commentid');\n }", "private function _GetCommentByPostedId()\n {\n global $DB;\n if($cid = Is_Valid_Number(GetVar('cid', 0, 'whole_number'),0,1,99999999))\n {\n $DB->result_type = MYSQL_ASSOC;\n $c_arr = $DB->query_first('SELECT * FROM {comments} WHERE commentid = %d LIMIT 1', $cid);\n return $c_arr;\n }\n return false;\n }", "public function getID(): string {\n\t\treturn 'comments';\n\t}", "public function getCommentId(): Uuid {\n\t\treturn ($this->commentId);\n\t}", "public function getIdCommentaire()\n {\n return $this->Id_commentaire;\n }", "function getIdCommentaire() {\n return $this->idCommentaire;\n }", "public function getCommentPostId() {\n\t\treturn ($this->commentPostId);\n\t}", "function comment() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from comments where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "function getComment() {\n return DataObjectPool::get($this->getAdditionalProperty('comment_type'), $this->getAdditionalProperty('comment_id'));\n }", "function get_post_ID() {\n\t\treturn $this->get_data( 'comment_post_ID' );\n\t}", "public function getCommentsAdmin() \n {\n $db = $this->dbConnect();\n $reqPostComments = $this->bdd->query('SELECT id, id_post, author, comment, DATE_FORMAT(date_comment, \\'Le %d/%m/%Y à %H h %i\\') AS date_comment FROM comments ORDER BY date_comment DESC');\n $commentsId = $reqPostComments->fetchAll();\n $reqPostComments->closeCursor();\n return $commentsId;\n }", "public function getId(int $id)\n {\n $query = $this->db->pdo->prepare('SELECT id, idnews, idparent, niveau, moderate, content, membre, addDate FROM comments WHERE id =' . $id);\n $query->execute(['id' => $id]);\n\n $donnees = $query->fetch(PDO::FETCH_ASSOC);\n\n return new Comment($donnees);\n }", "function get_single_comment($comment_id) {\n global $db;\n $query = 'SELECT * FROM comments \n WHERE comment_id = :comment_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':comment_id', $comment_id);\n $statement->execute();\n $comment = $statement->fetch();\n $statement->closeCursor();\n return $comment;\n }", "function _get_comment_reply_id($post = \\null)\n {\n }", "protected function get_comment_ids()\n {\n }", "public function get_comment_id( $retval, $comment ) {\n\t\t$this->comment_id = $comment->comment_ID;\n\t\treturn $retval;\n\t}", "function user_get_comment_data($id = null)\n\t{\n\t\t$uid = ($id == null) ? $_SESSION['uid'] : $id;\n\t\t$comments = $this->DB->database_select('user_comments', '*', array('to_user' => $uid));\n\t\treturn $comments;\n\t}", "function comment_ID()\n {\n }", "public function getComment($idComment)\n\t{\t\n\t\t$req=$this->_bdd->query('SELECT id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate FROM Comments WHERE id='.$idComment);\n\t\t//die(var_dump($idComment));\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$comment=new Comments($datas);\n\t\t}\n\t\treturn $comment;\n\t}", "public function getComments($id){\n $id = (int)$id;\n $sql = \"select * from comments WHERE discussion_id = '{$id}'\";\n return $this->db->query($sql);\n }", "function get_comment_author($comment_id = 0)\n {\n }", "function get_comment_guid($comment_id = \\null)\n {\n }", "public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }", "public function idComment($idComment)\n\t{\n\t\t$datas= array('id'=>$idComment);\n\t\t$comment= new Comments($datas);\n\t\treturn $comment;\n\t}", "function get_comment_to_edit($id)\n {\n }", "public function getResourceId()\n\t{\n\t\treturn 'comment';\n\t}", "function getLatestCommentID() {\n $latestCommentID = 0;\n $dbr = wfGetDB( DB_SLAVE );\n $s = $dbr->selectRow(\n 'Comments',\n array( 'CommentID' ),\n array( 'Comment_Page_ID' => $this->id ),\n __METHOD__,\n array( 'ORDER BY' => 'Comment_Date DESC', 'LIMIT' => 1 )\n );\n if ( $s !== false ) {\n $latestCommentID = $s->CommentID;\n }\n return $latestCommentID;\n }", "function getorderid(){\n\t\n\t$comment = trim($_POST['comment']);\n\t\t\n\t\t$sql= \"SELECT design_order_id\n\t\tFROM `design_order`\n\t\tWHERE comment = '$comment'\n\t\tAND customer_id =\".$_SESSION['user_id'].\"\";\n\t\t\n\t\t$Q = $this-> db-> query($sql);\n\tif ($Q-> num_rows() > 0){\n\tforeach ($Q->result_array() as $row){\n\t$d = $row['design_order_id'];\n\t}\n\treturn $d;\n\t\n\t}\n\t}", "function get_comment_id_fields($post = \\null)\n {\n }", "public static function find_comment_by_comment_id($id){\n global $database;\n $sql = \"SELECT * FROM \" . self::$db_table . \" WHERE id = \" . $database->realEscapeString($id) .\" LIMIT 1\";\n $the_result_array= self::submit_query($sql);\n return !empty($the_result_array) ? array_shift($the_result_array) :false;\n }", "function getCommentNumberPost($postId)\n{\n global $conn;\n\n $sql = \"SELECT comments FROM post WHERE postId =$postId\";\n $result = mysqli_query($conn, $sql);\n $row = mysqli_fetch_assoc($result);\n return $row['comments'];\n}", "public function getById($id)\n {\n return $this->comment\n ->where('id', $id)\n ->get();\n }", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->message = $row['message'];\n\n }", "function getCommentData($comid)\n{\n\t$sql = \"SELECT * FROM comments WHERE commentID =\".$comid;\n\t$result = mysql_query($sql);\n \t$comment = mysql_fetch_array($result);\n \treturn $comment;\n}", "public function get_commentaire(){retrun($id_local_commentaire); }", "public function actionGetVehicleCommentInd($id){\n\t echo json_encode(VehicleComments::model()->getForVehicleInd($id));\n\t}", "public function get_comment($id)\r\n\t{\r\n\t\t// get the comments and join on the post so we\r\n\t\t// can get it's name\r\n\t\t$comment = $this->db\r\n\t\t\t\t\t\t->select('comments.*, posts.title as post_title')\r\n\t\t\t\t\t\t->where('comments.id', $id)\r\n\t\t\t\t\t\t->join($this->_table['posts'], \"posts.id = comments.post_id\")\r\n\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t->get($this->_table['comments'])\r\n\t\t\t\t\t\t->row_array();\r\n\r\n\t\t// there's two ways the comments come\r\n\t\t// out of the database.\r\n\t\t\r\n\t\t// an unregistered user\r\n\t\tif ($comment['name'])\r\n\t\t{\r\n\t\t\t// concat author and email and assign to display_name\r\n\t\t\t$comment['display_name'] = $comment['name'] . ' [' . $comment['email'] . ']';\r\n\t\t}\r\n\t\t// or a registered user\r\n\t\telse\r\n\t\t{\r\n\t\t\t// concat user_id and [Registered User](from the language files)\r\n\t\t\t// assign to display_name\r\n\t\t\t$comment['display_name'] = $this->ion_auth->get_db_display_name($comment['user_id']) . ' [' . lang('comments_reg_user') . ']';\r\n\t\t}\r\n\r\n\t\t// return it\r\n\t\treturn $comment;\r\n\t}", "function getcomment()\n\t{\n\t\t## variable initialization\n\t\tglobal $option, $mainframe, $db;\n\t\t$commentId = JRequest::getVar('cmtid', '', 'get', 'int');\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\n\t\t## for pagination\n\t\t$limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');\n\t\t$limitstart = $mainframe->getUserStateFromRequest($option . 'limitstart', 'limitstart', 0, 'int');\n\n\t\t## \tquery for delete the comments\n\t\tif ($commentId)\n\t\t{\n\t\t\t$query = \"DELETE FROM #__hdflv_comments\n \t\t WHERE id=\" . $commentId . \"\n \t\t OR parentid=\" . $commentId;\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t## message for deleting comment\n\t\t\t$mainframe->enqueueMessage( 'Comment Successfully Deleted' );\n\t\t}\n\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\t\t$query = \"SELECT COUNT(id) FROM #__hdflv_comments\n \t\t WHERE videoid = $id\";\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\t\tif (!$commentTotal)\n\t\t{\n\t\t\t$strRedirectPage = 'index.php?layout=adminvideos&option=' . JRequest::getVar('option') . '&user=' . JRequest::getVar('user');\n \t$mainframe->redirect($strRedirectPage);\n\t\t}\n\n\t\t$query=\"SELECT id as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid = 0 and published=1 and videoid=$id union\n\t\t\t\tSELECT parentid as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid !=0 and published=1 and videoid=$id\n\t\t\t\tORDER BY number desc,parentid\";## Query is to display the comments posted for particular video\n\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\n\t\t$pageNav = new JPagination($commentTotal, $limitstart, $limit);\n\n $query = \"$query LIMIT $pageNav->limitstart,$pageNav->limit\";\n\t\t$db->setQuery($query);\n\t\t$comment = $db->loadObjectList();\n\n\t\t$query = \"SELECT `title` FROM #__hdflv_upload WHERE id = $id\";\n\t\t$db->setQuery($query);\n\t\t$videoTitle = $db->loadResult();\n\n\t\t/**\n\t\t * get the most recent database error code\n\t\t * display the last database error message in a standard format\n\t\t *\n\t\t */\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tJError::raiseWarning($db->getErrorNum(), $db->stderr());\n\t\t}\n\n\t\t$comment = array('pageNav' => $pageNav, 'limitstart' => $limitstart, 'comment' => $comment ,'videotitle' => $videoTitle);\n\t\treturn $comment;\n\t}", "function &_getComment($cid){\n\t\tif (!isset($this->commentdata[$cid])) {\n\t\t\t$this->commentdata[$cid]=mysql_fetch_assoc($res=sql_query('SELECT * FROM '.sql_table('comment').' WHERE cnumber='.(int)$cid.' LIMIT 1'));\n\t\t\tmysql_free_result($res);\n\t\t}\n\t\treturn $this->commentdata[$cid];\n\t}", "public static function getComment($id) {\n\t\tif (!intval($id)) return false;\n\t\treturn self::_getDao()->get(intval($id));\n\t}", "function get_comment() {\n\t\treturn $this->comment;\n\t}", "function get($id) {\n $query = $this->db->prepare('SELECT * FROM comments WHERE id = ?');\n $query->execute([$id]);\n return $query->fetch(PDO::FETCH_OBJ);\n }", "public function getComment($id){\n $lesson=$this->getComments(\"WHERE `courses_lessons_comments`.`comment_id`=$id\");\n if(count($lesson)>0)\n return $lesson[0];\n return [];\n }", "public function getCommentAccordingToCommentId($commentID){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myquery=\"SELECT comment_id,comment_description,comment_date,news_id,user_name FROM comment where comment_id='\".$commentID.\"'\";\n\t\t\t $result= $conn->query($myquery);\n\t\t\t $c1=new Comment();\n\t\t\t foreach($result as $comment){\t\t\t\t\n\t\t\t\t$c1->setCommentId($comment[\"comment_id\"]);\n\t\t\t\t$c1->setCommentDescription($comment[\"comment_description\"]);\n\t\t\t\t$c1->setCommentDate($comment[\"comment_date\"]);\n\t\t\t\t$c1->setNewsId($comment[\"news_id\"]);\n\t\t\t\t$c1->setUserName($comment[\"user_name\"]);\n\t\t\t\t\t\t\t\t\n\t\t\t }\n\t\t\t$conn =null;\n\t\t\treturn $c1;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function get_comment()\n\t{\n\t\treturn $this->comment;\n\t}", "function comments() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['video_id'];\n if ($id > 0) {\n $query = \"select * from comments where video_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n } \n }", "public function findComment(int $id)\n {\n return static::find($id);\n }", "public function getId()\n {\n return $this->c_id;\n }", "public function getComment($commentid){\n\t\t$query = Queries::getcomment($commentid);\n\t\treturn $this->query($query);\n\t}", "public function find($id)\n {\n $comments = $this->session->get('comments', []);\n\n $comment = $comments[$id];\n\n return $comment;\n }", "public function getComment() {}", "public function get_id();", "public function get_id();", "function get_instance_comment($cId) \n {\n return $this->instance->get_instance_comment($cId);\n }", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "public function getComment($id)\n {\n $db = $this->dbConnect();\n $req = $db->prepare('SELECT id, author, comment, DATE_FORMAT(comment_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS comment_date_fr FROM comments WHERE id = ? ');\n $req->execute(array($id));\n $comment = $req->fetch();\n return $comment;\n }", "public function getMailComment($id) {\n\n\t\t$manager = $this->manager->getManager();\n\n\t\t$mail = $manager->prepare('SELECT * FROM comments WHERE ID = ?') or die(print_r($manager->errorMessage()));\n\n\t\t$mail->execute(array($id));\n\n\t\t$email = $mail->fetch();\n\n\t\treturn $email;\n\t}", "public function ListComments($id) {\n try {\n \n\t //$res = $this->db->ExecuteSelectQueryAndFetchAll(\"SELECT Comment.*, User.acronym as owner FROM Comment INNER JOIN User ON Comment.idUser=User.id WHERE idContent=? AND Comment.deleted IS NULL;\", array($id));\n\t $res = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('select * by content'), array($id));\n\t print_r($id);\n\t print_r($res);\n\t return $res;\n } catch(Exception $e) {\n\t\techo $e;\n\t\treturn null;\n }\n }", "static public function getComment($id) {\r\n //return decoded cached object if the comment are cached\r\n if(Cache::has(SELF::CACHE_INDENTIFIER.$id)) {\r\n $comment = json_decode(Cache::get(SELF::CACHE_INDENTIFIER.$id));\r\n //else retrieve comment from database and cache comment in json format\r\n } else{\r\n $comment = SELF::find($id);\r\n Cache::put(SELF::CACHE_INDENTIFIER.$id, json_encode($comment), SELF::CACHE_DURATION_MINUTES);\r\n }\r\n return $comment;\r\n }", "function getComment($db, $id) {\n $statement = $db->prepare(\"SELECT * FROM comments where id=:id\");\n $statement->bindValue(':id', $id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "public static function findCommentsOn($id=0){\n\t\t//So custom find function() is needed\n\t\tglobal $connection;\n\t\t$sql = \"SELECT * FROM \".static::$table_name.\" WHERE post_id = \";\n\t\t$sql .= $connection->real_escape_string($id) . \" ORDER BY created ASC \";\n\t\t//echo $sql;\n\t\treturn static::findBySql($sql);\n\t}", "public function getComment($comment_id){\n\n $comment_id = (int) $comment_id;\n\n\t\t$select = new Select;\n\n $select->from('y2m_comment')\n\n\t\t\t->where(array('y2m_comment.comment_id'=>$comment_id));\n\n\t\t$statement = $this->adapter->createStatement();\n\n\t\t$select->prepareStatement($this->adapter, $statement);\n\n\t\t//echo $mainSelect->getSqlString();\n\n\t\t$resultSet = new ResultSet();\t\t\n\n\t\t$resultSet->initialize($statement->execute());\t \n\n\t\treturn $resultSet->current();\n\n }", "function get_comment_author_url($comment_id = 0)\n {\n }", "public function getCommentTrailId(): Uuid {\n\t\treturn ($this->commentTrailId);\n\t}", "function getComment($commentID) {\n if ($commentID && $comment = $this->CI->Model('SocialComment')->get($commentID)->result) {\n return array(\n 'data' => $comment,\n 'metadata' => $comment::getMetadata(),\n );\n }\n }", "function get_commentdata($comment_id, $no_cache = 0, $include_unapproved = \\false)\n {\n }", "private function selectById($id) {\n $sql = \"SELECT * FROM `comments` WHERE `id` = :id\";\n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue(':id', $id); \n $stmt->execute(); \n return $stmt->fetch(PDO::FETCH_ASSOC); \n }", "function get_comment_author_IP($comment_id = 0)\n {\n }", "function getPostingComment($id = 0) {\n return getAll(\"SELECT r.content FROM posting_reply pr \n INNER JOIN posting p on pr.posting_id = p.id \n INNER JOIN reply r on pr.reply_id = r.id WHERE p.id = $id\");\n}", "public function get_reply_comments($id) {\n $this->db->query(\"SELECT * FROM replies, users WHERE comment_id = :id and replies.user_id = users.id\");\n $this->db->bind(':id', $id);\n $row = $this->db->resultSet();\n if ( $this->db->rowCount() > 0) {\n return $row;\n } else {\n return 'false';\n }\n }", "public function fetch_the_id() {}", "function get_user_comment()\n {\n global $conn;\n $user_id = $_GET['id'];\n $get_comment = \"SELECT * FROM comments WHERE userID = '$user_id' ORDER BY created_at DESC LIMIT 1\";\n $query_db = mysqli_query($conn, $get_comment);\n return $query_db;\n }", "public function getComment(int $id)\n\t{\n\n\t\treturn $this->select('c.*', 'e.title AS `episode`','ch.name AS `chapter`', 'u.first_name', 'u.last_name', 'c.email')\n\t\t\t ->from('comments c')\n\t\t\t ->join('LEFT JOIN episodes e ON c.episode_id=e.id')\n\t\t\t ->join('LEFT JOIN chapters ch ON e.chapter_id=ch.id')\n\t\t\t ->join('LEFT JOIN users u ON c.user_id=u.id')\n\t\t\t ->where('c.id=?', $id)\n\t\t\t ->fetch();\n\t}", "public function view($id)\n {\n return Comment::find($id);\n }", "public static function getCommentById($id)\n {\n $id = intval($id);\n\n if ($id) {\n $commentItem = [];\n $db = Db::getConnection();\n $result = $db->query('SELECT * FROM comments WHERE id_to_what_post =' . $id);\n\n $i = 0;\n while($row = $result->fetch()) {\n //$commentItem[$i]['id_to_what_post'] = $row['id_to_what_post'];\n $commentItem[$i]['date'] = $row['date'];\n $commentItem[$i]['text'] = $row['text'];\n $commentItem[$i]['author'] = $row['author'];\n $i++;\n }\n\n return $commentItem;\n }\n }", "public function getId() {\n return $this->get('id', 'news');\n }", "public function getComment()\n { \n return $this->comment;\n }", "public function readComment(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }", "public function getid()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "private function selectbyId($id) {\n $sql = \"SELECT * FROM `comments` WHERE `id` = :id\"; \n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue('id', $id); \n $stmt->execute(); \n return $stmt->fetch(PDO::FETCH_ASSOC); \n }", "public function getId(){\n return $this->_data['id'];\n }", "public function getComment()\n\t{\n\t\treturn $this->comment;\n\t}", "function getComments($post_id){\n GLOBAL $CONNECTION; \n $sql = \"SELECT * FROM comment WHERE post_id=$post_id ORDER BY commented_at DESC\";\n $comments = mysqli_query($CONNECTION, $sql);\n return $comments;\n }", "public function edit($id)\n {\n return comment::find($id);\n }" ]
[ "0.8121609", "0.79570055", "0.79570055", "0.7907798", "0.78875047", "0.78558445", "0.77994883", "0.7723602", "0.7546351", "0.75064725", "0.73979044", "0.73278487", "0.7171783", "0.706689", "0.69819933", "0.6853628", "0.68283504", "0.68185574", "0.6779278", "0.6772789", "0.67477", "0.6739067", "0.672385", "0.67083216", "0.66666025", "0.66657114", "0.6662778", "0.66540325", "0.663995", "0.6614824", "0.6589476", "0.6546262", "0.65376407", "0.65130407", "0.64948654", "0.6491759", "0.6466253", "0.6457449", "0.6457016", "0.64542806", "0.6446679", "0.6446679", "0.6446679", "0.6446679", "0.6446679", "0.6446679", "0.6427965", "0.64126134", "0.6393878", "0.639204", "0.6385975", "0.63815856", "0.63794464", "0.63712746", "0.6368489", "0.6366878", "0.63650453", "0.6356901", "0.6351066", "0.63416326", "0.6341232", "0.6340275", "0.63347733", "0.6328907", "0.63038766", "0.62992156", "0.62992156", "0.62966657", "0.62935543", "0.62935543", "0.62935543", "0.62912166", "0.62906134", "0.6280793", "0.62454563", "0.6240057", "0.6236888", "0.6234422", "0.62226635", "0.6222507", "0.6221009", "0.6205329", "0.62042904", "0.62023807", "0.6197853", "0.6196606", "0.61934906", "0.61909914", "0.61829513", "0.61710036", "0.61621404", "0.6160565", "0.6159403", "0.61553127", "0.6153374", "0.6153374", "0.61530256", "0.6147819", "0.6145369", "0.61437744", "0.61372334" ]
0.0
-1
Get on Service data recive id
private function GetServices($_list) { //Get Database $_database = $this->ConnectDatabase(); //Create Data $_data = array($_list); //Call and return Database Function return $this->CallDatabase( $_database, $_data, function($_pdo, $_parameters) { $_cond = '(' . $_parameters[0] . ')'; //Create Query $_query = $_pdo->prepare(" SELECT id, name FROM `Services` WHERE `id` IN " . $_cond ); //Execute Query $_query->execute($_parameters); $_data = array(); while ($_row = $_query->fetch(PDO::FETCH_ASSOC)) { array_push($_data, $_row); } return $_data; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getserviceId()\n {\n return $this->service_id;\n }", "public function getServiceId()\n {\n return $this->service_id;\n }", "public function getId(){\n return $this->_data['id'];\n }", "public function getServiceId() {\n return $this->serviceId;\n }", "public function getIdService() {\n return $this->idService;\n }", "public function getServiceId()\r\n {\r\n return $this->serviceId;\r\n }", "public function getId() {}", "public function getId() {}", "public function getId() {\n\t\treturn $this -> data['id'];\n\t}", "abstract protected function _getIdentityServiceId();", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "function getId() {\n\t\treturn $this->getData('id');\n\t}", "abstract public static function getServiceId(): string;", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "function getId(){\n\t\t\treturn $this->$id;\n\t\t}", "public function getId() {\r\n\t\treturn $this->data['id'];\r\n\t}", "public function get_id();", "public function get_id();", "function getId();", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "function getId(){\n\t\treturn $this->id;\n\t}", "public function getID();", "public function getID();", "public function getID();", "public function getId() ;", "public function getId(){\n\t\treturn $this->id;\n\t}", "public function getId(){\n\t\treturn $this->id;\n\t}", "public function getId(){\n\t\treturn $this->id;\n\t}", "public function getId(){\n\t\treturn $this->id;\n\t}", "public function getId(){\n\t\treturn $this->id;\n\t}", "function getID() {\n\t\treturn $this->data_array['id'];\n\t}", "public function getId(){\n return $this->id;\n }", "public static function id(){\n return self::info('id');\n }", "public function getId(){\r\n\t\treturn $this->id;\r\n\t}", "public function getId(){\r\n\t\t\treturn $this->id;\r\n\t\t}", "public function getId(){\n\t\t\treturn $this->id;\n\t\t}", "public function getId(){\n\t\t\treturn $this->id;\n\t\t}", "public function getId(){\n\t\t\treturn $this->id;\n\t\t}", "public function getId(){\n\t\t\treturn $this->id;\n\t\t}", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\r\n return $this->id;\r\n }", "function getId() {\n\t\treturn $this->id;\n\t}", "public function GetId () ;", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId(){\n return $this->id;\n }", "public function getId() {\n return $this->id;\n }", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();" ]
[ "0.7124434", "0.703428", "0.7018995", "0.695804", "0.6899601", "0.68947816", "0.6855121", "0.6855121", "0.6837995", "0.6758128", "0.6755041", "0.6755041", "0.67427254", "0.672395", "0.6703478", "0.6697409", "0.6664666", "0.6664666", "0.6661957", "0.66610676", "0.66610676", "0.66610676", "0.6658222", "0.6658222", "0.6658222", "0.66581035", "0.6645711", "0.6645711", "0.6645711", "0.6645711", "0.6645711", "0.6639372", "0.6633345", "0.6630432", "0.6622135", "0.6610916", "0.65986466", "0.65986466", "0.65986466", "0.65986466", "0.6590391", "0.6590391", "0.6590391", "0.65842557", "0.65801", "0.65752417", "0.6574085", "0.6574085", "0.6574085", "0.6574085", "0.6574085", "0.6574085", "0.6574085", "0.6574085", "0.6571529", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537", "0.65577537" ]
0.0
-1
Get Comments recive id
private function GetComments($_id) { //Get Database $_database = $this->ConnectDatabase(); //Create Data $_data = array($_id); //Call and return Database Function return $this->CallDatabase( $_database, $_data, function($_pdo, $_parameters) { //Create Query $_query = $_pdo->prepare("SELECT cm.id id, cm.description description, cm.ratting rate, cm.created date, cm.type `type`, us.nick_name user_nick, us.url_profile user_url_perfil FROM Comments cm LEFT JOIN Users us ON us.id = cm.id_user WHERE cm.id_partner = ? "); //Execute Query $_query->execute($_parameters); $_data = null; while ($_row = $_query->fetch(PDO::FETCH_ASSOC)) { $_row['user_url_perfil'] = strlen($_row['user_url_perfil']) > 1 ? $this->image_client_path . $_row['user_url_perfil'] : null; $_row['date'] = $this->ConvertDataClient($_row['date']); $_data = $_row; } return $_data; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getId()\n {\n return $this->_commentId;\n }", "public function getIdComment()\n {\n return $this->idComment;\n }", "public function getIdComment()\n {\n return $this->idComment;\n }", "public function getCommentId()\n {\n return $this->comment_id;\n }", "function get_comment_ID()\n {\n }", "public function getCommentId() {\n\t\treturn ($this->commentId);\n\t}", "public function id(): int\n {\n return $this->comment->id;\n }", "public function getCommentID()\n {\n return $this->commentID;\n }", "public function getCommentId()\n {\n return $this->_getValue('oepaypal_commentid');\n }", "private function _GetCommentByPostedId()\n {\n global $DB;\n if($cid = Is_Valid_Number(GetVar('cid', 0, 'whole_number'),0,1,99999999))\n {\n $DB->result_type = MYSQL_ASSOC;\n $c_arr = $DB->query_first('SELECT * FROM {comments} WHERE commentid = %d LIMIT 1', $cid);\n return $c_arr;\n }\n return false;\n }", "public function getID(): string {\n\t\treturn 'comments';\n\t}", "public function getCommentId(): Uuid {\n\t\treturn ($this->commentId);\n\t}", "public function getIdCommentaire()\n {\n return $this->Id_commentaire;\n }", "function getIdCommentaire() {\n return $this->idCommentaire;\n }", "public function getCommentPostId() {\n\t\treturn ($this->commentPostId);\n\t}", "function comment() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from comments where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "function getComment() {\n return DataObjectPool::get($this->getAdditionalProperty('comment_type'), $this->getAdditionalProperty('comment_id'));\n }", "function get_post_ID() {\n\t\treturn $this->get_data( 'comment_post_ID' );\n\t}", "public function getCommentsAdmin() \n {\n $db = $this->dbConnect();\n $reqPostComments = $this->bdd->query('SELECT id, id_post, author, comment, DATE_FORMAT(date_comment, \\'Le %d/%m/%Y à %H h %i\\') AS date_comment FROM comments ORDER BY date_comment DESC');\n $commentsId = $reqPostComments->fetchAll();\n $reqPostComments->closeCursor();\n return $commentsId;\n }", "public function getId(int $id)\n {\n $query = $this->db->pdo->prepare('SELECT id, idnews, idparent, niveau, moderate, content, membre, addDate FROM comments WHERE id =' . $id);\n $query->execute(['id' => $id]);\n\n $donnees = $query->fetch(PDO::FETCH_ASSOC);\n\n return new Comment($donnees);\n }", "function get_single_comment($comment_id) {\n global $db;\n $query = 'SELECT * FROM comments \n WHERE comment_id = :comment_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':comment_id', $comment_id);\n $statement->execute();\n $comment = $statement->fetch();\n $statement->closeCursor();\n return $comment;\n }", "function _get_comment_reply_id($post = \\null)\n {\n }", "protected function get_comment_ids()\n {\n }", "public function get_comment_id( $retval, $comment ) {\n\t\t$this->comment_id = $comment->comment_ID;\n\t\treturn $retval;\n\t}", "function user_get_comment_data($id = null)\n\t{\n\t\t$uid = ($id == null) ? $_SESSION['uid'] : $id;\n\t\t$comments = $this->DB->database_select('user_comments', '*', array('to_user' => $uid));\n\t\treturn $comments;\n\t}", "function comment_ID()\n {\n }", "public function getComment($idComment)\n\t{\t\n\t\t$req=$this->_bdd->query('SELECT id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate FROM Comments WHERE id='.$idComment);\n\t\t//die(var_dump($idComment));\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$comment=new Comments($datas);\n\t\t}\n\t\treturn $comment;\n\t}", "public function getComments($id){\n $id = (int)$id;\n $sql = \"select * from comments WHERE discussion_id = '{$id}'\";\n return $this->db->query($sql);\n }", "function get_comment_author($comment_id = 0)\n {\n }", "function get_comment_guid($comment_id = \\null)\n {\n }", "public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }", "public function idComment($idComment)\n\t{\n\t\t$datas= array('id'=>$idComment);\n\t\t$comment= new Comments($datas);\n\t\treturn $comment;\n\t}", "function get_comment_to_edit($id)\n {\n }", "public function getResourceId()\n\t{\n\t\treturn 'comment';\n\t}", "function getLatestCommentID() {\n $latestCommentID = 0;\n $dbr = wfGetDB( DB_SLAVE );\n $s = $dbr->selectRow(\n 'Comments',\n array( 'CommentID' ),\n array( 'Comment_Page_ID' => $this->id ),\n __METHOD__,\n array( 'ORDER BY' => 'Comment_Date DESC', 'LIMIT' => 1 )\n );\n if ( $s !== false ) {\n $latestCommentID = $s->CommentID;\n }\n return $latestCommentID;\n }", "function getorderid(){\n\t\n\t$comment = trim($_POST['comment']);\n\t\t\n\t\t$sql= \"SELECT design_order_id\n\t\tFROM `design_order`\n\t\tWHERE comment = '$comment'\n\t\tAND customer_id =\".$_SESSION['user_id'].\"\";\n\t\t\n\t\t$Q = $this-> db-> query($sql);\n\tif ($Q-> num_rows() > 0){\n\tforeach ($Q->result_array() as $row){\n\t$d = $row['design_order_id'];\n\t}\n\treturn $d;\n\t\n\t}\n\t}", "function get_comment_id_fields($post = \\null)\n {\n }", "public static function find_comment_by_comment_id($id){\n global $database;\n $sql = \"SELECT * FROM \" . self::$db_table . \" WHERE id = \" . $database->realEscapeString($id) .\" LIMIT 1\";\n $the_result_array= self::submit_query($sql);\n return !empty($the_result_array) ? array_shift($the_result_array) :false;\n }", "function getCommentNumberPost($postId)\n{\n global $conn;\n\n $sql = \"SELECT comments FROM post WHERE postId =$postId\";\n $result = mysqli_query($conn, $sql);\n $row = mysqli_fetch_assoc($result);\n return $row['comments'];\n}", "public function getById($id)\n {\n return $this->comment\n ->where('id', $id)\n ->get();\n }", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->message = $row['message'];\n\n }", "function getCommentData($comid)\n{\n\t$sql = \"SELECT * FROM comments WHERE commentID =\".$comid;\n\t$result = mysql_query($sql);\n \t$comment = mysql_fetch_array($result);\n \treturn $comment;\n}", "public function get_commentaire(){retrun($id_local_commentaire); }", "public function actionGetVehicleCommentInd($id){\n\t echo json_encode(VehicleComments::model()->getForVehicleInd($id));\n\t}", "public function get_comment($id)\r\n\t{\r\n\t\t// get the comments and join on the post so we\r\n\t\t// can get it's name\r\n\t\t$comment = $this->db\r\n\t\t\t\t\t\t->select('comments.*, posts.title as post_title')\r\n\t\t\t\t\t\t->where('comments.id', $id)\r\n\t\t\t\t\t\t->join($this->_table['posts'], \"posts.id = comments.post_id\")\r\n\t\t\t\t\t\t->limit(1)\r\n\t\t\t\t\t\t->get($this->_table['comments'])\r\n\t\t\t\t\t\t->row_array();\r\n\r\n\t\t// there's two ways the comments come\r\n\t\t// out of the database.\r\n\t\t\r\n\t\t// an unregistered user\r\n\t\tif ($comment['name'])\r\n\t\t{\r\n\t\t\t// concat author and email and assign to display_name\r\n\t\t\t$comment['display_name'] = $comment['name'] . ' [' . $comment['email'] . ']';\r\n\t\t}\r\n\t\t// or a registered user\r\n\t\telse\r\n\t\t{\r\n\t\t\t// concat user_id and [Registered User](from the language files)\r\n\t\t\t// assign to display_name\r\n\t\t\t$comment['display_name'] = $this->ion_auth->get_db_display_name($comment['user_id']) . ' [' . lang('comments_reg_user') . ']';\r\n\t\t}\r\n\r\n\t\t// return it\r\n\t\treturn $comment;\r\n\t}", "function getcomment()\n\t{\n\t\t## variable initialization\n\t\tglobal $option, $mainframe, $db;\n\t\t$commentId = JRequest::getVar('cmtid', '', 'get', 'int');\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\n\t\t## for pagination\n\t\t$limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');\n\t\t$limitstart = $mainframe->getUserStateFromRequest($option . 'limitstart', 'limitstart', 0, 'int');\n\n\t\t## \tquery for delete the comments\n\t\tif ($commentId)\n\t\t{\n\t\t\t$query = \"DELETE FROM #__hdflv_comments\n \t\t WHERE id=\" . $commentId . \"\n \t\t OR parentid=\" . $commentId;\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t## message for deleting comment\n\t\t\t$mainframe->enqueueMessage( 'Comment Successfully Deleted' );\n\t\t}\n\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\t\t$query = \"SELECT COUNT(id) FROM #__hdflv_comments\n \t\t WHERE videoid = $id\";\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\t\tif (!$commentTotal)\n\t\t{\n\t\t\t$strRedirectPage = 'index.php?layout=adminvideos&option=' . JRequest::getVar('option') . '&user=' . JRequest::getVar('user');\n \t$mainframe->redirect($strRedirectPage);\n\t\t}\n\n\t\t$query=\"SELECT id as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid = 0 and published=1 and videoid=$id union\n\t\t\t\tSELECT parentid as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid !=0 and published=1 and videoid=$id\n\t\t\t\tORDER BY number desc,parentid\";## Query is to display the comments posted for particular video\n\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\n\t\t$pageNav = new JPagination($commentTotal, $limitstart, $limit);\n\n $query = \"$query LIMIT $pageNav->limitstart,$pageNav->limit\";\n\t\t$db->setQuery($query);\n\t\t$comment = $db->loadObjectList();\n\n\t\t$query = \"SELECT `title` FROM #__hdflv_upload WHERE id = $id\";\n\t\t$db->setQuery($query);\n\t\t$videoTitle = $db->loadResult();\n\n\t\t/**\n\t\t * get the most recent database error code\n\t\t * display the last database error message in a standard format\n\t\t *\n\t\t */\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tJError::raiseWarning($db->getErrorNum(), $db->stderr());\n\t\t}\n\n\t\t$comment = array('pageNav' => $pageNav, 'limitstart' => $limitstart, 'comment' => $comment ,'videotitle' => $videoTitle);\n\t\treturn $comment;\n\t}", "function &_getComment($cid){\n\t\tif (!isset($this->commentdata[$cid])) {\n\t\t\t$this->commentdata[$cid]=mysql_fetch_assoc($res=sql_query('SELECT * FROM '.sql_table('comment').' WHERE cnumber='.(int)$cid.' LIMIT 1'));\n\t\t\tmysql_free_result($res);\n\t\t}\n\t\treturn $this->commentdata[$cid];\n\t}", "public static function getComment($id) {\n\t\tif (!intval($id)) return false;\n\t\treturn self::_getDao()->get(intval($id));\n\t}", "function get_comment() {\n\t\treturn $this->comment;\n\t}", "function get($id) {\n $query = $this->db->prepare('SELECT * FROM comments WHERE id = ?');\n $query->execute([$id]);\n return $query->fetch(PDO::FETCH_OBJ);\n }", "public function getComment($id){\n $lesson=$this->getComments(\"WHERE `courses_lessons_comments`.`comment_id`=$id\");\n if(count($lesson)>0)\n return $lesson[0];\n return [];\n }", "public function getCommentAccordingToCommentId($commentID){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myquery=\"SELECT comment_id,comment_description,comment_date,news_id,user_name FROM comment where comment_id='\".$commentID.\"'\";\n\t\t\t $result= $conn->query($myquery);\n\t\t\t $c1=new Comment();\n\t\t\t foreach($result as $comment){\t\t\t\t\n\t\t\t\t$c1->setCommentId($comment[\"comment_id\"]);\n\t\t\t\t$c1->setCommentDescription($comment[\"comment_description\"]);\n\t\t\t\t$c1->setCommentDate($comment[\"comment_date\"]);\n\t\t\t\t$c1->setNewsId($comment[\"news_id\"]);\n\t\t\t\t$c1->setUserName($comment[\"user_name\"]);\n\t\t\t\t\t\t\t\t\n\t\t\t }\n\t\t\t$conn =null;\n\t\t\treturn $c1;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function get_comment()\n\t{\n\t\treturn $this->comment;\n\t}", "function comments() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['video_id'];\n if ($id > 0) {\n $query = \"select * from comments where video_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n } \n }", "public function findComment(int $id)\n {\n return static::find($id);\n }", "public function getId()\n {\n return $this->c_id;\n }", "public function getComment($commentid){\n\t\t$query = Queries::getcomment($commentid);\n\t\treturn $this->query($query);\n\t}", "public function find($id)\n {\n $comments = $this->session->get('comments', []);\n\n $comment = $comments[$id];\n\n return $comment;\n }", "public function getComment() {}", "public function get_id();", "public function get_id();", "function get_instance_comment($cId) \n {\n return $this->instance->get_instance_comment($cId);\n }", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "public function getComment($id)\n {\n $db = $this->dbConnect();\n $req = $db->prepare('SELECT id, author, comment, DATE_FORMAT(comment_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS comment_date_fr FROM comments WHERE id = ? ');\n $req->execute(array($id));\n $comment = $req->fetch();\n return $comment;\n }", "public function getMailComment($id) {\n\n\t\t$manager = $this->manager->getManager();\n\n\t\t$mail = $manager->prepare('SELECT * FROM comments WHERE ID = ?') or die(print_r($manager->errorMessage()));\n\n\t\t$mail->execute(array($id));\n\n\t\t$email = $mail->fetch();\n\n\t\treturn $email;\n\t}", "public function ListComments($id) {\n try {\n \n\t //$res = $this->db->ExecuteSelectQueryAndFetchAll(\"SELECT Comment.*, User.acronym as owner FROM Comment INNER JOIN User ON Comment.idUser=User.id WHERE idContent=? AND Comment.deleted IS NULL;\", array($id));\n\t $res = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('select * by content'), array($id));\n\t print_r($id);\n\t print_r($res);\n\t return $res;\n } catch(Exception $e) {\n\t\techo $e;\n\t\treturn null;\n }\n }", "static public function getComment($id) {\r\n //return decoded cached object if the comment are cached\r\n if(Cache::has(SELF::CACHE_INDENTIFIER.$id)) {\r\n $comment = json_decode(Cache::get(SELF::CACHE_INDENTIFIER.$id));\r\n //else retrieve comment from database and cache comment in json format\r\n } else{\r\n $comment = SELF::find($id);\r\n Cache::put(SELF::CACHE_INDENTIFIER.$id, json_encode($comment), SELF::CACHE_DURATION_MINUTES);\r\n }\r\n return $comment;\r\n }", "function getComment($db, $id) {\n $statement = $db->prepare(\"SELECT * FROM comments where id=:id\");\n $statement->bindValue(':id', $id);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "public static function findCommentsOn($id=0){\n\t\t//So custom find function() is needed\n\t\tglobal $connection;\n\t\t$sql = \"SELECT * FROM \".static::$table_name.\" WHERE post_id = \";\n\t\t$sql .= $connection->real_escape_string($id) . \" ORDER BY created ASC \";\n\t\t//echo $sql;\n\t\treturn static::findBySql($sql);\n\t}", "public function getComment($comment_id){\n\n $comment_id = (int) $comment_id;\n\n\t\t$select = new Select;\n\n $select->from('y2m_comment')\n\n\t\t\t->where(array('y2m_comment.comment_id'=>$comment_id));\n\n\t\t$statement = $this->adapter->createStatement();\n\n\t\t$select->prepareStatement($this->adapter, $statement);\n\n\t\t//echo $mainSelect->getSqlString();\n\n\t\t$resultSet = new ResultSet();\t\t\n\n\t\t$resultSet->initialize($statement->execute());\t \n\n\t\treturn $resultSet->current();\n\n }", "function get_comment_author_url($comment_id = 0)\n {\n }", "public function getCommentTrailId(): Uuid {\n\t\treturn ($this->commentTrailId);\n\t}", "function getComment($commentID) {\n if ($commentID && $comment = $this->CI->Model('SocialComment')->get($commentID)->result) {\n return array(\n 'data' => $comment,\n 'metadata' => $comment::getMetadata(),\n );\n }\n }", "function get_commentdata($comment_id, $no_cache = 0, $include_unapproved = \\false)\n {\n }", "private function selectById($id) {\n $sql = \"SELECT * FROM `comments` WHERE `id` = :id\";\n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue(':id', $id); \n $stmt->execute(); \n return $stmt->fetch(PDO::FETCH_ASSOC); \n }", "function get_comment_author_IP($comment_id = 0)\n {\n }", "function getPostingComment($id = 0) {\n return getAll(\"SELECT r.content FROM posting_reply pr \n INNER JOIN posting p on pr.posting_id = p.id \n INNER JOIN reply r on pr.reply_id = r.id WHERE p.id = $id\");\n}", "public function get_reply_comments($id) {\n $this->db->query(\"SELECT * FROM replies, users WHERE comment_id = :id and replies.user_id = users.id\");\n $this->db->bind(':id', $id);\n $row = $this->db->resultSet();\n if ( $this->db->rowCount() > 0) {\n return $row;\n } else {\n return 'false';\n }\n }", "public function fetch_the_id() {}", "function get_user_comment()\n {\n global $conn;\n $user_id = $_GET['id'];\n $get_comment = \"SELECT * FROM comments WHERE userID = '$user_id' ORDER BY created_at DESC LIMIT 1\";\n $query_db = mysqli_query($conn, $get_comment);\n return $query_db;\n }", "public function getComment(int $id)\n\t{\n\n\t\treturn $this->select('c.*', 'e.title AS `episode`','ch.name AS `chapter`', 'u.first_name', 'u.last_name', 'c.email')\n\t\t\t ->from('comments c')\n\t\t\t ->join('LEFT JOIN episodes e ON c.episode_id=e.id')\n\t\t\t ->join('LEFT JOIN chapters ch ON e.chapter_id=ch.id')\n\t\t\t ->join('LEFT JOIN users u ON c.user_id=u.id')\n\t\t\t ->where('c.id=?', $id)\n\t\t\t ->fetch();\n\t}", "public function view($id)\n {\n return Comment::find($id);\n }", "public static function getCommentById($id)\n {\n $id = intval($id);\n\n if ($id) {\n $commentItem = [];\n $db = Db::getConnection();\n $result = $db->query('SELECT * FROM comments WHERE id_to_what_post =' . $id);\n\n $i = 0;\n while($row = $result->fetch()) {\n //$commentItem[$i]['id_to_what_post'] = $row['id_to_what_post'];\n $commentItem[$i]['date'] = $row['date'];\n $commentItem[$i]['text'] = $row['text'];\n $commentItem[$i]['author'] = $row['author'];\n $i++;\n }\n\n return $commentItem;\n }\n }", "public function getId() {\n return $this->get('id', 'news');\n }", "public function getComment()\n { \n return $this->comment;\n }", "public function readComment(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }", "public function getid()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "private function selectbyId($id) {\n $sql = \"SELECT * FROM `comments` WHERE `id` = :id\"; \n $stmt = $this->pdo->prepare($sql); \n $stmt->bindValue('id', $id); \n $stmt->execute(); \n return $stmt->fetch(PDO::FETCH_ASSOC); \n }", "public function getId(){\n return $this->_data['id'];\n }", "public function getComment()\n\t{\n\t\treturn $this->comment;\n\t}", "function getComments($post_id){\n GLOBAL $CONNECTION; \n $sql = \"SELECT * FROM comment WHERE post_id=$post_id ORDER BY commented_at DESC\";\n $comments = mysqli_query($CONNECTION, $sql);\n return $comments;\n }", "public function edit($id)\n {\n return comment::find($id);\n }" ]
[ "0.8121609", "0.79570055", "0.79570055", "0.7907798", "0.78875047", "0.78558445", "0.77994883", "0.7723602", "0.7546351", "0.75064725", "0.73979044", "0.73278487", "0.7171783", "0.706689", "0.69819933", "0.6853628", "0.68283504", "0.68185574", "0.6779278", "0.6772789", "0.67477", "0.6739067", "0.672385", "0.67083216", "0.66666025", "0.66657114", "0.6662778", "0.66540325", "0.663995", "0.6614824", "0.6589476", "0.6546262", "0.65376407", "0.65130407", "0.64948654", "0.6491759", "0.6466253", "0.6457449", "0.6457016", "0.64542806", "0.6446679", "0.6446679", "0.6446679", "0.6446679", "0.6446679", "0.6446679", "0.6427965", "0.64126134", "0.6393878", "0.639204", "0.6385975", "0.63815856", "0.63794464", "0.63712746", "0.6368489", "0.6366878", "0.63650453", "0.6356901", "0.6351066", "0.63416326", "0.6341232", "0.6340275", "0.63347733", "0.6328907", "0.63038766", "0.62992156", "0.62992156", "0.62966657", "0.62935543", "0.62935543", "0.62935543", "0.62912166", "0.62906134", "0.6280793", "0.62454563", "0.6240057", "0.6236888", "0.6234422", "0.62226635", "0.6222507", "0.6221009", "0.6205329", "0.62042904", "0.62023807", "0.6197853", "0.6196606", "0.61934906", "0.61909914", "0.61829513", "0.61710036", "0.61621404", "0.6160565", "0.6159403", "0.61553127", "0.6153374", "0.6153374", "0.61530256", "0.6147819", "0.6145369", "0.61437744", "0.61372334" ]
0.0
-1
Call and return Database Function
private function UpdateServices($_database, $_data) { return $this->CallDatabase($_database, $_data, function($_pdo, $_parameters) { $set = "id_services = ?, prices = ?, actives = ?"; //Create Query $_query = $_pdo->prepare("UPDATE `PartnerServices` SET " . $set . " WHERE id_partner = ? "); //Execute Query $_query->execute($_parameters); //Tratamento da resposta if (is_null($_query->errorInfo())) { $this->_response["status"] = false; $this->_response["error"] = $_query->errorInfo(); } else { $this->_response["status"] = true; } return $this->_response; } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDatabase();", "public function database();", "function smarty_function_db($params, &$smarty)\n{\n extract($params);\n switch($function) {\n\tcase \"fetch\":\n\t return content::fetch($key);\n\t break;\n\tdefault:\n\t return;\n\t break;\n }\n}", "function MySQL() {\n \n }", "public function getFunction($q){\r\t\t$this->connect();\t//connect if not connected \r\t\t$res=sqlite_fetch_array (sqlite_query($this->handle,$q));\r\t\treturn $res[\"0\"];\r\t}", "public function dbInstance();", "function getDBFunction()\n {\n if($this->precision == 0 and $this->scale == 0)\n return parent::getDBFunction();\n\n return \"$this->functionName('\".$this->attrName.\"', $this->precision, $this->scale)\";\n }", "function connectDB();", "function get_db_value($sql)\n{\n global $db;\n $db_look = new DB_Sql();\n $db_look->Database = $db->Database;\n $db_look->User = $db->User;\n $db_look->Password = $db->Password;\n $db_look->Host = $db->Host;\n\n $db_look->query($sql);\n if($db_look->next_record())\n return $db_look->f(0);\n else\n return \"\";\n}", "public function getFromDB() {}", "function sqlite_create_function($dbhandle, $function_name, $callback, $num_args = -1)\n{\n}", "function logUseInDB($function, $objDB)\n{\n $objDB->query(\"INSERT INTO `editor_statistics` (`function`) VALUES ('$function');\");\n}", "function execute();", "function sqlite_create_function($function_name, $callback, $num_args = -1)\n{\n}", "public function getDb();", "public static function staticFunc1($db) {\n// readme($result->count());exit;\n// exit;\n }", "function kval_sqlite_query($sql)\n{\n return kval_sqlite_queryexec(func_get_args())[1];\n}", "abstract function getSQL();", "function kval_sqlite_exec($sql)\n{\n return kval_sqlite_queryexec(func_get_args())[0];\n}", "function db(){\n\treturn Database::getInstance();\n}", "public abstract function operateDB($data);", "function queryDataBase($string){\n\n\tinclude(\"./config/database.cfg\");\n\n\treturn (performQuery($cfg['DB_NAME'],$cfg['DB_USER'],$cfg['DB_PASSWORD'],$string));\n\n}", "function useDatabase($conn,$queryString)\r\n{\r\n// $result = mysql_query ($queryString);\r\n$result = mysqli_query($conn, $queryString);\r\n//Return result - needs to be processed using the\r\nreturn $result;\r\n}", "function testCreatSqlFunction()\r\n {\r\n global $webUrl;\r\n global $lang, $DATABASE, $SERVER;\r\n\r\n // Turn to the \"Create SQL/PL function\" page.\r\n\t\t$this->assertTrue($this->get(\"$webUrl/functions.php\", array(\r\n\t\t\t 'server' => $SERVER,\r\n\t\t\t\t\t\t'action' => 'create',\r\n\t\t\t\t\t\t'database' => $DATABASE,\r\n\t\t\t\t\t\t'schema' => 'public'))\r\n\t\t\t\t\t);\r\n \r\n // Enter the detail information of a SQL/PL function.\r\n $this->assertTrue($this->setField('formFunction', 'sqlplfunction')); \r\n $this->assertTrue($this->setField('formArguments', 'double precision[], double precision'));\r\n $this->assertTrue($this->setField('formSetOf', 'SETOF'));\r\n $this->assertTrue($this->setField('formReturns', 'double precision'));\r\n $this->assertTrue($this->setField('formArray', '[ ]'));\r\n $this->assertTrue($this->setField('formLanguage', 'sql'));\r\n $this->assertTrue($this->setField('formDefinition', 'select $1'));\r\n $this->assertTrue($this->setField('formProperties[0]', 'VOLATILE'));\r\n $this->assertTrue($this->setField('formProperties[1]', 'RETURNS NULL ON NULL INPUT'));\r\n $this->assertTrue($this->setField('formProperties[2]', 'SECURITY INVOKER')); \r\n \r\n // Click the \"Create\" button to create a function. \r\n $this->assertTrue($this->clickSubmit($lang['strcreate']));\r\n \r\n // Verify whether the function is created successfully.\r\n $this->assertTrue($this->assertWantedText($lang['strfunctioncreated'])); \r\n \r\n return TRUE; \r\n }", "function get_database() {\n $db = new Database();\n return ($db->connect());\n}", "protected function getDatabase() {}", "function UseDB() {\n $sql = \"USE mydb;\";\n performSQL($sql);\n}", "public static function query();", "public function testFunctionWithDatabaseQuery(): void\n {\n $query = ConnectionManager::get('test')\n ->selectQuery(['column']);\n\n $binder = new ValueBinder();\n $function = new $this->expressionClass('MyFunction', [$query]);\n $this->assertSame(\n 'MyFunction((SELECT column))',\n preg_replace('/[`\"\\[\\]]/', '', $function->sql($binder))\n );\n }", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "function getFunctions() {\n return mysql_query(sprintf('SELECT definer, name, param_list, returns, body FROM mysql.proc WHERE db = \\'%s\\' AND type = \\'FUNCTION\\'', $this->config[\"database\"]));\n }", "function wrapper_select_db($dbname) {\n\t\treturn $this->functions['select_db']($dbname, $this->link_id);\n\t}", "public function run(){\n $sql = $this->sql();\n return $this->query($sql,$this->args);\n }", "public function sql(): string;", "function get_sql_crud() {\n try {\n $app = Slim\\Slim::getInstance();\n $table = $app->request->params('table_name');\n $model = $app->request->params('model');\n $ck_sql_alias = $app->request->params('ck_sql_alias');\n\n $gii = new easyuigii();\n $gii->ck_sql_alias = $ck_sql_alias;\n $data = $gii->get_sql_for_select($table, $model);\n\n $app->render(200, ['success' => true, 'sql' => $data]);\n } catch (Exception $e) {\n $app->render(200, ['isError' => true, 'msg' => $e->getMessage()]);\n error_log(LogTime() . 'error - get sql for crud ' . PHP_EOL, 3, 'logs/error.log');\n }\n}", "private function func_execute () {\n $this -> connection = parent::func_query ($this -> query, $this -> query_data);\n }", "public function getDatabaseHandler();", "function PhpDbCommonFunction($sql, $successtext){\r\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\r\n\t\t// Check connection\r\n\t\tif ($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\r\n\t\t} \r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n\t\t\techo $successtext;\r\n\t\t} else {\r\n\t\t\techo \"Error : \" . $conn->error;\r\n\t\t}\r\n\r\n\t\t$conn->close();\r\n\t}", "function db()\r\n{\r\n global $db;\r\n return $db;\r\n}", "public function query();", "public function query();", "public function query();", "public function module_db() {\n\t\treturn ( isset( $this->module_db ) && ! empty( $this->module_db ) ) ? $this->module_db : $this->module();\n\t}", "public function getDatabase(): string;", "function db_query($query) {\n $db = db_connect();\n $result = $db->query($query);\n \n if(!$result) {\n echo \"Query Error: \" . db_error();\n return false;\n }\n\n return $result;\n}", "public function loadListFunction()\n {\n \t$select = $this->select();\n \t$select->distinct(true);\n \t$select->setIntegrityCheck(false);\n \t$select->from(array('fn' => 'function'),\n \t\t\tarray('fn.function_id', 'fn.name AS function_name'));\n \t$stmt = $select->query();\n \t$result = $stmt->fetchAll();\n \t// \techo $select->__toString() . \"\\n\";\n \treturn $result;\n }", "function db_execute($sql){\n db_connect();\n global $con;\n $result = mysqli_query($con,$sql) or die(mysqli_error($con));\n return $result;\n}", "public function call_function($fun_name, array $named_args = array()) {\n $response = $this->db->execute(new MongoCode(\"$fun_name()\",$named_args));\n return isset($response['retval'])?$response['retval']:$response;\n \n }", "public function getSQL();", "function getConnection($db,$custom);", "public function callFunction($function, array $params) {\n $params = implode(', ', $params);\n $this->_dataHandler->select(\"{$function}({$params}) AS result\", 'DUAL');\n\n return $this->_dataHandler->fetchObject()->result;\n }", "function query_to_db($conn, $sql){\r\n $result = mysqli_query($conn, $sql);\r\n return $result;\r\n}", "function db_table() {\n\t\t\t$vars = get_class_vars(__CLASS__);\n\t\t\treturn $vars[__FUNCTION__];\n\t\t}", "function run_app(){\n\t\tglobal $con;\n\t\t$query = \"select * from user\";\n\t\t$res=$con->query($query);\n\t\treturn $res;\n\t}", "function optimizeDatabase() {}", "public function getSql();", "public function getSql();", "function getFilmsList()\n{\n\n $query = \"Select filmpk, movietitle, pitchtext, summary, dateintheaters\n From film\n Order by movietitle\";\n \n // call the executeQuery method (in dbConnExec.php)\n // and return the result\n\n return executeQuery($query);\n \n //Alternatively, call a stored procedure\n \n// return executeQuery(\"Exec getFilmsList\");\n}", "function getDatabaseId();", "public function insertDatabase();", "public function fetch()\n\t{\n\t\t//$this -> error();\n\t\t$dbName = $this -> databaseName;\n\t\treturn $dbName() -> fetch();\n\t}", "function query() {}", "abstract public function execute() ;", "abstract protected function _getSQL(): String;", "abstract function execute();", "abstract function execute();", "function verifyCaller( $vars )\n{\nglobal $db;\n\n\n\n}", "function mysql() {\n return call_user_func_array('mysql_db_query', func_get_args());\n}", "function createQuery() ;", "function db_query($query) {\r\n\t$connection = db_connect();\r\n\r\n\t// Query the database\r\n\t$result = mysqli_query($connection, $query);\r\n\r\n\treturn $result;\r\n}", "public function pdo();", "function Execute ();", "function getInterpreterId($iname) {\n $ci = & get_instance();\n $ci->load->database();\n $sql = \"SELECT * FROM gm_interpreter Where interpreter_name='\" . $iname . \"'\";\n $query = $ci->db->query($sql);\n $result = $query->row();\n // echo $sql; die;\n return $result;\n}", "function raw_db_query($query)\r\n{\r\n global $g_current_db;\r\n\r\n return sqlite_query($g_current_db, $query);\r\n}", "public function query()\n\t{\n\t\t\n\t}", "function db_startup(){\n\t\n\t}", "public function __invoke() { $db = new \\PDO('mysql:host=127.0.0.1;dbname=todo','root', 'password');\n $db->setAttribute(\\PDO::ATTR_DEFAULT_FETCH_MODE, \\PDO::FETCH_ASSOC);\n // this makes PDO give error messages if it has issues trying to update the db, otherwise it would fail silently\n $db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION );\n return $db;\n }", "public abstract function execute();", "public abstract function execute();", "public abstract function execute();", "abstract public function getSelectedDatabase();", "function ejecuta($strsql){\n\n $query = $this->db->query($strsql);\n return $query;\n\n }", "function fetch_from_database($sql) {\n\t$pdo = CDatabase::connect();\n\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t$stmt = $pdo->prepare($sql);\n\t$stmt->execute();\n\treturn $stmt->fetch(PDO::FETCH_ASSOC);\n\tCDatabase::disconnect();\n}", "function db_get_myid($table,$realid)\r\n{\r\n $dbc=new db_control;\r\n $dbc->host=$GLOBALS['host'];\r\n $dbc->dbname=$GLOBALS['dbname'];\r\n $dbc->username=$GLOBALS['username'];\r\n $dbc->pass=$GLOBALS['pass'];\r\n $dbc->table=$table;\r\n $dbc->realid=$realid;\r\n return $dbc->get_myid();\r\n}", "public static function db($database);", "function execQuery($query, $database)\n{\n include 'dbconfig.php';\n mysql_connect($_db_server,$_db_username,$_db_password) or die(mysql_error());\n mysql_select_db($database) or die(mysql_error());\n \n $data = mysql_query($query) or die(mysql_error());\n \n return $data;\n \n mysql_close();\n}", "function pdo_db_call ( $php_self = '', $call_id = 0, $db = null, $sql = '', $params = '', $method_name = '', $call_style = '' ) {\n\t\t$valid_method = FALSE;\n\t\t$allowed_methods = array ( 'fetch','fetchAll','rowCount' );\n\t\tforeach ( $allowed_methods as $key => $value ) {\n\t\t\tif ( $method_name == $value ) {\n\t\t\t\t$valid_method = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t\t$return_data = array();\n\t\tif ( $valid_method ) {\n\t\t\tif ( !$db ) {\n\t\t\t\t$db_connect_result = pdo_db_connect ();\n\t\t\t\tif ( $db_connect_result['rc'] == '1' ) {\n\t\t\t\t\t$db = $db_connect_result['db'];\n\t\t\t\t} else {\n\t\t\t\t\t$return_data['rc'] = '0';\n\t\t\t\t\t$return_data['result'] = 'Could not create database connection: ' . $db_connect_result['db'];\n\t\t\t\t\treturn $return_data;\n\t\t\t\t}\n\t\t\t} //!$db\n\t\n\t\t\ttry {\n\t\t\t\t$stmt = $db->prepare( $sql );\n\t\t\t\t$stmt->execute( $params );\n\t\t\t\t$result = $stmt-> $method_name ( $call_style );\n\t\t\t\t$return_data['result'] = $result;\n\t\t\t\t$return_data['rc'] = '1';\n\t\t\t} //try\n\t\t\tcatch (PDOException $ex) {\n\t\t\t\tlog_pdo_db_error ( $php_self, $call_id, $db, $sql, $params, $method_name, $call_style, $ex->getMessage() );\n\t\t\t\t$return_data['result'] = 'Your request could not be completed due to system error.<br>Please contact Support if problem persists.';\n\t\t\t\t$return_data['rc'] = '0';\n\t\t\t} //catch\n\t\t} else {\n\t\t\t$return_data['result'] = 'Invalid call method: ' . $method_name;\n\t\t\t$return_data['rc'] = '0';\n\t\t}\n\t\t\n\t\t$stmt->closeCursor();\n\t\t$db = null;\n\t\treturn $return_data;\n\t}" ]
[ "0.69729066", "0.6956835", "0.68216145", "0.65721154", "0.65181994", "0.6486178", "0.6385656", "0.6359341", "0.63477767", "0.6345388", "0.63046753", "0.6275455", "0.6270393", "0.626223", "0.62439686", "0.6220885", "0.62064826", "0.6203183", "0.6166822", "0.61633384", "0.614731", "0.6143846", "0.6115455", "0.6060828", "0.6023738", "0.602336", "0.60133874", "0.6011468", "0.6009386", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.6008869", "0.59964997", "0.5973759", "0.5961493", "0.5957735", "0.5940929", "0.5914852", "0.59134614", "0.5907225", "0.5892333", "0.5887542", "0.5887542", "0.5887542", "0.58840287", "0.5880789", "0.5865366", "0.58631754", "0.5857243", "0.58360565", "0.5831447", "0.5829968", "0.5814537", "0.58078843", "0.5800705", "0.5798313", "0.57958615", "0.5795844", "0.5795844", "0.57846427", "0.5760243", "0.5751072", "0.57381094", "0.5737728", "0.5717528", "0.5698936", "0.5697412", "0.5697412", "0.5696435", "0.5692738", "0.5685797", "0.5680916", "0.56781024", "0.5673713", "0.56689405", "0.56671184", "0.56540304", "0.5649201", "0.5647219", "0.5639738", "0.5639738", "0.5639738", "0.56394136", "0.5638594", "0.5636954", "0.5633089", "0.5632459", "0.5632423", "0.56321144" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { if($request->che_loja){ $cheques = Cheque::where('che_loja',$request->che_loja)->get(); } else { $cheques = Cheque::get(); } $lojas = Loja::all(); $data['lojas'] = converteArray($lojas,'loj_id','loj_nome'); $data['cheques'] = $cheques; $data['titulo'] = 'cheques'; return view('central/cheque/index',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create(Cliente $cliente) { $bancos = Banco::all(); $lojas = Loja::all(); $data['bancos'] = converteArray($bancos,'ban_codigo','ban_nome'); $data['lojas'] = converteArray($lojas,'loj_id','loj_nome'); $clientes = $cliente->ativos(); $data['clientes'] = [null => ''] + converteArray($clientes,'cli_id','cli_nome'); $data['situacoes'] = [ 'AGUARDANDO'=> 'AGUARDANDO', 'REPASSADO' => 'REPASSADO' , 'DEVOLVIDO' => 'DEVOLVIDO' , 'RECEBIDO' => 'RECEBIDO' , 'EXCLUIDO' => 'EXCLUIDO' ]; $data['titulo'] = 'Cadastro de cheque'; return view('central/cheque/add',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $data = $request->except('_token'); //validação cheque $cheque = new Cheque(); $this->validate($request, $cheque->rules()); if($request->che_status == 'REPASSADO'){ $this->validate($request, [ 'che_cliente_repassado' => 'required' ]); } try { $banco = Banco::where('ban_codigo',$data['che_banco_codigo'])->first(); if(!$banco){ $response['erros'] = 'Banco não encontrado'; $response['status'] = 'failed'; return $response; } DB::beginTransaction(); $data['che_idbanco'] = $banco->ban_id; //insere cheque $data['che_data_emissao'] = convertData($data['che_data_emissao']); $data['che_data_vencimento'] = convertData($data['che_data_vencimento']); $data['che_data_adicionado'] = date('Y-m-d H:i:s'); $data['che_valor'] = convertFloat($data['che_valor']); $cheque->create($data); DB::commit(); return redirect('central/cheque')->with('alert-success', 'Cheque foi adicionado com sucesso!'); } catch (Exception $ex) { DB::rollback(); return redirect('central/cheque')->with('alert-danger','Falha ao adicionar Cheque!'); } }
{ "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
Store a newly created resource in storage.
public function readerStore(Request $request) { $data = $request->except('_token'); //validação cheque $cheque = new Cheque(); $rules = $cheque->rules(); if($request['che_status'] == 'REPASSADO'){ $rules = $rules + ['che_cliente_repassado' => 'required']; } $validation = Validator::make($request->all(),$cheque->rules(),$cheque->messages()); $response = []; $errosMessage = ''; if($validation->fails()){ foreach ($validation->errors()->messages() as $error) { foreach ($error as $key => $value) { if($key == 0){ $errosMessage .= '<br>'.$value; } else { $errosMessage .= $value.'<br>'; } } } $response['erros'] = $errosMessage; $response['status'] = 'failed'; return $response; } else { try { $banco = Banco::where('ban_codigo',$data['che_banco_codigo'])->first(); if(!$banco){ $response['erros'] = 'Banco não encontrado'; $response['status'] = 'failed'; return $response; } DB::beginTransaction(); $data['che_idbanco'] = $banco->ban_id; //insere cheque $data['che_data_emissao'] = convertData($data['che_data_emissao']); $data['che_data_vencimento'] = convertData($data['che_data_vencimento']); $data['che_data_adicionado'] = date('Y-m-d H:i:s'); # Se não repassado, che_cliente_repassado é nulo if($request['che_status'] != 'REPASSADO'){ $data['che_cliente_repassado'] = null; } $cheque->create($data); DB::commit(); $response['erros'] = $errosMessage; $response['status'] = 'success'; return $response; } catch (Exception $ex) { DB::rollBack(); $response['erros'] = $errosMessage; $response['status'] = 'failed'; return $response; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Cliente $cliente, $id) { $cheque = Cheque::find($id); $bancos = Banco::all(); $lojas = Loja::all(); $clientes = $cliente->ativos(); $data['clientes'] = [null => ''] + converteArray($clientes,'cli_id','cli_nome'); $data['situacoes'] = [ 'AGUARDANDO'=> 'AGUARDANDO', 'REPASSADO' => 'REPASSADO' , 'DEVOLVIDO' => 'DEVOLVIDO' , 'RECEBIDO' => 'RECEBIDO' , 'EXCLUIDO' => 'EXCLUIDO' ]; $data['lojas'] = converteArray($lojas,'loj_id','loj_nome'); $data['cheque'] = $cheque; $data['bancos'] = converteArray($bancos,'ban_codigo','ban_nome'); $data['titulo'] = 'edição de cheque'; return view('central/cheque/add',$data); }
{ "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) { $data = $request->except('_token'); $cheque = Cheque::find($data['che_id']); $this->validate($request, $cheque->rules()); if($request['che_status'] == 'REPASSADO'){ $rules = $rules + ['che_cliente_repassado' => 'required']; } try { $banco = Banco::where('ban_codigo',$data['che_banco_codigo'])->first(); if(!$banco){ $response['erros'] = 'Banco não encontrado'; $response['status'] = 'failed'; return $response; } DB::beginTransaction(); $data['che_idbanco'] = $banco->ban_id; //insere cheque $data['che_data_emissao'] = convertData($data['che_data_emissao']); $data['che_data_vencimento'] = convertData($data['che_data_vencimento']); $data['che_data_atualizada'] = date('Y-m-d H:i:s'); $data['che_valor'] = convertFloat($data['che_valor']); # Se não repassado, che_cliente_repassado é nulo if($request['che_status'] != 'REPASSADO'){ $data['che_cliente_repassado'] = null; } //insere cheque $cheque->update($data); DB::commit(); return redirect('central/cheque')->with('alert-success', 'Cheque foi editado com sucesso!'); } catch (Exception $ex) { DB::rollback(); return redirect('central/cheque')->with('alert-danger','Falha ao editar Cheque!'); } }
{ "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) { $cheque = Cheque::find($id); $cheque->che_status = 'EXCLUIDO'; try { DB::beginTransaction(); $cheque->save(); DB::commit(); return redirect('central/cheque')->with('alert-success', 'Cheque foi excluir com sucesso!'); }catch (Exception $ex) { DB::rollback(); return redirect('central/cheque')->with('alert-danger','Falha ao excluir Cheque!'); } }
{ "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
Create a new job instance.
public function __construct(array $data) { list( 'type' => $this->type, 'payload' => $this->payload, 'visitor_id' => $this->visitor_id, 'user_id' => $this->user_id ) = $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "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}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n {}", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function create()\n {\n //TODO\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6920272", "0.6905722", "0.6905722", "0.6869542", "0.6808916", "0.65271425", "0.65184414", "0.64918077", "0.6489135", "0.6468623", "0.6425879", "0.64058304", "0.63938236", "0.63899404", "0.63753885", "0.6304669", "0.6256802", "0.6241474", "0.620155", "0.61789167", "0.60741454", "0.60695714", "0.6047274", "0.60462874", "0.6028435", "0.6027225", "0.6021894", "0.60214204", "0.59231514", "0.58802027", "0.5874528", "0.58576655", "0.58098435", "0.5805053", "0.58005697", "0.5789109", "0.57851434", "0.57767034", "0.5775661", "0.5755982", "0.5702295", "0.5683395", "0.5683395", "0.5683395", "0.5683376", "0.5679739", "0.5678496", "0.5659406", "0.56529284", "0.56470996", "0.5634536", "0.5632702", "0.5632702", "0.5628215", "0.5625956", "0.5621957", "0.56141514", "0.56048644", "0.5604791", "0.5601149", "0.5601067", "0.5599652", "0.5595376", "0.55932534", "0.55932534", "0.55932015", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55362236", "0.5534658", "0.5531583", "0.55224913", "0.5522197", "0.5517534", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.5514842", "0.549955", "0.5497938", "0.54876786", "0.54876786", "0.54876786" ]
0.0
-1
Fonction qui permet d'afficher l'image d'une armure ainsi que son infobulle complete
function affiche_image_armure($image_armures, $nom_armure, $defense_armure, $description_armures, $BonusPerception_armures, $bonusPv_armure){ $description_arme = $description_armures; echo "<td width=50 height=50 align=center> <img tabindex='0' src='../images/armures/$image_armures' width=50 height=50 data-toggle='popover' data-trigger='focus' data-html='true' data-placement='bottom' title=\"<b>$nom_armure</b>\" "; echo " data-content=\" <div><img src=../images/armures/$image_armures></div> <div><u>Defense :</u> $defense_armure</div>"; if($BonusPerception_armures){ echo "<div><u>Bonus Perception :</u> $BonusPerception_armures</div>"; } if($bonusPv_armure){ echo "<div><u>bonus Pv :</u> $bonusPv_armure</div>"; } echo "<div><b>Description</b></div><div>$description_armures</div>\" >"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rutaImageFly()\n {\n\n // primero vemos a que galeria pertenece\n $galeria = ORM::factory( 'Galeria', $this->galeria );\n\n return( $galeria->rutaImageFly().$this->imagen );\n\n }", "function affiche_image(){\n\t\tglobal $infos_id;\n\t\tif($infos_id['grade']==0){\n\t\t\treturn\"<img src='ressources/membre.png' title='Membre' alt='Membre'>\";\n\t\t}\n\t\tif($infos_id['grade']==10){\n\t\t\treturn \"<img src='ressources/users.png' title='Conseil' alt='Membre du conseil'>\";\n\t\t}\n\t\tif($infos_id['grade']==20){\n\t\t\treturn \"<img src='ressources/admin.png' title='Vice président' alt='Vice président'>\";\n\t\t}\n\t\tif($infos_id['grade']==30){\n\t\t\treturn \"<img src='ressources/boss.png' title='Président' alt='Président'>\";\n\t\t}\n\t}", "public function carregar_imagem()\n\t{\n\t\t$id = $this->input->get(\"id_aluno\");\n\t\t$dados[\"aluno\"] = $this->Aluno_Model->retorna_aluno($id);\t\n\t\t//\tCARREGA A VIZUALIZACAO DA VIEW LISTA\n\t\t$this->load->view('layout/cabecalho_secretaria');\n\t\t$this->load->view('layout/menu_lateral_secretaria');\n\t\t$this->load->view('conteudo/_secretaria/_aluno/fotografia', $dados);\n\t\t$this->load->view('layout/rodape');\n\t\t$this->load->view('layout/script');\n\t}", "protected function fetchFullTextImage(){\n $this->imageFullText = $this->getImageTypeFromImages('full');\n }", "public function cargarImagen() {\n\n $id = $_REQUEST[\"id\"];\n\n echo $this->usuario->getCampo($id,'imagen');\n\n }", "protected function processImage() {}", "function trataImagem($nomeIntegrador=false){\n\t\t$this->enviaMensagemTelegramWeb(\"\\xF0\\x9F\\x94\\xB4\\xF0\\x9F\\x94\\xB4 ATENCAO \\xF0\\x9F\\x94\\xB4\\xF0\\x9F\\x94\\xB4\");\n\t\t$this->enviaMensagemTelegramWeb(\"=====================%0A \\xF0\\x9F\\x98\\xB1 FALHA $nomeIntegrador \\xF0\\x9F\\x98\\xB1%0A=====================%0APor Favor Resolva a imagem abaixo!%0AResponda: /resp SoLuCao\");\n\t\t$this->enviaImagem();\n\t\t$this->monitoraRespostaImagem();\n\t}", "public function showImage()\n {\n }", "public function aparecer() {\n // Referencia al objeto dentro de la clase\n echo '<img src=\"' . $this -> foto . '\">';\n\n }", "function show_image()\n\t{\n\t\tif ( $this->ipsclass->input['rc'] == \"\" )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Get the info from the db\n\t\t\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t \t\t\t\t 'from' => 'reg_antispam',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"regid='\".trim($this->ipsclass->txt_alphanumerical_clean($this->ipsclass->input['rc'])).\"'\"\n\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t \n\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Using GD?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->vars['bot_antispam'] == 'gd' )\n\t\t{\n\t\t\t$this->ipsclass->show_gd_img($row['regcode']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Using normal then, check for \"p\"\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->ipsclass->input['p'] == \"\" )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$p = intval($this->ipsclass->input['p']) - 1; //substr starts from 0, not 1 :p\n\t\t\t\n\t\t\t$this_number = substr( $row['regcode'], $p, 1 );\n\t\t\t\n\t\t\t$this->ipsclass->show_gif_img($this_number);\n\t\t}\n\t}", "function immagine_stampa_low($id_img=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\tif ($id_img==\"\") {\n\t\treturn \"\";\n\t}else {\n\t\t$q_img=\"SELECT low_res, med_res FROM immagine WHERE id_img=$id_img\";\n\t\t$r_img=$db->query($q_img);\n\t\tif (!$r_img) {\n\t\t\treturn \"\";\n\t\t}\n\t\telse {\n\t\t\t$ro_img=mysql_fetch_array($r_img);\n\t\t\t$img=\"<img width=\\\"176px\\\" src=\\\"\".$ro_img['low_res'].\"\\\"/>\";\n\t\t\t$a='<a href=\"';\n $a.=$ro_img['med_res'];\n $a.='\"';\n $a.= 'rel=\"lightbox\">';\n\t\t\t$img = $a . $img . \"</a>\";\n\t\t\treturn $img;\n\t\t}\n\t}\n\t\n}", "function extractIMGmisencache($text, $id, $link, $taille = 200){\n\t$valretour = \"\";\n\t$letexte = \"\";\n\t$doc = new DOMDocument();\n\t$doc->loadHTML($text);\n\t$list = $doc->getElementsByTagName('img');\n\tforeach ($list as $node) {\n\t\tif ($node->hasAttribute('src')) {\n\t\t\t$img_loc = $node->getAttribute('src');\n\t\t\t$filename = basename($img_loc);\n\t\t\t$extension = explode(\".\",$filename);\n\t\t\t// Si c'est un jpg on traite sinon suivant\n\t\t\tif (strtoupper(end($extension)) == \"JPG\"){ \n\t\t\t\t// loading image into constructor\n\t\t\t\t$image = new FastImage($img_loc);\n\t\t\t\tlist($width, $height) = $image->getSize();\n\t\t\t\t// echo \"dimensions: \" . $width . \"x\" . $height;\t\t\t\t\t\n\t\t\t\t// Si superieur au mini requis on sort c'est ok\n\t\t\t\tif ($width > $taille || $height > $taille){\n\t\t\t\t\t$valretour = miseenformeIMG($img_loc,$width,$height,$text);\n\t\t\t\t\t$query=\"INSERT INTO `\".MYSQL_PREFIX.\"MagFonctions_cache` (`id`, `urlimage`, `imgwidth`, `imgheight`) VALUES ('\".$id.\"', '\".$img_loc.\"', '\".$width.\"', '\".$height.\"');\";\n\t\t\t\t\tmysql_query($query);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Si pas d'image il faut que l'on force le texte\n\tif ( $valretour == \"\") { \n\t\t//$valretour = FunctionsMag::txtCHAP($text);\n\t\t// On memorise noimage dans la bdd pour ne plus faire de recherche\n\t\t// <div class=\"blog-content\">\n\t\tonchercheInPage($text, $id, $link, $taille = 200);\n\t\t//$query=\"INSERT INTO `\".MYSQL_PREFIX.\"MagFonctions_cache` (`id`, `urlimage`, `imgwidth`, `imgheight`) VALUES ('\".$id.\"', 'noimage', '0', '0');\";\n\t\t//echo $query;\n\t\t//mysql_query($query);\n\t\t$valretour = stripTAG(TruncateHTML::truncateChars($text, '200', '...'));\n\t}\n\treturn $valretour;\n}", "function draw_y ($image, $black, $grey, $light_grey, $tab) // affiche les infos de l'axe des ordonnees\n\t{\n\t\tImageTTFText ($image, 10, 0, 3, 20, $grey, $this->path, $this->yname);\n\n\t\t//l'origine\n\t\tImageTTFText ($image, 10, 0, 0, $this->y(0) + 3, $black, $this->path, 0);\n\n\t\t$nb_draw = floor($this->ref_height / 30);\n\t\t$i = $this->max_y / $nb_draw;\n\t\t$stop = $nb_draw * $i;\n\n\t\t// affiche les reperes en fonction de la hauteur de l'axe\n\t\t$compt = 0;\n\t\twhile($i <= $stop)\n\t\t{\n\t\t\t$compt++;\nimageline($image, $this->x(0) - 5, $this->y($i), $this->x(0), $this->y($i), $black);\nimageline($image, $this->x(0) + 1, $this->y($i), $this->pic_width - 30, $this->y($i), $light_grey);\nImageTTFText ($image, 10, 0, 0, $this->y($i) + 3, $black, $this->path, $i);\n\t\t\t$i += $this->max_y / $nb_draw;\n\t\t\t\n\t\t}\n\t\tif ($compt == 1)\n\t\t{\n\t\t\t$i -= $this->max_y / $nb_draw;\nimageline($image, $this->x(0) - 5, $this->y($i/2), $this->x(0), $this->y($i/2), $black);\nimageline($image, $this->x(0) + 1, $this->y($i/2), $this->pic_width - 30, $this->y($i/2), $light_grey);\nImageTTFText ($image, 10, 0, 0, $this->y($i/2) + 3, $black, $this->path, $i/2);\n\t\t}\n\t}", "function RellenarImagenesDeLaMinuta($texto, $dir_img)\r\n {\r\n $this->Imprimir($texto, 20, 10, 12);\r\n\r\n $this->Cell(22);\r\n\r\n $this->Cell(155, 98, '', 1, 0, 'C');\r\n\r\n $this->Image(sfConfig::get('sf_web_dir') . '/' . $dir_img, 33, $this->GetY() + 1, 153, 95);\r\n }", "public function image();", "public function image();", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "function filets_creer_icone_barre($file, $num=-1) {\n\tstatic $icones_barre;\n\trep_icones_barre($icones_barre);\n\tdefine_IMG_GD_MAX_PIXELS();\n\t// la config \"Methode de fabrication des vignettes\" doit etre renseignee pour 'image_reduire'\n\tif($num<0) {\n\t\tlist($w) = @getimagesize($file);\n\t\t$file = filtrer('image_recadre', $file, floor($w/4), 40, '');\n\t\t$file = filtrer('image_reduire', $file, 19, 19);\n\t\t$file = filtrer('image_recadre', $file, 16, 16, 'left');\n\t} else {\n\t\t$file = image_typo(\"_{$num}_\", 'couleur=00BFFF', 'taille=9', 'police=dustismo.ttf');\n\t\t$file = filtrer('image_recadre', $file, 16, 10, 'bottom');\n\t}\n\t$nom = basename($src = extraire_attribut($file, 'src'));\n\t@copy($src, $icones_barre.$nom);\n\treturn $nom;\n}", "function logo ()\n {\n global $connection;\n $sql = \"SELECT * FROM slike_logo sl ORDER BY sl.putanja_logo DESC LIMIT 0,1\";\n $sum = $connection->query($sql)->fetchAll();\n foreach($sum as $item) :\n echo \"<a href='index.php?page=pocetna'><img src=$item->putanja_logo alt=$item->ime_slike title='NanoSoft DeLux' width='177' height='106'/></a>\";\n endforeach;\n }", "function ver_buscar_mapa($fid_string=\" \",$presenta=0,$idmapa=0,$intensidad){\n \n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/ver_mapa.html\");\n \n //echo \"intensidad : $intensidad\";\n \n if($intensidad>0){\n $plantilla->iniciaBloque(\"intensidad\");\n }\n \n $imapa = new imapa();\n \n $result1 = $imapa->get_mapa();\n \n $nombres = array();\n \n $count=0;\n \n $modo=0;\n \n $color=array(\"#B19CD9\",\"#FF6961\",\"#77DD77\",\"#CFCFC4\",\"#FDFD96\");\n \n $stroke=array(\"#966FD6\",\"#C23B22\",\"#03C03C\",\"#836953\",\"#FFB347\");\n \n while($mapa= mysql_fetch_array($result1)){\n $count++;\n \n $plantilla->iniciaBloque(\"mapa\");\n $plantilla->reemplazaEnBloque(\"idmapa\", $mapa[idgis_mapa],\"mapa\");\n $plantilla->reemplazaEnBloque(\"nombre\", $mapa[nombre],\"mapa\");\n \n if( $mapa[idgis_mapa]==$idmapa || ( $mapa[predeterminado]>0 && $idmapa==0 ) ){\n \n $plantilla->reemplazaEnBloque(\"selected\", \"selected\",\"mapa\");\n \n $plantilla->reemplaza(\"frontera\", $mapa[frontera]);\n $plantilla->reemplaza(\"enfoque\", $mapa[enfoque]);\n $plantilla->reemplaza(\"resolucion\", $mapa[resolucion]);\n $plantilla->reemplaza(\"proyeccion\", $mapa[proyeccion]);\n $plantilla->reemplaza(\"unidad\", $mapa[unidad]);\n\n $i=0;\n $nombre=\"\";\n $result2 = $imapa->get_capa_mapa($mapa[idgis_mapa]);\n while($capa= mysql_fetch_array($result2)){\n $nombre=$capa[nombre];\n $nombres[$nombre]=$nombre;\n if($modo>0){\n $plantilla->iniciaBloque(\"capa\");\n $plantilla->reemplazaEnBloque(\"i\", $i, \"capa\");\n\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"capa\");\n\n\n $plantilla->reemplazaEnBloque(\"proyeccion\", $capa[proyeccion], \"capa\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"capa\");\n }else{\n \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"capa\");\n }\n }else{\n $plantilla->iniciaBloque(\"gml\"); \n $plantilla->reemplazaEnBloque(\"i\", $i, \"gml\");\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"gml\");\n $plantilla->reemplazaEnBloque(\"color\", $color[($i%5)], \"gml\");\n $plantilla->reemplazaEnBloque(\"stroke\", $stroke[($i%5)], \"gml\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"gml\");\n }else{ \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"gml\");\n }\n } \n $i++;\n }\n $capas=\" \";\n\n foreach ($nombres as $nombre){\n $capas .= $nombre.\",\";\n }\n\n\n $capas = substr($capas, 0, -1);\n\n\n $plantilla->reemplaza(\"i\", $i);\n $plantilla->reemplaza(\"nombre\", $nombre);\n $plantilla->reemplaza(\"capas\", $capas);\n $plantilla->reemplaza(\"fid_string\", $fid_string);\n \n }\n \n \n }\n \n if($count==0){\n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/no_mapa.html\");\n }\n \n if($presenta>0){\n $plantilla->presentaPlantilla();\n }else{\n return $plantilla->getPlantillaCadena();\n }\n \n}", "function displayImageInformation()\n {\n // query the number of saved images of the account\n $savedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'SAVED'\") or die(mysql_error());\n \n // query the number of deleted images of the account\n $deletedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n // calculate the number of images\n $savedImagesCount = mysql_num_rows($savedImagesQuery);\n $deletedImagesCount = mysql_num_rows($deletedImagesQuery);\n $totalImagesCount = $savedImagesCount + $deletedImagesCount;\n \n // calculate the hard disk space the saved image has used\n $savedImagesFileSize = 0;\n \n for($i=0; $i<$savedImagesCount ; $i++)\n {\n // incrementally compute the file sizes of each saved images in Kilobytes\n // 1 KB = 1024 bytes\n $savedImagePath = mysql_result($savedImagesQuery,$i,\"path\");\n $savedImagesFileSize = $savedImagesFileSize + ((filesize($savedImagePath)) / 1024);\n }\n \n // calculate the hard disk space the deleted image has used\n $deletedImagesFileSize = 0;\n \n for($i=0; $i<$deletedImagesCount; $i++)\n {\n // incrementally compute the file sizes of each deleted images in kilobytes\n // 1 KB = 1024 bytes\n $deletedImagePath = mysql_result($deletedImagesQuery,$i,\"path\");\n $deletedImagesFileSize = $deletedImagesFileSize + ((filesize($deletedImagePath)) / 1024);\n }\n \n // compute the total disk space that is being used\n $totalImagesFileSize = $savedImagesFileSize + $deletedImagesFileSize;\n \n // display the images information\n echo \"\n <p>Image Information</p>\n <p id='box'>\n Saved Images : \".$savedImagesCount.\" (\".round($savedImagesFileSize,2).\" KB)<br>\n Deleted Images : \".$deletedImagesCount.\" (\".round($deletedImagesFileSize,2).\" KB)<br><br>\n Total Images : \".$totalImagesCount.\" (\".round($totalImagesFileSize,2).\" KB)<br>\n </p>\";\n \n return;\n }", "abstract public function show($img);", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "function Display_Photo($Nom, $Prenom, $id, $Font_Size)\n{\n\tif(!isset($Font_Size)) {\n\t\t$Font_Size=\"1\";\n\t}\n\t\n\tif (file_exists(\"Photos/Individu_\".$id.\".jpg\")) { \n\t\tif ($Prenom == \"NO LINK\"){\n\t\t\techo '<A HREF='.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].' class=\"tooltip\"><FONT SIZE=\"'.$Font_Size.'\">'.$Nom.'</FONT>';\n\t\t\techo '<em><span></span>';\n\t\t\techo \"<img src='Photos/Individu_\".$id.\".jpg' height='100' border='1' alt='Paroissien_\".$id.\"'>\";\n\t\t\techo '<br><font face=verdana size=1>'.$Nom.'</font>';\n\t\t\techo '</em></A>';\n\t\t} else {\n\t\t\techo '<A HREF=/SuiviParoissien.php?action=edit_Individu&id='.$id.' class=\"tooltip\"><FONT SIZE=\"'.$Font_Size.'\">'.$Prenom.' '.$Nom.'</FONT>';\n\t\t\techo '<em><span></span>';\n\t\t\techo \"<img src='Photos/Individu_\".$id.\".jpg' height='100' border='1' alt='Paroissien_\".$id.\"'>\";\n\t\t\techo '<br><font face=verdana size=1>'.$Prenom.' '.$Nom.'</font>';\n\t\t\techo '</em></A>';\n\t\t}\n\t} else {\n\t\tif ($Prenom == \"NO LINK\"){\n\t\t\techo '<A HREF='.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'>';\n\t\t\techo '<FONT SIZE=\"'.$Font_Size.'\">' .$Nom. '</FONT> ';\n\t\t\techo '</A>';\n\t\t} else {\n\t\t\techo '<A HREF=/SuiviParoissien.php?action=edit_Individu&id='.$id.'>';\n\t\t\techo '<FONT SIZE=\"'.$Font_Size.'\">' .$Prenom. ' ' .$Nom. '</FONT> ';\n\t\t\techo '</A>';\n\t\t}\n\t}\n}", "public function display_image($data) {\n global $ID;\n if (file_exists(mediaFN($ID))) {\n echo '<img class=\"proofreadpage\" alt=\"\" width=\"500\" src=\"' . ml($ID, array('w' => '500')) . '\" />';\n }\n }", "function redimensionne_image($photo)\n{\n\t$info_image = getimagesize($photo);\n\t// largeur et hauteur de l'image d'origine\n\t$largeur = $info_image[0];\n\t$hauteur = $info_image[1];\n\t// largeur et/ou hauteur maximum à afficher\n\tif(basename($_SERVER['PHP_SELF'],\".php\") === \"trombi_impr\") {\n\t\t// si pour impression\n\t\t$taille_max_largeur = getSettingValue(\"l_max_imp_trombinoscopes\");\n\t\t$taille_max_hauteur = getSettingValue(\"h_max_imp_trombinoscopes\");\n\t} else {\n\t// si pour l'affichage écran\n\t\t$taille_max_largeur = getSettingValue(\"l_max_aff_trombinoscopes\");\n\t\t$taille_max_hauteur = getSettingValue(\"h_max_aff_trombinoscopes\");\n\t}\n\n\t// calcule le ratio de redimensionnement\n\t$ratio_l = $largeur / $taille_max_largeur;\n\t$ratio_h = $hauteur / $taille_max_hauteur;\n\t$ratio = ($ratio_l > $ratio_h)?$ratio_l:$ratio_h;\n\n\t// définit largeur et hauteur pour la nouvelle image\n\t$nouvelle_largeur = $largeur / $ratio;\n\t$nouvelle_hauteur = $hauteur / $ratio;\n\n\treturn array($nouvelle_largeur, $nouvelle_hauteur);\n}", "function marcadeagua($img_original, $img_marcadeagua, $img_nueva, $calidad)\n{\n $info_original = getimagesize($img_original);\n $anchura_original = $info_original[0];\n $altura_original = $info_original[1];\n // obtener datos de la \"marca de agua\" \n $info_marcadeagua = getimagesize($img_marcadeagua);\n $anchura_marcadeagua = $info_marcadeagua[0];\n $altura_marcadeagua = $info_marcadeagua[1];\n // calcular la posición donde debe copiarse la \"marca de agua\" en la fotografia \n $horizmargen = ($anchura_original - $anchura_marcadeagua)/2;\n $vertmargen = ($altura_original - $altura_marcadeagua)/2;\n // crear imagen desde el original \n $original = ImageCreateFromJPEG($img_original);\n ImageAlphaBlending($original, true);\n // crear nueva imagen desde la marca de agua \n $marcadeagua = ImageCreateFromPNG($img_marcadeagua);\n // copiar la \"marca de agua\" en la fotografia \n ImageCopy($original, $marcadeagua, $horizmargen, $vertmargen, 0, 0, $anchura_marcadeagua, $altura_marcadeagua);\n // guardar la nueva imagen \n ImageJPEG($original, $img_nueva, $calidad);\n // cerrar las imágenes \n ImageDestroy($original);\n ImageDestroy($marcadeagua);\n}", "public function itemFullInfo(){\n // $img = $this->itemImg;\n\n // if ($img) {\n // $this->img_path = $this->itemImg->img_path;\n \n // }else{\n // $this->img_path = \"/images/default_bg.jpg\"; \n // }\n\n // if (file_exists('.'.$this->img_path)) {\n \n // }else{\n // $this->img_path = \"/images/default_bg.jpg\";\n // }\n\n if (file_exists('./images/products/thumb/'.$this->item.'.jpg')) {\n\n $this->img_path = \"/images/products/thumb/\".$this->item.\".jpg\";\n }else{\n $this->img_path = \"/images/default_bg.jpg\";\n }\n \n if (file_exists('./images/products/large/'.$this->item.'.jpg')) {\n\n $this->big = \"/images/products/large/\".$this->item.\".jpg\";\n }else{\n $this->big = \"/images/default_bg.jpg\";\n }\n return $this;\n }", "function imagenes_disponibles($id_palabra) {\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "public function printImage($rij,$kolom){\n $this->rij = $rij; \n $this->kolom = $kolom; \n $dbh = new PDO(\"mysql:host=localhost;dbname=cursusphp;charset=utf8\", \"cursusgebruiker\", \"cursuspwd\"); \n $sql = \"select status from lightsout where rijnr= :rijnummer and kolomnr = :kolomnummer\"; \n $stmt = $dbh -> prepare($sql); \n $stmt->execute(array(':rijnummer' => $rij, ':kolomnummer' => $kolom )); \n $resultSet = $stmt->fetchAll(PDO::FETCH_ASSOC); \n $dbh = null;\n $this->status = $resultSet[0][\"status\"]; \n if ($this->status == 0) {\n print(\"<a href=\\\"lightsout.php?action=klik&rij=\".$rij.\"&kolom=\".$kolom.\"\\\"><img src=\\\"lightsout-uit.png\\\" alt=\\\"leeg\\\"></a>\");\n }\n elseif($this->status == 1) {\n print(\"<a href=\\\"lightsout.php?action=klik&rij=\".$rij.\"&kolom=\".$kolom.\"\\\"><img src=\\\"lightsout-aan.png\\\" alt=\\\"geel\\\"></a>\");\n }\n \n }", "public function excluirImagemGaleria(){ \n\t\t\n\t\t//deleta a imagem da pasta\n\t\tinclude_once(\"../funcoes/geral.php\");\n\t\t$sql = \"\n\t\t\tSELECT thumb\n\t\t\tFROM programa_imagem\n\t\t\"; \n\t\tif($this->idImagem)\n\t\t\t$sql .=\" WHERE id = '$this->idImagem'\";\n\n\t\t$this->sql = $sql;\n\t\t$this->qr = self::execSql($this->sql);\t\n\t\t$qtRegistros = $this->getQuantidadeData($sql); // retorna a quantidade de registro\t \n\t\tif($qtRegistros > 0){\n\t\t\twhile($lista = self::resultsAll($this->qr)){\n\n\t\t\t\tdeletaImagem($lista[\"thumb\"]);//deleto a imagem do arquivo\n\t\t\t\n\t\t\t}\n\t\t}\n\n\t}", "function getImagen(){\n\t\t\treturn $this->imagen;\n\t\t}", "private function recortarImagen()\n\t{\n\t\t$ImgTemporal=\"temporal_clase_Imagen.\".strtolower($this->extencion);\n\n\t\t$CoefAncho\t\t= $this->propiedadesImagen[0]/$this->anchoDestino;\n\t\t$CoefAlto\t\t= $this->propiedadesImagen[1]/$this->altoDestino;\n\t\t$Coeficiente=0;\n\t\tif ($CoefAncho>1 && $CoefAlto>1)\n\t\t{ if($CoefAncho>$CoefAlto){ $Coeficiente=$CoefAlto; } else {$Coeficiente=$CoefAncho;} }\n\n\t\tif ($Coeficiente!=0)\n\t\t{\n\t\t\t$anchoTmp\t= ceil($this->propiedadesImagen[0]/$Coeficiente);\n\t\t\t$altoTmp\t= ceil($this->propiedadesImagen[1]/$Coeficiente);\n\n\t\t\t$ImgMediana = imagecreatetruecolor($anchoTmp,$altoTmp);\n\t\t\timagecopyresampled($ImgMediana,$this->punteroImagen,0,0,0,0,$anchoTmp,$altoTmp,$this->propiedadesImagen[0],$this->propiedadesImagen[1]);\n\t\t\t\n\t\t\t// Tengo que desagregar la funcion de image para crear para reUtilizarla\n\t\t\t//imagejpeg($ImgMediana,$ImgTemporal,97);\n\t\t\t$this->crearArchivoDeImagen($ImgMediana,$ImgTemporal);\n\t\t}\n\n\t\t$fila\t\t\t= floor($this->recorte['centrado']/$this->recorte['columnas']);\n\t\t$columna\t\t= $this->recorte['centrado'] - ($fila*$this->recorte[\"columnas\"]);\n\t\t\n\t\t$centroX \t= floor(($anchoTmp / $this->recorte[\"columnas\"])/2)+$columna*floor($anchoTmp / $this->recorte[\"columnas\"]);\n\t\t$centroY \t= floor(($altoTmp / $this->recorte[\"filas\"])/2)+$fila*floor($altoTmp / $this->recorte[\"filas\"]);\n\n\t\t$centroX\t-= floor($this->anchoDestino/2);\n\t\t$centroY \t-= floor($this->altoDestino/2);\n\n\t\tif ($centroX<0) {$centroX = 0;}\n\t\tif ($centroY<0) {$centroY = 0;}\n\n\t\tif (($centroX+$this->anchoDestino)>$anchoTmp) {$centroX = $anchoTmp-$this->anchoDestino;}\n\t\tif (($centroY+$this->altoDestino)>$altoTmp) {$centroY = $altoTmp-$this->altoDestino;}\n\n\t\t$ImgRecortada = imagecreatetruecolor($this->anchoDestino,$this->altoDestino);\n\t\timagecopymerge ( $ImgRecortada,$ImgMediana,0,0,$centroX, $centroY, $this->anchoDestino, $this->altoDestino,100);\n\n\t\t//imagejpeg($ImgRecortada,$this->imagenDestino,97);\n\t\t$this->crearArchivoDeImagen($ImgRecortada,$this->imagenDestino);\n\t\timagedestroy($ImgRecortada);\n\t\tunlink($ImgTemporal);\n\t}", "public function showImageFromGet() {\n\n\t\t// $imageFilename = UniteFunctionsRev::getGetVar(\"img\");\n\t\t$imageID = intval( UniteFunctionsRev::getGetVar( 'img' ) );\n\t\t$maxWidth = UniteFunctionsRev::getGetVar( 'w',-1 );\n\t\t$maxHeight = UniteFunctionsRev::getGetVar( 'h',-1 );\n\t\t$type = UniteFunctionsRev::getGetVar( 't','' );\n\n\t\t// set effect\n\t\t$effect = UniteFunctionsRev::getGetVar( 'e' );\n\t\t$effectArgument1 = UniteFunctionsRev::getGetVar( 'ea1' );\n\n\t\tif ( ! empty( $effect ) ) {\n\t\t\t$this->setEffect( $effect,$effectArgument1 ); }\n\n\t\t$this->showImageByID( $imageID );\n\t\techo 'sechs<br>';\n\t\t// $this->showImage($imageFilename,$maxWidth,$maxHeight,$type);\n\t}", "public function getAbsolutePicture();", "function showRegDet($data, $paso){\n include '../library/libcon.php';\n\n $sql = \"SELECT id, nombrecompleto, concepto, direccion, telefono1, telefono2, latitud, longitud, regionsalon, instagram, url_img, url_img_thumb FROM web_salones WHERE REGIONSALON = '\".$data.\"' AND ESTADO NOT IN (0, 3);\";\n $result = (array) json_decode(miBusquedaSQL($sql), true);\n $salon = '';\n\n foreach ($result as $r) {\n $miniatura = $r[\"url_img_thumb\"];\n\n if($miniatura == \"\"){\n $miniatura = \"13thumb.jpg\";\n }\n $salon .= '<li class=\"item col-md-3 col-sm-6 marginbt10\">\n <figure class=\"icon-overlay\"><a href=\"#0\" data-type=\"slide-portfolio-item-1\" data-sid=\"'.$r[\"id\"].'\" data-tipo=\"1\"><img src=\"/c/img/salons/'.$miniatura.'\" alt=\"\" /></a></figure>\n <div class=\"slide-portfolio-item-info box\">\n <h4 class=\"post-title\">'.$r[\"nombrecompleto\"].'</h4>\n <div class=\"meta marginbt0\">'.cambiarRegion($r[\"regionsalon\"]).'</div>\n </div>\n </li>';\n }\n\n \n\n $pais = cambiarRegion($data);\n\n $dos = '<div class=\"dark-wrapper mb50\" id=\"ubicaciones\">\n <div class=\"container inner2\">\n <h3 class=\"section-title text-center mt10\">Ubicaciones</h3>\n <div class=\"divide30\"></div>'.$salon.'\n </div>\n </div>';\n\n $msg = '<h2 class=\"fondobuscar\">'.$pais.'</h2>\n <div class=\"col-md-12\">\n <div class=\"col-md-6\">\n <h3>Listado de Salones:</h3>\n </div>\n </div>'.$dos;\n\n\n\n\n return $msg;\n}", "function display_statut($statut)\n{\n?>\n<img id=\"iconeStatut\" src=\"<?php \n\t\t\t\tif($statut == 0)\n\t\t\t\t{\n\t\t\t\t\techo \"img/wait.svg\";\n\t\t\t\t}\n\t\t\t\telse if($statut == 1)\n\t\t\t\t{\n\t\t\t\t\techo \"img/error.png\";\n\t\t\t\t}\t\t\t\t\n\t\t\t\telse if($statut == 2)\n\t\t\t\t{\n\t\t\t\t\techo \"img/ok.svg\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t?>\"><?php\n }", "function subir_imagenes($tipo,$imagen,$descripcion,$ruta,$size)\n\t{\n\t\t\t//return \"La imagen\".$tipo.\" No se subio\";\n\t\t\tif(strstr($tipo,\"image\"))\n\t\t\t{\n\n\t\t\t\tif(strstr($tipo,\"jpeg\"))\n\t\t\t\t\t$extension=\".jpg\";\n\t\t\t\telse if(strstr($tipo,\"gif\"))\n\t\t\t\t\t$extension=\".gif\";\n\t\t\t\telse if(strstr($tipo,\"png\"))\n\t\t\t\t\t$extension=\".png\";\n\t\t\t\t//para saber si la imagen tiene el ancho correcto es de 420px\n\t\t\t\t$tam_img=getimagesize($imagen);\n\t\t\t\t$ancho_img=$tam_img[0];\n\t\t\t\t$alto_img =$tam_img[1];\n\t\t\t\t$ancho_img_deseado=$size;\n\n\t\t\t\t//sii la imagen es maor en su ancho a 420px reajusto su tamaño\n\t\t\t\t\tif($ancho_img > $ancho_img_deseado)\n\t\t\t\t\t{\n\t\t\t\t\t\t//reajustamos\n\t\t\t\t\t\t//por una regla de tres obtengo el alto de la imagen de manera \n\t\t\t\t\t\t//proporciaonal el ancho nuevo que sera 420\n\t\t\t\t\t\t$nuevo_ancho_img = $ancho_img_deseado;\n\t\t\t\t\t\t$nuevo_alto_img=($alto_img*$nuevo_ancho_img)/$ancho_img;\n\t\t\t\t\t\t//CREO UNA IMAGEN EN COLOR REAL CON LA NUEVAS DIMENSIONES\n\t\t\t\t\t\n\t\t\t\t\t\t$img_reajustada=imagecreatetruecolor($nuevo_ancho_img, $nuevo_alto_img);\n\t\t\t\t\t\t//CREO UNA IMAGEN BASADA EN LA ORIGINAL DEPENDIENDO DE SU EXTENSION ES EL TIPO QUE CREARE\n\t\t\t\t\t\tswitch ($extension) {\n\t\t\t\t\t\t\tcase '.jpg':\n\t\t\t\t\t\t\t\t$img_original=imagecreatefromjpeg($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagejpeg($img_reajustada,$nombre_img_ext,100);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".jpg\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '.gif':\n\t\t\t\t\t\t\t\t$img_original=imagecreatefromgif($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagegif($img_reajustada,$nombre_img_ext,100);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".gif\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '.png':\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$img_original=imagecreatefrompng($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\timagesavealpha($img_reajustada, true);\n\t\t\t\t\t\t\t\timagealphablending($img_reajustada, false);\t\n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\timagecolortransparent($img_reajustada);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagepng($img_reajustada,$nombre_img_ext,0);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".png\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//no se reajusta y se sube\n\t\t\t\t\t\t$destino=$ruta.$descripcion.$extension;\n\n\t\t\t\t\t\t//Se sube la foto\n\t\t\t\t\t\tmove_uploaded_file($imagen,$destino) /*or die(\"No se pudo subir la imagen\")*/;\n\n\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles para el perfil\n\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\tborrar_imagenes($nombre_img,$extension);\n\t\t\t\t\t}\n\t\t\t\t\t//Asigno el nombre que el que se guardara en la base de datos\n\t\t\t\t\t$imagen=$descripcion.$extension;\n\t\t\t\t\treturn $imagen;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"La imagen\".$imagen.\" No se subio\";\n\t\t\t}\n\n\t}", "private function show_result_before() {\n ?>\n <!DOCTYPE html>\n <html>\n <head>\n <title>Image Resizer $ Shahriar</title>\n <style>\n *{\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n body{\n background: #FAFAFA;\n }\n .img-box{\n margin: auto;\n margin-top: 5vw;\n width: 90%;\n min-height: 90%;\n padding: 50px;\n display: table;\n background: #FFF;\n border: 1px dashed rgba(0,0,0,0.1);\n border-radius: 2px;\n }\n .img-list {\n list-style: decimal inside;\n }\n .img-list li {\n border: 1px solid rgba(0,0,0,0.1);\n border-radius: 2px;\n padding: 10px 15px;\n margin: 5px;\n }\n .msg-success {\n color: #30AA30;\n }\n .msg-error {\n color: #F25959;\n }\n </style>\n </head>\n <body>\n <div class=\"img-box\">\n <ol class=\"img-list\">\n <?php\n }", "protected function calidadImagenDefaut(){\r\n\t\t$this->calidadImagen=100;\r\n\t}", "function getImage();", "public function saveAsset()\n {\n if(!empty($this->uploadedFile))\n {\n // If file is exist -> remove him\n if(file_exists($this->getFilePath()))\n {\n unlink($this->getFilePath());\n }\n $this->genFilename();\n $imagine = Image::getImagine()->open($this->uploadedFile->tempName);\n }\n else\n {\n if(file_exists($this->getFilePath())) {\n $imagine = Image::getImagine()->open($this->getFilePath());\n } else return false;\n }\n\n $size = $imagine->getSize();\n $box = $this->getImageBox($size);\n\n if (($size->getWidth() <= $box->getWidth() && $size->getHeight() <= $box->getHeight()) || (!$box->getWidth() && !$box->getHeight())) {\n $widthDiff = abs($size->getWidth() - $box->getWidth()) / $size->getWidth();\n $heightDiff = abs($size->getHeight() - $box->getHeight()) / $size->getHeight();\n if($widthDiff > $heightDiff) {\n $resizeBox = new Box($box->getWidth(), $size->getHeight() * $box->getWidth()/$size->getWidth());\n } else {\n $resizeBox = new Box($size->getWidth() * $box->getHeight()/$size->getHeight(), $box->getHeight());\n }\n $imagine->resize($resizeBox);\n\n // var_dump($width);\n // var_dump($height);\n // die;\n // // $imagine->crop($point, $box);\n // $imagine->save($this->getFilePath());\n // return $this->save(false);\n }\n\n $imagine = $imagine->thumbnail($box, ManipulatorInterface::THUMBNAIL_OUTBOUND);\n $imagine->save($this->getFilePath());\n\n // create empty image to preserve aspect ratio of thumbnail\n // $thumb = Image::getImagine()->create($box, new Color('FFF', 100));\n\n // // calculate points\n // $startX = 0;\n // $startY = 0;\n // if ($size->getWidth() < $box->getWidth()) {\n // $startX = ceil($box->getWidth() - $size->getWidth()) / 2;\n // }\n // if ($size->getHeight() < $box->getHeight()) {\n // $startY = ceil($box->getHeight() - $size->getHeight()) / 2;\n // }\n\n // $thumb->paste($img, new Point($startX, $startY));\n // $thumb->save($this->getFilePath());\n\n return $this->save(false);\n }", "function upImagenAction(){\n\t\t\n\t\t$request = $this->get('request');\n\t\t\n\t\t$estetica=$request->request->get('id');\n\t\t$img=$request->request->get('img');\n\t\t\t\t\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t$hcEstetica = $em->getRepository('HcBundle:Hc')->find($estetica);\n\t\t\n\t\t\t\t\n\t\tif($hcEstetica){\t\t\n\t\t\t$ruta = $this->container->getParameter('dlaser.directorio.imagenes');\n\t\t\t\n\t\t\tif ($img) {\n\t\t\t\t\n\t\t\t\t$imgData = base64_decode(substr($img,22));\n\t\t\t\t\n\t\t\t\t$file = $ruta.'grafico_'.$estetica.'.png';\n\t\t\t\t\n\t\t\t\tif (file_exists($file)) { unlink($file); }\n\t\t\t\t$fp = fopen($file, 'w');\n\t\t\t\tfwrite($fp, $imgData);\n\t\t\t\tfclose($fp);\n\t\t\t\t\n\t\t\t\t$response=array(\"responseCode\"=>200, \"msg\"=>\"La operación ha sido exitosa.\");\n\t\t\t}\n\t\t}else{\n\t\t\t$response=array(\"responseCode\"=>400, \"msg\"=>\"Ha ocurrido un error al crear la imagen.\");\n\t\t}\n\t\t\n\t\t$return=json_encode($response);\n\t\treturn new Response($return,200,array('Content-Type'=>'application/json'));\n\t}", "function immagini_gest($id_imm=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t$str=\"\";\n\t$q_foto=\"SELECT * FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm\";\n\t$r_foto=$db->query($q_foto);\n\t\n\tif (!$r_foto) {\n\t\t$str.=\"<center>Nessuna foto disponibile per l'immobile</center><br>\";\n\t\t$str.=\"<b><a href=\\\"immobile_show.php?id_imm=$id_imm\\\"><img src=\\\"images/freccia.gif\\\"/>Torna all'immobile</a></b>\";\n\t}else {\n\t\t$str.= \"<div class=\\\"clienti\\\">\";\n\t\t$str.= \"<TABLE id=\\\"clienti\\\">\\n\";\n\t\t$str.=\"<tr>\\n\";\n\t\t$str.=\"<td colspan=\\\"2\\\" class=\\\"clienti_header\\\">\\n\";\n\t\t$str.=\"Immagini dell'immobile $id_imm\";\n\t\t$str.=\"</td>\\n\";\n\t\t$str.=\"</tr>\\n\";\n\t\t\n\t\twhile ($ro_foto=mysql_fetch_array($r_foto)) {\n\t\t\t$str.= \"<TR>\\n\";\n\t\t\t$str.= \"<TD class=\\\"foto_gest_header\\\">\\n\";\n\t\t\t$str.= immagine_stampa_low($ro_foto['id_img']);\n\t\t\t$str.= \"</TD>\\n\";\n\t\t\t$str.= \" <TD class=\\\"foto_opzioni\\\">\\n\";\n\t\t\t$str.=\"<a href=\\\"immagine_add.php?azione=mod&id_img=\";\n\t\t\t$str.= $ro_foto['id_img'];\n\t\t\t$str.=\"\\\">\";\n\t\t\t$str.= \"Modifica\";\n\t\t\t$str.=\"</a>\";\n\t\t\t$str.=\"<br><br>\";\n\t\t\t$str.=\"<a href=\\\"immagine_del.php?id_imm=$id_imm&id_img=\";\n\t\t\t$str.= $ro_foto['id_img'];\n\t\t\t$str.=\"\\\" onclick=\\\"NewWindow(this.href,'pg_center','500','350','no');return false;\\\">\";\n\t\t\t$str.=\"Cancella\";\n\t\t\t$str.=\"</a>\";\n\t\t\t$str.= \"</TD>\\n\";\n\t\n\t\t\t$str.= \"</TR>\\n\";\n\t\t}\n\t\t$str.= \"</TABLE>\";\n\t\t\n\t\t$str.=\"</div>\";\n\n\t}\n\t\n\treturn $str;\n}", "public function getImagen()\r\n {\r\n return $this->imagen;\r\n }", "public function getImage() {}", "public function returnImgCapa($anunRef){\n\n\t$sql = \"SELECT anuncio_imagem_capa FROM Anuncio WHERE anuncio_id = '{$anunRef}'\";\n\n\tif($row = $this->runSelect($sql)){\n\n\t \treturn $row[0]['anuncio_imagem_capa'];\n\n\t} else {\n\n\t}\n }", "function imagenes_por_palabra_y_tipo_imagen($id_palabra,$registrado,$estado,$id_tipo_imagen) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND imagenes.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($estado !='' && $estado < 4 && $estado > 0) {\n\t\t\t$sql_estado='AND imagenes.estado='.$estado.'';\n\t\t} elseif ($estado='all') {\n\t\t\t$sql_estado='';\n\t\t} else {\n\t\t\t$sql_estado='AND imagenes.estado=1';\n\t\t}\n\t\t\n\t\tif ($id_tipo_imagen==99) { $sql_tipo_imagen=''; } \n\t\telse { $sql_tipo_imagen='AND imagenes.id_tipo_imagen='.$id_tipo_imagen.''; }\n\t\t\n\t\t$query = \"SELECT palabra_imagen.*,\n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename\n\t\tFROM palabra_imagen, imagenes\n\t\tWHERE palabra_imagen.id_palabra='$id_palabra'\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\t$sql_tipo_imagen\n\t\t$mostrar_registradas\n\t\t$sql_estado\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function affiche_image_arme($image_arme, $nom_arme, $description_arme, $portee_arme, $degats_arme){\n\t\n\t$description_arme = $description_arme;\n\t\n\techo \"\t<td width=50 height=50 align=center>\n\t\t\t\t<img tabindex='0' src='../images/armes/$image_arme' width=50 height=50 \n\t\t\t\t\tdata-toggle='popover' data-trigger='focus' data-html='true' data-placement='bottom'\n\t\t\t\t\ttitle=\\\"<b>$nom_arme</b>\\\" \";\n\techo \"\t\t\tdata-content=\\\"\t<div><img src=../images/armes/$image_arme></div>\n\t\t\t\t\t\t\t\t\t<div><u>Portee :</u> $portee_arme</div>\n\t\t\t\t\t\t\t\t\t<div><u>Degats :</u> $degats_arme</div>\n\t\t\t\t\t\t\t\t\t<div><b>Description</b></div>\n\t\t\t\t\t\t\t\t\t<div>$description_arme</div>\\\" >\";\n\techo \"\t</td>\";\n}", "public function renderTagImage($result);", "function Image() {\r\n\t\treturn $this->ResizedAdvertisementImage();\r\n\t}", "function kdw_row_tiles_txt_img (){ \r\n \r\n}", "public function getImagen()\n {\n return $this->imagen;\n }", "public function getImagen()\n {\n return $this->imagen;\n }", "public function getImagen()\n {\n return $this->imagen;\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "public function borrar($imagen)\n {\n }", "function mostrar_producto_img(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM producto WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$id=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image, nombre_image FROM imagen WHERE galeria_image='$id' AND tabla_image='producto'ORDER BY id_image\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\n\t\t\twhile ($resultado2 = mysql_fetch_array($consulta2)){\n\t\t\t\t$this->listado[]=$resultado2;\n\t\t\t}\n\t\t}\n\t}", "function miseenformeIMG($img_loc,$width,$height,$text){\n\t// Si format paysage \n\tif ($width > $height){\n\t\t// Si $width > 400 juste l'image pas de texte\n\t\tif ($width > 400){\n\t\t\t$lestyleimg = ' style=\"float:left;max-width:100%;max-height: auto;padding-right:1em;\" ';\n\t\t\t$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\";\n\t\t// L'image est petite nous plaçon l'image et le texte\n\t\t} else {\n\t\t\t$lestyleimg = ' style=\"float:left;max-width:200px;max-height: 240px;padding-right:1em;\" ';\n\t\t\t//$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".FunctionsMag::txtCHAP($text);\n\t\t\t$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".stripTAG(TruncateHTML::truncateChars($text, '200', '...'));\n\t\t}\n\t// Nous sommes en format portrait nous plaçons l'image et le texte\t\n\t} else {\n\t\t$lestyleimg = ' style=\"float:left;max-width:auto;max-height: 240px;padding-right:1em;\" ';\n\t\t//$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".FunctionsMag::txtCHAP($text);\n\t\t$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".stripTAG(TruncateHTML::truncateChars($text, '200', '...'));\n\t}\n\treturn $valretour;\n}", "function getImage($nr){ //vienaskaita, nes ieskai vieno id informacijos;\n $manoSQL = \"SELECT * FROM images WHERE id = $nr\"; //issigalvotas kintamasis, tiesiog stringas, gali bet koki teksta rasyti.\n $rezultatai = mysqli_query ( getPrisijungimas(), $manoSQL); // mysqli_query tiesiog ivykdo komandas; jei nori delete ar update, tai uztenka sios f-jos\n\n// print_r($rezultatai);\n $rezultatai_masyvas = mysqli_fetch_assoc($rezultatai); // cia objekta ideda i masyva; jei reikia gauti duomenis, tam reikia sios eilutes, kad gautus duomenis issaugoti.\n// print_r($rezultatai_masyvas);\n return $rezultatai_masyvas;\n}", "function add_img_tour($type,$item,$file){\n\tif($type == 'belarus'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus.json';\n\t}\n\tif($type == 'belarus_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus_pref.json';\n\t}\n\tif($type == 'foreigners'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners.json';\n\t}\n\tif($type == 'foreigners_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners_pref.json';\n\t}\n\t$exItem = explode('%',$item);\n\t$type = $exItem[0];\n\t$tour = (int)$exItem[1];\n\t$object = json_decode(file_get_contents($patch));\n\t$object_item = $object[0]->$type;\n\t$folder = $object_item[$tour]->img;\n\tdo{\n\t\t$img = randomName(10);\n\t\t$extension = explode('.',$file['name']);\n\t\t$imgName = $img.'.'.$extension[1];\n\t} while(file_exists('../../'.$folder.'/'.$imgName));\n\tmove_uploaded_file($file['tmp_name'], '../../'.$folder.'/'.$imgName);\n\treturn true;\n}", "function tampilPhoto($nrk=''){\n $rs=$this->mdl->get_data($nrk)->row();\n $result = $rs->X_PHOTO->load();\n// If any text (or whitespace!) is printed before this header is sent,\n// the text won't be displayed and the image won't display properly.\n// Comment out this line to see the text and debug such a problem.\n header(\"Content-type: image/JPEG\");\n echo $result;\n }", "function amap_ma_get_entity_img($u, $namecleared) {\n if (!$namecleared)\n return false;\n\n if (elgg_instanceof($u, 'user') || elgg_instanceof($u, 'group')) {\n $entity_img = elgg_view('output/img', array(\n 'src' => $u->getIconURL('tiny'),\n 'alt' => $namecleared,\n 'class' => \"mapicon\",\n ));\n } else if (elgg_instanceof($u, 'object', 'agora')) {\n $entity_img = elgg_view('output/url', array(\n 'href' => \"agora/view/{$u->guid}/\" . elgg_get_friendly_title($namecleared),\n 'text' => elgg_view('agora/thumbnail', array('classfdguid' => $u->guid, 'size' => 'tiny', 'tu' => $u->time_updated)),\n 'class' => \"mapicon\",\n ));\n } else if (elgg_instanceof($u, 'object', 'page') || elgg_instanceof($u, 'object', 'page_top')) {\n $entity_img = elgg_view('output/img', array(\n 'src' => $u->getIconURL('tiny'),\n 'alt' => $namecleared,\n 'class' => \"mapicon\",\n ));\n }\n return $entity_img;\n}", "public function testUpdateAvatarImage()\n {\n }", "function subirFotoElemento($campo, $tipo, $id, $refresh, $backdir) {\n\t\tif($_FILES[$campo]['type'] != 'image/jpeg' AND $_FILES[$campo]['type'] != 'image/gif' AND $_FILES[$campo]['type'] != 'image/png') {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'El formato de imagen no es válido, sólo se aceptan JPG, GIF o PNG';\n\t\t}\n\n\t\t//Obtengo las dimensiones de la imagen, si se puede entonces es una imagen de verdad y evito una shell en el server\n\t\t$check = getimagesize($_FILES[$campo]['tmp_name']);\n\n\t\tif($check == FALSE) {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'Seleccione una imagen válida';\n\t\t}\n\n\t\t//Si no hay ningún error, arranco la subida...\n\t\tif($error_img == FALSE) {\n\t\t\tif($_FILES[$campo]['type'] == 'image/jpeg') {\n\t\t\t\t$extension_img = '.jpg';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/gif') {\n\t\t\t\t$extension_img = '.gif';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/png') {\n\t\t\t\t$extension_img = '.png';\n\t\t\t}\n\n\t\t\t$directorio_subida = $backdir . '../sitio/fotos/' . $tipo . '/ampl/';\n\t\t\t$directorio_subida_m = $backdir . '../sitio/fotos/' . $tipo . '/';\n\n\t\t\tif($img = glob($directorio_subida . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\tif($img = glob($directorio_subida_m . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\t$sin_punto = explode('.', $_FILES[$campo]['name']);\n\t\t\tmove_uploaded_file($_FILES[$campo]['tmp_name'],$directorio_subida . $_FILES[$campo]['name']);\n\t\t\trename($directorio_subida . $_FILES[$campo]['name'],$directorio_subida . $id . $extension_img);\n\n\t\t\t$modulo_variable_ancho_imagen_chica = 'modulo_' . $tipo . '_ancho_imagen_chica';\n\t\t\t$modulo_variable_alto_imagen_chica = 'modulo_' . $tipo . '_alto_imagen_chica';\n\t\t\t$modulo_variable_ancho_imagen_grande = 'modulo_' . $tipo . '_ancho_imagen_grande';\n\t\t\t$modulo_variable_alto_imagen_grande = 'modulo_' . $tipo . '_alto_imagen_grande';\n\t\t\t$modulo_variable_tipo_resize = 'modulo_' . $tipo . '_tipo_resize';\n\t\t\t$modulo_variable_watermark = 'modulo_' . $tipo . '_watermark';\n\t\t\t$modulo_variable_watermark_dir = 'modulo_' . $tipo . '_watermark_dir';\n\n\t\t\tglobal $$modulo_variable_ancho_imagen_chica;\n\t\t\tglobal $$modulo_variable_alto_imagen_chica;\n\t\t\tglobal $$modulo_variable_ancho_imagen_grande;\n\t\t\tglobal $$modulo_variable_alto_imagen_grande;\n\t\t\tglobal $$modulo_variable_tipo_resize;\n\t\t\tglobal $$modulo_variable_watermark;\n\t\t\tglobal $$modulo_variable_watermark_dir;\n\n\t\t\tif($_FILES[$campo]['type'] != 'image/gif') {\n\t\t\t\trequire($backdir . 'lib/Simpleimage/SimpleImage.php');\n\n\t\t\t\t$img = new \\claviska\\SimpleImage($directorio_subida . $id . $extension_img);\n\t\t\t\t$img->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t$img_thumb = new \\claviska\\SimpleImage($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\tif($$modulo_variable_tipo_resize == 'recortar') { //////////////////////////////////////////////////////////////Si está en modo recorte\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t} else { /////////////////////////////////////////////////////////////////////////////////////////////////////////Si está en modo proporcionar\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($refresh == TRUE) {\n\t\t\t\techo refresh();\n\t\t\t}\n\t\t} else {\n\t\t\techo '<br><div class=\"alert alert-danger\"><strong>Error</strong> ' . $msg . '</div>';\n\t\t}\n\t}", "function cargar_imagenes($idc=null,$seccion){\r\r\n $html = \"\";\r\r\n if (!is_null($idc))\r\r\n $ims = zen_deserializar($this->padre->bd->seleccion_unica(\"imagenes from contenidos where idc=\".$idc)); \r\r\n else \r\r\n $ims = array();\r\r\n $n = count($ims);\r\r\n for ($i=0; $i<$n; $i++){\r\r\n\t $im = ZF_SITIO_WEB.'media/img/'.$seccion.'/'.$ims[$i];\r\r\n\t $html .= '<a href=\"'.$im.'\" target=\"_blank\"><img src=\"'.$im.\r\r\n\t \t'\" border=\"0\"></a>[<label for=\"borrar_'.$ims[$i].\r\r\n\t \t'\">borrar</label><input type=\"checkbox\" id=\"borrar_'.$ims[$i]\r\r\n\t \t.'\" name=\"borrar_'.$ims[$i].'\"/>]<br/>';\r\r\n }\r\r\n return $html;\r\r\n }", "public function ausschnittAction() {\n\t\tif (!isset($this->session->image)) {\n\t\t\t$this->session->image = array();\n\t\t}\n\n\t\t$dirtyIndex = intval($this->getParam(\"image\"));\n\t\t$galery = Zend_Registry::get('galery');\n\t\tif (isset($galery['filesAbs'][$dirtyIndex])) {\n\t\t\t// save image properties in session\n\t\t\t$this->session->image['index'] = $dirtyIndex;\n\t\t\t$this->session->image['pathRel'] = $galery['filesRel'][$dirtyIndex];\n\t\t\t$this->session->image['pathAbs'] = $galery['filesAbs'][$dirtyIndex];\n\t\t\t$this->view->assign(\"dimensions\", Zend_Registry::get('dimensions'));\n\t\t\t$this->view->assign(\"imagePath\", $this->session->image['pathRel']);\n\t\t} else {\n\t\t\t$this->_helper->redirector->gotoUrl('/');\n\t\t}\n\t}", "public function Recortar()\n\t{\n\t\t// pega o ID do aluno\n\t\t$id = $this->input->post(\"id_aluno\"); \n\t\t// Configurações para o upload da imagem\n\t\t// Diretório para salvar a imagem\n\t\t$configUpload['upload_path'] = FCPATH .\"_assets/upload/alunos\";\n\t\t// Tipos de imagem permitidos\n\t\t$configUpload['allowed_types'] = 'jpg|png';\n\t\t// Usar nome de arquivo aleatório, ignorando o nome original do arquivo\n\t\t$configUpload['encrypt_name'] = TRUE;\n\t\t// Aplica as configurações para a library upload\n\t\t$this->upload->initialize($configUpload);\n\t\t// Verifica se o upload foi efetuado ou não\n\t\t// Em caso de erro carrega a home exibindo as mensagens\n\t\t// Em caso de sucesso faz o processo de recorte\n\t\tif ( ! $this->upload->do_upload('imagem'))\n\t\t{\n\t\t\t// Recupera as mensagens de erro e envia o usuário para a home\n\t\t\t$dados= array('error' => $this->upload->display_errors());\n\t\t\t// $this->load->view('home',$dados);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Recupera os dados da imagem\n\t\t\t$dadosImagem = $this->upload->data();\n\t\t\t// Calcula os tamanhos de ponto de corte e posição\n\t\t\t// de forma proporcional em relação ao tamanho da\n\t\t\t// imagem original\n\t\t\t$tamanhos = $this->CalculaPercetual($this->input->post());\n\t\t\t// Define as configurações para o recorte da imagem\n\t\t\t// Biblioteca a ser utilizada\n\t\t\t$configCrop['image_library'] = 'gd2';\n\t\t\t//Path da imagem a ser recortada\n\t\t\t$configCrop['source_image'] = $dadosImagem['full_path'];\n\t\t\t// Diretório onde a imagem recortada será gravada\n\t\t\t$configCrop['new_image'] = FCPATH .\"_assets/upload\";\n\t\t\t// Proporção\n\t\t\t$configCrop['maintain_ratio'] = FALSE;\n\t\t\t// Qualidade da imagem\n\t\t\t$configCrop['quality'] = 100;\n\t\t\t// Tamanho do recorte\n\t\t\t$configCrop['width'] = $tamanhos['wcrop'];\n\t\t\t$configCrop['height'] = $tamanhos['hcrop'];\n\t\t\t// Ponto de corte (eixos x e y)\n\t\t\t$configCrop['x_axis'] = $tamanhos['x'];\n\t\t\t$configCrop['y_axis'] = $tamanhos['y'];\n\t\t\t// Aplica as configurações para a library image_lib\n\t\t\t$this->image_lib->initialize($configCrop);\n\t\t\t// Verifica se o recorte foi efetuado ou não\n\t\t\t// Em caso de erro carrega a home exibindo as mensagens\n\t\t\t// Em caso de sucesso envia o usuário para a tela\n\t\t\t// de visualização do recorte\n\t\t\tif ( ! $this->image_lib->crop())\n\t\t\t{\n\t\t\t\t// Recupera as mensagens de erro e envia o usuário para a home\n\t\t\t\t$dados = array('error' => $this->image_lib->display_errors());\n\t\t\t\t// $this->load->view('home',$dados);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$info_arquivo = $this->upload->data(); // recupera os dados do arquivo em caso de sucesso\n\t\t\t\t$nome_arquivo = $dadosImagem['file_name'];\t// pega o nome do arquivo da array\n\t\t\t\t$aluno = array(\n\t\t\t\t\t\"id_aluno\" => $id,\n\t\t\t\t\t\"photo\" => $nome_arquivo\n\t\t\t\t);\n\t\t\t\t$this->db->where('id_aluno', $id);\n\t\t\t\t$this->db->update('aluno', $aluno);\n\t\t\t\techo $this->session->set_flashdata('msg',\"<div class='alert alert-success text-center'>FOTOGRAFIA ALTERADA COM SUCESSO</div>\");\t\n\t\t\t\tredirect('secretaria/aluno/detalhe?id_aluno='.$id); // redireciona para o pefil do aluno\n\t\t\t}\n\t\t}\n\t}", "public function display()\n {\n header(\"Content-Type: image/png; name=\\\"barcode.png\\\"\");\n imagepng($this->_image);\n }", "function Footer() {\n $this->SetFont('Arial','I',8); \n $this->Image('../img/imagen.jpg',20,250,180,10);//Izquierda a derecha, posicion, Ancho, Alto;\n\n \n }", "public function anchoFijo($ancho_Imagen){\t\t\r\n\t\t$this->ancho_imagen_copia=$ancho_Imagen;\t\t\r\n\t\t$this->alto_imagen_copia=(int)round($ancho_Imagen*$this->alto_imagen_original/$this->ancho_imagen_original);\r\n\t}", "function _tts_preprocess_p_img_big(&$vars){\n $alt = (isset($vars['content']['field_img'][0]['#item']['title'])\n && !empty($vars['content']['field_img'][0]['#item']['title'])\n ? $vars['content']['field_img'][0]['#item']['title'] . ' - '\n : '') . 'Serramenti Torino';\n $vars['content']['field_img'][0]['#item']['alt'] = $alt;\n \n \n if ($vars['view_mode'] == 'full'){\n $vars['content']['field_img'] = array(\n '#prefix' => '<div class=\"wrapper-p-img margin-b-1\">',\n '#suffix' => '</div>',\n 'data' => $vars['content']['field_img'][0],\n );\n\n //_tts_add_fancy_svg($vars);\n\n if (isset($vars['content']['field_img']['data']['#item']['title']) && $vars['content']['field_img']['data']['#item']['title']!== ''){\n $title = $vars['content']['field_img']['data']['#item']['title'];\n $vars['content']['field_img']['desc'] = array(\n '#prefix' => '<div class=\"margin-t-05 margin-sm-h-2\"><p class=\"small\">',\n '#suffix' => '</p></div>',\n '#markup' => $title,\n '#weight' => 2,\n );\n }\n }\n}", "function subirImagen($id_patalla) {\n // MODIFICAR RUTA AL SUBIR AL HOSTING\n $dir_subida = '/home/c0990002/public_html/TB/imagenes_pantallas/';\n\n if (isset($_FILES['imagen']) && !$_FILES['imagen']['error'] > 0) {\n //GUARDADO DE IMAGEN\n if (move_uploaded_file($_FILES['imagen']['tmp_name'], $dir_subida . 'imagen_pantalla_id_' . $id_patalla)) {\n //return $dir_subida.'imagen_pantalla_id_'.$id_patalla;\n return 'https://www.rockerapp.com/TB/imagenes_pantallas/' . 'imagen_pantalla_id_' . $id_patalla;\n }\n }\n}", "public function renderImageAction()\n {\n $config = \\Zend_Registry::get('configs');\n $path = $config['upload']['rodape']['destination'];\n\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_getAllParams();\n\n $entity = $this->getService('Artefato')->findBy(array(\n 'sqArtefato' => $params['sqArtefato']\n ));\n $enderecoImagem = $path . '/' . $entity[0]->getDeImagemRodape();\n $dto = new \\Core_Dto_Search(\n array(\n 'resize' => true,\n 'width' => 120,\n 'height' => 120\n )\n );\n\n return $this->showImage($dto, $enderecoImagem);\n }", "static function afficherGalerie ($chemin)\r\n {\r\n // LA FONCTION glob CONSTRUIT LE TABLEAU POUR MOI\r\n // $image = glob(\"./assets/img/*.jpg\");\r\n // https://www.php.net/manual/fr/function.glob.php\r\n $image = glob($chemin, GLOB_BRACE);\r\n\r\n foreach($image as $compteur => $element)\r\n {\r\n echo \r\n <<<x\r\n <img src=\"$element\" alt=\"$element\">\r\n\r\n x;\r\n }\r\n\r\n }", "function write_translation() {\r\n $this->final_image = cloneImg($this->get_cleaned_image());\r\n foreach ($this->text_blocks as $block) {\r\n $black = imagecolorallocate($this->final_image, 0, 0, 0);\r\n $red = imagecolorallocate($this->final_image, 255, 0, 0);\r\n $green = imagecolorallocate($this->final_image, 0, 255, 0);\r\n $yellow = imagecolorallocate($this->final_image, 255, 255, 0);\r\n \r\n $translation_width=$block->translation_width;\r\n $translation_height=$block->translation_height;\r\n\r\n $block_height=round(distance($block->x4,$block->y4,$block->x1,$block->y1));\r\n $block_width=round(distance($block->x1,$block->y1,$block->x2,$block->y2));\r\n\r\n $Ix=$block->x1+($block_width-$translation_width)/2;\r\n $Iy=$block->y1+$block->translation_top_offset+($block_height-$translation_height)/2 ;\r\n $tmpx=$Ix;\r\n $tmpy=$Iy;\r\n\r\n if ($block->text_angle !=0) {\r\n $insert=rotate($Ix,$Iy, $block->x1,$block->y1,0- $block->text_angle);\r\n $Ix = $insert[0];\r\n $Iy = $insert[1];\r\n }\r\n\r\n imagettftext (\r\n $this->final_image,\r\n $block->font_size,\r\n $block->text_angle,\r\n $Ix,\r\n $Iy,\r\n $black,\r\n $block->font,\r\n $block->formatted_text );\r\n }\r\n\r\n \r\n $this->final_image_path=\"uploads/\".microtime().\".jpg\";\r\n imagewrite($this->final_image,$this->final_image_path,$quality=100);\r\n }", "public function ShowAirlineAction()\n {\n $em = $this->getDoctrine()->getManager();\n $Airline=$em->getRepository('MyAppEspritBundle:Airlinecompany')->findAll();\n $imgs=array();\n foreach ($Airline as $key => $entity)\n {\n if($entity->getPicture() == null)\n {\n $imgs[$key] = \"iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAMAAAACDyzWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAP9QTFRF8vLy2dnZ5ubm/Pz81tbW4ODg3t7e29vbsLCw5+fn0tLS7Ozs+fn539/fz8/PsrKy/f39/v7+u7u79fX1ra2tysrKyMjIw8PD6enpy8vLs7OzsbGx+/v7xMTEzs7O7+/v3Nzcrq6u6+vrtLS0uLi4rKysxsbGycnJurq6+vr64uLiwsLCzc3Ntra219fX9PT01NTU4eHh7u7utbW1vr6++Pj45eXl4+Pj0NDQwcHBubm5x8fHvb299/f38/Pz1dXV8fHxwMDA6Ojo9vb20dHR3d3dvLy82traxcXFr6+v2NjYt7e35OTkv7+/09PT7e3t6urq8PDwq6urzMzM////kkQrbAAAIOdJREFUeNrsnWlD2soChrNgpWyC1IqCQLV6lOJS64JV61672O1O/v9vuaxhJgyQPZnM+344xypkfTJPZslEMRAkwig4BAgARAAgggBABAAiCABEACCCAEAEACIIAEQAIIIAQAQAIggARAAgggBABAAiCABEACCCAEAEACIIAESSAuBTOo9jhLhOsbO+6a0EbOyv6DiOiLuUry5OvSq4dvnzFkcScROteuPHPSA0jLhJKbNU8acSAg0jLvR7cnHtVy24dvkeGkZ8169tAKFhJAj9OgAQGkYc5OHk7trwF0CjtgMNI/ZyXz0qGX4DCA0jfuvXIYDQMOKvfp0C2NMw+o4R3/TrGEBoGJmj36PqvbNvOC3RoGFkhn7vfj0YwQIIDSO+6dcVgIbRrELDiB/6dQkgNIxwcn138mCEAyA0jEykspQpGWEBaBiL0DDC6Hfptbtvui3JoGHEs369AAgNI5716wnAnoYXcOwRw7ipau6/7KUUg4aRrn4vTspGNABCw4gn/XoGsKvhNDQM/UYIIDQsdU4vrspGtABCwxJnc71TNKIGsKfhjzgX0G90AELD0G+0AELD0G+0AELD0uUgfebPgvwquY6hYZn0u/r10IgXgNAw9BstgNAw9BsxgF0Nr0HDiU9udfnQiCeA0LAEyW7Vi0ZcAYSGk6/f6ou/C/S7xDr+RKBh6Dc6AKFh6DdaAKHhxEZNn/u/0CBKK2g4idnb2P1iiAGgsQcNQ79RAggNQ78RAwgNQ7/RAtjV8GdoOCEJsjQJEBJoOCF5Dkq/AQMIDUO/0QJo7H2DhqHfCAGEhoVP4CdQEfwCQgJVWPA1ycAVufdtFxqGfqMDEBqGfiMGEBoWMiENawpFj92aPDQsWMKabSAkMKBh0fQb1uyjYZVM0DD0GymAQTeoIwLqN1QAoWFhEuobKcOsHEDDQuj37c9bI5kAQsPQb7QA9kb2QMPQb4QAQsPQb7QAQsMxzu3PtzUj6QD2nm9p4VzHMa/Sr8JfaRRdZNAw9BspgNAw9BstgAE+Zoq4Sz79FM2KoxqlAg3HKfrKfsOQC0BoGPqNFkBoGPqNGEDjDzQst36jBhAajkGU9zs1Q1YAoeHo9VttRnwBRHwA/nxqi6XhB2VzerLlU+hXLACF0vDtmVonc1JXz4R5ACtq/cYCQGE0/KX1SGzm8eOtCHv0Mb0Yg4sgBgciG38NF/8eEUd51Gox3yWdfDo2AKAQGta1DnGcdr4c532Kg35jA2DMNbzpAr9+nuJbJYmFfmMEYFfD9ZhqWEkR12kv7EG/YgAYVw0XW8RTCtk41qd2N2JzYcSoySCOGn44Il7zHDsPt9LPMRJMjA5MdituGs62iffUj2O1TzHSb9wAjJ2Gz4g/OYvRPsVJv7EDMF4aLuWJX1ksxmWnztNqzOp4Mbs/CeqVZG5aKoh/UeOxU8X6VtwqRbHrt8zFRcOviZ9ZLEG/YgAYFw3/a/sKIHkV/S7FTr8xBTAWGs51iM+5h35FAbCr4eWINVxS/eaPtKMdIXO4vJozAKAoGtaI/+lE2SL9Uj2I55mO6+DJaDX8pR0AgOQmsj2KqX7jDKCRW41Ow7VHEkiievwirvqNNYBRaviZBJRoukTO0gfxPctxfn4hKg2/JoElgl7YYmd90wCAbjV8mJQbwOHAhNBHSR9+XY31k3oxf4IrAg3XMiTAPIbcFRFr/QoAYAQafiaB5ibMEWcx168IAIauYY0EnOfweoXLVxexf1BegIeof4Sp4QYJPAth7ctZNRX/syvCU/wharhcDx5AEs71JIB+RQEwPA3vPZIwokG/YgHY1XA1jGKjmCLhpBL8rWz1RowzK8pEOmFouNQkYSXgntlSZqliAEDRNHweGn+kHeisaKLoVygADeMgYA2/kBDT/gP9igZgwBo+I+HmL/QrGoCBajhs/oKqCz+c3F0bADAwDadfksIfIUG8Ovn10lHJAICiadjHZ9Ad9cr5PUOfYPoVEcBANLx3QKJJxt9dEU2/QgLY07DPA4uVDIkq7XsfhXlfFUy/ggLos4ZreRJljvx6WrN0VL0X8GSKCKCfGr4+L5CIox77cTk9/Lp7MABgZBrWG5tnC47zdETikILqcLsrm4dJ0K/AABqbjIaV5zaRLI/nNeH1KzKAtIb3nomMqZvMXd+dPBgAMCoNH2aIpMkPrFtZypQMABiFhgtdDZ8WiLR5JbZ+RQewr+HiEZE490LrV3gAexrOyMwfqZ+JrN8EAGjcv/u8JjGAy+80wU+g6ABWVraqb2XF77/1pZUiAIw0z4R83f4gJ3+rb3YJ+QcAI01vKucNOTW8/OZDSI94AsCpKfVPhYwa7ur3bVCjWgGg7ejD0yGdhjfe7a6ZTYEAMHIAZdPwQL8AMD4Akv8k0vBIvwAwRgBKpGGmtAeAsQFQFg2zFxoAjA+AUmj4v62ltwQAxhNACTQ8UcoDwFgBmHQNT15gADBeAE4oKknhNbgDwJgBmGANb7x7P1m6A8DYAZhUDfMvLAAYPwCZhtok6xcAxhTABGqYq18AGFsAk6bhq+2LKX8BgPEEMFEa7ur3kgBAsQBMkIan6hcAxhrApGh4un4BYLwBTISGV7bSlwQAiglgAjT8bZZ+AWDsARRdw7P1CwDjD6DQGp6nXwAoAIBdDb/5kFD9AkAhABRVwyfbdzY+BQDjD2AkGv6dSqVeLXT/43L2rpVP8/ULAAUBkH6MMeg8/lio/LO8reP09u+CmvFfvwBQGADD0fDjq2xu+rbuHS/89le/AFAcAIPX8OKmjXf05v406/7pFwAKBGCwGk7d237tm76pzlnYzvef9ktrACgMgIFpuPPi8A1tOS3ji34BYKwAzMx9v0vz8/6P377f+FVczBFZyh75oF8AGCsAF218/qaqnZ75Oa3+7023UzT/ufGsXwAoHIDG3/VOsfbKt9Iv62WG8MZvjn5/OdwEACgWgMbpxVXZqPjyZq92S/e29SWNrRKv7Kd3CABMNoB9DRsVH/g7KHvf/tNFL/oFgEICaFTWH4ueXxJc2PRnDxqP7vULAMUEsKfh27o3/lIzW51r5c1NbVDzPtvcPNyb+dnnoX6/7xAAKAeAPQ17e8NXa2rlY+/Px4OO9eP11MKMfhKt3dPv/goBgNIAaFSWdt03Shca/IUWjz/OaGbM5P9MqbR8eXSnXwAoLoDG6b7rvuEjfmGmLMxtYKw/cd8rU7us7hAAKBeAxoLbvuEDXrdvTXu02W93PnFHePvzba4JAGUD8Kz3qisXGl7k9LzVzh3UadoLbAmaTz8ZRmkBAEoG4Gt3Q7Tyk9WPvZbDKnU7P0awtvJzcEd5DgClA9DFEK3WxHJKFRd9y/WzoqnfkdHvAaB8AA7eOOnldB+mXI5i+Gfqd5QXACgfgM403LT6t/jRfVvik66v7DMNOgsAUD4AnWj4wFr/uL7xNJhhf4etUJeaAFBCAG1r+Mba/vLHU3/erze/7q0F6g8AKCGANjXcsbQ/l1pe8Fv72ev7fbKUqbUMAJQQQFsabt9aSqumF/4u05/6fb8/LKXqYRsAygigDQ1rljWrXvi72z4Zed3SMXIPAKUEcK6GVbYCvHfjTb/fxmMULGZ/BoBSAjhHwx12ygP9xgf9jh4s2fNyGwgAEwPgTA1n2fqH6ot+RxZmR2kpAFBSAGdo+Nlze52p3/fvvs1pX8wDQEkBnKrhOnuf1vKi3y3OyOcmK+EOAJQVwCkaZmvAf3zU7zCvmRX8BYDSAsjV8COjyOu6n/odNjJ+YRSfAoDSAsjTMFMDKab81e+wMabmsh4CABMH4ISGj5gmQNfjXy62r2YNtGY2TgWAEgNo1fAx/bUv7vW7MfMDf+i1HAJAmQFkNXzk9vbMrn55N5oqAJQaQFrDzBwclSD0O8g5vZ5bACg3gGMNP9J3gHv1QPQ7qAkzkx0dAUC5ATQ1/OK5CfptdcvWtBuLbopaAJhYAIcavvZaAF68+Wrzk3QRWGsDQNkB7Gs4RX/nPCj9Dh9TotfVBIDSA9jT8AFdKtUD0+/gLpAubY8BIAAkZGMpM66EaI75+7D91cnHF6jtK3YAIAAkzeu7k4fRV5y+4mHts339Dkbd0G2BCwAQAJJNo3RUHY5VUYLU72Sv8z8ACABJbyR+ZajhhUD1O3jyhHZwHQBKD+BN/6MDDRcLgep3UA2hHz1ZBIDSAzicDKur4Xu71dKhfpfW/3PTaE2PTL0HgNIDaA6E6Wr4yYl+33wlrvKD2sIvAFB6AMdPTF7frb8NVr8DB9cc3gQCwCQD+Eh9/mH5zWqw+u2HngDkAABKDiC9yE27s2h9eLPs4anhM4ctgQAwyQDSI2Hy9mbRWtt9t+qBP6YhpgIAJQeQbhdODfqGVwPUby8dapW3AFByAKmjU6rPeG7YJ/1a6j3GKQCUHMDcJAwzNbz7ZtUrfwz0bQAoNYBtajS+Qg3RWg1IvxOPoDwCQKkB7DCVYGqk9HJA+rVWg1MAUGoA6QcytenPDfunX+uYQBUASg0g3S92bhkpvRqEfvsjEKmVPgFAqQFcZJsB2QeWlmf806+GwDwABIDDvLLWOGgNL/ukX2ux+xEASg3g00wbmtT5p99eUgAQAHJObpP33PCyz/oFgADQroJNDfupXygYANqshJgarjp/57V9AFEJkRtAukLKnxVmdft/y/7yh2YYADi3IZquh7xd8rkIpBuinwGg1ADSA6I3J/887BDx+SaQHoOIrji5AWzTB4pTCd71vRUagxEA4JSxeXuT+v1A9cP5p2HqoRAMx5IdwEPq83WefgPoCqFeyoQBqbIDSM9cf8DVr++dwfWZ2geAcgF4NqVNjvNKOb80TM9H+BcASg4g3SZXmT0c0C8N03PlfwSAkgP4m/p82bTtu901fqu0HxpuTLM+AJQQQEJNlFHqTNWvj6NSMTUHAJxWHr2a+1CcDxrG5EQAcFq3RO81wRvvPq/N/IJXDdNvJj4DgNIDSBdItTr5uv1h3jc8apieJ/8HAJQeQPqWzFDXbY078PJ4HN0Igyl6ASDTFL1ZnaNfHzRcoTbQ3vsKAWCyARyf34P0S8cmRq41zBS45wAQAJpv7sitLh86eFWhSw3TDd9GBgACwNEs0ZtbhS6JubZtlNxp+IvTRhgAmHgAmwP9DnqFHcxT7kbDdBXEVj8cAEw+gO29gX77eWg7wMm5hulmb7tvJQGACQeQvM5ujV/h5uRVDY41zBSAWQIAAWAvF2lqgMqpkyLQqYbpO0BbAxEAYPIBXNmq0oMC7XWPudMwg5JCACAA7PX9vl9jzFhy+MpW+7NWdug2QLvvSweAyQbwavuCfUzI7ktUXWj4L70W+7UdAJhcAFe20pcTlQP7ZZMzDR+U3K0EACYWwG9d/U42jxi60/em29Jwh35P63j0NQCUF8CBfgcj85nS6bBN/Ncww7i9gVgAMMkAjvQ7bAtkvlkhxG8NnzMr2CQAUHIAx/oddIecersNnKdh9gaw1gGAkgN4sn3H/oJddlF1TuAsDd8wLTB2e4EBYFIBXPlE63eQf+xqb4iPGn7cYxb+pQ0ApQbQot8hJGwhtfeb+KbhzjVbvB4RACgzgBP6HeSZuU0zTjPEJw13yux25QkAlBhAnn4nH5jslYFuLMzRcIYt/2yPggGAiQTw2/ef0x48an9hv1/7QXzQ8BF7/2dc1wGgxABO0S/3NtAoNolnDf+wLvOIAEBpAZyu32FrXdGyCI141PDHkmWJTwQASgvgznT9jp4PsfJy++hFw/Vj6za9EAAoLYAn27/mnu28dSE1Dxr+cWpdmos+PgCYEADn6XeYl4nFHGfcaXhnc2JRWQIAZQVwvn6HqUwsp3jedsFNp3pjXdCfNgCUFUA7+uU3B/abThx7WD00yicXbAtg1hV/ADABAK7sf9+xf8ZfOMt6eOWEmef+U8alzFLF4/0fAEwEgDvf91ecnPJ8ibO00482HySv5x/MVhxKw+cEAEoKoAP9jgRa4y2veLxo46ubOvWV8tVQw8UnAgDlBNCZfkf9t4f8Re5VmjPKwfrza0u/20jD10cEAMoJoFP9jvqFX09d7KH2zBmq9aieKTxz9zWcrRMAKCeAv7ZPXJ73xdqMRZfKf7SFhYXnVErt/u8sWy5O/2z56r2nVzsAQFEBPHOnX1PDt/7sQflo19OrHQCgqAAuuNSvmac9H7Z/wdH0HQAwQQB+c61fs1ZxX/K4+dmOs+k7AGBiANQvPeh3PJzU0+Erm1OwrbnXMAAUEkDl/dUK8SMHrm8FD5+dTt8BABMDYD79XCc+5eaPmw2//eF8+g4AmBAA9ZX9xhPxL0cV3dlWF7OpyaWs7b5bBYAyAKi836lpxNfU8w5MfNgquJm+AwAmBMCP6UXDZ/76A/w+/ivOX3np9jzjbvoOAJgMAPW1/UauSYLJwdntDAhLiqbOGfPnQsMAUCgAu/q9bdVJcGmn8mfZsrV9sHz8eiFla7WONQwAYwNgZmFu2u++PZIwkkmlUq96a8x3f3A0j4xTDQPA2AA4N2vv330jsc/a53cbADCJAF6mP60QEeJIwwBQFADvPPf9hhYnGgaAYgAohn5daBgACgHgZXprhYgU2xoGgCIAeLF9RQSLXQ0DwPgDKJZ+HWoYAMYeQOH060jDADDuAAqoXycaBoDxBrCr3w0ibGxoGADGGsC3VUH1O9bwVwAoLoAC69euhgFgfAEUW782NQwAYwug8Po1Nbz9FQCKB+DM05YcDQPAeALocFCTuBoGgLEEMDH6nVueA8BIU0y8fudpeAEARpp64vU7Z6/OAGCkOfA2nFN8DR8DwEjzIoN+Z1xa7T0AGGmupdDv9L17NgBgtGnKod9p5XsZAEac07rTEXSCa7i69V9yGmESAKBxPBbUbpL1y9Pwbx0ARp+/bUn0O6Hho5wBAGOQ244k+rVoeLFoAMBYRD8rEG8vOxBQw6nbJJy6ZABoGOXlz88peaIuHKUPDAAYm2iTr39Oeg6XV08BYDxiefOuJCl21jcBYBzycHJ3bciYsyRoWHwA76tHJUPOdDWcA4AR6/f30r0hbRKgYcEBlFa/idGw2ABKrN+kaFhkAEtH1XtD+hQLQmtYYACv704ewJ/oGhYXQOg3ERoWFUDol9Xw1iYAhH6hYVkArCxloN9kaFhEAEs3SxqIm9BwXUgNCwgg9JskDYsHIPSbKA0LB+BNFfqdpeEsAAwypxdXZXA2Iy+iaVgsACvr0G/CNCwUgNBv8jQsEIDQr10NVw8AoP/ZXO8UAVfiNCwMgKnqGchKoIYFARD6dZhzUTQsBoDQb2I1LASAB2noN6kaFgDA3OryIXhypeEfABD6hYbFBhD6TbaGYw4g9OtVw+kfANB9slt16DfZGg4YQGZaxZSqOWvM+1E9t7FobfSzQv1SjcfhVentMf9Bwli1Zr41eSlrKOaqLSdcoQ9j0gHsJdPwS78A0B6AhDynVQA4jt274nn6BYB2AVQOl3+tAEAz9m5J1PS5zUUDwHkAGsW35qsdACDJ2/je3sbuFwMA+gWgoVxsXwHA0W2gDf1+quuGYwBjWNtTY3JBKORy+ApvWQHMaM2J6z9Xaand5DV2I3LZtTcrqtqqcKvMSvc7zYrOA3DWhuiVpqpWcuOf2Qp5Q2v2NkXL0hDnep9r8Y9QWcv3N51frc9pvYXl5gKo9JfS1Br6vG1mtnPKoeleuN3F5RtcALu14b6GleGnKvo0APWsNjgWepIA7J6ALPuCPWVsJFLQzJ1V1JWt9OWQ2om5x3V19AUGQK3366ZlffTZzxbGR7kx/LllLlQrjDdFNY/IaHvVnJG33MJnM+MrizM/emt0s6HPUjCz2nzZcsDy5jZXeNuZyU6atpwaNnflJhXc+39fw0p5uO2FLBfAXH68Uc1cogDUmbPYYr2cKo/O3bd379fGv2YPgZ4anyD6yOmZ4WL5AOZN9rvUZa03o+UMuynDM9EYXx7lArPp1FZwttEY40pSqekAWldbsdxYVKwbZPlCSrcA2DC3MqNzAexrOM+2R1gBzPI2KiEAGvRZbFrvDAv64HCebN9xDvPEqWWBSY1wmlIC0p+mfu7vvFLgLLAb6nQXmG9Y+Ov+mSUwy9vICQD1Ard9arzj1naDnPULKZ0FMMXuAQfAkYapQ24BcGLbWwkFUONXjvW2qV9unbkwBUDzc1NO+JTkuSAMTrjC/YYyWXZP3OA1bQGo8VfLXWvF4O6NavCXM6jn8QAcapj3hz6AuQJ3j5MH4PisqwX6+OdH+i3wmyyog19gABzduU054RmqdKAWrdLnifpMnjl/1Bd6p0MfFzkFbuP6+OOpzHQAM5Mf0pg9pL6sMReEysDB386pAJLL9U8r1HJZAM1rq5By0GYhIICN8V7nqOO0+O7OlEOF805w+mgxRy7HXZ9K3ROlKM5NkRcMw/xDd5V5+stN6gvMuTQ3rDnejeaUfaYuNCuA1NYXqKWM+aPKe5W++2jRW8DcA47/0LuYpwDYKl6aGp4AsDA+6KmQ3skeDYAadWzMC/18531m/GmF4wCmR5PbgMUHUKOvbfpGh/qGavm9SpHArLc50fwzrZjWZjRE07unco7RxJdT4y8o/IJOZ7dzCoBd/ZgatgJYphashdQ+GCKAufExaHIO/7cloquBAagRzqIJdcwtv2fOPrNelQegEjiAhAegTnNm2ATQIJfpQaO0FUCFB6CaGACpYk+dPPwn24/jQ54KDUDFMYDEXwAb9gDMcQFU3AE4qg1bAdQSDGBBzVA3KBMArnxKX6oG/fuyOkw5AgAVpwBqrgHs/qE13NPWjC8rvgI4rA3bApAkA0A6DGj9m5ud7z/X+qfC5LXB79EMFMBGiACO69JN3c4NpN8A9jUsKYApBsDeETh588taDeB2AwULoN50BiCn98Q+gFQ7dyEbBYA9DatTAWTLi4QBSB9vJT/Qr7W3rt8alwsBQKrnP0PCBJBuzs5kIwCwq+EugRICOO7a0LOmfkfniO1l0PSwACznC5bm/6ABZDsdUkoEAJJXuxvHsgFYMLu3c4NzfrL9i65usb29llvBoADMpib7n4IG0Ciz3V7DW8FQAdT09vqGJAAW1P7AN3N1ucEN18r+9x22vt+afmYDAjDL7QANHMCJ0S3l8AE0jGezbzjhAFpak4a1ja5+j1KWjyiZqQOCggCQO8LLbi149j7PAdDQ2YutP4gqbACVUaO0tRYcVqIBMDdqfP5lGbM5GOJWmBimFRyA445hRQkZwG4hqFqL0dAB7NWGv0kHYGWk3+5Vzxm1ruf5leYgACyMi1rnAGpeFDwY9pphB1GFD+BoiJYVwEQrON/X7/7KxDkyNyvFGxIZAIC5aecvJAANnbrx0qMBcNA3LBWA3UP7a/tk8kxr4x/znG9G0hWXotvH/QOQ6nQsTFl6aAD2NSwXgKPa73QAcxEDOL4LKLNdJL4DyDzyFA2APQ2vyQTgY0+/swE0IgaQ3yShUDeNvgGo2QCw7OdwLN4IrMtPG3sVWQDMvznh32zFCMDyNAC5S20EDSB/PKDhH4DkhXx64W1gKnEA6iv7HaqKyxNNhuoWnlIJ0X0GMGM5S/xHmhRmbPx4YG15CoDTH8tUx0egxauEtCwAFsasKzQbTgHMskeO7gs+T1+Nt8S8AJtJA/D2/WVNHXdAlacMmtY4LdHjzzaNis8A0uO0+wBSnbVMC3V23HBsfoR5cod6PLdMpgKYN49AbtQSU6B3oLt0piGgOd51+hJwDCB95LKW0TBfloaN0t2D3uKNHUkCgPn0E+/JxuFHMpO/zs0bXugJQH2aacetkZkGO/KZs40VSxWfv3MMgFn+MI2pe8h72jjnAkDLbrIPJf0dNkpb+2eSA2BXvw1jxrPbGve3ZlK+A8jDyRxhrzc0rT8NC/OHBm+EI5WWLQB1/iO406+HyQ3t35x4AdCYeDA9dUc/N2y9uxUfQOX9Ts2wHH22IdpafBTKEz0owz/4BKDG2ZJ+JUQZJmcFcIIwy8wIdPVl+mOZk0xYpnZge0g4taIB9k4BzLAAWwDMFcy+4Yk78AQA+DG9yA5G6B12bdZomIzlqdRxz23Z98EIhTK3sttiH1fsXweFyWEskyMtevdPDkbDtCw1mKy1PLbMIZLXXQFYNve3P7WHdW6YnLpGazj4OdvCnJxooN/hegdno6BNPH6VG48NzWgTNyDDgQrdo+/XcKzRnFNqmSnoxo+nZBWzAlAw+89MeHizYw07eLtLnN0VR41DbCoTVejhSIXxNUit1fy8UwAz5iFs6YbBm55NaZoazofwgsjwXtMw0q85IiarTZkXzyh37726f+RODta7L/N75jpleKvHL8b4t5u5Gds4WKKduc10pdJdSkXhtuEY5e4f2e3KKRr7eTeZewjv97+2vK4kdgCO9StGeJMWpYKfsjFE+c3aefLpOKxyKXF75FcaUfAXEwBDLC9CKmc/7+wZoqVhafhohTFlbVwANL7sbuwlBkDR9GveBzYL5iMtlXCmQNdGifwdaiFJS0nMngR1gHrRDRkTSrkRPIBhleWI/3CEcOoCB/A8reJMipoQ5KUIvweI0BoOFkDoNwEa/rYnLIDQLzQcIYDF+lYW5w8ajgrAL8sbOZy8ZGj4c3AaDgxA6BcajhBA6BcajhLAw+VV6DdpGg6mOz8QAM/SBzhj0HBUAEK/0HCUAEK/ydXwe/817DuA0C80HCGAxc76Js4TNBwVgIdXH05xkpKu4VpsAYR+ZdDwmq8a9hFA6BcajhLA8tUF9AsNRwagVr3BmZFHw/vH8QKw+Aj9QsPRAQj9QsNRAgj9yqjhFV807AOApcxSBecDGo4KwPLJxTVOBjQcFYDQr9wabkQLIPQLDUcJ4MPJHfQLDUcG4H31qIRTAA03ogEQ+kX6WfCiYfcAQr+IDxp2DSD0i/ihYZcAlo6q9zjuyFjD1cUwAXy4+/WAg474oGFXAEK/iF8adgEg9Itwk3ejYecAXt+dQL+IXxp2DGBlKQP9Ir5p2CGApaOl1zjOyHQNp5tBAgj9Ij5r2BGA0C/it4adAHhT1XB8ERsafgoCwNOLqzIOLuKzhm0DCP0iQWjYLoDQLxKIhu0BCP0iDnNrU8O2ANxc7xRxSJEgNGwHQOgXCUzD8wGEfhHXGr6seQYQ+kWC1LCCo4REGQCIAEAEACIIAEQAIIIAQAQAIggARAAgggBABAAiCABEACCCAEAEACIIAEQAIIIAQAQAIggARAAgggBABAAiiK38X4ABAJQhP9nQvpVSAAAAAElFTkSuQmCC\";\n }\n else\n {\n $imgs[$key] = base64_encode(stream_get_contents($entity->getPicture()));\n }\n\n\n }\n\n return $this->render(\"MyAppEspritBundle:Ween/AirlineCompany:Showairlinecompany.html.twig\",array(\"airlines\"=>$Airline,\"images\"=>$imgs));\n\n }", "function image($id) {\n\t\t\t$image = $id;\n\t\t\tif ( -1 == $image ) {\n\t\t\t\t$image = get_template_directory_uri(). '/img/promo-placeholder.jpg';\n\t\t\t} else {\n\t\t\t\t$image = wp_get_attachment_image_src($id, 'carousel');\n\t\t\t\t$image = $image[0];\n\t\t\t}\n\t\t\techo($image);\n\t}", "public function subir_imagen($f, $alto_max, $alto_min , $ancho_max, $ancho_min)\n\t{\n\t\t/**\n\t\t*\tRecoleccion de parametros del archivo necesarios para la validacion\n\t\t*/\n\t\t$file = $f;\n\t\t$nombre = $file[\"name\"];\n\t\t$tipo = $file[\"type\"];\n\t\t$ruta_temp = $file[\"tmp_name\"];\n\t\t$size = $file[\"size\"];\n\t\t$dimensiones = getimagesize($ruta_temp);\n\t\t$width = $dimensiones[0];\n\t\t$height = $dimensiones[1];\n\t\t$carpeta = Yii::app()->request->baseUrl.\"/images/tmp/\";\n\n\t\t/**\n\t\t*\tHTML que retorna ya sea si encuentra error o todo sale bien\n\t\t*/\n\t\t$html_1=\"<div class='bs-callout bs-callout-danger'><h4>\";\n\t\t$html_2=\"</h4><p>\";\n\t\t$html_3=\"</p></div>\";\n\n\t\t/**\n\t\t*\tValidacion del tipo de archivo\n\t\t*/\n\t\tif($tipo != 'image/jpg' && $tipo != 'image/jpeg' && $tipo != 'image/png' && $tipo != 'image/gif')\n\t\t{\n\t\t\treturn $html_1.\"El archivo no es una imagen\".$html_2.\"Los formatos aceptados son <strong>jpg, jpeg, png y gif</strong>\".$html_3;\n\t\t/**\n\t\t*\tValidacion por tamanio o peso\n\t\t*/\n\t\t}else if($size > 1024*1024)\n\t\t{\n\t\t\treturn $html_1.\"La imagen ocupa demasiado espacio\".$html_2.\"El tamanio maximo aceptado es de <strong>1 MB o 1024 Kb</strong>\".$html_3;\n\t\t/**\n\t\t*\tValidacion dimensiones\n\t\t*/\n\t\t}else if($width > $ancho_max || $width < $ancho_min || $height > $alto_max || $height < $alto_min)\n\t\t{\n\t\t\treturn $html_1.\"Las dimensiones no corresponden\".$html_2.\"La imagen debe tener preferiblemente <strong>ancho entre: \".$ancho_min.\"px y \".$ancho_max.\" <br> alto entre: \".$alto_min.\" px y \".$alto_max.\"px </strong>\".$html_3;\n\t\t/**\n\t\t*\tSi paso las anteriores se sube la imagen al servidor en la carpeta images/tmp/\n\t\t*/\n\t\t}else{\n\t\t\t$src = $_SERVER['DOCUMENT_ROOT'].$carpeta.$nombre;\n\t\t\tmove_uploaded_file($ruta_temp,$src);\n\t\t\t/**\n\t\t\t*\tRetorna el html para que se pueda ver la imagen\n\t\t\t*/\n\t\t\treturn '<img class=\"img_slide\" src=\"'.$carpeta.$nombre.'\">';\n\t\t}\n\t}", "public function getImagen()\n {\n return $this->imagen;\n }", "public function getImagen()\n {\n return $this->imagen;\n }", "function imagenes_disponibles_tipos($id_palabra,$with_pictcolor,$with_pictnegro,$with_imagenes,$with_cliparts) {\n\t\t\t\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\n\t\t$with_pictcolor\n\t\t$with_pictnegro\n\t\t$with_imagenes\n\t\t$with_cliparts\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "public function Information()\n {\n $this->imgInfo = list($width, $height, $type, $attr) = getimagesize($this->pathToImage);\n !empty($this->imgInfo) or self::errorMessage(\"The file doesn't seem to be an image.\");\n $mime = $this->imgInfo['mime'];\n\n if($this->verbose) {\n $this->imgInfo['filesize'] = $filesize = filesize($this->pathToImage);\n self::verbose(\"Image file: {$this->pathToImage}\");\n self::verbose(\"Image information: \" . print_r($this->imgInfo, true));\n self::verbose(\"Image width x height (type): {$width} x {$height} ({$type}).\");\n self::verbose(\"Image file size: {$filesize} bytes.\");\n self::verbose(\"Image mime type: {$mime}.\");\n }\n }", "public static function modifImage($fichier,$id){\r\n $im = ModelProgramme::getImage($id);\r\n $var = str_replace(\"images/\",\"\",$im);\r\n $fichier=\"images/\".$var;\r\n $fichier= str_replace(\" \",\"\",$fichier);\r\n $array = array(\r\n \"suppression\" => \"bar\",\r\n \"edit\" => \"foo\",\r\n );\r\n\r\n\r\n\r\n if (file_exists($fichier)) {\r\n if (@unlink($fichier)) {\r\n $array[\"suppression\"]=\"Suppression de $fichier réussite </br>\";\r\n } else {\r\n $array[\"suppression\"]=\"Echec de suppression de $fichier : $php_errormsg\";\r\n }\r\n } else {\r\n $array[\"suppression\"]=\"Le fichier $fichier n'existe pas </br>\";\r\n\r\n }\r\n\r\n // Vérifier si le formulaire a été soumis\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\r\n // Vérifie si le fichier a été uploadé sans erreur.\r\n if (isset($_FILES[\"photo\"]) && $_FILES[\"photo\"][\"error\"] == 0) {\r\n $allowed = array(\"jpg\" => \"image/jpg\", \"jpeg\" => \"image/jpeg\", \"gif\" => \"image/gif\", \"png\" => \"image/png\");\r\n $filename = $_FILES[\"photo\"][\"name\"];\r\n $filetype = $_FILES[\"photo\"][\"type\"];\r\n $filesize = $_FILES[\"photo\"][\"size\"];\r\n\r\n // Vérifie l'extension du fichier\r\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n if (!array_key_exists($ext, $allowed)) die(\"Erreur : Veuillez sélectionner un format de fichier valide.\");\r\n\r\n // Vérifie la taille du fichier - 5Mo maximum\r\n $maxsize = 5 * 1024 * 1024;\r\n if ($filesize > $maxsize) die(\"Error: La taille du fichier est supérieure à la limite autorisée.\");\r\n\r\n // Vérifie le type MIME du fichier\r\n if (in_array($filetype, $allowed)) {\r\n // Vérifie si le fichier existe avant de le télécharger.\r\n if (file_exists(\"upload/\" . $_FILES[\"photo\"][\"name\"])) {\r\n $array[\"edit\"]=$_FILES[\"photo\"][\"name\"] . \" existe déjà.\";\r\n\r\n } else {\r\n move_uploaded_file($_FILES[\"photo\"][\"tmp_name\"], \"images/\" . $_FILES[\"photo\"][\"name\"]);\r\n $array[\"edit\"]= \"Votre fichier a été téléchargé avec succès. \".$_FILES[\"photo\"][\"name\"];\r\n\r\n\r\n $adresse = \"images/\".$filename;\r\n $adresse = str_replace(\" \",\"\",$adresse);\r\n ModelProgramme::update($id,\"urlImage\",$adresse);\r\n }\r\n } else {\r\n $array[\"edit\"]= \"Error: Il y a eu un problème de téléchargement de votre fichier. Veuillez réessayer.\";\r\n }\r\n } else {\r\n echo \"Error: \" . $_FILES[\"photo\"][\"error\"];\r\n }\r\n\r\n }\r\n return $array;\r\n }", "public function preview_image()\n {\n return 'contact-area/04.png';\n }", "function miniatureImage($what){\n\t$photoVariations=getVariationFctNom($what['ID']);\n\t$photoArticle=explode(\";\", $what['photo']);\n\t$img = $photoArticle[0];\n\t$currId = 0;\n\t$testVideo=0;\n\n\techo \"<table style='width:100%;'>\";\n\t\t\t\n\tforeach($photoArticle as $i)\n\t{\n\t\techo\"<tr>\n\t\t\t\t<td style='vertical-align:top middle;'>\n\t\t\t\t<a href='#'><img id='imgNo$currId' src='\".$i.\"' width='50' height='50'/></a>\n\t\t\t\t</td></tr>\";\t\t\n\t\t$currId++;\t\t\n\t}\n\n\n\tforeach ($photoVariations as $nomvari => $i) \n\t{\n\t\tforeach ($i as $varindividuelle) \n\t\t{\n\t\t\tif($varindividuelle['photo']!=null)\n\t\t\t{\n\t\t\t\techo \"<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t<a href='#'><img id='imgNo$currId' src='\".$varindividuelle['photo'].\"' width='50' height='50' style='float : left,'/></a>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\";\n\t\t\t\t$currId++;\n\t\t\t}\n\t\t}\t\t\t\n\t}\n/*<video width='50' height='50' controls='controls'>\n\t\t\t\t\t\t<source src='\".$what[\"video\"].\"' type='video/mp4' />\n\t\t\t\t\t</video>*/\n\tif($what[\"video\"]!=null)\n\t{\n\t\t$testVideo=1;\n\t\techo \"<tr>\n\t\t\t\t<td>\n\t\t\t\t<a href='#'>\n\t\t\t\t\t<p id='vidNo'>Video</p>\n\t\t\t\t</a>\n\t\t\t\t</td>\n\t\t\t\t</tr>\";\t\t\n\t}\n\n\telse\n\t\t$testVideo=0;\n\n\techo \"\t\t\n\t</table>\";\n\t$nbImage=$currId;\n\t?>\n\n\t<script type=\"text/javascript\">\n\t\t$(document).ready(function(){\n\t\t\tfor(let i=0; i< <?= $nbImage ?>; i++){\n\t\t\t\t$(\"#imgNo\" + i).click(function(event){\n\t\t\t\t\t$(\"#imagePrincipale\").attr(\"src\", $(event.target).attr(\"src\"));\n\t\t\t\t\t//test.getElementById(\"#imagePrincipale\").style.display = \"none\";\n\t\t\t\t\t$(\"#imagePrincipale\").css(\"display\", \"block\");\n\t\t\t\t\t$(\"#articleVideo\").css(\"display\", \"none\");\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t\t$(\"#vidNo\").click(function(event){\n\t\t\t\t\t$(\"#imagePrincipale\").css(\"display\", \"none\");\n\t\t\t\t\t$(\"#articleVideo\").css(\"display\", \"block\");\n\t\t\t\t});\n\t\t\t\n\n\t\t});\n\t\t\t\n\t</script>\n\t<?php\n}", "protected function collectTcaSpriteIcons() {}", "function redimensionne_image_petit($photo)\n{\n\tglobal $photo_redim_taille_max_largeur, $photo_redim_taille_max_hauteur;\n\n\tif((!preg_match(\"/^[0-9]{1,}$/\", $photo_redim_taille_max_largeur))||($photo_redim_taille_max_largeur<=0)) {\n\t\t$photo_redim_taille_max_largeur=35;\n\t}\n\n\tif((!preg_match(\"/^[0-9]{1,}$/\", $photo_redim_taille_max_hauteur))||($photo_redim_taille_max_hauteur<=0)) {\n\t\t$photo_redim_taille_max_hauteur=35;\n\t}\n\n\t// prendre les informations sur l'image\n\t$info_image = getimagesize($photo);\n\t// largeur et hauteur de l'image d'origine\n\t$largeur = $info_image[0];\n\t$hauteur = $info_image[1];\n\t// largeur et/ou hauteur maximum à afficher\n\t//$taille_max_largeur = 35;\n\t//$taille_max_hauteur = 35;\n\n\t// calcule le ratio de redimensionnement\n\t$ratio_l = $largeur / $photo_redim_taille_max_largeur;\n\t$ratio_h = $hauteur / $photo_redim_taille_max_hauteur;\n\t$ratio = ($ratio_l > $ratio_h)?$ratio_l:$ratio_h;\n\n\t// définit largeur et hauteur pour la nouvelle image\n\t$nouvelle_largeur = $largeur / $ratio;\n\t$nouvelle_hauteur = $hauteur / $ratio;\n\n\t// on renvoit la largeur et la hauteur\n\treturn array($nouvelle_largeur, $nouvelle_hauteur);\n}", "public function afficher_musique($id)\n{\n\n $db = $this->_db;\n $requete = $db->prepare(\"SELECT * FROM musiques WHERE id=$id\");\n $requete->execute();\n $resultat = $requete->fetchall();\n\n foreach($resultat as $musique)\n {\n $titre = $musique['titre'];\n $artiste = $musique['artiste'];\n $album = $musique['album'];\n $image = $musique['image'];\n\n echo\n \"<div class='card' style='width: 18rem;'>\n <img class='card-img-top' src='images-auto/$image' alt='Album $album'>\n <div class='card-body'>\n <h5 class='card-title'>Artiste :</h5><p class = 'anim'>$artiste</p>\n <h5 class='card-title'>Album : </h5><p class = 'anim'>$album</p>\n <h5 class='card-title'>Titre :</h5><p class = 'anim'> $titre</p> \n </div>\n </div>\";\n \n}\n}", "function cr_sq_details() {\n $crse_color = $this->config->item('course_color');\n $svpath=$this->config->item('sq_image_folder').'small_77/';\n echo $svpath;\n \n //create_image_sq(\"#339900\",$svpath);\n //create_image_sq(\"#663300\",$svpath);\n //create_image_sq(\"#CC0000\",$svpath);\n //create_image_sq(\"#000000\",$svpath);\n //create_image_sq(\"#9900CC\",$svpath);\n // create_image_sq(\"#CC0099\",$svpath);\n // create_image_sq(\"#FF9900\",$svpath);\n // create_image_sq(\"#66FF66\",$svpath);\n // create_image_sq(\"#FFFF00\",$svpath);\n // create_image_sq(\"#0000FF\",$svpath);\n\n // create_image_sq(\"#EBC1BF\",$svpath);\n // create_image_sq(\"#DBDEA4\",$svpath);\n //create_image_sq(\"#A8D8E8\",$svpath);\n // create_image_sq(\"#B5F49A\",$svpath);\n // create_image_sq(\"#E2D289\",$svpath);\n //create_image_sq(\"#F0FE57\",$svpath);\n //create_image_sq(\"#E8E2DF\",$svpath);\n // create_image_sq(\"#F8AB93\",$svpath);\n // create_image_sq(\"#B68FFF\",$svpath);\n create_image_sq(\"#FDB6FF\",$svpath);\n\n\n\n \n print '<img src=\"'.$this->config->item('sq_image_url').'image.png\">';\n \n \n\t\t\t\n\t\t}", "public function Getimg($idAseguradora)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//ECHO strtolower($idAseguradora);\r\n\t\t\tswitch (strtolower($idAseguradora) ) {\r\n\t\t\t\tcase \"169159ad-d55a-467b-9efd-2b7139ecc730\": //ANDI ASISTENCIA SA\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Mafre.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"ae7c4aa0-bcba-4804-b2aa-3496c4edc5f7\": // CORIS SA\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Coris.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"715697a2-f643-4d5b-ac49-83b11e8546b0\": // UNIVERSAL\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/UniversalAssistance.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"b2ff47cf-50d3-4803-992d-9ee57d9fe736\": // EDUCAMOS VIAJANDO LTDA(SAFEST)\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Safest.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"4e04d2c4-5c91-46e4-99dd-e992638da6f8\": // ASSIST CARD\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/AssistCard.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"8528cc83-53f7-4330-aaed-ef0a5ad2b08f\": // CHARTIS COLOMBIA SEGUROS GENERALES SA(TRAVELGUARD)\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/TravelGuard.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"db7a54c0-bf90-4508-9528-f7c6af83357b\": // QUALITAS ASSISTANCE SAS\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Qualitas.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function Contenido($imagenlogo) {\n \t$this->SetMargins(10,10,151.5);\n\n \t//declaramos las fuentes a usar o tentativamente a usar ya que no sabemos cual es la original\n\t $this->AddFont('Gotham-B','','gotham-book.php');\n\t $this->AddFont('Gotham-B','B','gotham-book.php');\n\t $this->AddFont('Gotham-M','','gotham-medium.php');\n\t $this->AddFont('Helvetica','','helvetica.php');\n\n //variables locales\n $numero_de_presidiums=6;\n\n $presidium_orden=\"1\";\n $presidium_nombre=\"Cesar Gibran Cadena Espinosa de los Monteros\";\n $presidium_cargo=\"Dirigente de Redes y Enlaces \";\n\n \t//la imagen del PVEM\n \t$this->Image($imagenlogo, $this->GetX()+10, $this->GetY()+10, 100,40);\n\n \t//el primer espacio\n \t$this->Ln(3);\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(35, 5,utf8_decode(\"Distribución Logística:\"), 0,0, 'C', 1);\n\n $this->setY($this->GetY()+45);\n $this->Ln();\n $this->SetFillColor(231, 234,243); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetFont('Helvetica', '', 9); //font de cuando se va a rellenar la informacion\n $this->SetTextColor(0,0,0); //color gris para las letras\n $this->Cell(40, 5,utf8_decode(\"Presídium (Primera Fila):\"), 0,0, 'C', 1);\n\n $this->Ln(); \n $this->Ln(); \n\n $this->SetFillColor(160,68,68); //color de fondo donde se va a rellenar los campos (como azul claro)\n $this->SetTextColor(255); //color gris para las letras\n $tamano= ($numero_de_presidiums*7.5)/2;\n $this->setX((120/2)-$tamano);\n\n if ( ($numero_de_presidiums) % 2 ==1){ //es impar\n $candidato=($numero_de_presidiums/2)+.5;\n }else{\n $candidato=($numero_de_presidiums/2)+1;\n }\n\n for($i=0;$i<=$numero_de_presidiums;$i++){\n\n if ( ($i+1) == $candidato ){\n $this->Cell(7, 7,utf8_decode(\"*\"), 1, 0, 'C', 1);\n }else{\n $this->Cell(7, 7,utf8_decode(\"\"), 1, 0, 'C', 1); \n }\n }\n $this->Ln(); \n $this->Ln(5); \n\n\n //CONFIGURACION DE COLOR VERDE CON BLANCO\n $this->SetFont('Gotham-B','',6.5);\n $this->SetFillColor(73, 168, 63);\n $this->SetTextColor(255);\n $this->Cell(9, 5,utf8_decode(\"Orden\"), 'LR', 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode(\"Nombre\"), 'LR', 0, 'C', 1);\n $this->Cell(0, 5,utf8_decode(\"Cargo\"), 'LR', 0, 'C', 1);\n\n\n $this->Ln(); \n\n\n //CONFIGURACION SIN COLOR de fondo\n $this->SetFont('Helvetica', '', 6.5); //font de cuando se va a rellenar la informacion\n $this->SetFillColor(255, 255, 255);\n $this->SetTextColor(0);\n\n\n //ESTO ES LO QUE IRIA EN UN FOR\n for($i=0;$i<=7;$i++){\n \n $this->Cell(9, 5,utf8_decode($presidium_orden), 1, 0, 'C', 1);\n $this->Cell(55, 5,utf8_decode($presidium_nombre), 1, 0, 'C', 1);\n $this->MultiCell(0, 5,utf8_decode($presidium_cargo), 1, 'C', 1);\n $this->Ln(1);\n } \n \n }", "function image() {\n echo json_encode(array('element' => '<img src=\"msbienvenuebackground.png\" alt=\"Welcome\">'));\n exit;\n }", "public function display_bitmap($width,$height,$bitmap) \r\n { \r\n $rowSize=floor(($width+31)/32)*4; \r\n $size=$rowSize*$height + 62; //62 metadata size \r\n $bytemap=$this->bitmap2bytemap($bitmap,$width,$height); \r\n \r\n\r\n header(\"Content-Type: image/bmp\"); \r\n #bitmap header \r\n echo \"BM\"; //header \r\n echo (pack('V',$size)); //bitmap size , 4 bytes unsigned little endian \r\n echo \"RRRR\"; \r\n echo (pack('V',14+40+8)); //bitmap data start offset , 4 bytes unsigned little endian, 14 forced, 40 header, 8 colors \r\n\r\n #info header \r\n echo pack('V',40); //bitmap header size (min 40), 4 bytes unsigned little-endian \r\n echo (pack('V',$width)); //bitmap width , 4 bytes signed integer \r\n echo (pack('V',$height)); //bitmap height , 4 bytes signed integer \r\n echo (pack('v',1)); //number of colored plains , 2 bytes \r\n echo (pack('v',1)); //color depth , 2 bytes \r\n echo (pack('V',0)); //compression algorithm , 4 bytes (0=none, RGB) \r\n echo (pack('V',0)); //size of raw data, 0 is fine for no compression , 4 bytes \r\n echo (pack('V',11808)); //horizontal resolution (dpi), 4 bytes \r\n echo (pack('V',11808)); //vertical resolution (dpi), 4 bytes \r\n echo (pack('V',0)); //number of colors in pallette (0 = all), 4 bytes \r\n echo (pack('V',0)); //number of important colors (0 = all), 4 bytes \r\n\r\n #color palette \r\n echo (pack('V',0)); //first color, black \r\n echo (pack('V',0x00FFFFFF)); //next color, white \r\n\r\n for ($j=$height-1;$j>=0;--$j) \r\n for ($i=0;$i<$rowSize/4;++$i) \r\n for ($k=0;$k<4;++$k) \r\n if (isset($bytemap[$j][$i*4+$k])) \r\n echo pack('C',$bytemap[$j][$i*4+$k]); \r\n else \r\n echo pack('C',1); \r\n }", "public function buscaImagen($id){\n if(empty($id))\n return '';\n \n $sql = \"Select imagen from item where id=:id\";\n\t\t$db = Yii::app()->getDb();\n\t\t$cmd = $db->createCommand($sql);\n\t\t$nombre = \"$id\";\n\t\t$cmd->bindParam(':id', $id);\n\t\treturn $cmd->queryAll();\n }", "public function preview_image()\n {\n return 'contact-area/02.png';\n }", "function imgrace($id)\n{\nif ($id == 1)\n{\necho \"<img src=\\\"images/races/1-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 2)\n{\necho \"<img src=\\\"images/races/2-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 3)\n{\necho \"<img src=\\\"images/races/3-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 4)\n{\necho \"<img src=\\\"images/races/4-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 5)\n{\necho \"<img src=\\\"images/races/5-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 6)\n{\necho \"<img src=\\\"images/races/6-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 7)\n{\necho \"<img src=\\\"images/races/7-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 8)\n{\necho \"<img src=\\\"images/races/8-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 9)\n{\necho \"<img src=\\\"images/races/9-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 10)\n{\necho \"<img src=\\\"images/races/10-0.gif\\\" alt=\\\"\\\">\";\n}\nelseif ($id == 11)\n{\necho \"<img src=\\\"images/races/11-0.gif\\\" alt=\\\"\\\">\";\n}\n}" ]
[ "0.6600475", "0.59704095", "0.59265107", "0.5846652", "0.5828441", "0.5810266", "0.5809202", "0.5763449", "0.5754753", "0.5673554", "0.5605244", "0.5597154", "0.5549073", "0.5548339", "0.553179", "0.553179", "0.55296594", "0.55296594", "0.55296594", "0.55296594", "0.55087835", "0.5501504", "0.5499053", "0.5498888", "0.5492064", "0.5491462", "0.54831624", "0.5472869", "0.5470458", "0.54687256", "0.5455394", "0.54389113", "0.5438707", "0.54342705", "0.5418029", "0.5411765", "0.5405884", "0.54035", "0.53997463", "0.5386473", "0.53695726", "0.5361734", "0.53521365", "0.533725", "0.5337043", "0.5323717", "0.53197443", "0.53190374", "0.53175735", "0.5315476", "0.53146243", "0.5308271", "0.5303596", "0.529699", "0.5296315", "0.5288669", "0.5288669", "0.5288669", "0.528651", "0.5272069", "0.5268271", "0.5265748", "0.5264688", "0.52553844", "0.5255261", "0.52531075", "0.5249146", "0.5244612", "0.5244489", "0.5225249", "0.52247643", "0.52225083", "0.52200127", "0.52080494", "0.52017987", "0.51978177", "0.5195779", "0.5194504", "0.51888156", "0.5186212", "0.51858294", "0.5185411", "0.51846594", "0.51846594", "0.5182929", "0.5182085", "0.5168147", "0.5165624", "0.5164571", "0.51618993", "0.5159861", "0.5154512", "0.5153242", "0.5150078", "0.51499313", "0.513922", "0.51356107", "0.5134383", "0.5132538", "0.5132348" ]
0.59256065
3
Fonction qui permet d'afficher l'image d'une arme ainsi que son infobulle complete
function affiche_image_arme($image_arme, $nom_arme, $description_arme, $portee_arme, $degats_arme){ $description_arme = $description_arme; echo " <td width=50 height=50 align=center> <img tabindex='0' src='../images/armes/$image_arme' width=50 height=50 data-toggle='popover' data-trigger='focus' data-html='true' data-placement='bottom' title=\"<b>$nom_arme</b>\" "; echo " data-content=\" <div><img src=../images/armes/$image_arme></div> <div><u>Portee :</u> $portee_arme</div> <div><u>Degats :</u> $degats_arme</div> <div><b>Description</b></div> <div>$description_arme</div>\" >"; echo " </td>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rutaImageFly()\n {\n\n // primero vemos a que galeria pertenece\n $galeria = ORM::factory( 'Galeria', $this->galeria );\n\n return( $galeria->rutaImageFly().$this->imagen );\n\n }", "function affiche_image(){\n\t\tglobal $infos_id;\n\t\tif($infos_id['grade']==0){\n\t\t\treturn\"<img src='ressources/membre.png' title='Membre' alt='Membre'>\";\n\t\t}\n\t\tif($infos_id['grade']==10){\n\t\t\treturn \"<img src='ressources/users.png' title='Conseil' alt='Membre du conseil'>\";\n\t\t}\n\t\tif($infos_id['grade']==20){\n\t\t\treturn \"<img src='ressources/admin.png' title='Vice président' alt='Vice président'>\";\n\t\t}\n\t\tif($infos_id['grade']==30){\n\t\t\treturn \"<img src='ressources/boss.png' title='Président' alt='Président'>\";\n\t\t}\n\t}", "public function cargarImagen() {\n\n $id = $_REQUEST[\"id\"];\n\n echo $this->usuario->getCampo($id,'imagen');\n\n }", "public function carregar_imagem()\n\t{\n\t\t$id = $this->input->get(\"id_aluno\");\n\t\t$dados[\"aluno\"] = $this->Aluno_Model->retorna_aluno($id);\t\n\t\t//\tCARREGA A VIZUALIZACAO DA VIEW LISTA\n\t\t$this->load->view('layout/cabecalho_secretaria');\n\t\t$this->load->view('layout/menu_lateral_secretaria');\n\t\t$this->load->view('conteudo/_secretaria/_aluno/fotografia', $dados);\n\t\t$this->load->view('layout/rodape');\n\t\t$this->load->view('layout/script');\n\t}", "protected function fetchFullTextImage(){\n $this->imageFullText = $this->getImageTypeFromImages('full');\n }", "public function aparecer() {\n // Referencia al objeto dentro de la clase\n echo '<img src=\"' . $this -> foto . '\">';\n\n }", "protected function processImage() {}", "function trataImagem($nomeIntegrador=false){\n\t\t$this->enviaMensagemTelegramWeb(\"\\xF0\\x9F\\x94\\xB4\\xF0\\x9F\\x94\\xB4 ATENCAO \\xF0\\x9F\\x94\\xB4\\xF0\\x9F\\x94\\xB4\");\n\t\t$this->enviaMensagemTelegramWeb(\"=====================%0A \\xF0\\x9F\\x98\\xB1 FALHA $nomeIntegrador \\xF0\\x9F\\x98\\xB1%0A=====================%0APor Favor Resolva a imagem abaixo!%0AResponda: /resp SoLuCao\");\n\t\t$this->enviaImagem();\n\t\t$this->monitoraRespostaImagem();\n\t}", "function logo ()\n {\n global $connection;\n $sql = \"SELECT * FROM slike_logo sl ORDER BY sl.putanja_logo DESC LIMIT 0,1\";\n $sum = $connection->query($sql)->fetchAll();\n foreach($sum as $item) :\n echo \"<a href='index.php?page=pocetna'><img src=$item->putanja_logo alt=$item->ime_slike title='NanoSoft DeLux' width='177' height='106'/></a>\";\n endforeach;\n }", "public function showImage()\n {\n }", "function Display_Photo($Nom, $Prenom, $id, $Font_Size)\n{\n\tif(!isset($Font_Size)) {\n\t\t$Font_Size=\"1\";\n\t}\n\t\n\tif (file_exists(\"Photos/Individu_\".$id.\".jpg\")) { \n\t\tif ($Prenom == \"NO LINK\"){\n\t\t\techo '<A HREF='.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].' class=\"tooltip\"><FONT SIZE=\"'.$Font_Size.'\">'.$Nom.'</FONT>';\n\t\t\techo '<em><span></span>';\n\t\t\techo \"<img src='Photos/Individu_\".$id.\".jpg' height='100' border='1' alt='Paroissien_\".$id.\"'>\";\n\t\t\techo '<br><font face=verdana size=1>'.$Nom.'</font>';\n\t\t\techo '</em></A>';\n\t\t} else {\n\t\t\techo '<A HREF=/SuiviParoissien.php?action=edit_Individu&id='.$id.' class=\"tooltip\"><FONT SIZE=\"'.$Font_Size.'\">'.$Prenom.' '.$Nom.'</FONT>';\n\t\t\techo '<em><span></span>';\n\t\t\techo \"<img src='Photos/Individu_\".$id.\".jpg' height='100' border='1' alt='Paroissien_\".$id.\"'>\";\n\t\t\techo '<br><font face=verdana size=1>'.$Prenom.' '.$Nom.'</font>';\n\t\t\techo '</em></A>';\n\t\t}\n\t} else {\n\t\tif ($Prenom == \"NO LINK\"){\n\t\t\techo '<A HREF='.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'>';\n\t\t\techo '<FONT SIZE=\"'.$Font_Size.'\">' .$Nom. '</FONT> ';\n\t\t\techo '</A>';\n\t\t} else {\n\t\t\techo '<A HREF=/SuiviParoissien.php?action=edit_Individu&id='.$id.'>';\n\t\t\techo '<FONT SIZE=\"'.$Font_Size.'\">' .$Prenom. ' ' .$Nom. '</FONT> ';\n\t\t\techo '</A>';\n\t\t}\n\t}\n}", "function mostrar_producto_img(){\n\t\tif (isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$sql=\"SELECT * FROM producto WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t$resultado = mysql_fetch_array($consulta);\n\t\t\t$id=$resultado['id_pro'];\n\t\t\t$sql2=\"SELECT directorio_image, nombre_image FROM imagen WHERE galeria_image='$id' AND tabla_image='producto'ORDER BY id_image\";\n\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\n\t\t\twhile ($resultado2 = mysql_fetch_array($consulta2)){\n\t\t\t\t$this->listado[]=$resultado2;\n\t\t\t}\n\t\t}\n\t}", "function displayImageInformation()\n {\n // query the number of saved images of the account\n $savedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'SAVED'\") or die(mysql_error());\n \n // query the number of deleted images of the account\n $deletedImagesQuery = mysql_query(\"SELECT image_id, path FROM argus_images WHERE account_id = '\".$this -> accountId.\"' AND status = 'DELETED'\") or die(mysql_error());\n \n // calculate the number of images\n $savedImagesCount = mysql_num_rows($savedImagesQuery);\n $deletedImagesCount = mysql_num_rows($deletedImagesQuery);\n $totalImagesCount = $savedImagesCount + $deletedImagesCount;\n \n // calculate the hard disk space the saved image has used\n $savedImagesFileSize = 0;\n \n for($i=0; $i<$savedImagesCount ; $i++)\n {\n // incrementally compute the file sizes of each saved images in Kilobytes\n // 1 KB = 1024 bytes\n $savedImagePath = mysql_result($savedImagesQuery,$i,\"path\");\n $savedImagesFileSize = $savedImagesFileSize + ((filesize($savedImagePath)) / 1024);\n }\n \n // calculate the hard disk space the deleted image has used\n $deletedImagesFileSize = 0;\n \n for($i=0; $i<$deletedImagesCount; $i++)\n {\n // incrementally compute the file sizes of each deleted images in kilobytes\n // 1 KB = 1024 bytes\n $deletedImagePath = mysql_result($deletedImagesQuery,$i,\"path\");\n $deletedImagesFileSize = $deletedImagesFileSize + ((filesize($deletedImagePath)) / 1024);\n }\n \n // compute the total disk space that is being used\n $totalImagesFileSize = $savedImagesFileSize + $deletedImagesFileSize;\n \n // display the images information\n echo \"\n <p>Image Information</p>\n <p id='box'>\n Saved Images : \".$savedImagesCount.\" (\".round($savedImagesFileSize,2).\" KB)<br>\n Deleted Images : \".$deletedImagesCount.\" (\".round($deletedImagesFileSize,2).\" KB)<br><br>\n Total Images : \".$totalImagesCount.\" (\".round($totalImagesFileSize,2).\" KB)<br>\n </p>\";\n \n return;\n }", "function cargar_imagenes($idc=null,$seccion){\r\r\n $html = \"\";\r\r\n if (!is_null($idc))\r\r\n $ims = zen_deserializar($this->padre->bd->seleccion_unica(\"imagenes from contenidos where idc=\".$idc)); \r\r\n else \r\r\n $ims = array();\r\r\n $n = count($ims);\r\r\n for ($i=0; $i<$n; $i++){\r\r\n\t $im = ZF_SITIO_WEB.'media/img/'.$seccion.'/'.$ims[$i];\r\r\n\t $html .= '<a href=\"'.$im.'\" target=\"_blank\"><img src=\"'.$im.\r\r\n\t \t'\" border=\"0\"></a>[<label for=\"borrar_'.$ims[$i].\r\r\n\t \t'\">borrar</label><input type=\"checkbox\" id=\"borrar_'.$ims[$i]\r\r\n\t \t.'\" name=\"borrar_'.$ims[$i].'\"/>]<br/>';\r\r\n }\r\r\n return $html;\r\r\n }", "public function ShowAirlineAction()\n {\n $em = $this->getDoctrine()->getManager();\n $Airline=$em->getRepository('MyAppEspritBundle:Airlinecompany')->findAll();\n $imgs=array();\n foreach ($Airline as $key => $entity)\n {\n if($entity->getPicture() == null)\n {\n $imgs[$key] = \"iVBORw0KGgoAAAANSUhEUgAAAoAAAAHgCAMAAAACDyzWAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAP9QTFRF8vLy2dnZ5ubm/Pz81tbW4ODg3t7e29vbsLCw5+fn0tLS7Ozs+fn539/fz8/PsrKy/f39/v7+u7u79fX1ra2tysrKyMjIw8PD6enpy8vLs7OzsbGx+/v7xMTEzs7O7+/v3Nzcrq6u6+vrtLS0uLi4rKysxsbGycnJurq6+vr64uLiwsLCzc3Ntra219fX9PT01NTU4eHh7u7utbW1vr6++Pj45eXl4+Pj0NDQwcHBubm5x8fHvb299/f38/Pz1dXV8fHxwMDA6Ojo9vb20dHR3d3dvLy82traxcXFr6+v2NjYt7e35OTkv7+/09PT7e3t6urq8PDwq6urzMzM////kkQrbAAAIOdJREFUeNrsnWlD2soChrNgpWyC1IqCQLV6lOJS64JV61672O1O/v9vuaxhJgyQPZnM+344xypkfTJPZslEMRAkwig4BAgARAAgggBABAAiCABEACCCAEAEACIIAEQAIIIAQAQAIggARAAgggBABAAiCABEACCCAEAEACIIAESSAuBTOo9jhLhOsbO+6a0EbOyv6DiOiLuUry5OvSq4dvnzFkcScROteuPHPSA0jLhJKbNU8acSAg0jLvR7cnHtVy24dvkeGkZ8169tAKFhJAj9OgAQGkYc5OHk7trwF0CjtgMNI/ZyXz0qGX4DCA0jfuvXIYDQMOKvfp0C2NMw+o4R3/TrGEBoGJmj36PqvbNvOC3RoGFkhn7vfj0YwQIIDSO+6dcVgIbRrELDiB/6dQkgNIxwcn138mCEAyA0jEykspQpGWEBaBiL0DDC6Hfptbtvui3JoGHEs369AAgNI5716wnAnoYXcOwRw7ipau6/7KUUg4aRrn4vTspGNABCw4gn/XoGsKvhNDQM/UYIIDQsdU4vrspGtABCwxJnc71TNKIGsKfhjzgX0G90AELD0G+0AELD0G+0AELD0uUgfebPgvwquY6hYZn0u/r10IgXgNAw9BstgNAw9BsxgF0Nr0HDiU9udfnQiCeA0LAEyW7Vi0ZcAYSGk6/f6ou/C/S7xDr+RKBh6Dc6AKFh6DdaAKHhxEZNn/u/0CBKK2g4idnb2P1iiAGgsQcNQ79RAggNQ78RAwgNQ7/RAtjV8GdoOCEJsjQJEBJoOCF5Dkq/AQMIDUO/0QJo7H2DhqHfCAGEhoVP4CdQEfwCQgJVWPA1ycAVufdtFxqGfqMDEBqGfiMGEBoWMiENawpFj92aPDQsWMKabSAkMKBh0fQb1uyjYZVM0DD0GymAQTeoIwLqN1QAoWFhEuobKcOsHEDDQuj37c9bI5kAQsPQb7QA9kb2QMPQb4QAQsPQb7QAQsMxzu3PtzUj6QD2nm9p4VzHMa/Sr8JfaRRdZNAw9BspgNAw9BstgAE+Zoq4Sz79FM2KoxqlAg3HKfrKfsOQC0BoGPqNFkBoGPqNGEDjDzQst36jBhAajkGU9zs1Q1YAoeHo9VttRnwBRHwA/nxqi6XhB2VzerLlU+hXLACF0vDtmVonc1JXz4R5ACtq/cYCQGE0/KX1SGzm8eOtCHv0Mb0Yg4sgBgciG38NF/8eEUd51Gox3yWdfDo2AKAQGta1DnGcdr4c532Kg35jA2DMNbzpAr9+nuJbJYmFfmMEYFfD9ZhqWEkR12kv7EG/YgAYVw0XW8RTCtk41qd2N2JzYcSoySCOGn44Il7zHDsPt9LPMRJMjA5MdituGs62iffUj2O1TzHSb9wAjJ2Gz4g/OYvRPsVJv7EDMF4aLuWJX1ksxmWnztNqzOp4Mbs/CeqVZG5aKoh/UeOxU8X6VtwqRbHrt8zFRcOviZ9ZLEG/YgAYFw3/a/sKIHkV/S7FTr8xBTAWGs51iM+5h35FAbCr4eWINVxS/eaPtKMdIXO4vJozAKAoGtaI/+lE2SL9Uj2I55mO6+DJaDX8pR0AgOQmsj2KqX7jDKCRW41Ow7VHEkiievwirvqNNYBRaviZBJRoukTO0gfxPctxfn4hKg2/JoElgl7YYmd90wCAbjV8mJQbwOHAhNBHSR9+XY31k3oxf4IrAg3XMiTAPIbcFRFr/QoAYAQafiaB5ibMEWcx168IAIauYY0EnOfweoXLVxexf1BegIeof4Sp4QYJPAth7ctZNRX/syvCU/wharhcDx5AEs71JIB+RQEwPA3vPZIwokG/YgHY1XA1jGKjmCLhpBL8rWz1RowzK8pEOmFouNQkYSXgntlSZqliAEDRNHweGn+kHeisaKLoVygADeMgYA2/kBDT/gP9igZgwBo+I+HmL/QrGoCBajhs/oKqCz+c3F0bADAwDadfksIfIUG8Ovn10lHJAICiadjHZ9Ad9cr5PUOfYPoVEcBANLx3QKJJxt9dEU2/QgLY07DPA4uVDIkq7XsfhXlfFUy/ggLos4ZreRJljvx6WrN0VL0X8GSKCKCfGr4+L5CIox77cTk9/Lp7MABgZBrWG5tnC47zdETikILqcLsrm4dJ0K/AABqbjIaV5zaRLI/nNeH1KzKAtIb3nomMqZvMXd+dPBgAMCoNH2aIpMkPrFtZypQMABiFhgtdDZ8WiLR5JbZ+RQewr+HiEZE490LrV3gAexrOyMwfqZ+JrN8EAGjcv/u8JjGAy+80wU+g6ABWVraqb2XF77/1pZUiAIw0z4R83f4gJ3+rb3YJ+QcAI01vKucNOTW8/OZDSI94AsCpKfVPhYwa7ur3bVCjWgGg7ejD0yGdhjfe7a6ZTYEAMHIAZdPwQL8AMD4Akv8k0vBIvwAwRgBKpGGmtAeAsQFQFg2zFxoAjA+AUmj4v62ltwQAxhNACTQ8UcoDwFgBmHQNT15gADBeAE4oKknhNbgDwJgBmGANb7x7P1m6A8DYAZhUDfMvLAAYPwCZhtok6xcAxhTABGqYq18AGFsAk6bhq+2LKX8BgPEEMFEa7ur3kgBAsQBMkIan6hcAxhrApGh4un4BYLwBTISGV7bSlwQAiglgAjT8bZZ+AWDsARRdw7P1CwDjD6DQGp6nXwAoAIBdDb/5kFD9AkAhABRVwyfbdzY+BQDjD2AkGv6dSqVeLXT/43L2rpVP8/ULAAUBkH6MMeg8/lio/LO8reP09u+CmvFfvwBQGADD0fDjq2xu+rbuHS/89le/AFAcAIPX8OKmjXf05v406/7pFwAKBGCwGk7d237tm76pzlnYzvef9ktrACgMgIFpuPPi8A1tOS3ji34BYKwAzMx9v0vz8/6P377f+FVczBFZyh75oF8AGCsAF218/qaqnZ75Oa3+7023UzT/ufGsXwAoHIDG3/VOsfbKt9Iv62WG8MZvjn5/OdwEACgWgMbpxVXZqPjyZq92S/e29SWNrRKv7Kd3CABMNoB9DRsVH/g7KHvf/tNFL/oFgEICaFTWH4ueXxJc2PRnDxqP7vULAMUEsKfh27o3/lIzW51r5c1NbVDzPtvcPNyb+dnnoX6/7xAAKAeAPQ17e8NXa2rlY+/Px4OO9eP11MKMfhKt3dPv/goBgNIAaFSWdt03Shca/IUWjz/OaGbM5P9MqbR8eXSnXwAoLoDG6b7rvuEjfmGmLMxtYKw/cd8rU7us7hAAKBeAxoLbvuEDXrdvTXu02W93PnFHePvzba4JAGUD8Kz3qisXGl7k9LzVzh3UadoLbAmaTz8ZRmkBAEoG4Gt3Q7Tyk9WPvZbDKnU7P0awtvJzcEd5DgClA9DFEK3WxHJKFRd9y/WzoqnfkdHvAaB8AA7eOOnldB+mXI5i+Gfqd5QXACgfgM403LT6t/jRfVvik66v7DMNOgsAUD4AnWj4wFr/uL7xNJhhf4etUJeaAFBCAG1r+Mba/vLHU3/erze/7q0F6g8AKCGANjXcsbQ/l1pe8Fv72ev7fbKUqbUMAJQQQFsabt9aSqumF/4u05/6fb8/LKXqYRsAygigDQ1rljWrXvi72z4Zed3SMXIPAKUEcK6GVbYCvHfjTb/fxmMULGZ/BoBSAjhHwx12ygP9xgf9jh4s2fNyGwgAEwPgTA1n2fqH6ot+RxZmR2kpAFBSAGdo+Nlze52p3/fvvs1pX8wDQEkBnKrhOnuf1vKi3y3OyOcmK+EOAJQVwCkaZmvAf3zU7zCvmRX8BYDSAsjV8COjyOu6n/odNjJ+YRSfAoDSAsjTMFMDKab81e+wMabmsh4CABMH4ISGj5gmQNfjXy62r2YNtGY2TgWAEgNo1fAx/bUv7vW7MfMDf+i1HAJAmQFkNXzk9vbMrn55N5oqAJQaQFrDzBwclSD0O8g5vZ5bACg3gGMNP9J3gHv1QPQ7qAkzkx0dAUC5ATQ1/OK5CfptdcvWtBuLbopaAJhYAIcavvZaAF68+Wrzk3QRWGsDQNkB7Gs4RX/nPCj9Dh9TotfVBIDSA9jT8AFdKtUD0+/gLpAubY8BIAAkZGMpM66EaI75+7D91cnHF6jtK3YAIAAkzeu7k4fRV5y+4mHts339Dkbd0G2BCwAQAJJNo3RUHY5VUYLU72Sv8z8ACABJbyR+ZajhhUD1O3jyhHZwHQBKD+BN/6MDDRcLgep3UA2hHz1ZBIDSAzicDKur4Xu71dKhfpfW/3PTaE2PTL0HgNIDaA6E6Wr4yYl+33wlrvKD2sIvAFB6AMdPTF7frb8NVr8DB9cc3gQCwCQD+Eh9/mH5zWqw+u2HngDkAABKDiC9yE27s2h9eLPs4anhM4ctgQAwyQDSI2Hy9mbRWtt9t+qBP6YhpgIAJQeQbhdODfqGVwPUby8dapW3AFByAKmjU6rPeG7YJ/1a6j3GKQCUHMDcJAwzNbz7ZtUrfwz0bQAoNYBtajS+Qg3RWg1IvxOPoDwCQKkB7DCVYGqk9HJA+rVWg1MAUGoA6QcytenPDfunX+uYQBUASg0g3S92bhkpvRqEfvsjEKmVPgFAqQFcZJsB2QeWlmf806+GwDwABIDDvLLWOGgNL/ukX2ux+xEASg3g00wbmtT5p99eUgAQAHJObpP33PCyz/oFgADQroJNDfupXygYANqshJgarjp/57V9AFEJkRtAukLKnxVmdft/y/7yh2YYADi3IZquh7xd8rkIpBuinwGg1ADSA6I3J/887BDx+SaQHoOIrji5AWzTB4pTCd71vRUagxEA4JSxeXuT+v1A9cP5p2HqoRAMx5IdwEPq83WefgPoCqFeyoQBqbIDSM9cf8DVr++dwfWZ2geAcgF4NqVNjvNKOb80TM9H+BcASg4g3SZXmT0c0C8N03PlfwSAkgP4m/p82bTtu901fqu0HxpuTLM+AJQQQEJNlFHqTNWvj6NSMTUHAJxWHr2a+1CcDxrG5EQAcFq3RO81wRvvPq/N/IJXDdNvJj4DgNIDSBdItTr5uv1h3jc8apieJ/8HAJQeQPqWzFDXbY078PJ4HN0Igyl6ASDTFL1ZnaNfHzRcoTbQ3vsKAWCyARyf34P0S8cmRq41zBS45wAQAJpv7sitLh86eFWhSw3TDd9GBgACwNEs0ZtbhS6JubZtlNxp+IvTRhgAmHgAmwP9DnqFHcxT7kbDdBXEVj8cAEw+gO29gX77eWg7wMm5hulmb7tvJQGACQeQvM5ujV/h5uRVDY41zBSAWQIAAWAvF2lqgMqpkyLQqYbpO0BbAxEAYPIBXNmq0oMC7XWPudMwg5JCACAA7PX9vl9jzFhy+MpW+7NWdug2QLvvSweAyQbwavuCfUzI7ktUXWj4L70W+7UdAJhcAFe20pcTlQP7ZZMzDR+U3K0EACYWwG9d/U42jxi60/em29Jwh35P63j0NQCUF8CBfgcj85nS6bBN/Ncww7i9gVgAMMkAjvQ7bAtkvlkhxG8NnzMr2CQAUHIAx/oddIecersNnKdh9gaw1gGAkgN4sn3H/oJddlF1TuAsDd8wLTB2e4EBYFIBXPlE63eQf+xqb4iPGn7cYxb+pQ0ApQbQot8hJGwhtfeb+KbhzjVbvB4RACgzgBP6HeSZuU0zTjPEJw13yux25QkAlBhAnn4nH5jslYFuLMzRcIYt/2yPggGAiQTw2/ef0x48an9hv1/7QXzQ8BF7/2dc1wGgxABO0S/3NtAoNolnDf+wLvOIAEBpAZyu32FrXdGyCI141PDHkmWJTwQASgvgznT9jp4PsfJy++hFw/Vj6za9EAAoLYAn27/mnu28dSE1Dxr+cWpdmos+PgCYEADn6XeYl4nFHGfcaXhnc2JRWQIAZQVwvn6HqUwsp3jedsFNp3pjXdCfNgCUFUA7+uU3B/abThx7WD00yicXbAtg1hV/ADABAK7sf9+xf8ZfOMt6eOWEmef+U8alzFLF4/0fAEwEgDvf91ecnPJ8ibO00482HySv5x/MVhxKw+cEAEoKoAP9jgRa4y2veLxo46ubOvWV8tVQw8UnAgDlBNCZfkf9t4f8Re5VmjPKwfrza0u/20jD10cEAMoJoFP9jvqFX09d7KH2zBmq9aieKTxz9zWcrRMAKCeAv7ZPXJ73xdqMRZfKf7SFhYXnVErt/u8sWy5O/2z56r2nVzsAQFEBPHOnX1PDt/7sQflo19OrHQCgqAAuuNSvmac9H7Z/wdH0HQAwQQB+c61fs1ZxX/K4+dmOs+k7AGBiANQvPeh3PJzU0+Erm1OwrbnXMAAUEkDl/dUK8SMHrm8FD5+dTt8BABMDYD79XCc+5eaPmw2//eF8+g4AmBAA9ZX9xhPxL0cV3dlWF7OpyaWs7b5bBYAyAKi836lpxNfU8w5MfNgquJm+AwAmBMCP6UXDZ/76A/w+/ivOX3np9jzjbvoOAJgMAPW1/UauSYLJwdntDAhLiqbOGfPnQsMAUCgAu/q9bdVJcGmn8mfZsrV9sHz8eiFla7WONQwAYwNgZmFu2u++PZIwkkmlUq96a8x3f3A0j4xTDQPA2AA4N2vv330jsc/a53cbADCJAF6mP60QEeJIwwBQFADvPPf9hhYnGgaAYgAohn5daBgACgHgZXprhYgU2xoGgCIAeLF9RQSLXQ0DwPgDKJZ+HWoYAMYeQOH060jDADDuAAqoXycaBoDxBrCr3w0ibGxoGADGGsC3VUH1O9bwVwAoLoAC69euhgFgfAEUW782NQwAYwug8Po1Nbz9FQCKB+DM05YcDQPAeALocFCTuBoGgLEEMDH6nVueA8BIU0y8fudpeAEARpp64vU7Z6/OAGCkOfA2nFN8DR8DwEjzIoN+Z1xa7T0AGGmupdDv9L17NgBgtGnKod9p5XsZAEac07rTEXSCa7i69V9yGmESAKBxPBbUbpL1y9Pwbx0ARp+/bUn0O6Hho5wBAGOQ244k+rVoeLFoAMBYRD8rEG8vOxBQw6nbJJy6ZABoGOXlz88peaIuHKUPDAAYm2iTr39Oeg6XV08BYDxiefOuJCl21jcBYBzycHJ3bciYsyRoWHwA76tHJUPOdDWcA4AR6/f30r0hbRKgYcEBlFa/idGw2ABKrN+kaFhkAEtH1XtD+hQLQmtYYACv704ewJ/oGhYXQOg3ERoWFUDol9Xw1iYAhH6hYVkArCxloN9kaFhEAEs3SxqIm9BwXUgNCwgg9JskDYsHIPSbKA0LB+BNFfqdpeEsAAwypxdXZXA2Iy+iaVgsACvr0G/CNCwUgNBv8jQsEIDQr10NVw8AoP/ZXO8UAVfiNCwMgKnqGchKoIYFARD6dZhzUTQsBoDQb2I1LASAB2noN6kaFgDA3OryIXhypeEfABD6hYbFBhD6TbaGYw4g9OtVw+kfANB9slt16DfZGg4YQGZaxZSqOWvM+1E9t7FobfSzQv1SjcfhVentMf9Bwli1Zr41eSlrKOaqLSdcoQ9j0gHsJdPwS78A0B6AhDynVQA4jt274nn6BYB2AVQOl3+tAEAz9m5J1PS5zUUDwHkAGsW35qsdACDJ2/je3sbuFwMA+gWgoVxsXwHA0W2gDf1+quuGYwBjWNtTY3JBKORy+ApvWQHMaM2J6z9Xaand5DV2I3LZtTcrqtqqcKvMSvc7zYrOA3DWhuiVpqpWcuOf2Qp5Q2v2NkXL0hDnep9r8Y9QWcv3N51frc9pvYXl5gKo9JfS1Br6vG1mtnPKoeleuN3F5RtcALu14b6GleGnKvo0APWsNjgWepIA7J6ALPuCPWVsJFLQzJ1V1JWt9OWQ2om5x3V19AUGQK3366ZlffTZzxbGR7kx/LllLlQrjDdFNY/IaHvVnJG33MJnM+MrizM/emt0s6HPUjCz2nzZcsDy5jZXeNuZyU6atpwaNnflJhXc+39fw0p5uO2FLBfAXH68Uc1cogDUmbPYYr2cKo/O3bd379fGv2YPgZ4anyD6yOmZ4WL5AOZN9rvUZa03o+UMuynDM9EYXx7lArPp1FZwttEY40pSqekAWldbsdxYVKwbZPlCSrcA2DC3MqNzAexrOM+2R1gBzPI2KiEAGvRZbFrvDAv64HCebN9xDvPEqWWBSY1wmlIC0p+mfu7vvFLgLLAb6nQXmG9Y+Ov+mSUwy9vICQD1Ard9arzj1naDnPULKZ0FMMXuAQfAkYapQ24BcGLbWwkFUONXjvW2qV9unbkwBUDzc1NO+JTkuSAMTrjC/YYyWXZP3OA1bQGo8VfLXWvF4O6NavCXM6jn8QAcapj3hz6AuQJ3j5MH4PisqwX6+OdH+i3wmyyog19gABzduU054RmqdKAWrdLnifpMnjl/1Bd6p0MfFzkFbuP6+OOpzHQAM5Mf0pg9pL6sMReEysDB386pAJLL9U8r1HJZAM1rq5By0GYhIICN8V7nqOO0+O7OlEOF805w+mgxRy7HXZ9K3ROlKM5NkRcMw/xDd5V5+stN6gvMuTQ3rDnejeaUfaYuNCuA1NYXqKWM+aPKe5W++2jRW8DcA47/0LuYpwDYKl6aGp4AsDA+6KmQ3skeDYAadWzMC/18531m/GmF4wCmR5PbgMUHUKOvbfpGh/qGavm9SpHArLc50fwzrZjWZjRE07unco7RxJdT4y8o/IJOZ7dzCoBd/ZgatgJYphashdQ+GCKAufExaHIO/7cloquBAagRzqIJdcwtv2fOPrNelQegEjiAhAegTnNm2ATQIJfpQaO0FUCFB6CaGACpYk+dPPwn24/jQ54KDUDFMYDEXwAb9gDMcQFU3AE4qg1bAdQSDGBBzVA3KBMArnxKX6oG/fuyOkw5AgAVpwBqrgHs/qE13NPWjC8rvgI4rA3bApAkA0A6DGj9m5ud7z/X+qfC5LXB79EMFMBGiACO69JN3c4NpN8A9jUsKYApBsDeETh588taDeB2AwULoN50BiCn98Q+gFQ7dyEbBYA9DatTAWTLi4QBSB9vJT/Qr7W3rt8alwsBQKrnP0PCBJBuzs5kIwCwq+EugRICOO7a0LOmfkfniO1l0PSwACznC5bm/6ABZDsdUkoEAJJXuxvHsgFYMLu3c4NzfrL9i65usb29llvBoADMpib7n4IG0Ciz3V7DW8FQAdT09vqGJAAW1P7AN3N1ucEN18r+9x22vt+afmYDAjDL7QANHMCJ0S3l8AE0jGezbzjhAFpak4a1ja5+j1KWjyiZqQOCggCQO8LLbi149j7PAdDQ2YutP4gqbACVUaO0tRYcVqIBMDdqfP5lGbM5GOJWmBimFRyA445hRQkZwG4hqFqL0dAB7NWGv0kHYGWk3+5Vzxm1ruf5leYgACyMi1rnAGpeFDwY9pphB1GFD+BoiJYVwEQrON/X7/7KxDkyNyvFGxIZAIC5aecvJAANnbrx0qMBcNA3LBWA3UP7a/tk8kxr4x/znG9G0hWXotvH/QOQ6nQsTFl6aAD2NSwXgKPa73QAcxEDOL4LKLNdJL4DyDzyFA2APQ2vyQTgY0+/swE0IgaQ3yShUDeNvgGo2QCw7OdwLN4IrMtPG3sVWQDMvznh32zFCMDyNAC5S20EDSB/PKDhH4DkhXx64W1gKnEA6iv7HaqKyxNNhuoWnlIJ0X0GMGM5S/xHmhRmbPx4YG15CoDTH8tUx0egxauEtCwAFsasKzQbTgHMskeO7gs+T1+Nt8S8AJtJA/D2/WVNHXdAlacMmtY4LdHjzzaNis8A0uO0+wBSnbVMC3V23HBsfoR5cod6PLdMpgKYN49AbtQSU6B3oLt0piGgOd51+hJwDCB95LKW0TBfloaN0t2D3uKNHUkCgPn0E+/JxuFHMpO/zs0bXugJQH2aacetkZkGO/KZs40VSxWfv3MMgFn+MI2pe8h72jjnAkDLbrIPJf0dNkpb+2eSA2BXvw1jxrPbGve3ZlK+A8jDyRxhrzc0rT8NC/OHBm+EI5WWLQB1/iO406+HyQ3t35x4AdCYeDA9dUc/N2y9uxUfQOX9Ts2wHH22IdpafBTKEz0owz/4BKDG2ZJ+JUQZJmcFcIIwy8wIdPVl+mOZk0xYpnZge0g4taIB9k4BzLAAWwDMFcy+4Yk78AQA+DG9yA5G6B12bdZomIzlqdRxz23Z98EIhTK3sttiH1fsXweFyWEskyMtevdPDkbDtCw1mKy1PLbMIZLXXQFYNve3P7WHdW6YnLpGazj4OdvCnJxooN/hegdno6BNPH6VG48NzWgTNyDDgQrdo+/XcKzRnFNqmSnoxo+nZBWzAlAw+89MeHizYw07eLtLnN0VR41DbCoTVejhSIXxNUit1fy8UwAz5iFs6YbBm55NaZoazofwgsjwXtMw0q85IiarTZkXzyh37726f+RODta7L/N75jpleKvHL8b4t5u5Gds4WKKduc10pdJdSkXhtuEY5e4f2e3KKRr7eTeZewjv97+2vK4kdgCO9StGeJMWpYKfsjFE+c3aefLpOKxyKXF75FcaUfAXEwBDLC9CKmc/7+wZoqVhafhohTFlbVwANL7sbuwlBkDR9GveBzYL5iMtlXCmQNdGifwdaiFJS0nMngR1gHrRDRkTSrkRPIBhleWI/3CEcOoCB/A8reJMipoQ5KUIvweI0BoOFkDoNwEa/rYnLIDQLzQcIYDF+lYW5w8ajgrAL8sbOZy8ZGj4c3AaDgxA6BcajhBA6BcajhLAw+VV6DdpGg6mOz8QAM/SBzhj0HBUAEK/0HCUAEK/ydXwe/817DuA0C80HCGAxc76Js4TNBwVgIdXH05xkpKu4VpsAYR+ZdDwmq8a9hFA6BcajhLA8tUF9AsNRwagVr3BmZFHw/vH8QKw+Aj9QsPRAQj9QsNRAgj9yqjhFV807AOApcxSBecDGo4KwPLJxTVOBjQcFYDQr9wabkQLIPQLDUcJ4MPJHfQLDUcG4H31qIRTAA03ogEQ+kX6WfCiYfcAQr+IDxp2DSD0i/ihYZcAlo6q9zjuyFjD1cUwAXy4+/WAg474oGFXAEK/iF8adgEg9Itwk3ejYecAXt+dQL+IXxp2DGBlKQP9Ir5p2CGApaOl1zjOyHQNp5tBAgj9Ij5r2BGA0C/it4adAHhT1XB8ERsafgoCwNOLqzIOLuKzhm0DCP0iQWjYLoDQLxKIhu0BCP0iDnNrU8O2ANxc7xRxSJEgNGwHQOgXCUzD8wGEfhHXGr6seQYQ+kWC1LCCo4REGQCIAEAEACIIAEQAIIIAQAQAIggARAAgggBABAAiCABEACCCAEAEACIIAEQAIIIAQAQAIggARAAgggBABAAiiK38X4ABAJQhP9nQvpVSAAAAAElFTkSuQmCC\";\n }\n else\n {\n $imgs[$key] = base64_encode(stream_get_contents($entity->getPicture()));\n }\n\n\n }\n\n return $this->render(\"MyAppEspritBundle:Ween/AirlineCompany:Showairlinecompany.html.twig\",array(\"airlines\"=>$Airline,\"images\"=>$imgs));\n\n }", "abstract public function show($img);", "function imagenes_disponibles($id_palabra) {\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "function extractIMGmisencache($text, $id, $link, $taille = 200){\n\t$valretour = \"\";\n\t$letexte = \"\";\n\t$doc = new DOMDocument();\n\t$doc->loadHTML($text);\n\t$list = $doc->getElementsByTagName('img');\n\tforeach ($list as $node) {\n\t\tif ($node->hasAttribute('src')) {\n\t\t\t$img_loc = $node->getAttribute('src');\n\t\t\t$filename = basename($img_loc);\n\t\t\t$extension = explode(\".\",$filename);\n\t\t\t// Si c'est un jpg on traite sinon suivant\n\t\t\tif (strtoupper(end($extension)) == \"JPG\"){ \n\t\t\t\t// loading image into constructor\n\t\t\t\t$image = new FastImage($img_loc);\n\t\t\t\tlist($width, $height) = $image->getSize();\n\t\t\t\t// echo \"dimensions: \" . $width . \"x\" . $height;\t\t\t\t\t\n\t\t\t\t// Si superieur au mini requis on sort c'est ok\n\t\t\t\tif ($width > $taille || $height > $taille){\n\t\t\t\t\t$valretour = miseenformeIMG($img_loc,$width,$height,$text);\n\t\t\t\t\t$query=\"INSERT INTO `\".MYSQL_PREFIX.\"MagFonctions_cache` (`id`, `urlimage`, `imgwidth`, `imgheight`) VALUES ('\".$id.\"', '\".$img_loc.\"', '\".$width.\"', '\".$height.\"');\";\n\t\t\t\t\tmysql_query($query);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Si pas d'image il faut que l'on force le texte\n\tif ( $valretour == \"\") { \n\t\t//$valretour = FunctionsMag::txtCHAP($text);\n\t\t// On memorise noimage dans la bdd pour ne plus faire de recherche\n\t\t// <div class=\"blog-content\">\n\t\tonchercheInPage($text, $id, $link, $taille = 200);\n\t\t//$query=\"INSERT INTO `\".MYSQL_PREFIX.\"MagFonctions_cache` (`id`, `urlimage`, `imgwidth`, `imgheight`) VALUES ('\".$id.\"', 'noimage', '0', '0');\";\n\t\t//echo $query;\n\t\t//mysql_query($query);\n\t\t$valretour = stripTAG(TruncateHTML::truncateChars($text, '200', '...'));\n\t}\n\treturn $valretour;\n}", "public function getImage();", "public function getImage();", "public function getImage();", "public function getImage();", "function imagenes_disponibles_tipos($id_palabra,$with_pictcolor,$with_pictnegro,$with_imagenes,$with_cliparts) {\n\t\t\t\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\n\t\t$with_pictcolor\n\t\t$with_pictnegro\n\t\t$with_imagenes\n\t\t$with_cliparts\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "public function itemFullInfo(){\n // $img = $this->itemImg;\n\n // if ($img) {\n // $this->img_path = $this->itemImg->img_path;\n \n // }else{\n // $this->img_path = \"/images/default_bg.jpg\"; \n // }\n\n // if (file_exists('.'.$this->img_path)) {\n \n // }else{\n // $this->img_path = \"/images/default_bg.jpg\";\n // }\n\n if (file_exists('./images/products/thumb/'.$this->item.'.jpg')) {\n\n $this->img_path = \"/images/products/thumb/\".$this->item.\".jpg\";\n }else{\n $this->img_path = \"/images/default_bg.jpg\";\n }\n \n if (file_exists('./images/products/large/'.$this->item.'.jpg')) {\n\n $this->big = \"/images/products/large/\".$this->item.\".jpg\";\n }else{\n $this->big = \"/images/default_bg.jpg\";\n }\n return $this;\n }", "function filets_creer_icone_barre($file, $num=-1) {\n\tstatic $icones_barre;\n\trep_icones_barre($icones_barre);\n\tdefine_IMG_GD_MAX_PIXELS();\n\t// la config \"Methode de fabrication des vignettes\" doit etre renseignee pour 'image_reduire'\n\tif($num<0) {\n\t\tlist($w) = @getimagesize($file);\n\t\t$file = filtrer('image_recadre', $file, floor($w/4), 40, '');\n\t\t$file = filtrer('image_reduire', $file, 19, 19);\n\t\t$file = filtrer('image_recadre', $file, 16, 16, 'left');\n\t} else {\n\t\t$file = image_typo(\"_{$num}_\", 'couleur=00BFFF', 'taille=9', 'police=dustismo.ttf');\n\t\t$file = filtrer('image_recadre', $file, 16, 10, 'bottom');\n\t}\n\t$nom = basename($src = extraire_attribut($file, 'src'));\n\t@copy($src, $icones_barre.$nom);\n\treturn $nom;\n}", "function RellenarImagenesDeLaMinuta($texto, $dir_img)\r\n {\r\n $this->Imprimir($texto, 20, 10, 12);\r\n\r\n $this->Cell(22);\r\n\r\n $this->Cell(155, 98, '', 1, 0, 'C');\r\n\r\n $this->Image(sfConfig::get('sf_web_dir') . '/' . $dir_img, 33, $this->GetY() + 1, 153, 95);\r\n }", "function showRegDet($data, $paso){\n include '../library/libcon.php';\n\n $sql = \"SELECT id, nombrecompleto, concepto, direccion, telefono1, telefono2, latitud, longitud, regionsalon, instagram, url_img, url_img_thumb FROM web_salones WHERE REGIONSALON = '\".$data.\"' AND ESTADO NOT IN (0, 3);\";\n $result = (array) json_decode(miBusquedaSQL($sql), true);\n $salon = '';\n\n foreach ($result as $r) {\n $miniatura = $r[\"url_img_thumb\"];\n\n if($miniatura == \"\"){\n $miniatura = \"13thumb.jpg\";\n }\n $salon .= '<li class=\"item col-md-3 col-sm-6 marginbt10\">\n <figure class=\"icon-overlay\"><a href=\"#0\" data-type=\"slide-portfolio-item-1\" data-sid=\"'.$r[\"id\"].'\" data-tipo=\"1\"><img src=\"/c/img/salons/'.$miniatura.'\" alt=\"\" /></a></figure>\n <div class=\"slide-portfolio-item-info box\">\n <h4 class=\"post-title\">'.$r[\"nombrecompleto\"].'</h4>\n <div class=\"meta marginbt0\">'.cambiarRegion($r[\"regionsalon\"]).'</div>\n </div>\n </li>';\n }\n\n \n\n $pais = cambiarRegion($data);\n\n $dos = '<div class=\"dark-wrapper mb50\" id=\"ubicaciones\">\n <div class=\"container inner2\">\n <h3 class=\"section-title text-center mt10\">Ubicaciones</h3>\n <div class=\"divide30\"></div>'.$salon.'\n </div>\n </div>';\n\n $msg = '<h2 class=\"fondobuscar\">'.$pais.'</h2>\n <div class=\"col-md-12\">\n <div class=\"col-md-6\">\n <h3>Listado de Salones:</h3>\n </div>\n </div>'.$dos;\n\n\n\n\n return $msg;\n}", "function upImagenAction(){\n\t\t\n\t\t$request = $this->get('request');\n\t\t\n\t\t$estetica=$request->request->get('id');\n\t\t$img=$request->request->get('img');\n\t\t\t\t\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t$hcEstetica = $em->getRepository('HcBundle:Hc')->find($estetica);\n\t\t\n\t\t\t\t\n\t\tif($hcEstetica){\t\t\n\t\t\t$ruta = $this->container->getParameter('dlaser.directorio.imagenes');\n\t\t\t\n\t\t\tif ($img) {\n\t\t\t\t\n\t\t\t\t$imgData = base64_decode(substr($img,22));\n\t\t\t\t\n\t\t\t\t$file = $ruta.'grafico_'.$estetica.'.png';\n\t\t\t\t\n\t\t\t\tif (file_exists($file)) { unlink($file); }\n\t\t\t\t$fp = fopen($file, 'w');\n\t\t\t\tfwrite($fp, $imgData);\n\t\t\t\tfclose($fp);\n\t\t\t\t\n\t\t\t\t$response=array(\"responseCode\"=>200, \"msg\"=>\"La operación ha sido exitosa.\");\n\t\t\t}\n\t\t}else{\n\t\t\t$response=array(\"responseCode\"=>400, \"msg\"=>\"Ha ocurrido un error al crear la imagen.\");\n\t\t}\n\t\t\n\t\t$return=json_encode($response);\n\t\treturn new Response($return,200,array('Content-Type'=>'application/json'));\n\t}", "public function image();", "public function image();", "function image() {\n echo json_encode(array('element' => '<img src=\"msbienvenuebackground.png\" alt=\"Welcome\">'));\n exit;\n }", "function show_image()\n\t{\n\t\tif ( $this->ipsclass->input['rc'] == \"\" )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\n\t\t// Get the info from the db\n\t\t\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t \t\t\t\t 'from' => 'reg_antispam',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"regid='\".trim($this->ipsclass->txt_alphanumerical_clean($this->ipsclass->input['rc'])).\"'\"\n\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\t\t\t\t\t \n\t\t$this->ipsclass->DB->simple_exec();\n\t\t\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Using GD?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->vars['bot_antispam'] == 'gd' )\n\t\t{\n\t\t\t$this->ipsclass->show_gd_img($row['regcode']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Using normal then, check for \"p\"\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $this->ipsclass->input['p'] == \"\" )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$p = intval($this->ipsclass->input['p']) - 1; //substr starts from 0, not 1 :p\n\t\t\t\n\t\t\t$this_number = substr( $row['regcode'], $p, 1 );\n\t\t\t\n\t\t\t$this->ipsclass->show_gif_img($this_number);\n\t\t}\n\t}", "public function getImage() {}", "function kdw_row_tiles_txt_img (){ \r\n \r\n}", "public function displayImgTag() {\n $urlimg = \"/plugins/graphontrackers/reportgraphic.php?_jpg_csimd=1&group_id=\".(int)$this->graphic_report->getGroupId().\"&atid=\". $this->graphic_report->getAtid();\n $urlimg .= \"&report_graphic_id=\".$this->graphic_report->getId().\"&id=\".$this->getId();\n \n \n echo '<img src=\"'. $urlimg .'\" ismap usemap=\"#map'. $this->getId() .'\" ';\n if ($this->width) {\n echo ' width=\"'. $this->width .'\" ';\n }\n if ($this->height) {\n echo ' height=\"'. $this->height .'\" ';\n }\n echo ' alt=\"'. $this->title .'\" border=\"0\">';\n }", "function amap_ma_get_entity_img($u, $namecleared) {\n if (!$namecleared)\n return false;\n\n if (elgg_instanceof($u, 'user') || elgg_instanceof($u, 'group')) {\n $entity_img = elgg_view('output/img', array(\n 'src' => $u->getIconURL('tiny'),\n 'alt' => $namecleared,\n 'class' => \"mapicon\",\n ));\n } else if (elgg_instanceof($u, 'object', 'agora')) {\n $entity_img = elgg_view('output/url', array(\n 'href' => \"agora/view/{$u->guid}/\" . elgg_get_friendly_title($namecleared),\n 'text' => elgg_view('agora/thumbnail', array('classfdguid' => $u->guid, 'size' => 'tiny', 'tu' => $u->time_updated)),\n 'class' => \"mapicon\",\n ));\n } else if (elgg_instanceof($u, 'object', 'page') || elgg_instanceof($u, 'object', 'page_top')) {\n $entity_img = elgg_view('output/img', array(\n 'src' => $u->getIconURL('tiny'),\n 'alt' => $namecleared,\n 'class' => \"mapicon\",\n ));\n }\n return $entity_img;\n}", "public function ausschnittAction() {\n\t\tif (!isset($this->session->image)) {\n\t\t\t$this->session->image = array();\n\t\t}\n\n\t\t$dirtyIndex = intval($this->getParam(\"image\"));\n\t\t$galery = Zend_Registry::get('galery');\n\t\tif (isset($galery['filesAbs'][$dirtyIndex])) {\n\t\t\t// save image properties in session\n\t\t\t$this->session->image['index'] = $dirtyIndex;\n\t\t\t$this->session->image['pathRel'] = $galery['filesRel'][$dirtyIndex];\n\t\t\t$this->session->image['pathAbs'] = $galery['filesAbs'][$dirtyIndex];\n\t\t\t$this->view->assign(\"dimensions\", Zend_Registry::get('dimensions'));\n\t\t\t$this->view->assign(\"imagePath\", $this->session->image['pathRel']);\n\t\t} else {\n\t\t\t$this->_helper->redirector->gotoUrl('/');\n\t\t}\n\t}", "public function getImages($idAnuncio){\n\t\t$query = \"SELECT fi.idImagen, fi.small, fi.medium, fi.big FROM final_imagen fi WHERE idAnuncio = '\".$idAnuncio.\"'\"; \n\t\treturn $this->con->action($query);\n\t}", "function Footer() {\n $this->SetFont('Arial','I',8); \n $this->Image('../img/imagen.jpg',20,250,180,10);//Izquierda a derecha, posicion, Ancho, Alto;\n\n \n }", "private function ShowSingleImage()\n\t{\n\t\t//Abfrage und überprüfung der Bild-ID \n\t\t$imageId = functions::GetVar($_GET, 'id');\n\t\tif(!is_numeric($imageId))\n\t\t{\n\t\t\tfunctions::Output_fehler('Es wurde keine g&uuml;ltige ID &uuml;bergeben!');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Javascripts für den Filebrowser importieren\n\t\tJsImport::ImportSystemJS('filebrowser.js');\n\t\tJsImport::ImportSystemJS('ajax_queue.js');\n\t\tJsImport::ImportSystemJS('ajax_file_browser_client.js');\n\t\tJsImport::ImportModuleJS('galerie', 'galerieFileBrowser.js');\n\t\tJsImport::ImportModuleJS('galerie', 'galerie.js');\n\t\tFunctions::RunJs('radioBoxChange();');\n\t\t\n\t\t//Initialisieren der Datenablagerung\n\t\t$daten = array();\n\t\t\n\t\t//Abfragen der Informationen zu dem Bild\n\t\ttry \n\t\t{\n\t\t\t$daten = SqlManager::GetInstance() -> SelectRow('modgaleriebilder', $imageId);\n\t\t}\n\t\tcatch (SqlManagerException $ex)\n\t\t{\n\t\t\tFunctions::Output_fehler($ex);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Verarbeiten der Daten\n\t\ttry \n\t\t{\n\t\t\t$daten['preview'] = FILEBASE . Filebase::GetFilePath($daten['pfad_k']);\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\tFunctions::Output_warnung('Der Pfad zum Preview-Bild konnte nicht ermittelt werden!');\n\t\t}\n\t\ttry \n\t\t{\n\t\t\t$daten['pfad_g'] = Filebase::GetFilePath($daten['pfad_g']);\n\t\t}\n\t\tcatch (Exception $ex)\n\t\t{\n\t\t\tFunctions::Output_warnung('Der Pfad zum Bild in Normalgr&ouml;sse konnte nicht ermittelt werden!');\n\t\t}\n\n\t\tif($daten['path_sg'] !== null)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\t$daten['original']['path'] = Filebase::GetFilePath($daten['path_sg']);\n\t\t\t}\n\t\t\tcatch (Exception $ex)\n\t\t\t{\n\t\t\t\t$daten['original']['path'] = 'unbekannt';\n\t\t\t\tFunctions::Output_warnung('Der Pfad zum Bild in sehr grossen Bild konnte nicht ermittelt werden!');\n\t\t\t}\n\t\t\t$daten['original']['filesystem'] = ' checked=\"checked\"';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$daten['original']['delete'] = ' checked=\"checked\"';\n\t\t}\n\t\n\t\t//Link zum speichern der Bild-Informationen\n\t\t$gid = 0;\n\t\ttry \n\t\t{\n\t\t\t$gid = SqlManager::GetInstance() -> SelectItem('modgaleriebilder', 'gallerieId', 'id=\\''. $imageId .'\\'');\n\t\t}\n\t\tcatch (SqlManagerException $ex)\n\t\t{\n\t\t\tfunctions::Output_fehler($ex);\n\t\t}\n\n\t\t\n\t\t$daten['galerie'] = functions::Selector('modgalerie', 'name', $daten['gallerieId']);\n\t\t$daten['savelink'] = functions::GetLink(array('action' => 'savesingleimage', 'id' => $imageId, 'gid' => $gid), true);\n\t\t\n\t\tfunctions::Output_var('galerie', $daten);\n\t}", "public function Getimg($idAseguradora)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//ECHO strtolower($idAseguradora);\r\n\t\t\tswitch (strtolower($idAseguradora) ) {\r\n\t\t\t\tcase \"169159ad-d55a-467b-9efd-2b7139ecc730\": //ANDI ASISTENCIA SA\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Mafre.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"ae7c4aa0-bcba-4804-b2aa-3496c4edc5f7\": // CORIS SA\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Coris.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"715697a2-f643-4d5b-ac49-83b11e8546b0\": // UNIVERSAL\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/UniversalAssistance.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"b2ff47cf-50d3-4803-992d-9ee57d9fe736\": // EDUCAMOS VIAJANDO LTDA(SAFEST)\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Safest.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"4e04d2c4-5c91-46e4-99dd-e992638da6f8\": // ASSIST CARD\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/AssistCard.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"8528cc83-53f7-4330-aaed-ef0a5ad2b08f\": // CHARTIS COLOMBIA SEGUROS GENERALES SA(TRAVELGUARD)\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/TravelGuard.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"db7a54c0-bf90-4508-9528-f7c6af83357b\": // QUALITAS ASSISTANCE SAS\r\n\t\t\t\t\techo \"<img src=\\\"tpl/img/Partners/Qualitas.png\\\"/>\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function imagenes_por_palabra_y_tipo_imagen($id_palabra,$registrado,$estado,$id_tipo_imagen) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND imagenes.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($estado !='' && $estado < 4 && $estado > 0) {\n\t\t\t$sql_estado='AND imagenes.estado='.$estado.'';\n\t\t} elseif ($estado='all') {\n\t\t\t$sql_estado='';\n\t\t} else {\n\t\t\t$sql_estado='AND imagenes.estado=1';\n\t\t}\n\t\t\n\t\tif ($id_tipo_imagen==99) { $sql_tipo_imagen=''; } \n\t\telse { $sql_tipo_imagen='AND imagenes.id_tipo_imagen='.$id_tipo_imagen.''; }\n\t\t\n\t\t$query = \"SELECT palabra_imagen.*,\n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename\n\t\tFROM palabra_imagen, imagenes\n\t\tWHERE palabra_imagen.id_palabra='$id_palabra'\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\t$sql_tipo_imagen\n\t\t$mostrar_registradas\n\t\t$sql_estado\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function subirFotoElemento($campo, $tipo, $id, $refresh, $backdir) {\n\t\tif($_FILES[$campo]['type'] != 'image/jpeg' AND $_FILES[$campo]['type'] != 'image/gif' AND $_FILES[$campo]['type'] != 'image/png') {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'El formato de imagen no es válido, sólo se aceptan JPG, GIF o PNG';\n\t\t}\n\n\t\t//Obtengo las dimensiones de la imagen, si se puede entonces es una imagen de verdad y evito una shell en el server\n\t\t$check = getimagesize($_FILES[$campo]['tmp_name']);\n\n\t\tif($check == FALSE) {\n\t\t\t$error_img = TRUE;\n\t\t\t$msg = 'Seleccione una imagen válida';\n\t\t}\n\n\t\t//Si no hay ningún error, arranco la subida...\n\t\tif($error_img == FALSE) {\n\t\t\tif($_FILES[$campo]['type'] == 'image/jpeg') {\n\t\t\t\t$extension_img = '.jpg';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/gif') {\n\t\t\t\t$extension_img = '.gif';\n\t\t\t} elseif($_FILES[$campo]['type'] == 'image/png') {\n\t\t\t\t$extension_img = '.png';\n\t\t\t}\n\n\t\t\t$directorio_subida = $backdir . '../sitio/fotos/' . $tipo . '/ampl/';\n\t\t\t$directorio_subida_m = $backdir . '../sitio/fotos/' . $tipo . '/';\n\n\t\t\tif($img = glob($directorio_subida . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\tif($img = glob($directorio_subida_m . $id . '.*')) {\n\t\t\t\tunlink($img[0]);\n\t\t\t}\n\n\t\t\t$sin_punto = explode('.', $_FILES[$campo]['name']);\n\t\t\tmove_uploaded_file($_FILES[$campo]['tmp_name'],$directorio_subida . $_FILES[$campo]['name']);\n\t\t\trename($directorio_subida . $_FILES[$campo]['name'],$directorio_subida . $id . $extension_img);\n\n\t\t\t$modulo_variable_ancho_imagen_chica = 'modulo_' . $tipo . '_ancho_imagen_chica';\n\t\t\t$modulo_variable_alto_imagen_chica = 'modulo_' . $tipo . '_alto_imagen_chica';\n\t\t\t$modulo_variable_ancho_imagen_grande = 'modulo_' . $tipo . '_ancho_imagen_grande';\n\t\t\t$modulo_variable_alto_imagen_grande = 'modulo_' . $tipo . '_alto_imagen_grande';\n\t\t\t$modulo_variable_tipo_resize = 'modulo_' . $tipo . '_tipo_resize';\n\t\t\t$modulo_variable_watermark = 'modulo_' . $tipo . '_watermark';\n\t\t\t$modulo_variable_watermark_dir = 'modulo_' . $tipo . '_watermark_dir';\n\n\t\t\tglobal $$modulo_variable_ancho_imagen_chica;\n\t\t\tglobal $$modulo_variable_alto_imagen_chica;\n\t\t\tglobal $$modulo_variable_ancho_imagen_grande;\n\t\t\tglobal $$modulo_variable_alto_imagen_grande;\n\t\t\tglobal $$modulo_variable_tipo_resize;\n\t\t\tglobal $$modulo_variable_watermark;\n\t\t\tglobal $$modulo_variable_watermark_dir;\n\n\t\t\tif($_FILES[$campo]['type'] != 'image/gif') {\n\t\t\t\trequire($backdir . 'lib/Simpleimage/SimpleImage.php');\n\n\t\t\t\t$img = new \\claviska\\SimpleImage($directorio_subida . $id . $extension_img);\n\t\t\t\t$img->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t$img_thumb = new \\claviska\\SimpleImage($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\tif($$modulo_variable_tipo_resize == 'recortar') { //////////////////////////////////////////////////////////////Si está en modo recorte\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->thumbnail($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t} else { /////////////////////////////////////////////////////////////////////////////////////////////////////////Si está en modo proporcionar\n\t\t\t\t\tif($$modulo_variable_watermark == 1) { //Verifico si está activa o no la marca de agua\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->overlay($$modulo_variable_watermark_dir, 'center', '1')\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\n\t\t\t\t\t} else { //Si la marca de agua no está activa, no la pongo...\n\t\t\t\t\t\t//Ampliada\n\t\t\t\t\t\t$img\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_grande, $$modulo_variable_alto_imagen_grande)\n\t\t\t\t\t\t\t->toFile($directorio_subida . $id . $extension_img);\n\n\t\t\t\t\t\t//Miniatura\n\t\t\t\t\t\t$img_thumb\n\t\t\t\t\t\t\t->bestFit($$modulo_variable_ancho_imagen_chica, $$modulo_variable_alto_imagen_chica, 'center')\n\t\t\t\t\t\t\t->toFile($directorio_subida_m . $id . $extension_img);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($refresh == TRUE) {\n\t\t\t\techo refresh();\n\t\t\t}\n\t\t} else {\n\t\t\techo '<br><div class=\"alert alert-danger\"><strong>Error</strong> ' . $msg . '</div>';\n\t\t}\n\t}", "public function afficher_musique($id)\n{\n\n $db = $this->_db;\n $requete = $db->prepare(\"SELECT * FROM musiques WHERE id=$id\");\n $requete->execute();\n $resultat = $requete->fetchall();\n\n foreach($resultat as $musique)\n {\n $titre = $musique['titre'];\n $artiste = $musique['artiste'];\n $album = $musique['album'];\n $image = $musique['image'];\n\n echo\n \"<div class='card' style='width: 18rem;'>\n <img class='card-img-top' src='images-auto/$image' alt='Album $album'>\n <div class='card-body'>\n <h5 class='card-title'>Artiste :</h5><p class = 'anim'>$artiste</p>\n <h5 class='card-title'>Album : </h5><p class = 'anim'>$album</p>\n <h5 class='card-title'>Titre :</h5><p class = 'anim'> $titre</p> \n </div>\n </div>\";\n \n}\n}", "function getImagen(){\n\t\t\treturn $this->imagen;\n\t\t}", "function subir_imagenes($tipo,$imagen,$descripcion,$ruta,$size)\n\t{\n\t\t\t//return \"La imagen\".$tipo.\" No se subio\";\n\t\t\tif(strstr($tipo,\"image\"))\n\t\t\t{\n\n\t\t\t\tif(strstr($tipo,\"jpeg\"))\n\t\t\t\t\t$extension=\".jpg\";\n\t\t\t\telse if(strstr($tipo,\"gif\"))\n\t\t\t\t\t$extension=\".gif\";\n\t\t\t\telse if(strstr($tipo,\"png\"))\n\t\t\t\t\t$extension=\".png\";\n\t\t\t\t//para saber si la imagen tiene el ancho correcto es de 420px\n\t\t\t\t$tam_img=getimagesize($imagen);\n\t\t\t\t$ancho_img=$tam_img[0];\n\t\t\t\t$alto_img =$tam_img[1];\n\t\t\t\t$ancho_img_deseado=$size;\n\n\t\t\t\t//sii la imagen es maor en su ancho a 420px reajusto su tamaño\n\t\t\t\t\tif($ancho_img > $ancho_img_deseado)\n\t\t\t\t\t{\n\t\t\t\t\t\t//reajustamos\n\t\t\t\t\t\t//por una regla de tres obtengo el alto de la imagen de manera \n\t\t\t\t\t\t//proporciaonal el ancho nuevo que sera 420\n\t\t\t\t\t\t$nuevo_ancho_img = $ancho_img_deseado;\n\t\t\t\t\t\t$nuevo_alto_img=($alto_img*$nuevo_ancho_img)/$ancho_img;\n\t\t\t\t\t\t//CREO UNA IMAGEN EN COLOR REAL CON LA NUEVAS DIMENSIONES\n\t\t\t\t\t\n\t\t\t\t\t\t$img_reajustada=imagecreatetruecolor($nuevo_ancho_img, $nuevo_alto_img);\n\t\t\t\t\t\t//CREO UNA IMAGEN BASADA EN LA ORIGINAL DEPENDIENDO DE SU EXTENSION ES EL TIPO QUE CREARE\n\t\t\t\t\t\tswitch ($extension) {\n\t\t\t\t\t\t\tcase '.jpg':\n\t\t\t\t\t\t\t\t$img_original=imagecreatefromjpeg($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagejpeg($img_reajustada,$nombre_img_ext,100);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".jpg\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '.gif':\n\t\t\t\t\t\t\t\t$img_original=imagecreatefromgif($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagegif($img_reajustada,$nombre_img_ext,100);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".gif\");\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase '.png':\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$img_original=imagecreatefrompng($imagen);\n\t\t\t\t\t\t\t\t//REAJUSTO LA IMAGEN NUEVA CON RESPETO ALA ORIGINAL \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\timagesavealpha($img_reajustada, true);\n\t\t\t\t\t\t\t\timagealphablending($img_reajustada, false);\t\n\t\t\t\t\t\t\t\timagecopyresampled($img_reajustada, $img_original, 0, 0, 0, 0, $nuevo_ancho_img, $nuevo_alto_img, \n\t\t\t\t\t\t\t\t$ancho_img, $alto_img);\n\t\t\t\t\t\t\t\timagecolortransparent($img_reajustada);\n\t\t\t\t\t\t\t\t//Guardo la imagen reescalada en el servidor \n\t\t\t\t\t\t\t\t$nombre_img_ext=$ruta.$descripcion.$extension;\n\t\t\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\t\t\timagepng($img_reajustada,$nombre_img_ext,0);\n\t\t\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles del perfil\n\t\t\t\t\t\t\t\tborrar_imagenes($nombre_img,\".png\");\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t//no se reajusta y se sube\n\t\t\t\t\t\t$destino=$ruta.$descripcion.$extension;\n\n\t\t\t\t\t\t//Se sube la foto\n\t\t\t\t\t\tmove_uploaded_file($imagen,$destino) /*or die(\"No se pudo subir la imagen\")*/;\n\n\t\t\t\t\t\t//ejecuto la funcion para borrar posibles imagenes dobles para el perfil\n\t\t\t\t\t\t$nombre_img=$ruta.$descripcion;\n\t\t\t\t\t\tborrar_imagenes($nombre_img,$extension);\n\t\t\t\t\t}\n\t\t\t\t\t//Asigno el nombre que el que se guardara en la base de datos\n\t\t\t\t\t$imagen=$descripcion.$extension;\n\t\t\t\t\treturn $imagen;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \"La imagen\".$imagen.\" No se subio\";\n\t\t\t}\n\n\t}", "function ver_buscar_mapa($fid_string=\" \",$presenta=0,$idmapa=0,$intensidad){\n \n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/ver_mapa.html\");\n \n //echo \"intensidad : $intensidad\";\n \n if($intensidad>0){\n $plantilla->iniciaBloque(\"intensidad\");\n }\n \n $imapa = new imapa();\n \n $result1 = $imapa->get_mapa();\n \n $nombres = array();\n \n $count=0;\n \n $modo=0;\n \n $color=array(\"#B19CD9\",\"#FF6961\",\"#77DD77\",\"#CFCFC4\",\"#FDFD96\");\n \n $stroke=array(\"#966FD6\",\"#C23B22\",\"#03C03C\",\"#836953\",\"#FFB347\");\n \n while($mapa= mysql_fetch_array($result1)){\n $count++;\n \n $plantilla->iniciaBloque(\"mapa\");\n $plantilla->reemplazaEnBloque(\"idmapa\", $mapa[idgis_mapa],\"mapa\");\n $plantilla->reemplazaEnBloque(\"nombre\", $mapa[nombre],\"mapa\");\n \n if( $mapa[idgis_mapa]==$idmapa || ( $mapa[predeterminado]>0 && $idmapa==0 ) ){\n \n $plantilla->reemplazaEnBloque(\"selected\", \"selected\",\"mapa\");\n \n $plantilla->reemplaza(\"frontera\", $mapa[frontera]);\n $plantilla->reemplaza(\"enfoque\", $mapa[enfoque]);\n $plantilla->reemplaza(\"resolucion\", $mapa[resolucion]);\n $plantilla->reemplaza(\"proyeccion\", $mapa[proyeccion]);\n $plantilla->reemplaza(\"unidad\", $mapa[unidad]);\n\n $i=0;\n $nombre=\"\";\n $result2 = $imapa->get_capa_mapa($mapa[idgis_mapa]);\n while($capa= mysql_fetch_array($result2)){\n $nombre=$capa[nombre];\n $nombres[$nombre]=$nombre;\n if($modo>0){\n $plantilla->iniciaBloque(\"capa\");\n $plantilla->reemplazaEnBloque(\"i\", $i, \"capa\");\n\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"capa\");\n\n\n $plantilla->reemplazaEnBloque(\"proyeccion\", $capa[proyeccion], \"capa\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"capa\");\n }else{\n \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"capa\");\n }\n }else{\n $plantilla->iniciaBloque(\"gml\"); \n $plantilla->reemplazaEnBloque(\"i\", $i, \"gml\");\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"gml\");\n $plantilla->reemplazaEnBloque(\"color\", $color[($i%5)], \"gml\");\n $plantilla->reemplazaEnBloque(\"stroke\", $stroke[($i%5)], \"gml\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"gml\");\n }else{ \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"gml\");\n }\n } \n $i++;\n }\n $capas=\" \";\n\n foreach ($nombres as $nombre){\n $capas .= $nombre.\",\";\n }\n\n\n $capas = substr($capas, 0, -1);\n\n\n $plantilla->reemplaza(\"i\", $i);\n $plantilla->reemplaza(\"nombre\", $nombre);\n $plantilla->reemplaza(\"capas\", $capas);\n $plantilla->reemplaza(\"fid_string\", $fid_string);\n \n }\n \n \n }\n \n if($count==0){\n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/no_mapa.html\");\n }\n \n if($presenta>0){\n $plantilla->presentaPlantilla();\n }else{\n return $plantilla->getPlantillaCadena();\n }\n \n}", "function _get_ico_data() {\n\t\tif ( ! is_array( $this->_images ) || empty( $this->_images ) )\n\t\t\treturn false;\n\t\t\n\t\t\n\t\t$data = pack( 'vvv', 0, 1, count( $this->_images ) );\n\t\t$pixel_data = '';\n\t\t\n\t\t$icon_dir_entry_size = 16;\n\t\t\n\t\t$offset = 6 + ( $icon_dir_entry_size * count( $this->_images ) );\n\t\t\n\t\tforeach ( $this->_images as $image ) {\n\t\t\t$data .= pack( 'CCCCvvVV', $image['width'], $image['height'], $image['color_palette_colors'], 0, 1, $image['bits_per_pixel'], $image['size'], $offset );\n\t\t\t$pixel_data .= $image['data'];\n\t\t\t\n\t\t\t$offset += $image['size'];\n\t\t}\n\t\t\n\t\t$data .= $pixel_data;\n\t\tunset( $pixel_data );\n\t\t\n\t\t\n\t\treturn $data;\n\t}", "public function tratamientoImagenes($infoImage):bool{\n if($infoImage[\"refimgperfilusuarios\"][\"error\"]===UPLOAD_ERR_OK){\n $extencionesImagen = array(0=>\"image/jpg\",1=>\"image/png\", 2=>\"image/jpeg\");\n $typeImage = $infoImage[\"refimgperfilusuarios\"][\"type\"];\n $tamanioImagen = $infoImage[\"refimgperfilusuarios\"][\"size\"];\n $tamanioLimite = 1024*1024*8;\n if(in_array($typeImage, $extencionesImagen)){\n if($tamanioImagen<$tamanioLimite){\n return true;\n }\n }\n }\n return false; \n }", "function affiche_image_armure($image_armures, $nom_armure, $defense_armure, $description_armures,\n\t\t\t\t\t\t\t $BonusPerception_armures, $bonusPv_armure){\n\t\t\t\t\t\t\t\t \n\t$description_arme = $description_armures;\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t \n\techo \"<td width=50 height=50 align=center>\n\t\t\t<img tabindex='0' src='../images/armures/$image_armures' width=50 height=50 \n\t\t\t\t\tdata-toggle='popover' data-trigger='focus' data-html='true' data-placement='bottom'\n\t\t\t\t\ttitle=\\\"<b>$nom_armure</b>\\\" \";\n\techo \"\t\t\tdata-content=\\\"\t<div><img src=../images/armures/$image_armures></div>\n\t\t\t\t\t\t\t\t\t<div><u>Defense :</u> $defense_armure</div>\";\n\t\t\t if($BonusPerception_armures){\n\t\t\t\techo \"<div><u>Bonus Perception :</u> $BonusPerception_armures</div>\";\n\t\t\t }\n\t\t\t if($bonusPv_armure){\n\t\t\t\techo \"<div><u>bonus Pv :</u> $bonusPv_armure</div>\";\n\t\t\t }\n\t\t\t echo \"<div><b>Description</b></div><div>$description_armures</div>\\\" >\";\n}", "static function afficherGalerie ($chemin)\r\n {\r\n // LA FONCTION glob CONSTRUIT LE TABLEAU POUR MOI\r\n // $image = glob(\"./assets/img/*.jpg\");\r\n // https://www.php.net/manual/fr/function.glob.php\r\n $image = glob($chemin, GLOB_BRACE);\r\n\r\n foreach($image as $compteur => $element)\r\n {\r\n echo \r\n <<<x\r\n <img src=\"$element\" alt=\"$element\">\r\n\r\n x;\r\n }\r\n\r\n }", "function add_img_tour($type,$item,$file){\n\tif($type == 'belarus'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus.json';\n\t}\n\tif($type == 'belarus_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/belarus_pref.json';\n\t}\n\tif($type == 'foreigners'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners.json';\n\t}\n\tif($type == 'foreigners_pref'){\n\t\t$patch = '../../jsdb/JSON/tours/foreigners_pref.json';\n\t}\n\t$exItem = explode('%',$item);\n\t$type = $exItem[0];\n\t$tour = (int)$exItem[1];\n\t$object = json_decode(file_get_contents($patch));\n\t$object_item = $object[0]->$type;\n\t$folder = $object_item[$tour]->img;\n\tdo{\n\t\t$img = randomName(10);\n\t\t$extension = explode('.',$file['name']);\n\t\t$imgName = $img.'.'.$extension[1];\n\t} while(file_exists('../../'.$folder.'/'.$imgName));\n\tmove_uploaded_file($file['tmp_name'], '../../'.$folder.'/'.$imgName);\n\treturn true;\n}", "public function display_image($data) {\n global $ID;\n if (file_exists(mediaFN($ID))) {\n echo '<img class=\"proofreadpage\" alt=\"\" width=\"500\" src=\"' . ml($ID, array('w' => '500')) . '\" />';\n }\n }", "function mostrarImatgesPublica($idProducte){\n $conn=connexioBD();\n $llistaImatges=\"\";\n $sql1=\"SELECT * FROM imatges WHERE producte_id='$idProducte'\";\n if (!$resultado =$conn->query($sql1)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($imatges=$resultado->fetch_assoc()){\n $llistaImatges.=\"<img width=\\\"150px\\\" height=\\\"150px\\\" src=\\\"\".$imatges[\"ruta\"].\"\\\">\";\n }\n }\n return $llistaImatges;\n $resultado->free();\n $conn->close();\n}", "public function renderTagImage($result);", "public function buscaImagen($id){\n if(empty($id))\n return '';\n \n $sql = \"Select imagen from item where id=:id\";\n\t\t$db = Yii::app()->getDb();\n\t\t$cmd = $db->createCommand($sql);\n\t\t$nombre = \"$id\";\n\t\t$cmd->bindParam(':id', $id);\n\t\treturn $cmd->queryAll();\n }", "public function Information()\n {\n $this->imgInfo = list($width, $height, $type, $attr) = getimagesize($this->pathToImage);\n !empty($this->imgInfo) or self::errorMessage(\"The file doesn't seem to be an image.\");\n $mime = $this->imgInfo['mime'];\n\n if($this->verbose) {\n $this->imgInfo['filesize'] = $filesize = filesize($this->pathToImage);\n self::verbose(\"Image file: {$this->pathToImage}\");\n self::verbose(\"Image information: \" . print_r($this->imgInfo, true));\n self::verbose(\"Image width x height (type): {$width} x {$height} ({$type}).\");\n self::verbose(\"Image file size: {$filesize} bytes.\");\n self::verbose(\"Image mime type: {$mime}.\");\n }\n }", "public function getImagen()\r\n {\r\n return $this->imagen;\r\n }", "public function show_image() {\n\t $options = Request::get(\"params\");\n\t $img_id = Request::get(\"id\");\n\t $img_size = $options[0];\n \t$this->use_view=false;\n\t\t$this->use_layout=false;\n \tif(!$size = $img_size) $size=110;\n \telse{\n\t\t\tif(strrpos($size, \".\")>0) $size = substr($size, 0, strrpos($size, \".\"));\n\t\t}\n \t$img = new WildfireFile($img_id);\n $img->show($size);\n }", "protected function combineImages() {}", "public function showImageFromGet() {\n\n\t\t// $imageFilename = UniteFunctionsRev::getGetVar(\"img\");\n\t\t$imageID = intval( UniteFunctionsRev::getGetVar( 'img' ) );\n\t\t$maxWidth = UniteFunctionsRev::getGetVar( 'w',-1 );\n\t\t$maxHeight = UniteFunctionsRev::getGetVar( 'h',-1 );\n\t\t$type = UniteFunctionsRev::getGetVar( 't','' );\n\n\t\t// set effect\n\t\t$effect = UniteFunctionsRev::getGetVar( 'e' );\n\t\t$effectArgument1 = UniteFunctionsRev::getGetVar( 'ea1' );\n\n\t\tif ( ! empty( $effect ) ) {\n\t\t\t$this->setEffect( $effect,$effectArgument1 ); }\n\n\t\t$this->showImageByID( $imageID );\n\t\techo 'sechs<br>';\n\t\t// $this->showImage($imageFilename,$maxWidth,$maxHeight,$type);\n\t}", "function imagenes_disponibles_tipo($id_palabra,$id_tipo) {\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_palabra = '$id_palabra'\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\n\t\tAND imagenes.id_tipo_imagen='$id_tipo'\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "public function getImagen()\n {\n return $this->imagen;\n }", "public function getImagen()\n {\n return $this->imagen;\n }", "public function getImagen()\n {\n return $this->imagen;\n }", "protected function collectTcaSpriteIcons() {}", "public static function modifImage($fichier,$id){\r\n $im = ModelProgramme::getImage($id);\r\n $var = str_replace(\"images/\",\"\",$im);\r\n $fichier=\"images/\".$var;\r\n $fichier= str_replace(\" \",\"\",$fichier);\r\n $array = array(\r\n \"suppression\" => \"bar\",\r\n \"edit\" => \"foo\",\r\n );\r\n\r\n\r\n\r\n if (file_exists($fichier)) {\r\n if (@unlink($fichier)) {\r\n $array[\"suppression\"]=\"Suppression de $fichier réussite </br>\";\r\n } else {\r\n $array[\"suppression\"]=\"Echec de suppression de $fichier : $php_errormsg\";\r\n }\r\n } else {\r\n $array[\"suppression\"]=\"Le fichier $fichier n'existe pas </br>\";\r\n\r\n }\r\n\r\n // Vérifier si le formulaire a été soumis\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {\r\n // Vérifie si le fichier a été uploadé sans erreur.\r\n if (isset($_FILES[\"photo\"]) && $_FILES[\"photo\"][\"error\"] == 0) {\r\n $allowed = array(\"jpg\" => \"image/jpg\", \"jpeg\" => \"image/jpeg\", \"gif\" => \"image/gif\", \"png\" => \"image/png\");\r\n $filename = $_FILES[\"photo\"][\"name\"];\r\n $filetype = $_FILES[\"photo\"][\"type\"];\r\n $filesize = $_FILES[\"photo\"][\"size\"];\r\n\r\n // Vérifie l'extension du fichier\r\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\r\n if (!array_key_exists($ext, $allowed)) die(\"Erreur : Veuillez sélectionner un format de fichier valide.\");\r\n\r\n // Vérifie la taille du fichier - 5Mo maximum\r\n $maxsize = 5 * 1024 * 1024;\r\n if ($filesize > $maxsize) die(\"Error: La taille du fichier est supérieure à la limite autorisée.\");\r\n\r\n // Vérifie le type MIME du fichier\r\n if (in_array($filetype, $allowed)) {\r\n // Vérifie si le fichier existe avant de le télécharger.\r\n if (file_exists(\"upload/\" . $_FILES[\"photo\"][\"name\"])) {\r\n $array[\"edit\"]=$_FILES[\"photo\"][\"name\"] . \" existe déjà.\";\r\n\r\n } else {\r\n move_uploaded_file($_FILES[\"photo\"][\"tmp_name\"], \"images/\" . $_FILES[\"photo\"][\"name\"]);\r\n $array[\"edit\"]= \"Votre fichier a été téléchargé avec succès. \".$_FILES[\"photo\"][\"name\"];\r\n\r\n\r\n $adresse = \"images/\".$filename;\r\n $adresse = str_replace(\" \",\"\",$adresse);\r\n ModelProgramme::update($id,\"urlImage\",$adresse);\r\n }\r\n } else {\r\n $array[\"edit\"]= \"Error: Il y a eu un problème de téléchargement de votre fichier. Veuillez réessayer.\";\r\n }\r\n } else {\r\n echo \"Error: \" . $_FILES[\"photo\"][\"error\"];\r\n }\r\n\r\n }\r\n return $array;\r\n }", "function getImage($nr){ //vienaskaita, nes ieskai vieno id informacijos;\n $manoSQL = \"SELECT * FROM images WHERE id = $nr\"; //issigalvotas kintamasis, tiesiog stringas, gali bet koki teksta rasyti.\n $rezultatai = mysqli_query ( getPrisijungimas(), $manoSQL); // mysqli_query tiesiog ivykdo komandas; jei nori delete ar update, tai uztenka sios f-jos\n\n// print_r($rezultatai);\n $rezultatai_masyvas = mysqli_fetch_assoc($rezultatai); // cia objekta ideda i masyva; jei reikia gauti duomenis, tam reikia sios eilutes, kad gautus duomenis issaugoti.\n// print_r($rezultatai_masyvas);\n return $rezultatai_masyvas;\n}", "public function getAbsolutePicture();", "public function anchoFijo($ancho_Imagen){\t\t\r\n\t\t$this->ancho_imagen_copia=$ancho_Imagen;\t\t\r\n\t\t$this->alto_imagen_copia=(int)round($ancho_Imagen*$this->alto_imagen_original/$this->ancho_imagen_original);\r\n\t}", "function MiFoto($enlace, $cod_per)\n{\n $result = mysqli_query($enlace, \"SELECT foto_per FROM perfil where id_perfil = '$cod_per' \");\n while ($row = mysqli_fetch_row($result)) {\n /*almacenamos el nombre de la ruta en la variable $ruta_img*/\n //$img = $row[0];\n echo 'images/' . $row[0];\n }\n}", "function mostrarImatgesUsuaris($idProducte){\n $conn=connexioBD();\n $llistaImatges=\"\";\n $sql1=\"SELECT * FROM imatges WHERE producte_id='$idProducte'\";\n if (!$resultado =$conn->query($sql1)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($imatges=$resultado->fetch_assoc()){\n $idImatge=$imatges[\"id\"];\n $llistaImatges.=\"<img width=\\\"150px\\\" height=\\\"150px\\\" src=\\\"\".$imatges[\"ruta\"].\"\\\">\".\"<a href='borrarProducte.php?borrarImatge=$idImatge'>Borrar Imatge</a>\";\n }\n }\n return $llistaImatges;\n $resultado->free();\n $conn->close();\n}", "public function renderImageAction()\n {\n $config = \\Zend_Registry::get('configs');\n $path = $config['upload']['rodape']['destination'];\n\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n\n $params = $this->_getAllParams();\n\n $entity = $this->getService('Artefato')->findBy(array(\n 'sqArtefato' => $params['sqArtefato']\n ));\n $enderecoImagem = $path . '/' . $entity[0]->getDeImagemRodape();\n $dto = new \\Core_Dto_Search(\n array(\n 'resize' => true,\n 'width' => 120,\n 'height' => 120\n )\n );\n\n return $this->showImage($dto, $enderecoImagem);\n }", "public function excluirImagemGaleria(){ \n\t\t\n\t\t//deleta a imagem da pasta\n\t\tinclude_once(\"../funcoes/geral.php\");\n\t\t$sql = \"\n\t\t\tSELECT thumb\n\t\t\tFROM programa_imagem\n\t\t\"; \n\t\tif($this->idImagem)\n\t\t\t$sql .=\" WHERE id = '$this->idImagem'\";\n\n\t\t$this->sql = $sql;\n\t\t$this->qr = self::execSql($this->sql);\t\n\t\t$qtRegistros = $this->getQuantidadeData($sql); // retorna a quantidade de registro\t \n\t\tif($qtRegistros > 0){\n\t\t\twhile($lista = self::resultsAll($this->qr)){\n\n\t\t\t\tdeletaImagem($lista[\"thumb\"]);//deleto a imagem do arquivo\n\t\t\t\n\t\t\t}\n\t\t}\n\n\t}", "public function subir_imagen($f, $alto_max, $alto_min , $ancho_max, $ancho_min)\n\t{\n\t\t/**\n\t\t*\tRecoleccion de parametros del archivo necesarios para la validacion\n\t\t*/\n\t\t$file = $f;\n\t\t$nombre = $file[\"name\"];\n\t\t$tipo = $file[\"type\"];\n\t\t$ruta_temp = $file[\"tmp_name\"];\n\t\t$size = $file[\"size\"];\n\t\t$dimensiones = getimagesize($ruta_temp);\n\t\t$width = $dimensiones[0];\n\t\t$height = $dimensiones[1];\n\t\t$carpeta = Yii::app()->request->baseUrl.\"/images/tmp/\";\n\n\t\t/**\n\t\t*\tHTML que retorna ya sea si encuentra error o todo sale bien\n\t\t*/\n\t\t$html_1=\"<div class='bs-callout bs-callout-danger'><h4>\";\n\t\t$html_2=\"</h4><p>\";\n\t\t$html_3=\"</p></div>\";\n\n\t\t/**\n\t\t*\tValidacion del tipo de archivo\n\t\t*/\n\t\tif($tipo != 'image/jpg' && $tipo != 'image/jpeg' && $tipo != 'image/png' && $tipo != 'image/gif')\n\t\t{\n\t\t\treturn $html_1.\"El archivo no es una imagen\".$html_2.\"Los formatos aceptados son <strong>jpg, jpeg, png y gif</strong>\".$html_3;\n\t\t/**\n\t\t*\tValidacion por tamanio o peso\n\t\t*/\n\t\t}else if($size > 1024*1024)\n\t\t{\n\t\t\treturn $html_1.\"La imagen ocupa demasiado espacio\".$html_2.\"El tamanio maximo aceptado es de <strong>1 MB o 1024 Kb</strong>\".$html_3;\n\t\t/**\n\t\t*\tValidacion dimensiones\n\t\t*/\n\t\t}else if($width > $ancho_max || $width < $ancho_min || $height > $alto_max || $height < $alto_min)\n\t\t{\n\t\t\treturn $html_1.\"Las dimensiones no corresponden\".$html_2.\"La imagen debe tener preferiblemente <strong>ancho entre: \".$ancho_min.\"px y \".$ancho_max.\" <br> alto entre: \".$alto_min.\" px y \".$alto_max.\"px </strong>\".$html_3;\n\t\t/**\n\t\t*\tSi paso las anteriores se sube la imagen al servidor en la carpeta images/tmp/\n\t\t*/\n\t\t}else{\n\t\t\t$src = $_SERVER['DOCUMENT_ROOT'].$carpeta.$nombre;\n\t\t\tmove_uploaded_file($ruta_temp,$src);\n\t\t\t/**\n\t\t\t*\tRetorna el html para que se pueda ver la imagen\n\t\t\t*/\n\t\t\treturn '<img class=\"img_slide\" src=\"'.$carpeta.$nombre.'\">';\n\t\t}\n\t}", "function imageObj($OA) {\n \n // check isset\n if(!isset($OA['alt'])) $OA['alt'] = '';\n if(!isset($OA['file'])) $OA['file'] = '';\n if(!isset($OA['title'])) $OA['title'] = '';\n \n // wrap before\n if (isset($OA['wrapB'])) echo $OA['wrapB'].\"\\n\";\n \n // link begin\n if (isset($OA['link'])) {\n echo '<a href=\"'. $OA['link'] .'\"';\n if(isset($OA['linkT'])) echo ' target=\"'. $OA['linkT'] .'\"';\n echo '>';\n }\n \n // check for absolute path\n if (substr($OA['file'],0,4) == 'http') $pT = '';\n else $pT = THEMEPATH;\n \n // check width and height and echo tag\n if (isset($OA['width'])) {\n echo '<img src=\"'. $pT . $OA['file'] .'\"';\n if ($OA['width'] != 'auto') echo ' width=\"'. $OA['width'] .'\"';\n if ($OA['height'] != 'auto') echo ' height=\"'. $OA['height'] .'\"';\n echo ' alt=\"'. $OA['alt'] .'\"';\n if ($OA['title']) echo ' title=\"'. $OA['title'] .'\"';\n echo '>';\n } else {\n echo '<img src=\"'. $pT . $OA['file'] .'\" alt=\"'. $OA['alt'] .'\"';\n if ($OA['title']) echo ' title=\"'. $OA['title'] .'\"';\n echo '>';\n }\n \n // if 'link' exists\n if (isset($OA['link'])) echo '</a>';\n \n // 'wrap' after\n if (isset($OA['wrapA'])) echo \"\\n\".$OA['wrapA'];\n echo \"\\n\\n\";\n}", "public function imageItem_1(bool $fulIInfo = false)\n {\n if (!empty($this->image_1)) {\n return $this->relationImage('image_1', $fulIInfo);\n } \n }", "public function footimage_info()\n {\n $res = $this->db->get('footer_slider');\n\n // print_r($res);\n return $res;\n }", "function argentinagobar_bloques_imagen_destacada_admin_info($subtype, $conf, $contexts)\n{\n if (!empty($conf)) {\n $block = new stdClass;\n $block->title = isset($conf['override_title']) ? $conf['override_title_text'] : t('Imagen destacada');\n $block->content = t('Imagen destacada.');\n return $block;\n }\n}", "function getImage();", "function getImagePathInfo() \n { \n return $this->_imagePathInfo; \n }", "public function printImage($rij,$kolom){\n $this->rij = $rij; \n $this->kolom = $kolom; \n $dbh = new PDO(\"mysql:host=localhost;dbname=cursusphp;charset=utf8\", \"cursusgebruiker\", \"cursuspwd\"); \n $sql = \"select status from lightsout where rijnr= :rijnummer and kolomnr = :kolomnummer\"; \n $stmt = $dbh -> prepare($sql); \n $stmt->execute(array(':rijnummer' => $rij, ':kolomnummer' => $kolom )); \n $resultSet = $stmt->fetchAll(PDO::FETCH_ASSOC); \n $dbh = null;\n $this->status = $resultSet[0][\"status\"]; \n if ($this->status == 0) {\n print(\"<a href=\\\"lightsout.php?action=klik&rij=\".$rij.\"&kolom=\".$kolom.\"\\\"><img src=\\\"lightsout-uit.png\\\" alt=\\\"leeg\\\"></a>\");\n }\n elseif($this->status == 1) {\n print(\"<a href=\\\"lightsout.php?action=klik&rij=\".$rij.\"&kolom=\".$kolom.\"\\\"><img src=\\\"lightsout-aan.png\\\" alt=\\\"geel\\\"></a>\");\n }\n \n }", "function cargar_sublink(){\n if (isset($_GET['cont']) && $_GET['cont']!=\"\"){\n $id=$_GET['cont'];\n $sql=\"SELECT *, id_sub AS etiqueta, id_sub AS directorio_image, id_sub AS nombre_image FROM link, linkxsub, sublink WHERE id_cat='$id' AND link_rel=id_cat AND sublink_rel=id_sub ORDER BY prioridad_sub ASC\";\n $consulta=mysql_query($sql);\n while ($resultado = mysql_fetch_array($consulta)){\n $buscar=$resultado['id_sub'];\n $sql=\"SELECT directorio_image, nombre_image FROM imagen WHERE galeria_image='$buscar' AND tabla_image='subcategoria' ORDER BY id_image\";\n $imagenes=mysql_query($sql) or die(mysql_error());\n $respuesta = mysql_fetch_array($imagenes);\n $resultado['directorio_image']=$respuesta['directorio_image'];\n $resultado['nombre_image']=$respuesta['nombre_image'];\n $resultado['etiqueta']=$this->modificar_url($resultado['nombre_sub']);\n $resultado['etiqueta_cat']=$this->modificar_url($resultado['etiqueta_cat']);\n $this->mensaje=\"si\";\n $this->listado[] = $resultado;\n }\n }\n }", "function Image() {\r\n\t\treturn $this->ResizedAdvertisementImage();\r\n\t}", "function affichageTheme($image,$titre,$idTheme){\n\t\t\t\techo'<div class=\"col-xl-4 col-lg-4 col-md-6 col-sm-12\">\n\t\t\t\t\t\t<div class=\"polaroid\">\n\t\t\t\t\t\t\t<a href=\"/ProjetRadioGit/ProjetRadioPhp/pages/niveau0/Emission.php?id_theme='.$idTheme.'\">\n\t\t\t\t\t\t\t\t<div class=\"image\" style=\"background-image:url('.$image.')\">\n\t\t\t\t\t\t\t\t\t<img src=\"'.$image.'\" class=\"center\" alt=\"Image du thème : '.$image.'\"/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"polatxt\">\n\t\t\t\t\t\t\t\t\t<p>'.$titre.'</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t<form action=\"Desarchiver.php\" method=\"POST\">\n\t\t\t\t\t\t\t\t<input id=\"id_Theme\" name=\"id_Theme\" type=\"hidden\" value=\"'.$idTheme.'\">\n\t\t\t\t\t\t\t\t<input id=\"objet\" name=\"objet\" type=\"hidden\" value=\"'.$_POST['objet'].'\">\n\t\t\t\t\t\t\t\t<input id=\"texte\" name=\"texte\" type=\"hidden\" value=\"'.$_POST['texte'].'\">\n\t\t\t\t\t\t\t\t<button type=\"submit\" class=\"btn btn-outline-success btn-block \" name=\"Desarchiver\" value=\"1\" >Desarchiver</button>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t\t</br>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\t\t\t\t\n\t\t\t}", "private function show_result_before() {\n ?>\n <!DOCTYPE html>\n <html>\n <head>\n <title>Image Resizer $ Shahriar</title>\n <style>\n *{\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n }\n body{\n background: #FAFAFA;\n }\n .img-box{\n margin: auto;\n margin-top: 5vw;\n width: 90%;\n min-height: 90%;\n padding: 50px;\n display: table;\n background: #FFF;\n border: 1px dashed rgba(0,0,0,0.1);\n border-radius: 2px;\n }\n .img-list {\n list-style: decimal inside;\n }\n .img-list li {\n border: 1px solid rgba(0,0,0,0.1);\n border-radius: 2px;\n padding: 10px 15px;\n margin: 5px;\n }\n .msg-success {\n color: #30AA30;\n }\n .msg-error {\n color: #F25959;\n }\n </style>\n </head>\n <body>\n <div class=\"img-box\">\n <ol class=\"img-list\">\n <?php\n }", "function showImage($user_id){\r\n $query=\"SELECT * FROM users WHERE id=$user_id\";\r\n $sql= mysqli_query($_SESSION['connection'], $query);\r\n $images= mysqli_fetch_assoc($sql);\r\n $image= $images['imagenes'];\r\n return '<img src=\"data:image/jpeg;base64,'.base64_encode($image).'\" style=\"width:200px;height:200px\"/>';\r\n }", "public function getImagen()\n {\n return $this->imagen;\n }", "public function getImagen()\n {\n return $this->imagen;\n }", "function display_statut($statut)\n{\n?>\n<img id=\"iconeStatut\" src=\"<?php \n\t\t\t\tif($statut == 0)\n\t\t\t\t{\n\t\t\t\t\techo \"img/wait.svg\";\n\t\t\t\t}\n\t\t\t\telse if($statut == 1)\n\t\t\t\t{\n\t\t\t\t\techo \"img/error.png\";\n\t\t\t\t}\t\t\t\t\n\t\t\t\telse if($statut == 2)\n\t\t\t\t{\n\t\t\t\t\techo \"img/ok.svg\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t?>\"><?php\n }", "public function image($id)\n {\n $data = $id;\n $query = $this->db->select('*')->from('imageProduct')->where('idProduct',$data)->get()->result_array();\n\n $breadcrum = array(\n 'br1' => array('name' => 'Home', 'url'=>'ci-admin'),\n 'br2' => array('name' => 'Product','url'=>'ci-admin/product'),\n 'br3' => array('name' => 'Multi Image'),\n );\n $this->template->breadcrum($breadcrum);\n $this->template->load('layout', 'contents' , 'ci-admin/product/image.php',array('id'=>$id,'data'=>$query,'csrf'=>$this->csrf));\n }", "public function testUpdateAvatarImage()\n {\n }", "public function get_image_link()\n {\n }", "function miseenformeIMG($img_loc,$width,$height,$text){\n\t// Si format paysage \n\tif ($width > $height){\n\t\t// Si $width > 400 juste l'image pas de texte\n\t\tif ($width > 400){\n\t\t\t$lestyleimg = ' style=\"float:left;max-width:100%;max-height: auto;padding-right:1em;\" ';\n\t\t\t$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\";\n\t\t// L'image est petite nous plaçon l'image et le texte\n\t\t} else {\n\t\t\t$lestyleimg = ' style=\"float:left;max-width:200px;max-height: 240px;padding-right:1em;\" ';\n\t\t\t//$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".FunctionsMag::txtCHAP($text);\n\t\t\t$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".stripTAG(TruncateHTML::truncateChars($text, '200', '...'));\n\t\t}\n\t// Nous sommes en format portrait nous plaçons l'image et le texte\t\n\t} else {\n\t\t$lestyleimg = ' style=\"float:left;max-width:auto;max-height: 240px;padding-right:1em;\" ';\n\t\t//$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".FunctionsMag::txtCHAP($text);\n\t\t$valretour = \"<img src=\\\"\".$img_loc.\"\\\"\".$lestyleimg.\"/>\".stripTAG(TruncateHTML::truncateChars($text, '200', '...'));\n\t}\n\treturn $valretour;\n}", "function showImage()\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\timagegif($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\timagejpeg($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\timagepng($this->ImageStream);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "function imagenes_disponibles_tipo_por_palabra_exacta($palabra,$id_tipo) {\n\t\t$query = \"SELECT palabras.*, tipos_palabra.*, \n\t\timagenes.id_imagen,imagenes.id_colaborador,imagenes.imagen,imagenes.extension,imagenes.id_tipo_imagen,\n\t\timagenes.estado,imagenes.registrado,imagenes.id_licencia,imagenes.id_autor,imagenes.tags_imagen,\n\t\timagenes.tipo_pictograma,imagenes.validos_senyalectica,imagenes.original_filename,\n\t\tpalabra_imagen.*\n\t\tFROM palabras, tipos_palabra, imagenes, palabra_imagen\n\t\tWHERE palabras.palabra = '$palabra'\n\t\tAND palabra_imagen.id_palabra = palabras.id_palabra\n\t\tAND palabra_imagen.id_imagen = imagenes.id_imagen\n\t\tAND tipos_palabra.id_tipo_palabra=palabras.id_tipo_palabra\n\t\tAND imagenes.id_tipo_imagen='$id_tipo'\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\tmysql_close($connection);\n\t\treturn $result;\n\t}", "function comprovarImg($idImatge, $idUsuari){\n $conn=connexioBD();\n $existe=false;\n $sql1=\"SELECT * FROM imatges INNER JOIN productes ON imatges.producte_id=productes.id WHERE imatges.id='$idImatge' and productes.usuari_id='$idUsuari'\";\n if (!$resultado =$conn->query($sql1)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows==1){\n $existe=true;\n }\n return $existe;\n $resultado->free();\n $conn->close(); \n}", "function imagecustom($im, $text) {\n}", "function GetImage()\n {\n //Obtient les images par défaut de chaque produit de la fiche\n $ficheProduct = new EeCommerceFicheProductProduct($this->Core);\n $ficheProduct->AddArgument(new Argument(\"EeCommerceFicheProductProduct\", \"FicheId\", EQUAL, $this->IdEntite));\n $products = $ficheProduct->GetByArg();\n \n $html = \"<div>\";\n \n foreach($products as $product)\n {\n $img = new Image($product->Product->Value->ImageDefault->Value);\n $img->Alt = $img->Title = $product->Product->Value->NameProduct->Value;\n \n $html .= \"<div class='col-md-4' >\" . $img->Show().\"</div>\"; \n }\n \n $html .= \"</div>\";\n \n return $html;\n \n }", "public function show($data,Fileupload $fileupload)\n {\n \n $contents = Storage::url('images/sunil.jpg');\n\n echo \"<img src='\".$contents.\"' height='400px' width='200px'/>\";\n }" ]
[ "0.6336713", "0.62503296", "0.6117874", "0.6116785", "0.5952203", "0.59506184", "0.5931126", "0.59133375", "0.5911963", "0.591134", "0.5863301", "0.5862361", "0.57956654", "0.57742184", "0.57569027", "0.5738422", "0.57235086", "0.57223576", "0.5711278", "0.5711278", "0.5711278", "0.5711278", "0.5683141", "0.5677614", "0.5643841", "0.56160593", "0.5604193", "0.5602643", "0.55886763", "0.55886763", "0.55840164", "0.5582737", "0.55691826", "0.5553199", "0.55525315", "0.55499107", "0.5547537", "0.5547503", "0.5545646", "0.5545334", "0.5522954", "0.5517857", "0.55109143", "0.5498943", "0.54965377", "0.54921263", "0.54870695", "0.54680556", "0.5462317", "0.5462029", "0.5460056", "0.54523194", "0.5448999", "0.54336846", "0.54317963", "0.5426331", "0.54195374", "0.5403683", "0.5391246", "0.53898", "0.53862983", "0.5382681", "0.5374492", "0.5374492", "0.5374492", "0.53744715", "0.5374469", "0.53685516", "0.53674906", "0.535999", "0.5358153", "0.53569114", "0.5356295", "0.53535795", "0.53484106", "0.5347359", "0.5339997", "0.53386873", "0.5338204", "0.5337816", "0.53129625", "0.531003", "0.5305133", "0.53028196", "0.53026927", "0.52993464", "0.52978766", "0.52931964", "0.52931964", "0.52924716", "0.5289004", "0.5284656", "0.5284025", "0.52838796", "0.5282772", "0.5281823", "0.5280334", "0.52779436", "0.52766794", "0.52731717" ]
0.5530196
40
Processes a potentially nested test suite based on various filters through the CLI.
private function processSuiteFilters(TestSuite $suite, array $arguments): void { if (empty($arguments['filter']) && empty($arguments[self::PARALLEL_ARG]) && empty($arguments['groups']) && empty($arguments['excludeGroups'])) { return; } $filterFactory = new Factory(); if (!empty($arguments['excludeGroups'])) { $filterFactory->addFilter( new ReflectionClass(ExcludeGroupFilterIterator::class), $arguments['excludeGroups'] ); } if (!empty($arguments['groups'])) { $filterFactory->addFilter( new ReflectionClass(IncludeGroupFilterIterator::class), $arguments['groups'] ); } if (!empty($arguments['filter'])) { $filterFactory->addFilter( new ReflectionClass('PHPUnit_Runner_Filter_Test'), $arguments['filter'] ); } if (!empty($arguments[self::PARALLEL_ARG])) { $filterFactory->addFilter( new ReflectionClass('PhpUnit\Runner\Filter\Parallel'), $arguments[self::PARALLEL_ARG] ); } $suite->injectFilter($filterFactory); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function runTests(){\n $process = new Process(['./vendor/bin/phpunit --filter '.$this->params['model_name'].'Test']);\n $process->start();\n foreach($process as $type => $data){\n if($process::OUT !== $type){\n $this->error($data);\n continue;\n }\n $this->info($data);\n }\n }", "public function run() {\n Preview::$config->reporter->before_suite($this->result);\n\n if ($this->runnable()) {\n $this->timer->start();\n $this->extend_context_with_parent();\n\n // run before hooks if error occured\n // force all its children tests set to error.\n try {\n $this->run_before();\n } catch (\\Exception $e) {\n $this->force_error($e);\n }\n\n // run all its children test cases/suites.\n foreach ($this->cases as $case) {\n $case->run();\n }\n foreach ($this->suites as $suite) {\n $suite->run();\n }\n\n // run after hooks.\n // do not handle any exceptions,\n // since reporter has printed results out.\n $this->run_after();\n $this->finish();\n\n $this->timer->stop();\n }\n\n Preview::$config->reporter->after_suite($this->result);\n }", "private function runTests(){\n if($this->option('s')) return false;\n $process = new Process(['./vendor/bin/phpunit','--exclude-group','skip-test']);\n $process->start();\n foreach($process as $type => $data){\n if($process::OUT !== $type){\n $this->error($data);\n continue;\n }\n echo $data;\n }\n }", "public function process_test($tester) {\n\t\t$this->setupTests();\n\t\t$this->process();\n\t}", "public static function main()\n {\n $suite = new PHPUnit_Framework_TestSuite('Tinebase_Log_Filter_FilterTest');\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "public static function main() {\n\t\tTestRunner::run( self::suite() );\n\t}", "private function initSuite(): void\n {\n $suiteNodes = $this->xml->xpath('/testsuites/testsuite/testsuite');\n $this->isSingle = count($suiteNodes) === 0;\n\n $node = $this->xml->xpath('/testsuites/testsuite');\n $node = current($node);\n\n if ($node !== false) {\n $this->suites[] = new TestSuite(\n (string) $node['name'],\n (int) $node['tests'],\n (int) $node['assertions'],\n (int) $node['failures'],\n (int) $node['errors'],\n (int) $node['warnings'],\n (int) $node['skipped'],\n (float) $node['time'],\n (string) $node['file']\n );\n } else {\n $this->suites[] = TestSuite::empty();\n }\n }", "function main(tiny_api_Cli $cli)\n{\n $cli->header('Unit Tests');\n\n $unit_test_file = $cli->get_arg('unit-test-file');\n if (!empty($unit_test_file))\n {\n if (!is_file($unit_test_file))\n {\n $cli->error(\"Could not find file \\\"$unit_test_file\\\"!\");\n exit(1);\n }\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->disable_tap()\n ->disable_stop_on_failure()\n ->execute(array($unit_test_file))\n ->print_summary();\n }\n else\n {\n exec(\"/usr/bin/find \"\n . getcwd()\n . \" -name \\\"*.php\\\" | /bin/grep \\\"/tests/\\\"\",\n $files, $retval);\n\n $utm = tiny_api_Unit_Test_Manager::make($cli)\n ->execute($files)\n ->print_summary();\n }\n}", "public function do_tests()\n {\n foreach ($this->tests as $test) {\n $test->do_test($this->parse_script, $this->interpret_script);\n }\n }", "public function main()\n {\n $testSuitesDoc = new DOMDocument();\n $testSuitesDoc->load((string) $this->inFile);\n\n $this->fixDocument($testSuitesDoc);\n\n $this->transform($testSuitesDoc);\n }", "function run()\n\t{\n\t\t$arguments = array();\n\n\t\tif ($this->_options['help']) {\n\t\t\t$this->_doHelp();\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->_options['testdox']) {\n\t\t\t$arguments['printer'] = new PHPUnit_Util_TestDox_ResultPrinter_Text;\n\t\t}\n\n\t\tif ($this->_options['group']) {\n\t\t\t$arguments['groups'] = explode( ',', $this->_options['group'] );\n\t\t}\n\n\t\tif ($this->_options['exclude-group']) {\n\t\t\t$arguments['excludeGroups'] = explode( ',', $this->_options['exclude-group'] );\n\t\t}\n\n\t\t/*\n\t\t * Find all the matching files\n\t\t */\n\t\tif ($this->_startDir) {\n\t\t\t$dir = $this->_startDir;\n\t\t} else {\n\t\t\t$dir = '';\n\t\t}\n\t\tif ($this->_options['debug']) {\n\t\t\techo 'Discovering files in ' . $this->_startDir . self::$eol;\n\t\t}\n\t\t$testFiles = array();\n\t\t$this->_dirWalk($testFiles, '');\n\t\tif ($this->_options['debug']) {\n\t\t\techo 'Running ' . count($testFiles) . ' test files:' . self::$eol;\n\t\t\tforeach ($testFiles as $fid) {\n\t\t\t\techo $fid . self::$eol;\n\t\t\t}\n\t\t}\n\t\t$suite = new PHPUnit_Framework_TestSuite();\n\t\t$suite->addTestFiles($testFiles);\n\t\t// This will change when we have more than CLI support\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite, $arguments);\n\t}", "public function testRun()\n {\n $scenario = new Hostingcheck_Scenario();\n $scenario->add(\n new Hostingcheck_Scenario_Group(\n 'group1',\n 'Group 1',\n new Hostingcheck_Scenario_Tests()\n )\n );\n $scenario->add(\n new Hostingcheck_Scenario_Group(\n 'group2',\n 'Group 2',\n new Hostingcheck_Scenario_Tests()\n )\n );\n\n $runner = new Hostingcheck_Runner($scenario);\n $results = $runner->run();\n $this->assertCount(2, $results);\n }", "function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite(__CLASS__);\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "function runTests() {\n\t\tif(is_array($this->_aTests)){\n\t\t\tforeach($this->_aTests as $test){\n\t\t\t\t$this->_aResults[$test->sName] = array();\n\t\t\t\t$this->_aResults = $test->run($this->_aResults);\n\n\t\t\t}\n\t\t}\n\t}", "public function cli_main() {\t\t\r\n\t\t$command = new Tx_PHPUnitCli_TextUI_Command();\r\n\t\t\r\n\t\t$arguments = $this->cli_getArgIndex();\r\n\t\t$rawArguments = $_SERVER['argv'];\r\n\t\t\r\n\t\tif ($arguments[$this->customArgumentKey]) {\r\n\t\t\t$extensionsWithTestSuites = $this->getExtensionsWithTestSuites();\r\n\t\t\t$testSuite = new PHPUnit_Framework_TestSuite();\r\n\t\t\t\r\n\t\t\tif (count($arguments[$this->customArgumentKey])==1) {\r\n\t\t\t\t\t// parameter as comma separated list of extension keys\r\n\t\t\t\t$extensionKeysToProcess = t3lib_div::trimExplode(',', $arguments[$this->customArgumentKey][0]);\r\n\t\t\t} else {\r\n\t\t\t\t\t// parameter\r\n\t\t\t\t$extensionKeysToProcess = $arguments[$this->customArgumentKey];\r\n\t\t\t}\r\n\t\t\t\t// Load the files containing test cases from extensions:\r\n\t\t\tforeach ($extensionKeysToProcess as $extensionKey) {\r\n\t\t\t\tif (!t3lib_extMgm::isLoaded($extensionKey)) {\r\n\t\t\t\t\t$this->cli_echo(\"Extension $extensionKey not loaded\\n\");\r\n\t\t\t\t\texit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);\r\n\t\t\t\t}\r\n\t\t\t\t$paths = $extensionsWithTestSuites[$extensionKey];\r\n\t\t\t\tself::loadRequiredTestClasses($paths);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Add all classes to the test suite which end with \"testcase\"\r\n\t\t\tforeach (get_declared_classes() as $class) {\r\n\t\t\t\t$classReflection = new ReflectionClass($class);\r\n\t\t\t\tif ($classReflection->isSubclassOf('tx_phpunit_testcase') && (strtolower(substr($class, -8, 8)) == 'testcase' || substr($class, -4, 4) == 'Test') && $class != 'tx_phpunit_testcase' && $class != 'tx_phpunit_database_testcase' && $class != 'tx_t3unit_testcase') {\r\n\t\t\t\t\t$testSuite->addTestSuite($class);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$command->setTest($testSuite);\r\n\t\t\t\r\n\t\t\t$rawArguments = $this->filterCustomCLIArguments($rawArguments);\r\n\t\t}\r\n\r\n\t\t$command->run($rawArguments, true);\r\n\t\t\r\n\t\t$testRunner = new PHPUnit_TextUI_TestRunner();\r\n\r\n\t\t$result = $testRunner->doRun($testSuite, $arguments = array());\r\n\t\t\r\n\t\tif ($exit) {\r\n\t\t\tif (isset($result) && $result->wasSuccessful()) {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);\r\n\t\t\t}\r\n\t\t\r\n\t\t\telse if (!isset($result) || $result->errorCount() > 0) {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);\r\n\t\t\t}\r\n\t\t\r\n\t\t\telse {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite(__CLASS__);\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "public function __run()\n {\n $Reporter = new CakeXmlReporter('utf-8', array(\n 'app' => $this->Manager->appTest,\n 'plugin' => $this->Manager->pluginTest,\n 'group' => ($this->type === 'group'),\n 'codeCoverage' => $this->doCoverage\n ));\n\n if ($this->doCoverage) {\n if (!extension_loaded('xdebug')) {\n $this->out(__('You must install Xdebug to use the CakePHP(tm) Code Coverage Analyzation. Download it from http://www.xdebug.org/docs/install', true));\n $this->_stop(0);\n }\n }\n\n ob_start();\n\n try {\n if ($this->type == 'all') {\n $result = $this->Manager->runAllTests($Reporter);\n } else if ($this->type == 'group') {\n $ucFirstGroup = ucfirst($this->file);\n if ($this->doCoverage) {\n require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';\n CodeCoverageManager::init($ucFirstGroup, $Reporter);\n CodeCoverageManager::start();\n }\n $result = $this->Manager->runGroupTest($ucFirstGroup, $Reporter);\n } else {\n\n $folder = $folder = $this->__findFolderByCategory($this->category);\n $case = $this->__getFileName($folder, $this->isPluginTest);\n\n if ($this->doCoverage) {\n require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';\n CodeCoverageManager::init($case, $Reporter);\n CodeCoverageManager::start();\n }\n $result = $this->Manager->runTestCase($case, $Reporter);\n }\n } catch (Exception $e) {\n ob_get_clean();\n $this->out('Tests failed to run. ' . $e->getMessage());\n $this->_stop(1);\n }\n $xml = ob_get_clean();\n\n $xmlD = new DOMDocument();\n $xmlD->loadXML($xml);\n\n $xslt = new XSLTProcessor();\n $XSL = new DOMDocument();\n $XSL->load(dirname(__FILE__).DS.'xsl'.DS.'to-junit.xsl');\n $xslt->importStylesheet($XSL);\n $out = $xslt->transformToXML($xmlD);\n $time = time();\n\n file_put_contents(ROOT . DS . \"build\" . DS . \"logs\" . DS . \"junit-$time.xml\", $out);\n echo \"Done.\\n\";\n }", "public static function suite() : TestSuite {\n\t\t$GLOBALS['PHP_CODESNIFFER_SNIFF_CODES'] = [];\n\t\t$GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES'] = [];\n\t\t$GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES'] = [];\n\n\t\t$suite = new TestSuite( static::STANDARD . ' Standards' );\n\n\t\t$standards_dir = dirname( __DIR__, 2 ) . '/src';\n\t\t$all_details = Standards::getInstalledStandardDetails( false, $standards_dir );\n\t\t$details = $all_details[ static::STANDARD ];\n\n\t\tAutoload::addSearchPath( $details['path'], $details['namespace'] );\n\t\tAutoload::addSearchPath( $details['path'], $details['namespace'] );\n\n\t\t$test_dir = __DIR__ . '/tests/' . static::STANDARD . '/Tests/';\n\t\tif ( false === is_dir( $test_dir ) ) {\n\t\t\t// No tests for this standard.\n\t\t\treturn $suite;\n\t\t}\n\n\t\t$di = new RecursiveIteratorIterator(\n\t\t\tnew RecursiveDirectoryIterator( $test_dir, FilesystemIterator::SKIP_DOTS )\n\t\t);\n\n\t\tforeach ( $di as $file ) {\n\t\t\t$filename = $file->getFilename();\n\n\t\t\t// Skip hidden files.\n\t\t\tif ( 0 === strpos( $filename, '.' ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Tests must end with \"Test.php\".\n\t\t\tif ( substr( $filename, - 1 * strlen( static::TEST_SUFFIX ) ) !== static::TEST_SUFFIX ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$className = Autoload::loadFile( $file->getPathname() );\n\t\t\t$GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS'][ $className ] = $details['path'];\n\t\t\t$GLOBALS['PHP_CODESNIFFER_TEST_DIRS'][ $className ] = $test_dir;\n\t\t\t$suite->addTestSuite( $className );\n\t\t}\n\n\t\treturn $suite;\n\t}", "public static function suite() {\n\n\t\t$suite = new PHPUnit_Framework_TestSuite('All Collectionable plugin tests');\n\n\t\t$basePath = App::pluginPath('Collectionable') . 'Test' . DS . 'Case' . DS;\n\t\t$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basePath));\n\n\t\twhile ($it->valid()) {\n\n\t\t\tif (!$it->isDot()) {\n\t\t\t\t$file = $it->key();\n\t\t\t\tif (preg_match('|Test\\.php$|', $file) && $file !== __FILE__) {\n\t\t\t\t\t$suite->addTestFile($file);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$it->next();\n\t\t}\n\n\t\treturn $suite;\n\n\t}", "public function testGroups(): void\n {\n $process = $this->phpbench(\n 'run --group=do_nothing --dump --progress=none benchmarks/set1/BenchmarkBench.php'\n );\n\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertXPathCount(1, $output, '//subject');\n }", "function addTestSuite(&$tsuiteMgr,&$argsObj,$container,&$hash)\r\n{\r\n $new_order = null;\r\n\r\n // compute order\r\n //\r\n // $nt2exclude=array('testplan' => 'exclude_me','requirement_spec'=> 'exclude_me','requirement'=> 'exclude_me');\r\n // $siblings = $tsuiteMgr->tree_manager->get_children($argsObj->containerID,$nt2exclude);\r\n // if( !is_null($siblings) )\r\n //{\r\n // $dummy = end($siblings);\r\n // $new_order = $dummy['node_order']+1;\r\n //}\r\n $ret = $tsuiteMgr->create($argsObj->containerID,$container['container_name'],\r\n $container['details'],\r\n $new_order,config_get('check_names_for_duplicates'),'block');\r\n \r\n $op['messages']= array('msg' => $ret['msg'], 'user_feedback' => '');\r\n $op['status']=$ret['status_ok'];\r\n\r\n if($ret['status_ok'])\r\n {\r\n $op['messages']['user_feedback'] = lang_get('testsuite_created');\r\n if($op['messages']['msg'] != 'ok')\r\n {\r\n $op['messages']['user_feedback'] = $op['messages']['msg'];\r\n }\r\n\r\n if(trim($argsObj->assigned_keyword_list) != \"\")\r\n {\r\n $tsuiteMgr->addKeywords($ret['id'],explode(\",\",$argsObj->assigned_keyword_list));\r\n }\r\n writeCustomFieldsToDB($tsuiteMgr->db,$argsObj->tprojectID,$ret['id'],$hash);\r\n }\r\n return $op;\r\n}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n \t\tPHPUnit_TextUI_TestRunner::run( $suite);\n \t}", "public static function suite() {\n\t\t$Suite = new CakeTestSuite('All Tools tests');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Lib');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Lib' . DS . 'Utility');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Lib' . DS . 'Misc');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'View');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'View' . DS . 'Helper');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Model');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Model' . DS . 'Behavior');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Model' . DS . 'Datasource');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Console' . DS . 'Command');\n\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Controller' . DS . 'Component');\n\t\t$path = dirname(__FILE__);\n\t\t$Suite->addTestDirectory($path . DS . 'Controller' . DS . 'Component' . DS . 'Auth');\n\n\t\t//$path = dirname(__FILE__);\n\t\t//$Suite->addTestDirectory($path . DS . 'Controller');\n\n\t\t//$path = CakePlugin::path('Tools') . 'Test' . DS . 'Case' . DS;\n\t\t//$Suite->addTestDirectoryRecursive($path);\n\t\treturn $Suite;\n\t}", "public static function main() \n {\n require_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite(\"Zend_Filter_Word_UnderscoreToPathSeparatorTest\");\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "abstract public function runTests(BaseRunner $runner, $useStdout = false,\n $firstRun = false, $mutant = false, array $testCases = array());", "public function startTestSuite(\\PHPUnit_Framework_TestSuite $suite)\n\t{\n\t\t\n\t}", "static function main() {\n $suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n PHPUnit_TextUI_TestRunner::run( $suite);\n }", "static function main() {\n $suite = new PHPUnit_Framework_TestSuite( __CLASS__);\n PHPUnit_TextUI_TestRunner::run( $suite);\n }", "function test_all () {\n\n\t\t$this->layout = 'test';\n\n\t\t$tests_folder = new Folder('../tests');\n\n\t\t$results = array();\n\t\t$total_errors = 0;\n\t\tforeach ($tests_folder->findRecursive('.*\\.php') as $test) {\n\t\t\tif (preg_match('/^(.+)\\.php/i', basename($test), $r)) {\n\t\t\t\trequire_once($test);\n\t\t\t\t$test_name = Inflector::Camelize($r[1]);\n\t\t\t\tif (preg_match('/^(.+)Test$/i', $test_name, $r)) {\n\t\t\t\t\t$module_name = $r[1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$module_name = $test_name;\n\t\t\t\t}\n\t\t\t\t$suite = new TestSuite($test_name);\n\t\t\t\t$result = TestRunner::run($suite);\n\n\t\t\t\t$total_errors += $result['errors'];\n\n\t\t\t\t$results[] = array(\n\t\t\t\t\t'name'=>$module_name,\n\t\t\t\t\t'result'=>$result,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->set('success', !$total_errors);\n\t\t$this->set('results', $results);\n\t}", "public function testConfiguredDefinitionWithPHPUnitTester()\n {\n $options = [\n new InputOption(\n 'processes',\n 'p',\n InputOption::VALUE_REQUIRED,\n 'The number of test processes to run.',\n 'auto'\n ),\n new InputOption(\n 'functional',\n 'f',\n InputOption::VALUE_NONE,\n 'Run test methods instead of classes in separate processes.'\n ),\n new InputOption('help', 'h', InputOption::VALUE_NONE, 'Display this help message.'),\n new InputOption(\n 'phpunit',\n null,\n InputOption::VALUE_REQUIRED,\n 'The PHPUnit binary to execute. <comment>(default: vendor/bin/phpunit)</comment>'\n ),\n new InputOption(\n 'runner',\n null,\n InputOption::VALUE_REQUIRED,\n 'Runner, WrapperRunner or SqliteRunner. <comment>(default: Runner)</comment>'\n ),\n new InputOption(\n 'bootstrap',\n null,\n InputOption::VALUE_REQUIRED,\n 'The bootstrap file to be used by PHPUnit.'\n ),\n new InputOption(\n 'configuration',\n 'c',\n InputOption::VALUE_REQUIRED,\n 'The PHPUnit configuration file to use.'\n ),\n new InputOption('group', 'g', InputOption::VALUE_REQUIRED, 'Only runs tests from the specified group(s).'),\n new InputOption(\n 'stop-on-failure',\n null,\n InputOption::VALUE_NONE,\n 'Don\\'t start any more processes after a failure.'\n ),\n new InputOption(\n 'exclude-group',\n null,\n InputOption::VALUE_REQUIRED,\n 'Don\\'t run tests from the specified group(s).'\n ),\n new InputOption(\n 'log-junit',\n null,\n InputOption::VALUE_REQUIRED,\n 'Log test execution in JUnit XML format to file.'\n ),\n new InputOption('colors', null, InputOption::VALUE_NONE, 'Displays a colored bar as a test result.'),\n new InputArgument(\n 'path',\n InputArgument::OPTIONAL,\n 'The path to a directory or file containing tests. <comment>(default: current directory)</comment>'\n ),\n new InputOption(\n 'no-test-tokens',\n null,\n InputOption::VALUE_NONE,\n 'Disable TEST_TOKEN environment variables. <comment>(default: variable is set)</comment>'\n ),\n new InputOption('path', null, InputOption::VALUE_REQUIRED, 'An alias for the path argument.'),\n new InputOption(\n 'coverage-clover',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in Clover XML format.'\n ),\n new InputOption(\n 'coverage-crap4j',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in Crap4J XML format.'\n ),\n new InputOption(\n 'coverage-html',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in HTML format.'\n ),\n new InputOption(\n 'coverage-php',\n null,\n InputOption::VALUE_REQUIRED,\n 'Serialize PHP_CodeCoverage object to file.'\n ),\n new InputOption(\n 'coverage-text',\n null,\n InputOption::VALUE_NONE,\n 'Generate code coverage report in text format.'\n ),\n new InputOption(\n 'coverage-xml',\n null,\n InputOption::VALUE_REQUIRED,\n 'Generate code coverage report in PHPUnit XML format.'\n ),\n new InputOption(\n 'coverage-test-limit',\n null,\n InputOption::VALUE_REQUIRED,\n 'Limit the number of tests to record for each line of code. ' .\n 'Helps to reduce memory and size of coverage reports.'\n ),\n new InputOption('testsuite', null, InputOption::VALUE_OPTIONAL, 'Filter which testsuite to run'),\n new InputOption(\n 'max-batch-size',\n 'm',\n InputOption::VALUE_REQUIRED,\n 'Max batch size (only for functional mode).',\n 0\n ),\n new InputOption('filter', null, InputOption::VALUE_REQUIRED, 'Filter (only for functional mode).'),\n new InputOption(\n 'parallel-suite',\n null,\n InputOption::VALUE_NONE,\n 'Run the suites of the config in parallel.'\n ),\n new InputOption(\n 'passthru',\n null,\n InputOption::VALUE_REQUIRED,\n 'Pass the given arguments verbatim to the underlying test framework. ' .\n 'Example: --passthru=\"\\'--prepend\\' \\'xdebug-filter.php\\'\"'\n ),\n new InputOption(\n 'passthru-php',\n null,\n InputOption::VALUE_REQUIRED,\n 'Pass the given arguments verbatim to the underlying php process. ' .\n 'Example: --passthru-php=\"\\'-d\\' \\'zend_extension=xdebug.so\\'\"'\n ),\n new InputOption(\n 'verbose',\n 'v',\n InputOption::VALUE_REQUIRED,\n 'If given, debug output is printed. Example: --verbose=1'\n ),\n new InputOption(\n 'whitelist',\n null,\n InputOption::VALUE_REQUIRED,\n 'Directory to add to the coverage whitelist.'\n ),\n ];\n $expected = new InputDefinition($options);\n $definition = $this->command->getDefinition();\n $this->assertEquals($expected, $definition);\n }", "public static function main()\n {\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "public static function main()\n {\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "public static function main()\n {\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "public static function main()\n {\n $suite = new TestSuite(\"Zend_Dom_QueryTest\");\n $result = (new resources_Runner())->run($suite);\n }", "public static function main() \n {\n require_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite(\"Zend_Filter_Word_UnderscoreToSeparatorTest\");\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "public static function main()\n {\n $suite = new TestSuite(\"Zend_Form_Decorator_ViewHelperTest\");\n $result = (new resources_Runner())->run($suite);\n }", "public function processOption()\n {\n global $argv;\n $option = isset($argv[1])? $argv[1] : null;\n $option = str_replace('-', '', $option);\n $param = isset($argv[2])? $argv[2] : null;\n\n switch($option) {\n case 'a':\n // runs all the tests\n putenv('RUN_ALL_TESTS=1');\n $command = 'phpunit --stop-on-failure AllTests';\n break;\n\n case 'c':\n // runs the test code coverage\n $phpunitDir = dirname(__FILE__) . '/' . self::PHPUNIT_TEST_RESULTS_DIR;\n $coverageDir = $phpunitDir . '/' . self::COVERAGE_DIR;\n $testdoxFile = $phpunitDir . '/' . self::TESTDOX_FILE;\n\n is_dir($phpunitDir) or die('Error: invalid phpunit directory');\n is_dir($coverageDir) or die('Error: invalid test code coverage directory');\n\n putenv('RUN_ALL_TESTS=1');\n\n if (extension_loaded('Xdebug')) {\n $command = \"phpunit --testdox-html $testdoxFile --coverage-html $coverageDir AllTests\";\n } else {\n list($phpIniFile, $pearDir) = $this->prepareTestCoverageCommand();\n $command = \"php -c \\\"$phpIniFile\\\" \\\"$pearDir/phpunit\\\" --testdox-html $testdoxFile --coverage-html $coverageDir AllTests\";\n }\n break;\n\n case 'r':\n // reruns the last command\n $command = \"phpunit --stop-on-failure AllTests\";\n break;\n\n case 's':\n // runs a specific test\n $param or die('Error: enter the test to run !');\n\n putenv('RUN_ALL_TESTS=1');\n $command = \"phpunit --stop-on-failure --filter $param .\";\n break;\n\n case 'u':\n // runs the updated tests\n putenv('RUN_ALL_TESTS=0');\n $command = 'phpunit --stop-on-failure AllTests';\n break;\n\n case 'v':\n // runs all tests in verbose mode\n putenv('RUN_ALL_TESTS=1');\n $command = 'phpunit --verbose AllTests';\n break;\n\n case 'h':\n default:\n $command = null;\n }\n\n return $command;\n }", "public static function suite()\n {\n $suite = new PHPUnit_Framework_TestSuite('PHP CodeSniffer Standards');\n $baseDir = pathinfo(getcwd().\"/Ongr\", PATHINFO_DIRNAME);\n\n \\PHP_CodeSniffer::setConfigData('installed_paths', $baseDir);\n $path = pathinfo(\\PHP_CodeSniffer::getInstalledStandardPath('Ongr'), PATHINFO_DIRNAME);\n $testsDir = $path . DIRECTORY_SEPARATOR . 'Tests' . DIRECTORY_SEPARATOR . 'Unit';\n\n $directoryIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($testsDir));\n\n /** @var \\SplFileInfo $fileinfo */\n foreach ($directoryIterator as $file) {\n // Skip hidden and extension must be php.\n if ($file->getFilename()[0] === '.' || pathinfo($file, PATHINFO_EXTENSION) !== 'php') {\n continue;\n }\n\n $className = str_replace(\n [$baseDir . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR],\n ['', '\\\\'],\n substr($file, 0, -4)\n );\n\n $suite->addTest(new $className('getErrorList'));\n }\n\n return $suite;\n }", "public function run_tests()\n {\n }", "public function testApply() {\n\t\t$group = new Group();\n\t\t$group->add($this->_paths['testClassTest']);\n\t\t$this->report->group = $group;\n\n\t\tComplexity::apply($this->report, $group->tests());\n\n\t\t$results = array_pop($this->report->results['filters'][$this->_paths['complexity']]);\n\t\t$expected = [$this->_paths['testClass'] => $this->_metrics];\n\t\t$this->assertEqual($expected, $results);\n\n\t\tFilters::clear($group);\n\t}", "public function testLoader()\n {\n $suiteCollection = new SuiteCollection(array(\n TestUtil::createSuite(array(\n 'subjects' => array('benchOne', 'benchTwo'),\n 'benchmarks' => array('BenchOne', 'BenchTwo'),\n 'groups' => array('one', 'two'),\n 'output_time_unit' => 'milliseconds',\n 'output_mode' => 'throughput',\n 'revs' => 5,\n 'warmup' => 2,\n 'sleep' => 9,\n 'env' => array(\n 'system' => array(\n 'os' => 'linux',\n 'memory' => 8096,\n 'distribution' => 'debian',\n ),\n 'vcs' => array(\n 'system' => 'git',\n 'branch' => 'foo',\n ),\n ),\n )),\n TestUtil::createSuite(),\n ));\n\n $this->persister->persist($suiteCollection);\n $suiteCollection = $this->loader->load(new Comparison('$in', 'run', array(1, 2)));\n\n $suites = $suiteCollection->getSuites();\n $this->assertCount(2, $suites);\n\n $suite = current($suites);\n\n // assert env information\n $envInformations = $suite->getEnvInformations();\n $this->assertCount(2, $envInformations);\n $this->assertEquals('system', $envInformations[0]->getName());\n $this->assertEquals(array(\n 'os' => 'linux',\n 'memory' => 8096,\n 'distribution' => 'debian',\n ), iterator_to_array($envInformations[0]));\n $this->assertEquals('vcs', $envInformations[1]->getName());\n\n // assert benchmarks\n $benchmarks = $suite->getBenchmarks();\n $this->assertCount(2, $benchmarks);\n $this->assertEquals('BenchOne', $benchmarks[0]->getClass());\n $this->assertEquals('BenchTwo', $benchmarks[1]->getClass());\n\n // assert subjects\n $subjects = array_values($benchmarks[0]->getSubjects());\n $this->assertCount(2, $subjects);\n $this->assertEquals('benchOne', $subjects[0]->getName());\n $this->assertEquals('benchTwo', $subjects[1]->getName());\n $subject = $subjects[0];\n $this->assertEquals(array('one', 'two'), $subject->getGroups());\n $this->assertEquals(5, $subject->getRevs());\n $this->assertEquals(2, $subject->getWarmup());\n $this->assertEquals(9, $subject->getSleep());\n $this->assertEquals('milliseconds', $subject->getOutputTimeUnit());\n $this->assertEquals('throughput', $subject->getOutputMode());\n\n // assert variants\n $variants = $subject->getVariants();\n $this->assertCount(1, $variants);\n $variant = current($variants);\n\n // assert iterations\n $iterations = $variant->getIterations();\n $this->assertCount(2, $iterations);\n $iteration = current($iterations);\n $this->assertEquals(10, $iteration->getTime());\n $this->assertEquals(200, $iteration->getMemory());\n }", "public function run () {\r\n print \"\\n\";\r\n \r\n # Console spacing.\r\n foreach ( $this->tests as $test ) {\r\n if ( strlen( $test->name() ) > $this->longest_test_name_length )\r\n $this->longest_test_name_length = strlen( $test->name() );\r\n }\r\n \r\n foreach ( $this->tests as $test ) {\r\n $test->run();\r\n $this->print_test( $test );\r\n }\r\n \r\n $this->print_summary_stats();\r\n }", "public static function main()\n {\n\n PHPUnit_TextUI_TestRunner::run(self::suite());\n }", "function drush_test_xml_results($test_id, $dir, $info) {\n $dir = is_string($dir) ? $dir : '.';\n\n // Get an array of test result objects from the database.\n if (drush_drupal_major_version() >= 7) {\n $results = db_query(\"SELECT * FROM {simpletest} WHERE test_id = :test_id ORDER BY test_class, message_id\", array(':test_id' => $test_id));\n }\n else {\n $result = db_query(\"SELECT * FROM {simpletest} WHERE test_id = %d ORDER BY test_class, message_id\", $test_id);\n $results = array();\n while ($row = db_fetch_object($result)) {\n $results[] = $row;\n }\n }\n\n // Collect and aggregate the data from simpletest.\n $test_suites = array();\n foreach ($results as $result) {\n // Create test_suite object.\n // Formatting name so it becomes \"group.name\" without any other dots. Jenkins uses string splitting on dots to gather info.\n $test_suite_name = str_replace('.', '', $info['group']) . '.' . str_replace('.', '', $info['name']);\n if (!isset($test_suites[$test_suite_name])) {\n $test_suite = new stdClass();\n $test_suite->name = $test_suite_name;\n $test_suite->test_cases = array();\n $test_suites[$test_suite_name] = $test_suite;\n }\n else {\n $test_suite = $test_suites[$test_suite_name];\n }\n // Create test_case object.\n list(, $test_case_name) = explode('->', $result->function, 2);\n if (empty($test_case_name)) {\n // There is no '->' present on static function calls. Use the whole string in those cases.\n $test_case_name = $result->function;\n }\n $test_case_name = str_replace('.', '', $test_case_name); // Remove those dots Jenkins loves so much.\n if (!isset($test_suite->test_cases[$test_case_name])) {\n $test_case = new stdClass();\n $test_case->name = $test_case_name;\n $test_case->failure_message = '';\n $test_case->error_message = '';\n $test_case->system_out = '';\n $test_case->system_err = '';\n $test_suite->test_cases[$test_case_name] = $test_case;\n }\n else {\n $test_case = $test_suite->test_cases[$test_case_name];\n }\n // Prepare message.\n $status = str_pad($result->status . ':', 10);\n $message = strip_tags($result->message, '<a>'); // Jenkins encodes the output so don't use any tags.\n $message = preg_replace('/<a.*?href=\"([^\"]+)\".*?>(.*?)<\\/a>/', '$1 $2', $message); // Jenkins will turn urls into clickable links.\n $message = $status . ' [' . $result->message_group . '] ' . $message . ' [' . basename($result->file) . ':' . $result->line . \"]\\n\";\n // Everything is logged in system_out.\n $test_case->system_out .= $message;\n // Failures go to failures.\n if ($result->status == 'fail') {\n $test_case->failure_message .= $message;\n }\n // Exceptions go both to errors and system_err.\n if ($result->status == 'exception') {\n $test_case->error_message .= $message;\n $test_case->system_err .= $message;\n }\n }\n\n // Build an XML document from our results.\n $xml = new DOMDocument('1.0', 'UTF-8');\n foreach ($test_suites as $test_suite) {\n $test_suite_element = $xml->createElement('testsuite');\n $test_suite_element->setAttribute('name', $test_suite->name);\n foreach ($test_suite->test_cases as $test_case) {\n $test_case_element = $xml->createElement('testcase');\n $test_case_element->setAttribute('name', $test_case->name);\n if (!empty($test_case->failure_message)) {\n $failure_element = $xml->createElement('failure');\n $failure_element->setAttribute('message', $test_case->failure_message);\n $test_case_element->appendChild($failure_element);\n }\n if (!empty($test_case->error_message)) {\n $error_element = $xml->createElement('error');\n $error_element->setAttribute('message', $test_case->error_message);\n $test_case_element->appendChild($error_element);\n }\n if (!empty($test_case->system_out)) {\n $system_out_element = $xml->createElement('system-out');\n $system_out_element->appendChild($xml->createTextNode($test_case->system_out));\n $test_case_element->appendChild($system_out_element);\n }\n if (!empty($test_case->system_err)) {\n $system_err_element = $xml->createElement('system-err');\n $system_err_element->appendChild($xml->createTextNode($test_case->system_err));\n $test_case_element->appendChild($system_err_element);\n }\n $test_suite_element->appendChild($test_case_element);\n }\n $xml->appendChild($test_suite_element);\n }\n // Save to disk.\n file_put_contents($dir . '/testsuite-' . $test_id . '.xml', $xml->saveXML());\n}", "public function startTestSuite(PHPUnit_Framework_TestSuite $suite)\n {\n if (class_exists($suite->getName()) && is_subclass_of($suite->getName(), '\\\\PHPUnit_Framework_TestCase')) {\n $this->_run(static::SCOPE_TEST_CASE);\n }\n }", "public static function main()\n {\n $suite = new TestSuite(__CLASS__);\n $result = (new resources_Runner())->run($suite);\n }", "public static function main()\n {\n require_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite(\"Zend_Form_Element_CheckboxTest\");\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "public function process()\n\t{\n\t\t$aVals = $this->request()->getArray('val');\n\t\t$this->testInstall();\n\n\t\t// $this->testInstall();\n\n\t\tif($aVals) {\n\t\t\tPhpfox::getService('unittest.test.socialad')->test($aVals['test_suite']);\n\n\t\t\t$sContent = ob_get_contents();\n\t\t\tob_clean();\n\t\t\techo(str_replace(\"\\n\", \"</br>\", $sContent));\n\t\t\tob_end_flush();\n\t\t\texit;\n\t\t}\n\n\t\t$this->template()->assign(array(\n\t\t\t'aTestSuites' => Phpfox::getService('unittest.test.socialad')->getTestSuites()\n\t\t));\n\t}", "public static function suite()\n {\n $suite = new PHPUnit_Framework_TestSuite('Module Tests');\n\n P4Cms_Module::setCoreModulesPath(APPLICATION_PATH);\n P4Cms_Module::addPackagesPath(MODULE_PATH);\n\n // save working directory.\n $cwd = getcwd();\n\n foreach (P4Cms_Module::fetchAll() as $module) {\n // detect and load phpunit.xml file.\n $configFile = $module->getPath() . '/tests/phpunit.xml';\n if (file_exists($configFile)) {\n chdir(dirname($configFile));\n $config = PHPUnit_Util_Configuration::getInstance($configFile);\n $config->handlePHPConfiguration();\n $suite->addTest($config->getTestSuiteConfiguration());\n continue;\n }\n \n // fallback - detect and load AllTests.php file.\n $suiteFile = $module->getPath() . '/tests/AllTests.php';\n if (file_exists($suiteFile)) {\n P4Cms_Loader::addPackagePath($module->getName(), $module->getPath());\n $testClassName = $module->getName().'_Test_AllTests';\n $suite->addTest($testClassName::suite());\n }\n\n }\n\n // restore working directory.\n chdir($cwd);\n\n return $suite;\n }", "public function testBuildFilterLevel()\n {\n $astSubtree = new ASTGroup(\n 'T_LOGIC_AND',\n [\n new ASTGroup(\n 'T_LOGIC_OR',\n [\n new ASTAssertion(\n 'test_dse_1',\n 'T_OP_EQ',\n 'value1'\n ),\n new ASTAssertion(\n 'test_dse_2',\n 'T_OP_LT',\n 'value2'\n )\n ]\n ),\n new ASTAssertion(\n 'test_dse_3',\n 'T_OP_NEQ',\n 'value3'\n )\n ]\n );\n\n $filterDefinition1 = new Filter();\n $filterDefinition1->setConditionType('OR');\n $filter1 = new FilterCondition('test_dse_1', FilterCondition::METHOD_NUMERIC_EQ, 'value1');\n $filter2 = new FilterCondition('test_dse_2', FilterCondition::METHOD_NUMERIC_LT, 'value2');\n $filterDefinition1[] = $filter1;\n $filterDefinition1[] = $filter2;\n $filter3 = new FilterCondition('test_dse_3', FilterCondition::METHOD_NUMERIC_NEQ, 'value3');\n $filterDefinition2 = new Filter();\n $filterDefinition2->setConditionType('AND');\n $filterDefinition2[] = $filterDefinition1;\n $filterDefinition2[] = $filter3;\n\n $expectedFilterTree = $filterDefinition2;\n\n $dataSourceElements = [\n new Field('test_dse_1', '', '', new NumberDataType()),\n new Field('test_dse_2', '', '', new NumberDataType()),\n new Field('test_dse_3', '', '', new NumberDataType()),\n ];\n\n $dataSource = $this->getMock('Netdudes\\DataSourceryBundle\\DataSource\\DataSourceInterface');\n $dataSource->expects($this->any())\n ->method('getFields')\n ->will($this->returnValue($dataSourceElements));\n\n $extensionContainer = $this->getMockBuilder('Netdudes\\DataSourceryBundle\\Extension\\TableBundleExtensionContainer')\n ->disableOriginalConstructor()\n ->getMock();\n $interpreterFactory = new InterpreterFactory($extensionContainer);\n $interpreter = $interpreterFactory->create($dataSource);\n\n $this->assertEquals($expectedFilterTree, $interpreter->buildFilterLevel($astSubtree));\n }", "public function runTests()\n {\n $this->testCase(1, array (1, 1));\n $this->testCase(2, array (1, 2));\n $this->testCase(3, array (2, 2));\n $this->testCase(4, array (2, 2));\n $this->testCase(5, array (2, 3));\n $this->testCase(6, array (2, 3));\n $this->testCase(7, array (3, 3));\n $this->testCase(8, array (3, 3));\n $this->testCase(9, array (3, 3));\n $this->testCase(10, array(2, 5));\n $this->testCase(11, array(3, 4));\n $this->testCase(12, array(3, 4));\n $this->testCase(13, array(4, 4));\n $this->testCase(14, array(4, 4));\n $this->testCase(15, array(4, 4));\n $this->testCase(16, array(4, 4));\n $this->testCase(17, array(3, 6));\n $this->testCase(18, array(3, 6));\n $this->testCase(19, array(4, 5));\n $this->testCase(20, array(4, 5));\n $this->testCase(21, array(3, 7));\n $this->testCase(22, array(5, 5));\n $this->testCase(23, array(5, 5));\n $this->testCase(24, array(5, 5));\n $this->testCase(25, array(5, 5));\n $this->testCase(26, array(4, 7));\n $this->testCase(27, array(4, 7));\n $this->testCase(28, array(4, 7));\n $this->testCase(29, array(5, 6));\n $this->testCase(30, array(5, 6));\n $this->testCase(31, array(4, 8));\n $this->testCase(32, array(4, 8));\n $this->testCase(33, array(6, 6));\n $this->testCase(34, array(6, 6));\n $this->testCase(35, array(6, 6));\n $this->testCase(36, array(6, 6));\n $this->testCase(37, array(5, 8));\n $this->testCase(38, array(5, 8));\n $this->testCase(39, array(5, 8));\n $this->testCase(40, array(5, 8));\n $this->testCase(41, array(6, 7));\n $this->testCase(42, array(6, 7));\n $this->testCase(43, array(5, 9));\n $this->testCase(44, array(5, 9));\n $this->testCase(45, array(5, 9));\n $this->testCase(46, array(7, 7));\n $this->testCase(47, array(7, 7));\n $this->testCase(48, array(7, 7));\n $this->testCase(49, array(7, 7));\n $this->testCase(50, array(5, 10));\n $this->testCase(51, array(6, 9));\n $this->testCase(52, array(6, 9));\n $this->testCase(53, array(6, 9));\n $this->testCase(54, array(6, 9));\n $this->testCase(55, array(7, 8));\n $this->testCase(56, array(7, 8));\n $this->testCase(57, array(6, 10));\n $this->testCase(58, array(6, 10));\n $this->testCase(59, array(6, 10));\n $this->testCase(60, array(6, 10));\n $this->testCase(61, array(8, 8));\n $this->testCase(62, array(8, 8));\n $this->testCase(63, array(8, 8));\n $this->testCase(64, array(8, 8));\n $this->testCase(65, array(6, 11));\n $this->testCase(66, array(6, 11));\n $this->testCase(67, array(7, 10));\n $this->testCase(68, array(7, 10));\n $this->testCase(69, array(7, 10));\n $this->testCase(70, array(7, 10));\n $this->testCase(71, array(8, 9));\n $this->testCase(72, array(8, 9));\n $this->testCase(73, array(7, 11));\n $this->testCase(74, array(7, 11));\n $this->testCase(75, array(7, 11));\n $this->testCase(76, array(7, 11));\n $this->testCase(77, array(7, 11));\n $this->testCase(78, array(9, 9));\n $this->testCase(79, array(9, 9));\n $this->testCase(80, array(9, 9));\n $this->testCase(81, array(9, 9));\n $this->testCase(82, array(7, 12));\n $this->testCase(83, array(7, 12));\n $this->testCase(84, array(7, 12));\n $this->testCase(85, array(8, 11));\n $this->testCase(86, array(8, 11));\n $this->testCase(87, array(8, 11));\n $this->testCase(88, array(8, 11));\n $this->testCase(89, array(9, 10));\n $this->testCase(90, array(9, 10));\n $this->testCase(91, array(7, 13));\n $this->testCase(92, array(8, 12));\n $this->testCase(93, array(8, 12));\n $this->testCase(94, array(8, 12));\n $this->testCase(95, array(8, 12));\n $this->testCase(96, array(8, 12));\n $this->testCase(97, array(10, 10));\n $this->testCase(98, array(10, 10));\n $this->testCase(99, array(10, 10));\n $this->testCase(100, array(10, 10));\n }", "public function run ()\n { \n $this->fireCallback (self::TEST_SUITE_BEFORE);\n \n foreach ($this->getTestCases () as $name => $testCase)\n {\n $this->fireCallback (self::TEST_CASE_BEFORE);\n \n $this->_switchTestCase ($name);\n $testCase ($this);\n \n $this->fireCallback (self::TEST_CASE_AFTER);\n }\n \n $this->fireCallback (self::TEST_SUITE_AFTER);\n \n // I want to override $this\n $isolation = function ($structure, $suiteName)\n {\n require_once __DIR__ . '/views/main.php';\n };\n \n $isolation ($this->getAssertions (), $this->getName ());\n }", "public static function main()\n\t{\n\t\trequire_once \"PHPUnit/TextUI/TestRunner.php\";\n\n\t\t$suite = new PHPUnit_Framework_TestSuite(\"EssentialsTest\");\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "public static function main()\n {\n $suite = new TestSuite(\"Zend_Form_Element_RadioTest\");\n $result = (new resources_Runner())->run($suite);\n }", "public static function run() {\n\t\t$dispatcher = new HHVMTestSuiteDispatcher();\n\t\t$dispatcher->dispatch();\n\t}", "static public function suite() {\n return Dev_Unit::load_with_prefix('Test.Templates.HTML.Forms.', 'Case');\n }", "public function reRunSuite(): void\n {\n $args = $_SERVER['argv'];\n $env = $this->executionContext ? $this->executionContext->asEnv() : array();\n\n $env = array_filter(\n array_merge($env, $_SERVER),\n function($x): bool { return !is_array($x); }\n );\n\n pcntl_exec($this->getExecutablePath(), $args, $env);\n }", "public function setSuite()\n {\n $this->_suite = true;\n }", "function reorderTestSuiteViewer(&$smartyObj,&$treeMgr,$argsObj)\r\n{\r\n $level = null;\r\n $oid = is_null($argsObj->testsuiteID) ? $argsObj->containerID : $argsObj->testsuiteID;\r\n $children = $treeMgr->get_children($oid, \r\n array(\"testplan\" => \"exclude_me\",\"requirement_spec\" => \"exclude_me\"));\r\n $object_info = $treeMgr->get_node_hierarchy_info($oid);\r\n $object_name = $object_info['name'];\r\n\r\n\r\n if (!sizeof($children))\r\n { \r\n $children = null;\r\n }\r\n\r\n $smartyObj->assign('arraySelect', $children);\r\n $smartyObj->assign('objectID', $oid);\r\n $smartyObj->assign('object_name', $object_name);\r\n\r\n if($oid == $argsObj->tprojectID)\r\n {\r\n $level = 'testproject';\r\n $smartyObj->assign('level', $level);\r\n $smartyObj->assign('page_title',lang_get('container_title_' . $level));\r\n }\r\n\r\n return $level;\r\n}", "public function executeIndex ()\n {\n// $loader->load();\n $tree = array();\n /*$added_tests = array();\n foreach ($this->_getTests($loader->suite()) as $test) {\n $reflection = new ReflectionClass($test);\n $test = $reflection->getFileName();\n $test = substr($test, strpos($test, 'phpunit/') + 8, strlen($test));\n $path = dirname($reflection->getFileName());\n $path = substr($path, strpos($path, 'phpunit/') + 8, strlen($path));\n $path = implode('\"][\"', explode('/', $path));\n if (! in_array($test, $added_tests)) {\n eval(\"\\$tree[\\\"{$path}\\\"][] = \\$test;\");\n $added_tests[] = $test;\n }\n }*/\n $this->tree = $tree;\n \n \n $this->fixtureslist = $this->_getFixturesList();\n }", "private function init(): void\n {\n $this->initSuite();\n $cases = $this->getCaseNodes();\n foreach ($cases as $file => $nodeArray) {\n $this->initSuiteFromCases($nodeArray);\n }\n }", "function moveTestSuiteViewer(&$smartyObj,&$tprojectMgr,$argsObj)\r\n{\r\n $testsuites = $tprojectMgr->gen_combo_test_suites($argsObj->tprojectID,\r\n array($argsObj->testsuiteID => 'exclude'));\r\n // Added the Test Project as the FIRST Container where is possible to copy\r\n $testsuites = array($argsObj->tprojectID => $argsObj->tprojectName) + $testsuites;\r\n\r\n // original container (need to comment this better)\r\n $smartyObj->assign('old_containerID', $argsObj->tprojectID);\r\n $smartyObj->assign('containers', $testsuites);\r\n $smartyObj->assign('objectID', $argsObj->testsuiteID);\r\n $smartyObj->assign('object_name', $argsObj->tsuite_name);\r\n $smartyObj->assign('top_checked','checked=checked');\r\n $smartyObj->assign('bottom_checked','');\r\n}", "public static function suite() {\n\t\t$suite = new CakeTestSuite('All Plugin plugins test');\n\t\t$plugins = App::objects('plugin', APP . 'Plugin', false);\n\t\tforeach ($plugins as $plugin) {\n\t\t\tif (CakePlugin::loaded($plugin)) {\n\t\t\t\t$file = CakePlugin::path($plugin) . 'Test' . DS . 'Case' . DS . 'All' . $plugin . 'TestsTest.php';\n\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t$suite->addTestFile($file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $suite;\n\t}", "public static function main()\n {\n $suite = new PHPUnit_Framework_TestSuite('Tinebase_CustomFieldTest');\n PHPUnit_TextUI_TestRunner::run($suite);\n }", "function suite($title, $fn=null) {\n $desc = new TestSuite($title, $fn);\n if (!$fn) {\n Util::set_default_filename_and_lineno($desc, debug_backtrace());\n }\n $desc->set_parent(Preview::$world->current());\n Preview::$world->push($desc);\n $desc->setup();\n Preview::$world->pop();\n return new TestAPI($desc);\n}", "public function testGetItemSubCategoryByFilter()\n {\n }", "abstract protected function doRun(array $testArgs);", "private function config_OSF_TestsSuites()\n {\n // Get package info\n $configPath = \"{$this->osf_web_services_folder}/{$this->osf_tests_suites_folder}\";\n\n // Configure\n $this->span(\"Configuring...\", 'info');\n // Web Service paths\n $this->sed(\"REPLACEME\", \"{$this->osf_web_services_folder}/StructuredDynamics/osf\",\n \"{$configPath}/phpunit.xml\");\n $this->sed(\"\\$this-\\>osfInstanceFolder = \\\".*\\\";\", \"\\$this-\\>osfInstanceFolder = \\\"{$this->osf_web_services_folder}/{$this->osf_web_services_ns}/\\\";\",\n \"{$configPath}/Config.php\");\n $this->sed(\"\\$this-\\>endpointUrl = \\\".*/ws/\\\";\", \"\\$this-\\>endpointUrl = \\\"http://{$this->osf_web_services_domain}/ws/\\\";\",\n \"{$configPath}/Config.php\");\n $this->sed(\"\\$this-\\>endpointUri = \\\".*/wsf/ws/\\\";\", \"\\$this-\\>endpointUri = \\\"http://{$this->osf_web_services_domain}/wsf/ws/\\\";\",\n \"{$configPath}/Config.php\");\n $this->sed(\"\\$this-\\>userID = '.*/wsf/users/tests-suites';\", \"\\$this-\\>userID = 'http://{$this->osf_web_services_domain}/wsf/users/tests-suites';\",\n \"{$configPath}/Config.php\");\n $this->sed(\"\\$this-\\>adminGroup = '.*/wsf/groups/administrators';\", \"\\$this-\\>adminGroup = 'http://{$this->osf_web_services_domain}/wsf/groups/administrators';\",\n \"{$configPath}/Config.php\");\n $this->sed(\"\\$this-\\>testGroup = \\\".*/wsf/groups/unittests\\\";\", \"\\$this-\\>testGroup = \\\"http://{$this->osf_web_services_domain}/wsf/groups/unittests\\\";\",\n \"{$configPath}/Config.php\");\n $this->sed(\"\\$this-\\>testUser = \\\".*/wsf/users/unittests\\\";\", \"\\$this-\\>testUser = \\\"http://{$this->osf_web_services_domain}/wsf/users/unittests\\\";\",\n \"{$configPath}/Config.php\");\n // Web Service credentials\n $this->sed(\"\\$this-\\>applicationID = '.*';\", \"\\$this-\\>applicationID = '{$this->application_id}';\",\n \"{$configPath}/Config.php\");\n $this->sed(\"\\$this-\\>apiKey = '.*';\", \"\\$this-\\>apiKey = '{$this->api_key}';\",\n \"{$configPath}/Config.php\");\n }", "public static function main()\n {\n $suite = new PHPUnit_Framework_TestSuite('Tine 2.0 ActiveSync Backend SyncState Tests');\n PHPUnit_TextUI_TestRunner::run($suite);\n }", "private function _test_exec() {\n\t\t// pro kazdy jeden testovaci soubor\n\t\tforeach ($this->_dirs as $name => $dir) {\n\t\t\tforeach ($dir as $index => $test) {\n\t\t\t\t// pro kazdou cestu proved test\n\t\t\t\t$test_ret = $this->_test_single_test($test[0], $test[1]);\n\t\t\t\t// vysledek testu uloz\n\t\t\t\t$this->_dirs[$name][$index][1] = $test_ret;\n\t\t\t}\n\t\t}\n\n\t\t$this->_test_render();\n\t}", "function ContextHierarchy() {\n // The 'custom' config file has higher priority than cli and config files.\n $eval = '$contextConfig = drush_get_option(\"contextConfig\", \"n/a\");';\n $eval .= '$cli1 = drush_get_option(\"cli1\");';\n $eval .= 'print json_encode(get_defined_vars());';\n $config = UNISH_SANDBOX . '/drushrc.php';\n $options = array(\n 'cli1' => NULL,\n 'config' => $config,\n 'root' => $this->root,\n 'uri' => $this->env,\n );\n $this->drush('php-eval', array($eval), $options);\n $output = $this->getOutput();\n $actuals = json_decode(trim($output));\n $this->assertEquals('custom', $actuals->contextConfig);\n $this->assertTrue($actuals->cli1);\n\n // Site alias trumps 'custom'.\n $eval = '$contextConfig = drush_get_option(\"contextConfig\", \"n/a\");';\n $eval .= 'print json_encode(get_defined_vars());';\n $options = array(\n 'config' => $config,\n 'root' => $this->root,\n 'uri' => $this->env,\n );\n $this->drush('php-eval', array($eval), $options, '@contextAlias');\n $output = $this->getOutput();\n $actuals = json_decode(trim($output));\n $this->assertEquals('alias1', $actuals->contextConfig);\n\n // Command specific wins over non-specific. Note we call unit-eval command\n // in order not to purturb php-eval with options in config file.\n $eval = '$contextConfig = drush_get_option(\"contextConfig\", \"n/a\");';\n $eval .= 'print json_encode(get_defined_vars());';\n $options = array(\n 'root' => $this->root,\n 'uri' => $this->env,\n 'config' => $config,\n 'include' => dirname(__FILE__),\n );\n $this->drush('unit-eval', array($eval), $options);\n $output = $this->getOutput();\n $actuals = json_decode(trim($output));\n $this->assertEquals('custom-specific', $actuals->contextConfig);\n }", "public function testComplexScenario()\n {\n /**\n * TOP LEVEL\n * +-----------------------------+\n * | 2 columns, with nested: |\n * | C1 |\n * | C11 C12 |\n * | +-----------+-------------+ |\n * | | | C2 | |\n * | | | C21 C22 | |\n * | | | +----+----+ | |\n * | | A1 | | A2 | B3 | | |\n * | | B4 | | A5 | | | |\n * | | | +----+----+ | |\n * | +-----+-----+-------------+ |\n * | |\n * | 3 columns: |\n * | C3 |\n * | C31 C32 C33 |\n * | +------+------+-----------+ |\n * | | A6 | B7 | B8 | |\n * | | A9 | B10 | B11 | |\n * | | | | A1* | |\n * | +------+------+-----------+ |\n * | |\n * | A12 |\n * | *B7 |\n * +-----------------------------+\n *\n * C: Container\n * A: Item of type A\n * B: Item of type B\n * *: Duplicated item\n *\n * Note that duplicated items will have different styles\n */\n\n // We will need a storage to have identifiers\n $storage = new TestTokenLayoutStorage();\n $storage->saveToken(new EditToken('testing', []));\n\n // Create types\n $typeRegistry = $this->createTypeRegistry();\n $aType = $typeRegistry->getType('a');\n $bType = $typeRegistry->getType('b');\n\n // Place a top level container and build layout (no items)\n $layout = new TestLayout(7);\n $topLevel = $layout->getTopLevelContainer();\n $c1 = new HorizontalContainer('C1');\n $topLevel->append($c1);\n $c11 = $c1->appendColumn('C11');\n $c12 = $c1->appendColumn('C12');\n $c2 = new HorizontalContainer('C2');\n $c12->append($c2);\n $c21 = $c2->appendColumn('C21');\n $c22 = $c2->appendColumn('C22');\n $c3 = new HorizontalContainer('C3');\n $topLevel->append($c3);\n $c31 = $c3->appendColumn('C31');\n $c32 = $c3->appendColumn('C32');\n $c33 = $c3->appendColumn('C33');\n\n // Now place all items\n $a1_1 = $aType->create(1);\n $a1_2 = $aType->create(1, 'foo');\n $a2 = $aType->create(2);\n $b3 = $bType->create(3);\n $b4 = $bType->create(4, 'teaser');\n $a5 = $aType->create(5);\n $a6 = $aType->create(6);\n $b7_1 = $bType->create(7);\n $b7_2 = $bType->create(7, 'bar');\n $b8 = $bType->create(8);\n $a9 = $aType->create(9);\n $b10 = $bType->create(10);\n $b11 = $bType->create(11);\n $a12 = $aType->create(12);\n\n $c11->append($a1_1);\n $c11->append($b4);\n\n $c21->append($a2);\n $c21->append($a5);\n\n $c22->append($b3);\n\n $c31->append($a6);\n $c31->append($a9);\n\n $c32->append($b7_1);\n $c32->append($b10);\n\n $c33->append($b8);\n $c33->append($b11);\n $c33->append($a1_2);\n\n $topLevel->append($a12);\n $topLevel->append($b7_2);\n\n // We need to save the layout to have storage identifiers\n $storage->update('testing', $layout);\n\n // And go for some searches.\n $found = $layout->findContainer($c21->getStorageId());\n $this->assertSame($c21, $found);\n $found = $layout->findContainerOf($b10->getStorageId());\n $this->assertSame($c32, $found);\n $found = $layout->findItem($b3->getStorageId());\n $this->assertSame($b3, $found);\n\n // And also invalid searches\n try {\n // Container is an item\n $layout->findContainer($a5->getStorageId());\n $this->fail();\n } catch (GenericError $e) {\n $this->assertTrue(true);\n }\n try {\n // Container does not exists\n $layout->findContainer(555);\n $this->fail();\n } catch (GenericError $e) {\n $this->assertTrue(true);\n }\n try {\n // Item does not exists\n $layout->findItem(666);\n $this->fail();\n } catch (GenericError $e) {\n $this->assertTrue(true);\n }\n try {\n // Item or container does not exists\n $layout->findContainerOf(999);\n $this->fail();\n } catch (GenericError $e) {\n $this->assertTrue(true);\n }\n }", "public static function suite() {\n\t\t$suite = new CakeTestSuite('All Attempt Plugin Tests');\n\n\t\t$basePath = CakePlugin::path('Attempt') . 'Test' . DS . 'Case' . DS;\n\t\t// controllers\n\t\t$suite->addTestFile($basePath . 'Controller' . DS . 'Component' . DS . 'AttemptComponentTest.php');\n\t\t// models\n\t\t$suite->addTestFile($basePath . 'Model' . DS . 'AttemptTest.php');\n\n\t\treturn $suite;\n\t}", "function test() {\n $testmethods = get_class_methods($this);\n foreach ($testmethods as $curtestmethod) {\n // filtering class methods by names. A test method name should start with 'data_for_test_'\n $pos = strstr($curtestmethod, 'data_for_test_');\n if ($pos != false && $pos == 0) {\n $data = $this->$curtestmethod();\n $regex = $data['regex'];\n $modifiers = null;\n if (array_key_exists('modifiers', $data)) {\n $modifiers = $data['modifiers'];\n }\n // iterate over available engines\n foreach ($this->engines as $enginename) {\n $matcher = new $enginename($regex, $modifiers);\n if (!$this->check_for_errors($matcher)) {\n // iterate over all tests\n foreach ($data['tests'] as $expected) {\n $str = $expected['str'];\n $matcher->match($str);\n $matchername = $matcher->name();\n $obtained = $matcher->get_match_results();\n // not the results are obtained, let us check them!\n if (array_key_exists('is_match', $expected)) {\n // compare with single result\n $ismatchpassed = false;\n $fullpassed = false;\n $indexfirstpassed = false;\n $indexlastpassed = false;\n $nextpassed = false;\n $leftpassed = false;\n $this->compare_results($matcher, $expected, $obtained, $ismatchpassed, $fullpassed, $indexfirstpassed, $indexlastpassed, $nextpassed, $leftpassed);\n $this->do_assertions($matchername, $regex, $str, $obtained, $ismatchpassed, $fullpassed, $indexfirstpassed, $indexlastpassed, $nextpassed, $leftpassed);\n } else {\n // compare with multiple results\n $ismatchpassed = array();\n $fullpassed = array();\n $indexfirstpassed = array();\n $indexlastpassed = array();\n $nextpassed = array();\n $leftpassed = array();\n $indexmatch = array(); // index of $expecter['results'] which match obtained $index_first and $index_last\n $passed = false;\n foreach ($expected['results'] as $key=>$curexpected) {\n $ismatchpassed[$key] = false;\n $fullpassed[$key] = false;\n $indexfirstpassed[$key] = false;\n $indexlastpassed[$key] = false;\n $nextpassed[$key] = false;\n $leftpassed[$key] = false;\n $passed = $passed || $this->compare_results($matcher, $curexpected, $obtained, $ismatchpassed[$key], $fullpassed[$key], $indexfirstpassed[$key], $indexlastpassed[$key], $nextpassed[$key], $leftpassed[$key]);\n if ($indexfirstpassed[$key] && $indexlastpassed[$key]) {\n $indexmatch[] = $key;\n }\n }\n $this->assertTrue($passed, \"$matchername failed on regex '$regex' and string '$str'\");\n // if the test is not passed - display obtained results\n if (!$passed) {\n // if some indexes were matched - display other fields not matched\n foreach ($indexmatch as $key) {\n $number = $key + 1;\n echo \"Results of comparison for the $number possible result:<br/>\";\n $this->do_assertions($matchername, $regex, $str, $obtained, $ismatchpassed[$key], $fullpassed[$key], $indexfirstpassed[$key], $indexlastpassed[$key], $nextpassed[$key], $leftpassed[$key], true);\n echo '<br/>';\n }\n // if indexes were not matched at all - just print the obtained result\n if (count($indexmatch) == 0) {\n echo \"Indexes not matched at all. Obtained result is:<br/>\";\n echo 'is_match = ' . $obtained['is_match']; echo '<br/>';\n echo 'full = ' . $obtained['full']; echo '<br/>';\n if (array_key_exists('index_first', $obtained)) {\n echo 'index_first = '; print_r($obtained['index_first']); echo '<br/>';\n }\n if (array_key_exists('index_last', $obtained)) {\n echo 'index_last = '; print_r($obtained['index_last']); echo '<br/>';\n }\n if (array_key_exists('next', $obtained)) {\n echo 'next = ' . $obtained['next'] . '<br/>';\n }\n if (array_key_exists('left', $obtained)) {\n echo 'left = ' . $obtained['left'] . '<br/>';\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }", "public static function suite()\n {\n // Use a special PHP_CodeSniffer test suite so that we can\n // unset our autoload function after the run.\n $suite = new TestSuite('PHP CodeSniffer');\n $suite->addTest(AllSniffs::suite());\n // Unregister this here because the PEAR tester loads\n // all package suites before running then, so our autoloader\n // will cause problems for the packages included after us.\n spl_autoload_unregister(['PHP_CodeSniffer', 'autoload']);\n\n return $suite;\n }", "public function testGetOptionParser()\n {\n $this->shell->loadTasks();\n $parser = $this->shell->getOptionParser();\n $this->assertArrayHasKey('init', $parser->subcommands());\n $this->assertArrayHasKey('extract', $parser->subcommands());\n }", "public function runTestSuite(array $testSuite, $trimOutput = true)\n {\n $output = '';\n\n foreach ($testSuite as $test) {\n $output .= $this->runTest($test, $trimOutput);\n }\n\n return $output;\n }", "function getTests(){\n $listOfAvailableTests = parent::getTests();\n $url = get_instance()->uri->uri_string();\n $listOfSubTests = trim(Text::getSubstringAfter($url, '/subtests/'));\n if($listOfSubTests){\n $listOfSubTests = explode(',', $listOfSubTests);\n foreach($listOfSubTests as $key => &$subTest){\n $subTest = trim($subTest);\n if(!in_array($subTest, $listOfAvailableTests)){\n unset($listOfSubTests[$key]);\n echo \"Test '$subTest' does not exist as a test within \" . $this->getLabel() . \"<br/>\";\n }\n }\n $listOfSkippedTests = array_diff($listOfAvailableTests, $listOfSubTests);\n $this->reporter->paintSkip(count($listOfSkippedTests) . \" tests not run.\");\n $listOfAvailableTests = $listOfSubTests;\n }\n return $listOfAvailableTests;\n }", "public static function suite() {\n\t\t$suite = new PHPUnit_Framework_TestSuite('MongoDB Plugin tests');\n $casePath = CakePlugin::path('Mongodb') . DS . 'Test' . DS . 'Case';\n\t\t$suite->addTestFile($casePath . DS . 'Behavior' . DS . 'SqlCompatibleTest.php');\n\t\t$suite->addTestFile($casePath . DS . 'Behavior' . DS . 'SubCollectionValidatorBehaviorTest.php');\n\t\t$suite->addTestFile($casePath . DS . 'Datasource' . DS . 'MongodbSourceTest.php');\n\t\t$suite->addTestFile($casePath . DS . 'Model' . DS . 'MongodbAssociationsTest.php');\n\t\t$suite->addTestFile($casePath . DS . 'Model' . DS . 'MongodbInheritanceModelTest.php');\n\t\treturn $suite;\n\t}", "public static function suite() {\n\t\t$suite = new CakeTestSuite('All ArraySort Tests');\n\n\t\t$path = App::pluginPath('ArraySort') . 'Test' . DS . 'Case' . DS;\n\t\t$suite->addTestDirectoryRecursive($path);\n\t\treturn $suite;\n\t}", "function deleteTestSuite(&$smartyObj,&$argsObj,&$tsuiteMgr,&$treeMgr,&$tcaseMgr,$level)\r\n{\r\n\r\n $feedback_msg = '';\r\n $system_message = '';\r\n $testcase_cfg = config_get('testcase_cfg');\r\n $can_delete = 1;\r\n\r\n if($argsObj->bSure)\r\n {\r\n $tsuite = $tsuiteMgr->get_by_id($argsObj->objectID);\r\n $tsuiteMgr->delete_deep($argsObj->objectID);\r\n $tsuiteMgr->deleteKeywords($argsObj->objectID);\r\n $smartyObj->assign('objectName', $tsuite['name']);\r\n $doRefreshTree = true;\r\n $feedback_msg = 'ok';\r\n $smartyObj->assign('user_feedback',lang_get('testsuite_successfully_deleted'));\r\n }\r\n else\r\n {\r\n $doRefreshTree = false;\r\n\r\n // Get test cases present in this testsuite and all children\r\n $testcases = $tsuiteMgr->get_testcases_deep($argsObj->testsuiteID);\r\n $map_msg['warning'] = null;\r\n $map_msg['link_msg'] = null;\r\n $map_msg['delete_msg'] = null;\r\n\r\n if(is_null($testcases) || count($testcases) == 0)\r\n {\r\n $can_delete = 1;\r\n }\r\n else\r\n {\r\n $map_msg = build_del_testsuite_warning_msg($treeMgr,$tcaseMgr,$testcases,$argsObj->testsuiteID);\r\n if( in_array('linked_and_executed', (array)$map_msg['link_msg']) )\r\n {\r\n $can_delete = $argsObj->grants->delete_executed_testcases;\r\n }\r\n }\r\n\r\n $system_message = '';\r\n if(!$can_delete && !$argsObj->grants->delete_executed_testcases)\r\n {\r\n $system_message = lang_get('system_blocks_tsuite_delete_due_to_exec_tc');\r\n }\r\n\r\n // prepare to show the delete confirmation page\r\n $smartyObj->assign('can_delete',$can_delete);\r\n $smartyObj->assign('objectID',$argsObj->testsuiteID);\r\n $smartyObj->assign('objectName', $argsObj->tsuite_name);\r\n $smartyObj->assign('delete_msg',$map_msg['delete_msg']);\r\n $smartyObj->assign('warning', $map_msg['warning']);\r\n $smartyObj->assign('link_msg', $map_msg['link_msg']);\r\n }\r\n $smartyObj->assign('system_message', $system_message);\r\n $smartyObj->assign('page_title', lang_get('delete') . \" \" . lang_get('container_title_' . $level));\r\n $smartyObj->assign('sqlResult',$feedback_msg);\r\n\r\n return $doRefreshTree;\r\n}", "public function supportsSuite(Suite $suite);", "abstract protected function run_tests($code, $testcases);", "public function __construct()\n\t{\n\t\t$this->setName('AllTests');\n\t\t\n\t\t// Tests for util package\n\t\t$this->addTestSuite('VarProfileTest');\n\t\t\n\t\t// Tests for shop package\n\t\t$this->addTestSuite('ProductTest');\n\t\t$this->addTestSuite('ProductEntryTest');\n\t\t$this->addTestSuite('ShoppingCartTest');\n\t}", "public function test(array $suiteNames): CollectionBuilder {\n return $this->getTaskPhpunitRun($suiteNames);\n }", "public function run()\n {\n foreach ($this->getTestMethods() as $method)\n {\n $test = $method->getName();\n\n $this->info(sfInflector::humanize(sfInflector::underscore(substr($test, 4))));\n $this->setUp();\n $this->$test();\n $this->tearDown();\n }\n }", "public static function main() {\n PHPUnit_TextUI_TestRunner::run(new PHPUnit_Framework_TestSuite(__CLASS__));\n }", "public static function main() {\n PHPUnit_TextUI_TestRunner::run(new PHPUnit_Framework_TestSuite(__CLASS__));\n }", "public function test_scenario3() {\n\n $data = array(array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_1.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_1.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => true, \"stem_words\" => true, \"use_stopwords\" => false, \"language\" => \"en\"))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_2.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_2.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => true, \"stem_words\" => true, \"use_stopwords\" => false))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_3.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_3.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => false, \"stem_words\" => false, \"use_stopwords\" => false, \"language\" => \"en\"))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_4.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_4.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => false, \"stem_words\" => true, \"use_stopwords\" => true, \"language\" => \"en\"))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_5.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_5.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"token_mode\" => \"full_terms_only\", \"language\" => \"en\" )))))\n );\n\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a model and translate the tree model into a set of IF-THEN rules\\n\";\n\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 10000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I update the source with options \" . json_encode($item[\"options\"]) . \"\\n\";\n\t $source = self::$api->update_source($source->resource, $item[\"options\"]);\n\t $this->assertEquals(BigMLRequest::HTTP_ACCEPTED, $source->code);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 10000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wait until the model is ready \". $model->resource . \"\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 10000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"And I translate the tree into IF_THEN rules\\n\";\n\n $fp = fopen($item[\"local_file\"], 'w');\n $local_model->rules($fp);\n fclose($fp);\n print \" Then I check the output is like \" . $item[\"expected_file\"] . \" expected file\\n\";\n $this->assertEquals(0, strcmp(trim(file_get_contents($item[\"local_file\"])), trim(file_get_contents($item[\"expected_file\"]))));\n\n }\n }", "public function testSortWithSuites()\n {\n // mock tests for test object handler.\n $numberOfCalls = 0;\n $mockTest1 = AspectMock::double(\n TestObject::class,\n ['getEstimatedDuration' => function () use (&$numberOfCalls) {\n $actionCount = [300, 275];\n $result = $actionCount[$numberOfCalls];\n $numberOfCalls++;\n\n return $result;\n }]\n )->make();\n\n $mockHandler = AspectMock::double(\n TestObjectHandler::class,\n ['getObject' => function () use ($mockTest1) {\n return $mockTest1;\n }]\n )->make();\n\n AspectMock::double(TestObjectHandler::class, ['getInstance' => $mockHandler])->make();\n\n // create test to size array\n $sampleTestArray = [\n 'test1' => 100,\n 'test2' => 300,\n 'test3' => 500,\n 'test4' => 60,\n 'test5' => 125\n ];\n\n // create mock suite references\n $sampleSuiteArray = [\n 'mockSuite1' => ['mockTest1', 'mockTest2']\n ];\n\n // perform sort\n $testSorter = new ParallelGroupSorter();\n $actualResult = $testSorter->getTestsGroupedBySize($sampleSuiteArray, $sampleTestArray, 500);\n\n // verify the resulting groups\n $this->assertCount(4, $actualResult);\n\n $expectedResults = [\n 1 => ['mockSuite1_0'],\n 2 => ['mockSuite1_1'],\n 3 => ['test3'],\n 4 => ['test2','test5', 'test4'],\n 5 => ['test1'],\n ];\n\n foreach ($actualResult as $groupNum => $group) {\n $this->assertEquals($expectedResults[$groupNum], array_keys($group));\n }\n }", "public function test_scenario1() {\n\n $data = array(\n array(\"model\" =>\n array(\"topic_model\" =>\n array(\"alpha\" => 0.08,\n \"beta\" => 0.1,\n \"hashed_seed\" => 0,\n \"language\" => \"en\",\n \"bigrams\" => True,\n \"case_sensitive\" => False,\n \"term_topic_assignments\" => array(array(0, 0, 1, 2),\n array(0, 1, 2, 0),\n array(1, 2, 0, 0),\n array(0, 0, 2, 0)),\n \"termset\" => array(\"cycling\", \"playing\", \"shouldn't\", \"uńąnimous court\"),\n \"options\" => [],\n \"topics\" => array(array(\"name\" => \"Topic 1\",\n \"id\" => \"000000\",\n \"top_terms\" => array(\"a\", \"b\"),\n \"probability\" => 0.1),\n array(\"name\" => \"Topic 2\",\n \"id\" => \"000001\",\n \"top_terms\" => array(\"c\", \"d\"),\n \"probability\" => 0.1),\n array(\"name\" => \"Topic 3\",\n \"id\" => \"000000\",\n \"top_terms\" => array(\"e\", \"f\"),\n \"probability\" => 0.1),\n array(\"name\" => \"Topic 4\",\n \"id\" => \"000000\",\n \"top_terms\" => array(\"g\", \"h\"),\n \"probability\" => 0.1)),\n \"fields\" => array(\"000001\" => array(\"datatype\" => \"string\",\n \"name\" => \"TEST TEXT\",\n \"optype\" => \"text\",\n \"order\" => 0,\n \"preferred\" => True,\n \"summary\" => [],\n \"term_analysis\" => []))),\n \"resource\" => \"topicmodel/aaaaaabbbbbbccccccdddddd\",\n \"status\" => array(\"code\" => 5)),\n \"text\" => array(\"TEST TEXT\" => \"uńąnimous court 'UŃĄNIMOUS COURT' `play``the plays PLAYing SHOULDN'T CYCLE cycling shouldn't uńąnimous or court's\"),\n \"expected\" => array(array(\"name\" => 'Topic 1', \"probability\" => 0.17068527918781726),\n array(\"name\" => 'Topic 2', \"probability\" => 0.1865482233502538),\n array(\"name\" => 'Topic 3', \"probability\" => 0.5157043147208121),\n array(\"name\" => 'Topic 4', \"probability\" => 0.12706218274111675))));\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a local distribution from a Topic Model\\n\";\n print \"I create a local topic model\\n\";\n $object = json_decode(json_encode($item[\"model\"]), FALSE);\n $local_topic_model = new TopicModel($object);\n\n print \"I create a distribution for local topic model\\n\";\n $distribution = $local_topic_model->distribution($item[\"text\"]);\n\n print \"And the distribution for local topic model equals the expected values.\\n\";\n $this->assertEquals($distribution, $item[\"expected\"]);\n }\n }", "public function testCheckIfOverviewContainsSuite()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->see('TestSuite1')\n ->assertViewHas('testSuites');\n\n }", "public static function main()\n {\n $suite = new TestSuite(\"Zend_Form_Decorator_LabelTest\");\n $result = (new resources_Runner())->run($suite);\n }", "public function run()\n {\n // set up the test suite\n $this->setUp();\n\n // run each test\n foreach ($this->getClasses() as $test) {\n $test = new $test;\n \n // depending on what is asserted, we hadnle it differently\n try {\n $test->run();\n $this->assertions = array_merge($this->assertions, $test->assertions());\n } catch (Testes_UnitTest_FatalAssertion $e) {\n $this->assertions[] = $e;\n $test->tearDown();\n $this->tearDown();\n return $this;\n } catch (Exception $e) {\n $test->tearDown();\n $this->tearDown();\n throw $e;\n }\n }\n\n // tear down the suite\n $this->tearDown();\n\n return $this;\n }", "protected function addTestOptions()\n {\n foreach (['test' => 'PHPUnit', 'pest' => 'Pest'] as $option => $name) {\n $this->getDefinition()->addOption(new InputOption(\n $option,\n null,\n InputOption::VALUE_NONE,\n \"Generate an accompanying {$name} test for the {$this->type}\"\n ));\n }\n }" ]
[ "0.6128064", "0.60965717", "0.58767354", "0.5820667", "0.58174706", "0.58077425", "0.5785293", "0.57483566", "0.57361007", "0.57121193", "0.57006806", "0.56574285", "0.5647751", "0.56437147", "0.5621686", "0.5526055", "0.5493485", "0.5483558", "0.54710424", "0.5428393", "0.54252064", "0.539973", "0.539973", "0.539973", "0.539973", "0.539973", "0.539973", "0.53567004", "0.5354074", "0.5347002", "0.5319341", "0.5306652", "0.5306652", "0.52995974", "0.5289497", "0.52598643", "0.52598643", "0.52598643", "0.52131796", "0.52048934", "0.5194935", "0.5192661", "0.5191398", "0.51460356", "0.5140597", "0.5139899", "0.51390046", "0.513882", "0.5126451", "0.5123821", "0.5121211", "0.51078296", "0.5079041", "0.5063307", "0.5057001", "0.50491214", "0.50422114", "0.5037224", "0.50363666", "0.5030594", "0.50223213", "0.5016227", "0.5010827", "0.5010678", "0.497997", "0.49778", "0.49620762", "0.49606222", "0.4952528", "0.49514362", "0.49442846", "0.49402747", "0.49307647", "0.49272847", "0.4905657", "0.4905278", "0.49003306", "0.4889583", "0.48811784", "0.4876669", "0.48590347", "0.48539668", "0.48537272", "0.485245", "0.48445863", "0.48246804", "0.48229218", "0.4818526", "0.48177803", "0.48099506", "0.4794905", "0.47933355", "0.47933355", "0.4790974", "0.47864568", "0.4784914", "0.47746214", "0.47736618", "0.47650856", "0.47628418" ]
0.57958055
6
Display a listing of the resource.
public function index() { $limit = Input::get('limit', 24); $input = Input::all(); $products = Products::filter(Input::all(), $limit); $types = Types::dropdownList(); $units = Units::dropdownList(); if (Request::ajax()) { return Response::json($products->lists('nameprice'))->setCallback(Input::get('callback')); } else { $index = $products->getPerPage() * ($products->getCurrentPage() - 1) + 1; return View::make('products.index', compact('products', 'index', 'input', 'types', 'units')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $types = Types::dropdownList(); $units = Units::dropdownList(); $suppliers = Suppliers::dropdownList(); return View::make('products.create', compact('types', 'units', 'suppliers')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store() { $validator = Validator::make(Input::all(), Products::$rules); if ($validator->passes()) { $product = new Products; $product->name = addslashes(Input::get('name')); $product->color_id = Input::get('color'); $product->product_code = 0; $product->sp = Input::get('sp'); $product->cp = Input::get('cp'); $product->quantity = Input::get('quantity'); $product->type_id = Input::get('type_id'); $product->unit_id = Input::get('unit_id'); $product->save(); $product->setProductCode($product); $stock = new Stocks(); $stock->supplier_id = Input::get('supplier_id'); $stock->product_id = $product->id; $stock->quantity = Input::get('quantity'); $stock->save(); return Redirect::route('products.index') ->with('success', 'Product created successfully'); } else { return Redirect::route('products.create') ->withErrors($validator) ->withInput(Input::all()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $product = Products::find($id); if (Request::ajax()) { $return = [ 'product' => [ $product, 'unit' => $product->unit ] ]; return Response::json($product)->setCallback(Input::get('callback')); } }
{ "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) { if (!$id) return Redirect::route('products.index') ->with('error', 'Please Provide product id'); $product = Products::find($id); if (empty($product)) return Redirect::route('products.index') ->with('error', 'Product not found'); $types = Types::dropdownList(); $units = Units::dropdownList(); return View::make('products.edit', compact('product', 'types', 'units')); }
{ "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($id) { if (Input::get('check_update') == 1) { $validator = Validator::make(Input::all(), Products::$rules2); if ($validator->passes()) { $product = Products::find($id); $product->name = addslashes(Input::get('name')); $product->color_id = Input::get('color'); $product->cp = Input::get('cp'); $product->sp = Input::get('sp'); $product->type_id = Input::get('type_id'); $product->unit_id = Input::get('unit_id'); $product->save(); return Redirect::route('products.index') ->with('success', 'Product updated successfully'); } else { return Redirect::route('products.edit', $id) ->withErrors($validator) ->withInput(Input::all()); } } else { $validator = Validator::make(Input::all(), Products::$rules3); if ($validator->passes()) { $product = Products::find($id); $product->discount = Input::get('discount'); $product->save(); return Redirect::route('products.index') ->with('success', 'Product discount updated successfully'); } else { return Redirect::route('products.discount', $id) ->withErrors($validator) ->withInput(Input::all()); } } }
{ "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) { if (!$id) return Redirect::route('products.index') ->with('error', 'Please provide product id'); $product = Products::find($id); if (empty($product)) return Redirect::route('products.index') ->with('error', 'Product not found'); Products::destroy($id); return Redirect::route('products.index') ->with('success', 'Product deleted successfully'); }
{ "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
Retrieve a list of users with the given args. For use in select/multiselect fields.
public function handle() { mylisting_check_ajax_referrer(); try { $page = ! empty( $_REQUEST['page'] ) ? ( absint( $_REQUEST['page'] ) - 1 ) : 0; $search = ! empty( $_REQUEST['search'] ) ? sanitize_text_field( $_REQUEST['search'] ) : ''; $per_page = 25; $args = [ 'number' => $per_page, 'offset' => $page * $per_page, 'fields' => [ 'ID', 'user_login', 'display_name' ], 'orderby' => 'display_name', 'order' => 'ASC', ]; if ( ! empty( trim( $search ) ) ) { $args['search'] = '*'.trim( $search ).'*'; } $users = get_users( $args ); if ( empty( $users ) || is_wp_error( $users ) ) { throw new \Exception( _x( 'No users found.', 'Users dropdown list', 'my-listing' ) ); } $results = []; foreach ( $users as $user ) { $results[] = [ 'id' => $user->ID, 'text' => $user->display_name, ]; } wp_send_json( [ 'success' => true, 'results' => $results, 'more' => count( $results ) === $per_page, 'args' => \MyListing\is_dev_mode() ? $args : [], ] ); } catch ( \Exception $e ) { wp_send_json( [ 'success' => false, 'message' => $e->getMessage(), ] ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function route_userlist(array $args) {\n\t\tif (!self::$ctrl->get_user_data())\n\t\t\treturn self::$core::pj([Error::USER_NOT_LOGGED_IN], 401);\n\t\treturn self::$core::pj(\n\t\t\tself::$manage->list($args['get']), 403);\n\t}", "public function listUsers($fields = null);", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "function acf_get_users($args = array())\n{\n}", "public function findUsers($args)\n {\n // Need read access to call this function\n if (!SecurityUtil::checkPermission(\"{$this->name}::\", '::', ACCESS_READ)) {\n return false;\n }\n\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n $dbtable = DBUtil::getTables();\n $userstable = $dbtable['users'];\n $userscolumn = $dbtable['users_column'];\n\n // Set query conditions (unless some one else sends a hardcoded one)\n $where = array();\n if (!isset($args['condition']) || !$args['condition']) {\n // Do not include anonymous user\n $where[] = \"({$userscolumn['uid']} != 1)\";\n\n foreach ($args as $arg => $value) {\n if ($value) {\n switch($arg) {\n case 'uname':\n // Fall through to next on purpose--no break\n case 'email':\n $where[] = \"({$userscolumn[$arg]} LIKE '%\".DataUtil::formatForStore($value).\"%')\";\n break;\n case 'ugroup':\n $uidList = UserUtil::getUsersForGroup($value);\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n break;\n case 'regdateafter':\n $where[] = \"({$userscolumn['user_regdate']} > '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'regdatebefore':\n $where[] = \"({$userscolumn['user_regdate']} < '\"\n . DataUtil::formatForStore($value) . \"')\";\n break;\n case 'dynadata':\n if ($useProfileMod) {\n $uidList = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata', array(\n 'dynadata' => $value\n ));\n if (is_array($uidList) && !empty($uidList)) {\n $where[] = \"({$userscolumn['uid']} IN (\" . implode(', ', $uidList) . \"))\";\n }\n }\n break;\n default:\n // Skip unknown values--do nothing, and no error--might be other legitimate arguments.\n }\n }\n }\n }\n // TODO - Should this exclude pending delete too?\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . \")\";\n $where = 'WHERE ' . implode(' AND ', $where);\n\n $permFilter = array();\n $permFilter[] = array(\n 'realm' => 0,\n 'component_left' => $this->name,\n 'component_middle' => '',\n 'component_right' => '',\n 'instance_left' => 'uname',\n 'instance_middle' => '',\n 'instance_right' => 'uid',\n 'level' => ACCESS_READ,\n );\n $objArray = DBUtil::selectObjectArray('users', $where, 'uname', null, null, null, $permFilter);\n\n return $objArray;\n }", "public function get($arguments = []) {\n //If no argument was provided, all users will be retrieved.\n if (count($arguments) < 1) {\n $this->result_array['users'] = $this->get_all();\n } else {\n $this->result_array['users'][] = $this->get_single($arguments);\n }\n }", "public function getUsersList()\n {\n }", "function hc_get_users($args, $widget = false){\n\t\t//set gravatar size\n\t\tif (!isset($args['gravatarsize']) || $args['gravatarsize'] == '') {\n\t\t\t$gravatarSize = '32';\n\t\t}else{\n\t\t\t$gravatarSize = $args['gravatarsize'];\n\t\t}\n\n\t\t//display group or single\n\t\tif(isset($args['single']) && ($args['single'] == 'single' || $args['single'] == true)){\n\t\t\t$hc_users = array();\n\t\t\t$user = $args['username'];\n\t\t\t$userArr = explode(',',$user);\n\t\t\tforeach ($userArr as $key => $username) {\n\t\t\t\t$hc_users[] = get_user_by('login', $username);\n\t\t\t}\n\t\t}else{\n\t\t\t//args for getting users\n\t\t\tif (empty($args['group']))\n\t\t\t\treturn new WP_Error('No users', __(\"No group or user specified\", 'hypercontact'));\n\t\t\t\t\n\t\t\t$roles = array(\n\t\t\t\t\t\t'role'\t\t=> $args['group'],\n\t\t\t\t\t\t'fields'\t=> array('ID')\n\t\t\t\t\t);\n\n\t\t\t// Create a new user query\n\t\t\t$wp_user_query = new WP_User_Query($roles);\n\t\t\t\n\t\t\t// Get user meta\n\t\t\t$groupId = $wp_user_query->get_results();\n\t\t\t$hc_users = array();\n\t\t\tforeach ($groupId as $key => $value) {\n\t\t\t\t$hc_users[] = get_user_by('id', $value->ID);\n\t\t\t}\n\t\t}\n\t\t\n\t\tforeach ($hc_users as $index => $user) {\n\t\t\t$user->gravatar = get_avatar( $user->user_email, $gravatarSize);\n\t\t\t$user = hc_filter($user, $widget);\n\t\t}\n\n\t\tif(isset($args['fields'])){\n\t\t\t$fieldsString = $args['fields'];\n\t\t\t$fieldsArray = explode(',',$fieldsString);\n\t\t\t$fieldsArray = array_map('trim', $fieldsArray);\n\t\t\tforeach ($hc_users as $key => $user){\n\t\t\t\tforeach ($user as $field => $value) {\n\t\t\t\t\tif (!in_array($field, $fieldsArray)) {\n\t\t\t\t\t\tunset($user->$field);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tif (!empty($hc_users) && (isset($hc_users[0]) && !empty($hc_users[0]))){\n\t\t\treturn $hc_users;\n\t\t}else{\n\t\t\treturn new WP_Error('No info', __(\"No user info could be found\", 'hypercontact'));\n\t\t}\n\t}", "public function getUsers();", "public function getUsers();", "public function getUsers();", "function hc_users($args){\n\t\t$users = hc_get_users($args);\n\t\tif ( is_wp_error($users) ){\n\t\t\t\techo $users->get_error_message();\n\t\t\t\treturn false;\n\t\t}\n\t\tforeach ($users as $key => $user) {\n\t\t\techo '<ul class=\"hc_user_list\">';\n\t\t\techo '<li class=\"hc_user_name\">'.$user->display_name.'</li>';\n\t\t\techo '<li class=\"hc_user_gravatar\">'.$user->gravatar.'</li>';\n\t\t\techo '<ul class=\"hc_user_info\">';\n\t\t\t\tforeach ($user as $field => $value) {\n\t\t\t\t\tif (($field !=' display_name' && $field != 'gravatar') && $value != '') {\n\t\t\t\t\t\tif ($field == 'user_url') {\n\t\t\t\t\t\t\techo '<li><a href=\"'.$value.'\">'.$value.'</a></li>';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<li>'.$value.'</li>';\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}\n\t\t\techo '</ul>';\n\t\t\techo '</ul>';\n\t\t}\n\t}", "function &getUsers($uids)\n {\n $criteria = new CriteriaCompo();\n $criteria->add(new Criteria('uid', '(' . implode(',', $uids) . ')', 'IN'));\n $criteria->setSort('uid');\n\n $member_handler =& xoops_gethandler('member');\n $users =& $member_handler->getUsers($criteria, true);\n return $users;\n }", "function wfSpecialListusers( $par = null ) {\n\tglobal $wgRequest;\n\n\tlist( $limit, $offset ) = wfCheckLimits();\n\n\n\t$slu = new ListUsersPage();\n\t\n\t/**\n\t * Get some parameters\n\t */\n\t$groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' );\n\t$slu->requestedGroup = $groupTarget;\n\t$slu->requestedUser = $wgRequest->getVal('username');\n\n\treturn $slu->doQuery( $offset, $limit );\n}", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function getall($args)\n {\n\n $items = array();\n\n // do not show the account links if Profile is not the Profile manager\n $profilemodule = System::getVar('profilemodule', '');\n if ($profilemodule != 'Profile') {\n return $items;\n }\n\n $uname = isset($args['uname']) ? $args['uname'] : null;\n if (!$uname && UserUtil::isLoggedIn()) {\n $uname = UserUtil::getVar('uname');\n }\n\n // Create an array of links to return\n if (!empty($uname)) {\n $uid = UserUtil::getIdFromName($uname);\n $items['0'] = array('url' => ModUtil::url('Profile', 'user', 'view', array('uid' => $uid)),\n 'module' => 'Profile',\n //! account panel link\n 'title' => $this->__('Personal info'),\n 'icon' => 'admin.png');\n\n if (SecurityUtil::checkPermission('Profile:Members:', '::', ACCESS_READ)) {\n $items['1'] = array('url' => ModUtil::url('Profile', 'user', 'viewmembers'),\n 'module' => 'Profile',\n 'title' => $this->__('Registered users list'),\n 'icon' => 'members.png');\n }\n }\n\n // Return the items\n return $items;\n }", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }", "function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}", "public function get_users_list() {\n\n\t\t\t$users = get_users();\n\n\t\t\t$result = array( '0' => esc_html__( 'Select a user', 'cherry' ) );\n\n\t\t\tif ( empty( $users ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\tforeach ( $users as $user ) {\n\t\t\t\t$result[ $user->data->ID ] = $user->data->user_nicename;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "public function list_users( $args, $assoc_args ) {\n\t\t$formatter = $this->get_formatter( $assoc_args );\n\n\t\t$topic_id = $args[0];\n\n\t\t// Check if topic exists.\n\t\tif ( ! bbp_is_topic( $topic_id ) ) {\n\t\t\t\\WP_CLI::error( 'No topic found by that ID.' );\n\t\t}\n\n\t\t$ids = bbp_get_topic_favoriters( $topic_id );\n\n\t\tif ( ! $ids ) {\n\t\t\t\\WP_CLI::error( 'Could not find any users.' );\n\t\t}\n\n\t\tif ( 'ids' === $formatter->format ) {\n\t\t\techo implode( ' ', $ids ); // WPCS: XSS ok.\n\t\t} elseif ( 'count' === $formatter->format ) {\n\t\t\t$formatter->display_items( $ids );\n\t\t}\n\t}", "protected function get_users( $type = 'auth', $args = array() )\n\t{\n\t\tswitch ( $type ) {\n\t\t\tcase 'pending' :\n\t\t\t\t$compare = 'NOT EXISTS';\n\t\t\t\tbreak;\n\n\t\t\tcase 'auth' :\n\t\t\tdefault :\n\t\t\t\t$compare = 'EXISTS';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// check if a user is authenticated or not\n\t\t// depends on the $type\n\t\t$defaults = array(\n\t\t\t'orderby' => 'ID',\n\t\t\t'meta_key' => 'authentication',\n\t\t\t'meta_value' => '1',\n\t\t\t'meta_compare' => $compare\n\t\t);\n\n\t\t// for multisite, we need to remove the 'blog_id' so we can get all users\n\t\t// without the capabilities meta key added to the FROM query\n\t\tif ( is_multisite() ) {\n\t\t\t$defaults['blog_id'] = false;\n\t\t}\n\n\t\t$args = wp_parse_args( $args, $defaults );\n\n\t\treturn get_users( $args );\n\t}", "public function retrieve_users()\n {\n $search_query = Request::post(self::PARAM_SEARCH_QUERY);\n \n // Set the conditions for the search query\n if ($search_query && $search_query != '')\n {\n $conditions[] = Utilities::query_to_condition(\n $search_query, \n array(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_USERNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME), \n new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)));\n }\n \n // Only include active users\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(User::class_name(), User::PROPERTY_ACTIVE), \n new StaticConditionVariable(1));\n \n // Combine the conditions\n $count = count($conditions);\n if ($count > 1)\n {\n $condition = new AndCondition($conditions);\n }\n \n if ($count == 1)\n {\n $condition = $conditions[0];\n }\n \n $this->user_count = DataManager::count(User::class_name(), $condition);\n $parameters = new DataClassRetrievesParameters(\n $condition, \n 100, \n $this->get_offset(), \n array(\n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_LASTNAME)), \n new OrderBy(new PropertyConditionVariable(User::class_name(), User::PROPERTY_FIRSTNAME))));\n \n return DataManager::retrieves(User::class_name(), $parameters);\n }", "function fetchUsers()\r\n {\r\n $users = $this->DB->database_select('users', array('username', 'uid'));\r\n return $users;\r\n }", "function get_users()\n {\n //Unimplemented\n }", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "public function get_users_for_select() {\n\t\tif ( empty( $this->cache[ __FUNCTION__ ] ) ) {\n\t\t\t$default_option = [\n\t\t\t\t'value' => '',\n\t\t\t\t'label' => __( ' - Select User for Import - ', 'edgenet' ),\n\t\t\t];\n\n\t\t\t$user_args = [\n\t\t\t\t'role__in' => [ 'editor', 'administrator' ],\n\t\t\t\t'number' => 100,\n\t\t\t];\n\t\t\t$user_query = new \\WP_User_Query( $user_args );\n\n\t\t\t$user_results = $user_query->get_results();\n\n\t\t\tif ( $user_results ) {\n\t\t\t\t$options = array_map( function ( $user ) {\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'value' => $user->ID,\n\t\t\t\t\t\t'label' => sprintf( '%s [%s]', $user->user_login, $user->user_email ),\n\t\t\t\t\t];\n\t\t\t\t}, $user_results );\n\n\t\t\t}\n\n\t\t\tarray_unshift( $options, $default_option );\n\n\t\t\t$this->cache[ __FUNCTION__ ] = $options;\n\t\t}\n\n\t\treturn $this->cache[ __FUNCTION__ ];\n\t}", "function get_users()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = $db->query(\"SELECT * FROM users\");\n\t\t\n\t\treturn $db->results($query);\n\t}", "private function getUserBatch() {\n\t\t// Include also hidden (disabled) users to the export\n\t\t$hidden_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\n\t\t// Ignore access settings to get all users\n\t\telgg_set_ignore_access(true);\n\n\t\t$users = elgg_get_entities(array(\n\t\t\t'type' => 'user',\n\t\t\t'limit' => $this->limit,\n\t\t\t'offset' => $this->offset,\n\t\t));\n\n\t\t// Set access level to normal\n\t\telgg_set_ignore_access(false);\n\n\t\t// Set hidden status to normal\n\t\taccess_show_hidden_entities($hidden_status);\n\n\t\treturn $users;\n\t}", "public function getAllUsers($parameters = array());", "private function _searchUsers( array $aGet=array() ) {\n \n $_aArgs = $aGet + array(\n 'number' => 100, // the maximum number to return.\n );\n \n // Set the callback to modify the database query string.\n add_action( 'pre_user_query', array( $this, '_replyToModifyMySQLWhereClauseToSearchUsers' ) );\n \n $_oResults = new WP_User_Query( $_aArgs );\n\n // Format the data\n $_aData = array();\n foreach( $_oResults->results as $_iIndex => $_oUser ) {\n $_aData[ $_iIndex ] = array(\n 'id' => $_oUser->ID,\n 'name' => $_oUser->data->display_name,\n );\n } \n return $_aData;\n \n }", "public function users(array $options);", "public function getUsersListAttribute()\n {\n return User::orderBy('name')->get();\n }", "public function get_users()\n\t{\n\t\t$sql=\"SELECT * FROM waf_users WHERE 1=1\";\n\t\t$result=$this->db->LIST_Q($sql);\n\t\treturn $result;\n\t}", "protected function get_users_query_args()\n {\n }", "public function getList() {\n //Retourne la liste de tous les users\n $users = [];\n $requsers = $this->db->query('SELECT * FROM user');\n\n while ($data = $requsers->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new user($data);\n }\n\n return $users;\n }", "function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}", "public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }", "function getUsers() {\n\n\tglobal $db;\n\treturn $db->getUsersByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "function getUsers() {\n $users = $this->users;\n if (is_string($users)) {\n $users = explode(',', $users);\n }\n return $users;\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }", "function listUsers() {\n return $this->users;\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public static function getUsers() {\n\t\t$res = self::$db->query(\"SELECT id, email, username, logins, last_login FROM `\".self::$users_tbl.\"` ORDER BY username\");\n\t\t$row = $res->fetchAll(PDO::FETCH_ASSOC);\n\t\treturn $row;\n\t}", "public function ajax_get_users() {\n\n\t\t// Get list of users.\n\t\t$users = get_users( array( 'orderby' => 'display_name' ) );\n\t\tif ( ! empty( $users ) ) {\n\n\t\t\t// Build user data.\n\t\t\t$user_data = array(\n\t\t\t\t'selected' => 0,\n\t\t\t\t'users' => $users,\n\t\t\t);\n\n\t\t\t/*\n\t\t\t * If we passed a speaker post ID, get the\n\t\t\t * user ID assigned to the speaker post ID.\n\t\t\t */\n\t\t\t$speaker_post_id = isset( $_GET['speaker_post_id'] ) ? $_GET['speaker_post_id'] : 0;\n\t\t\tif ( $speaker_post_id > 0 ) {\n\n\t\t\t\t// Get the assigned user ID for the speaker.\n\t\t\t\t$speaker_user_id = get_post_meta( $speaker_post_id, 'conf_sch_speaker_user_id', true );\n\t\t\t\tif ( $speaker_user_id > 0 ) {\n\t\t\t\t\t$user_data['selected'] = $speaker_user_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print the user data.\n\t\t\techo json_encode( $user_data );\n\n\t\t}\n\n\t\twp_die();\n\t}", "public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }", "function GetUsers($set_type = 'all', $get_data = false)\n\t{\n\t\t$where_clause = array('sid' => $this->sid);\n\t\t\n\t\tswitch ($set_type) {\n\t\t\tcase 'active':\n\t\t\t\t$where_clause['status'] = array ('!=', 'closed');\n\t\t\t\t$where_clause['actual_time + INTERVAL '. LC_ALLOWED_IDLE_TIME] = array ('>', 'NOW()');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'all':\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'requester':\n\t\t\t\t$where_clause = array (\n\t\t\t\t\t'#WHERE' => array (\n\t\t\t\t\t\t'sid' => $this->sid\n\t\t\t\t\t),\n\t\t\t\t\t'#ORDER' => 'user_id ASC',\n\t\t\t\t\t'#LIMIT' => 1\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\tif (is_array($set_type)) {\n\t\t\t\t\t$where_clause = $set_type;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$r = $this->db->q('SELECT user_id FROM #_PREF_lc_users', $where_clause);\n\t\t$users = array();\n\t\twhile ($ud = $this->db->fetchAssoc($r)) {\n\t\t\t$user = new LcUser($ud['user_id']);\n\t\t\tif ($get_data) $user->getData();\n\t\t\t$users[] = $user;\n\t\t}\n\t\t\n\t\treturn $users;\n\t}", "function admin_get_users()\n{\n global $app;\n\n $users = $app->bbs->users();\n $app->render('admin_users.html', [\n 'page' => mkPage(getMessageString('admin_users'), 0, 2),\n 'users' => $users,\n 'isadmin' => is_admin()]);\n}", "protected function get_users() {\n\t\t\t$users = wp_cache_get( 'mycred_users' );\n\n\t\t\tif ( false === $users ) {\n\t\t\t\t$users = array();\n\t\t\t\t$blog_users = get_users( array( 'orderby' => 'display_name' ) );\n\t\t\t\tforeach ( $blog_users as $user ) {\n\t\t\t\t\tif ( false === $this->core->exclude_user( $user->ID ) )\n\t\t\t\t\t\t$users[ $user->ID ] = $user->display_name;\n\t\t\t\t}\n\t\t\t\twp_cache_set( 'mycred_users', $users );\n\t\t\t}\n\n\t\t\treturn apply_filters( 'mycred_log_get_users', $users );\n\t\t}", "private function getUsers()\n {\n $url = $this->base_uri.'user/assignable/multiProjectSearch?projectKeys='.$this->project;\n $users = $this->request($url);\n if (!$this->infos['errorBoolean']) {\n return json_decode($users);\n }\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "public function findUsers(): iterable;", "public function getList()\r\n {\r\n $result = $this->query(\r\n \"SHOW USERS\",\r\n $this->getValueBuilder('Aviogram\\InfluxDB\\Entity\\Admin\\User')\r\n ->addField('user', 'getName', 'setName')\r\n ->addField('admin', 'isAdmin', 'setAdmin')\r\n );\r\n\r\n $return = new Collection\\Admin\\User();\r\n\r\n foreach ($result->getSeries() as $serie) {\r\n foreach($serie->getValues() as $value) {\r\n $return->append($value);\r\n }\r\n }\r\n\r\n return $return;\r\n }", "public function getUserList() {\n return $this->users;\n }", "public function ajax_get_users() {\n\n\t\t// Get list of users.\n\t\t$users = get_users( [ 'orderby' => 'display_name' ] );\n\t\tif ( ! empty( $users ) ) {\n\n\t\t\t// Build user data.\n\t\t\t$user_data = [\n\t\t\t\t'selected' => 0,\n\t\t\t\t'users' => $users,\n\t\t\t];\n\n\t\t\t/*\n\t\t\t * If we passed a speaker post ID, get the\n\t\t\t * user ID assigned to the speaker post ID.\n\t\t\t */\n\t\t\t$speaker_post_id = isset( $_GET['speaker_post_id'] ) ? $_GET['speaker_post_id'] : 0;\n\t\t\tif ( $speaker_post_id > 0 ) {\n\n\t\t\t\t// Get the assigned user ID for the speaker.\n\t\t\t\t$speaker_user_id = get_post_meta( $speaker_post_id, 'conf_sch_speaker_user_id', true );\n\t\t\t\tif ( $speaker_user_id > 0 ) {\n\t\t\t\t\t$user_data['selected'] = $speaker_user_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Print the user data.\n\t\t\techo json_encode( $user_data );\n\n\t\t}\n\n\t\twp_die();\n\t}", "public function get_users()\r\n\t\t{\r\n\t\t\t$retArr = array();\r\n\r\n\t\t\tif(is_array($this->obj))\r\n\t\t\t{\r\n\t\t\t\treturn $this->obj;\r\n\t\t\t}\r\n\t\t}", "public function getUserList()\n {\n $responseMap = $this->_postCommand(static::$COMMAND_GET_USER_LIST);\n \n // From the response, filter out only the users that matched this environment Prefix\n $userIdList = [];\n foreach ($responseMap['ids'] as $userId) {\n $unprefixedUserId = PrefixHelper::unprefix($userId);\n \n if ($unprefixedUserId !== false) {\n $userIdList[] = $unprefixedUserId;\n }\n }\n \n return $userIdList;\n }", "public static function getUserList($userID, $num);", "public function findUsers();", "public function findUsers();", "public function getUserList($fields = array(), $excludeExternal = true)\n {\n // if $excludeExternal is true, then we don't include them in the listing\n if ($excludeExternal) {\n $fields['role<>'] = User::ROLE_EXTERNAL;\n }\n\n $users = $this->dbService->getObjects($this->userClass, $fields, 'username asc');\n return $users;\n }", "public function getLTIUsers();", "public function getList($user);", "function getUsers() {\n\t\t$dbObject = getDatabase();\n\t\t\n\t\t// now the sql again\n\t\t$sql = \"select users_username from users\";\n\t\t\n\t\t// run the query\n\t\t$result = $dbObject->query($sql);\n\t\t\n\t\t// iterate over the results - we expect a simple array containing\n\t\t// a list of usernames\n\t\t$i = 0;\n\t\t$users = array();\n\t\tforeach($result as $row) {\n\t\t\t$users[$i] = $row[\"username\"];\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t// now return the list\n\t\treturn $users;\n\t}", "public function userList() \n { \n $user = User::get(); \n return response([ 'data' => ToArray::collection($user), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}", "public function listUsers()\n {\n $query = new Query();\n\n $rows = $query->select(['id', 'name'])\n ->from('users')\n ->orderBy(['date_add' => SORT_DESC])\n ->all();\n\n return $rows;\n }", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public function getUsers() {\n\t\ttry {\n\t\t\treturn $this->getBounded1MInstance(\"XTUsersRecords\", $filter, $order, $limit, $whereAdd);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function getUsers(){\n\t\t\t$users = $this->db->get(\"users\");\n\t\t\treturn $users;\n\t\t}", "public function getUsers()\n {\n $users = [];\n $request = $this->_db->query('SELECT * FROM user');\n while ($data = $request->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new User($data);\n }\n return $users;\n }", "public function selectAllUsers(){\r\n $userList = new UsersList();\r\n return $userList->selectAllUsers();\r\n }", "public function users(UserRequestParams $params) {\n $parameters = [\n 'pending' => $params->getPending(),\n 'branch_id' => $params->getBranchId(),\n 'selection_status' => $params->getSelectionStatus(),\n 'sort_attr' => $params->getSortAttr(),\n '$sort_dir' => $params->getSortDir(),\n 'page' => $params->getPage(),\n 'page_size' => $params->getPage(),\n 'search_text' => $params->getSearchText(),\n 'exclude' => $params->getExclude(),\n 'exclude_power_users_and_super_admins' => $params->getExcludePowerUsersAndSuperAdmins()\n ];\n\n return $this->docebo->get(self::PATH_LIST_USERS, $parameters);\n }", "public function batch_get_results() {\n\t\t$query = new WP_User_Query( $this->args );\n\t\t$total_users = $query->get_total();\n\t\t$this->set_total_num_results( $total_users );\n\t\treturn $query->get_results();\n\t}", "function list_users(){\r\n\t\t$query = $this->db->query(\"SELECT userid, concat(fname, ' ', lname, ' (', username, ')') as name FROM nf_users\");\r\n\t\t$return = array();\r\n\t\tforeach($query->result() as $row){\r\n\t\t\t$return[$row->userid] = $row->name;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "public static function listUser()\n {\n $self = new self();\n\n $where = '';\n $limit = self::LIMIT;\n\n\n $search = isset($_GET['search']) ? $_GET['search'] : '';\n\n $page = (isset($_GET['page']) && $_GET['page'] >= 0) ?\n (int)$_GET['page'] : 1;\n\n if ($search != '')\n $where .= \" WHERE name LIKE '%$search%' \";\n\n $from = ($page == 1) ? 1 : ($page - 1) * $limit;\n\n $sql = \"SELECT * FROM user \" . $where . \" ORDER BY id DESC LIMIT $from, $limit\";\n\n $result = $self->db->query($sql);\n $result = $result->fetchAll();\n\n $countSql = \"SELECT count(*) FROM user \" . $where;\n\n $resultCount = $self->db->query($countSql);\n $resultCount = $resultCount->count();\n\n return [\n 'items' => $result,\n 'current_page' => $page,\n 'limit' => $limit,\n 'total' => $resultCount,\n 'keysearch' => $search,\n 'from' => $from\n ];\n }", "public function getUsers()\n {\n $st = $this->execute('SELECT * FROM '. self::$prefix .'user ORDER BY `userid`;');\n\n $rs = $st->fetchAll(PDO::FETCH_ASSOC);\n\n $users = array();\n foreach($rs AS $row) {\n $user = new sspmod_janus_User($this->_config->getValue('store'));\n $user->setUid($row['uid']);\n $user->load();\n $users[] = $user;\n }\n \n return $users;\n }", "public function usersList()\n {\n return app(UsersList::class)($this);\n }", "public function getUserList($page)\r\n {\r\n $userRepository = $this->entityManager->getRepository(User::class);\r\n $users = $userRepository->findBy(\r\n [],\r\n ['email' => 'ASC'],\r\n self::NB_USER_PER_PAGE,\r\n ($page - 1) * self::NB_USER_PER_PAGE\r\n );\r\n\r\n return $users;\r\n }", "public static function listUsers()\n {\n //Init curl\n $curl = new curl\\Curl();\n\n // GET request to api\n $response = $curl->get(Yii::$app->params['listUsers']);\n\n $records = json_decode($response, true);\n\n foreach($records as $users){\n foreach($users as $user){\n $list[$user['id']] = $user['name'] . ' ' . $user['last_name'];\n }\n }\n\n return $list;\n }", "static function getUsers()\n\t{\n\t\t$dataBase = self::dbConnect();\n\t\t$request = $dataBase->query('SELECT login, email FROM users');\n\n\t\treturn $request;\n\t}", "public function getAllUsers($fields = array()) {\n // TODO: DAL(Database Access Layer) is recommended\n if ($fields && is_array($fields)) {\n // TODO: Implements dynamical fields security\n foreach ($fields as $key => $field) {\n $fields[$key] = \"''\" . str_replace(\"''\", \"''\", $field) . \"''\";\n }\n unset($key, $field);\n $fieldsStr = join(',', $fields);\n } else {\n $fieldsStr = '*';\n }\n $sql = 'SELECT ' . $fieldsStr . ' FROM users;';\n $sth = $this->getConnection()->query($sql);\n $sth->setFetchMode(\\PDO::FETCH_ASSOC);\n return $sth->fetchAll();\n }", "public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}", "function get_user_list()\n {\n $query = $this->db->get('user_login');\n return $query->result();\n }", "public function admin_get_users(){\n $limit = $this->input->get('length');\n $offset = $this->input->get('start');\n $search = $this->input->get('search')['value'];\n echo $this->usm->get_users($limit, $offset, $search);\n }", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "function listUsers($gid)\n {\n return array();\n }", "public function get_users() {\n\n\t\t\t$query = $this->db->prepare(\"SELECT * FROM `users` ORDER BY `user_id`\");\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$query->execute();\n\t\t\t}catch(PDOException $e){\n\t\t\t\tdie($e->getMessage());\n\t\t\t}\n\n\t\t\treturn $query->fetchAll();\n\n\t\t}", "public static function getAllUsers() {\r\n // Create a User object\r\n $user = new User();\r\n // Return an array of user objects from the database, ordered by firstname\r\n return $user->getCollection([\"ORDER\" => ['firstname' => 'ASC']]);\r\n }", "function getUsersList()\n {\n $this->db->select('*');\n $this->db->order_by('name', 'asc');\n $this->db->limit(10, 0);\n $q = $this->db->get('users');\n $result = $q->result_array();\n return $result;\n }", "public function getMembers() {\r\n\r\n //statement of resources\r\n $user = array();\r\n\r\n //sql connection\r\n $connect = connection::getInstance();\r\n\r\n //user sql request\r\n $sql = \"SELECT* FROM users\";\r\n //sending request\r\n\r\n\r\n\r\n $req = mysql_query($sql) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error());\r\n\r\n while ($data = mysql_fetch_assoc($req)) {\r\n //scenario creation\r\n $data['nameU'] = Users::secure($data['nameU']);\r\n $data['IDU'] = Users::secure($data['IDU']);\r\n $data['typeU'] = Users::secure($data['typeU']);\r\n $data['admin'] = Users::secure($data['admin']);\r\n $data['password'] = Users::secure($data['password']);\r\n\r\n $users[] = new User($data['nameU'], $data['IDU'], $data['typeU'], $data['admin'], $data['password']);\r\n }\r\n\r\n return $users;\r\n }", "public static function getUsers($options)\n {\n $user = new User(array());\n $users = $user->get($options);\n return $users;\n }", "public function getList($params = array()) {\n\t\tif (empty($params['start'])) $params['start'] = 0;\n\t\tif (empty($params['limit'])) $params['limit'] = 100;\n\n\t\t$db = DBConnection::getInstance();\n\t\t$list = array();\n\t\t\n\t\t$where = ' WHERE (1=1) ';\n if (!empty($params['search'])) {\n $where .= \" AND username like CONCAT ('%', :search, '%') \";\n }\n\t\tif (!empty($params['username'])) {\n\t\t\t$where .= ' AND username=:username ';\n\t\t}\n\t\tif (isset($params['deleted'])) {\n\t\t\tif ($params['deleted'] > 0) {\n\t\t\t\t$where .= ' AND dtime > 0 ';\n\t\t\t} else {\n\t\t\t\t$where .= ' AND NOT dtime > 0 ';\n\t\t\t}\n\t\t}\n\n\t\t$sql = \"SELECT COUNT(id) as total FROM users \".$where;\n\t\t$query = $db->prepare($sql);\n\t\tif (!empty($params['username'])) {\n\t\t\t$query->bindParam('username', $params['username']);\n\t\t}\n if (!empty($params['search'])) {\n $query->bindParam('search', $params['search']);\n }\n\t\t$query->execute();\n\t\t$row = $query->fetch();\n\t\t$total = $row['total'];\n\t\t\n\t\t$sql = \"SELECT * FROM users \".$where.\" ORDER BY username LIMIT :start, :limit \";\n\t\t$query = $db->prepare($sql);\n\t\t$query->bindParam('start', $params['start'], \\PDO::PARAM_INT);\n\t\t$query->bindParam('limit', $params['limit'], \\PDO::PARAM_INT);\n\t\tif (!empty($params['username'])) {\n\t\t\t$query->bindParam('username', $params['username']);\n\t\t}\n if (!empty($params['search'])) {\n $query->bindParam('search', $params['search']);\n }\n\t\t$query->execute();\n\t\twhile ($row = $query->fetch()) {\n\t\t\t$item = new User();\n\t\t\t$item->setId($row['id']);\n\t\t\t$item->setUsername($row['username']);\n\t\t\t$item->setPassword('');\n\t\t\t$item->setRoles($row['roles']);\n\t\t\t$item->setCredits((int) $row['credits']);\n\t\t\t$item->setCtime($row['ctime']);\n\t\t\t$item->setDtime($row['dtime']);\n\n\t\t\t$list[$row['id']] = $item;\n\t\t}\n\t\t\n\t\treturn array(\n\t\t\t'start' => !empty($params['start']) ? $params['start'] : 0,\n\t\t\t'limit' => !empty($params['limit']) ? $params['limit'] : 0,\n\t\t\t'total' => $total,\n\t\t\t'list' => $list\n\t\t);\n\t}", "public function getUsers()\n {\n return $this->users->getValues();\n }", "public function getUsers(){\n $sql=\"SELECT * FROM users\";\n $select=parent::connect_db()->prepare($sql);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\n }", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }" ]
[ "0.75620735", "0.747613", "0.7380027", "0.73233765", "0.7316735", "0.72555846", "0.7218982", "0.7210113", "0.7181653", "0.7181653", "0.7181653", "0.7144198", "0.7095289", "0.70679975", "0.70199937", "0.69761664", "0.69761664", "0.69750905", "0.69583", "0.6955847", "0.6951631", "0.69462264", "0.6941951", "0.6933972", "0.69223595", "0.68951684", "0.686588", "0.6861491", "0.6841997", "0.6812986", "0.68027955", "0.6785066", "0.6778225", "0.6770323", "0.67020047", "0.66992027", "0.66954094", "0.6690679", "0.66886085", "0.66815096", "0.66804785", "0.6679281", "0.6646924", "0.66364396", "0.66334456", "0.6632898", "0.6585252", "0.6583343", "0.6565368", "0.6559415", "0.6558375", "0.65528923", "0.65523", "0.6547315", "0.65411156", "0.6536195", "0.65302116", "0.6527371", "0.6521863", "0.6519161", "0.6516922", "0.6515824", "0.6512599", "0.6509077", "0.6509077", "0.6488594", "0.64878047", "0.6482504", "0.6481843", "0.6475058", "0.6471611", "0.6468926", "0.646738", "0.64655405", "0.6463383", "0.64564544", "0.6455263", "0.6449701", "0.6442844", "0.6442571", "0.64351666", "0.6428944", "0.6428098", "0.6425165", "0.641299", "0.6411136", "0.64072967", "0.6399227", "0.639813", "0.63968277", "0.6395512", "0.63925743", "0.6387236", "0.6379652", "0.6379559", "0.6377877", "0.6376265", "0.63710153", "0.63666964", "0.63665736", "0.6352379" ]
0.0
-1
Handle the incoming request.
public function register(){ return view('form'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest() {}", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "function handleRequest() ;", "abstract public function handleRequest(Request $request);", "abstract public function handleRequest($request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "protected function handle(Request $request) {}", "public function handle($request);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function processRequest();", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "public function handle(Request $request);", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "abstract public function processRequest();", "public abstract function processRequest();", "abstract protected function process(Request $request);", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public static function process_http_request()\n {\n }", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest(Request $request, Response $response);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function handle(array $request);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle(ServerRequestInterface $request);", "public function serve_request()\n {\n }", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "abstract function handle(Request $request, $parameters);", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "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 handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "public function handle(Request $request): Response;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function handle(array $request = []);", "function handle(Request $request = null, Response $response = null);", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\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 }", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "public function run()\n\t{\n\t\t$response = $this->dispatch($this['request']);\n\n\t\t$response->send();\n\n\t\t$this->callFinishMiddleware($response);\n\t}", "public function runRequest() {\n }", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function listen() {\n\t\t$requestType = $this->getRequestType();\n\t\t$prefix = '';\n\t\t$params = array();\n\t\tswitch ($requestType) {\n\t\t\tcase 'GET':\n\t\t\t\t$prefix = 'get';\n\t\t\t\t$params = $_GET;\n\t\t\t\tbreak;\n\n\t\t\tcase 'POST':\n\t\t\t\t$prefix = 'post';\n\t\t\t\t$params = $_POST;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PUT':\n\t\t\t\t$prefix = 'put';\n\t\t\t\t$params = $this->getRestParams();\n\t\t\t\tbreak;\n\n\t\t\tcase 'DELETE':\n\t\t\t\t$prefix = 'delete';\n\t\t\t\t$params = $this->getRestParams();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new CHttpException(400, 'Invalid request');\n\t\t}\n\n\t\ttry {\n\t\t\t$paramsSet = $this->getActionParamsSet($params['cmd']);\n\t\t\tif ($this->validateRequestParams($params, $paramsSet)) {\n\t\t\t\t$accessTokenModel = $this->getAccessTokenModel();\n\t\t\t\t$method = $prefix . $params['cmd'];\n\t\t\t\tif (method_exists($this, $method)) {\n\t\t\t\t\tif ($this->accessRules()) {\n\t\t\t\t\t\t$this->_appAccessControlFilter->checkFiler($this->getApplicationModel(), $method);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->prolongAccessTokenLifeTime) {\n\t\t\t\t\t\t$this->prolongAccessTokenLifeTime($accessTokenModel);\n\t\t\t\t\t}\n\n\t\t\t\t\t$result = call_user_func(array($this, $method), $params);\n\n\t\t\t\t\treturn $this->composeResult($result, 200);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new CHttpException(400, 'Unknown command');\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (CHttpException $exc) {\n\t\t\treturn $this->composeResult(null, $exc->statusCode, $exc->getMessage());\n\t\t}\n\t\tcatch (CException $exc) {\n\t\t\treturn $this->composeResult(null, 500, $exc->getMessage());\n\t\t}\n\t}", "final public function handle() : void\n {\n $method = strtolower($this->context->web()->method());\n $res = (object) [\n 'rest' => $this->context->rest(),\n 'method' => $method,\n 'data' => $this->context->formdata($method == 'patch' ? 'put' : $method)->fetchRaw(),\n ];\n $this->context->web()->sendJSON($res);\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function handle(Request $request)\n {\n //dump($request->all());\n\n admin_success('Processed successfully.');\n\n return back();\n }", "public function run()\n {\n\n // Base path of the API requests\n $basePath = trim($this->settings['application.path']);\n if( $basePath != '/' ){\n $basePath = '/'.trim($basePath, '/').'/';\n }\n\n // Setup dynamic routing\n $this->map($basePath.':args+', array($this, 'dispatch'))->via('GET', 'POST', 'HEAD', 'PUT', 'DELETE', 'OPTIONS');\n\n //Invoke middleware and application stack\n $this->middleware[0]->call();\n\n //Fetch status, header, and body\n list($status, $header, $body) = $this->response->finalize();\n\n //Send headers\n if (headers_sent() === false) {\n\n //Send status\n header(sprintf('HTTP/%s %s', $this->config('http.version'), \\Slim\\Http\\Response::getMessageForCode($status)));\n\n //Send headers\n foreach ($header as $name => $value) {\n $hValues = explode(\"\\n\", $value);\n foreach ($hValues as $hVal) {\n header(\"$name: $hVal\", true);\n }\n }\n }\n\n // Send body\n echo $body;\n }", "public function DispatchRequest ();", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function handler() {\n\t\t$type = Router::verify_type();\n\n\t\tswitch ( $type ) {\n\t\t\tcase self::TYPE_REFRESH_MAP:\n\t\t\t\t$this->cls( 'Crawler_Map' )->gen();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_EMPTY:\n\t\t\t\t$this->cls( 'Crawler_Map' )->empty_map();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_EMPTY:\n\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_empty();\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_DEL:\n\t\t\t\tif ( ! empty( $_GET[ 'id' ] ) ) {\n\t\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_del( $_GET[ 'id' ] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_BLACKLIST_ADD:\n\t\t\t\tif ( ! empty( $_GET[ 'id' ] ) ) {\n\t\t\t\t\t$this->cls( 'Crawler_Map' )->blacklist_add( $_GET[ 'id' ] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t// Handle the ajax request to proceed crawler manually by admin\n\t\t\tcase self::TYPE_START:\n\t\t\t\tself::start( true );\n\t\t\t\tbreak;\n\n\t\t\tcase self::TYPE_RESET:\n\t\t\t\t$this->reset_pos();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tAdmin::redirect();\n\t}", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function request();", "function handle_request() {\n global $subrosa_config, $cfg, $mt;\n // Initialize SubRosa and handle request\n $subrosa_config = init_subrosa_config();\n\n require_once( 'SubRosa/DebuggingEnv.php' );\n $senv = new SubRosa_DebuggingEnv();\n\n $cfg =& $subrosa_config;\n require_once( $cfg['subrosa_path'] );\n\n apache_setenv('SUBROSA_EVALUATED', 1);\n apache_note('SUBROSA_EVALUATED', '1');\n $_SERVER['SUBROSA_EVALUATED'] = 1;\n $_SESSION['SUBROSA_EVALUATED'] = 1;\n\n $mt = new SubRosa( null, $_SERVER['SUBROSA_BLOG_ID'] );\n if (isset($_GET['debug'])) $mt->debugging = true;\n $mt->bootstrap();\n}", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }", "public function handle($request, $next);", "public function run(): void\n {\n // missing routing\n // missing proper controller/model system\n // missing middleware framework\n // hacks incoming :)\n\n self::$config['httpMethod'] = $_SERVER['REQUEST_METHOD'];\n self::$config['uri'] = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n echo $this->handleRequest(self::$config['uri'] === '/' ? '/site/index' : self::$config['uri']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n }\n\n disconnectFromDB();\n }\n }", "public function handle() {}", "function handleGETRequest() {\n if (connectToDB()) {\n if (array_key_exists('countTuples', $_GET)) {\n handleCountRequest();\n } else if (array_key_exists('displayTuples', $_GET)) {\n\t\t handleDisplayRequest();\n\t\t} else if (array_key_exists('deleteTuple', $_GET)) {\n\t\t handleDeleteRequest();\n\t\t}\n\n disconnectFromDB();\n }\n }", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function run()\n {\n $post = file_get_contents($this->getInputFile());\n if (substr($post, 0, 5) == '<?xml') {\n //pingback\n $xs = xmlrpc_server_create();\n xmlrpc_server_register_method(\n $xs, 'pingback.ping', array($this, 'handlePingbackPing')\n );\n $out = xmlrpc_server_call_method($xs, $post, null);\n\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 200 OK');\n $resp->sendXml($out);\n\n } else if (isset($_POST['source']) && isset($_POST['target'])) {\n //webmention\n $res = $this->handleRequest($_POST['source'], $_POST['target']);\n $resp = $this->getWebmentionResponder();\n $resp->send($res);\n\n } else {\n //unknown\n $resp = $this->getPingbackResponder();\n $resp->sendHeader('HTTP/1.0 400 Bad Request');\n $resp->sendHeader('Content-Type: text/html');\n $resp->sendOutput($this->unknownRequest);\n }\n }", "function onRequest(){\n\n\t// check if we need to reload the application\n\tcheckApplicationState();\n\n\t// initialize the ViewSate for every request\n\tsetViewState( getFactory()->getBean( 'ViewState' ) );\n\n\t// decide what to do, the front controller\n\thandleAction();\n\n\t// render the application\n\trenderApplication();\n}", "function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n } \n else if (array_key_exists('avgAgeQueryRequest', $_POST)) {\n //console_log(\"hello\");\n handleAvgAgeRequest();\n //echo \"Average age is 0\";\n } \n\n disconnectFromDB();\n }\n }", "protected function handleGET() {\n /* ... Do the stuff ... */\n\n return $this->render('default.html', array());\n }" ]
[ "0.81443435", "0.80565155", "0.8054052", "0.8054052", "0.8054052", "0.8012054", "0.76565933", "0.7453767", "0.7427182", "0.74211967", "0.73596436", "0.7341611", "0.7303668", "0.72207993", "0.71966445", "0.71955097", "0.71865135", "0.71590275", "0.7092262", "0.7065288", "0.7045881", "0.7045278", "0.7036542", "0.70256114", "0.6975252", "0.68973315", "0.6868569", "0.6863603", "0.68358356", "0.6784327", "0.67840457", "0.67543256", "0.67304766", "0.6724813", "0.6715296", "0.670899", "0.66867405", "0.66831625", "0.6657759", "0.6627255", "0.66260797", "0.6602456", "0.65990335", "0.6583801", "0.6576244", "0.65641546", "0.65635693", "0.65503633", "0.65183526", "0.6509255", "0.6501781", "0.64996064", "0.64884627", "0.645482", "0.6446267", "0.64323944", "0.6419897", "0.64137155", "0.6398115", "0.63862145", "0.63509065", "0.6330968", "0.6321741", "0.632154", "0.63173103", "0.6306707", "0.6304785", "0.62610155", "0.6245076", "0.6226863", "0.62268484", "0.62240636", "0.6201359", "0.61768043", "0.6157829", "0.61539936", "0.6126824", "0.6126824", "0.6126824", "0.6115132", "0.6114553", "0.61085683", "0.6094312", "0.6086701", "0.60811746", "0.6080727", "0.60746986", "0.6071301", "0.6067646", "0.60660446", "0.6065167", "0.6064856", "0.6060916", "0.6053187", "0.6035924", "0.602004", "0.6015193", "0.60114783", "0.6009538", "0.60087067", "0.6006069" ]
0.0
-1
Wandelt bool in string um. true = 'true', false = 'false'
private function boolToString ($value) { if (true === $value) { return 'true'; } elseif (false === $value) { return 'false'; } else { return $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function strbool($bool){\r\n return ($bool) ? \"true\" : \"false\";\r\n }", "function str_bool($string) {\n if (strtolower($string) === 'true') {\n return true;\n } elseif (strtolower($string) === 'false') {\n return false;\n }\n\n return $string;\n}", "private function strToBoolean($value) {\r\n\t\tif ($value && strtolower($value) === \"true\") {\r\n\t\t return true;\r\n\t\t} else {\r\n\t\t return false;\r\n\t\t}\r\n\t}", "function bool2str($bool) {\n\tif($bool ===false)\n\t\treturn 'false';\n\telse\n\t\treturn 'true';\n}", "function bool_str($value) {\r\n if ($value) {\r\n return 'yes'; \r\n } else {\r\n return 'no';\r\n }\r\n}", "function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}", "function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }", "function bool($val,$str=false){\n if(is_string($val)) {\n $val=strtolower($val);\n $val=$val && $val!=\"false\" && $val !=\"no\" && $val !=\"n\" && $val !=\"f\" && $val !=\"off\";\n }else $val=(bool)$val;\n return $str?($val?\"true\":\"false\"):$val;\n}", "function stage_string_to_bool($string)\n{\n return is_bool($string) ? $string : ( 'yes' === $string || 1 === $string || 'true' === $string || '1' === $string );\n}", "function convert_string_to_boolean($string)\n{\n return filter_var($string, FILTER_VALIDATE_BOOLEAN);\n}", "private function parseBoolean($str)\n {\n return $str == \"true\" ? true : false;\n }", "public function toBoolean()\n {\n $key = $this->toLowerCase()->str;\n $map = array(\n 'true' => true,\n '1' => true,\n 'on' => true,\n 'yes' => true,\n 'false' => false,\n '0' => false,\n 'off' => false,\n 'no' => false,\n );\n\n if (array_key_exists($key, $map)) {\n return $map[$key];\n } elseif (is_numeric($this->str)) {\n return ((int) $this->str > 0);\n } else {\n return (bool) $this->regexReplace('[[:space:]]', '')->str;\n }\n }", "private function toBoolean($string)\n\t{\n\t\tif ($string === 'true') {\n\t\t\treturn true;\n\t\t}\n\t\tif ($string === 'false') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn null;\n\t}", "public function getBooleanString($tf);", "function bool_s($boolean) {\n\treturn ($boolean ? 'true' : 'false');\n}", "abstract public function unescapeBoolean($bool);", "function boolval($val){\n return $val === 'true' ? true : false;\n}", "function get_boolean($str)\n{\n $str = strtolower($str);\n if (in_array($str, array('false', '0', 'no', 'nein', ''), TRUE))\n return FALSE;\n else\n return TRUE;\n}", "protected function bool2str($bool) {\n return ($bool) ? 'TRUE' : 'FALSE';\n }", "public function testToStringWithStringValueTrue()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('true');\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}", "abstract public function escapeBoolean($bool);", "private static function bool2str($v)\n {\n //convert boolean to text value.\n $v = $v === true ? 'true' : $v;\n $v = $v === false ? 'false' : $v;\n return $v;\n }", "public static function get_boolean_from_string($str, $default = false){\n\t \n\t\tif ($default !== false or $default !== true){\n\t\t\t$default = false;\n\t\t}\n\t\t\n\t\tif (strcasecmp(trim($str),\"true\") == 0){\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (strcasecmp(trim($str),\"false\") == 0){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn $default;\n\t}", "function b2s($b) {\n return ($b) ? 'TRUE' : 'FALSE';\n}", "function bool_to_string($value) {\n return $value ? 'true' : 'false';\n }", "function booleanValuefromString($s) {\r\n\t\treturn ((strcmp($s, '0') != 0) && (strcasecmp($s, 'false') != 0));\r\n\t}", "public function testToStringWithBooleanValueTrue()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(true);\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}", "static function toBoolean($data)\r\n {\r\n if(!is_string($data))\r\n return (bool) $data;\r\n switch(strtolower($data)) {\r\n case '1':\r\n case 'TRUE':\r\n case 'on':\r\n case 'yes':\r\n case 'y':\r\n return TRUE;\r\n default:\r\n return FALSE;\r\n }\r\n }", "function stage_bool_to_string($bool)\n{\n if (! is_bool($bool)) {\n $bool = wc_string_to_bool($bool);\n }\n return true === $bool ? 'yes' : 'no';\n}", "public function testToStringWithStringValueOn()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('on');\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}", "public function stringToBoolean($val) {\n return ($val === \"true\");\n }", "public static function toBool($string)\n\t{\n\t\t$string = trim((string)$string);\n\t\t$string = strtolower($string);\n\n\t\tif (in_array($string, array(1, 'true', 'yes', 'on', 'enabled'), true))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (in_array($string, array(0, 'false', 'no', 'off', 'disabled'), true))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (bool)$string;\n\t}", "public static function stringToBool($str)\n {\n if (is_bool($str)) {\n return $str;\n }\n \n return in_array(strtolower($str), ['true','yes','1','valid','correct']);\n }", "public function booleanString($var)\n {\n return is_bool($var)\n ? ($var ? 'True' : 'False')\n : $var;\n }", "function toBoolean(){\n\t\tif(in_array($this->lower(),array('','false','off','no','n','f'))){\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$this->toString();\n\t}", "function rest_sanitize_boolean($value)\n {\n }", "function ToBool($var) \n{\n if (!is_string($var)) \n return (bool) $var;\n \n switch (strtolower($var)) \n { \n case '1':\n case 'true':\n case 'on':\n case 'yes':\n case 'y':\n return true;\n default:\n return false;\n }\n}", "function sqlBool($b, $db){\n\t$b = $db->real_escape_string($b);\n\tif ($b) return '1';\n\telse return '0';\n}", "public function testToStringWithStringValueOff()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('off');\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals('false', $boolean->__toString());\n\t}", "private function boolean(bool $value): string\n {\n return $value ? 'true' : 'false';\n }", "public function testToStringWithStringValueYes()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('yes');\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}", "function to_boolean($val);", "private function dbFeedBack($bool){\n if($bool == FALSE){\n //display '0' as false\n return \"{0}\"; \n }\n else{\n //display 1 as true\n return \"{1}\";\n } \n }", "public static function strval($value)\n\t{\n\t\treturn is_bool($value)\n\t\t\t? ($value ? 'true' : 'false')\n\t\t\t: strval($value);\n\t}", "public function testToStringWithBooleanValueFalse()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(false);\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals('false', $boolean->__toString());\n\t}", "public function testToStringWithStringValueFalse()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('false');\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals('false', $boolean->__toString());\n\t}", "public function boolToStr($boolean)\n {\n return ($boolean === true) ? 'true' : 'false';\n }", "private function convertStringBooleans($data) {\n foreach($data as $key=>$value) {\n if($value === 'true' || $value === 'TRUE')\n $data[$key] = true;\n\n if($value === 'false' || $value === 'FALSE')\n $data[$key] = false;\n\n if (is_array($value)) {\n $data[$key] = $this->convertStringBooleans($value);\n }\n }\n\n return $data;\n }", "function toBool($var) {\n\tif (true === $var || 1 === $var) {\n\t\treturn true;\n\t}\n\tswitch (strtolower($var)) {\n\t\tcase \"yes\":\n\t\tcase \"on\":\n\t\tcase \"1\":\n\t\tcase \"y\":\n\t\tcase \"true\":\n\t\tcase \"t\":\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}", "public static function booleanToString($obj)\n {\n return $obj ? 'true' : 'false';\n }", "protected function toBool($value)\n\t{\n\t\tif ($value === true) {\n\t\t\treturn 'yes';\n\t\t}\n\t\treturn 'no';\n\t}", "function bool_from_yn($yn)\n {\n }", "function boolval($var) {\r\n if (is_bool($var)) { return $var; }\r\n switch ($var) {\r\n case 'true': return true;\r\n case 'false': return false;\r\n default: throw new InvalidArgumentException('Cannot parse value '.$var);\r\n }\r\n}", "public static function bool2text($valBool)\n\t{\n\t\t$salida = \"\";\n\n\t\tif($valBool) {\n\n\t\t\t$salida = \"Si\";\n\n\t\t} else {\n\n\t\t\t$salida = \"No\";\n\n\t\t}\n\n\t\treturn $salida;\n\t}", "public static function boolToString($value)\n {\n $value = $value === true ? 'true' : $value;\n $value = $value === false ? 'false' : $value;\n return $value;\n }", "public function parseBoolean($int)\r\n {\r\n if ($int = 1) {\r\n return true;\r\n } else if ($int = 0) {\r\n return false;\r\n } else {\r\n return $int;\r\n }\r\n }", "public function testToStringWithStringValueY()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('y');\n\t\t// check that the two booleans are equal\n\t\t$this->assertEquals('true', $boolean->__toString());\n\t}", "static function toBoolean ($v)\n {\n return is_string ($v) ? get (self::$BOOLEAN_VALUES, $v, false) : boolval ($v);\n }", "public static function bool2str(bool $boolean = true): string\n {\n if ($boolean === false) {\n return 'FALSE';\n } else {\n return 'TRUE';\n }\n }", "public function testToStringWithStringValueN()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('n');\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals('false', $boolean->__toString());\n\t}", "function post_bool($boolean_name) {\n\t$boolean = $_POST[$boolean_name];\n\tif ($boolean == \"true\")\n\t\treturn true;\n\n\treturn false;\n}", "private function prepareBoolParam($value)\n {\n if (is_bool( $value )) {\n return true === $value ? 'true' : 'false';\n }\n\n return $value;\n }", "public function getRealValue(string $value)\n {\n if ($value === \"true\") {\n return true;\n }\n\n if ($value === \"false\") {\n return false;\n }\n\n return $value;\n }", "function booltostr(bool $bool, int $mode = BOOL_TO_STR_OPTION_LOWERCASE): string\n {\n return BOOL_TO_STR_OPTIONS_MAP[$mode][$bool];\n }", "function isTrue($value) {\r\n\treturn is_bool($value) ? $value : (bool)preg_match('/^(1|y|yes|true|on)$/i',(string)$value);\r\n}", "function bool($value)\n{\n return ! in_array(strtolower($value), ['no', 'false', '0', '', '-1']);\n}", "function sanitize_bool( $value, $key, array $data ) {\n\tif ( is_bool( $value ) ) {\n\t\treturn $value;\n\t} elseif ( is_numeric( $value ) ) {\n\t\treturn (bool) $value;\n\t} elseif ( is_string( $value ) ) {\n\t\tif ( in_array( strtolower( $value ), array( 'true', 'on', 'yes' ), true ) ) {\n\t\t\treturn true;\n\t\t} elseif ( in_array( strtolower( $value ), array( 'false', 'off', 'no' ), true ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn (bool) $value;\n}", "public function testToStringWithStringValueNo()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean('no');\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals('false', $boolean->__toString());\n\t}", "protected function escapeBoolean($value)\n {\n return ($value) ? $this->booleanTrue : $this->booleanFalse;\n }", "function converter(&$value, $key){\n if($value === \"true\") {\n $value = TRUE;\n } elseif ($value === \"false\") {\n $value = FALSE;\n }\n if ($key === \"not\") {\n if ($value === \"1\") {\n $value = TRUE;\n }\n if ($value === \"0\") {\n $value = FALSE;\n }\n }\n }", "private function bool($value)\n\t{\n\t\t// We do *not* follow the string 0 php casting rule.\n\t\t// {if field} should be true if the user entered\n\t\t// something. Doesn't matter what it is.\n\t\tif ($value === '0')\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn (bool) $value;\n\t}", "public function clean_boolean($input)\r\n {\r\n settype($input, 'boolean');\r\n return $input;\r\n }", "public function wt_parse_bool_field($value) {\n if ('0' === $value) {\n return false;\n }\n\n if ('1' === $value) {\n return true;\n }\n\n // Don't return explicit true or false for empty fields or values like 'notify'.\n return wc_clean($value);\n }", "public function testStringWithZeroCastedToBoolGivesFalse() {\n\t\t$this->assertFalse((bool)'0');\n\t}", "function message($boolValue) {\n\tif($boolValue) {\n\t\techo \"TRUE: \";\n\t} else {\n\t\techo \"FALSE: \";\n\t}\n\techo \"GOT value as \", (int)$boolValue, \"\\n\";\n}", "function get_bool_or_null($value)\r\n{\r\n $temp = null ;\r\n\r\n if(is_null($value)){\r\n\r\n $temp .= \"<code style='font_size: 9px ; color:#3465a4 '>\" . PHP_EOL ;\r\n \r\n $temp .= 'null' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\"; \r\n\r\n }else if(is_bool($value)){\r\n $temp .= '<code style=\"font_size: 10px\">boolean </code>';\r\n \r\n $temp .= \"<code style='font_size: 9px ; color:#75507b '>\" . PHP_EOL ;\r\n \r\n $temp .= $value == true ? 'true' : 'false' . PHP_EOL;\r\n \r\n $temp .= \"</code><br>\";\r\n \r\n }\r\n\r\n return $temp ;\r\n}", "function bool ($value)\r\n{\r\n\tif ($value === true || $value === false)\r\n\t\treturn $value;\r\n\r\n\treturn $value === 'true' || ($value !== 'false' && !!$value);\r\n}", "protected function _castBoolToString(&$item, $key)\n {\n if (is_bool($item)) {\n $item = ($item) ? 'true' : 'false';\n }\n }", "function o_castBool($value) {\n\t\t\treturn Obj::singleton()->castBool($value);\n\t\t}", "public function bool_to_bit( $value ) {\n\t\treturn ( ! empty( $value ) && 'false' !== $value ) ? '1' : '';\n\t}", "function validate_boolean($bool){\n if ($bool == \"\" ) { return true ; }\n $bool = strtolower($bool);\n\n $true = array(\"y\",\"yes\",\"t\",\"true\",\"n\",\"no\",\"f\",\"false\");\n if ( in_array($bool, $true ) ) {\n return true ;\n }\n\n if ( is_bool($bool) ) {\n return true ;\n }\n else { \n return false ;\n }\n}", "public function getBooleanFormatForQueryString(): string\n {\n return $this->booleanFormatForQueryString;\n }", "protected function stringIfTrue($check, $str) {\n if($check)\n return $str;\n return '';\n }", "public function bool()\n {\n return filter_var($this->value, FILTER_VALIDATE_BOOLEAN);\n }", "function serendipity_ini_bool($var) {\n return ($var === 'on' || $var == '1');\n}", "private function convert_to_boolean_attributes() {\n foreach ($this->attributes() as $attr => $val) {\n if (preg_match('/^can_/', $attr) || preg_match('/^is_/', $attr)) {\n $this->$attr = ($val == '1');\n }\n }\n }", "public static function bool($input = \"\"):bool {\n\n # check if email\n\t\treturn filter_var($input, FILTER_VALIDATE_BOOL) ? true : false;\n\n }", "public function testMethodToStringWithStringValueN()\n\t{\n\t // initialize a new Boolean instance\n\t $boolean = new TechDivision_Lang_Boolean(true);\n\t\t// check that the two boolean are equal\n\t\t$this->assertEquals(\n\t\t\tnew TechDivision_Lang_String('true'), \n\t\t\t$boolean->toString()\n\t\t);\n\t}", "function wpsl_bool_check( $atts ) {\n\n foreach ( $atts as $key => $val ) {\n if ( in_array( $val, array( 'true', '1', 'yes', 'on' ) ) ) {\n $atts[$key] = true;\n } else if ( in_array( $val, array( 'false', '0', 'no', 'off' ) ) ) {\n $atts[$key] = false;\n }\n }\n\n return $atts;\n}", "public static function boolean() {}", "function boolval($in, $strict = false) {\n\t\tif (is_bool($in)){\n\t\t\treturn $in;\n\t\t}\n\t\t$in = strtolower($in);\n\t\t$out = null;\n\t\tif (in_array($in, array('false', 'no', 'n', 'off', '0', 0, null), true)) {\n\t\t\t$out = false;\n\t\t} else if ($strict) {\n\t\t\tif (in_array($in, array('true', 'yes', 'y', 'on', '1', 1), true)) {\n\t\t\t\t$out = true;\n\t\t\t}\n\t\t} else {\n\t\t\t$out = ($in ? true : false);\n\t\t}\n\t\treturn $out;\n\t}", "public function ifStr($str);", "function isBoolType($a = 0)\n{\n $b = (boolean)$a;\n\n echo \"число $a при переводе в булев тип изменится на '$b ' <br/>\n так как при переводе значение boolean будет = false(по правилам приведения типов)\";\n echo \"<br>\";\n var_dump($a, $b);\n}", "function isValidBoolean($var) {\n //Returns blank error message for a false character string, such as \"0\", \"false\", \"off\" and \"no\"\n //Otherwise returns an error message\n\n //Check for unsafe characters\n $msg = isSantizeString($var);\n if ($msg != \"\") {\n return $msg;\n }\n\n $msg = filter_var($var, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);\n if ($msg === true || $msg === false) {\n return \"\";\n } else {\n return \"Invalid Boolean\";\n }\n}", "public static function ensureString($value)\n\t{\n\t\tif (TJavaScript::isJsLiteral($value))\n\t\t\treturn $value;\n\t\tif (is_bool($value))\n\t\t\treturn $value?'true':'false';\n\t\telse\n\t\t\treturn (string)$value;\n\t}", "function to_boolean ($value) {\n\tif (\n\n\t\t// Falsy\n\t\t!$value or\n\n\t\t// Empty\n\t\tempty($value) or\n\n\t\t// Zero or less\n\t\t(is_numeric($value) and strval($value) <= 0) or\n\n\t\t// Keyword\n\t\t(is_string($value) and in_array(trim(strtolower($value)), array('null', 'nul', 'nil', 'false')))\n\n\t) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function when_match( $bool, $str = '', $otherwise_str = '', $echo = true ) {\n\t$str = trim( $bool ? $str : $otherwise_str );\n\n\tif ( $str ) {\n\t\t$str = ' ' . $str;\n\n\t\tif ( $echo ) {\n\t\t\techo esc_attr($str);\n\t\t\treturn '';\n\t\t}\n\t}\n\n\treturn $str;\n}", "public function toBool($bool): bool\n {\n if (!\\is_string($bool)) {\n return (bool) $bool;\n }\n \n return strtolower($bool) === 'true' ? true : false;\n }", "function trans_single( $name ) {\r\n $name = trim($name);\r\n if ($name == \"false\" || !$name) {\r\n return 0;\r\n }\r\n else {\r\n return 1;\r\n }\r\n }", "public static function plainBoolean($value)\n {\n if ($value === true) {\n return 'Yes';\n } elseif ($value === false) {\n return 'No';\n }\n\n return '---';\n }" ]
[ "0.8043605", "0.7928609", "0.7789", "0.77377677", "0.7605333", "0.7509016", "0.7467655", "0.7461856", "0.74408287", "0.7313766", "0.7304124", "0.7283361", "0.7221148", "0.72047126", "0.71382177", "0.7126457", "0.7120392", "0.7034559", "0.70320797", "0.7021255", "0.7020636", "0.70194405", "0.6980457", "0.6974896", "0.696857", "0.69669676", "0.694941", "0.694608", "0.6928562", "0.69185555", "0.6909922", "0.6902995", "0.68724823", "0.68306583", "0.6822956", "0.675897", "0.67412597", "0.67199296", "0.67180395", "0.6694184", "0.6631432", "0.6610473", "0.6603326", "0.65995455", "0.6558349", "0.65517324", "0.6536166", "0.6503783", "0.6502744", "0.6467664", "0.6435899", "0.64241254", "0.6390848", "0.638401", "0.6377551", "0.6360604", "0.6360309", "0.63409615", "0.6314595", "0.6299404", "0.6295338", "0.6287646", "0.6280446", "0.62735206", "0.6271936", "0.6270246", "0.6236196", "0.623015", "0.6222964", "0.6216804", "0.6212319", "0.6203305", "0.6158031", "0.61503965", "0.6147135", "0.61353225", "0.61299676", "0.6124666", "0.6124382", "0.61145294", "0.6104461", "0.60773855", "0.6077076", "0.60658985", "0.6063274", "0.6015899", "0.60145926", "0.59958297", "0.59939754", "0.5985112", "0.5979994", "0.59724647", "0.59715945", "0.59686923", "0.59633523", "0.59399533", "0.5938146", "0.59214175", "0.59151554", "0.5907703" ]
0.6793404
35
Erzeugt Textausgabe der Ergebnisse der einzelnen Testcases
public function getTestResults() { /* * Wenn die Tests noch nicht ausgeführt wurden, dies nun tun */ if ($this->_needRun === true) { $this->run(); } foreach ($this->_testCases as $key => $testCase) { /* * Zusicherung nicht erfüllt */ if ($testCase['assert'] !== $testCase['result']) { $this->_testResults[$key] = $this->_testCases[$key]['functionName'].": fehlgeschlagen ". $this->boolToString($testCase['assert'])." != ".$this->boolToString($testCase['result'])."<br>"; $this->_failedTests++; } /* * Zusicherung erfüllt */ else { $this->_testResults[$key] = $this->_testCases[$key]['functionName'].": erfolgreich ". $this->boolToString($testCase['assert'])." == ".$this->boolToString($testCase['result'])."<br>"; $this->_passedTests++; } } return $this->_testResults; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_test_solution($testtype, $wo_record, $nosent, $wo_text)\n{\n if ($testtype == 1) {\n $trans = repl_tab_nl($wo_record['WoTranslation']) . \n getWordTagList($wo_record['WoID'], ' ', 1, 0);\n return $nosent ? $trans : \"[$trans]\";\n }\n return $wo_text;\n}", "public function runTests() {\n $results = \"\";\n for ($i = 0; $i < sizeof($this->tests); $i++) {\n $results .= \"Test \" . ($i + 1) . \": \" . $this->tests[$i]->runTest() . \"<br>\";\n }\n return $results;\n }", "public function testValidateDocumentTxtValidation()\n {\n }", "function do_test_test_content()\n{\n global $debug;\n \n $testsql = do_test_get_test_sql(\n $_REQUEST['selection'], $_SESSION['testsql'], $_REQUEST['lang'], $_REQUEST['text']\n );\n $totaltests = $_SESSION['testtotal'];\n $testtype = do_test_get_test_type((int)getreq('type'));\n $count = get_first_value(\n \"SELECT COUNT(DISTINCT WoID) AS value \n FROM $testsql AND WoStatus BETWEEN 1 AND 5 \n AND WoTranslation != '' AND WoTranslation != '*' AND WoTodayScore < 0\"\n );\n if ($debug) { \n echo \"DEBUG - COUNT TO TEST: $count<br />\"; \n }\n if (!is_numeric($count)) {\n my_die(\"The number of words left to test is not an integer: \\\"$count\\\"!\");\n }\n $notyettested = (int) $count;\n\n $count2 = prepare_test_area($testsql, $totaltests, $notyettested, $testtype);\n prepare_test_footer($notyettested);\n do_test_test_javascript($count2);\n}", "public function _summary() {\n $text = $this->_failed ? 'TESTS FAILED!' : 'TESTS PASSED';\n $result = $this->_colors->getColoredString($text, $this->_colorsPalete[!$this->_failed]);\n $this->_log($result);\n }", "function succ_test_html($test_counter, $test_name){\n echo \"<font size=\\\"2\\\" color=\\\"green\\\">$test_counter. $test_name TEST : passed</font><br>\\n\";\n }", "public function showTestResults() {\n echo \"Tests: {$this->tests}\\n\";\n echo \"Pass: {$this->pass}\\n\";\n echo \"Fail: {$this->fail}\\n\";\n }", "public static function text() {}", "public function text() {}", "public function text() {}", "public function text() {}", "function test()\n\t{\n\t\t$this->open('tickets/index.php/ticket653');\n\t\t$this->verifyTitle(\"Verifying Ticket 653\", \"\");\n\n\t\t$this->assertText('textspan', 'This is the page for Ticket653');\n\t}", "public function stringsTestDataProvider() {}", "public function get_text()\n {\n }", "public function testTitle()\n {\n $this->markTestSkipped();\n }", "function __construct($test_line)\n\t{\n\t\t$this->text = trim($test_line);\n\t\tif(strstr($test_line, 'ok') !== false)\n\t\t{\n\t\t $this->has_ok = true;\n\t\t}\n\t\tif(strstr($test_line, 'subtests') !== false || strstr($test_line, 'skipped') !== false)\n\t\t{\n\t\t $this->special_tags = true;\n\t\t}\n\t\tif(strstr($test_line, 'bonus') !== false)\n\t\t{\n\t\t $this->has_bonus = true;\n\t\t}\n\t\t\n\t\t$pos = strpos($this->text, ':');\n\t\t\n\t\tif($pos !== false && $pos != 0)\n\t\t{\n\t\t $tags = trim(substr($this->text, $pos+1));\n\t\t \n\t\t\t$key = substr($this->text, 0, $pos);\n\t\t\t//$tags = substr($this->text, $pos+1);\n\t\t\t\n\t\t\t//if(trim($tags) == ';') return;\n\t\t\t\n\t\t\tif($this->special_tags) return; // if no_tags then dont add this unit test to stats\n\t\t\t\n\t\t\tif(isset(UnitTest::$success_count) && array_key_exists($key, UnitTest::$success_count))\n\t\t\t{\n\t\t\t\tif($this->has_ok)\n\t\t\t\t{\n\t\t\t\t\tUnitTest::$success_count[$key]++;\n \n\t\t\t\t}\n \n UnitTest::$all_count[$key]++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($this->has_ok)\n\t\t\t\t{\n\t\t\t\t\tUnitTest::$success_count[$key]=1;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tUnitTest::$success_count[$key]=0;\n\t\t\t\t}\n \n UnitTest::$all_count[$key]=1;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function testTranslationUI() {\n $this->doTestBasicTranslation();\n $this->doTestTranslationOverview();\n $this->doTestOutdatedStatus();\n $this->doTestPublishedStatus();\n $this->doTestAuthoringInfo();\n $this->doTestTranslationEdit();\n $this->doTestTranslationChanged();\n $this->doTestChangedTimeAfterSaveWithoutChanges();\n $this->doTestTranslationDeletion();\n }", "public function run()\n {\n $count = CountString::$countTests;\n $ar = $this->getAr();\n for ($i = 1, $ii = 1; $i <= $count; $i++, $ii++) {\n if ($ii > 3) {\n $ii = 1;\n }\n\n if ((Test::where('id', '=', $i)->first()) === null) {\n $Test = Test::create([\n 'user_id' => '1',\n 'grade_id' => $ii ,\n 'subject_id' => $ii,\n 'page_id' => $ii,\n 'name' => ($i) . '-й тест',\n 'slug' => str_slug(($i) . '-й тест', '_', 'en'),\n\n\n 'text_input' => $ar['input'][$ii-1],\n 'text_html' => $ar['html'][$ii-1],\n\n 'difficulty' => 0,\n 'difficulty_2' => 0,\n 'difficulty_3' => 0,\n\n\n 'comment' => 'comment - ' . $i,\n 'description' => 'description - ' . $i,\n\n\n 'active' => 1,\n 'published_at' => now()\n\n ]);\n\n $Test->save();\n }\n }\n }", "function testText()\n {\n $l_st=new StaticText();\n $l_st->setText(new DynamicStaticValue(static::TEXT));\n $l_store=new MapData(null);\n $l_text=$l_st->getAttValue(\"text\", $l_store,\"string\",true);\n $this->assertEquals(static::TEXT,$l_text);\n }", "function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}", "public function testing(){\n\t\t$this->load->library(\"unit_test\");\n\n\t\t$this->unit->run($this->isValid(\"\"), \"null\", \"Test Validasi Null\");\n\t\t$this->unit->run($this->isValid(\"*&&^^\"), \"symbolerror\", \"Test Validasi Symbol\");\n\t\t$this->unit->run($this->isValidHari(\"Selasa\"), true, \"Test Validasi Hari\");\n\t\t$this->unit->run($this->isValidJam(\"0\"), false, \"Test Validasi Jam\");\n\n\t\techo $this->unit->report();\n\t}", "public function testGetUnitDetails()\n {\n }", "public function testCanBeUsedAsString()\n {\n\n }", "function unsucc_test_html($test_counter, $test_name, $returned_val, $exp_val){\n echo \"<font size=\\\"2\\\" color=\\\"red\\\">$test_counter. $test_name TEST : failed</font><br>\\n\";\n if($returned_val === \"124\"){\n echo \"<font size=\\\"2\\\" color=\\\"black\\\" style=\\\"margin-left: 15%\\\">Program got stucked killed the process</font><br>\\n\";\n }\n echo \"<font size=\\\"2\\\" color=\\\"black\\\" style=\\\"margin-left: 15%\\\">Expected return value : $exp_val - returned : $returned_val</font><br>\\n\";\n }", "public function test_scenario1() {\n\n $data = array(\n array(\"model\" =>\n array(\"topic_model\" =>\n array(\"alpha\" => 0.08,\n \"beta\" => 0.1,\n \"hashed_seed\" => 0,\n \"language\" => \"en\",\n \"bigrams\" => True,\n \"case_sensitive\" => False,\n \"term_topic_assignments\" => array(array(0, 0, 1, 2),\n array(0, 1, 2, 0),\n array(1, 2, 0, 0),\n array(0, 0, 2, 0)),\n \"termset\" => array(\"cycling\", \"playing\", \"shouldn't\", \"uńąnimous court\"),\n \"options\" => [],\n \"topics\" => array(array(\"name\" => \"Topic 1\",\n \"id\" => \"000000\",\n \"top_terms\" => array(\"a\", \"b\"),\n \"probability\" => 0.1),\n array(\"name\" => \"Topic 2\",\n \"id\" => \"000001\",\n \"top_terms\" => array(\"c\", \"d\"),\n \"probability\" => 0.1),\n array(\"name\" => \"Topic 3\",\n \"id\" => \"000000\",\n \"top_terms\" => array(\"e\", \"f\"),\n \"probability\" => 0.1),\n array(\"name\" => \"Topic 4\",\n \"id\" => \"000000\",\n \"top_terms\" => array(\"g\", \"h\"),\n \"probability\" => 0.1)),\n \"fields\" => array(\"000001\" => array(\"datatype\" => \"string\",\n \"name\" => \"TEST TEXT\",\n \"optype\" => \"text\",\n \"order\" => 0,\n \"preferred\" => True,\n \"summary\" => [],\n \"term_analysis\" => []))),\n \"resource\" => \"topicmodel/aaaaaabbbbbbccccccdddddd\",\n \"status\" => array(\"code\" => 5)),\n \"text\" => array(\"TEST TEXT\" => \"uńąnimous court 'UŃĄNIMOUS COURT' `play``the plays PLAYing SHOULDN'T CYCLE cycling shouldn't uńąnimous or court's\"),\n \"expected\" => array(array(\"name\" => 'Topic 1', \"probability\" => 0.17068527918781726),\n array(\"name\" => 'Topic 2', \"probability\" => 0.1865482233502538),\n array(\"name\" => 'Topic 3', \"probability\" => 0.5157043147208121),\n array(\"name\" => 'Topic 4', \"probability\" => 0.12706218274111675))));\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a local distribution from a Topic Model\\n\";\n print \"I create a local topic model\\n\";\n $object = json_decode(json_encode($item[\"model\"]), FALSE);\n $local_topic_model = new TopicModel($object);\n\n print \"I create a distribution for local topic model\\n\";\n $distribution = $local_topic_model->distribution($item[\"text\"]);\n\n print \"And the distribution for local topic model equals the expected values.\\n\";\n $this->assertEquals($distribution, $item[\"expected\"]);\n }\n }", "public function getTests();", "public function testGetSnippet()\n {\n\n }", "public static function main() {\r\n require_once \"PHPUnit/TextUI/TestRunner.php\";\r\n\r\n $suite = new PHPUnit_Framework_TestSuite(\"SpreadsheetReader_TextTest\");\r\n $result = PHPUnit_TextUI_TestRunner::run($suite);\r\n }", "function TestCase_get_text($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get_text', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function get_proizvod_Test(){\r\n $this->unit->run($this->get_proizvod(0), TRUE, 'Testiranje ucitavanja jednog dela proizvoda');\r\n echo $this->unit->report();\r\n }", "public function getTestCode()\n {\n return $this->getField(5)[0];\n }", "public function testGetTextSegment()\n {\n $this->assertEquals($this->alignment->getTextSegmentId(), $this->alignment->getTextSegment()->getId());\n }", "public static function makeDescription(TestCase $testCase): string\n {\n $name = $testCase->getName(true);\n\n // First, lets replace underscore by spaces.\n $name = str_replace('_', ' ', $name);\n\n // Then, replace upper cases by spaces.\n $name = (string) preg_replace('/([A-Z])/', ' $1', $name);\n\n // Finally, if it starts with `test`, we remove it.\n $name = (string) preg_replace('/^test/', '', $name);\n\n // Removes spaces\n $name = (string) trim($name);\n\n // Finally, lower case everything\n return (string) mb_strtolower($name);\n }", "public function getTestName()\n {\n return $this->getField(5)[1];\n }", "function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite(__CLASS__);\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "public function testGetChars()\n {\n $this->todo('stub');\n }", "private function generateTextData()\n {\n return $this->faker->sentence();\n }", "public function testGetText()\n {\n $doc = $this->createDomDocument('<content>Less: &lt;</content>');\n $content = new Content($this->createFakeNode(), $doc->documentElement->firstChild);\n static::assertEquals('text', $content->getType());\n static::assertEquals('Less: <', (string) $content);\n }", "public function testCreateTestCaseWithDetails()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->click('#newCase')\n ->seePageIs('/library/testcase/create')\n ->type('TestCase2', 'name1')\n ->select('1', 'testSuite1')\n ->type('someDecription','description1')\n ->type('somePrefixes','prefixes1')\n ->type('someSteps','steps1')\n ->type('someResult','expectedResult1')\n ->type('someSuffixes','suffixes1')\n ->press('submit');\n\n $this->seeInDatabase('TestCaseHistory', [\n 'TestCaseDescription' => 'someDecription',\n 'TestCasePrefixes' => 'somePrefixes',\n 'TestSteps' => 'someSteps',\n 'ExpectedResult' => 'someResult',\n 'TestCaseSuffixes' => 'someSuffixes'\n ]);\n }", "public function addToTests()\n\t{\n\t\treturn parent::addToTests(\n\t\t\tsprintf('public function test%s%s()', $this->class, $this->sufix),\n\t\t\t'{',\n\t\t\tsprintf(\"\\t\\$this->common('report.%s'); //%s%s\", $this->route, 'TO', 'DO'),\n\t\t\t\"}\\n\"\n\t\t);\n\t}", "public static function get_tests()\n {\n }", "public function getTestInfo($test)\n {\n /* Mapping of gettext strings -> labels. */\n $labels = array(\n 'contains' => _(\"Contains\"),\n 'not contain' => _(\"Doesn't contain\"),\n 'is' => _(\"Is\"),\n 'not is' => _(\"Isn't\"),\n 'begins with' => _(\"Begins with\"),\n 'not begins with' => _(\"Doesn't begin with\"),\n 'ends with' => _(\"Ends with\"),\n 'not ends with' => _(\"Doesn't end with\"),\n 'exists' => _(\"Exists\"),\n 'not exist' => _(\"Doesn't exist\"),\n 'regex' => _(\"Regular expression\"),\n 'not regex' => _(\"Doesn't match regular expression\"),\n 'matches' => _(\"Matches (with placeholders)\"),\n 'not matches' => _(\"Doesn't match (with placeholders)\"),\n 'less than' => _(\"Less than\"),\n 'less than or equal to' => _(\"Less than or equal to\"),\n 'greater than' => _(\"Greater than\"),\n 'greater than or equal to' => _(\"Greater than or equal to\"),\n 'equal' => _(\"Equal to\"),\n 'not equal' => _(\"Not equal to\")\n );\n\n /* The type of tests available. */\n $types = array(\n 'int' => array(\n 'less than', 'less than or equal to', 'greater than',\n 'greater than or equal to', 'equal', 'not equal'\n ),\n 'none' => array(\n 'exists', 'not exist'\n ),\n 'text' => array(\n 'contains', 'not contain', 'is', 'not is', 'begins with',\n 'not begins with', 'ends with', 'not ends with', 'regex',\n 'not regex', 'matches', 'not matches'\n )\n );\n\n /* Create the information object. */\n $ob = new stdClass;\n $ob->label = $labels[$test];\n foreach ($types as $key => $val) {\n if (in_array($test, $val)) {\n $ob->type = $key;\n break;\n }\n }\n\n return $ob;\n }", "public function provideSpecialCharacterTests() {\n $result = [\n [[\n 'descr' => \"& and < and > and \\\" get replaced with HTML-safe equivalents.\",\n 'bbcode' => \"This <woo!> &\\\"yeah!\\\" 'sizzle'\",\n 'html' => \"This &lt;woo!&gt; &amp;&quot;yeah!&quot; 'sizzle'\",\n ]],\n [[\n 'descr' => \":-) produces a smiley <img> element.\",\n 'bbcode' => \"This is a test of the emergency broadcasting system :-)\",\n 'regex' => <<<'REGEX'\n`This is a test of the emergency broadcasting system <img src=\"smileys/smile.gif\" alt=\":-\\)\" title=\":-\\)\" class=\"bbcode_smiley\" />`\nREGEX\n,\n ]],\n [[\n 'descr' => \"--- does *not* produce a [rule] tag.\",\n 'bbcode' => \"This is a test of the --- emergency broadcasting system.\",\n 'html' => \"This is a test of the --- emergency broadcasting system.\",\n ]],\n [[\n 'descr' => \"---- does *not* produce a [rule] tag.\",\n 'bbcode' => \"This is a test of the ---- emergency broadcasting system.\",\n 'html' => \"This is a test of the ---- emergency broadcasting system.\",\n ]],\n [[\n 'descr' => \"----- produces a [rule] tag.\",\n 'bbcode' => \"This is a test of the ----- emergency broadcasting system.\",\n 'html' => \"This is a test of the\\n<hr class=\\\"bbcode_rule\\\" />\\nemergency broadcasting system.\",\n ]],\n [[\n 'descr' => \"--------- produces a [rule] tag.\",\n 'bbcode' => \"This is a test of the --------- emergency broadcasting system.\",\n 'html' => \"This is a test of the\\n<hr class=\\\"bbcode_rule\\\" />\\nemergency broadcasting system.\",\n ]],\n [[\n 'descr' => \"[-] does *not* produce a comment.\",\n 'bbcode' => \"This is a test of the [- emergency broadcasting] system.\",\n 'html' => \"This is a test of the [- emergency broadcasting] system.\",\n ]],\n [[\n 'descr' => \"[--] produces a comment.\",\n 'bbcode' => \"This is a test of the [-- emergency broadcasting] system.\",\n 'html' => \"This is a test of the system.\",\n ]],\n [[\n 'descr' => \"[----] produces a comment.\",\n 'bbcode' => \"This is a test of the [---- emergency broadcasting] system.\",\n 'html' => \"This is a test of the system.\",\n ]],\n [[\n 'descr' => \"[--] comments may contain - and [ and \\\" and ' characters.\",\n 'bbcode' => \"This is a test of the [-- emergency - [ \\\" ' broadcasting] system.\",\n 'html' => \"This is a test of the system.\",\n ]],\n [[\n 'descr' => \"[--] comments may *not* contain newlines.\",\n 'bbcode' => \"This is a test of the [-- emergency\\n\\rbroadcasting] system.\",\n 'html' => \"This is a test of the [-- emergency<br>\\nbroadcasting] system.\",\n ]],\n [[\n 'descr' => \"['] produces a comment.\",\n 'bbcode' => \"This is a test of the ['emergency broadcasting] system.\",\n 'html' => \"This is a test of the system.\",\n ]],\n [[\n 'descr' => \"['] comments may contain [ and \\\" and ' characters.\",\n 'bbcode' => \"This is a test of the ['emergency [ \\\" ' broadcasting] system.\",\n 'html' => \"This is a test of the system.\",\n ]],\n [[\n 'descr' => \"['] comments may *not* contain newlines.\",\n 'bbcode' => \"This is a test of the [' emergency\\n\\rbroadcasting] system.\",\n 'html' => \"This is a test of the [' emergency<br>\\nbroadcasting] system.\",\n ]],\n [[\n 'descr' => \"[!-- --] produces a comment.\",\n 'bbcode' => \"This is a test of the [!-- emergency broadcasting --] system.\",\n 'html' => \"This is a test of the system.\",\n ]],\n [[\n 'descr' => \"[!-- ] does *not* produce a viable comment.\",\n 'bbcode' => \"This is a test of the [!-- emergency broadcasting ] system.\",\n 'html' => \"This is a test of the [!-- emergency broadcasting ] system.\",\n ]],\n [[\n 'descr' => \"[!-- - -- ] [ --] produces a comment.\",\n 'bbcode' => \"This is a test of the [!-- emergency - broadcasting -- system ] thingy --].\",\n 'html' => \"This is a test of the .\",\n ]],\n [[\n 'descr' => \"[!-- - -- ] [ --] --] produces a comment with a --] left over.\",\n 'bbcode' => \"This is a test of the [!-- emergency - broadcasting -- system ] thingy --] and other --] stuff.\",\n 'html' => \"This is a test of the and other --] stuff.\",\n ]],\n [[\n 'descr' => \"[!-- --] does not break any following tags outside it.\",\n 'bbcode' => \"The [!-- quick brown --]fox jumps over the [b]lazy[/b] [i]dog[/i].\",\n 'html' => \"The fox jumps over the <b>lazy</b> <i>dog</i>.\",\n ]],\n [[\n 'descr' => \"Tag marker mode '<' works correctly.\",\n 'bbcode' => \"This is <b>a <i>test</b></i>.\",\n 'html' => \"This is <b>a <i>test</i></b>.\",\n 'tag_marker' => '<',\n ]],\n [[\n 'descr' => \"Tag marker mode '{' works correctly.\",\n 'bbcode' => \"This is {b}a {i}test{/b}{/i}.\",\n 'html' => \"This is <b>a <i>test</i></b>.\",\n 'tag_marker' => '{',\n ]],\n [[\n 'descr' => \"Tag marker mode '(' works correctly.\",\n 'bbcode' => \"This is (b)a (i)test(/b)(/i).\",\n 'html' => \"This is <b>a <i>test</i></b>.\",\n 'tag_marker' => '(',\n ]],\n [[\n 'descr' => \"Ampersand pass-through mode works correctly.\",\n 'bbcode' => \"This is <b>a <i>test</b></i> &amp; some junk.\",\n 'html' => \"This is <b>a <i>test</i></b> &amp; some junk.\",\n 'tag_marker' => '<',\n ]],\n ];\n return $result;\n }", "public function testKojiPreskacem()\n {\n $this->markTestSkipped(\"ovaj test je namjerno prekocen\");\n }", "public function getText();", "public function getText();", "public function getText();", "public function test_transform_all() {\n\t\t\t$text = $this->instance->transform(array(\n\t\t\t\t'repository' => \"slack\",\n\t\t\t\t'revision' => \"r126299\",\n\t\t\t\t'url' => 'http://svn.example.com/wsvn/main/?op=revision&rev=126299',\n\t\t\t\t'author' => 'ph',\n\t\t\t\t'log' => 'commit message',\n\t\t\t));\n\n\t\t\t$this->assertEquals($text, '[slack] <http://svn.example.com/wsvn/main/?op=revision&amp;rev=126299|r126299>: ph - commit message');\n\t\t}", "public function testForSmallWords2() {\n $ret = $this->resolucao->textWrap($this->baseString, 12);\n $this->assertEquals(\"Se vi mais\", $ret[0]);\n $this->assertEquals(\"longe foi\", $ret[1]);\n $this->assertEquals(\"por estar de\", $ret[2]);\n $this->assertEquals(\"pé sobre\", $ret[3]);\n $this->assertEquals(\"ombros de\", $ret[4]);\n $this->assertEquals(\"gigantes\", $ret[5]);\n $this->assertCount(6, $ret);\n }", "public function testAddText()\n {\n $element = new Element();\n $element->addText('text');\n\n // expected\n $expected = [\n [\n 'type' => 'mrkdwn',\n 'text' => 'text',\n 'verbatim' => false,\n ],\n ];\n\n // assert\n $this->assertEquals($expected, $element->elements);\n }", "public function test_comicEntityIsCreated_textObjects_setTextObjects()\n {\n $sut = $this->getSUT();\n $textObjects = $sut->getTextObjects();\n\n $expected = [\n TextObject::create(\n 'issue_solicit_text',\n 'en-us',\n \"It's the origin of the original Avenger, Ant-Man! Hank Pym has been known by a variety of names — including Ant-Man, Giant-Man, Goliath and Yellowjacket — he’s been an innovative scientist, a famed super hero, an abusive spouse and more. What demons drive a man like Hank Pym? And how did he begin his heroic career? \"\n ),\n ];\n\n $this->assertEquals($expected, $textObjects);\n }", "public function testGetExpert()\n {\n }", "public static function main()\n {\n $suite = new PHPUnit_Framework_TestSuite('Tinebase_NotesTest');\n PHPUnit_TextUI_TestRunner::run($suite);\n }", "public function testLocationAndTexts() {\r\n for($i = 0; $i < 9; $i++) {\r\n echo '$loc[' . $i . ']: ' . $loc[$i] . '<br/>';\r\n }\r\n for($i = 0; $i < 9; $i++) {\r\n echo '$texts[' . $i . ']: ' . $texts[$i] . '<br/>';\r\n }\r\n }", "public function providerToPlainText() {\n $tests = [];\n $tests[] = ['some text', 'some text'];\n $tests[] = ['some &amp; text', 'some & text'];\n $tests[] = ['<b>some text</b>', 'some text'];\n $tests[] = ['<script>alert(\\'message\\');</script><b>some text</b>', 'alert(\\'message\\');some text'];\n return $tests;\n }", "static function main() {\n\t\t$suite = new PHPUnit_Framework_TestSuite(__CLASS__);\n\t\t$result = PHPUnit_TextUI_TestRunner::run($suite);\n\t}", "abstract protected function run_tests($code, $testcases);", "function toString() {\n return sprintf(\n \"TestCase %s->%s() failed: %s\\n\",\n\n get_class($this->_failedTest),\n $this->_failedTest->getName(),\n $this->_thrownException\n );\n }", "public static function getTestString(){\n\t\t//This function will throw out a test string. It is for testing only.\n\t\t$testString = 'me re re me fa me re re me me me fa se sol sol fa sol la sol fa me';\n\t\t//$testString = 'me re re me sol me';\n\t\treturn($testString);\n\t}", "public function testSetText()\n {\n $label = Tag::label();\n $label->div([], 'Test');\n $this->assertEquals(trim((string) $label), \"<label>\\n <div>\\n Test\\n </div>\\n</label>\");\n }", "public function testFormatText()\n {\n foreach ($this->testLocales as $locale) {\n foreach ($this->testAddresses as $data) {\n $expected = $this->getExpectedFormatWithLocale(\n $data,\n 'text',\n $locale\n );\n\n $formatted = $this->addressFormat->format(\n $data['source'],\n 'text',\n $locale\n );\n\n $this->assertEquals($expected, $formatted);\n }\n }\n }", "public function provideInlineConversionTests() {\n $result = [\n [[\n 'descr' => \"[i] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [i]emergency broadcasting system[/i].\",\n 'html' => \"This is a test of the <i>emergency broadcasting system</i>.\",\n ]],\n [[\n 'descr' => \"[b] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [b]emergency broadcasting system[/b].\",\n 'html' => \"This is a test of the <b>emergency broadcasting system</b>.\",\n ]],\n [[\n 'descr' => \"[u] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [u]emergency broadcasting system[/u].\",\n 'html' => \"This is a test of the <u>emergency broadcasting system</u>.\",\n ]],\n [[\n 'descr' => \"[s] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [s]emergency broadcasting system[/s].\",\n 'html' => \"This is a test of the <strike>emergency broadcasting system</strike>.\",\n ]],\n [[\n 'descr' => \"[sup] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [sup]emergency broadcasting system[/sup].\",\n 'html' => \"This is a test of the <sup>emergency broadcasting system</sup>.\",\n ]],\n [[\n 'descr' => \"[sub] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [sub]emergency broadcasting system[/sub].\",\n 'html' => \"This is a test of the <sub>emergency broadcasting system</sub>.\",\n ]],\n [[\n 'descr' => \"[font=Arial] gets correctly converted (simple font name).\",\n 'bbcode' => \"This is a test of the [font=Arial]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Arial'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=Times New Roman] gets correctly converted (unquoted default value).\",\n 'bbcode' => \"This is a test of the [font=Times New Roman]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Times New Roman'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=Times New Roman size=1] gets converted (trailing parameter identified).\",\n 'bbcode' => \"This is a test of the [font=Times New Roman size=1]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Times New Roman'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=\\\"Courier New\\\"] gets correctly converted (quoted default value).\",\n 'bbcode' => \"This is a test of the [font=\\\"Courier New\\\"]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Courier New'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[font=\\\"Courier New\\\" blarg size=1] gets converted (floating parameter ignored).\",\n 'bbcode' => \"This is a test of the [font=\\\"Courier New\\\" blarg size=1]emergency broadcasting system[/font].\",\n 'html' => \"This is a test of the <span style=\\\"font-family:'Courier New'\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[size=6] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [size=6]emergency broadcasting system[/size].\",\n 'html' => \"This is a test of the <span style=\\\"font-size:2.0em\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[size=10] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [size=10]emergency broadcasting system[/size].\",\n 'html' => \"This is a test of the <span style=\\\"font-size:1.0em\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[size=blah] gets ignored.\",\n 'bbcode' => \"This is a test of the [size=blah]emergency broadcasting system[/size].\",\n 'html' => \"This is a test of the [size=blah]emergency broadcasting system[/size].\",\n ]],\n [[\n 'descr' => \"[color=red] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [color=red]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the <span style=\\\"color:red\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[color=gronk] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [color=gronk]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the <span style=\\\"color:gronk\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[color=#FFF] gets correctly converted.\",\n 'bbcode' => \"This is a test of the [color=#FFF]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the <span style=\\\"color:#FFF\\\">emergency broadcasting system</span>.\",\n ]],\n [[\n 'descr' => \"[color=*#\\$] is prohibited.\",\n 'bbcode' => \"This is a test of the [color=*#\\$]emergency broadcasting system[/color].\",\n 'html' => \"This is a test of the [color=*#\\$]emergency broadcasting system[/color].\",\n ]],\n [[\n 'descr' => \"[spoiler] gets converted.\",\n 'bbcode' => \"Ssh, don't tell, but [spoiler]Darth is Luke's father[/spoiler]!\",\n 'html' => \"Ssh, don't tell, but <span class=\\\"bbcode_spoiler\\\">Darth is Luke's father</span>!\",\n ]],\n [[\n 'descr' => \"[acronym] gets converted.\",\n 'bbcode' => \"The [acronym=\\\"British Broadcasting Company\\\"]BBC[/acronym] airs [i]Doctor Who[/i] on Saturdays.\",\n 'html' => \"The <span class=\\\"bbcode_acronym\\\" title=\\\"British Broadcasting Company\\\">BBC</span> airs <i>Doctor Who</i> on Saturdays.\",\n ]],\n [[\n 'descr' => \"[acronym] safely encodes its content.\",\n 'bbcode' => \"The [acronym=_\\\"><script>alert(/XSS/.source)</script><x]Foo[/acronym] is safe.\",\n 'html' => \"The <span class=\\\"bbcode_acronym\\\" title=\\\"_&quot;&gt;&lt;script&gt;alert(/XSS/.source)&lt;/script&gt;&lt;x\\\">Foo</span> is safe.\",\n ]],\n ];\n return $result;\n }", "public function getTestCases ()\n {\n return $this->_testCases;\n }", "public function testTextInfo() {\n $this->assertFalse($this->object->isset_textInfo());\n\n $textInfo = 'test';\n $this->object->set_textInfo($textInfo);\n $this->assertTrue($this->object->isset_textInfo());\n $this->assertEquals($textInfo, $this->object->get_textInfo());\n }", "public function kahlanBaseline()\n {\n return \"The PHP Test Framework for Freedom, Truth and Justice.\";\n }", "public static function main() \n {\n require_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite(\"Zend_Filter_Word_UnderscoreToSeparatorTest\");\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "function testOutput()\n { \n $l_st=new StaticText();\n $l_st->setText(new DynamicStaticValue(static::TEXT));\n $l_st->setClass(new DynamicStaticValue(\"MyClass\")); \n $this->expectOutputRegex(\"/span(.*)MyClass(.*)\".htmlspecialchars(static::TEXT).\"/s\");\n $this->displayElement($l_st,[]);\n }", "public function test_scenario3() {\n\n $data = array(array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_1.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_1.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => true, \"stem_words\" => true, \"use_stopwords\" => false, \"language\" => \"en\"))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_2.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_2.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => true, \"stem_words\" => true, \"use_stopwords\" => false))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_3.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_3.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => false, \"stem_words\" => false, \"use_stopwords\" => false, \"language\" => \"en\"))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_4.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_4.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"case_sensitive\" => false, \"stem_words\" => true, \"use_stopwords\" => true, \"language\" => \"en\"))))),\n array(\"filename\"=> \"data/spam.csv\",\n \"local_file\" => \"tmp/if_then_rules_spam_textanalysis_5.txt\",\n \"expected_file\" => \"data/model/if_then_rules_spam_textanalysis_5.txt\",\n \"options\" => array(\"fields\" => array(\"000001\" => array(\"optype\" => \"text\", \"term_analysis\" => array(\"token_mode\" => \"full_terms_only\", \"language\" => \"en\" )))))\n );\n\n\n foreach($data as $item) {\n print \"\\nSuccessfully creating a model and translate the tree model into a set of IF-THEN rules\\n\";\n\n print \"Given I create a data source uploading a \". $item[\"filename\"]. \" file\\n\";\n $source = self::$api->create_source($item[\"filename\"], $options=array('name'=>'local_test_source', 'project'=> self::$project->resource));\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $source->code);\n $this->assertEquals(1, $source->object->status->code);\n\n print \"And I wait until the source is ready\\n\";\n $resource = self::$api->_check_resource($source->resource, null, 10000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I update the source with options \" . json_encode($item[\"options\"]) . \"\\n\";\n\t $source = self::$api->update_source($source->resource, $item[\"options\"]);\n\t $this->assertEquals(BigMLRequest::HTTP_ACCEPTED, $source->code);\n\n print \"And I create dataset with local source\\n\";\n $dataset = self::$api->create_dataset($source->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $dataset->code);\n $this->assertEquals(BigMLRequest::QUEUED, $dataset->object->status->code);\n\n print \"And I wait until the dataset is ready\\n\";\n $resource = self::$api->_check_resource($dataset->resource, null, 10000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create model\\n\";\n $model = self::$api->create_model($dataset->resource);\n $this->assertEquals(BigMLRequest::HTTP_CREATED, $model->code);\n\n print \"And I wait until the model is ready \". $model->resource . \"\\n\";\n $resource = self::$api->_check_resource($model->resource, null, 10000, 30);\n $this->assertEquals(BigMLRequest::FINISHED, $resource[\"status\"]);\n\n print \"And I create a local model\\n\";\n $local_model = new Model($model->resource, self::$api);\n print \"And I translate the tree into IF_THEN rules\\n\";\n\n $fp = fopen($item[\"local_file\"], 'w');\n $local_model->rules($fp);\n fclose($fp);\n print \" Then I check the output is like \" . $item[\"expected_file\"] . \" expected file\\n\";\n $this->assertEquals(0, strcmp(trim(file_get_contents($item[\"local_file\"])), trim(file_get_contents($item[\"expected_file\"]))));\n\n }\n }", "public function testGetContador()\n {\n }", "public function testGetValidMessageByMessageText(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function run()\n {\n $a = \"test\";\n $b = \"that is test\";\n assert($b==\"this is $a\");\n }", "public function testBasicTest()\n {\n $response = $this->get('/test');\n\n $response->assertStatus(200);\n\n $response->assertSeeText('小粽子');\n\n }", "public function testGetStatementParameters()\n {\n // Start of user code Statement.testgetStatementParameters\n // Case covered by testToString\n // End of user code\n }", "function get_test_description($_script, $_suite, $_test)\n{\n\tglobal $caldavtester_dir, $testspath;\n\t// a little bit of caching\n\tstatic $script=null, $xml=null;\n\tif ($script !== $_script)\n\t{\n\t\t$xml = simplexml_load_file($caldavtester_dir.'/'.$testspath.$_script);\n\t\t$script = $_script;\n\t}\n\tif ($xml)\n\t{\n\t\tforeach($xml->{'test-suite'} as $suite)\n\t\t{\n\t\t\tif ((string)$suite['name'] === $_suite)\n\t\t\t{\n\t\t\t\tforeach($suite->test as $test)\n\t\t\t\t{\n\t\t\t\t\tif ((string)$test['name'] === $_test)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $test->description;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\t// no need to search further\n\t\t\t}\n\t\t}\n\t}\n\t// script, suite or test not found\n\treturn null;\n}", "public function testForSmallWords() {\n $ret = $this->resolucao->textWrap($this->baseString, 8);\n $this->assertEquals(\"Se vi\", $ret[0]);\n $this->assertEquals(\"mais\", $ret[1]);\n $this->assertEquals(\"longe\", $ret[2]);\n $this->assertEquals(\"foi por\", $ret[3]);\n $this->assertEquals(\"estar de\", $ret[4]);\n $this->assertEquals(\"pé sobre\", $ret[5]);\n $this->assertEquals(\"ombros\", $ret[6]);\n $this->assertEquals(\"de\", $ret[7]);\n $this->assertEquals(\"gigantes\", $ret[8]);\n $this->assertCount(9, $ret);\n }", "public function runTestSequence ()\n {\n $this->numberOfAssertions = 0;\n \n try {\n // Run setup\n $this->setUp();\n \n // Run test\n $this->result = $this->runtest();\n \n $this->status = 0; // Passed\n } // Catch for incomplete test\n catch (CIUnit_Framework_Exception_IncompleteTest $e) {\n $this->status = 2; // Incomplete\n $this->statusMessage = $e->getMessage();\n } \n\n // Catch for skipped test\n catch (CIUnit_Framework_Exception_SkippedTest $e) {\n $this->status = 1; // Skipped\n $this->statusMessage = $e->getMessage();\n } \n\n // Catch for Assertion Failure\n catch (CIUnit_Framework_Exception_AssertionFailed $e) {\n $this->status = 3; // Failure\n $this->statusMessage = $e->getMessage();\n } // Catch for Error\n catch (Exception $e) {\n $this->status = 4; // Error\n $this->statusMessage = $e->getMessage();\n }\n \n // revert fictures\n try {\n $this->tearDown();\n } // catch any errors\n catch (Exception $error) {\n if (! isset($e))\n $e = $error;\n }\n \n // If there is exception caught throw it\n if (isset($e))\n throw $e;\n }", "public function displayTest( ) {\n }", "public function runTests()\n {\n $this->testCase(1, array (1, 1));\n $this->testCase(2, array (1, 2));\n $this->testCase(3, array (2, 2));\n $this->testCase(4, array (2, 2));\n $this->testCase(5, array (2, 3));\n $this->testCase(6, array (2, 3));\n $this->testCase(7, array (3, 3));\n $this->testCase(8, array (3, 3));\n $this->testCase(9, array (3, 3));\n $this->testCase(10, array(2, 5));\n $this->testCase(11, array(3, 4));\n $this->testCase(12, array(3, 4));\n $this->testCase(13, array(4, 4));\n $this->testCase(14, array(4, 4));\n $this->testCase(15, array(4, 4));\n $this->testCase(16, array(4, 4));\n $this->testCase(17, array(3, 6));\n $this->testCase(18, array(3, 6));\n $this->testCase(19, array(4, 5));\n $this->testCase(20, array(4, 5));\n $this->testCase(21, array(3, 7));\n $this->testCase(22, array(5, 5));\n $this->testCase(23, array(5, 5));\n $this->testCase(24, array(5, 5));\n $this->testCase(25, array(5, 5));\n $this->testCase(26, array(4, 7));\n $this->testCase(27, array(4, 7));\n $this->testCase(28, array(4, 7));\n $this->testCase(29, array(5, 6));\n $this->testCase(30, array(5, 6));\n $this->testCase(31, array(4, 8));\n $this->testCase(32, array(4, 8));\n $this->testCase(33, array(6, 6));\n $this->testCase(34, array(6, 6));\n $this->testCase(35, array(6, 6));\n $this->testCase(36, array(6, 6));\n $this->testCase(37, array(5, 8));\n $this->testCase(38, array(5, 8));\n $this->testCase(39, array(5, 8));\n $this->testCase(40, array(5, 8));\n $this->testCase(41, array(6, 7));\n $this->testCase(42, array(6, 7));\n $this->testCase(43, array(5, 9));\n $this->testCase(44, array(5, 9));\n $this->testCase(45, array(5, 9));\n $this->testCase(46, array(7, 7));\n $this->testCase(47, array(7, 7));\n $this->testCase(48, array(7, 7));\n $this->testCase(49, array(7, 7));\n $this->testCase(50, array(5, 10));\n $this->testCase(51, array(6, 9));\n $this->testCase(52, array(6, 9));\n $this->testCase(53, array(6, 9));\n $this->testCase(54, array(6, 9));\n $this->testCase(55, array(7, 8));\n $this->testCase(56, array(7, 8));\n $this->testCase(57, array(6, 10));\n $this->testCase(58, array(6, 10));\n $this->testCase(59, array(6, 10));\n $this->testCase(60, array(6, 10));\n $this->testCase(61, array(8, 8));\n $this->testCase(62, array(8, 8));\n $this->testCase(63, array(8, 8));\n $this->testCase(64, array(8, 8));\n $this->testCase(65, array(6, 11));\n $this->testCase(66, array(6, 11));\n $this->testCase(67, array(7, 10));\n $this->testCase(68, array(7, 10));\n $this->testCase(69, array(7, 10));\n $this->testCase(70, array(7, 10));\n $this->testCase(71, array(8, 9));\n $this->testCase(72, array(8, 9));\n $this->testCase(73, array(7, 11));\n $this->testCase(74, array(7, 11));\n $this->testCase(75, array(7, 11));\n $this->testCase(76, array(7, 11));\n $this->testCase(77, array(7, 11));\n $this->testCase(78, array(9, 9));\n $this->testCase(79, array(9, 9));\n $this->testCase(80, array(9, 9));\n $this->testCase(81, array(9, 9));\n $this->testCase(82, array(7, 12));\n $this->testCase(83, array(7, 12));\n $this->testCase(84, array(7, 12));\n $this->testCase(85, array(8, 11));\n $this->testCase(86, array(8, 11));\n $this->testCase(87, array(8, 11));\n $this->testCase(88, array(8, 11));\n $this->testCase(89, array(9, 10));\n $this->testCase(90, array(9, 10));\n $this->testCase(91, array(7, 13));\n $this->testCase(92, array(8, 12));\n $this->testCase(93, array(8, 12));\n $this->testCase(94, array(8, 12));\n $this->testCase(95, array(8, 12));\n $this->testCase(96, array(8, 12));\n $this->testCase(97, array(10, 10));\n $this->testCase(98, array(10, 10));\n $this->testCase(99, array(10, 10));\n $this->testCase(100, array(10, 10));\n }", "function test1(){\n $tests = array();\n $tests[] = array('äa.txt', '%5g]a.txt');\n $tests[] = array('ä.', '%5g].');\n $tests[] = array('asciistring','asciistring');\n $tests[] = array('ascii-_/.string','ascii-_/.string');\n $tests[] = array('AName','%x%1a]ame');\n $tests[] = array('A Name','%x%0%1a]ame');\n $tests[] = array('Another...Name','%x]nother...%1a]ame');\n $tests[] = array('Aß∂ƒName','%x%5b%6oy%aa%1a]ame');\n $tests[] = array('A%ß-∂_.ƒName','%x%%5b]-%6oy]_.%aa%1a]ame');\n $tests[] = array('A%%ß-∂_.ƒName','%x%%%5b]-%6oy]_.%aa%1a]ame');\n $tests[] = array('데이터도 함께 복원됩니다. 강력한','%zf4%13dg%15ao%zhg%0%164o%yig%0%11at%138w%zk9%zag%zb8].%0%xyt%10cl%164c]');\n $tests[] = array('совместимая','%td%ta%sy%t8%t1%td%te%t4%t8%sw%tr]');\n $tests[] = array('нехватка_файлового_пространства_на_сервере_p0-squid.some.domain.1270211897.txt.gz','%t9%t1%th%sy%sw%te%t6%sw]_%tg%sw%t5%t7%ta%sy%ta%sz%ta]_%tb%tc%ta%td%te%tc%sw%t9%td%te%sy%sw]_%t9%sw]_%td%t1%tc%sy%t1%tc%t1]_p0-squid.some.domain.1270211897.txt.gz');\n\n $tests[] = array('name[1]','name[1]');\n $tests[] = array('Name[1]','%1a]ame[1]');\n $tests[] = array('Name[A]','%1a]ame[%x]]');\n\n foreach($tests as $test){\n list($utf8,$safe) = $test;\n $this->assertEquals(SafeFN::encode($utf8),$safe);\n $this->assertEquals(SafeFN::decode($safe),$utf8);\n }\n }", "public function testTitleText() {\n // Confirm that the view has the normal title before making the view return\n // no result.\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n\n // Change the view to return no result.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Add a value which does not exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Euler',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_empty | Drupal');\n\n // Change the view to return a result instead.\n /** @var \\Drupal\\views\\Entity\\View $view */\n $view = View::load('test_area_title');\n $display =& $view->getDisplay('default');\n $display['display_options']['filters']['name'] = [\n 'field' => 'name',\n 'id' => 'name',\n 'table' => 'views_test_data',\n 'relationship' => 'none',\n 'plugin_id' => 'string',\n // Change to a value which does exist. The dataset is defined in\n // \\Drupal\\views\\Tests\\ViewTestData::dataSet().\n 'value' => 'Ringo',\n ];\n $view->save();\n\n $this->drupalGet('test-area-title');\n $this->assertSession()->titleEquals('test_title_header | Drupal');\n }", "function verifyTextSearchReplaceAll(){\n parent::doExpandAdvanceSection();\n $this->type(TEXT_EDITOR, \"\");\n $this->click(LINK_SEARCH);\n $this->type(TEXT_EDITOR, (TEXT_SAMPLE));\n $this->type(INPUT_SEARCH, (TEXT_SEARCH));\n $this->type(INPUT_REPLACE, (TEXT_REPLACE));\n $this->click(BUTTON_REPLACEALL);\n $this->click(BUTTON_CANCEL);\n $this->click(BUTTON_PREVIEW);\n $this->waitForPageToLoad((WIKI_TEST_WAIT_TIME));\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT1));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT2));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n try {\n $this->assertEquals((TEXT_REPLACE), $this->getText(TEXT_PREVIEW_TEXT3));\n } catch (PHPUnit_Framework_AssertionFailedError $e) {\n parent::doCreateScreenShot(__FUNCTION__);\n array_push($this->verificationErrors, $e->toString());\n }\n }", "public function testSimple()\n {\n //$tokenizer->tokenize(__FILE__);\n }", "public function testValidateText(){\n\n\t\t$errors = $this->validator->detect_errors('valid', 'text');\n\t\t// var_dump($errors);\n\t\t$this->assertEquals( count($errors), 0 );\n\n\t\t$errors = $this->validator->detect_errors('valid', 'textarea');\n\t\t// var_dump($errors);\n\t\t$this->assertEquals( count($errors), 0 );\n\n\t\t$errors = $this->validator->detect_errors('invalid'.\"\\r\\n\".\"invalid\", 'text');\n\t\t// var_dump($errors);\n\t\t$this->assertEquals( count($errors), 1 );\n\n\t\t$errors = $this->validator->detect_errors('valid'.\"\\r\\n\".\"valid\", 'textarea');\n\t\t// var_dump($errors);\n\t\t$this->assertEquals( count($errors), 0 );\n\n\t}", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public static function main() \n {\n require_once \"PHPUnit/TextUI/TestRunner.php\";\n\n $suite = new PHPUnit_Framework_TestSuite(\"Zend_Filter_Word_UnderscoreToPathSeparatorTest\");\n $result = PHPUnit_TextUI_TestRunner::run($suite);\n }", "public function getTextContent();", "public function testGetTitle(){\n $this->assertSame(\"Ms./Mrs.\", Customer::getTitle(\"female\"));\n $this->assertSame(\"Mr.\", Customer::getTitle(\"male\"));\n $this->assertSame(\"\", Customer::getTitle(\"\"));\n $this->assertSame(\"\", Customer::getTitle(\"daererer\"));\n }", "public function cli_main() {\t\t\r\n\t\t$command = new Tx_PHPUnitCli_TextUI_Command();\r\n\t\t\r\n\t\t$arguments = $this->cli_getArgIndex();\r\n\t\t$rawArguments = $_SERVER['argv'];\r\n\t\t\r\n\t\tif ($arguments[$this->customArgumentKey]) {\r\n\t\t\t$extensionsWithTestSuites = $this->getExtensionsWithTestSuites();\r\n\t\t\t$testSuite = new PHPUnit_Framework_TestSuite();\r\n\t\t\t\r\n\t\t\tif (count($arguments[$this->customArgumentKey])==1) {\r\n\t\t\t\t\t// parameter as comma separated list of extension keys\r\n\t\t\t\t$extensionKeysToProcess = t3lib_div::trimExplode(',', $arguments[$this->customArgumentKey][0]);\r\n\t\t\t} else {\r\n\t\t\t\t\t// parameter\r\n\t\t\t\t$extensionKeysToProcess = $arguments[$this->customArgumentKey];\r\n\t\t\t}\r\n\t\t\t\t// Load the files containing test cases from extensions:\r\n\t\t\tforeach ($extensionKeysToProcess as $extensionKey) {\r\n\t\t\t\tif (!t3lib_extMgm::isLoaded($extensionKey)) {\r\n\t\t\t\t\t$this->cli_echo(\"Extension $extensionKey not loaded\\n\");\r\n\t\t\t\t\texit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);\r\n\t\t\t\t}\r\n\t\t\t\t$paths = $extensionsWithTestSuites[$extensionKey];\r\n\t\t\t\tself::loadRequiredTestClasses($paths);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Add all classes to the test suite which end with \"testcase\"\r\n\t\t\tforeach (get_declared_classes() as $class) {\r\n\t\t\t\t$classReflection = new ReflectionClass($class);\r\n\t\t\t\tif ($classReflection->isSubclassOf('tx_phpunit_testcase') && (strtolower(substr($class, -8, 8)) == 'testcase' || substr($class, -4, 4) == 'Test') && $class != 'tx_phpunit_testcase' && $class != 'tx_phpunit_database_testcase' && $class != 'tx_t3unit_testcase') {\r\n\t\t\t\t\t$testSuite->addTestSuite($class);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$command->setTest($testSuite);\r\n\t\t\t\r\n\t\t\t$rawArguments = $this->filterCustomCLIArguments($rawArguments);\r\n\t\t}\r\n\r\n\t\t$command->run($rawArguments, true);\r\n\t\t\r\n\t\t$testRunner = new PHPUnit_TextUI_TestRunner();\r\n\r\n\t\t$result = $testRunner->doRun($testSuite, $arguments = array());\r\n\t\t\r\n\t\tif ($exit) {\r\n\t\t\tif (isset($result) && $result->wasSuccessful()) {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);\r\n\t\t\t}\r\n\t\t\r\n\t\t\telse if (!isset($result) || $result->errorCount() > 0) {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);\r\n\t\t\t}\r\n\t\t\r\n\t\t\telse {\r\n\t\t\t\texit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}", "public function testMain()\n {\n echo \"\\n >----------- Test Main : ---------> \\n\";\n// $this->getRandomNumber();\n// $this->getLoggedUserMail();\n// $this->saveVerificationCode();\n// $this->verification();\n// $this->checkEmailVerification();\n// $this->checkSendCode();\n }", "function runTests() {\n\tAssertFileMatches('The.Tv.Show.S24E13.720p.HDTV.X264-GROUPNAME.torrent');\n\tAssertFileMatches('Another.Tv.Show.S11E13.720p.HDTV.X264-GROUPNAME.torrent');\n\tAssertFileDoesNotMatch('boring.tv.show.torrent');\n}", "public function testCompleteScenarioEn(): void {\n $crawler = $this->logInSuperAdmin(\"en\");\n $client = $this->getClient();\n $crawler = $client->click($crawler->filter(\"#navbar\")->selectLink(\"Manage Contacts\")->link());\n\n // 1. list all messages\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"1.1 The status code expected is not ok.\");\n $this->assertEquals(\"/en/sadmin/contact\", $client->getRequest()->getRequestUri(), \"1.2 The request uri expected is not ok.\");\n $this->assertContains(\"Contacts management - Nairus\", $crawler->filter(\"html > head > title\")->text(), \"1.3 The page title is not ok\");\n $this->assertEquals(\"Contacts list\", $crawler->filter(\"h1\")->text(), \"1.4 The page h1 is not ok\");\n $this->assertNotNull($crawler->filter(\"#contacts-container > table\"), \"1.5 The message's list is missing\");\n $theadCols = $crawler->filter(\"#contacts-container > table > thead > tr > th\");\n $this->assertEquals(6, $theadCols->count(), \"1.6 Six cols are expected\");\n $this->assertEquals(\"Last name / First name\", $theadCols->eq(1)->text(), \"1.7 The col title is not ok\");\n $this->assertEquals(\"Phone / Email\", $theadCols->eq(2)->text(), \"1.8 The col title is not ok\");\n $this->assertEquals(\"Ip\", $theadCols->eq(3)->text(), \"1.9 The col title is not ok\");\n $this->assertEquals(\"Request date\", $theadCols->eq(4)->text(), \"1.10 The col title is not ok\");\n $this->assertEquals(\"Actions\", $theadCols->eq(5)->text(), \"1.11 The col title is not ok\");\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $this->assertEquals(2, $tbodyRow->count(), \"1.12 Two rows are expected\");\n $this->assertContains('<i class=\"far fa-comment-dots\"></i>', $tbodyRow->eq(0)->children()->eq(1)->html(), \"1.13 The message icon is missing\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $tbodyRow->eq(0)->children()->eq(3)->html(), \"1.14 The blacklisted icon is missing\");\n $this->assertCount(2, $tbodyRow->eq(0)->children()->eq(5)->filter(\"ul > li\"), \"1.15 Two actions button are expected\");\n $this->assertContains('<i class=\"far fa-comment-dots\"></i>', $tbodyRow->eq(1)->children()->eq(1)->html(), \"1.16 The message icon is missing\");\n $this->assertNotContains('<i class=\"fas fa-user-slash\"></i>', $tbodyRow->eq(1)->children()->eq(3)->html(), \"1.17 The blacklisted icon is not expected\");\n $this->assertCount(3, $tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\"), \"1.18 Three actions button is expected\");\n $this->assertNotNull($crawler->filter(\"#message-contact-pager\"), \"1.19 The pagination container is expected\");\n\n // 2. go to page 2 and delete with list button\n $crawler = $client->click($crawler->filter(\"#message-contact-pager > nav > ul\")->selectLink(\"2\")->link());\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"2.1 The status code expected is not ok.\");\n $this->assertEquals(\"/en/sadmin/contact/2\", $client->getRequest()->getRequestUri(), \"2.2 The request uri expected is not ok.\");\n $this->assertContains(\"Contacts management - Page 2 - Nairus\", $crawler->filter(\"html > head > title\")->text(), \"2.3 The page title is not ok\");\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $this->assertEquals(1, $tbodyRow->count(), \"2.4 One row is expected\");\n $this->assertCount(2, $tbodyRow->eq(0)->children()->eq(5)->filter(\"ul > li\"), \"2.5 Two actions button are expected\");\n $deleteForm = $tbodyRow->eq(0)->children()->eq(5)->filter(\"ul\")->selectButton(\"Delete\")->form();\n $client->submit($deleteForm);\n $crawler = $client->followRedirect();\n\n // 3. return to the list (one page with no pagination)\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"3.1 The status code expected is not ok.\");\n $this->assertEquals(\"/en/sadmin/contact\", $client->getRequest()->getRequestUri(), \"3.2 The request uri expected is not ok.\");\n $this->assertNotNull($crawler->filter(\"#admin-container .message-container\"), \"3.3 The message container is missing\");\n $this->assertCount(1, $crawler->filter(\"#admin-container .message-container .alert-success\"), \"3.4 One success message is expected\");\n $this->assertRegExp(\"~The message No.\\\"[0-9]+\\\" has been successfully deleted!~\", $crawler->filter(\"#admin-container .message-container .alert-success\")->text(),\n \"3.5 The success message is not ok\");\n $this->assertEquals(0, $crawler->filter(\"#message-contact-pager\")->count(), \"3.6 The pager container should not be displayed.\");\n\n // 4. blacklist the second item with list page buttons\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $blacklistForm = $tbodyRow->eq(1)->children()->eq(5)->filter(\"ul\")->selectButton(\"Blacklist ip\")->form();\n $client->submit($blacklistForm);\n $crawler = $client->followRedirect();\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"4.1 The status code expected is not ok.\");\n $this->assertEquals(\"/en/sadmin/contact\", $client->getRequest()->getRequestUri(), \"4.2 The request uri expected is not ok.\");\n $this->assertNotNull($crawler->filter(\"#admin-container .message-container\"), \"4.3 The message container is missing\");\n $this->assertCount(1, $crawler->filter(\"#admin-container .message-container .alert-success\"), \"4.4 One success message is expected\");\n $this->assertRegExp(\"~The \\\"[0-9\\.]+\\\" ip has been successfully blacklisted!~\", $crawler->filter(\"#admin-container .message-container .alert-success\")->text(),\n \"4.5 The success message is not ok\");\n $tbodyRow = $crawler->filter(\"#contacts-container > table > tbody > tr\");\n $this->assertContains('<i class=\"fas fa-user-slash\"></i>', $tbodyRow->eq(1)->children()->eq(3)->html(), \"4.6 The blacklisted icon is not expected\");\n $this->assertCount(2, $tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\"), \"4.7 Two actions button are expected\");\n\n // 5. go to the show page and delete with the show page buttons\n $crawler = $client->click($tbodyRow->eq(1)->children()->eq(5)->filter(\"ul > li\")->selectLink(\"Show details\")->link());\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"5.1 The status code expected is not ok.\");\n $this->assertRegExp(\"~/en/sadmin/contact/[0-9]+/show$~\", $client->getRequest()->getRequestUri(), \"5.2 The request uri expected is not ok.\");\n $this->assertRegExp(\"~Detail of the message No. [0-9]+~\", $crawler->filter(\"html > head > title\")->text(), \"5.3 The page title is not ok\");\n $this->assertRegExp(\"~^Detail of the message No. [0-9]+$~\", $crawler->filter(\"h1\")->text(), \"5.3 The page h1 is not ok\");\n $content = $crawler->filter(\"#admin-container .card .card-body\");\n $this->assertContains(\"Son Goku\", $content->text(), \"5.4 The contact name is missing\");\n $this->assertContains(\"Bonjour le monde\", $content->text(), \"5.5 The contact message is missing\");\n $this->assertContains(\"[email protected]\", $content->text(), \"5.6 The contact email is missing\");\n $this->assertRegExp(\"~127.0.0.[0-9]+~\", $content->text(), \"5.7 The contact ip is missing\");\n $actionButtons = $crawler->filter(\"#admin-container .card .actions\")->children();\n $this->count(2, $actionButtons, \"5.8 Two action buttons are expected.\");\n $this->assertContains(\"Return to the list\", $actionButtons->eq(0)->text(), \"5.9 The label of the first button is not ok.\");\n $this->assertContains('<i class=\"fas fa-chevron-left\"></i>', $actionButtons->eq(0)->html(), \"5.10 The icon of the first button is not ok.\");\n $this->assertContains(\"Delete\", $actionButtons->eq(1)->text(), \"5.11 The label of the first button is not ok.\");\n $this->assertContains('<i class=\"fas fa-trash-alt\"></i>', $actionButtons->eq(1)->html(), \"5.12 The icon of the first button is not ok.\");\n\n // delete the message\n $client->submit($actionButtons->eq(1)->selectButton(\"Delete\")->form());\n $crawler = $client->followRedirect();\n\n // verify the result\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"5.13 The status code expected is not ok.\");\n $this->assertEquals(\"/en/sadmin/contact\", $client->getRequest()->getRequestUri(), \"5.14 The request uri expected is not ok.\");\n $this->assertNotNull($crawler->filter(\"#admin-container .message-container\"), \"5.15 The message container is missing\");\n $this->assertCount(1, $crawler->filter(\"#admin-container .message-container .alert-success\"), \"5.16 One success message is expected\");\n $this->assertRegExp(\"~The message No.\\\"[0-9]+\\\" has been successfully deleted!~\", $crawler->filter(\"#admin-container .message-container .alert-success\")->text(),\n \"5.17 The success message is not ok\");\n $this->assertEquals(1, $crawler->filter(\"#contacts-container > table > tbody > tr\")->count(), \"5.18 One row is expected\");\n\n // 6. delete the last message and verify the no-item message is displayed.\n $client->submit($crawler->selectButton(\"Delete\")->form());\n $crawler = $client->followRedirect();\n $this->assertEquals(200, $this->getClient()->getResponse()->getStatusCode(), \"6.1 The status code expected is not ok.\");\n $this->assertEquals(\"/en/sadmin/contact\", $client->getRequest()->getRequestUri(), \"6.2 The request uri expected is not ok.\");\n $this->assertNotNull($crawler->filter(\"#admin-container .message-container\"), \"6.3 The message container is missing\");\n $this->assertCount(1, $crawler->filter(\"#admin-container .message-container .alert-success\"), \"6.4 One success message is expected\");\n $this->assertRegExp(\"~The message No.\\\"[0-9]+\\\" has been successfully deleted!~\", $crawler->filter(\"#admin-container .message-container .alert-success\")->text(),\n \"6.5 The success message is not ok\");\n $this->assertCount(0, $crawler->filter(\"#contacts-container > table\"), \"6.6 No row is expected\");\n $this->assertContains(\"There is no item for now!\", $crawler->filter(\"#contacts-container\")->text(), \"6.7 The no-item label is missing\");\n }", "public function test_init() {\n\n\t\t// chceme jenom zobrazit napovedu\n\t\tif ($this->opt['mode'] == HELP) {\n\t\t\techo <<<EOT\n--help vypíše na standardní výstup nápovědu skriptu (nenačítá žádný vstup), kterou lze převzít ze zadání (lze odstranit diakritiku, případně přeložit do angličtiny dle zvoleného jazyka dokumentace). Tento parametr nelze kombinovat s žádným dalším parametrem, jinak skript ukončete s chybou 10.\n--directory=path testy bude hledat v zadaném adresáři (chybí-li tento parametr, tak skript\nprochází aktuální adresář)\n--recursive testy bude hledat nejen v zadaném adresáři, ale i rekurzivně ve všech jeho podadresářích\n--parse-script=file soubor se skriptem v PHP 5.6 pro analýzu zdrojového kódu v IPP- code18 (chybí-li tento parametr, tak implicitní hodnotou je parse.php uložený v aktuálním adresáři)\n--int-script=file soubor se skriptem v Python 3.6 pro interpret XML reprezentace kódu v IPPcode18 (chybí-li tento parametr, tak implicitní hodnotou je interpret.py uložený v ak- tuálním adresáři)\nEOT;\n\t\t} else {\n\t\t\t// zjistime me, odkud chceme testy cist\n\t\t\t$path = $this->opt['flags']['directory'][1];\n\t\t\t// kdyz uzivatel nezada, prohledavame aktualni adresar\n\t\t\tif (strcmp($path, \"\") == 0) {\n\t\t\t\t$path = '.';\n\t\t\t}\n\n\t\t\t// chceme prohledavat rekurzivne?\n\t\t\t$recursive = $this->opt['flags']['recursive'];\n\t\t\t// prohledame adresar/adresare\n\t\t\t$io = new Tests_IO($path, $recursive);\n\t\t\t$this->_dirs = $io->io_lookup();\n\n\t\t\t// zavolame funkci na provedeni testu\n\t\t\t$this->_test_exec();\n\t\t}\n\t}", "public function testGetTaskComment()\n {\n }", "function runTests() {\n\t\tif(is_array($this->_aTests)){\n\t\t\tforeach($this->_aTests as $test){\n\t\t\t\t$this->_aResults[$test->sName] = array();\n\t\t\t\t$this->_aResults = $test->run($this->_aResults);\n\n\t\t\t}\n\t\t}\n\t}", "public function do_tests()\n {\n foreach ($this->tests as $test) {\n $test->do_test($this->parse_script, $this->interpret_script);\n }\n }", "protected function test9() {\n\n }", "function getTests(){\n $listOfAvailableTests = parent::getTests();\n $url = get_instance()->uri->uri_string();\n $listOfSubTests = trim(Text::getSubstringAfter($url, '/subtests/'));\n if($listOfSubTests){\n $listOfSubTests = explode(',', $listOfSubTests);\n foreach($listOfSubTests as $key => &$subTest){\n $subTest = trim($subTest);\n if(!in_array($subTest, $listOfAvailableTests)){\n unset($listOfSubTests[$key]);\n echo \"Test '$subTest' does not exist as a test within \" . $this->getLabel() . \"<br/>\";\n }\n }\n $listOfSkippedTests = array_diff($listOfAvailableTests, $listOfSubTests);\n $this->reporter->paintSkip(count($listOfSkippedTests) . \" tests not run.\");\n $listOfAvailableTests = $listOfSubTests;\n }\n return $listOfAvailableTests;\n }", "public function testBBcode()\n\t{\n\t\t$parsers = ParserWrapper::instance();\n\t\tforeach ($this->bbcTestCases as $testcase)\n\t\t{\n\t\t\t$name = $testcase[0];\n\t\t\t$test = $testcase[1];\n\t\t\t$expected = $testcase[2];\n\n\t\t\t$result = $parsers->parseMessage($test, true);\n\n\t\t\t$this->assertEquals($expected, $result, $name);\n\t\t}\n\t}", "public function run () {\r\n print \"\\n\";\r\n \r\n # Console spacing.\r\n foreach ( $this->tests as $test ) {\r\n if ( strlen( $test->name() ) > $this->longest_test_name_length )\r\n $this->longest_test_name_length = strlen( $test->name() );\r\n }\r\n \r\n foreach ( $this->tests as $test ) {\r\n $test->run();\r\n $this->print_test( $test );\r\n }\r\n \r\n $this->print_summary_stats();\r\n }", "function testNameAndTitleGeneration() {\n\t\t$file = $this->objFromFixture('File', 'asdf');\n\t\t$this->assertEquals('FileTest.txt', $file->Name);\n\t\t$this->assertNull($file->Title);\n\t\t\n\t\t/* However, if Name is set instead of Filename, then Title is set */\n\t\t$file = $this->objFromFixture('File', 'setfromname');\n\t\t$this->assertEquals(ASSETS_DIR . '/FileTest.png', $file->Filename);\n\t\t$this->assertEquals('FileTest', $file->Title);\n\t}" ]
[ "0.6502885", "0.64818543", "0.6185765", "0.61788356", "0.6126857", "0.6037545", "0.5992247", "0.59856766", "0.5964182", "0.5964182", "0.5964182", "0.5935763", "0.5934362", "0.59342265", "0.59047616", "0.58899754", "0.5848275", "0.5847947", "0.579946", "0.57921237", "0.5785505", "0.5784167", "0.5777784", "0.57714635", "0.5770748", "0.5769393", "0.5754624", "0.5751079", "0.5749824", "0.5745899", "0.5734937", "0.5732773", "0.5727665", "0.571656", "0.5696335", "0.5696027", "0.5687481", "0.5679758", "0.5668112", "0.56666744", "0.5646007", "0.5645492", "0.56373596", "0.5627645", "0.5613795", "0.5613795", "0.5613795", "0.56040806", "0.56025976", "0.5595493", "0.5569684", "0.5567456", "0.5561925", "0.556085", "0.5559779", "0.5553938", "0.5549403", "0.55469763", "0.55463636", "0.5546241", "0.55429536", "0.5539081", "0.5534919", "0.55298114", "0.5527627", "0.5523018", "0.55216235", "0.5521164", "0.55171424", "0.5512454", "0.55117875", "0.55052143", "0.55029005", "0.549762", "0.54917777", "0.54915416", "0.54824305", "0.5463879", "0.5462725", "0.5462201", "0.54549", "0.5453306", "0.5453097", "0.5452924", "0.545053", "0.5450505", "0.5447478", "0.544295", "0.5426728", "0.5425992", "0.542463", "0.5416715", "0.54080284", "0.54061097", "0.54056627", "0.5405295", "0.5403323", "0.54016393", "0.5401305", "0.54007715" ]
0.5969187
8
mengambil data produk secara random dengan batas maksimal yang ditentukan pd controller
function get_limit_history_penjualan($limit){ $this->db->order_by('Tanggal','asc'); $this->db->limit($limit); $query = $this->db->get('penjualan'); if ($query->num_rows()>0){ return $query->result(); }else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n /* $products = [];\n $types = ['Полиэфирные', 'Эпоксидные', 'Эпоксидно-полиэфирные', 'Полиуретановые', 'Силиконовые', 'Низкотемпературные', 'Фотоотверждающиеся'];\n $effects = ['Муар', 'Шагрень', 'Металлик', 'Глянец', 'Антик', 'Молотковый', 'Кожа', 'Другие'];\n $packages = ['Мешок', 'Коробка', 'Контейнер'];\n for ($i = 0; $i < 1000; $i++) {\n $name = 'Название краски номер ' . $i;\n $factory = 'Завод производитель краски номер' . $i;\n $typeOne = $types[array_rand($types, 1)];\n $effectsOne = $effects[array_rand($effects, 1)];\n $ral = rand(1000, 10000);\n $priceP = rand(100, 1000);\n $margin = rand(10, 50);\n $priceF = $priceP + $priceP * ($margin / 100);\n $packageOne = $packages[array_rand($packages, 1)];\n $weight = rand(1, 500);\n $products[] = [\n 'name' => $name,\n 'factory' => $factory,\n 'type' => $typeOne,\n 'effects' => $effectsOne,\n 'ral_color' => $ral,\n 'price_purchase' => $priceP,\n 'margin' => $margin,\n 'price_final' => $priceF,\n 'package_name'=>$packageOne,\n 'weight'=>$weight\n ];\n\n\n }\n DB::table('products')->insert($products);*/\n }", "public function run()\n {\n\n Product::truncate();\n $total = 60;\n $publisherArray = ['紅樹林出版','九章出版社','天下文化','天下雜誌','雄獅圖書','幼獅文化','卓著出版社'];\n $bookArray = ['唐吉軻德','雙城記','童軍警探','紅樓夢','麥田捕手','黑美人','玫瑰之名','天地一沙鷗','天使與魔鬼','安妮日記'];\n $InterpreterArray = ['呂相儒','林光 (當代翻譯家)','黎烈文','賴明珠','林曙光 (作家)',\n '劉其偉','劉墉 (作家、畫家)','李昂 (作家)','劉慕沙'];\n $fake = \\Faker\\Factory::create('zh_TW');\n foreach (range(1,$total) as $id){\n $price = rand(300,1200);\n $category_id = Category::inRandomOrder()->first()->id;\n $subcategory_id=Subcategory::inRandomOrder()->where('category_id',$category_id)->first()->subcategory_id;\n $product = Product::create([\n 'title' => $bookArray[($id-1)%10],\n 'subtitle' => $fake->realText(rand(10,15)),\n 'description' => $fake->realText(rand(10,15)),\n 'type' => 0,\n 'author' => \"作者\".($id-1)%10,\n 'publisher' => $publisherArray[rand(0,6)],\n 'publish_year'=>rand(1,2020),\n 'isbn'=>$this->randISBN(),\n 'category_id' =>$category_id,\n 'subcategory_id'=>$subcategory_id,\n 'author_description' =>$fake->realText(rand(10,15)),\n 'interpreter' => $InterpreterArray[rand(0,8)],\n 'list_price' => $price,\n 'sale_price' => floor($price*rand(60,100)/100),\n 'stock' => rand(0,10),\n ]);\n foreach (range(1,3) as $id){\n $product->tags()->attach(rand(1,8));\n }\n }\n }", "private function select_random() {\n $ad = $this->db_wrapper->select_data($this->table_name, '*', null, 1, 'RAND()');\n if($ad) {\n $ad = array_flat($ad);\n \n $this->ad_code = $ad['adcode'];\n $this->ad_id = $ad['ad_id'];\n $this->ad_title = $ad['ad_title'];\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n Produto::truncate();\n foreach(range(1,10) as $key =>$number) {\n $produto = Produto::create([\n \"pizzaria_id\" => random_int(1, 3),\n \"categoria_id\" => random_int(1, 6),\n \"nome\" => \"Produto {$key}\" ,\n \"imagem\" => \"\",\n \"descricao\" => $faker->text(),\n \"preco\" => random_int(1500, 50000)/10,\n \"quantidade\" => random_int(10, 100),\n ]);\n }\n }", "public function run()\n {\n $faker = Factory::create('id_ID');\n for ($c = 1; $c <= 5; $c++) {\n $sk = SuratKeluar::create([\n 'user_id' => User::where('role', Role::PEGAWAI)->inRandomOrder()->first()->id,\n 'jenis_id' => rand(JenisSurat::min('id'), JenisSurat::max('id')),\n 'nama_pengolah' => User::where('role', Role::PENGOLAH)->inRandomOrder()->first()->name,\n 'tgl_surat' => $faker->date('Y-m-d'),\n 'no_surat_penerima' => PerihalSurat::inRandomOrder()->first()->kode . '/' .\n str_pad($c, 3, '0', STR_PAD_LEFT) . '/' .\n $faker->randomNumber(3) . '.' . $faker->randomNumber(3) . '/' . rand(2018, 2019),\n 'instansi_penerima' => $faker->company,\n 'kota_penerima' => $faker->city,\n 'nama_penerima' => $faker->name,\n 'jabatan_penerima' => $faker->jobTitle,\n 'pangkat_penerima' => ucfirst(Factory::create()->word),\n 'nip_penerima' => $faker->nik(),\n 'no_surat' => PerihalSurat::inRandomOrder()->first()->kode . '/' .\n str_pad(SuratKeluar::count() + 1, 3, '0', STR_PAD_LEFT) .\n '/401.113/' . rand(2018, 2019),\n 'sifat_surat' => rand(0, 1) ? 'segera' : 'penting',\n 'lampiran' => '2 (dua) lembar',\n 'perihal' => $faker->sentence(rand(3, 6), true),\n 'isi' => '<p align=\"justify\">' . $faker->paragraphs(rand(2, 3), true) . '</p>',\n 'tembusan' => '<ol><li>' . $faker->name . '</li><li>' . $faker->name . '</li></ol>',\n 'status' => 5,\n 'files' => ['file1.jpg', 'file2.jpg'],\n ]);\n\n AgendaKeluar::create([\n 'suratkeluar_id' => $sk->id,\n 'ringkasan' => '<p align=\"justify\">' . $faker->sentences(rand(1, 2), true) . '</p>',\n 'keterangan' => $faker->sentence(),\n 'nama_tu' => User::where('role', Role::TU)->inRandomOrder()->first()->name,\n ]);\n }\n }", "Public function registrasi_dokter() {\n $kode_rs = 123; // kode RS jadi ini bisa buat jadi standarisasi 3 digit awal untuk id dokter\n $nip = $kode_rs.rand(1000,9999);\n $data['id_dokter'] = $nip;\n\n // load list spesialis dari db\n $data['spesialis'] = $this->model_dokter->get_spesialis()->result(); \n\n //melempar id_dokter ke view buat automation untuk pengisian id dokter\n $this->load->view('view_form_registrasi_dokter', $data);\n }", "public function run()\n {\n $faker = Faker::create();\n $solicitudCurso = PreNuSolicitudCurso::all();\n $asignatura = Asignatura::all(); \n $aceptado = array('si','no');\n $samples_temp = [];\n\n\t\tforeach ($asignatura as $item){\n\n $asigCodigo[] = $item->codigo;\n }\n foreach ($solicitudCurso as $item)\n {\n $num = $faker->numberBetween($min = 1, $max =6);\n \tfor($i = 0; $i < $num; $i ++){\n\n $samples_temp[] = [\n 'solicitud_curso' => $item->id,\n 'asignatura'=> $asigCodigo[$faker->unique->numberBetween($min = 0, $max = count($asigCodigo)-1)],\n 'observaciones'=>$faker->paragraph($nbSentences = 5, $variableNbSentences = true) ,\n 'aceptado'=>$aceptado[$faker->numberBetween($min = 0, $max = 1)]\n ];\n \t\t\n \t}\n \t\n }\n\n\n DetalleSolicitudCurso::insert($samples_temp);\n\n \n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n $input = array(\"L\", \"P\");\n // $input_spesialis = array(\n // \"Klinik Vaksin\",\"Poli Akupuntur Medic\",\"Poli Anak\",\"Poli Bedah\",\"Poli Gigi\",\"Poli Gigi Anak\",\"Poli Gizi\",\n // \"Poli Jantung\",\"Poli Kandungan\",\"Poli Kedokteran Olahraga\",\"Poli Klinik Morula\",\"Poli Klinik Kulit dan Kelamin\",\n // \"Poli Laktasi\",\"Poli Mata\",\"Poli Paru\",\"Poli Penyakit Dalam\",\"Poli Psikiater\",\"Poli Psikologi\",\n // \"Poli Syaraf\",\"Poli Telinga Hidung Tenggorokan\",\"Poli Tumbuh Kembang\",\"Poli Umum\",);\n\n\n for ($i=0; $i < 100; $i++) {\n $rand_keys = array_rand($input, 1);\n // $rand_spesialis = array_rand($input_spesialis, 1);\n DB::table('dokter')->insert([\n 'nama_dokter' => \"Dr. \".$faker->name,\n 'NIK' => $faker->isbn10,\n 'agama' => \"Islam\",\n 'nomor_str' => $faker->isbn10,\n 'email' => $faker->email,\n 'telpon' => $faker->e164PhoneNumber,\n 'password' => $faker->password,\n 'jenis_kelamin' => $input[$rand_keys],\n 'universitas' => \"Amikom\",\n 'tanggal_lahir' => $faker->dateTime('now', null),\n 'spesialis' => rand(1, 22),\n 'alamat' => $faker->address,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n ]);\n }\n }", "public function showProduct()\n {\n $shuffle_items = array();\n $products = Product::latest()->get();\n $shuffle_products = Product::get()->shuffle();\n foreach ($shuffle_products as $value) {\n $discount_item = $value->getProductPricing->first();\n if ($discount_item != null) {\n array_push($shuffle_items, $value);\n }\n }\n // dd($shuffle_items);\n return view('welcome', [\n 'shuffle_items' => array_slice($shuffle_items, 0, 4),\n 'products' => $products,\n 'random_products' => Product::all()->take(3),\n ]);\n }", "public function definition()\n {\n $allPL = DB::table('productlines')->get()->toArray();\n $allPLTitle = array_column($allPL, 'product_line');\n // $price = $this->faker->randomNumber(6, 2);\n // return [\n // 'product_code' => rand(123, 456),\n // 'product_name' => $this->faker->name(),\n // 'product_line' => $allPLTitle[array_rand($allPLTitle, 1)], // ko đc random -> phai lay tu bang productline\n // 'product_scale' => Str::random(100),\n // 'product_vendor' => $this->faker->company(),\n // 'product_description' => $this->faker->text($maxNbChars = 200),\n // 'quantity_inStock' => $this->faker->randomNumber(5),\n // 'price' => $price,\n // 'MSRP' => $this->faker->realText(),\n // 'image' => 'https://picsum.photos/200/300',\n // 'hot' => rand(0, 1),\n // 'cost_price' => $price + 100000,\n // ];\n\n $price = rand(100000, 10000000);\n return [\n 'product_code' => rand(123, 456),\n 'product_name' => Stringfake::generateRandomString(20),\n 'product_line' => $allPLTitle[array_rand($allPLTitle, 1)], // ko đc random -> phai lay tu bang productline\n 'product_scale' => Stringfake::generateRandomString(100),\n 'product_vendor' => Stringfake::generateRandomString(40),\n 'product_description' => Stringfake::generateRandomString(200),\n 'quantity_inStock' => rand(234, 567),\n 'price' => $price,\n 'MSRP' => Stringfake::generateRandomString(10),\n 'image' => 'https://picsum.photos/200/300',\n 'hot' => rand(0, 1),\n 'cost_price' => $price + 100000,\n ];\n }", "private function generateFakeData() {\n\n if( !isset($_SESSION['blogs']) ) { //Para no sobreescribi cada vez q refresquen la pagina\n \n for( $i = 1; $i <= 3; $i++ ) {\n $_SESSION['blogs'] = array(\n [\n 'title' => 'Tutorial de PHP ' . $i, \n 'body' => 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Enim id sint repudiandae sit assumenda ullam doloremque quisquam? Omnis quaerat, animi commodi officia alias eos, obcaecati impedit est voluptatem distinctio illum!'\n ],\n );\n }\n } \n }", "public function run()\n {\n $this->command->info('Data Di hapus');\n\n Admin::truncate();\n Pengguna::truncate();\n Transaksi::truncate();\n DetailTransaksi::truncate();\n Tracking::truncate();\n Kategori::truncate();\n SubKategori::truncate();\n\n $this->command->info('Data Sedang Dibuat');\n\n\n $admin = Admin::create([\n \t'id_admin' => AutoNumber::autoNumberAdmin('admin', 'id_admin', 'A'),\n \t'nama' => 'admin',\n \t'username' => 'admin',\n \t'password' => bcrypt('admin'),\n \t'jabatan' => 'admin',\n \t'img' => ''\n ]);\n\n $faker = Faker::create();\n foreach (range(1, 10) as $key => $value) {\n $this->command->info($key);\n $pengguna = new Pengguna;\n $pengguna->id_user = AutoNumber::autoNumberPengguna('pengguna', 'id_user', 'P');\n\n $transaksi = new Transaksi;\n $transaksi->kode_invoice = AutoNumber::autoNumberTransaksi('transaksi', 'kode_invoice', 'INV');\n $transaksi->id_user = $pengguna->id_user;\n $transaksi->total = 100000;\n $transaksi->status = 0;\n $transaksi->gambar_bukti = 'https://images.pexels.com/photos/9754/mountains-clouds-forest-fog.jpg?w=100&h=100&auto=compress&cs=tinysrgb';\n $transaksi->tanggal = date('Y-m-d');\n\n $detailTransaksi = new DetailTransaksi;\n $detailTransaksi->kode_invoice = $transaksi->kode_invoice;\n $detailTransaksi->nama_produk = 'Produk '. $key;\n $detailTransaksi->gambar_produk = $faker->imageUrl;\n $detailTransaksi->biaya_kirim = '100000';\n $detailTransaksi->subtotal = '100000';\n $detailTransaksi->caption = $faker->sentence;\n\n $subDetailTransaksi = new SubDetailTransaksi;\n $subDetailTransaksi->kode_detail = ++$key;\n $subDetailTransaksi->nama_bahan = 'Bahan '.$key;\n $subDetailTransaksi->jumlah = (1+$key);\n $subDetailTransaksi->subtotal = 50000;\n\n\n $tracking = new Tracking;\n $tracking->kode_invoice = $transaksi->kode_invoice;\n $tracking->pembelian_bahan_baku = 1;\n $tracking->cetak_kemasan = 0;\n $tracking->produksi = 0;\n $tracking->qc = 0;\n $tracking->pengiriman = 0;\n\n $pengguna->nama = $faker->firstName;\n $pengguna->username = $faker->username(2,10);\n $pengguna->email = $faker->email;\n $pengguna->whatsapp = $faker->phoneNumber;\n $pengguna->password = bcrypt('pengguna');\n $pengguna->status = 'Jabatan ' . $key;\n $pengguna->img = $faker->imageUrl;\n\n // kategori\n $kategori = new Kategori;\n $kategori->nama_kategori = 'Kategori '. $key;\n\n // sub kategori\n $subKategori = new SubKategori;\n $subKategori->id_kategori = $key;\n $subKategori->nama_subKategori = 'sub kategori '.$key;\n\n\n $kategori->save();\n $subKategori->save();\n $pengguna->save();\n $tracking->save();\n $detailTransaksi->save();\n $subDetailTransaksi->save();\n $transaksi->save();\n // Pengguna::create([\n // 'id_user' => AutoNumber::autoNumberPengguna('pengguna', 'id_user', 'P'),\n // 'nama' => $faker->name,\n // 'username' => $faker->username,\n // 'email' => $faker->email,\n // 'whatsapp' => $faker->phoneNumber,\n // 'password' => bcrypt($faker->password),\n // 'jabatan' => 'Jabatan ' . $key,\n // 'img' => $faker->imageUrl,\n // ]);\n }\n\n $this->command->info('Data Sudah dibuat');\n\n }", "public function definition()\n {\n $id = Penjualan::select('id')->get();\n return [\n 'penjualans_id' => $this->faker->randomElement($id),\n 'total' => $this->faker->numberBetWeen(1000, 9999999),\n 'terima' => $this->faker->numberBetWeen(1000, 9999999),\n 'kembali' => $this->faker->numberBetWeen(1000, 9999999),\n ];\n }", "public function definition()\n {\n $allPL = DB::table('productlines')->get()->toArray();\n $allPLTitle = array_column($allPL, 'product_line');\n\n return [\n 'product_code' => $this->faker->ean8 (),\n 'product_name' => $this->faker->name(),\n 'product_line' => $allPLTitle[array_rand($allPLTitle, 1)], // ko đc random -> phai lay tu bang productline\n 'product_scale' => Str::random(100),\n 'product_vendor' => $this->faker->company(),\n 'product_description' => $this->faker->text($maxNbChars = 200),\n 'quantity_inStock' => $this->faker->randomNumber(5),\n 'buy_price' => $this->faker->randomNumber(6, 2),\n 'MSRP' => $this->faker->realText(),\n\n\n ];\n }", "public function sample($jenis,$idpegawai)\n {\n if(Utils::cekHakakses('pegawai','l')){\n $pdo = DB::connection('perusahaan_db')->getPdo();\n //cek apakah atribut pegawai ada batasan?\n $bolehhapus = true;\n $pdo2 = DB::getPdo();\n $sql = 'SELECT email FROM `user` WHERE id=:iduser LIMIT 1';\n $stmt = $pdo2->prepare($sql);\n $stmt->bindValue(':iduser', Session::get('iduser_perusahaan'));\n $stmt->execute();\n if ($stmt->rowCount() == 0) {\n $bolehhapus = false;\n } else {\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $email = $row['email'];\n\n $sql = 'SELECT IFNULL(GROUP_CONCAT(idatributnilai SEPARATOR \",\"),\"\") as batasan FROM batasanemail be, batasanatribut ba WHERE be.idbatasan=ba.idbatasan AND be.email=:email';\n $stmt = $pdo->prepare($sql);\n $stmt->bindValue(':email', $email);\n $stmt->execute();\n $batasan = '';\n if ($stmt->rowCount() > 0) {\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $batasan = $row['batasan'];\n }\n\n if ($batasan != '') {\n $sql = 'SELECT DISTINCT(p.id) FROM pegawai p, pegawaiatribut pa WHERE p.id=pa.idpegawai AND pa.idatributnilai IN (' . $batasan . ') AND p.id = :idpegawai AND p.del = \"t\"';\n $stmt = $pdo->prepare($sql);\n $stmt->bindValue(':idpegawai', $idpegawai);\n $stmt->execute();\n if ($stmt->rowCount() > 0) {\n $bolehhapus = true;\n }\n }\n }\n\n if ($jenis == 'facesample') {\n // select facesample\n $sql = 'SELECT id, filename, checksum FROM facesample WHERE idpegawai=:idpegawai';\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam('idpegawai', $idpegawai);\n $stmt->execute();\n $data = $stmt->fetchAll(PDO::FETCH_OBJ);\n\n }else{\n //fingerprint\n $sql = 'SELECT id, algoritma, finger_id, `size`, valid, template, checksum, IFNULL(deleted,\"\") as deleted FROM fingersample WHERE idpegawai=:idpegawai';\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam('idpegawai', $idpegawai);\n $stmt->execute();\n $data = $stmt->fetchAll(PDO::FETCH_OBJ);\n }\n Utils::insertLogUser('akses menu pegawai facesample');\n $namapegawai = Utils::getNamaPegawai($idpegawai);\n return view('datainduk/pegawai/pegawai/sample', ['menu' => 'pegawai', 'jenis' => $jenis, 'idpegawai' => $idpegawai, 'bolehhapus' => $bolehhapus, 'namapegawai' => $namapegawai, 'data' => $data]);\n }\n }", "public function data_pelanggan()\n {\n $this->load->model(['data_pelanggan_m','modem_m','ct_m','meter_m','pembatas_arus_m','sim_card_m']);\n $action = $this->uri->segment(3);\n if(isset($action) && $action=='delete') {\n $id = $this->uri->segment(4);\n $this->data_pelanggan_m->delete($id); \n $this->flashmsg('Sukses Delete Data.');\n redirect('admin/data_pelanggan','refresh');\n exit();\n }\n $this->data['pelanggan'] = $this->data_pelanggan_m->get();\n $this->data['title'] = 'Dashboard Admin';\n $this->data['content'] = 'admin/data_pelanggan';\n $this->template($this->data);\n }", "public function run()\n {\n $asignaturas = App\\Modules\\Asignatura::all();\n foreach ($asignaturas as $asignatura) {\n \t$cantidad = rand(0,3);\n \tfactory(Prerequisito::class, $cantidad)->create(['id_asignatura' => $asignatura->id]);\n }\n }", "public function run()\n {\n $data = [\n ['id'=>'1','perusahaan'=>'GAWI BAHANDEP SAWIT MEKAR, PT','waktu_tempuh'=>'22'],\n ['id'=>'2','perusahaan'=>'RIMBA HARAPAN SAKTI, PT','waktu_tempuh'=>'20'],\n ['id'=>'3','perusahaan'=>'SARANA TITIAN PERMATA, PT','waktu_tempuh'=>'4.25'],\n ['id'=>'4','perusahaan'=>'KERRY SAWIT INDONESIA, PT','waktu_tempuh'=>'3'],\n ['id'=>'5','perusahaan'=>'MEGA IKA KHANSA, PT','waktu_tempuh'=>'12'],\n ['id'=>'6','perusahaan'=>'SALONOK LADANG MAS, PT','waktu_tempuh'=>'28'],\n ['id'=>'7','perusahaan'=>'AGRO INDOMAS, PT','waktu_tempuh'=>'13'],\n ['id'=>'8','perusahaan'=>'SAWITMAS NUGRAHA PERDANA, PT','waktu_tempuh'=>'13'],\n ['id'=>'9','perusahaan'=>'HAMPARAN MASSAWIT BANGUN PERSADA, PT','waktu_tempuh'=>'13'],\n ['id'=>'10','perusahaan'=>'RIM CAPITAL, PT','waktu_tempuh'=>'3'],\n ['id'=>'11','perusahaan'=>'TAPIAN NADENGGAN, PT','waktu_tempuh'=>'15'],\n ['id'=>'12','perusahaan'=>'SUMUR PANDAN WANGI, PT','waktu_tempuh'=>'13'],\n ['id'=>'13','perusahaan'=>'WANA SAWIT SUBUR LESTARI II (EKS. KHARISMA UNGGUL CENTRALTAMA CEMERLANG), PT','waktu_tempuh'=>'13'],\n ['id'=>'14','perusahaan'=>'BUANA ARTHA SEJAHTERA, PT','waktu_tempuh'=>'13'],\n ['id'=>'15','perusahaan'=>'TAPIAN NADENGGAN (EX. MITRATAMA ABADI MAKMUR), PT','waktu_tempuh'=>'13'],\n ['id'=>'16','perusahaan'=>'BINA SAWIT ABADI PRATAMA, PT','waktu_tempuh'=>'13'],\n ['id'=>'17','perusahaan'=>'MUSIRAWAS CITRA HARPINDO, PT','waktu_tempuh'=>'7'],\n ['id'=>'18','perusahaan'=>'MENTHOBI SAWIT JAYA, PT','waktu_tempuh'=>'8'],\n ['id'=>'19','perusahaan'=>'CIPTATANI KUMAI SEJAHTERA, PT','waktu_tempuh'=>'16.5'],\n ['id'=>'20','perusahaan'=>'KRIDATAMA LANCAR, PT','waktu_tempuh'=>'16.5'],\n ['id'=>'21','perusahaan'=>'BANGUN JAYA ALAM PERMAI (EKS. MITRA UNGGUL TAMA PERKASA), PT','waktu_tempuh'=>'18'],\n ['id'=>'22','perusahaan'=>'TEGUH SEMPURNA, PT','waktu_tempuh'=>'13.5'],\n ['id'=>'23','perusahaan'=>'TELAGA SARI PERSADA, PT','waktu_tempuh'=>'14.75'],\n ['id'=>'24','perusahaan'=>'ADITUNGGAL MAHAJAYA, PT','waktu_tempuh'=>'13'],\n ['id'=>'25','perusahaan'=>'MITRA KARYA AGROINDO, PT','waktu_tempuh'=>'13'],\n ['id'=>'26','perusahaan'=>'SUMBER INDAHPERKASA, PT','waktu_tempuh'=>'13']\n ];\n\n foreach ($data as $dt)\n {\n (new \\App\\Perusahaan())->create($dt);\n }\n }", "public function run()\n {\n $data=[];\n for($i=0;$i<100;$i++){\n \t$temp['typeid']=rand(1,11);\n \t$temp['goods']=str_random(10);\n \t$temp['price']=rand(1,10000);\n \t$temp['picname']='/upload/14869794804653.jpg';\n \t$temp['descr']='<p><img src=\"/upload/baidu/1486979474670564.jpg\" title=\"1486979474670564.jpg\"/></p><p><img src=\"/upload/baidu/1486922430402045.jpg\" title=\"1486922430402045.jpg\"/></p>';\n \t$temp['num']=rand(1,1000);\n \t$temp['created_at']=date('Y-m-d H:i:s');\n \t$temp['updated_at']=date('Y-m-d H:i:s');\n $temp['szie']=rand(0,2);\n \t$temp['state']=1;\n $data[]=$temp;\n }\n \\DB::table('goods')->insert($data);\n }", "public function tampilPulsaReguler(){\n $pulsaReguler = Price::where('detail_produk','Pulsa Reguler');\n $price = $pulsaReguler->paginate(15);\n $all = \"separoh\";\n $arr = array('price' => $price, 'all' => $all);\n return view('pelanggan/pages/halaman_produk')->with('arr',$arr);\n }", "public function run()\n {\n \tfor($i=0;$i<5;$i++){\n \t\t$data = new Proyek;\n \t\t$data->entity_id = ($i+1);\n \t\t$data->kode = \"Kode \".($i+1);\n\n \t\t$data->nama = \"Proyek \".($i+1);\n \t\t$data->lokasi = \"Lokasi \".($i+1);\n\n \t\t$data->owner = \"Owner \".($i+1);\n \t\t$data->anggaran = ($i+1);\n\n \t\t$data->tgl_mulai = date('Y-m-d');\n \t\t$data->tgl_selesai = date('Y-m-d');\n\n\n \t\t// $data->id_card = rand(0,15000);\n \t\t// $data->hp_no = rand(0,15000);\n \t\t// $data->keterangan = \"OK Generated\";\n \t\t$data->createdby_id = 1;\n $data->save();\n \t}\n }", "public function run()\n {\n \n for ($i=0; $i < 10; $i++) { \n $faker = Faker\\Factory::create();\n Penjualan::create([\n 'date' => Carbon::now()->format('Y-m-d'),\n 'nama_pembeli' => $faker->name,\n 'alamat_pembeli' => $faker->address,\n 'phone' => '089898765412',\n\n ]);\n }\n \n }", "public function index()\n {\n $user_id = (isset(Auth::user()->id))? Auth::user()->id : null;\n $responden = IdentitasResponden::where('user_id',$user_id)->get()->first(); \n $parameter = array();\n $responden_id = ($responden->id ?? false)? $responden->id : null;\n $get_parameter = Parameter::where('bagian','VI')->get();\n $Teknologi = Teknologi::where('identitas_responden_id',$responden_id)->get();\n \n $skor = ParameterSkor::where('type','sentence')->get();\n $data = [\n 'responden' => $responden,\n 'parameter' => $parameter,\n 'skor' => $skor,\n 'hasil_evaluasi'=> $this->teknologi($responden_id)\n ];\n return view('teknologi.index')->with($data);\n }", "public function run()\n {\n for($i=0; $i < 10; $i++){\n\n \t\t$data[$i] = [\n \t\t\t'id_kader' => rand(1, 10),\n \t\t\t'dirosa' => rand(1, 5),\n \t\t\t'majelis_taklim' => rand(1,5)\n \t\t];\n\n \t}\n\n \tDB::table('jumlah_pengajian')->truncate();\n \tDB::table('jumlah_pengajian')->insert($data);\n }", "public function run()\n {\n $faker = Faker::create();\n $pregrado = Pregrado::all();\n $semestre = array('semestre_1', 'semestre_2', 'semestre_3','semestre_4','otro'); \n $samples_temp = [];\n\n foreach ($pregrado as $item)\n {\n\n\n $desde = $faker->dateTimeBetween($startDate = '-1 years', $endDate = 'now');\n $semestre_temp = $semestre[$faker->numberBetween($min = 0, $max = count($semestre)-1)];\n if($semestre_temp === 'otro'){\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'anio'=> $faker->numberBetween($min = 1990, $max = 2016) ,\n 'semestre'=> $semestre_temp,\n 'desde'=>$desde ,\n 'hasta'=>$faker->dateTimeBetween($startDate = $desde, $endDate = 'now'),\n 'financiamiento'=> $faker->numberBetween($min = 1, $max = 3),\n 'carrera'=> $faker->numberBetween($min = 1, $max = 500)\n ];\n }\n else{\n\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'anio'=> $faker->numberBetween($min = 1990, $max = 2016) ,\n 'semestre'=> $semestre_temp,\n 'desde'=>'' ,\n 'hasta'=>'',\n 'financiamiento'=> $faker->numberBetween($min = 1, $max = 3),\n 'carrera'=> $faker->numberBetween($min = 1, $max = 500)\n ];\n }\n \n\n \n }\n PrePostulacionUniversidad::insert($samples_temp);\n\n \n }", "function pertek(){\n\t\t$id_pegawai = $this->session->userdata('pegawai_info');\n\t\t$pegawai = $this->m_profil->ini_pegawai_master($id_pegawai);\n\t\t$boleh = $this->session->userdata('boleh');\n\t\t$data['data'] = $this->m_profil->get_pertek($id_pegawai);\n\t\t\n\t\tif(!empty($data['data'])){\n\t\t\t$dok_ref = $this->m_edok->cek_dokumen($pegawai->nip_baru,\"pertek\",$data['data']->id_pertek);\n\t\t\t@$data['thumb'] = (empty($dok_ref))?\"assets/file/foto/photo.jpg\":\"assets/media/file/\".$pegawai->nip_baru.\"/pertek/thumb_\".$dok_ref[0]->file_dokumen;\n\t\t} else {\n\t\t\t$data['thumb'] = \"assets/file/foto/photo.jpg\";\n\t\t}\n\n\t\t$sess = $this->session->userdata('logged_in');\n\t\t$data['editable'] = (($sess['group_name']==\"admin\" || $sess['group_name']==\"pengelola\") && $boleh==\"ya\")?\"yes\":\"no\";\n\t\t$this->load->view('profile/pertek',$data);\n\t}", "public function petugas()\n {\n $respon = $this->curl->simple_get($this->API . '/petugas');\n $petugas = json_decode($respon, true);\n $data['petugas'] = $petugas['values'];\n $data['title'] = 'Admin Perpustakaan | Halaman Petugas';\n\n $this->load->view('admin/include/head', $data);\n $this->load->view('admin/include/header');\n $this->load->view('admin/include/sidebar');\n $this->load->view('admin/petugas', $data);\n $this->load->view('admin/include/script');\n $this->load->view('admin/include/footer');\n }", "public function data_pangkat()\n\t{\n\t\t$data = array(\n\t\t\t'data_pangkat' => $this->master_pangkat_model->select_master_pangkat(), \n\t\t);\n\n\t\t$this->load->view('data_pangkat_content', $data, FALSE);\n\t}", "public function definition()\n {\n return [\n // 'id_pesanan' => Pesanan::all()->random()->id,\n 'biaya_jahit' => $this->faker->randomFloat(null, 20000, 1000000),\n 'biaya_material' => $this->faker->randomFloat(null, 20000, 1000000),\n 'biaya_kirim' => $this->faker->randomFloat(null, 0, 50000),\n 'biaya_jemput' => $this->faker->randomFloat(null, 0, 50000),\n 'status_pembayaran' => $this->faker->randomElement(['2', '3', '4']),\n 'metode_pembayaran' => $this->faker->randomElement(['BANK', 'COD'])\n ];\n }", "public function run()\n {\n $faker = Faker\\Factory::create('vi_VN'); //locate 150\n $list = [];\n \n $listCategories = DB::table('categories')->pluck('id');\n $listSuppliers = DB::table('suppliers')->pluck('id');\n \n for ($i=1; $i <= 100; $i++) {\n array_push($list, \n [\n 'id' => $i,\n 'product_code' => $faker->numerify('product_#######'),\n 'product_name' => $faker->text(10),\n 'image' => $faker->imageUrl(300, 300),\n 'description' => $faker->text(200),\n 'standard_cost' => $faker->randomFloat(50000 , 50000, 10000000),\n 'list_price' => $faker->randomFloat(50000 , 50000, 10000000),\n 'quantity_per_unit' => $faker->numberBetween(1,100),\n 'discountinued' => $faker->numberBetween(0,1),\n 'discount' => $faker->numberBetween(0,100),\n\n //Khóa ngoại\n 'category_id' => $faker-> randomElement($listCategories),\n 'supplier_id' => $faker-> randomElement($listSuppliers),\n \n ]);\n }\n DB::table('products')->insert($list);\n }", "public function run()\n {\n $faker = new Faker;\n $products = Product::all();\n foreach (range(0, 10) as $number) {\n foreach ($products as $product) {\n OrderDetail::create([\n 'order_id' => rand(1, count(Order::all())),\n 'product_id' => $product->id,\n 'quantity' => $quantity = rand(1, 200),\n 'price' => $price = $product->price,\n 'total' => $quantity * $price\n\n\n\n ]);\n }\n }\n }", "public function index()\n\t{\n\t\t// $simpleProducts = Products::where('product_type',1)->where('delete_status',0)->where('did_you_know','!=','')->orderByRaw('RAND()')->take(5)->get();\n\t\t$simpleProducts = Products::join('product_region as t2', 't2.fkproduct_id', '=', 'products.id')\n ->select('products.id','products.did_you_know','products.product_slug','products.name')->where('products.product_type','=',1)->where('products.delete_status','=',0)->where('did_you_know','!=','')\n ->where('products.website_visible',1)\n ->where('products.stock_status',1)->where('t2.enable',1)->orderByRaw('RAND()')->take(5)->get();\n\t\t\t\t\t \n\t $diagnosisDetail = Diagnosis::select('diagnosis.id','diagnosis.did_you_know','diagnosis.diagnosis_slug','diagnosis.name')->where('delete_status',0)->where('did_you_know','!=','')->orderByRaw('RAND()')->take(5)->get();\n\t\t\n\t\t$testimonials = Testimonials::where('type','!=',2)->where('delete_status',0)->where('homepage_view',1)->orderByRaw('RAND()')->take(10)->get();\n\t\t$orderDetails=OrderDetails::select('id')->where('delete_status',0)->whereNotIn('order_status',['7','8'])->orWhereNull('order_status')->where('delete_status',0)->get();\n\t\t$happy_customers=16023;\n\t\t$count=count($orderDetails);\n\t\tif($count>0){\n\t\t\t$happy_customers=$happy_customers+$count;\n\t\t}\n\t\t\n\t\t$diagnosis = Diagnosis::select('id','name','diagnosis_slug')->where('delete_status',0)->get();\n\t\t\n\t\t$pageTitle = \"Grocare - Self Diagnosis & Personal Healthcare - Ayurvedic Treatment\";\n\n\t\t$meta_description = \"Grocare is successful in arriving with result oriented solutions to overcome distress to lead a healthier life.It is very keen in rendering cure and relief with its cost effective medicines.\";\n\t\t\n\t\t$seoDetails = Seo::where('page',0)->first();\n\t\t\n\t\tif(isset($seoDetails->id)) {\n\t\t\tif(!empty($seoDetails->seo_title)) {\n\t\t\t\t$pageTitle = $seoDetails->seo_title;\n\t\t\t}\n\t\t\tif(!empty($seoDetails->meta_description)) {\n\t\t\t\t$meta_description = $seoDetails->meta_description;\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t\t\n\t\treturn view('front/index')->with(array('pageTitle'=>$pageTitle,'meta_description'=>$meta_description,'testimonials'=>$testimonials,'diagnosis'=>$diagnosis,'simpleProducts'=>$simpleProducts,'happy_customers'=>$happy_customers,'diagnosisDetail'=>$diagnosisDetail));\n\t}", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n $modelName = array(\n 'DR3131KS',\n 'DR9129AM',\n 'DR0121AC',\n 'DR1023BB',\n 'DR9819MN',\n 'DR1209DM'\n );\n $products = [\n 'Tersedia',\n ];\n\n $jumlahl = [\n '1',\n '2',\n '3'\n ];\n\n $plat = [\n 'DR3131KS',\n 'DR9129AM',\n 'DR0121AC',\n 'DR1023BB',\n 'DR9819MN',\n 'DR1209DM'\n ];\n\n $jenis = [\n 'Mobil',\n 'Motor',\n 'Truk',\n 'Eskavator',\n 'Stomp',\n ];\n\n $tanggal = [\n '04/11/2018',\n '15/02/2019',\n '23/03/2018',\n '31/04/2018',\n '29/05/2018',\n ];\n\n $jenisbb = [\n 'Premium',\n 'Solar',\n 'Pertalite',\n 'Gas',\n 'Pertamax',\n ];\n\n $tipeservice = [\n 'Ganti Oli',\n 'Kaburator',\n 'Ganti Ban',\n 'Radiator',\n 'kaca',\n ];\n\n $sukucadang = [\n 'Oli',\n 'Kaburator',\n 'Ban',\n 'Radiator',\n 'Rem',\n ];\n \n\n // Create 50 product records\n for ($i = 0; $i < 50; $i++) {\n Siswa::create([\n 'nama' => $faker->name,\n 'alamat' => $faker->address\n ]);\n\n Pemeliharaan::create([\n 'plat' => $plat[rand(0, count($plat) - 1)],\n 'jenis' => $jenis[rand(0, count($jenis) - 1)],\n 'odometer' => $faker->areaCode,\n 'keterangan' => $faker->address,\n 'jenis_bb' => $jenisbb[rand(0, count($jenisbb) - 1)],\n 'harga_bb' => $faker->areaCode,\n 'jumlah_bb' => $jumlahl[rand(0, count($jumlahl) - 1)],\n 'tipe_service' => $tipeservice[rand(0, count($tipeservice) - 1)],\n 'harga_service' => $faker->areaCode,\n 'tgl_mulai' => $tanggal[rand(0, count($tanggal) - 1)],\n 'tgl_selesai' => $tanggal[rand(0, count($tanggal) - 1)],\n 'suku_cadang' => $sukucadang[rand(0, count($sukucadang) - 1)],\n 'harga_suku' => $faker->areaCode,\n ]);\n\n \n Peminjaman::create([\n 'nama' => $faker->name,\n 'instansi' => $faker->name,\n 'alamat' => $faker->address,\n 'perihal' => $faker->address,\n 'tgl_mulai' => $tanggal[rand(0, count($tanggal) - 1)],\n 'tgl_kembali' => $tanggal[rand(0, count($tanggal) - 1)],\n 'jenis' => $jenis[rand(0, count($jenis) - 1)],\n 'plat' => $plat[rand(0, count($plat) - 1)],\n 'harga' => $faker->areaCode,\n 'status' => $products[rand(0, count($products) - 1)],\n ]);\n\n Kendaraan::create([\n 'plat' => $plat[rand(0, count($plat) - 1)],\n 'jenis' => $jenis[rand(0, count($jenis) - 1)],\n 'status' => $products[rand(0, count($products) - 1)]\n ]);\n\n Peminjam::create([\n 'nama' => $faker->name,\n 'instansi' => $faker->name,\n 'alamat' => $faker->address\n ]);\n }\n }", "public function index()\n {\n $user_id = (isset(Auth::user()->id))? Auth::user()->id : null;\n $responden = IdentitasResponden::where('user_id',$user_id)->get()->first(); \n $responden_id = ($responden->id ?? false)? $responden->id : null;\n $parameter = array();\n $get_parameter = Parameter::where('bagian','IV')->get();\n $KerangkaKerja = KerangkaKerja::where('identitas_responden_id',$responden_id)->get();\n \n $skor = ParameterSkor::where('type','sentence')->get();\n $data = [\n 'responden' => $responden,\n 'parameter' => $parameter,\n 'hasil_evaluasi'=> $this->kerangkaKerja($responden_id),\n 'skor' => $skor\n ];\n return view('kerangka-kerja.index')->with($data);\n }", "public function run()\n {\n $faker = Faker::create();\n $preUach = PreUach::all();\n $samples_temp = [];\n\n foreach ($preUach as $item)\n {\n\n\n $samples_temp[] = [\n 'postulante' => $item->postulante,\n 'persona_matricula'=> $faker->lastName.' '. $faker->firstName,\n 'fecha_matricula'=>$faker->dateTimeBetween($startDate = '-5 months', $endDate = 'now')\n ]; \t\n }\n\n Declaracion::insert($samples_temp);\n \n }", "public function produk(){\n\n $hasil = $this->admin_model->ambilDataProduk();\n $data['hasil'] = $hasil;\n\n $this->load->view('admin/header');\n $this->load->view('admin/produk', $data);\n $this->load->view('front/footer');\n\n }", "public function generate()\n\t{\n\t\t$this->rfmModel->emptyTable();\n\n\t\t// ambil data pelanggan\n\t\t$dataModel = new DataModel();\n\t\t$dataPelanggan = $dataModel->getData()->getResultArray();\n\n\t\tforeach ($dataPelanggan as $pelanggan) {\n\t\t\t// hitung recency\n\t\t\t$tgl_daftar = strtotime($pelanggan['tgl_daftar']);\n\t\t\t$tgl_aktif = strtotime($pelanggan['tgl_aktif']);\n\t\t\t$selisih = $tgl_aktif - $tgl_daftar;\n\t\t\t$recency = $selisih / (24 * 60 * 60);\n\n\t\t\t// hitung frequency\n\t\t\t$frequency = $pelanggan['jumlah_paket'] == $pelanggan['jumlah_terpasang'] ? 1 : 0;\n\n\t\t\t// hitung monetary\n\t\t\t$monetary = $pelanggan['jumlah_terpasang'];\n\n\t\t\t$this->rfmModel->save([\n\t\t\t\t'r' => $recency,\n\t\t\t\t'f' => $frequency,\n\t\t\t\t'm' => $monetary,\n\t\t\t\t'pelanggan_id' => $pelanggan['id'],\n\t\t\t]);\n\t\t}\n\n\t\t$this->session->setFlashdata('sukses', 'Generate Selesai');\n\t\treturn \\json_encode([\n\t\t\t'success' => true,\n\t\t\t'redirect' => '/rfm'\n\t\t]);\n\t}", "public function index()\n {\n //生成不重复的随机值\n function NoRand($begin=1,$end=0,$limit=6){\n //统计数据表中有多少数据\n $sql_num = DB::table('music')->count();\n //将音乐库中的音乐数量塞入随机取 $limit 首\n $end = $sql_num;\n $rand_array=range($begin,$end);\n shuffle($rand_array);//调用现成的数组随机排列函数\n return array_slice($rand_array,0,$limit);//截取前$limit个\n }\n //NoRand即为随机推荐播放音乐的ID\n $NoRand = NoRand();\n foreach($NoRand as $v){\n //获取随机出的Norand序列的歌曲信息\n $data[] = Music::find($v)->getAttributes();\n }\n //dump($data);\n return view('Home/index',['data'=>$data]);\n }", "public static function random(){\n $conexion = StorianDB::connectDB();\n $query = $conexion->query(\"SELECT * FROM cuento ORDER BY RAND() LIMIT 1\");\n return $tabla = $query->fetchObject();\n }", "public function run()\n {\n $a=array();\n $os=App\\SocialWork::all();\n $p=App\\Person::all();\n\n foreach ($os as $o) {\n $a[]=$o->id;\n }\n foreach($p as $pe){\n \n if($pe->tipo=='medico'){\n $random_keys=array_rand($a,3);\n foreach ($random_keys as $i) {\n DB::table('person_social_works')->insert([\n 'person_id'=>$pe->id,\n 'social_work_id'=>$a[$i],\n ]); \n }\n }else{\n $random_keys=array_rand($a,1);\n \n DB::table('person_social_works')->insert([\n 'person_id'=>$pe->id,\n 'social_work_id'=>$a[$random_keys],\n ]); \n \n }\n \n \n \n \n }\n \n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n $limit = 80;\n $sections = [4,5,6];\n $insection = [1,2,3,4];\n $cat = [17,18,19,20,21,22,23,24,25,26,27];\n $color = [11,28,29,30,31];\n $size = [12,13,14,15,16];\n\n for ($i = 0; $i < $limit; $i++) {\n DB::table('product')->insert([ //,\n 'name_ru' => $faker->sentence(4),\n 'name_ua' => $faker->sentence(4),\n 'section' => $sections[$faker->numberBetween(0,count($sections)-1)],\n 'insection' => $this->randformArray(0, $insection),\n 'cat' => $cat[$faker->numberBetween(0,count($cat)-1)],\n 'price' => $faker->numberBetween(0,2200),\n 'bprice' => $faker->numberBetween(0,3200),\n 'color' => $this->randformArray(1, $color),\n 'size' => $this->randformArray(1, $size),\n 'gallery' => '[\"PerxDOzPpXmeJdldDQ.jpg\", \"CwkXutz7mSjNCgKwuD.jpg\", \"hMoAUrYRLBdqPfcljc.jpg\", \"cvMs5yeLZ1geXVxCwL.jpg\"]',\n 'data' => '[{\"num\": \"1\", \"name_ru\": \"1\", \"name_ua\": \"2\", \"value_ru\": \"3\", \"value_ua\": \"4\"}]',\n 'vendor' => $faker->secondaryAddress(),\n 'keywords' => $faker->words(20, true),\n 'description' => $faker->sentence(18),\n 'created_at' => $faker->time(\"U\"),\n 'updated_at' => $faker->time(\"U\")\n ]);\n }\n\n }", "public function queSucede()\n {\n\n\n\n $imgs = DB::SELECT('SELECT a.`id_actividad` AS id ,a.`nombre`, f.`foto`,SUBSTR(a.descripcion,1,100) as detalle, RAND() r\n FROM foto_actividades AS f\n INNER JOIN actividades AS a ON a.`id_actividad` = f.`id_actividad`\n WHERE f.tipo_foto = 2\n AND a.secciones = 2\n ORDER BY r DESC');\n\n return view('pagina.queSucede.queSucede', compact('imgs', 'imgp'));\n }", "public function run()\n {\n $product = new \\App\\Product();\n $product->name = 'ltp-1392l-9avdf';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 1;\n $product->image = '14917548621692873064dong-ho-casio-ltp-1392l-9avdf.jpg';\n $product->cost = 1000000;\n $product->save();\n $product = new \\App\\Product();\n $product->name = 'stuhrling-original';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 1;\n $product->image = '1491763867stuhrling-original-tourbillon.png';\n $product->cost = 2300000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'casio-ltp-1392l';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 4;\n $product->image = '1492021047casio-ltp.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'casio-ltp';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 0;\n $product->category_id = 1;\n $product->branch_id = 4;\n $product->image = '1491748133efr-539sg-1avudf.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'efr-539sg-1avudf';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 1;\n $product->image = '1491748133efr-539sg-1avudf.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'citizen-ny4051-51e';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 2;\n $product->branch_id = 1;\n $product->image = '1491763434citizen-ny4051-51e.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'aries-gold-l9003-s-wmop';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 2;\n $product->branch_id = 1;\n $product->image = '1491764326683084387dong-ho-aries-gold-l9003-s-wmop.png';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'casio-efr-106d-1avudf';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 2;\n $product->branch_id = 4;\n $product->image = '1491747976casio-efr-106d-1avudf.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'Bruno';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 2;\n $product->branch_id = 4;\n $product->image = '1492020334bruno.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'diamon';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 2;\n $product->branch_id = 4;\n $product->image = '1492020025diamon.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'diamon-d5';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 4;\n $product->image = '1492020822diamon-d5.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'diamond-dm';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 4;\n $product->image = '1492020568diamond-dm.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'citizen-bm6772-05aew';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 4;\n $product->image = '1491757567dong-ho-doi-citizen-bm6772-05aew1582-03a.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'atlantic';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 1;\n $product->branch_id = 4;\n $product->image = '1491841939atlantic.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'mtp-1302d';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 3;\n $product->branch_id = 2;\n $product->image = '1491882623mtp-1302d.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'citizen-bh1652';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 0;\n $product->hot = 1;\n $product->category_id = 3;\n $product->branch_id = 6;\n $product->image = '1492021555citizen-bh1652.jpg';\n $product->cost = 5500000;\n $product->save();;\n\n $product = new \\App\\Product();\n $product->name = 'citizenar0074';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 3;\n $product->branch_id = 6;\n $product->image = '1492022032citizenar0074.jpg';\n $product->cost = 5500000;\n $product->save();\n\n $product = new \\App\\Product();\n $product->name = 'epos-344';\n $product->quantity = random_int(1, 50);\n $product->status = 'còn hàng';\n $product->descriptionSummary = str_random(100);\n $product->description = str_random(500);\n $product->betterSale = 1;\n $product->hot = 1;\n $product->category_id = 3;\n $product->branch_id = 6;\n $product->image = '1492022226epos-344.jpg';\n $product->cost = 5500000;\n $product->save();\n\n }", "public function run()\n {\n $faker = Faker::create();\n $prods = Produto::all();\n $cates = Categoria::all()->pluck('id')->toArray();\n\n\n\n foreach($prods as $p){\n $elements = rand(2, 6);\n for($i=0; $i<$elements; $i++ ){\n do{\n $cate_id = $faker->randomElement($cates);\n }\n while(\n ProdutoCategoria::where('categoria_id',$p->id)\n ->where('produto_id',$cate_id)->exists()\n );\n ProdutoCategoria::create([\n 'produto_id' => $p->id,\n 'categoria_id'=> $cate_id,\n\n ]);\n\n }\n }\n }", "public function list_data_sedang_proses_rt()\n\t{\n\t\t$data['warga'] = $this->db->get_where('warga', ['id_warga' =>\n\t\t$this->session->userdata('id_warga')])->row_array();\n\t\t$data['total_notif'] = $this->m_warga->jumlah_notif()->result();\n\n\t\t$data_permohonan['data_sedang_proses'] = $this->m_warga->get_data_sedang_proses_rt()->result();\n\n\t\t$this->load->view('header');\n\t\t$this->load->view('warga/sidebar_warga', $data);\n\t\t$this->load->view('topbar', $data);\n\t\t$this->load->view('warga/list_data_permohonan_sedang_proses_rt', $data_permohonan);\n\t\t$this->load->view('footer');\n\t}", "public function index(){\n $conditions['returnType'] = '';\n \n // Load the list page view\n $data['title'] = 'Tugas Kuliah';\n $data['tugas_kuliah'] = $this->query_helper->getMateri($this->session->userdata('NIM'));\n // echo\"<pre>\";\n // print_r($data);\n // die;\n $data['colors'] = $this->query_helper->config_color();\n $this->load->view('templates/head', $data);\n $this->load->view('Tugas/index_tugas',$data);\n\n\n }", "public function data()\n {\n return [\n 'name' => $this->faker->text,\n 'cast' => $this->faker->text,\n 'genere' => $this->faker->text,\n 'description' => $this->faker->paragraph,\n 'image' => $this->faker->text,\n ];\n }", "public function index(){\r\n\t\t$sesion = $this->session->userdata('idioma');\r\n\r\n\t\t//si no existe la sesion, buscar idioma\r\n\t\tif(isset($sesion) or $sesion = ''){\r\n\t\t\t$idioma = $this->idiomas->existe_idioma_browser('es');\r\n\t\t\t$this->session->set_userdata(array('idioma' => $idioma));\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$idioma = $sesion;\r\n\t\t}\r\n\r\n\t\t//llamar al modelo\r\n\t\t$this->load->model('principalmodel','modelo');\r\n\r\n\r\n\t\t//obtener y asignar los datos\r\n\t\t$contenido = $this->modelo->contenido_index($idioma,array('encabezado', 'quienes_somos', 'pagina_productos'));\r\n\t\t$datos['url'] = base_url();\r\n\t\t$datos['titulo'] = 'Pagina principal';\r\n\t\t$datos['menu'] = $contenido['encabezado'][0];\r\n\t\t$datos['submenu'] = $this->idiomas->idiomas_instalados();\r\n\t\t$datos['cuerpo'] = $contenido['quienes_somos'][0];\r\n\t\t$datos['txproductos'] = $contenido['pagina_productos'][0];\r\n\t\t\r\n\t\t\r\n\t\t$productos_y_servicios = $this->modelo->proser_rand($idioma);\r\n\t\t$datos['productos'] = $productos_y_servicios['productos'];\r\n\t\t$datos['servicios'] = $productos_y_servicios['servicios'];\r\n\t\t$datos['idioma'] = $idioma;\r\n\r\n\t\t//construir el menu\r\n\t\t$this->load->helper('menu');\r\n\t\t\r\n\r\n\t\t\r\n\t\t//cargar las vistas\r\n\t\t//$this->load->view('pruebas/prueba',$datos);\r\n\t\t\r\n\t\t$this->load->view('templates/header_index', $datos);\r\n\t\t$this->load->view('paginas/quienes_somos', $datos);\r\n\t\t$this->load->view('templates/footer');\r\n\t\t\r\n\r\n\t}", "public function run()\n {\n $sales = Penjualan::all();\n $products = Product::all();\n $faker = Faker\\Factory::create();\n foreach ($sales as $sale) {\n $sale_id = $sale->id;\n foreach ($products as $product) {\n switch ($product->nama_produk) {\n case 'Semen':\n $unit_id = 3;\n break;\n case 'Pasir':\n $unit_id = 1;\n break;\n case 'Besi Cor':\n $unit_id = 2;\n break;\n case 'Galvalum':\n $unit_id = 4;\n break;\n case 'Krikil':\n $unit_id = 1;\n break;\n case 'Cat Tembok':\n $unit_id = 4;\n break;\n default:\n break;\n }\n PenjualanItem::create([\n 'penjualan_id' => $sale_id,\n 'product_id' => $product->id,\n 'quantity' => $faker->randomElement($array = array (10,20,30,40,50)),\n 'unit_id' => $unit_id,\n 'total' => 100000\n ]);\n }\n\n }\n }", "public function getProduct(){\r\n return rand(0,1);\r\n }", "public function run()\n {\n foreach (\\App\\Models\\Pesanan::where('isLunas', true)->get() as $row) {\n $keranjang = \\App\\Models\\Keranjang::whereIn('id', $row->keranjang_ids)->get();\n foreach ($keranjang as $val) {\n $arr = array(\"3.5\", \"4\", \"4.5\", \"5\");\n \\App\\Models\\Ulasan::create([\n 'user_id' => $val->user_id,\n 'produk_id' => $val->getProduk->id,\n 'deskripsi' => \\Faker\\Factory::create()->paragraph,\n 'gambar' => 'placeholder.jpg',\n 'bintang' => $arr[array_rand($arr)]\n ]);\n }\n }\n }", "public static function getRandom()\n\t{\n\t\t$randNumPhp = Lottery::getSecureRand( self::getCount() );\n\t\t//$randNumSql = '( SELECT FLOOR( MAX(`id`) * RAND() ) FROM `category_prize` LIMIT 1 )';\n\n\t\treturn self::find()\n ->select(['id', 'name'])\n\t\t ->andWhere(['>=', 'id', $randNumPhp])\n\t\t ->orderBy('id')\n\t\t ->asArray()\n ->one();\n\t}", "public function DataPesanan()\n\t{\n\t\t$data['DataOrder'] = $this->MSudi->GetDataJoin('tbl_order','tbl_menu','tbl_order.id_menu = tbl_menu.id')->result();\n\t\t$data['content'] = 'VPesanan';\n\t\t$this->load->view('welcome_message', $data);\n\t}", "public function dataKasir(){\r\n $this->load->model('User_model');\r\n $data['pegawai']=$this->User_model->getSuplier('pegawai');\r\n $this->load->view('dashboard/header');\r\n $this->load->view('dashboard/left_menu.php');\r\n $this->load->view('datauser/data_petugaskasir',$data);\r\n $this->load->view('dashboard/_js');\r\n }", "public function run()\n {\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina1.jpg\",\n \"nombre\" => \"Whey Protein\",\n \"descripcion\"=>\"Es un suplemento con amplia evidencia científica y que se encuentra en el grupo A de la clasificación del Instituto Australiano \n del Deporte (AIS), una entidad referente en cuanto a nutrición deportiva.\",\n \"valor\"=>88000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina2.jpg\",\n \"nombre\" => \"Isopure\",\n \"descripcion\"=>\"Isopure proteina cero carbohidratos vainilla - 3 Lb. Suplemento a base de albúmina de huevo en polvo, \n fuente de proteínas de alto valor biológico con el menor contenido de fósforo, potasio y sodio.\",\n \"valor\"=>100000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina3.jpg\",\n \"nombre\" => \"Nitro Tech\",\n \"descripcion\"=>\"Nitrotech 100% Whey Gold de Muscletech es una mezcla de proteína de suero aislada y concentrada de alta calidad y pureza, con péptidos\n de suero lácteo añadidos. Esta proteína tiene una rápida absorción y digestibilidad, ideal para recuperarse después de un entrenamiento.\",\n \"valor\"=>160000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina4.jpg\",\n \"nombre\" => \"Mass Tech\",\n \"descripcion\"=>\"Es un producto de avanzada para ganar masa muscular diseñado para cualquier persona a quien le cueste trabajo aumentar el tamaño, \n que esté en fase de voluminización o deseen adquirir incluso más fuerza.\",\n \"valor\"=>150000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina5.jpg\",\n \"nombre\" => \"Mega Whey\",\n \"descripcion\"=>\"MEGA WHEY PROTEIN es proteína de suero altamente bioasimilable adicionada con: Picolinato de cromo, y un excelente balance de vitaminas; \n de esta manera los deportistas obtienen mejores resultados en comparación con otras fórmulas comunes de proteína de suero.\",\n \"valor\"=>170000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina6.jpg\",\n \"nombre\" => \"Cell Tech\",\n \"descripcion\"=>\"Cell Tech Performance Series de Muscletech es un producto alimenticio en polvo con un 79% de hidratos de carbono de lenta y rápida \n absorción, creatina y aminoácidos esenciales.\",\n \"valor\"=>150000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina7.jpg\",\n \"nombre\" => \"Creatine Power\",\n \"descripcion\"=>\"Por esta compra obtienes la Proteína Megaplex Creatine Power por 10Lb con nueva fórmula que incluye HMB.\n Adicional recibes la bolsa por 2Lb de la versión clásica (hasta agotar existencias).\",\n \"valor\"=>167000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina8.jpg\",\n \"nombre\" => \"Super Mega Gainer\",\n \"descripcion\"=>\"Super mega gainer de GMN es un excelente complemento alimenticio capaz de mejorar en forma notable tu disponibilidad energética \n en el entrenamiento y de aumentar tu masa muscular, peso y fuerza rápidamente\",\n \"valor\"=>50000\n ]);\n Producto::create([\n \"foto\"=>\"Home/ImagenesPro-Gym/proteina9.jpg\",\n \"nombre\" => \"Hydroxycut Elite\",\n \"descripcion\"=>\"Hydroxycut Hardcore Elite es un super termogénico 4 en 1 con una fórmula que ofrece una experiencia sensorial increíble y que aporta cuatro ventajas distintas:\n Super-termogénesis, Energía extrema, Mayor concentración, Pérdida de peso de gran alcance.\",\n \"valor\"=>98000\n ]);\n }", "public function run()\n {\n $faker = Faker\\Factory::create('ja_JP');\n //\n $user = App\\User::all();\n $category = App\\Category::whereNotNull('parent_id')\n ->get();\n //\n for ($i=0; $i < 10; $i++) {\n $u = $user->random();\n $cat = $category->random();\n $data = [\n 'user_id' => $u->id,\n 'category_id' => $cat->id,\n 'note' => $faker->realText(100),\n 'prefecture' => collect(array_flip(config('my.prefectures')))->random(),\n 'city' => $faker->city,\n 'location' => $faker->address,\n 'span_time' => 5,\n 'public' => true,\n 'total_option_price' => 0,\n ];\n App\\Request::create($data);\n }\n }", "public function krs()\n {\n $data['halaman'] = \"Data Perwalian\";\n $data['perwalian'] = $this->mod->m_get_perwalian();\n $this->load->view('head.php', $data);\n $this->load->view('sidebar.php');\n $this->load->view('header.php');\n $this->load->view('dosen/daftar_perwalian.php',$data);\n $this->load->view('footer.php');\n }", "public function index(){\n $sim = $this->Similarity_M->get_data();\n // mendapatkan semua data yang sudah dirating oleh user tersebut \n $user = $this->Similarity_M->get_user($this->session->userdata('idakun'));\n // mendaptkan data akun selain akun yang sedang ingin deiberikan recommend\n $akun = $this->Akun_M->get_data();\n // Mendapatkan data semua barang\n $allbarang = $this->Barang_M->get_data();\n \n //inisialisasi data1 dan data2 \n $data2['hore'] = 0;\n $data1['coba'] = 0;\n $data1['coba2'] = 0;\n \n\n // pengecekan apakah user sudah pernah merating atau belum\n if ($user){\n\n // perulangan sebanyak akun yang di dapat\n foreach ($akun as $ak){\n $data[$ak->idakun] = 0;\n \n \n // perulangan sebanyak barang yang sudah dirating user tersebut\n foreach ($user as $us){\n \n // membentuk array untuk digunakan pada saat pencarian data di database yang berisi idbarang dari user yang ingin dikasih rating dan idakun selain akun tersebut\n $temp = array(\n 'idbarang' => $us->idbarang,\n 'akun' => $ak->idakun\n );\n \n // proses mendapatkan rating dari akunlain yang sudah merating barang tersebut\n $tempp = $this->Similarity_M->get_userr($temp);\n // jika rating didapatkan maka\n if($tempp){\n \n // proses perkalian antara rating yang diberikan user lain dengan rating yang diberikan oleh user tesebut\n $data[$ak->idakun] = $data[$ak->idakun] + $us->rating * $tempp->hasil;\n // proses mendatpakan kuadrat dari inputan rating barang tersebut dari user tersebut\n $data1['coba'] = $data1['coba'] + $us->rating * $us->rating;\n // proses kuadrat dari pemberian rating ke barang tersebut dari user lain\n $data1['coba2'] = $data1['coba2'] + $tempp->hasil * $tempp->hasil;\n \n }\n }\n \n // pengecekan apakah user tersebut memiliki kemiripan dengan user lain\n if ($data[$ak->idakun] != 0){\n // proses mendaptkan similarity\n $data[$ak->idakun] = $data[$ak->idakun] / (sqrt($data1['coba'])*sqrt($data1['coba2']));\n }\n \n \n // proses penambahan semua similarity\n $data2['hore'] = $data2['hore'] + $data[$ak->idakun];\n }\n\n // pengecekan apakah ada similarity terhadap user tersebut\n if ($data2['hore'] != 0){\n // perulangan untuk mendapatkan predict rating untuk barang\n foreach ($allbarang as $allbar){\n \n $temp = array(\n 'idbarang' => $allbar->idbarang,\n 'akun' => $this->session->userdata('idakun')\n );\n \n // pengecekan apakah barang sudah p[ernah dirating atau belum oleh user tersebut\n $tempp = $this->Similarity_M->get_user_not($temp);\n if($tempp){\n \n $data3[$allbar->idbarang] = 0;\n foreach ($akun as $ak){\n $temp = array(\n 'idbarang' => $allbar->idbarang,\n 'akun' => $ak->idakun\n );\n \n // mendapatkan data rating dari similarity akun lain dengan akun tersebut\n $tempp = $this->Similarity_M->get_userr($temp);\n // echo $data[$ak->idakun];\n if(($tempp) && ( !empty($data[$ak->idakun]))){\n \n // penambahan setiap similarity anatar akun dengan rating yang diberikan akun lain ke barang tersebut\n $data3[$allbar->idbarang] = $data3[$allbar->idbarang] + $data[$ak->idakun] * $tempp->hasil;\n \n }\n \n }\n // proses perhitungan predict yang akan diberikan oleh user ke barang tersebut\n $data3[$allbar->idbarang] = $data3[$allbar->idbarang] / $data2['hore'];\n $predict = array(\n 'idbarang' => $allbar->idbarang,\n 'idakun' => $this->session->userdata('idakun'),\n 'predict' => $data3[$allbar->idbarang]\n );\n \n // memasukan data predict rating barang tersebut ke dalam database\n $predictdata = $this->Predict_M->daftar_predict($predict);\n }\n \n }\n }\n \n }\n\n \n $data = array(\n 'barang' => $this->Barang_M->get_data()\n );\n $this->load->view('header');\n $this->load->view('landingpage',$data);\n $this->load->view('footer');\n }", "public function run()\n {\n \tfor($i=1;$i<=10;$i++){\n \t\t$p = new \\App\\Product([\n \t\t\t'category_id' => rand(1,10),\n \t\t\t'code' => str_random(10),\n \t\t\t'name' => 'สินค้า '.$i,\n \t\t\t'price' => rand(100,10000),\n \t\t\t'balance' => rand(1,100),\n \t\t\t'detail' => 'รายละเอียดสินค้า '.$i\n \t\t\t]);\n \t\t$p->save();\n \t}\n }", "public function index()\n {\n // $new = json_encode(Book::orderBy('created_at')->limit(5)->get());\n // $random =json_encode(Book::inRandomOrder()->limit(5)->get());\n\n\n return 'Legújabbak:'.'<br>'.\n json_encode(Book::orderBy('created_at')->limit(5)->get()).'<br>'.\n 'Random:'.\n '<br>'.json_encode(Book::inRandomOrder()->limit(5)->get());\n }", "public function definition()\n {\n $arrayEstado = ['abierta','cerrada'];\n $random = Arr::random($arrayEstado);\n\n $arrayBinario = ['si','no'];\n $random = Arr::random($arrayBinario);\n\n $arrayCategoria = ['comun','especial','plata','oro','platino'];\n $random = Arr::random($arrayCategoria);\n\n return [\n 'ubicacion' => $this->faker->streetAddress(),\n 'fecha' => $this->faker->date($format = 'Y-m-d', $max = 'now'),\n 'horaInicio' => $this->faker->time($format = 'H:i:s', $max = 'now'),\n 'horaFin' => $this->faker->time($format = 'H:i:s', $max = 'now'),\n //'estado' => Arr::random($arrayEstado),\n 'capacidadAsistentes'=> $this->faker->numberBetween($min = 5, $max = 30),\n //'tieneDeposito'=> Arr::random($arrayBinario),\n //'seguridadPropia'=> Arr::random($arrayBinario),\n //'categoria'=> Arr::random($arrayCategoria),\n ];\n }", "function get_data_dosen_test(){\t\n\t\t\t$kd = $this->session->userdata(\"kd_dosen\");\n\t\t\t/*$data = array('ta'=> $ta, 'smt'=>$smt);*/\n\t\t\t/* load main content */\n\t\t\t$api_url \t= URL_API_BKD.'bkd_dosen/get_data_dosen';\n\t\t\t$parameter = array('data_search' => array($kd));\n\t\t\t$data['dosen'] = $this->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\t\techo \"<pre>\";\n\t\t\tprint_r($data['dosen']);\n\t\t\techo \"</pre>\";\n\t\t}", "public function run()\n {\n //tugas\n $produk = [\n ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 4,'HargaProduk'=> 50000,'Kualitas'=>'Baru','Alamat'=>'Kp.Cilisung'], ['KategoriProduk'=>'Fashion', 'NamaProduk'=>'Baju','JenisProduk'=>'Katun','Jumlah'=> 3,'HargaProduk'=> 1.500000,'Kualitas'=>'Baru','Alamat'=>'Cirebon'],\n ['KategoriProduk'=>'Fashion', 'NamaProduk'=>'Celana','JenisProduk'=>'jeans','Jumlah'=> 3,'HargaProduk'=> 150000,'Kualitas'=>'Baru','Alamat'=>'Kp.salak'], ['KategoriProduk'=>'minuman', 'NamaProduk'=>'jus jeruk','JenisProduk'=>'cair','Jumlah'=> 10,'HargaProduk'=> 140000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 2,'HargaProduk'=> 6000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 5,'HargaProduk'=> 7000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 6,'HargaProduk'=> 15000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 1,'HargaProduk'=> 20000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'MakeUp', 'NamaProduk'=>'Lipstik','JenisProduk'=>'Padat','Jumlah'=> 8,'HargaProduk'=> 12000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka'], ['KategoriProduk'=>'Mmakanan', 'NamaProduk'=>'kentang','JenisProduk'=>'Makanan','Jumlah'=> 1,'HargaProduk'=> 5000,'Kualitas'=>'Baru','Alamat'=>'Kp.bojong malaka']\n ];\n // masukkan data ke database\n DB::table('produk')->insert($produk);\n }", "public function Petugas()\n {\n $data['title'] = 'Data Petugas';\n $data['user'] = $this->db->get_where('tbl_petugas', ['username' => $this->session->userdata('username')])->row_array();\n $data['siswa'] = $this->db->get_where('tbl_siswa', ['nisn' => $this->session->userdata('NISN')])->row_array();\n $data['petugas'] = $this->Data->petugas_get();\n $this->load->view('templates/header', $data);\n $this->load->view('templates/navbar', $data);\n $this->load->view('templates/sidebar', $data);\n $this->load->view('master/petugas/index', $data);\n }", "public function PublicSampleDetail(Request $request){\n \n $sampledetail=Sample::where(array('is_deleted'=>0,'is_public'=>1,'id'=>$request->sample_id))->firstOrFail();\n\n $sample_report=SampleReport::where(['sample_id'=>$sampledetail->sample_code,'replicate'=>1])\n ->join('esv', function ($join) {\n $join->on('esv.test_id', '=', 'sample_report.test_id')\n ->on('esv.esv_id', '=', 'sample_report.esv_id');\n })\n ->select('sample_report.*', 'esv.kingdom', 'esv.phylum', 'esv.class', 'esv.order','esv.family', 'esv.genus', 'esv.species', 'esv.common_name', 'esv.perc_match', 'esv.sequence','esv.species_img', 'esv.map_img', 'esv.description')\n ->get();\n $sample_data=array();\n $algaegenus=array();\n $array_lable=array();\n $array_value=array();\n if(count($sample_report)){\n $sample_data = $sample_report->groupBy('test_id');\n if(isset($sample_data['Algae'])){\n $algaegenus=$sample_data['Algae']->groupBy('genus');\n }\n \n }\n foreach($algaegenus as $key => $genusdata ){\n array_push($array_lable, $key);\n array_push($array_value, $genusdata->sum('perc_reads'));\n }\n $pie = Charts::create('pie', 'chartjs')\n ->title(false)\n ->legend('{display:none}')\n ->labels($array_lable)\n ->values($array_value)\n ->dimensions(400,400)\n ->responsive(false);\n return view('user.sample-detail',['sampledetail' =>$sampledetail,'sample_data'=>$sample_data,'algaegenus'=>$algaegenus,'pie'=>$pie]);\n }", "public function run()\n {\n Pasien::factory()->count(20)->create();\n Dokter::factory()->count(5)->create();\n TipeTest::insert([\n [\n 'tipe' => 'IMUNOSEROLOGI',\n 'nilai_normal' => 'NON REAKTIF',\n ], [\n 'tipe' => 'RAPID TEST COVID - 19',\n 'nilai_normal' => 'NON REAKTIF',\n ], [\n 'tipe' => 'igG COVID - 19',\n 'nilai_normal' => 'NON REAKTIF',\n ], [\n 'tipe' => 'igM COVID - 19',\n 'nilai_normal' => 'NON REAKTIF',\n ],\n ]);\n $pemeriksaan = [];\n for ($i = 0; $i < 5; ++$i) {\n $pemeriksaan[] = [\n 'id_pasien' => random_int(5, 10),\n 'id_dokter' => random_int(1, 5),\n 'tgl_pemeriksaan' => now('Asia/Jakarta'),\n 'keterangan' => 'tidak ada keterangan untuk sementara',\n 'no_reg' => 'nomer registrasi '.$i,\n 'pengirim' => 'iyek',\n ];\n }\n Pemeriksaan::insert($pemeriksaan);\n\n for ($i = 1; $i < 6; ++$i) {\n DetailPemeriksaan::insert([\n [\n 'id_pemeriksaan' => $i,\n 'hasil' => 'NON REAKTIF',\n 'tipe_pemeriksaan' => 1,\n ],\n [\n 'id_pemeriksaan' => $i,\n 'hasil' => 'NON REAKTIF',\n 'tipe_pemeriksaan' => 2,\n ],\n [\n 'id_pemeriksaan' => $i,\n 'hasil' => 'NON REAKTIF',\n 'tipe_pemeriksaan' => 3,\n ],\n [\n 'id_pemeriksaan' => $i,\n 'hasil' => 'NON REAKTIF',\n 'tipe_pemeriksaan' => 4,\n ],\n ]);\n }\n }", "public function Logica(){\n $cartas=[\n [1,2,3,4,5,6,7],\n [8,9,10,11,12,13],\n [14,15,16,17,18,19]\n ];\n $indice1 = rand(0,6);\n $indice2 = rand(0,5);\n $indice3 = rand(0,5);\n $cartas_sistem=[$cartas[0][$indice1], $cartas[1][$indice2], $cartas[2][$indice3]];\n\n var_dump( json_encode($cartas_sistem));\n $cartas_asign=[];\n \n while (count($cartas_asign) <= 3) {\n \n $num=rand(1,19);\n if ($num != $cartas_sistem[0] && $num != $cartas_sistem[1] && $num != $cartas_sistem[2]) {\n array_push($cartas_asign, $num);\n }\n \n }\n var_dump( json_encode($cartas_asign));\n $cartas_select=[];\n }", "public function run()\n {\n $data = [\n // product 68\n [\n 'product_name' => 'CARVIN SCx-1112',\n 'product_slug' => 'carvin-scx-1112',\n 'product_price' => '10890000',\n 'product_img' => 'CARVIN SCx-1112.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '1',\n 'product_cate' => '1'\n ], \n // product 67\n [\n 'product_name' => 'SS-SOUND PRO-218S',\n 'product_slug' => 'ss-sound-pro-218s',\n 'product_price' => '17500000',\n 'product_img' => 'SS-SOUND PRO-218S.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => '\n <table>\n <tbody>\n <tr>\n <td><strong>Loại loa</strong></td>\n <td>12-inch 2-way, Bass-reflex, Monitor</td>\n </tr>\n <tr>\n <td><strong>Đ&aacute;p tuyến tần số</strong></td>\n <td>60Hz &ndash; 20kHz (-10dB); 70Hz &ndash; 18kHz (-3dB)</td>\n </tr>\n <tr>\n <td><strong>G&oacute;c phủ &acirc;m thanh (NxD)</strong></td>\n <td>90o x 60o Main; 60o x 90o Monitor</td>\n </tr>\n <tr>\n <td><strong>Bộ chia dải tần</strong></td>\n <td>2-way với mạch bảo vệ loa HF&nbsp;Speaker Guard&trade;</td>\n </tr>\n <tr>\n <td><strong>Tần số Crossover</strong></td>\n <td>1.8 kHz</td>\n </tr>\n <tr>\n <td><strong>C&ocirc;ng suất</strong></td>\n <td>300W / 1200W (Peak)</td>\n </tr>\n <tr>\n <td><strong>Tăng &acirc;m khuy&ecirc;n d&ugrave;ng</strong></td>\n <td>300W &ndash; 900W</td>\n </tr>\n <tr>\n <td><strong>Độ nhạy (1w/1m)</strong></td>\n <td>96dB SPL</td>\n </tr>\n <tr>\n <td><strong>SPL</strong></td>\n <td>120dB Cont. / 126dB cực đại</td>\n </tr>\n <tr>\n <td><strong>Th&agrave;nh phần loa</strong></td>\n <td>12&Prime; woofer (coil 2-in) + 1&Prime; exit Mylar (coil 1.75-in)</td>\n </tr>\n <tr>\n <td><strong>Trở kh&aacute;ng</strong></td>\n <td>8&Omega;</td>\n </tr>\n <tr>\n <td><strong>Tri-amp 8&Omega;</strong></td>\n <td>LF &ndash; 300W / 1200W ; HF &ndash; 60W / 240W</td>\n </tr>\n <tr>\n <td><strong>Vỏ th&ugrave;ng loa</strong></td>\n <td>Gỗ Bạch Dương&nbsp;13-ply cao cấp</td>\n </tr>\n <tr>\n <td><strong>Hệ thống treo/ Lắp đặt</strong></td>\n <td>1-3/8-inch pole mount cup</td>\n </tr>\n <tr>\n <td><strong>Ho&agrave;n thiện</strong></td>\n <td>Lớp phủ c&ocirc;ng nghệ DuraTec&trade; chống trầy xước, chịu được t&aacute;c động thời tiết.</td>\n </tr>\n <tr>\n <td><strong>Mặt lưới</strong></td>\n <td>Th&eacute;p đen phủ bột chịu thời tiết, lớp bọt biển b&ecirc;n trong gi&uacute;p khử tạp &acirc;m.</td>\n </tr>\n <tr>\n <td><strong>Vận chuyển</strong></td>\n <td>1 tay cầm b&ecirc;n</td>\n </tr>\n <tr>\n <td><strong>Ng&otilde; kết nối</strong></td>\n <td>2x NL-4 Neutrik Speakon ;2x 1/4&Prime;</td>\n </tr>\n <tr>\n <td><strong>K&iacute;ch thước (CxRxS)</strong></td>\n <td>420 x 388 x 572 mm</td>\n </tr>\n <tr>\n <td><strong>Trọng lượng</strong></td>\n <td>16,5 Kg</td>\n </tr>\n </tbody>\n </table>\n ',\n 'product_dacbiet' => '1',\n 'product_cate' => '1'\n ], \n // product 66\n [\n 'product_name' => 'SICA CD95.44/N240 POLY',\n 'product_slug' => 'sica-cd9544n240-poly',\n 'product_price' => '4950000',\n 'product_img' => 'SICA CD95.44-N240 POLY.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '2'\n ], \n // product 65\n [\n 'product_name' => 'SICA CD120.44-640',\n 'product_slug' => 'sica-cd12044640',\n 'product_price' => '2420000',\n 'product_img' => 'SICA CD120.44-640.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '2'\n ],\n // product 64\n [\n 'product_name' => 'SICA 12N3PL',\n 'product_slug' => 'sica-12n3pl',\n 'product_price' => '5500000',\n 'product_img' => 'SICA 12N3PL.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '2'\n ],\n // product 63\n [\n 'product_name' => 'SICA 18S4PL',\n 'product_slug' => 'sica-18s4pl',\n 'product_price' => '10500000',\n 'product_img' => 'SICA 18S4PL.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '2'\n ],\n // product 62\n [\n 'product_name' => 'DJ SlimPAR Pro Q USB',\n 'product_slug' => 'dj-padled',\n 'product_price' => '4048560',\n 'product_img' => 'SlimPAR-Pro-Q-USB-RIGHT-800x500.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Tủ đựng Đèn',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '7'\n ],\n // product 61\n [\n 'product_name' => 'KLOTZ LY215',\n 'product_slug' => 'klotz-ly215',\n 'product_price' => '0',\n 'product_img' => 'KLOTZ LY225.jpg',\n 'product_baohanh' => 'không bảo hành',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '8'\n ],\n // product 60\n [\n 'product_name' => 'Tủ đèn Beam',\n 'product_slug' => 'tu-den-beam',\n 'product_price' => '0',\n 'product_img' => 'web-case-light-1-800x500.jpg',\n 'product_baohanh' => '3',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '8'\n ],\n // product 59\n [\n 'product_name' => 'SHURE BLX24A-PG58',\n 'product_slug' => 'shure-blx24a-pg58',\n 'product_price' => '9500000',\n 'product_img' => 'SHURE BLX24A-PG58.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Hộp Đựng MIC',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '4'\n ],\n // product 58\n [\n 'product_name' => 'SENNHEISER XSW2-ME2',\n 'product_slug' => 'sennheiser-xsw2-me2',\n 'product_price' => '12050000',\n 'product_img' => 'SENNHEISER XSW2-ME2.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Hộp Đựng MIC',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '1',\n 'product_cate' => '4'\n ],\n // product 57\n [\n 'product_name' => 'RCF HC2000',\n 'product_slug' => 'rcf-hc2000',\n 'product_price' => '15120000',\n 'product_img' => 'RCF HC2000.jpgg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '6'\n ],\n // product 56\n [\n 'product_name' => 'YAMAHA PX10',\n 'product_slug' => 'yamaha-px10',\n 'product_price' => '21890000',\n 'product_img' => 'YAMAHA PX10.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '1',\n 'product_cate' => '6'\n ],\n // product 55\n [\n 'product_name' => 'CARVIN HD-3000',\n 'product_slug' => 'carvin-hd-3000',\n 'product_price' => '13200000',\n 'product_img' => 'CARVIN HD-3000.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '1',\n 'product_cate' => '6'\n ],\n // product 54\n [\n 'product_name' => 'C-MARK DB-1400',\n 'product_slug' => 'c-mark-db-1400',\n 'product_price' => '12800000',\n 'product_img' => 'C-MARK DB-1400.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '6'\n ],\n // product 53\n [\n 'product_name' => 'C-MARK DB-1400',\n 'product_slug' => 'c-mark-db-1400',\n 'product_price' => '12800000',\n 'product_img' => 'C-MARK DB-1400.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '5'\n ],\n // product 52\n [\n 'product_name' => 'C-MARK A-903',\n 'product_slug' => 'c-mark-a-903',\n 'product_price' => '4300000',\n 'product_img' => 'C-MARK A-903.jpgg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '5'\n ],\n // product 51\n [\n 'product_name' => 'PHONIC PCL3200',\n 'product_slug' => 'phonic-pcl3200',\n 'product_price' => '2300000',\n 'product_img' => 'PHONIC PCL3200.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '5'\n ],\n // product 50\n [\n 'product_name' => 'RCF DX4008',\n 'product_slug' => 'rcf-dx4008',\n 'product_price' => '28440000',\n 'product_img' => 'RCF DX4008.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '1',\n 'product_cate' => '5'\n ],\n // product 49\n [\n 'product_name' => 'CARVIN C-2040',\n 'product_slug' => 'carvin-c-2040',\n 'product_price' => '21400000',\n 'product_img' => 'CARVIN C-2040.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '3'\n ],\n // product 48\n [\n 'product_name' => 'YAMAHA MGP-16X',\n 'product_slug' => 'yamaha-mgp-16x',\n 'product_price' => '24860000',\n 'product_img' => 'YAMAHA MGP-16X.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '2'\n ],\n // product 47\n [\n 'product_name' => 'PHONIC MR2443a',\n 'product_slug' => 'phonic-mr2443a',\n 'product_price' => '9500000',\n 'product_img' => 'PHONIC MR2443a.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Dây tín hiệu',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '1',\n 'product_cate' => '3'\n ],\n // product 46\n [\n 'product_name' => 'YAMAHA MGP-32X',\n 'product_slug' => 'yamaha-mgp-32x',\n 'product_price' => '382800000',\n 'product_img' => 'YAMAHA MGP-32X.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '1',\n 'product_cate' => '3'\n ],\n // product 45\n [\n 'product_name' => 'YAMAHA MGP-32X',\n 'product_slug' => 'yamaha-mgp-32x',\n 'product_price' => '38280000',\n 'product_img' => 'YAMAHA MGP-32X.jpg',\n 'product_baohanh' => '12',\n 'product_phukien' => 'Không',\n 'product_tinhtrang' => 'New 100%',\n 'product_khuyenmai' => 'Không',\n 'product_trangthai' => '1',\n 'product_mieuta' => 'content',\n 'product_dacbiet' => '0',\n 'product_cate' => '3'\n ]\n\n ];\n DB::table('vp_product')->insert($data);\n }", "public function run()\n {\n // 1\n $produk = new Produk();\n $produk->nama_produk = \"Paket Prima\";\n $produk->harga_coret = 4000000;\n $produk->harga_jual = 3800000;\n $produk->stok = 1;\n $produk->deskripsi_produk = \"Satu ekor Hewan Aqiqah + Masak Sate 180 tusuk + gule 30 porsi + Nasi Box 30 porsi Varian isi Nasi Box : Nasi, Cah Buncis Wortel, krupuk Palembang, Buah pisang, sendok, lembar doa, buku risalah\";\n $produk->created_by = \"1\";\n $produk->updated_by = \"1\";\n $produk->save();\n\n // 2\n $produk = new Produk();\n $produk->nama_produk = \"Paket Special\";\n $produk->harga_coret = 4500000;\n $produk->harga_jual = 4200000;\n $produk->stok = 1;\n $produk->deskripsi_produk = \"Satu ekor Hewan Aqiqah + Masak Sate 180 tusuk + gule 30 porsi + Nasi Box 30 porsi Varian isi Nasi Box : Nasi, Cah Buncis Wortel, krupuk Palembang, Buah pisang, sendok, lembar doa, buku risalah\";\n $produk->created_by = \"1\";\n $produk->updated_by = \"1\";\n $produk->save();\n\n // 3\n $produk = new Produk();\n $produk->nama_produk = \"Paket Premium\";\n $produk->harga_coret = 3500000;\n $produk->harga_jual = 3100000;\n $produk->stok = 1;\n $produk->deskripsi_produk = \"Satu ekor Hewan Aqiqah + Masak Sate 180 tusuk + gule 30 porsi + Nasi Box 30 porsi Varian isi Nasi Box : Nasi, Cah Buncis Wortel, krupuk Palembang, Buah pisang, sendok, lembar doa, buku risalah\";\n $produk->created_by = \"1\";\n $produk->updated_by = \"1\";\n $produk->save();\n }", "public function run()\n {\n DB::table('products')->insert([\n \t'image' => 'product_img.jpeg',\n \t'title' => 'Producto 1',\n \t'description' => 'descripcion producto 1',\n \t'category_id' => random_int(1, 14),\n ]);\n\n DB::table('products')->insert([\n \t'image' => 'product_img.jpeg',\n \t'title' => 'Producto 2',\n \t'description' => 'descripcion producto 2',\n \t'category_id' => random_int(1, 14),\n ]);\n\n DB::table('products')->insert([\n \t'image' => 'product_img.jpeg',\n \t'title' => 'Producto 3',\n \t'description' => 'descripcion producto 3',\n \t'category_id' => random_int(1, 14),\n ]);\n\n DB::table('products')->insert([\n \t'image' => 'product_img.jpeg',\n \t'title' => 'Producto 4',\n \t'description' => 'descripcion producto 4',\n \t'category_id' => random_int(1, 14),\n ]);\n\n DB::table('products')->insert([\n \t'image' => 'product_img.jpeg',\n \t'title' => 'Producto 5',\n \t'description' => 'descripcion producto 5',\n \t'category_id' => random_int(1, 14),\n ]);\n }", "public function run()\n {\n $products = [\n ['prodName'=>'Torta de chocolate','prodPrecio'=>'255','prodStock'=>'10','prodDesc'=>'Exquisita torta casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '1'],\n ['prodName'=>'Torta de ricota','prodPrecio'=>'235','prodStock'=>'10','prodDesc'=>'Exquisita torta casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '2'],\n ['prodName'=>'Tarta de espinaca','prodPrecio'=>'135','prodStock'=>'10','prodDesc'=>'Exquisita tarta casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '3'],\n ['prodName'=>'Budin de pan','prodPrecio'=>'335','prodStock'=>'10','prodDesc'=>'Exquisito budin casero.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '4'],\n ['prodName'=>'Empanada de atun','prodPrecio'=>'225','prodStock'=>'10','prodDesc'=>'Exquisita empanada casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '5'],\n ['prodName'=>'Ensalada de fruta','prodPrecio'=>'115','prodStock'=>'10','prodDesc'=>'Una fresca ensalada casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '6'],\n ['prodName'=>'Bomba de papa','prodPrecio'=>'345','prodStock'=>'10','prodDesc'=>'Exquisita bomba de papa casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '7'],\n ['prodName'=>'Sopa de zapallo','prodPrecio'=>'535','prodStock'=>'10','prodDesc'=>'Exquisita sopa casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '8'],\n ['prodName'=>'Albondigas con salsa','prodPrecio'=>'235','prodStock'=>'10','prodDesc'=>'Exquisitas albondigas caseras.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '9'],\n ['prodName'=>'Guiso de lentejas','prodPrecio'=>'135','prodStock'=>'10','prodDesc'=>'Exquisito guiso de lentejas.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '10'],\n ['prodName'=>'Pastel de papa','prodPrecio'=>'435','prodStock'=>'10','prodDesc'=>'Exquisito pastel de papa casero.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '11'],\n ['prodName'=>'Medialunas con miel','prodPrecio'=>'235','prodStock'=>'10','prodDesc'=>'Exquisitas medialunas con miel casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '12'],\n ['prodName'=>'Tortilla de zapallo','prodPrecio'=>'335','prodStock'=>'10','prodDesc'=>'Exquisita tortilla de papa casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '13'],\n ['prodName'=>'Falafel','prodPrecio'=>'135','prodStock'=>'10','prodDesc'=>'Exquisito falafel casero.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '14'],\n ['prodName'=>'Cheesecake','prodPrecio'=>'735','prodStock'=>'10','prodDesc'=>'Exquisito cheesecake casero.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '15'],\n ['prodName'=>'Lasagna','prodPrecio'=>'535','prodStock'=>'10','prodDesc'=>'Exquisita lasagna casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '16'],\n ['prodName'=>'Milanesa','prodPrecio'=>'435','prodStock'=>'10','prodDesc'=>'Exquisita milanesa casera.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '17'],\n ['prodName'=>'Lemonpie','prodPrecio'=>'435','prodStock'=>'10','prodDesc'=>'Exquisito lemonpie casero.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '18'],\n ['prodName'=>'Anillos de cebolla','prodPrecio'=>'435','prodStock'=>'10','prodDesc'=>'Exquisitos anillos de cebolla caseros.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Salado', 'id' => '19'],\n ['prodName'=>'Torta romana','prodPrecio'=>'435','prodStock'=>'10','prodDesc'=>'La mejor torta.','prodImagen'=>'avatars/default.jpg','prodSabor'=>'Dulce', 'id' => '20'],\n ];\n $ingredients = [\n ['name'=>'Lechuga', 'id' => '1'], ['name'=>'Tomate', 'id' => '2'], ['name'=>'Chocolate', 'id' => '3'],\n ['name'=>'Ricota', 'id' => '4'], ['name'=>'Queso', 'id' => '5'], ['name'=>'Crema', 'id' => '6'],\n ['name'=>'Papa', 'id' => '7'], ['name'=>'Atun', 'id' => '8'], ['name'=>'Zapallo', 'id' => '9'],\n ['name'=>'Lentejas', 'id' => '10'], ['name'=>'Espinaca', 'id' => '11'], ['name'=>'Cebolla', 'id' => '12'],\n ['name'=>'Pan', 'id' => '13'], ['name'=>'Limon', 'id' => '14'], ['name'=>'Fruta', 'id' => '15'],\n ['name'=>'Miel', 'id' => '16'],\n ];\n $categories = [\n ['name'=>'Tortas', 'id' => '1'], ['name'=>'Tartas', 'id' => '2'], ['name'=>'Empanadas', 'id' => '3'],\n ['name'=>'Guisos', 'id' => '4'], ['name'=>'Sopas', 'id' => '5'], ['name'=>'Pastas', 'id' => '6'],\n ['name'=>'Carnes', 'id' => '7'], ['name'=>'Verduras', 'id' => '8'], ['name'=>'Ensaladas', 'id' => '9'],\n ['name'=>'Entradas', 'id' => '9'], ['name'=>'Pasteleria', 'id' => '10'],\n ];\n foreach ($products as $product) {\n DB::table('products')->insert([\n 'name' => $product['prodName'],\n 'price'=> $product['prodPrecio'],\n 'stock'=> $product['prodStock'],\n 'description'=> $product['prodDesc'],\n 'flavour'=> $product['prodSabor'],\n 'image'=> $product['prodImagen'],\n ]);\n }\n foreach ($ingredients as $ingredient) {\n DB::table('ingredients')->insert([\n 'name' => $ingredient['name'],\n ]);\n }\n foreach ($categories as $category) {\n DB::table('categories')->insert([\n 'name' => $category['name'],\n ]);\n }\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'last_name' => 'ADMIN',\n 'country' => 'Matrix',\n 'province' => 'Hacker',\n 'email' => '[email protected]',\n 'password' => Hash::make('asd123'),\n 'age' => '18',\n 'admin' => '1',\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[0]['id'],\n 'ingredient_id' => $ingredients[2]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[0]['id'],\n 'category_id' => $categories[0]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[1]['id'],\n 'ingredient_id' => $ingredients[3]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[1]['id'],\n 'category_id' => $categories[0]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[2]['id'],\n 'ingredient_id' => $ingredients[10]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[2]['id'],\n 'category_id' => $categories[1]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[3]['id'],\n 'ingredient_id' => $ingredients[12]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[3]['id'],\n 'category_id' => $categories[0]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[4]['id'],\n 'ingredient_id' => $ingredients[7]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[4]['id'],\n 'category_id' => $categories[2]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[5]['id'],\n 'ingredient_id' => $ingredients[14]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[5]['id'],\n 'category_id' => $categories[8]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[6]['id'],\n 'ingredient_id' => $ingredients[7]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[6]['id'],\n 'category_id' => $categories[9]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[7]['id'],\n 'ingredient_id' => $ingredients[8]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[7]['id'],\n 'category_id' => $categories[4]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[8]['id'],\n 'ingredient_id' => $ingredients[5]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[8]['id'],\n 'category_id' => $categories[6]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[9]['id'],\n 'ingredient_id' => $ingredients[9]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[9]['id'],\n 'category_id' => $categories[3]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[10]['id'],\n 'ingredient_id' => $ingredients[6]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[10]['id'],\n 'category_id' => $categories[6]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[11]['id'],\n 'ingredient_id' => $ingredients[12]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[11]['id'],\n 'category_id' => $categories[9]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[12]['id'],\n 'ingredient_id' => $ingredients[8]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[12]['id'],\n 'category_id' => $categories[1]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[13]['id'],\n 'ingredient_id' => $ingredients[10]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[13]['id'],\n 'category_id' => $categories[7]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[14]['id'],\n 'ingredient_id' => $ingredients[4]['id'],\n ]);\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[14]['id'],\n 'ingredient_id' => $ingredients[5]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[14]['id'],\n 'category_id' => $categories[0]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[15]['id'],\n 'ingredient_id' => $ingredients[1]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[15]['id'],\n 'category_id' => $categories[5]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[16]['id'],\n 'ingredient_id' => $ingredients[12]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[16]['id'],\n 'category_id' => $categories[6]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[17]['id'],\n 'ingredient_id' => $ingredients[13]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[17]['id'],\n 'category_id' => $categories[0]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[18]['id'],\n 'ingredient_id' => $ingredients[11]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[18]['id'],\n 'category_id' => $categories[8]['id'],\n ]);\n\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[19]['id'],\n 'ingredient_id' => $ingredients[0]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[19]['id'],\n 'category_id' => $categories[0]['id'],\n ]);\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[19]['id'],\n 'ingredient_id' => $ingredients[1]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[19]['id'],\n 'category_id' => $categories[1]['id'],\n ]);\n DB::table('ingredient_product')->insert([\n 'product_id' => $products[19]['id'],\n 'ingredient_id' => $ingredients[2]['id'],\n ]);\n DB::table('category_product')->insert([\n 'product_id' => $products[19]['id'],\n 'category_id' => $categories[2]['id'],\n ]);\n\n }", "public function run()\n {\n //\n $faker = Faker::create();\n $bool= [true, false];\n App\\Product::all()->each(function($product) use ($faker ,$bool){\n \tApp\\Detail::created([\n \t\t'product_id'=> $product->id,\n \t\t'color' => $faker->hexcolor,\n \t\t'screen_technology'=>$faker->text(20),\n \t\t'screen_resolution'=> $faker->text(20),\n \t\t'screen_size'=>$faker->randomFloat(4,8),\n \t\t\n \t\t'cam_back_resolution'=>$faker->text(20),\n \t\t'cam_back_flash'=>$bool[array_rand(['0','1'])],\n \t\t'cam_front_resolution'=>$faker->text(20),\n \t\t'cam_front_videocall'=>$bool[array_rand(['0','1'])],\n \t\t\n \t\t'flatform_os'=>$faker->text(20),\n \t\t'flatform_chipset'=>$faker->text(20),\n \t\t'flatform_speed'=>$faker->numberBetween(10, 55)*100,\n \t\t'flatform_gpu'=>'Adreno 630',\n \t\t\n \t\t'memory_ram'=>$faker->numberBetween(1,10),\n \t\t'memory_internal'=>$faker->numberBetween(2,100),\n \t\t'memory_external'=>$faker->text(22),\n \t\t'memory_external_size'=>$faker->numberBetween(1,100),\n \t\t'connect_internet'=>'4G',\n \t\t'connect_sim'=>'2 Nano SIM',\n \t\t'connect_wifi'=>'Wi-Fi 802.11 a/b/g/n/ac, Wi-Fi Direct, Wi-Fi hotspot',\n \t\t'connect_gps'=>'A-GPS, GLONASS',\n \t\t'connect_bluetooth'=>'A2DP, LE, v5.0',\n \t\t'connect_usb'=>'USB Type-C',\n \t\t'connect_jack_headphone'=>'3.5 mm',\n \t\t'connect_other'=>'NFC',\n \t\t\n \t\t'body_size_vertical'=>$faker->numberBetween(100,200),\n \t\t'body_size_horizontal'=>$faker->numberBetween(50, 100),\n \t\t'body_size_think'=>$faker->numberBetween(5,10),\n \t\t'body_weight'=>$faker->numberBetween(100,200),\n \t\t\n \t\t'battery_size'=>$faker->numberBetween(20,50) * 100,\n \t\t'battery_type'=>'Li-Ion',\n \t\t'battery_technology'=>'Tiết kiệm pin, Siêu tiết kiệm pin, Sạc nhanh Quick Charge 3.0',\n\n \t]);\n });\n }", "public function odpranap()\n{\n$data = array(\n 'odpranap' => $this->odpranap->odpRanap(),\t\n 'pasien' => $this->odpranap->masterPasien(),\t\n // 'pasien' => $this->igd->get_data_barang_bykode($no_rm),\n 'title' => 'DAFTAR ODP RAJAL'\n);\n $this->konten['main_view'] = $this->load->view('covid/odpranap', $data, TRUE);\n $this->konten['filejs'] = \"covid/odpranapjs\";\n $this->load->view('templates/dashboard', $this->konten);\t\n}", "public function mahasiswa()\n {\n $data['halaman'] = \"Data Mahasiswa\";\n $data['mahasiswa'] = $this->mod->m_get_all_mahasiswa_plus_dosen();\n // print('<pre>');print_r($data);exit();\n $this->load->view('head.php', $data);\n $this->load->view('sidebar.php');\n $this->load->view('header.php');\n $this->load->view('dosen/mahasiswa.php', $data);\n $this->load->view('footer.php');\n }", "public function run()\n {\n\n $id_payment_status = [1,2,3];\n $payment_method= ['mandiri_va', 'bni_va', 'bri_va', 'bca_va', 'credit_card'];\n\n $payment = Payment::firstOrCreate([\n 'id' => Str::uuid(),\n 'id_payment_status'=> Arr::random($id_payment_status),\n 'payment_method'=> Arr::random($payment_method),\n 'total_price'=> rand(10000,1000000),\n ]);\n }", "public function tambah_pelanggan_all()\n {\n\n $layanan = Data_layanan::all();\n $kategori = Data_kategori::all();\n $pop = Data_pop::all();\n $sektor = Data_sektor::all();\n $tipe = Data_tipe_pengguna::all();\n $tipebandwith = Data_tipe_bw::all();\n\n\n return view('pelanggan/tambah_pelanggan_all', ['datalayanan' => $layanan, 'kategori' => $kategori, 'pop' => $pop, 'sektor' => $sektor, 'tipe' => $tipe, 'datatipebw' => $tipebandwith]);\n }", "public function tampilDataGalang(){\n\t\t\n\t}", "public function data_pros()\n {\n $data = [ 'aktif' => 'pros',\n 'prospektus' => $this->M_prospektus->get_data_prospektus()\n ];\n\n $this->template->load('template', 'prospektus/V_data_pros', $data);\n }", "public function run()\n {\n $keranjang = Keranjang::with(['penjual'=>function($query){\n $query->with(['produk']);\n }])->get();\n foreach($keranjang as $cart){\n $var = [];\n $produk = $cart->penjual->produk->random(10);\n foreach($produk as $belanjaan){\n $itemKeranjang = new App\\Item([\n 'keranjang_id'=>$cart->id,\n 'produk_id'=> $belanjaan->id,\n 'jumlah' => rand(1,$belanjaan->jumlah_tersedia),\n 'harga' => $belanjaan->harga,\n ]);\n $var[] = $itemKeranjang;\n }\n \n $cart->belanjaan()->saveMany($var);\n }\n }", "public function run()\n {\n DB::table(\"produk\")->insert([\n \t[\n \t\t\"nama\" => \"banner\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat banner\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"nota\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat nota\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"undangan\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat undangan\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"sticker print\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat sticker print\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"kartu nama\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat kartu nama\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"brosur\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat brosur\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"sticker sablon\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat sticker sablon\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"buku yaasin\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat buku yaasin\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"umbul-umbul kain\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat umbul-umbul kain\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"id card\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat id card\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"kalender\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat kalender\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"nama dada\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat nama dada\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"sablon plastik/tas/kaos\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat sablon plastik/tas/kaos\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"stempel\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat stempel\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t[\n \t\t\"nama\" => \"neon box (papan nama)\",\n \t\t\"harga_satuan\" => 2000,\n\t\t\t\t\"satuan\" => 'lembar',\n\t\t\t\t\"deskripsi\" => \"deskripsi singkat neon box (papan nama)\",\n \t\t\"created_by\" => \"1\",\n \t],\n \t\n ]);\n }", "public function getRealisasiSkpd(){\n\t\t$tahun_id = Input::get('tahun_id');\n\t\t// $tahun_id = 4;\n\t\t$skpd_id = Input::get('skpd_id');\n\t\t// $skpd_id = 2;\n\t\t$bulan = date('m');\n\n\t\t$model = new DataGrafik;\n\t\t$data_realisasi = $model->getDataGrafikRealisasi($skpd_id, $tahun_id);\n\n\t\t$skpd = DB::table('skpd')->where('id', '=', $skpd_id)->first();\n\t\t$tahun = Tahun::find($tahun_id);\n\n\t\t// data untuk grafik realisasi\n\t\t$data['series'] = json_encode($data_realisasi['series']);\n\t\t$data['categories'] = json_encode($data_realisasi['categories']);\n\t\t$data['chart_title'] = 'Grafik Realisasi Fisik dan Keuangan<br> '.$skpd->skpd.' Tahun '.$tahun->tahun;\n\n\t\t$data_realisasi_bulanan = $model->getRealisasiSkpdBulanan($tahun_id,$skpd_id, $bulan);\n\t\t$data['series_bulanan'] = json_encode($data_realisasi_bulanan['series']);\n\n\t\t// table\n\t\t$data['table_realisasi'] = $data_realisasi['table'];\n\t\t$data['table_realisasi_bulanan'] = $data_realisasi_bulanan['table'];\n\n\t\t// print_r($data_realisasi_bulanan);\n\t\treturn Response::json( $data );\n\t}", "function index()\n\t{\n\t\t\t$select_thnajar= $this->model->get_thn_ajar()->result();\n \n $vdata['kode_deskripsi'][NULL] = '';\n foreach ($select_thnajar as $b) {\n \n $vdata['kode_deskripsi'][$b->id]\n =$b->deskripsi;\n }\n //get Kelas\n\t\t\t$select_kelas= $this->mcommon->mget_list_kelas()->result();\n \n $vdata['kode_kelas'][NULL] = '';\n foreach ($select_kelas as $b) {\n \n\t\t\t\t\t\t\t$vdata['kode_kelas'][$b->kode_kelas.\"#\".$b->nama.\"#\".$b->tingkat.\"#\".$b->tipe_kelas]\n\t\t\t\t\t\t\t=$b->nama.\" | \".$b->tingkat.\" | \".$b->tipe_kelas;\n }\n //get Mata Pelajaran\n\t\t\t$select_mtpelajaran= $this->mcommon->mget_list_mata_pelajaran()->result();\n \n $vdata['mat_pal'][NULL] = '';\n foreach ($select_mtpelajaran as $b) {\n \n\t\t\t\t\t\t\t$vdata['mat_pal'][$b->id_matpal]\n\t\t\t\t\t\t\t=$b->id_matpal.\" | \".$b->nama_matpal;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t//get Guru\n\t\t\t$type ='guru';\n\t\t\t$select_guru= $this->mcommon->mget_list_master_guru($type)->result();\n \n $vdata['idguru'][NULL] = '';\n foreach ($select_guru as $b) {\n \n\t\t\t\t\t\t\t$vdata['idguru'][$b->id_guru]\n\t\t\t\t\t\t\t=$b->id_guru.\" | \".$b->nama_lengkap;\n }\n\t\t\n\t\t$vdata['title'] \t\t= 'RPP';\n\t $data['content'] \t\t= $this->load->view('vrpp',$vdata,TRUE);\n\t $this->load->view('main',$data);\n\t}", "public function index()\n {\n //CARA 2: untuk dapat kan banyak kategori untuk 1 judul\n //$metaproduk = DB::select('SELECT `id_produk`,`id_kategori` FROM `produk` group by `id_produk`');\n // $metaproduk=DB::select('SELECT `a`.`id_kategori`, `b`.`id`, `categori`.`judul`\n // FROM `produk` AS `a`, `produk_detail` AS `b`, `categori`\n // GROUP by `a`.`id_kategori`');\n $produk =ProdukDetail::orderBy('id', 'asc')->paginate(20);\n return ['data'=>$produk];\n }", "public function showIndex(){\n\t\t$tahun = 2014;\n\t\t$skpd_id = 1;\n\n\t\t$model = new DataGrafik;\n\t\t$tahun_id = $model->getIdTahunTerakhir($tahun);\n\t\t// get realisasi fisik & keuangan\n\t\t// get rencana realisasi fisik & keuangan\n\t\t$data_realisasi = $model->getDataGrafikRealisasiSkpd($skpd_id, $tahun_id);\n\n\t\t// data untuk grafik realisasi\n\t\t$data['series'] = json_encode($data_realisasi['series']);\n\t\t$data['categories'] = json_encode($data_realisasi['categories']);\n\t\t$data['chart_title'] = 'Grafik Realisasi Fisik dan Keuangan<br>Seluruh SKPD Tahun '.$tahun;\n\n\t\t// data untuk grafik realisasi bulanan\n\t\t$data_realisasi_bulanan = $this->getRealisasiSkpdBulanan($tahun_id,$skpd_id);\n\t\t$data['series_bulanan'] = json_encode($data_realisasi_bulanan['series']);\n\n\t\t// data untuk\n\t\t$data['skpd'] = $model->getSkpd();\n\t\t$data['tahun'] = $model->getTahun();\n\t\t$data['tahun_id'] = $tahun_id;\n\t\t$data['skpd_id'] = $skpd_id;\n\n\t\t// table\n\t\t$data['table_realisasi'] = $data_realisasi['table'];\n\t\t$data['table_realisasi_bulanan'] = $data_realisasi_bulanan['table'];\n\n\t\treturn View::make('umum.index', $data);\n\t}", "public function run()\n {\n //\n $faker = Faker::create();\n\n for ($i = 0; $i < 100; $i++) {\n $data = [\n 'pelanggan' => $faker->name,\n 'alamat' => $faker->address,\n 'telp' => $faker->phoneNumber,\n ];\n\n Pelanggan::create($data);\n }\n }", "function danhmuc() {\n $id = $this->uri->rsegment(3);\n $id = intval($id); //ép kiểu int\n\n $danhmuc = $this->hangsp_model->get_info($id);\n if (!$danhmuc) {\n redirect();\n }\n $this->data['danhmuc'] = $danhmuc;\n// //lấy ds sp thuoc hangsp\n $input = array();\n $input1 = array();\n\n $input1['where'] = array('stt_sp' => 0, 'hang_spID' => $id);\n\n\n $total_rows = $this->sanpham_model->get_total($input1);\n $this->data['total_rows'] = $total_rows; //tong sp\n $this->load->library('pagination');\n $config = array();\n $config['total_rows'] = $total_rows;\n $config['base_url'] = base_url('sanpham/danhmuc/' . $id);\n $config['per_page'] = 9; //6 sp 1 trang\n $config['uri_segment'] = 4; //phan doan hien thi so trang\n $config['next_link'] = 'Trang sau';\n $config['prev_link'] = 'Trang trước';\n $this->pagination->initialize($config); // khoi tao cau hinh phan trang \n $segment = $this->uri->segment(4);\n $segment = intval($segment);\n\n $input['limit'] = array($config['per_page'], $segment);\n\n $sanpham = $this->sanpham_model->get_list($input1);\n// $sanpham = $this->sanpham_model->get_list($input);\n $this->data['sanpham'] = $sanpham;\n \n $this->data['temp'] = 'site/sanpham/danhmuc';\n $this->load->view('site/layout', $this->data);\n }", "public function run()\n {\n \n for($i=0;$i<= 20;$i++){\n $manu = new Manufacture();\n $manu->manu_name=Str::random(10); \n\n }\n }", "public function actionMuestraPunto(){\n $d=0;\n $date=\"\";\n $dateTime=date(\"Y-m-d H:i:s\"); \n $mt = explode(' ', microtime()); \n $d=mt_rand(0,30); \n $time=strtotime ( date(\"Y-m-d H:i:s\") )*1000;\n echo CJSON::encode(array(\"temp\"=>$d,\"time\"=>$time)); \n }", "public function run()\n {\n Jadwal::truncate();\n $pemesann=[1,2,3,4,5,6,7,8,9,10];\n $kelass=[1,2,3,4,5,6,7,8,9,10];\n\n $pemesan=array_rand($pemesann);\n $kelas=array_rand($kelass);\n \n Jadwal::create([\n \"pemesan\"=>$pemesann[array_rand($pemesann)],\n \"mulai\"=>\"12:00:00\",\n \"selesai\"=>\"13:00:00\",\n \"tanggal\"=>date(\"Y-m-d\"),\n \"keperluan\"=>'belajar',\n \"id_kelas\"=>$kelass[array_rand($kelass)],\n\n ]);\n\n Jadwal::create([\n \"pemesan\"=>'1',\n \"mulai\"=>\"14:00:00\",\n \"selesai\"=>\"15:00:00\",\n \"tanggal\"=>date(\"Y-m-d\"),\n \"keperluan\"=>'nyusun rencana demo',\n \"id_kelas\"=>$kelass[array_rand($kelass)],\n\n ]);\n Jadwal::create([\n \"pemesan\"=>'1',\n \"mulai\"=>\"10:00:00\",\n \"selesai\"=>\"11:00:00\",\n \"tanggal\"=>date(\"Y-m-d\"),\n \"keperluan\"=>'belajar politik',\n \"id_kelas\"=>$kelass[array_rand($kelass)],\n\n ]);\n Jadwal::create([\n \"pemesan\"=>'1',\n \"mulai\"=>\"10:00:00\",\n \"selesai\"=>\"11:00:00\",\n \"tanggal\"=>\"2019-08-04\",\n \"keperluan\"=>'sedeng dot gen',\n \"id_kelas\"=>$kelass[array_rand($kelass)],\n\n ]);\n \n }", "public function run()\n {\n for ($i=0; $i < 500; $i++) {\n $faker = Factory::create('id_ID');\n $tanggal_pinjam = $faker->dateTimeBetween('-6 months', '-2 week');\n $tanggal_kembali = Carbon::parse($tanggal_pinjam)->addDays(10);\n $tanggal_pengembalian = Carbon::parse($tanggal_pinjam)->addDays(9);\n\n $user = User::create([\n 'name' => $faker->name(),\n 'email' => $faker->email(),\n 'password' => bcrypt('123123123'),\n ])->assignRole('peminjam');;\n\n $peminjaman = Peminjaman::create([\n 'kode_pinjam' => random_int(100000000, 999999999),\n 'peminjam_id' => $user->id,\n 'petugas_pinjam' => random_int(1,2),\n 'petugas_kembali' => random_int(1,2),\n 'denda' => 0,\n 'status' => 3,\n 'tanggal_pinjam' => $tanggal_pinjam,\n 'tanggal_kembali' => $tanggal_kembali,\n 'tanggal_pengembalian' => $tanggal_pengembalian\n ]);\n\n DetailPeminjaman::create([\n 'peminjaman_id' => $peminjaman->id,\n 'buku_id' => random_int(1,7)\n ]);\n }\n }", "public function listProduk()\n {\n $input = Input::all();\n $draw = $input['draw'];\n /**\n * set count\n **/\n $result = Product::getAllDataAdmin($input, true);\n $total = Product::getAllDataAdmin($input, false);\n $output=array();\n $output['draw']=$draw;\n $output['recordsTotal'] = $output['recordsFiltered']= count($total);\n $output['data']=array();\n\n /**\n * get all data\n **/\n $output['data'] = $result;\n return response()->json($output);\n }", "public function definition()\n {\n return [\n 'customer_id' => Customer::factory()->create()->id,\n 'nama_barang' => $this->faker->sentence,\n 'harga_barang' => rand(1000, 10000),\n 'qty' => rand(1, 100),\n 'total' => rand(200 , 100),\n 'images' => 'pp.jpeg',\n ];\n }", "public function index(){\n $price = Price::paginate(15);\n $all = \"semua\";\n $arr = array('price' => $price, 'all' => $all);\n return view('pelanggan/pages/halaman_produk')->with('arr',$arr);\n\n }", "public function run()\n {\n //\n $arr = [];\n for($i=0; $i<20;$i++){\n \t$tmp = [];\n \t$tmp['typeid'] = rand(1,10);\n \t$tmp['goods'] = str_random(20);\n \t$tmp['company'] = str_random(20);\n \t$tmp['descr'] = str_random(30);\n \t$tmp['price'] = rand(1,9999999);\n \t$tmp['picname'] = str_random(40);\n \t$tmp['picname_m']= str_random(40);\n \t$tmp['picname_s']= str_random(40);\n \t$tmp['state'] = rand(0,3);\n \t$tmp['store'] = rand(0,9999999);\n \t$tmp['num'] = rand(0,9999999);\n \t$tmp['clicknum'] = rand(0,9999999);\n \t$tmp['created_at'] = date('Y-m-d H:i:s');\n \t$tmp['updated_at'] = date('Y-m-d H:i:s');\n \t$arr[] = $tmp;\n }\n //插入\n DB::table('products')->insert($arr);\n }", "public function run()\n {\n DB::table('products')->insert([\n \t\n \t 'product_name' => Str::random(40),\n \t 'product_code' => Str::random(10),\n \t 'product_color' => Str::random(10),\n \t 'decription' =>Str::random(50),\n \t 'price' =>Str::random(20),\n \t 'care'=>Str::random(30),\n ]); \n }", "public function rapot()\n {\n $data['semester'] = $this->M_Nilai->get_data('tb_semester')->result();\n\n $this->load->view('ps/rapot' ,$data);\n }", "public function run()\n {\n $data = [];\n\n $faker = Faker\\Factory::create('ja_JP');\n for ($i = 0; $i < 100; $i++) {\n $data[] = [\n 'title' => $faker->userName,\n 'img' => $faker->imageUrl($width = 200, $height = 200),\n 'details' => $faker->realText,\n 'price' => $faker->numberBetween($min = 0, $max = 1000000),\n 'stock' => $faker->numberBetween($min = 0, $max = 1000000),\n 'saleDate' => $faker->date('Y-m-d H:i:s'),\n 'user_id' => $faker->numberBetween($min = 1, $max = 100),\n ];\n }\n\n $table = $this->table('products');\n $table->insert($data)->save();\n }", "public function definition()\n {\n $orderIDS= Order::pluck('id')->toArray();\n $productIDs = Product::pluck('id')->toArray();\n $index = array_rand($orderIDS);\n $index2 = array_rand($productIDs);\n\n return [\n 'order_id' => $orderIDS[$index],\n 'product_id' => $productIDs[$index2],\n 'amount' => $this->faker->randomNumber(),\n 'price' => $this->faker->randomFloat(2,20,100),\n 'discount' => $this->faker->randomFloat(2,0,1000)\n ];\n }", "public function run()\n {\n\n\n foreach (range(0,10) as $item)\n {\n $faker = new Faker\\Generator();\n $faker->addProvider(new Faker\\Provider\\Person($faker));\n\n $kurierModel = new \\App\\Kurier();\n $kurierModel->firstname = $faker->firstName;\n $kurierModel->lastname = $faker->lastName;\n $kurierModel->free = (int) rand(0, 1);\n $kurierModel->save();\n }\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n for ($i = 1; $i <= 20; $i++) {\n DB::table('uangmasuk')->insert(\n [\n\n 'nis' => $faker->nis,\n 'nama_santri' => $faker->nama_santri,\n 'tgl_masuk' => $faker->tgl_masuk,\n 'kelas' => $faker->kelas,\n 'no_hp' => $faker->no_hp,\n 'spp' => $faker->spp,\n 'ekstra' => $faker->ekstra,\n 'buku' => $faker->buku,\n 'psb' => $faker->psb,\n 'tasyakuran' => $faker->tasyakuran,\n 'sumbangan_buku' => $faker->sumbangan_buku,\n 'ujian_1' => $faker->ujian_1,\n 'ujian_2' => $faker->ujian_2,\n 'un' => $faker->un,\n 'tunggakan' => $faker->tunggakan,\n 'total' => $faker->spp + $faker->ekstra + $faker->buku + $faker->psb + $faker->tasyakuran + $faker->sumbangan_buku + $faker->ujian_1 + $faker->ujian_2 + $faker->un + $faker->tunggakan\n\n ]\n );\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $count = 30;\n $list = range(1, $count);\n shuffle($list);\n $colors = $list;\n $capacities = $list;\n $neckfinishes = $list;\n $packinginfos = $list;\n foreach(range(1, 30) as $index)\n {\n DB::table('products')->insert([\n 'serial_number' => $faker->word,\n 'color_id' => array_shift($colors),\n 'capacity_id' => array_shift($capacities),\n 'neckfinish_id' => array_shift($neckfinishes),\n 'packinginfo_id' => array_shift($packinginfos),\n 'showcase_id' => $faker->randomNumber(),\n 'name' => $faker->name,\n 'image' => \"http://localhost:4200/assets/imgs/bottle1.png\",\n 'catagory' => $faker->word,\n 'type' => $faker->word,\n 'style' => $faker->word,\n 'model' => $faker->word,\n 'description' => $faker->word,\n 'shape' => $faker->word,\n 'material' => $faker->word,\n 'details' => $faker->word,\n 'technical_detail_link' => $faker->url,\n 'batch_number' => $faker->randomNumber(),\n 'unit_measure' => $faker->randomNumber(),\n 'msrp' => $faker->randomFloat($nbMaxDecimal = 5, $min = 0, $max = 5),\n 'drawing' => $faker->url,\n 'heavy_metal' => $faker->url,\n 'fda_report' => $faker->url,\n 'msds' => $faker->url,\n 'certificate' => $faker->url,\n 'qc_report' => $faker->url,\n 'status' => $faker->word,\n \n ]);\n }\n }" ]
[ "0.66269016", "0.64214265", "0.6397551", "0.627249", "0.62071973", "0.62065107", "0.6168384", "0.61676747", "0.61614007", "0.61047935", "0.6078641", "0.6075553", "0.60733825", "0.607329", "0.6066341", "0.6062846", "0.6062405", "0.60569775", "0.6043831", "0.6038772", "0.6037733", "0.6037062", "0.6029428", "0.60288227", "0.60285795", "0.6014588", "0.60136604", "0.60132855", "0.60127455", "0.6001635", "0.59979945", "0.5987956", "0.59855235", "0.59825283", "0.5979956", "0.5974558", "0.5970046", "0.5968861", "0.59688056", "0.5963687", "0.59616107", "0.5957845", "0.5937694", "0.59355605", "0.5929265", "0.5921137", "0.5907252", "0.5906683", "0.5903248", "0.5902934", "0.590027", "0.58998203", "0.5895257", "0.5891578", "0.58848464", "0.58843756", "0.5883564", "0.5881324", "0.58751464", "0.58715796", "0.5867258", "0.5865906", "0.58633566", "0.5860325", "0.5855829", "0.58497924", "0.5832028", "0.5830958", "0.58294916", "0.58255833", "0.5823729", "0.5821876", "0.5819718", "0.58085304", "0.5803925", "0.5800057", "0.579965", "0.5799462", "0.57951957", "0.5791554", "0.5789437", "0.57773465", "0.577565", "0.5770955", "0.5770667", "0.5769617", "0.5769363", "0.5767425", "0.57671994", "0.5766488", "0.57636356", "0.5760473", "0.57602865", "0.5758921", "0.57539785", "0.5750063", "0.5748313", "0.5745872", "0.57454747", "0.5745207", "0.5743778" ]
0.0
-1
Start function currency general setting
public function foodbakery_general_settings() { global $foodbakery_settings, $foodbakery_plugin_options; $base_currency = isset( $foodbakery_plugin_options['foodbakery_base_currency'] ) ? $foodbakery_plugin_options['foodbakery_base_currency'] : 'USD'; $currencies = array(); $foodbakery_currencuies = foodbakery_get_currencies(); if ( is_array($foodbakery_currencuies) ) { foreach ( $foodbakery_currencuies as $key => $value ) { $currencies[$key] = $value['name'] . '-' . $value['code']; } } $foodbakery_settings[] = array( "name" => esc_html__("Base Currency", "foodbakery"), "desc" => "", "hint_text" => esc_html__("All the transactions will be placed in this currency.", "foodbakery"), "id" => "base_currency", "std" => "USD", 'classes' => 'dropdown chosen-select-no-single base-currency-change', "type" => "select_values", "options" => $currencies ); $foodbakery_settings[] = array( "name" => esc_html__("Currency Alignment", "foodbakery"), "desc" => "", "id" => "currency_alignment", "std" => "Left", 'classes' => 'dropdown chosen-select-no-single', "type" => "select", "custom" => true, "options" => array('Left' => 'Left', 'Right' => 'Right'), ); /*$all_currencies = foodbakery_all_currencies_array( $base_currency ); $foodbakery_settings[] = array( "name" => esc_html__("Select Currency", "foodbakery"), "desc" => "", "hint_text" => esc_html__("Overall website currency to show the prices. The payments will be processed in Base Currency.", "foodbakery"), "id" => "currency_id", "std" => "USD", 'classes' => 'dropdown chosen-select-no-single ', "type" => "select_values", "options" => $all_currencies );*/ return $foodbakery_settings; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function admin_currency_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n\t\t\t if ($this->lang->line('admin_settings_currency_setting') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_settings_currency_setting')); \n\t\t else $this->data['heading'] = 'Currency Settings';\n $this->load->view(ADMIN_ENC_URL.'/adminsettings/currency_settings', $this->data);\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "function setCurrencyCode(){\n switch($this->Currency){\n case \"USD\": $this->CurrencyCode = 840;\n break;\n case \"EUR\": $this->CurrencyCode = 978;\n break;\n case \"AUD\": $this->CurrencyCode = 036;\n break;\n case \"CAD\": $this->CurrencyCode = 124;\n break;\n case \"GBP\": $this->CurrencyCode = 826;\n break;\n case \"JPY\": $this->CurrencyCode = 392;\n break;\n }// end switch\n }", "private function setCurrency()\n {\n $currency = $this->em->getRepository('ClubUserBundle:LocationConfig')->getObjectByKey('default_currency',$this->order->getLocation());\n\n $this->order->setCurrency($currency);\n $this->order->setCurrencyValue(1);\n }", "public function setGlobalCurrencyCode($code);", "public function setCurrency($c)\n {\n $this->setOption('currency',$c);\n }", "public function sendMoney() {\n // @TODO Do something\n echo 'VTB';\n parent::sendMoney();\n }", "public function askCurrency()\n {\n $this->ask('What is you main currency?', function (Answer $answer) {\n $this->account_currency = $answer->getText();\n\n $urlConvert = \"https://api.exchangeratesapi.io/latest?base={$this->account_currency}\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $urlConvert);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n $json_string = curl_exec($ch);\n $parsed_json = json_decode($json_string, true);\n\n if (isset($parsed_json['error'])) {\n $this->say($parsed_json['error']);\n $this->repeat();\n } else {\n $this->say('Great - that is all we need, ' . $this->user->name);\n\n $this->user->save();\n\n $this->account_number = sprintf(\"%06d\", $this->user->id+1);\n\n $this->user->account()->create([\n 'number' => $this->account_number,\n 'balance' => $this->account_balance,\n 'currency' => $this->account_currency\n ]);\n\n $this->say($this->user->name . ' your account number is ' . $this->account_number);\n }\n });\n }", "function setting()\n\t{\n\t\t// Tai cac file thanh phan\n\t\t$this->load->model('currency_model');\n\t\t$this->load->library('form_validation');\n\t\t$this->load->helper('form');\n\t\t\n\t\t// Lay cac bien cai dat\n\t\t$params = array_keys(array_merge($this->setting_default, $this->setting));\n\t \n\t\t// Tu dong kiem tra gia tri cua 1 bien\n\t\t$param = $this->input->post('_autocheck');\n\t\tif ($param)\n\t\t{\n\t\t\t$this->_setting_autocheck($param);\n\t\t}\n\t\t\n\t\t// Xu ly form\n\t\tif ($this->input->post('_submit'))\n\t\t{\n\t\t\t// Gan dieu kien cho cac bien\n\t\t\t$this->_setting_set_rules($params);\n\t\t\t\n\t\t\t// Xu ly du lieu\n\t\t\t$result = array();\n\t\t\tif ($this->form_validation->run())\n\t\t\t{\n\t\t\t // Goi ham xu ly setting cua payment\n\t\t\t $this->_setting_handle();\n\t\t\t \n\t\t\t //lay chiet khau goc cua nha cung cap\n\t\t\t $types = $this->get_types();\n\t\t\t $discount = array();\n\t\t\t \n\t\t\t\t// Lay gia tri setting tu form\n\t\t\t $setting_data = array();\n\t\t\t $default = $this->input->post('default');\n\t\t\t unset($params[0]);\n\t\t\t $total = 0;\n\t\t\t\tforeach ($params as $p => $v)\n\t\t\t\t{\n\t\t\t\t $val = $this->input->post($v);\n\t\t\t\t $total = count($val);\n\t\t\t\t $values[$v] = $val;\n\t\t\t\t}\n\t\t\t\t$keys = array_keys($values);\n\t\t\t\tfor ($i = 1;$i<= $total;$i++)\n\t\t\t\t{\n\t\t\t\t $d = array();\n\t\t\t\t foreach ($keys as $key)\n\t\t\t\t {\n\t\t\t\t if(isset($values[$key][$i]) && $values[$key][$i])\n\t\t\t\t {\n\t\t\t\t $d['default'] = $default;\n\t\t\t\t $d[$key] = $values[$key][$i];\n\t\t\t\t } \n\t\t\t\t }\n\t\t\t\t if(!empty($d))\n\t\t\t\t {\n\t\t\t\t $setting_data[$i] = $d;\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t foreach ($types as $type)\n\t\t\t\t {\n\t\t\t\t $discount[$i][$type] = $this->input->post('discount_'.$type.'_'.$i);\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tmodel('payment_card')->set_setting($this->code, $setting_data);\t\n\t\t\t\tmodel('payment_card')->set_setting('discount_'.$this->code, $discount);\n\t\t\t\t\n\t\t\t\t// Khai bao ket qua tra ve\n\t\t\t\t$result['complete'] = TRUE;\n\t\t\t\t$result['location'] = admin_url('payment_card');\n\t\t\t\tset_message(lang('notice_update_success'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach ($params as $param)\n\t\t\t\t{\n\t\t\t\t\t$result[$param] = form_error($param);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$output = json_encode($result);\n\t\t\tset_output('json', $output);\n\t\t}\n\t\t\n\t\t// Loai bo cac bien mac dinh ra khoi params truoc khi gui den view\n\t\t/*\n\t\t$params_default = array_keys($this->setting_default);\n\t\tforeach ($params as $k => $p)\n\t\t{\n\t\t\tif (in_array($p, $params_default))\n\t\t\t{\n\t\t\t\tunset($params[$k]);\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t\n\t\t$discounts = model('payment_card')->get_setting('discount_'.$this->code);\n\t\t$this->data['discounts'] = $discounts;\n\t\t\n\t\t// Luu bien gui den view\n\t\t$this->data['action'] \t= current_url();\n\t\t$this->data['params'] \t= $params;\n\t\t\n\t\t$this->data['code'] \t= $this->code;\n\t\t$this->data['setting'] \t= $this->setting_data;\n\t\treturn $this->data;\n\t}", "public function setCurrency($currency){\n $this->currency = $currency;\n }", "public function save_currency() {\n\t\t// Validate nonce\n\t\tforminator_validate_ajax( \"forminator_save_popup_currency\" );\n\n\t\tupdate_option( \"forminator_currency\", sanitize_text_field( $_POST['currency'] ) );\n\t\twp_send_json_success();\n\t}", "public function save_currency_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $currency_settings_val = $this->input->post(\"currency\");\n $config = '<?php ';\n foreach ($currency_settings_val as $key => $val) {\n $value = addslashes($val);\n $config .= \"\\n\\$config['$key'] = '$value'; \";\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_currency_settings.php';\n file_put_contents($file, $config);\n $this->setErrorMessage('success', 'Currency settings updated successfully','admin_adminlogin_currency_setting_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_currency_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "public function activate()\n {\n $this->add_setting('financialmodelingprep_API', '1a2abc9df3aed370108ba7b4db47314d');\n }", "public function __construct() {\n\n // WPML + Multi Currency related settings\n $this->current_currency = get_option('woocommerce_currency');\n // $this->multi_currency_enabled = in_array( 'woocommerce-multilingual/wpml-woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) && get_option( 'icl_enable_multi_currency' ) == 'yes';\n $this->supported_currencies = array( 'RMB', 'CNY' );\n\n $this->charset = strtolower( get_bloginfo( 'charset' ) );\n if( !in_array( $this->charset, array( 'gbk', 'utf-8') ) ) {\n $this->charset = 'utf-8';\n }\n\n // WooCommerce required settings\n $this->id = 'bocpay';\n $this->icon = apply_filters( 'woocommerce_bocpay_icon', plugins_url( 'images/boc-logo.png', __FILE__ ) );\n $this->has_fields = false;\n $this->method_title = '交通银行支付';\n $this->order_button_text = '使用交通银行支付';\n $this->notify_url = WC()->api_request_url( 'WC_Bocpay' );\n\n // Load the settings.\n $this->init_form_fields();\n $this->init_settings();\n\n $this->merchantID = $this->get_option( 'merchantID' );\n $this->title = $this->get_option( 'title' );\n $this->description = $this->get_option( 'description' );\n $this->debug = $this->get_option( 'debug' );\n\n // Logs\n $this->debug = 'yes';\n if ( 'yes' == $this->debug ) {\n $this->log = new WC_Logger();\n }\n\n // Actions\n add_action( 'woocommerce_update_options_payment_gateways', array( $this, 'process_admin_options' ) ); // WC <= 1.6.6\n add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); // WC >= 2.0\n add_action( 'woocommerce_thankyou_bocpay', array( $this, 'thankyou_page' ) );\n add_action( 'woocommerce_receipt_bocpay', array( $this, 'receipt_page' ) );\n\n // Payment listener/API hook\n add_action( 'woocommerce_api_wc_bocpay', array( $this, 'check_bocpay_response' ) );\n\n // Display Bocpay Trade No. in the backend.\n add_action( 'woocommerce_admin_order_data_after_billing_address',array( $this, 'wc_bocpay_display_order_meta_for_admin' ) );\n }", "function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}", "public function run()\n {\n //\n $b_curr=[\"Euro\",\"Euro\",\"Euro\",\"Us Dollar\",\"Swiss Franc\",\"British Pound\"];\n $t_curr=[\"Us Dollar\",\"Swiss Franc\",\"British Pound\",\"JPY\",\"Us Dollar\",\"CAD\"];\n $ex_rates=[1.3764,1.2079,0.8731,76.7200,1.1379,1.5648];\n for ($i = 0; $i <sizeof($b_curr); $i++) {\n ExchangeRate::create([\n 'baseCur' =>$b_curr[$i] ,\n 'targetCur' =>$t_curr[$i],\n 'rate' =>$ex_rates[$i]\n ]);\n ExchangeRate::create([\n 'baseCur' =>$t_curr[$i] ,\n 'targetCur' =>$b_curr[$i],\n 'rate' =>1/$ex_rates[$i]\n ]);\n\n }\n }", "public function setBaseCurrencyCode($code);", "public function setCurrency(string $currency);", "function Index()\n\t{\n\n\t\t$this->assign( 'tax_rate', 100 * Site_Config::GetVat() );\n\t\t$this->assign( 'customer', $_SESSION[ 'customer_details' ] );\n\t\t$this->assign( 'basket', $_SESSION[ 'basket' ] );\n\t\t$this->assign( 'customer_country', Country::Retrieve( $_SESSION[ 'customer_details' ]->country ) );\n\t\t$this->assign( 'shipping', Shipping::Retrieve( $_SESSION[ 'shipping' ] ) );\n\t\techo $this->Decorate( \"payment/choose_payment_method.tpl\" );\n\t}", "function init() {\r\n\r\n\t\t\tadd_filter( 'woocommerce_get_settings_pages', array( &$this, 'settings_tfls' ) );\r\n\r\n\t\t\t// Add wholesale price field to product\r\n\t\t\tadd_action( 'woocommerce_product_options_general_product_data', array(\r\n\t\t\t\t&$this,\r\n\t\t\t\t'product_options_wholesale_price'\r\n\t\t\t));\r\n\r\n\t\t\t// Save wholesale prices\r\n\t\t\tadd_action( 'woocommerce_process_product_meta', array(\r\n\t\t\t\t&$this,\r\n\t\t\t\t'process_product_simple_wholesale_price'\r\n\t\t\t));\r\n\r\n\t\t\t// Add international and wholesale prices to products\r\n\t\t\tadd_action( 'woocommerce_product_options_general_product_data', array(\r\n\t\t\t\t&$this,\r\n\t\t\t\t'product_options_countries_prices'\r\n\t\t\t) );\r\n\r\n\t\t\tadd_action( 'woocommerce_process_product_meta_simple', array(\r\n\t\t\t\t&$this,\r\n\t\t\t\t'process_product_simple_countries_prices'\r\n\t\t\t) );\r\n\r\n\t\t\tif ( WC()->version < '2.3' ) {\r\n\t\t\t\t//Deprecated\r\n\t\t\t\tadd_action( 'woocommerce_product_after_variable_attributes', array(\r\n\t\t\t\t\t&$this,\r\n\t\t\t\t\t'product_variable_attributes_countries_prices_wc2_2'\r\n\t\t\t\t), 10, 3 );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tadd_action( 'woocommerce_product_after_variable_attributes', array(\r\n\t\t\t\t\t&$this,\r\n\t\t\t\t\t'product_variable_attributes_countries_prices'\r\n\t\t\t\t), 10, 3 );\r\n\t\t\t}\r\n\r\n\r\n\t\t\tadd_action( 'woocommerce_process_product_meta_variable', array(\r\n\t\t\t\t&$this,\r\n\t\t\t\t'process_product_variable_countries_prices'\r\n\t\t\t) );\r\n\r\n\t\t\tadd_action( 'woocommerce_save_product_variation', array(\r\n\t\t\t\t&$this,\r\n\t\t\t\t'save_product_variation_countries_prices'\r\n\t\t\t), 10, 2 );\r\n\r\n\t\t\tadd_filter( 'woocommerce_currency', array( &$this, 'order_currency' ) );\r\n\r\n\t\t\tadd_action( 'admin_notices', array( &$this, 'check_database_file' ) );\r\n\r\n\t\t}", "public function getGlobalCurrencyCode();", "function initSpCost(){\r\n\t$SP_Cost = 0;\r\n}", "public function set_manual_currency($currency_data = FALSE)\r\n\t{\r\n\t\tif (is_array($currency_data) && ! empty($currency_data))\r\n\t\t{\r\n\t\t\t// Loop through data and set to cart session summary \r\n\t\t\tforeach($currency_data as $column => $column_value)\r\n\t\t\t{\r\n\t\t\t\tif ($column == 'exchange_rate')\r\n\t\t\t\t{\r\n\t\t\t\t\t// Check currency is a postive number\r\n\t\t\t\t\t$this->flexi->cart_contents['settings']['currency']['exchange_rate'] = ($column_value >= 0) ? \r\n\t\t\t\t\t\t$this->format_calculation($column_value, 2, TRUE) : 0;\r\n\t\t\t\t}\r\n\t\t\t\telse if (isset($this->flexi->cart_contents['settings']['currency'][$column]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->flexi->cart_contents['settings']['currency'][$column] = $column_value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}", "public function start() {\n\t\tif ( $this->in_progress() ) {\n\t\t\t$this->cancel( false );\n\t\t}\n\n\t\t$license = trim( get_option( 'ratesync_license_key' ) );\n\n\t\tif ( empty( $license ) ) {\n\t\t\t$this->add_error( __( 'A valid license key is required.', 'wc-ratesync' ) );\n\t\t}\n\n\t\tupdate_option( 'ratesync_sync_status', 'in_progress' );\n\t\tupdate_option( 'ratesync_last_sync', time() );\n\t\tupdate_option( 'ratesync_sync_queue', wc_rs_get_tax_states() );\n\t\t\n\t\t$this->trigger_import();\n\t}", "private function local_rate($currency)\n {\n switch ($currency) {\n case \"gbp\":\n $this->exchange_rate = 1;\n break;\n case \"usd\":\n $this->exchange_rate = 1.3;\n break;\n case \"eur\":\n $this->exchange_rate = 1.1;\n break;\n }\n }", "public function init()\n\t{\n\t\t$this->init_form_fields();\n \n\t\t// Load the settings.\n\t\t// http://wcdocs.woothemes.com/codex/extending/settings-api/#section-4\n\t\t$this->init_settings();\n\n\t\t// Define user set variables\n\t\t$this->enabled\t\t = $this->settings['enabled'];\n\t\t$this->title \t\t = $this->settings['title'];\n\t\t$this->availability = $this->settings['availability'];\n\t\t$this->countries \t = $this->settings['countries'];\n\t\t\n\t\t$this->jne_settings = get_option( $this->jne_shipping_rate_option );\n\t}", "public function __construct() {\n\t\t\t$this->id = 'cointopay';\n\t\t\t$this->icon = plugins_url('images/crypto.png', __FILE__);\n\n\t\t\t$this->init_form_fields();\n\t\t\t$this->init_settings();\n\n\t\t\t$this->title = $this->get_option('title');\n\t\t\t$this->description = $this->get_option('description');\n\t\t\t$this->altcoinid = 666;\n\t\t\t$this->merchantid = $this->get_option('merchantid');\n\n\t\t\t$this->apikey = '1';\n\t\t\t$this->secret = $this->get_option('secret');\n\t\t\t$this->msg['message'] = '';\n\t\t\t$this->msg['class'] = '';\n\n\t\t\tadd_action('init', array(&$this, 'check_cointopay_response'));\n\t\t\tadd_action('woocommerce_update_options_payment_gateways_' . $this->id, array(&$this, 'process_admin_options'));\n\t\t\tadd_action('woocommerce_api_' . strtolower(get_class($this)), array( &$this, 'check_cointopay_response' ));\n\t\t\tadd_action('wp_enqueue_scripts', array(&$this, 'Cointopay_Crypto_Gateway_admin_js' ));\n\t\t\n\t\t\t\n\t\t\tadd_action('woocommerce_after_order_notes', array(&$this, 'cointopay_crypto_select_checkout_field' ));\n\t\t\tadd_action('woocommerce_checkout_process', array(&$this, 'cointopay_crypto_process_custom_payment' ));\n\t\t\tadd_action( 'woocommerce_after_order_notes', array(&$this, 'cointopay_crypto_checkout_hidden_field' ), 10, 1 );\n\t\t\tadd_action('woocommerce_checkout_update_order_meta', array(&$this, 'cointopay_crypto_select_checkout_update_order_meta' ));\n\n\t\t\t// Valid for use.\n\t\t\tif (empty($this->settings['enabled']) === false && empty($this->apikey) === false && empty($this->secret) === false) {\n\t\t\t\t$this->enabled = 'yes';\n\t\t\t} else {\n\t\t\t\t$this->enabled = 'no';\n\t\t\t}\n\n\t\t\t// Checking if apikey is not empty.\n\t\t\tif (empty($this->apikey) === true) {\n\t\t\t\tadd_action('admin_notices', array( &$this, 'apikey_missingmessage' ));\n\t\t\t}\n\n\t\t\t// Checking if app_secret is not empty.\n\t\t\tif (empty($this->secret) === true) {\n\t\t\t\tadd_action('admin_notices', array( &$this, 'secret_missingmessage' ));\n\t\t\t}\n\n\t\t}", "public function run()\n {\n $currency = New Currency();\n $currency->name = 'Euro';\n $currency->code = 'euro';\n $currency->save();\n\n $currency = New Currency();\n $currency->name = 'Dollar';\n $currency->code = 'dollar';\n $currency->save();\n\n $currency = New Currency();\n $currency->name = 'Dinar';\n $currency->code = 'dinar';\n $currency->save();\n }", "public static function start()\n {\n self::registerDefault();\n\n $page = rex_request('page', 'string');\n $subpage = rex_request('subpage', 'string');\n $function = rex_request('function', 'string');\n\n if ($page === 'import_export' && $subpage === 'import' && $function === 'dbimport') {\n rex_register_extension('A1_AFTER_DB_IMPORT', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } elseif ($page === 'developer' && $function === 'update') {\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } else {\n self::synchronize(self::START_EARLY);\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(rex_developer_manager::START_LATE);\n });\n }\n }", "public function activate() {\r\n\r\n $this->checkPHPVersion();\r\n $this->checkCoinsDir();\r\n\r\n $this->addOptions();\r\n $this->createOrdersTable();\r\n\r\n API::downloadCoinsIcons();\r\n\r\n CryptoExchange::addRewriteRule();\r\n flush_rewrite_rules();\r\n\r\n }", "function dl_cadi_settings(){\r\n\r\n}", "public function editPriceMoney(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "protected function setInitCurrencyFormatter(){\n # $fmt = new NumberFormatter('en_US', NumberFormatter::CURRENCY);\n $fmt = new NumberFormatter('en_US', NumberFormatter::DECIMAL );\n $fmt->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS ,2 );\n # $fmt->setAttribute(NumberFormatter::MAX_SIGNIFICANT_DIGITS ,25 );\n #$fmt->setAttribute(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL ,'.');\n $fmt->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS,100); #// by default some locales got max 2 fraction digits, so if there are more digi fractions these will be dropped\n $this->currencyFormatter=$fmt;\n }", "public function setCurrency($currency);", "function currency_symbol() {\n\t\treturn DEFAULT_CURRENCY;\n\t}", "function calculateCurrency($prijs, $country)\r\n {\r\n }", "function init () {\n // Register the admin screen.\n add_action( 'admin_menu', array( &$this, 'register_admin_screen' ), 20 );\n \n $shortname = 'colabs';\n $options_gateways = array(); \n $currencies = colabs_get_currencies();\n foreach ($currencies as $key => $currency):\n $options_currency[$key] = $currency['name'].' ('.$currency['symbol'].')'; \n endforeach;\n $currency_symbol = colabs_get_currency_symbol(get_option('colabs_currency_code'));\n $options_gateways[] = array( \n \"name\" => __( 'Payments General', 'colabsthemes' ),\n \"icon\" => \"general\",\n \"type\" => \"heading\"); \n\n $options_gateways[] = array( \n \"name\" => __( 'Currency', 'colabsthemes' ),\n \"desc\" => sprintf( __(\"This is the currency you want to collect payments in. It applies mainly to PayPal payments since other payment gateways accept more currencies. If your currency is not listed then PayPal currently does not support it. See the list of supported <a target='_new' href='%s'>PayPal currencies</a>.\", 'colabsthemes'), 'https://www.paypal.com/cgi-bin/webscr?cmd=p/sell/mc/mc_intro-outside' ),\n \"id\" => $shortname.\"_currency_code\",\n \"options\" => $options_currency,\n \"type\" => \"select2\"); \n \n $options_gateways[] = array( \n \"name\" => __( \"Symbol Position\", \"colabsthemes\" ),\n \"desc\" => __( \"Some currencies place the symbol on the right side vs the left. Select how you would like your currency symbol to be displayed.\", \"colabsthemes\" ),\n \"id\" => $shortname.\"_currency_position\",\n \"std\" => \"left\",\n \"type\" => \"select2\",\n \"options\" => array( 'left' => sprintf(__('Left of Currency (%s100)', 'colabsthemes'),$currency_symbol),\n 'left_space' => sprintf(__('Left of Currency with Space (%s 100)', 'colabsthemes'),$currency_symbol),\n 'right' => sprintf(__('Right of Currency (100%s)', 'colabsthemes'),$currency_symbol),\n 'right_space' => sprintf(__('Right of Currency with Space (100 %s)', 'colabsthemes'),$currency_symbol)\n ) ); \n \n $this->default_options_gateways = $options_gateways;\n }", "function init() {\r\n\t\t$this->instance_form_fields = include( 'settings/settings-custom-shipping.php' );\r\n\t\t$this->title = $this->get_option( 'title' );\r\n\t\t$this->express_title\t\t\t\t\t\t=\t$this->get_option( 'express_title' );\r\n\t\t$this->conditional_cost\t\t\t\t\t= $this->get_option( 'conditional_cost' );\r\n\t\t$this->express_delivery_status\t= $this->get_option( 'express_delivery_status' );\r\n\t\t$this->express_delivery_price\t\t= $this->get_option( 'express_delivery_price' );\r\n\r\n\t\t$weight_steps_arr = explode( ', ', $this->weight_steps );\r\n\r\n\t\tforeach ( $weight_steps_arr as $weight_step ) {\r\n\t\t\t$this->{'price_below_'.\"{$weight_step}\".'_kg'} = $this->get_option( 'price_below_'.$weight_step.'_kg', 0 );\r\n\r\n\t\t\t$this->weight_based_cost[$weight_step] = $this->get_option( 'price_below_'.$weight_step.'_kg', 0 );\r\n\t\t}\r\n\t}", "public function admin_country_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n\t\t\t\tif ($this->lang->line('admin_settings_currency_setting') != '') \n\t\t $this->data['heading']= stripslashes($this->lang->line('admin_settings_currency_setting')); \n\t\t else $this->data['heading'] = 'Currency Settings';\n $this->load->view(ADMIN_ENC_URL.'/adminsettings/country_settings', $this->data);\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }", "public static function activate() {\n\t\tself::check_for_premium_settings();\n\t}", "public function start()\n\t{\n\t\t// reset first, will start automaticly after a full reset\n\t\t$this->data->directSet(\"resetNeeded\", 1);\n\t}", "function set_values() {\n\t\tparent::set_values();\n\t\t$currency = new currency($this->_currency_id);\n\t\t\n\t\t$this->order_id->value = $this->_order_id;\n\t\t$this->timestamp->value = date(\"j M Y\");\n\t\t$this->total_amount->value = $currency->format_money($this->_total_amount);\n\t}", "public function __construct() {\n\t\t\t\t\t$this->id = 'lalamove_rate_reg'; // Id for your shipping method. Should be uunique.\n\t\t\t\t\t$this->method_title = __( 'Shipping Price' ); // Title shown in admin\n\t\t\t\t\t$this->method_description = __( 'Price base on shipping adress and weight delivery via motorcycle.' ); // Description shown in admin\n \n\t\t\t\t\t$this->enabled = \"yes\"; // This can be added as an setting but for this example its forced enabled\n\t\t\t\t\t$this->title = \"LALAMOVE Rate\"; // This can be added as an setting but for this example its forced.\n \n\t\t\t\t\t$this->init();\n\t\t\t\t}", "public function charges_setting()\r\n\t{\r\n\t\t$data['charges'] = $this->My_model->get_all_charges(); \r\n\t\t$this->header();\r\n\t\t$this->load->view('pages/charges_setting',$data);\r\n\t\t$this->footer();\r\n\t}", "function uds_pricing_init()\n{\n\tglobal $uds_errors;\n\t// Basic init\n\t$dir = UDS_PRICING_URL;\n\tif(is_admin()) {\n\t\t$error = uds_pricing_process_products();\n\t\tif(is_wp_error($error)) {\n\t\t\t$uds_errors[] = $error;\n\t\t}\n\t\t\n\t\t$error = uds_pricing_process();\n\t\tif(is_wp_error($error)) {\n\t\t\t$uds_errors[] = $error;\n\t\t}\n\t}\n}", "public function setPrice()\n {\n $price = $this->price;\n $outFix = $this->outFix;\n $outPer = $this->outPer;\n $inPer = $this->inPer;\n $inFix = $this->inFix;\n $flag = $this->flagInOut;\n if ($price < 1) {\n $sumIn = $outFix > 0 ? 1 + $outFix : 1; //outFix\n $sumIn = $outPer > 0 ? $sumIn + ($sumIn * $outPer / 100) : $sumIn; //outPer\n $sumIn = $sumIn / $price; // price\n $sumIn = $inFix > 0 ? $sumIn + $inFix : $sumIn;// inFix\n $ss = $sumIn * $inPer / 100;\n $sumIn = $inPer > 0 ? $sumIn + $ss : $sumIn;\n $this->in = $this->format_amount($sumIn);\n $this->out = $flag ? 1 : 0;\n } else {\n $val = $inFix > 0 ? 1 - $inFix : 1;\n $val = $inPer > 0 ? $val - $val * ($inPer / 100) : $val;\n $sumOut = $price * $val;\n $sumOut = $outFix > 0 ? $sumOut - $outFix : $sumOut;\n $sumOut = $outPer > 0 ? $sumOut - $outPer / 100 * $sumOut : $sumOut;\n $this->out = $this->format_amount($sumOut);\n $this->in = $flag ? 1 : 0;\n }\n $this->price = (float)$price;\n }", "function cosmetro_top_currency_switcher( $format = '%s' ) {\n\n\t$is_enabled = get_theme_mod( 'top_currency_switcher', cosmetro_theme()->customizer->get_default( 'top_currency_switcher' ) );\n\n\tif ( ! $is_enabled ) {\n\t\treturn;\n\t}\n\n\tprintf( $format, cosmetro_currency_switcher() );\n\n}", "public function run() {\n $currencies = [\n [\"code\" => \"PHP\", \"name\" => \"Philippine Peso\"],\n [\"code\" => \"USD\", \"name\" => \"US Dollar\"],\n [\"code\" => \"JPY\", \"name\" => \"Japanese Yen\"],\n [\"code\" => \"KRW\", \"name\" => \"Korean Won\"],\n ];\n\n Currency::insert($currencies);\n }", "public function setBaseCurrency(SetBaseCurrencyRequest $request)\n {\n $message = $this->exchange_service->updateUserBaseCurrency(\n auth()->user(),\n $request->base_currency\n )->message;\n return Responser::send(200, [], $message);\n }", "public function __construct()\n {\n //acme-converter is our root configuration key under which all settings reside\n $commandPrefix = config('acme-converter.command_prefix');\n\n $this->signature = \"{$commandPrefix}converter:convert {currency}\";\n\n parent::__construct();\n }", "public function settingLocale() {}", "function currSetCurrentCurrency($currencyID)\r\n{\r\n $_SESSION[\"current_currency\"] = (int)$currencyID;\r\n\r\n if (isset($_SESSION[\"log\"])) {\r\n db_query(\"UPDATE \" . CUSTOMERS_TABLE . \" SET CID=\" . (int)$currencyID .\r\n \" WHERE Login='\" . xEscSQL($_SESSION[\"log\"]) . \"'\");\r\n }\r\n}", "public static function init()\n {\n $smarty = cmsms()->GetSmarty();\n $smarty->register_function('cgecomm_currency_code',array('cgecomm_smarty','cgecomm_currency_code'));\n $smarty->register_function('cgecomm_currency_symbol',array('cgecomm_smarty','cgecomm_currency_symbol'));\n $smarty->register_function('cgecomm_weight_units',array('cgecomm_smarty','cgecomm_weight_units'));\n $smarty->register_function('cgecomm_length_units',array('cgecomm_smarty','cgecomm_length_units'));\n $smarty->register_function('cgecomm_company_address',array('cgecomm_smarty','cgecomm_company_address'));\n $smarty->register_function('cgecomm_cartitem_exists',array('cgecomm_smarty','cgecomm_cartitem_exists'));\n $smarty->register_function('cgecomm_form_addtocart',array('cgecomm_smarty','cgecomm_form_addtocart'));\n $smarty->register_function('cgecomm_erasecart',array('cgecomm_smarty','cgecomm_erasecart'));\n $smarty->register_function('cgecomm_get_productinfo',array('cgecomm_smarty','cgecomm_get_productinfo'));\n }", "public function run()\n {\n\n $service = new SettingService;\n\n /*基础卡券配置************************************************************************************/\n\n //卡券基础\n $service->set('TICKET', [\n 'logo_url' => 'https://mp.weixin.qq.com/misc/getheadimg?token=1634606114&fakeid=3090887998&r=449871',\n 'brand_name' => 'Cafe Alayna',\n 'service_phone' => '4007170808',\n 'custom_url_name' => '会员中心',\n 'custom_url_sub_title' => '精彩不断',\n 'sub_title' => \"无限制\",\n 'notice' => \"消费时请出示该优惠券\",\n 'description' => \"请与会员卡配合使用\"\n ]);\n\n //会员卡\n $service->set('CARD', [\n //微信标准\n 'card_id' => 'pHVpWuD0HlSwrn8yry_4AcRVO4Fs',\n 'logo' => '/logo/jintai.png',\n 'title' => '金 泰 生 物',\n 'sub_title' => '探究生命奥秘 造福人类健康',\n 'color' => 'Color040',\n 'notice' => '请向店员出示会员卡',\n 'description' => '详见会员中心相关说明',\n 'bonus_cleared' => '积分不清零',\n 'bonus_rules' => '每消费1元获取1点积分',\n 'prerogative' => '持会员卡消费,可获1:1积分,会员储值更有满额赠送。',\n 'levels' => [\n ['id' => 1,'order' => 1,'name' => \"银牌\",'description' => '....'],\n ['id' => 2,'order' => 2,'name' => \"金牌\",'description' => '....'],\n ['id' => 3,'order' => 4,'name' => \"白金\",'description' => '....'],\n ['id' => 4,'order' => 3,'name' => \"年费\",'description' => '....'],\n ],\n\n ]);\n \n \n\n /*模版消息配置*************************************************************************************/\n\n $service->set('TEMPLATE_MESSAGES', [\n 'CARD_CREATE' => [\n 'label' => '新卡创建',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'Ff7Bz4uF8P11QiVwRcBh-tVOW6yCklceFwckgE_guwY',\n 'data_format' => [\n 'first' => '欢迎加入会员中心!',\n 'keyword1' => '[card.card_code]',\n 'keyword2' => '{date(\"Y-m-d H:i\")}',\n 'remark' => '感谢您的光临。',\n ]\n ],\n ],\n\n 'CONSUME' => [\n 'label' => '消费提醒',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'kMLqpQsyXv6lzuJfJd3vTdvyu-D9Uo-u9PJeE6pKApU',\n 'data_format' => [\n 'first' => '尊敬的会员,您刚进行了一笔消费!赠送您[order.bonus_present]积分',\n 'keyword1' =>'{date(\"Y-m-d H:i\")}',\n 'keyword2' => '[order.money_pay_amount]元',\n 'keyword3' => '金泰生物',\n 'remark' => '感谢您的光临',\n ]\n ],\n ],\n 'BALANCE' => [\n 'label' => '储值提醒',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => '_Vi2I7KdlMZ4IeO5fxOrZQQDVaj__3euv_ifVj4ju0Y',\n 'data_format' => [\n 'first' => '尊敬的会员,恭喜您充值成功!',\n 'keyword1' => '[order.balance_fee]元',\n 'keyword2' => '[order.balance_present]元,[order.bonus_present]积分',\n 'keyword3' => '金泰生物',\n 'keyword4' => '[card.balance]元',\n 'remark' => '如有疑问,敬请咨询',\n ]\n ],\n ],\n\n 'GOODS' => [\n 'label' => '新订单提醒',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'CbXupOXMeiCM8jUdda5Lil96FCryDm1krLyowp9OefU',\n 'data_format' => [\n 'first' => '尊敬的会员,您刚完成一笔订单!',\n 'keyword1' => '[title]',\n 'keyword2' => '[order.money_pay_amount]元。',\n 'keyword3' => '[card.nickname]',\n 'keyword4' => '',\n 'keyword5' =>'',\n 'remark' => '支付方式:[paymentStr],感谢您的光临',\n ]\n ],\n ],\n\n 'TICKET_VERIFIED' => [\n 'label' => '核销通知',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'WNfNYaFZtQj_7N3Oq1nzuIoxCWKPXt2SR0XpKVJdlIA',\n 'data_format' => [\n 'first' => '尊敬的会员,您刚核销了优惠券!',\n 'keyword1' => '[ticket.ticket_code]',\n 'keyword2' => '[ticket.tickettemplate.title]',\n 'keyword3' =>'',\n 'remark' => '如有疑问,请咨询商家客服',\n ]\n ],\n ],\n\n 'USE_PROPERTY' => [\n 'label' => '服务体验',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'fluWd9dEQSbpuus0wTHdTqqit42ByB-6Vb5ZspNIdQQ',\n 'data_format' => [\n 'first' => '尊敬的会员,您刚体验了一项服务',\n 'keyword1' => '金泰生物',\n 'keyword2' => '[property.property_template.title]',\n 'keyword3' => '{date(\"Y-m-d H:i\")}',\n 'remark' => '感谢您的惠顾',\n ]\n ],\n ],\n\n 'CODE_REDEEMED' => [\n 'label' => '兑换码',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'bg9iMWmh9dbS1ToCa_TZeIaaf-JPhzDco81mihPGwoM',\n 'data_format' => [\n 'first' => '尊敬的会员,您使用[code]兑换码!',\n 'keyword1' =>'[message]',\n 'keyword2' =>'{date(\"Y-m-d H:i\")}',\n 'remark' => '感谢您的光临',\n ]\n ],\n ],\n 'PROFILE_FILLED'=>[\n 'label' => '会员卡资料变更通知',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => '-yPw5qTAfgEae50udizbCVYYOVGzgO3Osn2Fz7IYUdk',\n 'data_format' => [\n 'first' => '尊敬的会员,您的资料变更成功',\n 'keyword1' => '{date(\"Y-m-d H:i\")}',\n 'keyword2' => '金泰生物',\n 'keyword3' => '[content]',\n 'remark' => '如非本人操作,请联系商家客服,感谢您的光临',\n ]\n ],\n ],\n 'REFERRER_BOUND'=>[//待完成\n 'label' => '推荐人绑定',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[experiment.name]',\n 'balance' => '[experiment.progress]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'h8KeFqj6Sq9EBx9SVytFwKQPnT2z3DuLus50v-P_E40',\n 'data_format' => [\n 'first' => '您好,【[card.nickname]】已被您推荐为会员',\n 'keyword1' =>'[card.nickname]',\n 'keyword2' => '{date(\"Y-m-d H:i\")}',\n 'remark' => '推荐关注奖励已打入您的会员账户,感谢您的推荐',\n ]\n ],\n ],\n \n 'PROGRESS_CHANGED'=>[//待完成\n 'label' => '项目进度提醒',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[name]',\n 'balance' => '[progress]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'cJq3nEfqsR-cF74de6lMogJLFj0I_RgMRBXIPpPCfb4',\n 'data_format' => [\n 'first' => '尊敬的会员,您的检测状态发生了变化',\n 'keyword1' =>'[name]',\n 'keyword2' => '[progress]',\n 'keyword3' => '【[progress]】完成',\n 'keyword4' =>'{date(\"Y-m-d H:i\")}',\n 'remark' => '请注意跟进,谢谢',\n ]\n ],\n ],\n \n \n 'GiveBalance'=>[\n 'label' => '账户余额变更通知',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => '9yGZ6d-z0lzD35BQrPEExAPLuvtqJciybISb167cA08',\n 'data_format' => [\n 'first' => '尊敬的会员,您的账户因为[reason]发生了余额变化',\n 'keyword1' =>'{date(\"Y-m-d H:i\")}',\n 'keyword2' => '[args]元',\n 'keyword3' => '',\n 'keyword4' => '[card.balance]',\n 'remark' => '感谢您的光临',\n ]\n ],\n ],\n 'GIVE_BONUS'=>[\n 'label' => '积分变更通知',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => '_LfsmtinCu1oJ9i6UmdhCx4KvywHayIFYqPhAB3PSJI',\n 'data_format' => [\n 'first' => '尊敬的会员,赠送您[args]积分。',\n 'keyword1' => '[card.nickname]',\n 'keyword2' =>'{date(\"Y-m-d H:i\")}',\n 'keyword3' =>'[args]',\n 'keyword4' =>'[card.bonus]',\n 'keyword5' =>'[reason]',\n 'remark' => '感谢您的光临',\n ]\n ],\n ],\n 'GIVE_GIFT'=>[\n 'label' => '礼品赠送成功提醒',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => 'bg9iMWmh9dbS1ToCa_TZeIaaf-JPhzDco81mihPGwoM',\n 'data_format' => [\n 'first' => '尊敬的会员,因为您达到[reason]条件,特赠送您大礼包一个。',\n 'keyword1' =>'[message]',\n 'keyword2' =>'{date(\"Y-m-d H:i\")}',\n 'remark' => '感谢您的光临',\n ]\n ],\n ],\n 'LEVEL_UP'=>[\n 'label' => '等级提升通知',\n 'sms' => [\n 'active' => true,\n 'sms_template_code' => 'SMS_2940044',\n 'sms_param' => [\n 'shop_name' => '[sms.shopname]',\n 'balance' => '[balance]',\n ]\n ],\n 'wechat' => [\n 'active' => true,\n 'template_id' => '16Z82dpEZH6-HMFXZX4PWxt-tWIamZ3PP46fW9zO0Jg',\n 'data_format' => [\n 'first' => '尊敬的会员,您已成功升级为[card.level]级会员。',\n 'keyword1' => '[detail]',\n 'keyword2' => '{date(\"Y-m-d H:i\")}',\n 'remark' => '感谢您的光临',\n ]\n ],\n ],\n\n\n\n ]);\n\n \n\t}", "public static function set_currency($currency) {\n\t\tself::$currency = $currency;\n\t}", "function ul_cadi_settings(){\r\n\r\n}", "abstract function update_markup_currency(& $price_summary, & $currency_obj);", "public function initModuleCode() {\n $this->module_code = 'wk_pricealert';\n }", "function ncurses_baudrate()\n{\n}", "public function run()\n {\n Currency::create([\n 'value' => 'usd',\n 'code' => 'USD',\n 'title' => 'US Dollar'\n ]);\n Currency::create([\n 'value' => 'eur',\n 'code' => 'EUR',\n 'title' => 'Euro'\n ]);\n Currency::create([\n 'value' => 'gbp',\n 'code' => 'GBP',\n 'title' => 'Pound sterling'\n ]);\n }", "function CallOrder()\n {\n global $USER, $CONF, $UNI;\n\n $this->amount = str_replace(\".\",\"\",HTTP::_GP('amount',0));\n $this->amountbis = HTTP::_GP('amount',0);\n\t\t\t\t\n\t\t\t\tif($this->amount < 10000){\n\t\t\t\t$this->printMessage('You have to buy minimum 10.000 AM!', true, array('game.php?page=donate', 3)); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif($this->amount >= 10000 && $this->amount < 20000)\t\t$this->amount *= 1.05;\n\t\t\t\telseif($this->amount >= 20000 && $this->amount < 50000) $this->amount *= 1.10;\n\t\t\t\telseif($this->amount >= 50000 && $this->amount < 100000) $this->amount *= 1.20;\n\t\t\t\telseif($this->amount >= 100000 && $this->amount < 150000) $this->amount *= 1.30;\n\t\t\t\telseif($this->amount >= 150000 && $this->amount < 200000) $this->amount *= 1.40;\n\t\t\t\telseif($this->amount >= 200000) $this->amount *= 1.50;\n\t\t\t\t\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->amount = round($this->amount + ($this->amount / 100 * 0));\n\t\t\t\t$this->amount = $this->amount + ($this->amount / 100 * 0);\n\t\t\t\t$this->cost = round($this->amountbis * 0.00011071);\n \n\n \n\t\t\t\t\n\t\t\t\t$this_p = new paypal_class;\n\t\t\t\t\n \n $this_p->add_field('business', $this::MAIL);\n \n\t\t\t\t\n\t\t\t $this_p->add_field('return', 'http://'.$_SERVER['HTTP_HOST'].'/game.php?page=overview');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this_p->add_field('cancel_return', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n $this_p->add_field('notify_url', 'http://'.$_SERVER['HTTP_HOST'].'/ipns.php');\n\t\t\t\t\n $this_p->add_field('item_name', $this->amount.' AM-User('.$USER['username'].').');\n $this_p->add_field('item_number', $this->amount.'_AM');\n $this_p->add_field('amount', $this->cost);\n //$this_p->add_field('action', $action); ?\n $this_p->add_field('currency_code', 'EUR');\n $this_p->add_field('custom', $USER['id']);\n $this_p->add_field('rm', '2');\n //$this_p->dump_fields(); \n\t\t\t\t foreach ($this_p->fields as $name => $value) {\n\t\t\t\t\t$field[] = array('text'=>'<input type=\"hidden\" name=\"'.$name.'\" value=\"'.$value.'\">');\n\t\t\t\t}\n\t\t\t $this->tplObj->assign_vars(array(\n\t\t\t\t'fields' => $field,\n\t\t\t ));\n\t\t\t$this->display('paypal_class.tpl');\n }", "function coppa_start()\n\t{\n\t\t$coppa_date = date( 'j-F y', mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")-13) );\n\t\t\n\t\t$this->ipsclass->lang['coppa_form_text'] = str_replace( \"<#FORM_LINK#>\", \"<a href='{$this->ipsclass->base_url}act=Reg&amp;CODE=12'>{$this->ipsclass->lang['coppa_link_form']}</a>\", $this->ipsclass->lang['coppa_form_text']);\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_register']->coppa_start($coppa_date);\n\t\t\n\t\t$this->page_title = $this->ipsclass->lang['coppa_title'];\n\t\t\n \t$this->nav = array( $this->ipsclass->lang['coppa_title'] );\n \t}", "private function __getCurrency()\n\t{\n\t\tif($this->currency == null)\n\t\t$this->currency = 1;\n\t\treturn $this->currency;\n\t}", "public function settings_init() {\n\n register_setting( 'settcalc', 'settcalc_options' );\n\n add_settings_section(\n 'settcalc_section_developers',\n __( 'Getting Started:', 'settcalc' ),\n array($this,'section_developers_cb'),\n 'settcalc'\n );\n\n add_settings_field(\n 'settcalc_field_phonelabel',\n __( 'Phone Number Label', 'settcalc' ),\n array($this,'field_phonelabel_cb'),\n 'settcalc',\n 'settcalc_section_developers',\n [\n 'label_for' => 'settcalc_field_phonelabel',\n 'class' => 'settcalc_row',\n 'settcalc_custom_data' => 'custom',\n ]\n );\n\n add_settings_field(\n 'settcalc_field_phonenumber',\n __( 'Phone Number', 'settcalc' ),\n array($this,'field_phonenumber_cb'),\n 'settcalc',\n 'settcalc_section_developers',\n [\n 'label_for' => 'settcalc_field_phonenumber',\n 'class' => 'settcalc_row',\n 'settcalc_custom_data' => 'custom',\n ]\n );\n\n\n\n add_settings_field(\n 'settcalc_field_contact',\n __( 'Contact Page Link', 'settcalc' ),\n array($this,'field_contact_cb'),\n 'settcalc',\n 'settcalc_section_developers',\n [\n 'label_for' => 'settcalc_field_contact',\n 'class' => 'settcalc_row',\n 'settcalc_custom_data' => 'custom',\n ]\n );\n\n\n\n }", "public function run()\n {\n /** @var array $currencies */\n $currencies = config('defaults.currencies');\n\n array_map(function ($currency) {\n Currency::create([\n 'name' => $currency['name'],\n 'description' => $currency['description'],\n ]);\n }, $currencies);\n }", "public function startPowerUnits() {\n\t\t\n\t}", "public function defaultHomeCurrency()\n {\n Validator::extend('default_home_currency', function ($attribute, $value, $parameters, $validator) {\n $request = app(\\Illuminate\\Http\\Request::class);\n $homeCurrency = Settings::where(['name'=>'default_currency'])->first();\n if ($homeCurrency->value==Request()->segment(4) && $request->status=='Inactive') {\n return false;\n } else {\n return true;\n }\n });\n }", "public function gatewayAction()\n {\n $user = $this->getUser();\n $amountdue = $this->getAmount();\n\n if ($user !== null && $amountdue > 0.15) {\n $limited_currencies = array('USD','ISK','HKD','TWD','CHF','EUR','DKK','CLP','CAD','CNY','THB','AUD','SGD','KRW','JPY','PLN','GBP','SEK','NZD','BRL','RUB');\n $currency_iso_code = $this->getCurrencyShortName();\n if (!in_array($currency_iso_code, $limited_currencies)) {\n $this->redirect(array('controller' => 'checkout'));\n } else {\n /** https://cex.io/api/last_price/BCH/EUR **/\n //$value_in_BCH = file_get_contents(\"https://blockchain.info/tobch?currency=\".$currency_iso_code.\"&value=\".$amountdue.\"\");\n $json = file_get_contents('https://cex.io/api/last_price/BCH/EUR');\n $json = json_decode($json, true);\n\n $value_in_BCH = 1/($json['lprice'] / $amountdue);\n\n if ($value_in_BCH > 0) {\n /** @var TYPE_NAME $zw_extended_public_key */\n $zw_extended_public_key = Shopware()->Config()->getByNamespace('ZwWebPaymentBitcoinCash', 'zw_extended_public_key');\n $zw_blockchain_api_key = Shopware()->Config()->getByNamespace('ZwWebPaymentBitcoinCash', 'zw_blockchain_api_key');\n $zw_callback_secret = Shopware()->Config()->getByNamespace('ZwWebPaymentBitcoinCash', 'zw_callback_secret');\n\n $config_secret = trim($zw_callback_secret);\n $secret = strtoupper(md5($config_secret.'-'.$this->session->sUserId));\n\n $url = Shopware()->Router()->assemble(array('action' => 'notify', 'controller' => 'PaymentBitcoinCash', 'module' => 'frontend', 'secret' => $secret, 'forceSecure' => true));\n $callback_url = htmlspecialchars($url);\n\n $xpub = trim($zw_extended_public_key);\n $api_key = trim($zw_blockchain_api_key);\n $blockchain_url = 'https://api.blockchain.info/v2/receive?xpub='.$xpub.'&callback='.urlencode($callback_url).'&key='.$api_key.'';\n //$blockchain_url = 'https://api.blockchain.info/v2/receive?xpub='.$xpub.'&callback='.urlencode($callback_url).'&gap_limit=99&key='.$api_key.'';\n\n $address = false;\n $message = false;\n $description = false;\n $try = 0;\n\n $context = stream_context_create(array('http' => array('ignore_errors' => true)));\n\n while ($try < 2) {\n $response = file_get_contents($blockchain_url, false, $context);\n $object = json_decode($response);\n if (!empty($object->{'address'})) {\n $address = $object->{'address'};\n break;\n } else {\n if (!empty($object->{'message'})) {\n $message = $object->{'message'};\n $description = $object->{'description'};\n break;\n } else {\n $try++;\n sleep(10);\n }\n }\n }\n\n if ($address) {\n $orderNumber = $this->saveOrder($address, md5($address), 17, false);\n //$orderId = Shopware()->Db()->fetchOne('SELECT `id` FROM `s_order` WHERE `ordernumber` = ?', $orderNumber);\n $order = Shopware()->Models()->getRepository('Shopware\\Models\\Order\\Order')->findOneBy(array('number' => $orderNumber));\n $orderId = $order->getId();\n $orderCurrency = $order->getCurrency();\n $invoiceAmount = $order->getInvoiceAmount();\n\n Shopware()->Db()->exec(\"INSERT INTO `zwilla_free_bitcoincash_address` \n (`id_order`,`value_in_BCH`,`address`,`status`,`crdate`) \n VALUES\n ('\".(int)$orderId.\"', '\".(double)$value_in_BCH.\"', '\".$address.\"', 'Pending', CURRENT_TIMESTAMP)\");\n\n $order->setComment('Please pay ' . $value_in_BCH . ' BCH to this address ' . $address . ' for order number ' . $orderNumber);\n\n Shopware()->Models()->flush($order);\n $this->View()->receivedAddress = 'YES';\n $this->View()->bitcoincashAddress = $address;\n $this->View()->valueInBCH = $value_in_BCH;\n $this->View()->orderNumber = $orderNumber;\n $this->View()->invoiceAmount = $invoiceAmount;\n $this->View()->orderCurrency = $orderCurrency;\n } else {\n // uncomment 3 lines below for debug\n //$logfile = fopen(dirname(__FILE__).'/error_log.txt', 'a+');\n //fwrite($logfile, $response);\n //fclose($logfile);\n Shopware()->Pluginlogger()->error('An unrecoverable error occurred: unable to obtain address, check your API key or xPub. ' . $message . ': ' . $description);\n $this->View()->receivedAddress = 'NO';\n $this->View()->message = $message;\n $this->View()->description = $description;\n }\n } else {\n $this->redirect(array('controller' => 'checkout'));\n }\n }\n } else {\n $this->redirect(array('controller' => 'checkout'));\n }\n }", "public function setCurrency($currency) {\n\t\t$this->currency = $currency;\n\t}", "public function admin_currency_calc($field) {\n\n\t\t/*$route=@Route::getCurrentRoute();\n\t\t\t if($route){\n\t\t\t $api_url = @$route->getPath();\n\t\t\t }else{\n\t\t\t $api_url = '';\n\t\t\t }\n\n\t\t\t $url_array=explode('/',$api_url);\n\t\t\t //Api currency conversion\n\t\t*/\n\t\tif (request()->segment(1) == 'api') {\n\t\t\t$user_details = JWTAuth::parseToken()->authenticate();\n\n\t\t\t$rate = Currency::whereCode($this->attributes['currency_code'])->first()->rate;\n\n\t\t\t$usd_amount = $this->attributes[$field] / $rate;\n\n\t\t\t$api_currency = $user_details->currency_code;\n\n\t\t\t$default_currency = Currency::where('default_currency', 1)->first()->code;\n\n\t\t\t$session_rate = Currency::whereCode($user_details->currency_code != null ? $user_details->currency_code : $default_currency)->first()->rate;\n\n\t\t\treturn round($usd_amount * $session_rate);\n\n\t\t} else {\n\n\t\t\t$rate = Currency::whereCode($this->attributes['currency_code'])->first()->rate;\n\n\t\t\t$usd_amount = @$this->attributes[$field] / @$rate;\n\n\t\t\t$default_currency = Currency::where('default_currency', 1)->first()->code;\n\n\t\t\t$session_rate = Currency::whereCode($default_currency)->first()->rate;\n\n\t\t\treturn round($usd_amount * $session_rate);\n\t\t}\n\n\t}", "function cg_activate() {\n\tadd_option('cg-option_3', 'any_value');\n}", "function setExpressCheckout(&$order)\n\t\t{\n\t\t\tglobal $pmpro_currency;\n\n\t\t\tif(empty($order->code))\n\t\t\t\t$order->code = $order->getRandomCode();\n\n\t\t\t//clean up a couple values\n\t\t\t$order->payment_type = \"PayPal Express\";\n\t\t\t$order->CardType = \"\";\n\t\t\t$order->cardtype = \"\";\n\n\t\t\t//taxes on initial amount\n\t\t\t$initial_payment = $order->InitialPayment;\n\t\t\t$initial_payment_tax = $order->getTaxForPrice($initial_payment);\n\t\t\t$initial_payment = pmpro_round_price((float)$initial_payment + (float)$initial_payment_tax);\n\n\t\t\t//taxes on the amount\n\t\t\t$amount = $order->PaymentAmount;\n\t\t\t$amount_tax = $order->getTaxForPrice($amount);\n\t\t\t$amount = pmpro_round_price((float)$amount + (float)$amount_tax);\n\n\t\t\t//paypal profile stuff\n\t\t\t$nvpStr = \"\";\n\t\t\t$nvpStr .=\"&AMT=\" . $initial_payment . \"&CURRENCYCODE=\" . $pmpro_currency;\n\t\t\tif(!empty($order->ProfileStartDate) && strtotime($order->ProfileStartDate, current_time(\"timestamp\")) > 0)\n\t\t\t\t$nvpStr .= \"&PROFILESTARTDATE=\" . $order->ProfileStartDate;\n\t\t\tif(!empty($order->BillingFrequency))\n\t\t\t\t$nvpStr .= \"&BILLINGPERIOD=\" . $order->BillingPeriod . \"&BILLINGFREQUENCY=\" . $order->BillingFrequency . \"&AUTOBILLOUTAMT=AddToNextBilling&L_BILLINGTYPE0=RecurringPayments\";\n\t\t\t$nvpStr .= \"&DESC=\" . urlencode( apply_filters( 'pmpro_paypal_level_description', substr($order->membership_level->name . \" at \" . get_bloginfo(\"name\"), 0, 127), $order->membership_level->name, $order, get_bloginfo(\"name\")) );\n\t\t\t$nvpStr .= \"&NOTIFYURL=\" . urlencode(admin_url('admin-ajax.php') . \"?action=ipnhandler\");\n\t\t\t$nvpStr .= \"&NOSHIPPING=1&L_BILLINGAGREEMENTDESCRIPTION0=\" . urlencode(substr($order->membership_level->name . \" at \" . get_bloginfo(\"name\"), 0, 127)) . \"&L_PAYMENTTYPE0=Any\";\n\n\t\t\t//if billing cycles are defined\n\t\t\tif(!empty($order->TotalBillingCycles))\n\t\t\t\t$nvpStr .= \"&TOTALBILLINGCYCLES=\" . $order->TotalBillingCycles;\n\n\t\t\t//if a trial period is defined\n\t\t\tif(!empty($order->TrialBillingPeriod))\n\t\t\t{\n\t\t\t\t$trial_amount = $order->TrialAmount;\n\t\t\t\t$trial_tax = $order->getTaxForPrice($trial_amount);\n\t\t\t\t$trial_amount = pmpro_round_price((float)$trial_amount + (float)$trial_tax);\n\n\t\t\t\t$nvpStr .= \"&TRIALBILLINGPERIOD=\" . $order->TrialBillingPeriod . \"&TRIALBILLINGFREQUENCY=\" . $order->TrialBillingFrequency . \"&TRIALAMT=\" . $trial_amount;\n\t\t\t}\n\t\t\tif(!empty($order->TrialBillingCycles))\n\t\t\t\t$nvpStr .= \"&TRIALTOTALBILLINGCYCLES=\" . $order->TrialBillingCycles;\n\n\t\t\tif(!empty($order->discount_code))\n\t\t\t{\n\t\t\t\t$nvpStr .= \"&ReturnUrl=\" . urlencode(pmpro_url(\"checkout\", \"?level=\" . $order->membership_level->id . \"&discount_code=\" . $order->discount_code . \"&review=\" . $order->code));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nvpStr .= \"&ReturnUrl=\" . urlencode(pmpro_url(\"checkout\", \"?level=\" . $order->membership_level->id . \"&review=\" . $order->code));\n\t\t\t}\n\n\t\t\t$additional_parameters = apply_filters(\"pmpro_paypal_express_return_url_parameters\", array());\n\t\t\tif(!empty($additional_parameters))\n\t\t\t{\n\t\t\t\tforeach($additional_parameters as $key => $value)\n\t\t\t\t\t$nvpStr .= urlencode(\"&\" . $key . \"=\" . $value);\n\t\t\t}\n\n\t\t\t$nvpStr .= \"&CANCELURL=\" . urlencode(pmpro_url(\"levels\"));\n\n\t\t\t$account_optional = apply_filters('pmpro_paypal_account_optional', true);\n \t\tif ($account_optional)\n \t\t$nvpStr .= '&SOLUTIONTYPE=Sole&LANDINGPAGE=Billing';\n\n\t\t\t$nvpStr = apply_filters(\"pmpro_set_express_checkout_nvpstr\", $nvpStr, $order);\n\n\t\t\t///echo str_replace(\"&\", \"&<br />\", $nvpStr);\n\t\t\t///exit;\n\n\t\t\t$this->httpParsedResponseAr = $this->PPHttpPost('SetExpressCheckout', $nvpStr);\n\n\t\t\tif(\"SUCCESS\" == strtoupper($this->httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($this->httpParsedResponseAr[\"ACK\"])) {\n\t\t\t\t$order->status = \"token\";\n\t\t\t\t$order->paypal_token = urldecode($this->httpParsedResponseAr['TOKEN']);\n\n\t\t\t\t//update order\n\t\t\t\t$order->saveOrder();\n\n\t\t\t\t//redirect to paypal\n\t\t\t\t$paypal_url = \"https://www.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token=\" . $this->httpParsedResponseAr['TOKEN'];\n\t\t\t\t$environment = pmpro_getOption(\"gateway_environment\");\n\t\t\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment)\n\t\t\t\t{\n\t\t\t\t\t$paypal_url = \"https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&useraction=commit&token=\" . $this->httpParsedResponseAr['TOKEN'];\n\t\t\t\t}\n\n\t\t\t\twp_redirect($paypal_url);\n\t\t\t\texit;\n\n\t\t\t\t//exit('SetExpressCheckout Completed Successfully: '.print_r($this->httpParsedResponseAr, true));\n\t\t\t} else {\n\t\t\t\t$order->status = \"error\";\n\t\t\t\t$order->errorcode = $this->httpParsedResponseAr['L_ERRORCODE0'];\n\t\t\t\t$order->error = urldecode($this->httpParsedResponseAr['L_LONGMESSAGE0']);\n\t\t\t\t$order->shorterror = urldecode($this->httpParsedResponseAr['L_SHORTMESSAGE0']);\n\t\t\t\treturn false;\n\t\t\t\t//exit('SetExpressCheckout failed: ' . print_r($httpParsedResponseAr, true));\n\t\t\t}\n\n\t\t\t//write session?\n\n\t\t\t//redirect to PayPal\n\t\t}", "public function setCurrency($currency) {\n\t\t$this->_currency = $currency;\n\t}", "public function execute()\n {\n $this->sinch->startCronStockPriceImport();\n }", "function main()\r\n {\r\n App::import('Model', 'Setting');\r\n $setting_model_obj = new Setting();\r\n $settings = $setting_model_obj->getKeyValuePairs();\r\n Configure::write($settings);\r\n\t\t// include cron component\r\n App::import('Core', 'ComponentCollection');\r\n \t$collection = new ComponentCollection();\r\n App::import('Component', 'Cron');\r\n $this->Cron = &new CronComponent($collection);\r\n $option = !empty($this->args[0]) ? $this->args[0] : '';\r\n $this->log('Cron started without any issue');\r\n if (!empty($option) && $option == 'main') {\r\n $this->Cron->main();\r\n }\r\n }", "public function getSourceCurrency();", "public function getCurrency();", "public function getCurrency();", "public function __construct()\n {\n if (7 == func_num_args()) {\n $this->baseCurrencyCode = func_get_arg(0);\n $this->baseCurrencySymbol = func_get_arg(1);\n $this->defaultDisplayCurrencyCode = func_get_arg(2);\n $this->defaultDisplayCurrencySymbol = func_get_arg(3);\n $this->availableCurrencyCodes = func_get_arg(4);\n $this->exchangeRates = func_get_arg(5);\n $this->extensionAttributes = func_get_arg(6);\n }\n }", "function eZProductCurrency( $id=-1 )\r\n {\r\n if ( $id != -1 )\r\n {\r\n $this->ID = $id;\r\n $this->get( $this->ID );\r\n }\r\n }", "public function __construct() {\n\t\t$this->id = 'coinbase';\n\t\t$this->has_fields = false;\n\t\t$this->order_button_text = __( 'Proceed to Coinbase', 'coinbase' );\n\t\t$this->method_title = __( 'Coinbase', 'coinbase' );\n\t\t$this->method_description = '<p>' .\n\t\t\t// translators: Introduction text at top of Coinbase Commerce settings page.\n\t\t\t__( 'A payment gateway that sends your customers to Coinbase Commerce to pay with cryptocurrency.', 'coinbase' )\n\t\t\t. '</p><p>' .\n\t\t\tsprintf(\n\t\t\t\t// translators: Introduction text at top of Coinbase Commerce settings page. Includes external URL.\n\t\t\t\t__( 'If you do not currently have a Coinbase Commerce account, you can set one up here: %s', 'coinbase' ),\n\t\t\t\t'<a target=\"_blank\" href=\"https://commerce.coinbase.com/\">https://commerce.coinbase.com/</a>'\n\t\t\t);\n\n\t\t// Timeout after 3 days. Default to 3 days as pending Bitcoin txns\n\t\t// are usually forgotten after 2-3 days.\n\t\t$this->timeout = ( new WC_DateTime() )->sub( new DateInterval( 'P3D' ) );\n\n\t\t// Load the settings.\n\t\t$this->init_form_fields();\n\t\t$this->init_settings();\n\n\t\t// Define user set variables.\n\t\t$this->title = $this->get_option( 'title' );\n\t\t$this->description = $this->get_option( 'description' );\n\t\t$this->debug = 'yes' === $this->get_option( 'debug', 'no' );\n\n\t\tself::$log_enabled = $this->debug;\n\n\t\tadd_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );\n\t\tadd_filter( 'woocommerce_order_data_store_cpt_get_orders_query', array( $this, '_custom_query_var' ), 10, 2 );\n\t\tadd_action( 'woocommerce_api_wc_gateway_coinbase', array( $this, 'handle_webhook' ) );\n\t}", "function admin_custom_config()\n {\n $db = DataAccess::getInstance();\n\n $options = '';\n $current_currency = $this->get('currency');\n if (!$current_currency) {\n $current_currency = 'USD';\n $this->set('currency', 'USD');//default to USD\n }\n $count = 0;\n ksort(self::$_currency);\n foreach (self::$_currency as $key => $currency) {\n $selected = ($current_currency == $key) ? ' selected=\"selected\"' : '';\n $options .= \"\n\t\t\t\t<option value='$key'$selected>$key - $currency</option>\";\n }\n\n $tpl = new geoTemplate('admin');\n $tpl->assign('payment_type', self::gateway_name);\n\n $tooltips['installation_id'] = geoHTML::showTooltip('Worldpay Installation ID', 'This the id you were given by Worldpay. This id will identify a user you submit to Worldpay to collect funds from.');\n $tooltips['callback_password'] = geoHTML::showTooltip('Worldpay Callback Password', 'This is the password that you can optionally set at Worldpay to verify that Worldpay is the one returning an authorization. You can leave this field blank and the password will not be checked on any Worldpay callback procedures.');\n $tpl->assign('tooltips', $tooltips);\n\n $tpl->assign('commonAdminOptions', $this->_showCommonAdminOptions());\n\n $values['installation_id'] = geoString::specialChars($this->get('installation_id'));\n $tpl->assign('currency_options', $options);\n $values['callback_password'] = geoString::specialChars($this->get('callback_password'));\n $tpl->assign('values', $values);\n\n\n return $tpl->fetch('payment_gateways/worldpay.tpl');\n }", "function activate() {\n\t$scheduler = new CSL_Feed_Import_Scheduler;\n\t// The first run will start run in 20 minutes.\n\t$first_run = time() + ( 20 * MINUTE_IN_SECONDS );\n\n\t// Clear Scheduler of any previous cron events to be sure.\n\t$scheduler->clear();\n\n\t// Schedule the first run.\n\t$scheduler->setup()->schedule_next( $first_run );\n}", "function set1()\n{\n global $ASP1, $ASP2, $SH, $MR, $SB;\n // show 5 options of price APP price drop with 5 rs each\n $m = intval ( $ASP1 / 5 );\n echo \"Target Price | Buy | Buy Rate | Money Needed | Reduction % | Total Held\\n\";\n echo \"------------ --- -------- ------------ ----------- ----------\\n\";\n for($i = 0; $i < 5; $i ++)\n {\n $ASP2 = ($m - $i) * 5;\n aspcalc ();\n }\n $ASP2 = $ASP1 * .5;\n aspcalc ();\n}", "public function __construct()\n {\n $this->sale_account = config('global.sale');\n $this->cash_sale = config('global.cash_sale');\n $this->sale_advance = config('global.sale_advance');\n $this->discount_allowed = config('global.discount_allowed');\n $this->credit_collection = config('global.credit_collection');\n // sub account for purcahse\n $this->purchase_account = config('global.purchase');\n $this->cash_purchase = config('global.cash_purchase');\n $this->purchase_advance = config('global.purchase_advance');\n $this->discount_received = config('global.discount_received');\n $this->credit_payment = config('global.credit_payment');\n $this->opening_balance=null;\n }", "public function index() {\n\t\t$this->loadMenu();\n\t\t\n\t\tif(!$this->data['accessView'])\n\t\t\tredirect($this->data['base_url_index'].'login', 'location', 301);\n\t\t\t\n\t\t$this->data['country'] = $this->model_country->loadCountrySelect();\n\t\t\n\t\t$this->data['pageBreadCumb'] = \"\";\n\t\t$this->data['pageTemplate']\t= \"campaign-manager/parameter/view_currencies\";\n\t\t$this->load->view('layout/main', $this->data);\n\t}", "public function run()\n {\n $currencies = [\n 'BTC',\n 'USDT'\n ];\n\n foreach ($currencies as $currency) {\n $model = new Currency();\n $model->name = $currency;\n $model->symbol = $currency;\n $model->type = \"coin\";\n $model->save();\n }\n }", "public function hookPayment($params)\n\t{\n\t\tglobal $smarty, $cookie, $cart;\n\t\t// guardamos el valor de la moneda seleccionada en la tienda\n\t\tif (_PS_VERSION_ < '1.5')\n\t\t{\n \t$curr = Currency::getCurrent();\n \t$codigo_moneda=$curr->iso_code_num;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$curr = $this->context->currency;\n\t\t\t$codigo_moneda=$curr->iso_code_num;\n\t\t}\n \t\n\t\tif ( (Tools::getValue('moneda') == \"\") and (isset($this->moneda)) )\n\t\t\t$moneda = $this->moneda;\n\t\telse\n\t\t\t$moneda = Tools::getValue('moneda');\n\t\tif ( (Tools::getValue('moneda2') == \"\") and (isset($this->moneda2)) )\n\t\t\t$moneda2 = $this->moneda2;\n\t\telse\n\t\t\t$moneda2 = Tools::getValue('moneda2');\n\t\tif ( (Tools::getValue('moneda3') == \"\") and (isset($this->moneda3)) )\n\t\t\t$moneda3 = $this->moneda3;\n\t\telse\n\t\t\t$moneda3 = Tools::getValue('moneda3');\n\t\t// switch case para analizar la moneda y asignar los valores del comercio correspondientes\n\t\tswitch ($codigo_moneda) {\n\t\t\tcase $moneda:\n\t\t\t\t$urltpv_comercio = Tools::getValue('urltpv', $this->urltpv);\n\t\t\t\t$codigo = Tools::getValue('codigo', $this->codigo);\n\t\t\t\t$trans = Tools::getValue('trans', $this->trans);\n\t\t\t\t$clave = Tools::getValue('clave', $this->clave);\t\t\t\t\n\t\t\t\t$nombre_comercio = Tools::getValue('nombre', $this->nombre);\n\t\t\t\t$terminal_comercio = Tools::getValue('terminal', $this->terminal);\n\t\t\t\t$tipofirma_comercio = Tools::getValue('tipofirma', $this->tipofirma);\n\t\t\t\t$indice = 1;\n\t\t\tbreak;\n\t\t\tcase $moneda2:\n\t\t\t\t$urltpv_comercio = Tools::getValue('urltpv2', $this->urltpv2);\n\t\t\t\t$codigo = Tools::getValue('codigo2', $this->codigo2);\n\t\t\t\t$trans = Tools::getValue('trans2', $this->trans2);\n\t\t\t\t$clave = Tools::getValue('clave2', $this->clave2);\n\t\t\t\t$nombre_comercio = Tools::getValue('nombre2', $this->nombre2);\n\t\t\t\t$terminal_comercio = Tools::getValue('terminal2', $this->terminal2);\n\t\t\t\t$tipofirma_comercio = Tools::getValue('tipofirma2', $this->tipofirma2);\n\t\t\t\t$indice = 2;\n\t\t\tbreak;\n\t\t\tcase $moneda3:\n\t\t\t\t$urltpv_comercio = Tools::getValue('urltpv3', $this->urltpv3);\t\t\t\n\t\t\t\t$codigo = Tools::getValue('codigo3', $this->codigo3);\n\t\t\t\t$trans = Tools::getValue('trans3', $this->trans3);\n\t\t\t\t$clave = Tools::getValue('clave3', $this->clave3);\n\t\t\t\t$nombre_comercio = Tools::getValue('nombre3', $this->nombre3);\n\t\t\t\t$terminal_comercio = Tools::getValue('terminal3', $this->terminal3);\n\t\t\t\t$tipofirma_comercio = Tools::getValue('tipofirma3', $this->tipofirma3);\n\t\t\t\t$indice = 3;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$urltpv_comercio = Tools::getValue('urltpv', $this->urltpv);\n\t\t\t\t$codigo = Tools::getValue('codigo', $this->codigo);\n\t\t\t\t$trans = Tools::getValue('trans', $this->trans);\n\t\t\t\t$clave = Tools::getValue('clave', $this->clave);\n\t\t\t\t$nombre_comercio = Tools::getValue('nombre', $this->nombre);\n\t\t\t\t$terminal_comercio = Tools::getValue('terminal', $this->terminal);\n\t\t\t\t$tipofirma_comercio = Tools::getValue('tipofirma', $this->tipofirma);\n\t\t\t\t$indice = 1;\n\t\t}\n\t\t$notificacion_comercio = Tools::getValue('notificacion', $this->notificacion);\n\t\tConfiguration::updateValue('REDSYS_INDICE', $indice);\n\t\t$cantidad_noconvert = number_format($params['cart']->getOrderTotal(true, 3), 2, '.', '');\n\t\t$cantidad_noconvert = str_replace('.','',$cantidad_noconvert);\n\t\t$cantidad_noconvert = floatval($cantidad_noconvert);\n\t\t$multimoneda = Tools::getValue('multimoneda', $this->multimoneda);\n\t\tif ($multimoneda == 1)\n\t\t{\n\t\t\t$cantidad = number_format($params['cart']->getOrderTotal(true, 3), 2, '.', '');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// calculamos la moneda por defecto de la tienda, tiene que coincidir con la moneda del TPV configurado en el módulo\n\t\t\t$id_currency = intval(Configuration::get('PS_CURRENCY_DEFAULT'));\n\t\t\t$currency_to = new Currency(intval($id_currency));\n\t\t\t$currency_from = new Currency(intval($params['cart']->id_currency));\n\t\t\t\n\t\t\t// la conversión la hacemos a la moneda seleccionada\n\t\t\t\n\t\t\tif ($currency_to !== $currency_from)\n\t\t\t\t$cantidad = number_format(Tools::convertPrice($params['cart']->getOrderTotal(true, 3), $currency_from, false), 2, '.', '');\n\t\t\telse\n\t\t\t\t$cantidad = number_format($params['cart']->getOrderTotal(true, 3), 2, '.', '');\n\t\t\t// pasaremos a Redsys el codigo de moneda por defecto\n\t\t\t$codigo_moneda = $currency_to->iso_code_num;\n\t\t}\n\t\t\n\t\t//var_dump($cookie);\n\t\t$cantidad = str_replace('.','',$cantidad);\n\t\t$cantidad = floatval($cantidad);\n\t\t// El número de pedido es los 8 ultimos digitos del ID del carrito + el tiempo MMSS.\n\t\t$numpedido = str_pad($params['cart']->id, 8, \"0\", STR_PAD_LEFT) . date('is');\t\t\n\t\t\n\t\t$ssl = Tools::getValue('ssl', $this->ssl);\n\t\tif ($ssl=='no'){\n\t\t\t$urltienda = 'http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/redsys/respuesta_tpv.php';\n\t\t}elseif($ssl=='si'){\n\t\t\t$urltienda = 'https://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'modules/redsys/respuesta_tpv.php';\n\t\t}else{\n\t\t\t$urltienda = '';\n\t\t}\n\t\t// Cálculo del SHA1 $trans . $urltienda\n\t\tif($tipofirma_comercio)\n\t\t\t$mensaje = $cantidad . $numpedido . $codigo . $codigo_moneda . $clave;\n\t\telse\n\t\t\t$mensaje = $cantidad . $numpedido . $codigo . $codigo_moneda . $trans . $urltienda . $clave;\n\t\t$firma = strtoupper(sha1($mensaje));\n\t\t$products = $params['cart']->getProducts();\n\t\t$productos = '';\n\t\t$id_cart = intval($params['cart']->id);\n\t\t//Activación de los idiomas del TPV\n\t\t$idiomas_estado = Tools::getValue('idiomas_estado', $this->idiomas_estado);\n\t\tif ($idiomas_estado=='si'){ \n\t\t\t$ps_language = new Language(intval($cookie->id_lang));\n\t\t\t$idioma_web = $ps_language->iso_code;\n\t\t\tswitch ($idioma_web) {\n\t\t\t\tcase 'es':\n\t\t\t\t$idioma_tpv='001';\n\t\t\t\tbreak;\n\t\t\t\tcase 'en':\n\t\t\t\t$idioma_tpv='002';\n\t\t\t\tbreak;\n\t\t\t\tcase 'ca':\n\t\t\t\t$idioma_tpv='003';\n\t\t\t\tbreak;\n\t\t\t\tcase 'fr':\n\t\t\t\t$idioma_tpv='004';\n\t\t\t\tbreak;\n\t\t\t\tcase 'de':\n\t\t\t\t$idioma_tpv='005';\n\t\t\t\tbreak;\n\t\t\t\tcase 'nl':\n\t\t\t\t$idioma_tpv='006';\n\t\t\t\tbreak;\n\t\t\t\tcase 'it':\n\t\t\t\t$idioma_tpv='007';\n\t\t\t\tbreak;\n\t\t\t\tcase 'sv':\n\t\t\t\t$idioma_tpv='008';\n\t\t\t\tbreak;\n\t\t\t\tcase 'pt':\n\t\t\t\t$idioma_tpv='009';\n\t\t\t\tbreak;\n\t\t\t\tcase 'pl':\n\t\t\t\t$idioma_tpv='011';\n\t\t\t\tbreak;\n\t\t\t\tcase 'gl':\n\t\t\t\t$idioma_tpv='012';\n\t\t\t\tbreak;\n\t\t\t\tcase 'eu':\n\t\t\t\t$idioma_tpv='013';\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t$idioma_tpv='002';\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$idioma_tpv = '0';\n\t\t}\n\t\tforeach ($products as $product) {\n\t\t\t$productos .= $product['quantity'].' unidad(es) de/del '.$product['name'].\", \";\n\t\t}\n\t\t$customer = new Customer((int)($cart->id_customer));\n\t\tif (_PS_VERSION_ < '1.5.4')\n\t\t{\n\t\t\t$url_ok_txt = 'http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'order-confirmation.php?key='.$customer->secure_key.'&id_cart='. $id_cart .'&id_module='.(int)($this->id).'&id_order='.(int)($numpedido);\n\t\t}\n\t\telse\n\t\t\t$url_ok_txt = 'http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'index.php?controller=order-confirmation&key='.$customer->secure_key.'&id_cart='. $id_cart .'&id_module='.(int)($this->id).'&id_order='.(int)($numpedido);\n\t\t$smarty->assign(array(\n\t\t\t'urltpv' => $urltpv_comercio,\n\t\t\t'cantidad' => $cantidad,\n\t\t\t'moneda' => $codigo_moneda,\n\t\t\t'pedido' => $numpedido,\n\t\t\t'codigo' => $codigo,\t\t\t\n\t\t\t'terminal' => $terminal_comercio,\n\t\t\t'trans' => $trans,\n\t\t\t'titular' => ($cookie->logged ? $cookie->customer_firstname.' '.$cookie->customer_lastname : false),\n\t\t\t'nombre' => $nombre_comercio,\n\t\t\t'urltienda' => $urltienda,\n\t\t\t'notificacion' => $notificacion_comercio,\n\t\t\t'productos' => $productos,\n\t\t\t'UrlOk' => $url_ok_txt,\n\t\t\t'UrlKO' => 'http://'.$_SERVER['HTTP_HOST'].__PS_BASE_URI__.'index.php?fc=module&module=redsys&controller=errorpayment',\n\t\t\t'firma' => $firma,\n\t\t\t'idioma_tpv' => $idioma_tpv,\n\t\t\t'this_path' => $this->_path,\n\t\t\t'cantidad_noconvert' => $cantidad_noconvert\n\t\t));\n\t\tif ($multimoneda == 1) \n\t\t{\n\t\t\tif ( ($codigo_moneda <> $moneda) and ($codigo_moneda <> $moneda2) and ($codigo_moneda <> $moneda3) )\n\t\t\t{\n\t\t\t\t// si la moneda seleccionada en la tienda para pagar no corresponde con las monedas configuradas en el comercio o comercios dados de alta\n\t\t\t\t// no se permite el pago mediante el módulo de Redsys\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\treturn $this->display(__FILE__, 'redsys.tpl');\n\t}", "private function _init() {\n\n global $admin_settings;\n global $payment_list;\n\n new KP_Korapay_Shortcode;\n\n $admin_settings = KP_Korapay_Admin_Settings::get_instance();\n $payment_list = KP_Korapay_Payment_List::get_instance();\n\n if ( is_admin() ) {\n KP_Tinymce_Plugin::get_instance();\n }\n\n if ($admin_settings->get_option_value( 'go_live' ) === 'yes' ) {\n $this->api_base_url = 'https://api.korapay.com/merchant';\n }\n\n }", "function trans_start($test_mode = FALSE)\r\n\t{\t\r\n\t\t$this->db->trans_start($test_mode);\r\n\t}", "private function SetMarginRateInitial(&$symbol, $obj)\n {\n $result = MTConSymbol::GetDefaultMarginRate();\n $new = false;\n\n if(isset($obj->MarginInitialBuy))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_BUY] = $obj->MarginInitialBuy;\n $new = true;\n }\n\n if(isset($obj->MarginInitialSell))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_SELL] = $obj->MarginInitialSell;\n $new = true;\n }\n\n if(isset($obj->MarginInitialBuyLimit))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_BUY_LIMIT] = $obj->MarginInitialBuyLimit;\n $new = true;\n }\n\n if(isset($obj->MarginInitialSellLimit))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_SELL_LIMIT] = $obj->MarginInitialSellLimit;\n $new = true;\n }\n\n if(isset($obj->MarginInitialBuyStop))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_BUY_STOP] = $obj->MarginInitialBuyStop;\n $new = true;\n }\n\n if(isset($obj->MarginInitialSellStop))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_SELL_STOP] = $obj->MarginInitialSellStop;\n $new = true;\n }\n\n if(isset($obj->MarginInitialBuyStopLimit))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_BUY_STOP_LIMIT] = $obj->MarginInitialBuyStopLimit;\n $new = true;\n }\n\n if(isset($obj->MarginInitialSellStopLimit))\n {\n $result[MTEnMarginRateTypes::MARGIN_RATE_SELL_STOP_LIMIT] = $obj->MarginInitialSellStopLimit;\n $new = true;\n }\n\n if(!$new)\n $this->OldMarginRateInitialConvert($symbol, $obj);\n else\n {\n $symbol->MarginRateInitial = $result;\n $this->OldMarginRateInitialSet($symbol, $obj);\n }\n }", "public function index()\n {\n // Compatibility for 1.4.7\n if (empty($this->session->data['token'])) {\n $this->session->data['token'] = '';\n }\n\n // Load language file and settings model\n $this->load->language('payment/getfinancing');\n $this->load->model('setting/setting');\n\n // Set page title\n $this->document->setTitle($this->language->get('heading_title'));\n\n // Process settings if form submitted\n if (($this->request->server['REQUEST_METHOD'] == 'POST') && ($this->validate())) {\n $this->load->model('setting/setting');\n $this->model_setting_setting->editSetting('getfinancing', $this->request->post);\n $this->session->data['success'] = $this->language->get('text_success');\n $this->redirect(HTTPS_SERVER . 'index.php?route=extension/payment&token=' . $this->session->data['token']);\n //v2.0\n //$this->response->redirect($this->url->link('extension/payment', 'token='.$this->session->data['token'], 'SSL'));\n }\n\n // Load language texts\n $this->data['heading_title'] = $this->language->get('heading_title');\n $this->data['text_enabled'] = $this->language->get('text_enabled');\n $this->data['text_disabled'] = $this->language->get('text_disabled');\n $this->data['text_all_zones'] = $this->language->get('text_all_zones');\n $this->data['text_yes'] = $this->language->get('text_yes');\n $this->data['text_no'] = $this->language->get('text_no');\n $this->data['text_edit'] = $this->language->get('text_edit');\n $this->data['merchant_id'] = $this->language->get('merchant_id');\n $this->data['username'] = $this->language->get('username');\n $this->data['password'] = $this->language->get('password');\n $this->data['entry_test'] = $this->language->get('entry_test');\n $this->data['entry_status'] = $this->language->get('entry_status');\n $this->data['entry_geo_zone'] = $this->language->get('entry_geo_zone');\n $this->data['entry_sort_order'] = $this->language->get('entry_sort_order');\n $this->data['entry_order_status'] = $this->language->get('entry_order_status');\n $this->data['tip'] = $this->language->get('tip');\n $this->data['button_save'] = $this->language->get('button_save');\n $this->data['button_cancel'] = $this->language->get('button_cancel');\n $this->data['tab_general'] = $this->language->get('tab_general');\n\n // Set errors if fields not correct\n if (isset($this->error['warning'])) {\n $this->data['error_warning'] = $this->error['warning'];\n } else {\n $this->data['error_warning'] = '';\n }\n\n if (isset($this->error['merchant_id'])) {\n $this->data['error_merchant_id'] = $this->error['merchant_id'];\n } else {\n $this->data['error_merchant_id'] = '';\n }\n\n if (isset($this->error['username'])) {\n $this->data['error_username'] = $this->error['username'];\n } else {\n $this->data['error_username'] = '';\n }\n\n if (isset($this->error['password'])) {\n $this->data['error_password'] = $this->error['password'];\n } else {\n $this->data['error_password'] = '';\n }\n\n\n // Set breadcrumbs\n $this->data['breadcrumbs'] = array();\n\n $this->data['breadcrumbs'][] = array(\n 'href' => HTTPS_SERVER.'index.php?route=common/home&token='.$this->session->data['token'],\n 'text' => $this->language->get('text_home'),\n 'separator' => false,\n );\n\n $this->data['breadcrumbs'][] = array(\n 'href' => HTTPS_SERVER.'index.php?route=extension/payment&token='.$this->session->data['token'],\n 'text' => $this->language->get('text_payment'),\n 'separator' => ' :: ',\n );\n\n $this->data['breadcrumbs'][] = array(\n 'href' => HTTPS_SERVER.'index.php?route=payment/getfinancing&token='.$this->session->data['token'],\n 'text' => $this->language->get('heading_title'),\n 'separator' => ' :: ',\n );\n\n // Set save/cancel button urls\n $this->data['action'] = HTTPS_SERVER.'index.php?route=payment/getfinancing&token='.$this->session->data['token'];\n\n $this->data['cancel'] = HTTPS_SERVER.'index.php?route=extension/payment&token='.$this->session->data['token'];\n\n // Load values for fields\n if (isset($this->request->post['getfinancing_merchant_id'])) {\n $this->data['getfinancing_merchant_id'] = $this->request->post['getfinancing_merchant_id'];\n } else {\n $this->data['getfinancing_merchant_id'] = $this->config->get('getfinancing_merchant_id');\n }\n if (isset($this->request->post['getfinancing_username'])) {\n $this->data['getfinancing_username'] = $this->request->post['getfinancing_username'];\n } else {\n $this->data['getfinancing_username'] = $this->config->get('getfinancing_username');\n }\n if (isset($this->request->post['getfinancing_password'])) {\n $this->data['getfinancing_password'] = $this->request->post['getfinancing_password'];\n } else {\n $this->data['getfinancing_password'] = $this->config->get('getfinancing_password');\n }\n if (isset($this->request->post['getfinancing_test'])) {\n $this->data['getfinancing_test'] = $this->request->post['getfinancing_test'];\n } else {\n $this->data['getfinancing_test'] = $this->config->get('getfinancing_test');\n }\n if (isset($this->request->post['getfinancing_status'])) {\n $this->data['getfinancing_status'] = $this->request->post['getfinancing_status'];\n } else {\n $this->data['getfinancing_status'] = $this->config->get('getfinancing_status');\n }\n if (isset($this->request->post['getfinancing_sort_order'])) {\n $this->data['getfinancing_sort_order'] = $this->request->post['getfinancing_sort_order'];\n } else {\n $this->data['getfinancing_sort_order'] = $this->config->get('getfinancing_sort_order');\n }\n\n // Render template\n //v1.5.x version\n $this->template = 'payment/getfinancing.tpl';\n $this->children = array(\n 'common/header',\n 'common/footer'\n );\n $this->response->setOutput($this->render());\n\n //v2.0 version\n //v2.0\n //$this->data['header'] = $this->load->controller('common/header');\n //$this->data['column_left'] = $this->load->controller('common/column_left');\n //$this->data['footer'] = $this->load->controller('common/footer');\n //$this->response->setOutput($this->load->view('payment/getfinancing.tpl', $data));\n }", "public function run()\n {\n Currency::create([\n 'name' => 'AUD',\n 'value' => '1'\n \n ]);\n\n Currency::create([\n 'name' => 'GBP',\n 'value' => '0.79'\n ]);\n\n Currency::create([\n 'name' => 'EUR',\n 'value' => '0.89'\n ]);\n\n Currency::create([\n 'name' => 'CAD',\n 'value' => '1.34'\n ]);\n\n Currency::create([\n 'name' => 'USD',\n 'value' => '1.43'\n ]);\n }", "function currency( $c_f_x )\t\r\n {\r\n \t$c_f_x = round($c_f_x, 2);\t//THIS WILL ROUND THE ACCEPTED PARAMETER TO THE \r\n \t\t\t\t\t\t\t //PRECISION OF 2\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n \t$temp_c_f_variable = strstr(round($c_f_x,2), \".\");\t//THIS WILL ASSIGN THE \".\" AND WHAT EVER \r\n \t\t\t\t\t\t\t\t//ELSE COMES AFTER IT. REMEMBER DUE TO \r\n \t\t\t\t\t\t\t\t//ROUNDING THERE ARE ONLY THREE THINGS\r\n \t\t\t\t\t\t\t\t//THIS VARIABLE CAN CONTAIN, A PERIOD \r\n \t\t\t\t\t\t\t\t//WITH ONE NUMBER, A PERIOD WITH TWO NUMBERS,\r\n \t\t\t\t\t\t\t\t//OR NOTHING AT ALL\r\n \t\t\t\t\t\t\t\t//EXAMPLE : \".1\",\".12\",\"\"\r\n\t\t\t\t\t\t\t\t\t\r\n \tif (strlen($temp_c_f_variable) == 2)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \".1\" SO YOU WOULD ADD A ZERO TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT \r\n \t{\r\n \t\t$c_f_x = $c_f_x . \"0\";\r\n \t}\r\n\t\t\r\n \tif (strlen($temp_c_f_variable) == 0)\t//THIS IF STATEMENT WILL CHECK TO SEE IF \r\n \t\t\t\t\t\t//LENGTH OF THE VARIABLE IS EQUAL TO 2. IF\r\n \t\t\t\t\t\t//IT IS, THEN WE KNOW THAT IT LOOKS LIKE \r\n \t\t\t\t\t\t//THIS \"\" SO YOU WOULD ADD TWO ZERO'S TO GIVE IT \r\n \t\t\t\t\t\t// A NICE LOOKING FORMAT\r\n \t{\r\n \t\t$c_f_x = $c_f_x . \".00\";\r\n \t}\r\n\t\t\r\n\t\t$c_f_x = \"$\" . $c_f_x;\t//THIS WILL ADD THE \"$\" TO THE FRONT \r\n\r\n \treturn $c_f_x;\t//THIS WILL RETURN THE VARIABLE IN A NICE FORMAT\r\n \t\t\t\t\t//BUT REMEMBER THIS NEW VARIABLE WILL BE A STRING \r\n \t\t\t\t\t//THEREFORE CAN BE USED IN ANY FURTHER CALCULATIONS\r\n \t\t\r\n }", "public function deliveryPriceDhaka()\n {\n }", "function get_ffd_currency() {\r\n\treturn apply_filters( 'ffd_currency', get_option( 'ffd_currency' ) );\r\n}", "function setSyncItemsPriceAction()\n {\n }", "public function setCurrency($currency)\n {\n $this->currency = $currency;\n }", "public function setCurrency($currency)\n {\n $this->currency = $currency;\n }", "protected function _construct()\r\n {\r\n $this->_init('ss_price', 'price_id');\r\n }", "public function dashboardprice($coin = 'BTC_USD', $type = null)\n {\n UserModel::authentication();\n\n //get the market\n $coin2 = explode('_', $coin);\n\n//get the price ticker\n if (file_exists(\\Filtration\\Core\\Config::get('PATH_LIBS') . \"tickers/\" . strtolower($coin2[0]) . \".php\")):\n include \\Filtration\\Core\\Config::get('PATH_LIBS') . \"tickers/\" . strtolower($coin2[0]) . \".php\";\n endif;\n\n//case to get buy or sell\n switch ($type) {\n case 'buy':\n echo $coinTicker->price($coin2[1], 'buy');\n break;\n case 'sell':\n echo $coinTicker->price($coin2[1], 'sell');\n break;\n }\n\n }" ]
[ "0.60177004", "0.5987294", "0.59734225", "0.59612644", "0.5835977", "0.5631259", "0.5594137", "0.5564504", "0.54974616", "0.54795855", "0.54729855", "0.54702", "0.5442873", "0.54342663", "0.5427754", "0.54122585", "0.53925544", "0.53905886", "0.53758883", "0.5370719", "0.5362266", "0.53455377", "0.53444284", "0.5330763", "0.53239113", "0.5323732", "0.53231317", "0.52981776", "0.52912855", "0.5290666", "0.5280299", "0.52743876", "0.52537984", "0.525091", "0.5242144", "0.52400416", "0.52350694", "0.5231778", "0.52295846", "0.522704", "0.52259934", "0.5216024", "0.5214832", "0.52049685", "0.5182694", "0.5171444", "0.5169272", "0.51617676", "0.5148316", "0.513692", "0.5135319", "0.5131002", "0.51297724", "0.512186", "0.511433", "0.5111525", "0.51034784", "0.5099432", "0.50985956", "0.50874585", "0.5078312", "0.50743693", "0.5056222", "0.50550675", "0.5045858", "0.5024777", "0.5024371", "0.5022576", "0.5018504", "0.5010262", "0.5005876", "0.50036645", "0.49961603", "0.49893925", "0.4988247", "0.49849898", "0.49849898", "0.49846068", "0.4967202", "0.49663314", "0.4965515", "0.4964019", "0.49571866", "0.49568266", "0.49516195", "0.49512133", "0.49432197", "0.4942782", "0.49383605", "0.49374178", "0.49296066", "0.49291143", "0.4928797", "0.49274936", "0.49254516", "0.49254313", "0.49250954", "0.49250954", "0.49250135", "0.49114636" ]
0.54920423
9
Start function get string length
public function foodbakery_get_string($length = 3) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ( $i = 0; $i < $length; $i ++ ) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLength();", "public function getTextLength();", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "public function getLength() {}", "abstract public function getLength();", "public function length();", "public function length();", "function length(){\n\t\t//return strlen($this->_String4);\n\t\treturn Translate::Length($this->_String4,$this->getEncoding());\n\t}", "public function getCharLength();", "public function getLength(): int;", "public function getLength(): int;", "public function length() : int;", "function length(): int;", "function length( $string )\n\t\t{\n\t\t\treturn strlen( $string );\n\t\t}", "private function countLength() {\n\n $this->_length = strlen($this->_value);\n }", "private final function getLength() {\n\t\t\treturn $this->length;\n\t\t}", "public function length()\n {\n return UTF8::strlen($this->str, $this->encoding);\n }", "public function getTotalLength();", "public function getTotalLength();", "function MBGetStringLength($s){\r\n if($this->CurrentFont['type']=='Type0')\r\n {\r\n $len = 0;\r\n $nbbytes = strlen($s);\r\n for ($i = 0; $i < $nbbytes; $i++)\r\n {\r\n if (ord($s[$i])<128)\r\n $len++;\r\n else\r\n {\r\n $len++;\r\n $i++;\r\n }\r\n }\r\n return $len;\r\n }\r\n else\r\n return strlen($s);\r\n }", "function getLength ()\n\t{\n\t\treturn $this->_len ; \n\t}", "public function strlen($date)\n {\n echo \"<h3><u> length of a string of $date </h2></u>\";\n $a=strlen($date);\n echo $a;\n echo \"<hr>\";\n }", "function acf_strlen($str)\n{\n}", "function MBGetStringLength($s)\n\t{\n\t\tif($this->CurrentFont['type']=='Type0')\n\t\t{\n\t\t\t$len = 0;\n\t\t\t$nbbytes = strlen($s);\n\t\t\tfor ($i = 0; $i < $nbbytes; $i++)\n\t\t\t{\n\t\t\t\tif (ord($s[$i])<128)\n\t\t\t\t\t$len++;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$len++;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $len;\n\t\t}\n\t\telse\n\t\t\treturn strlen($s);\n\t}", "#[\\ReturnTypeWillChange]\n public function count() {\n return mb_strlen($this->string);\n }", "function getLength(): int\n {\n return $this->length;\n }", "public function getTotalLength() {}", "public function getTotalLength() {}", "function MBGetStringLength($s)\n {\n if($this->CurrentFont['type']=='Type0')\n {\n $len = 0;\n $nbbytes = strlen($s);\n for ($i = 0; $i < $nbbytes; $i++)\n {\n if (ord($s[$i])<128)\n $len++;\n else\n {\n $len++;\n $i++;\n }\n }\n return $len;\n }\n else\n return strlen($s);\n }", "function MBGetStringLength($s)\n {\n if($this->CurrentFont['type']=='Type0')\n {\n $len = 0;\n $nbbytes = strlen($s);\n for ($i = 0; $i < $nbbytes; $i++)\n {\n if (ord($s[$i])<128)\n $len++;\n else\n {\n $len++;\n $i++;\n }\n }\n return $len;\n }\n else\n return strlen($s);\n }", "function MBGetStringLength($s)\n {\n if($this->CurrentFont['type']=='Type0')\n {\n $len = 0;\n $nbbytes = strlen($s);\n for ($i = 0; $i < $nbbytes; $i++)\n {\n if (ord($s[$i])<128)\n $len++;\n else\n {\n $len++;\n $i++;\n }\n }\n return $len;\n }\n else\n return strlen($s);\n }", "function MBGetStringLength($s)\n {\n if($this->CurrentFont['type']=='Type0')\n {\n $len = 0;\n $nbbytes = strlen($s);\n for ($i = 0; $i < $nbbytes; $i++)\n {\n if (ord($s[$i])<128)\n $len++;\n else\n {\n $len++;\n $i++;\n }\n }\n return $len;\n }\n else\n return strlen($s);\n }", "function MBGetStringLength($s)\n\n {\n\n if($this->CurrentFont['type']=='Type0')\n\n {\n\n $len = 0;\n\n $nbbytes = strlen($s);\n\n for ($i = 0; $i < $nbbytes; $i++)\n\n {\n\n if (ord($s[$i])<128)\n\n $len++;\n\n else\n\n {\n\n $len++;\n\n $i++;\n\n }\n\n }\n\n return $len;\n\n }\n\n else\n\n return strlen($s);\n\n }", "function MBGetStringLength($s)\n\n {\n\n if($this->CurrentFont['type']=='Type0')\n\n {\n\n $len = 0;\n\n $nbbytes = strlen($s);\n\n for ($i = 0; $i < $nbbytes; $i++)\n\n {\n\n if (ord($s[$i])<128)\n\n $len++;\n\n else\n\n {\n\n $len++;\n\n $i++;\n\n }\n\n }\n\n return $len;\n\n }\n\n else\n\n return strlen($s);\n\n }", "public function getElementTextLength();", "private function len($str) {\n\t\treturn mb_strlen($str, $this->encoding);\n\t}", "function getLength(): ?int;", "public function getLength()\r\n {\r\n return $this->length;\r\n }", "public function getLength()\n\t\t{\n\t\t\treturn $this->length;\n\t\t}", "protected function get_length(): int\n\t{\n\t\treturn $this->end - $this->start + 1;\n\t}", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "public function getLength()\n {\n return $this->length;\n }", "abstract protected function getLineLength(): int;", "public function length() {\r\n return strlen($this->contents);\r\n }", "public function getLength() {\r\n return $this->length;\r\n }", "public function length()\n {\n return $this->length;\n }", "public function getLen()\n {\n return $this->_len;\n }", "public static function length($s)\n\t{\n\t\treturn function_exists('mb_strlen') ? mb_strlen($s, 'UTF-8') : strlen(utf8_decode($s));\n\t}", "public function getOutputLength();", "public function getLength()\n {\n return strlen($this->data);\n }", "protected function getStringSize($value){\n\t\tif (function_exists('mb_strlen')) return mb_strlen($value);\n\n\t\treturn strlen($value);\n\t}", "function length($read, $count)\n{\n global $end;\n \n if (strlen($read) > 80) {\n echo \"\\e[0;31m Erreur : \\e[0;34m ligne $count : \\e[0;31m Ligne de plus de 80 caractères. \\e[0;m\\n\";\n $end += 1;\n }\n}", "public function MBGetStringLength($s)\n {\n if ('Type0' == $this->CurrentFont['type']) {\n $len = 0;\n $nbbytes = strlen($s);\n for ($i = 0; $i < $nbbytes; ++$i) {\n if (ord($s[$i]) < 128) {\n ++$len;\n } else {\n ++$len;\n ++$i;\n }\n }\n\n return $len;\n }\n\n return strlen($s);\n }", "public static function length($value){\n return mb_strlen($value);\n }", "public function getLength() {\n return $this->_length;\n }", "public function length() {\n \n return $this->getLength();\n }", "function smarty_modifier_strlength($string)\n{\n return strlen($string);\n}", "function getPayloadLength();", "public function length()\n {\n return $this->provider->length();\n }", "public static function len($str)\n {\n return strlen($str);\n }", "public static function sl($data)\n {\n return strlen($data);\n }", "public function getLength() {\n \n return $this->_length;\n }", "public function length()\n\t{\n\t\treturn count($this->parts);\n\t}", "public static function len( $str = '' ) {\n\t\tif ( empty( $str ) ) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t$vals = array();\n\n\t\treturn preg_match_all( '/./u', $str, $vals );\n\t}", "public function getLength()\n {\n return 0;\n }", "function totalStringLength ($stringOne, $stringTwo)\n{\n $number = strlen($stringOne) + strlen($stringTwo);\n\nreturn $number;\n}", "public function getLength($atOffset = false);", "public function getLengthLimit()\n {\n }", "public function getLength($atOffset = false) {}", "public static function strlen($string, $encoding = 'UTF-8') {}", "function getLength(?string $content = null): int\n{\n if (!isset($content)) {\n return 0;\n }\n return grapheme_strlen(strip_tags($content));\n}", "static function length(string $s, string $encoding = null): int {\n if ($encoding) {\n return mb_strlen($s, $encoding);\n }\n\n return mb_strlen($s);\n }", "public function length()\n {\n return strlen($this->buffer);\n }", "public function getMaxLength() {}", "public static function stringLength($value)\n {\n return mb_strlen($value);\n }", "function length_check() {\n # Reset Error Message\n $this->error_message = \"\";\n\n # Check that a length is set\n if ($this->length) {\n # Check Length\n if (strlen($this->cur_val) > $this->length) {\n # Set Error Message\n $this->set_error(\"Validation for length of input ({$this->cur_val}) failed. The input length is \" . strlen($this->cur_val) . \" and the max length is {$this->length}.\");\n\n # Return Truncated Result\n return substr($this->cur_val, 0, $this->length);\n }\n else {\n return $this->cur_val;\n }\n }\n else {\n return $this->cur_val;\n }\n }", "public function getFullLength()\n {\n $cmd_length = 1;\n\n $rl_length = strlen($this->remaining_length_bytes);\n\n return $cmd_length + $rl_length + $this->remaining_length;\n }", "public function length($value)\n {\n return 'LEN(' . $value . ')';\n }", "public function getQueryStringLengthValue()\n {\n return $this->readWrapperValue(\"query_string_length\");\n }", "public function getLength()\n {\n return $this->int_length;\n }", "public function lenLiteralSeparate() { return $this->_m_lenLiteralSeparate; }", "public function strlen($string) {\n\t\treturn grapheme_strlen($string);\n\t}", "public static function length($string)\n\t{\n\t\tif (function_exists(\"mb_strlen\"))\n\t\t\treturn mb_strlen($string, self::ENCODING);\n\t\telse\n\t\t\treturn strlen($string);\n\t}", "static function SmartLen($str)\n\t{\n\t\treturn strlen($str) + substr_count($str, \"\\t\") * 3; // 4-space tab\n\t}", "protected function get_max_length(): int\n\t{\n\t\treturn $this->end < $this->total ? $this->length : -1;\n\t}", "public function getMaxLength();", "public function get_bodylength() {\n return \"Lichaamslengte = \" . $this->bodylength . \"m\";\n }", "public function getLenom():string\n {\n return $this->lenom;\n }", "public function lenLiteral() {\n if ($this->_m_lenLiteral !== null)\n return $this->_m_lenLiteral;\n $this->_m_lenLiteral = ($this->isLenLiteralSeparate() ? $this->lenLiteralSeparate() : ($this->lenLiteralM1InTag() + 1));\n return $this->_m_lenLiteral;\n }", "public function length() {\r\n return filesize($this->fullName());\r\n }", "public function getCompleteLength()\n {\n return $this->complete_length;\n }", "public function length()\n {\n return $this->count();\n }", "function getSaltLength() ;" ]
[ "0.7940174", "0.78234833", "0.7792765", "0.7792765", "0.7792765", "0.77927214", "0.77790916", "0.7693953", "0.7693953", "0.76460564", "0.76370215", "0.7603378", "0.7603378", "0.7567684", "0.73764694", "0.73177487", "0.7276809", "0.72610754", "0.7218456", "0.72115904", "0.72115904", "0.7185561", "0.7154658", "0.7149621", "0.7091762", "0.70714843", "0.7063697", "0.7054488", "0.7051208", "0.7050822", "0.7031029", "0.7031029", "0.7031029", "0.7031029", "0.7030462", "0.7030462", "0.7018074", "0.6986491", "0.6968654", "0.6861464", "0.6843786", "0.6838509", "0.6831956", "0.6831956", "0.6831956", "0.6831956", "0.6831956", "0.6831956", "0.6831956", "0.6831956", "0.683012", "0.6814054", "0.6811614", "0.6776591", "0.6776085", "0.67524505", "0.67502385", "0.6730139", "0.66893184", "0.6663615", "0.6659829", "0.6659742", "0.66596234", "0.66397077", "0.6617428", "0.66160625", "0.6611128", "0.65898854", "0.65818924", "0.65737057", "0.6572537", "0.65713733", "0.6548822", "0.6496996", "0.64776677", "0.6464751", "0.6459575", "0.643341", "0.6414456", "0.64089835", "0.6405427", "0.63972634", "0.63928044", "0.6392709", "0.6389586", "0.6379529", "0.6366216", "0.6363677", "0.63611", "0.6354933", "0.6349687", "0.6332069", "0.63306725", "0.63152", "0.6315007", "0.6311295", "0.6307093", "0.6304721", "0.6301115", "0.6292072", "0.628217" ]
0.0
-1
Start function for add transaction
public function foodbakery_add_transaction($fields = array()) { global $foodbakery_plugin_options; define("DEBUG", 1); define("USE_SANDBOX", 1); define("LOG_FILE", "./ipn.log"); include_once('../../../../wp-load.php'); if ( is_array($fields) ) { foreach ( $fields as $key => $value ) { update_post_meta((int) $fields['foodbakery_transaction_id'], "$key", $value); } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function startTransaction();", "public function startTransaction(): void;", "abstract protected function _start_transaction();", "public function transactionStart()\n\t{\n\t\treturn;\n\t}", "public static function beginTransaction()\n {\n }", "public function starttrans(){\n\t\t$this->transaction = true;\n\t\t$this->query(\"START TRANSACTION\");\n\t}", "public function startTransaction()\n {\n $this->debug(\"transaction->start()\");\n DB::beginTransaction();\n }", "protected function beginTrans(){\r\n $this->transaction=$this->dba->beginTransaction();\r\n $this->isTransactionBegun=true;\r\n }", "public function beginTransaction();", "public function beginTransaction();", "public function beginTransaction();", "public function start_tran()\n {\n $this->execute('START TRANSACTION;');\n }", "public function beginTransaction():void;", "public abstract function beginTransaction();", "public function beginTransaction() {\n\t\t//noop\n\t}", "public function transactionBegin() {\n $this->host->beginTransaction();\n }", "public function testTransactionStart()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function startTransaction() {\n \t$this->_transaction_depth++;\n \t\n \tif( $this->_transaction_depth == 1 ) {\n \t\t$this->_start_transaction();\n \t}\n }", "public function beginTransaction(): void\n {\n $this->createTransaction();\n\n ++$this->transactions;\n }", "protected static function beginTransaction()\n\t{\n\t\tAbstractUnit::beginTransaction();\n\t}", "public function beginTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('BEGIN TRANSACTION');\r\n\t}", "public function startTransaction()\n {\n $this->getDriver()->database->startTransaction();\n }", "public function startTransaction() {\n $pdo = $this->getConnection();\n $pdo->beginTransaction();\n }", "private function beginTransaction()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->beginTransaction();\n\t\t}\n\t}", "function StartRun()\n {\n $this->transaction_in_progress =true;\n $this->db->StartTrans();\n }", "public function beginTransaction()\n {\n $this->transactions++;\n\n if ($this->transactions == 1) {\n $this->transaction = $this->neo->beginTransaction();\n }\n\n $this->fireConnectionEvent('beganTransaction');\n }", "protected function begin() {\n $this->objDbConn->beginTransaction();\n }", "public function beginTransaction()\r\n {\r\n ++$this->_txns;\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->beginTransaction();\r\n }\r\n }", "public function begin() {\n\t\t$this->mPDO->beginTransaction();\n\t}", "public function createTransaction()\n {\n }", "function beginTransaction(){\n\t\ttry {\n\t\t\t$this->dbconn->beginTransaction();\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function beginTransaction()\n {\n $this->transactions++;\n\n if ($this->transactions == 1) {\n $this->getPdo()->beginTransaction();\n }\n }", "function beginTransaction()\n\t\t{\n\t\t\t$this->conn->beginTransaction();\n\t\t}", "public function dbTransactionBegin()\n {\n DB::beginTransaction();\n }", "public static function beginTransaction()\n\t{\n\t\tif (self::$currentTransaction === null)\n\t\t\tself::$currentTransaction = Yii::app()->db->beginTransaction();\n\t}", "public function startTransaction()\n {\n\t\treturn $this->db->fireFastSqlQuery(\"START TRANSACTION\");\n\t}", "public function beginTransaction() {\n parent::beginTransaction();\n $this->activeTransaction = true;\n }", "function beginTransaction()\r\n\t\t{\r\n\t\t$this->transaction=FALSE;\r\n\t\t$this->query=\"START TRANSACTION \";\r\n\t\t$this->query.=($this->transaction_isolation)?\" ISOLATION LEVEL \".$this->transaction_isolation:\"\";\r\n\t\t$this->query.=($this->lock_type)?$this->lock_type:\"\";\r\n\t\t$this->runQuery();\r\n\t\t$this->transaction=TRUE;\r\n\t\t}", "public function transaction();", "public function transaction();", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "protected function createTransaction(): void\n {\n if ($this->transactions == 0) {\n try {\n $this->call('beginTransaction');\n } catch (Throwable $e) {\n $this->handleBeginTransactionException($e);\n }\n } elseif ($this->transactions >= 1) {\n $this->createSavepoint();\n }\n }", "public function beginTransaction()\n {\n $this->getActivePdo()->beginTransaction();\n }", "public function begin()\n\t{\n\t\tif (!$this->commit_stack) {\n\t\t\t$this->query('START TRANSACTION');\n\t\t}\n\t\t$this->commit_stack ++;\n\t}", "protected function beginTransaction()\n {\n $this->container->make('db')->beginTransaction();\n }", "public function iniciarTransaccion() {\n $this->ejecutar(\"START TRANSACTION\");\n }", "protected function begin()\n\t{\n\t\t$this->beginTransaction();\n\t}", "protected function beginTransaction()\n\t{\n\t\t$this->db->beginTransaction();\n\t}", "function begin_transaction()\n{\n\tglobal $transaction_level; // set in set_global_connection()\n\n\tif (!$transaction_level) {\n\t\tdb_query(\"BEGIN\", \"could not start a transaction\");\n\t}\n\t$transaction_level++;\n}", "function _auto_trans_begin()\r\n\t{\r\n\t\t// Begin auto transaction\r\n\t\tif ($this->auto_transaction)\r\n\t\t{\r\n\t\t\t$this->trans_begin();\r\n\t\t}\r\n\t}", "public function beginTransaction()\n {\n $transaction = $this->unprepared(\"START TRANSACTION;\");\n if (false !== $transaction) {\n $this->transactionCount++;\n }\n }", "public function addBeginTransaction(){\n\t\t$this->addQuery('', 'Begin transaction', 'begin_transaction');\n\n\t\treturn $this;\n\t}", "#[ReturnTypeWillChange]\n\tpublic function beginTransaction ()\n\t{\n\t\t$this->exec('BEGIN TRANSACTION');\n\t\treturn true;\n\t}", "function BeginTransaction() {\r\n $this->con->autoCommit(false);\r\n \r\n }", "public function start_tran();", "public function begin () {\n $this->connect();\n if( $this->in_transaction ) return;\n $this->transaction( 'BEGIN' );\n $this->in_transaction = true;\n }", "public function inTransaction();", "public function inTransaction();", "public static function beginTransaction() {\n\t\t\n\t\tself::$isTransaction = true;\n\t\tforeach (self::$con as $instanceName => $instance) {\n\t\t\t$instance->beginTransaction();\n\t\t}\n\t}", "function start() {\n // Warns if binary logging is not active\n //$r = $this->q(\"show variables like 'log_bin'\");\n //if (@mysql_fetch_object($r)->Value != 'ON') {\n // Binary log should be used for better data reliability\n // see http://dev.mysql.com/doc/refman/5.0/fr/commit.html\n // and http://dev.mysql.com/doc/refman/5.0/fr/binary-log.html\n // and http://www.cyberciti.biz/faq/what-is-mysql-binary-log/\n //}\n // Manages nested transactions:\n // only issues a BEGIN statement for the first transaction\n if (self::$started_transactions_count < 1) {\n // Backups current autocommit state\n self::$autocommit_state_backup = $this->autocommit();\n // Sets autocommit state to false\n $this->autocommit(false);\n // Begin transaction\n $this->q('BEGIN');\n // Resets internal variables\n self::$started_transactions_count = 0;\n $this->last_insert_id = null;\n $this->results = array();\n $this->exceptions = array();\n }\n // Manages transactions counter\n self::$started_transactions_count++;\n }", "public function whmcs_add_transaction($params = array()) {\n\t\t$params['action'] = 'AddTransaction';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "public function beginTransaction()\n {\n throw new Exception('transactions are not yet supported');\n $this->db->start_delegated_transaction();\n }", "public function beginTransaction() {\n\t\t$this->execute(\"SET autocommit = 0; START TRANSACTION;\");\n\t}", "abstract public function InTransaction();", "public function start_transaction() {\n $this->mysqli->autocommit(false);\n }", "public function beginTransaction()\n {\n self::$_transactionLevel++;\n \n if (self::$_transactionLevel == 1) {\n $this->getConnection()->beginTransaction();\n }\n }", "public function beginTransaction()\n {\n if (!$this->transaction++) {\n return $this->conexion->beginTransaction();\n }\n\n $this->conexion->exec('SAVEPOINT trans'.$this->transaction);\n return $this->transaction >= 0;\n }", "public function begin() {\n if ($this->tx_active) {\n throw new GDBException(\"can't begin new transaction\");\n } else {\n $this->x('BEGIN');\n $this->tx_active = true;\n }\n }", "public function transactionStart($asSavepoint = false)\n {\n $this->connect();\n\n if (!$asSavepoint || !$this->transactionDepth) {\n $this->connection->beginTransaction();\n }\n\n $this->transactionDepth++;\n }", "public static function beginTransaction()\n {\n static::$_connected or static::connect();\n\n if (static::$_intransaction) {\n return;\n }\n\n static::$_intransaction = true;\n\n static::$_pdo->beginTransaction();\n }", "public function run()\n {\n $borrow = new Transaction();\n $borrow->user_id = 1;\n $borrow->debit = 1000;\n $borrow->credit = 2000;\n $borrow->saldo = 2000;\n $borrow->total = 4000;\n $borrow->save();\n }", "public function beginTransaction()\n\t{\n $this->neoeloquent->beginTransaction();\n\t}", "function trans_start($test_mode = FALSE)\r\n\t{\t\r\n\t\t$this->db->trans_start($test_mode);\r\n\t}", "public function handleTransactionBeginning(TransactionBeginning $event)\n {\n Log::debug('begin');\n }", "function addTransaction($data) {\n\n $import = $this->getPdo()->prepare(\"INSERT into Transaction (day, amount, name, account_id, category_id) VALUES ( :date, :amount, :name, :accountId, :categoryId )\");\n\n $import->execute(array(\n 'date' \t\t=> $data['date'],\n 'amount' \t\t=> $data['amount'],\n 'name' \t \t\t=> $data['name'],\n 'accountId' \t=> $data['account_id'],\n 'categoryId' \t=> $data['category_id']\n ));\n\n return 'done';\n }", "protected function runTransactionBuild()\n {\n $this->request->transaction = new Transaction($this->request); /* Write the transaction record to disk */\n }", "public function run()\n {\n //\n ItemTransaction::create(['list_id'=>1,'inv_id'=>1,'amount'=>5,'type'=>0,'staff_id'=>1,'date'=>\\Carbon\\Carbon::now(),'remain_qty'=>10]);\n ItemTransaction::create(['list_id'=>1,'inv_id'=>1,'amount'=>5,'type'=>1,'staff_id'=>1,'date'=>\\Carbon\\Carbon::now(),'remain_qty'=>15]);\n }", "public function startTransaction(){\n \n if (!is_a($this->resourceId, \"mysqli\")) {\n $this->setError( _(\"No valid connection resource found\") );\n return false;\n }\n $this->resourceId->autocommit( FALSE ); //Turns autocommit off;\n \n }", "public static function beginTransaction()\n {\n $conn=CSQLMap::getConnection();\n return $conn->beginTransaction();\n }", "public function transactionStart($asSavepoint = false)\n\t{\n\t\t$this->connect();\n\n\t\tif (!$asSavepoint || !$this->transactionDepth)\n\t\t{\n\t\t\tparent::transactionStart($asSavepoint);\n\t\t}\n\n\t\t$savepoint = 'SP_' . $this->transactionDepth;\n\t\t$this->setQuery('SAVEPOINT ' . $this->quoteName($savepoint));\n\n\t\tif ($this->execute())\n\t\t{\n\t\t\t$this->transactionDepth++;\n\t\t}\n\t}", "public function beginTransaction()\n {\n \t// Get writable adapter.\n\t\t$this->_adapter = self::_getAdapterFromPool('master');\n\t\t\n\t\t// Begin a transaction.\n\t\t$successFlag = $this->_adapter->beginTransaction();\n\t\t\n\t\tif ($successFlag) {\n\t\t\t// If begining transaction is successful, set $_isInTransaction flag to true.\n\t\t\t// Once $_isInTransaction = ture, all the adpater return by CrFramework_Db_Control::getAdapter\n\t\t\t// will be master.\n\t\t\tself::$_isInTransaction = true;\n\t\t}\n\t\t\n\t\treturn $successFlag;\n }", "function add_transaction($transaction_id, $date, $time, $customer, $value){\n $str_query=\"insert into pos_transaction set transaction_id='$transaction_id',date='$date',\n time='$time',customer='$customer',value='$value'\";\n return $this->query($str_query);\n }", "public function startTransaction()\n {\n if ($this->transactionLevel === 0)\n {\n if (!$this->pdo->beginTransaction())\n {\n throw new DatabaseException('transaction-start');\n }\n }\n else\n {\n // Save at this point.\n $this->pdo->exec('SAVEPOINT LEVEL' . $this->transactionLevel);\n }\n \n ++$this->transactionLevel;\n }", "function BeginTrans() {}", "public function beginTransaction()\n {\n $ret = (bool)$this->PDO->beginTransaction();\n $ret == false && MyErrorHandler::exceptionLogger('beginTransaction() error', fileName);\n return (bool)$ret;\n }", "public function beginTransaction(){\n\n\t\t\t$this->failedQuery = true;\n\n\t\t\tswitch($this->databaseType){\n\n\t\t\t\tcase 1:\n\t\t\t\t\tmysqli_query($this->connection, \"BEGIN\") or $this->reportQueryError(mysqli_error(), \"BEGIN\", 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\todbc_autocommit($this->connection, false) or $this->reportQueryError(odbc_errormsg(), \"\", 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->connection->beginTransaction() or $this->reportQueryError(implode(\":\", $this->connection->errorInfo()), $query, 2);\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$this->transactionMode = true;\n\t\t}", "public function beginTransaction(): bool\n {\n ($this->currentTransactionLevel == 0)\n ? parent::beginTransaction()\n : $this->exec(\"SAVEPOINT LEVEL$this->currentTransactionLevel\");\n ++$this->currentTransactionLevel;\n return true;\n }", "public function transactional();", "public function run()\n {\n Transaction::factory()\n ->count(10)\n ->state(new Sequence(\n ['type' => 'transfer'],\n ['type' => 'receive'],\n ['type' => 'referral']\n ))->create();\n }", "public final static function beginTx($connection_type=null) {\n // Fail due to invalid num-transactions\n assert(self::$numTransactions >= 0);\n \n // Track number of transactions \n ++self::$numTransactions;\n\n // Short circuit so that we never initiate more than 1 transaction \n if (self::$numTransactions > 1) {\n return;\n }\n \n // Fail due to pre-existing database transaction \n assert(!isset(self::$databaseHandle));\n\n // Fail due to uninitialized database factory\n assert(isset(static::$databaseFactory));\n\n try {\n // Initialize db connection\n self::$databaseHandle = parent::$databaseFactory->getConnection($connection_type);\n self::$databaseHandle->beginTransaction();\n } catch (PDOException $e) {\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n \n // Initialize asset deletors\n self::$assetDeletors = array();\n }", "public function run()\n {\n TransactionType::truncate();\n $data = [\n ['name' => 'Pemasukan', 'category' => 1],\n ['name' => 'Pengeluaran', 'category' => 2],\n ['name' => 'Piutang', 'category' => 1],\n ['name' => 'Target', 'category' => 2],\n ];\n\n TransactionType::insert($data);\n }", "public function startTransaction(?string $connection): void;", "public function beginDBTransaction()\n {\n return $this->getDataMapper()->TransBegin();\n }", "function insert_transaction_record()\n\t{\n\t\t$invoice_id = strtotime('now');\n\t\t\n\t\t$data = array(\n\t\t 'user_id' => $this->user_id,\n\t\t 'invoice_id' => $invoice_id,\n\t\t 'product_id' => $this->auction_id,\t\t \t\t\n\t\t 'credit_debit' => 'DEBIT',\t\t \n\t\t 'transaction_name' =>'Bid Fee For auction ID: '.$this->auction_id,\n\t\t 'transaction_date' => $this->general->get_local_time('time'),\n\t\t 'transaction_type' => 'bid',\n\t\t 'transaction_status' => 'Completed',\t\t \n\t\t 'payment_method' => 'direct',\n\t\t 'amount'=>$this->user_bid_amt,\n\t\t 'pay_type' => $this->payment_type,\n\t \t);\n\t\t\n\t\t$this->db->insert('transaction', $data);\n\t\treturn $this->db->insert_id(); \t\n\t}", "public function run()\n {\n DB::connection('tenant')->beginTransaction();\n\n factory(\\App\\Model\\Master\\Customer::class, 10)->create();\n factory(\\App\\Model\\Master\\Supplier::class, 10)->create();\n factory(\\App\\Model\\Master\\Warehouse::class, 2)->create();\n\n $this->importChartOfAccount();\n $this->seedItems();\n\n DB::connection('tenant')->commit();\n }", "public function run()\n {\n $elements = [\n ['from_id' => 1, 'to_id' => 2, 'details' => 'sample transaction', 'amount' => 14],\n ['from_id' => 1, 'to_id' => 2, 'details' => 'sample transaction 2', 'amount' => 24],\n ['from_id' => 2, 'to_id' => 1, 'details' => 'sample transaction 3', 'amount' => 15],\n ];\n foreach($elements as $element){\n $item = new \\App\\Transaction();\n $item->from_id = $element['from_id'];\n $item->to_id = $element['to_id'];\n $item->details = $element['details'];\n $item->amount = $element['amount'];\n $item->save();\n }\n }", "static function init_transection($dbh)\r\n {\r\n\r\n $dbh->beginTransaction();\r\n\r\n }", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "function begin() {\n\t\t\tself::$db->begin();\n\t\t\t$this->begin_executed = true;\n\t\t}", "function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}" ]
[ "0.8024438", "0.78836364", "0.78535604", "0.76631075", "0.7654583", "0.7533349", "0.7349403", "0.73433846", "0.7340766", "0.7340766", "0.7340766", "0.73401487", "0.731239", "0.7309004", "0.72152275", "0.71524674", "0.71479315", "0.7120124", "0.71138966", "0.7101748", "0.70928144", "0.7000377", "0.69299865", "0.6916208", "0.69153625", "0.6913845", "0.68637174", "0.6862598", "0.6835532", "0.68297154", "0.6810253", "0.68054163", "0.6754191", "0.675188", "0.6750144", "0.67500323", "0.673333", "0.67151684", "0.67143893", "0.67143893", "0.66675866", "0.6650028", "0.664359", "0.6628992", "0.66272753", "0.66246086", "0.6615253", "0.6592686", "0.65864253", "0.65648085", "0.65290964", "0.65206313", "0.6500699", "0.6482483", "0.64692324", "0.6466559", "0.64488983", "0.64488983", "0.64323115", "0.6411343", "0.6403681", "0.6386759", "0.63867587", "0.63718855", "0.6359146", "0.6327201", "0.6319994", "0.6305257", "0.62624025", "0.6224171", "0.61642456", "0.61634827", "0.61192316", "0.61095625", "0.61075026", "0.60856193", "0.60603833", "0.6051949", "0.6047701", "0.60374033", "0.6027798", "0.60124826", "0.60061467", "0.6005746", "0.600345", "0.597441", "0.59676933", "0.59505945", "0.59335583", "0.5896429", "0.5893646", "0.5872661", "0.5853913", "0.5839311", "0.5828633", "0.5817513", "0.581606", "0.58067644", "0.58009446", "0.5791251", "0.5774442" ]
0.0
-1
The default read Action Return the content of the collection, get filters from the request params, get sort from request params
public function indexAction() { // merge filter and tFilter $jsonFilter = $this->params()->fromQuery('filter', '[]'); $jsonTFilter = $this->params()->fromQuery('tFilter', '[]'); $filterArray = Json::decode($jsonFilter, Json::TYPE_ARRAY); $tFilterArray = Json::decode($jsonTFilter, Json::TYPE_ARRAY); $filters = array_merge($tFilterArray, $filterArray); $mongoFilters = $this->_buildFilter($filters); $sort = Json::decode($this->params()->fromQuery('sort', null), Json::TYPE_ARRAY); $start = Json::decode($this->params()->fromQuery('start', null), Json::TYPE_ARRAY); $limit = Json::decode($this->params()->fromQuery('limit', null), Json::TYPE_ARRAY); $dataValues = $this->_dataService->getList($mongoFilters, $sort, $start, $limit, false); $response = array(); $response['total'] = $dataValues['count']; $response['data'] = $dataValues['data']; $response['success'] = TRUE; $response['message'] = 'OK'; return $this->_returnJson($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n \n /* return *///$sort \n\n \n $articles = Article::query();\n\n /* foreach($sort as $sortcol)\n {\n $sortdir = starts_with($sortcol, '-') ? 'desc' : 'asc';\n\n $sortCol = ltrim($sortcol, '-');\n\n $articles->orderBy($sortCol, $sortdir);\n } */\n\n if(request()->has('filterBy'))\n {\n list($criteria, $value) = explode(':', request()->filterBy);\n\n $articles->where($criteria, $value);\n }\n\n return ArticleResource::collection($articles->paginate(15));\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 readAction() {\n\t\tif(getParam('id')){\n\t\t\t$model = new $this->model(intval(getParam('id')));\n\t\t\t$records = array(\n\t\t\t\t$this->formatRow($model->get())\n\t\t\t);\n\t\t\t$this->setParam('records', $records);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// get submitted params\n\t\t$sortBy = getParam('sort', false);\n\t\t$filter = json_decode(getParam('filter', '{}'), true);\n\t\t\n\t\t// Setup the filtering and query variables\n\t\t$start = intval(getParam('start', 0));\n\t\t$limit = intval(getParam('limit', 0));\n\t\t\n\t\t//Fields to select\n\t\t$fields = $this->getFields();\n\t\t\n\t\t//From to use\n\t\t$from = $this->getFrom();\n\t\t\n\t\t//Join tables\n\t\t$join = $this->getJoin();\n\t\t\n\t\t//Base where clause\n\t\t$where = $this->getWhere();\n\t\t\n\t\t//Sort\n\t\t$sort = $this->getSort();\n\t\t\n\t\tif ($sortBy) {\n\t\t\t$sortArray = json_decode($sortBy, true);\n\t\t\t$numSorters = count($sortArray);\n\t\t\t$sort = array();\n\t\t\tfor ($i = 0; $i < $numSorters; $i++) {\n\t\t\t\t$sort[] = $sortArray[$i]['property'] . ' ' . $sortArray[$i]['direction'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Filter\n\t\t$where = array_merge($where, $this->applyFilter($filter));\n\t\t\n\n\t\t\n\t\t// convert query data to sql\n\t\t$fieldsSql = implode(',', $fields);\n\t\t$fromSql = ' FROM ' . implode(',', $from);\n\t\t$joinSql = implode(' ', $join);\n\t\t$whereSql = 'WHERE ' . implode(' AND ', $where);\n\t\tif (!count($where)) {\n\t\t\t$whereSql = '';\n\t\t}\n\t\t$sortSql = implode(',', $sort);\n\n\t\t// get total count\n\t\t$total = 0;\n\t\t$totalQuery = \"SELECT COUNT(*) total $fromSql $joinSql $whereSql\";\n\t\t$row = LP_Db::fetchRow($totalQuery);\n\t\tif ($row) {\n\t\t\t$total = $row['total'];\n\t\t}\n\t\t$this->setParam('total', $total);\n\t\t\n\t\t// get records\n\t\t$query = \"SELECT $fieldsSql $fromSql $joinSql $whereSql\";\n\t\t$this->setParam('query', $query);\n\t\tif($limit){\n\t\t\t$query = LP_Util::buildQuery($query, $sortSql, $limit, $start);\n\t\t}\n\t\t$rows = LP_Db::fetchAll($query);\n\t\t$numRows = count($rows);\n\t\t$records = array();\n\t\t\n\t\t//Format rows\n\t\tforeach ($rows as $row){\n\t\t\t$records[] = $this->formatRow($row);\n\t\t}\n\t\t\n\t\t$this->setParam('records', $records);\n\t}", "public function index()\n {\n $sort = FacadesRequest::get('sort');\n $dir = FacadesRequest::get('direction');\n\n if ($sort == '')\n $sort = 'created_at';\n\n $search = FacadesRequest::get('q');\n if ($search != '') {\n $pages = Page::where('name', 'LIKE', '%' . $search . '%')\n ->orWhere('description', 'LIKE', '%' . $search . '%')\n ->orderBy($sort, $dir)->paginate(10);\n }\n else {\n $pages = Page::orderBy($sort, $dir)->paginate(10);\n }\n\n\n return PageResource::collection($pages);\n }", "public function cgetAction()\n {\n $page = (int) $this->getRequest()->get('page', 1);\n $limit = (int) $this->getRequest()->get('limit', self::ITEMS_PER_PAGE);\n\n return $this->handleGetListRequest($page, $limit);\n }", "public function cgetAction()\n {\n $page = (int) $this->getRequest()->get('page', 1);\n $limit = (int) $this->getRequest()->get('limit', self::ITEMS_PER_PAGE);\n\n return $this->handleGetListRequest($page, $limit);\n }", "public function read()\n {\n return Contest::paginate(5);\n }", "public function index(Request $request)\n {\n $query = $request->query();\n\n\n if(isset($query['sort'])){\n if($query['sort'] === 'nameAsc'){\n $authors = Author::orderBy('name', 'asc');\n return new AuthorCollection($authors->paginate(10));\n }\n else if($query['sort'] === 'nameDesc'){\n $authors = Author::orderBy('name', 'desc');\n return new AuthorCollection($authors->paginate(10));\n }\n \n } \n else{\n return new AuthorCollection(Author::paginate(10));\n }\n \n }", "public function index()\n {\n $posts = Post::included()->filter()->sort()->getOrPaginate();\n // return $categories;\n return PostResource::collection($posts); //Para una o varias respuestas\n }", "public function index()\n {\n return Collection::on()->when($this->request->search, function ($query) {\n $query->where('name', 'ILIKE', '%' . $this->request->search . '%');\n $query->orWhere('description', 'ILIKE', '%' . $this->request->search . '%');\n })->when($this->request->limit, function ($query) {\n $query->limit($this->request->limit);\n })->when($this->request->page, function ($query) {\n $query->offset($this->request->limit * ($this->request->page - 1));\n })->orderBy('count_copies', 'desc')->get();\n }", "public function index_get() {\n $action = $this->get('action');\n switch ($action) {\n case \"retrieve_get\":\n $this->retrieve_get();\n break;\n default:\n $this->not_found();\n break;\n }\n }", "public function getAll()\n {\n $this->authorizeUserAction('viewAll');\n\n $model = new static::$model;\n\n // If we are caching the endpont, do a simple get all resources\n if (static::$cacheAll) {\n return $this->response->collection(Cache::remember(static::getCacheKey(), static::$cacheExpiresIn, function () use ($model) {\n return $model::with($model::getCollectionWith())->get();\n }), $this->getTransformer());\n }\n\n $query = $model::with($model::getCollectionWith());\n $this->qualifyCollectionQuery($query);\n\n // Handle pagination, if applicable\n $perPage = $model->getPerPage();\n if ($perPage) {\n // If specified, use per_page of the request\n if (request()->has('per_page')) {\n $perPage = intval(request()->input('per_page'));\n }\n\n $paginator = $query->paginate($perPage);\n\n return $this->response->paginator($paginator, $this->getTransformer());\n } else {\n $resources = $query->get();\n\n return $this->response->collection($resources, $this->getTransformer());\n }\n }", "public function getItems()\n {\n $pageSize = $this->request->query('pageSize') ?? 30;\n $page = $this->request->query('page') ?? 1;\n $sortBy = $this->request->query('sort') ?? 'title_asc';\n $search = $this->request->has('search') ? $this->request->query('search') : null;\n $allowedFields = ['title', 'author', 'isbn'];\n $allowedOrder = ['asc', 'desc'];\n $sort = ControllerHelpers::deserializeSort($sortBy, $allowedFields, $allowedOrder);\n if (!$sort) {\n return response()->json([\n 'success' => false,\n 'message' => 'Please enter a valid sort params'\n ], 400);\n }\n\n $items = new ItemService();\n try {\n $result = $items->getItems($page, $pageSize, $search, $sort);\n if ($result) {\n return response()->json([\n 'success' => true,\n 'items' => $result\n ], 200);\n }\n } catch (Exception $ex) {\n return response()->json([\n 'success' => false,\n 'message' => 'your request could not be completed'\n ], 400);\n }\n\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "public function action_read(){\t\t\n\t\t$result = '';\t\t\n//\t\tLog::instance()->add(Log::NOTICE, Debug::vars($this->request->param('table_name')));\n//\t\t$obj = new stdClass;\n//\t\t$obj->username = \"This is the content\";\n\t\tif ($this->request->method() === Request::POST)\n\t\t{\n\t\t\tlist($navigation,) = array_values(Arr::extract(\n\t\t\t\t\t$this->request->post(), array(\n\t\t\t\t\t\t'navigation'\n\t\t\t\t\t)));\n//\t\t\tLog::instance()->add(Log::NOTICE, Debug::vars(Route::get($this->request->directory()->uri(\n//\t\t\t\tarray('controller'=> $this->request->controller())\n//\t\t\t))));\n\t\t\t$this->request->redirect(Route::get($this->request->directory())->uri(\n\t\t\t\tarray(\n\t\t\t\t\t'controller'=> $this->request->controller(),\n\t\t\t\t\t'action'=>'read'\n\t\t\t\t)\n\t\t\t).'/'.$navigation);\n\t\t\n\t\t}\n\t\t$table_name = $this->request->param('table_name');\n\t\tif($table_name){\n\t\t\t$datalog = $this->_get_datalog($table_name);\n\t\t\t$result = View::factory('datalog')\n\t\t\t\t->set('show_table',TRUE)\n\t\t\t\t->set('datalog',$datalog);\n\t\t}\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t$this->view->result = $result;\n\n//\t\t$this->template->content = Message::display();\n// Log::instance()->add(Log::NOTICE, Route::url('admin'));\n// $this->request->redirect('admin/news');\n// $this->response->body('admin');\n }", "public function index() {\n\n\t\t$conditions = array();\n\t\tif((isset($this->request->query['q'])) && (!empty($this->request->query['q']))) {\n\t\t\t$search_schema = Content::searchSchema();\n\t\t\t$search_conditions = array();\n\t\t\t// For each searchable field, adjust the conditions to include a regex\n\t\t\tforeach($search_schema as $k => $v) {\n\t\t\t\t$field = (is_string($k)) ? $k:$v;\n\t\t\t\t$search_regex = new \\MongoRegex('/' . $this->request->query['q'] . '/i');\n\t\t\t\t$conditions['$or'][] = array($field => $search_regex);\n\t\t\t}\n\t\t}\n\n\t\t$conditions += array('published' => true);\n\n\t\t$limit = $this->request->limit ?: 5;\n\t\t$page = $this->request->page ?: 1;\n\t\t// Allow querystring params for these as well.\n\t\t$page = (isset($this->request->query['page'])) ? $this->request->query['page']:$page;\n\t\t$limit = (isset($this->request->query['limit'])) ? $this->request->query['limit']:$limit;\n\t\t$order = array('created' => 'desc');\n\t\t$total = Content::count(compact('conditions'));\n\t\t$documents = Content::all(compact('conditions','order','limit','page'));\n\n\t\t$page_number = (int)$page;\n\t\t$totalPages = ((int)$limit > 0) ? ceil($total / $limit):0;\n\n\t\t// Set data for the view template\n\t\treturn compact('documents', 'total', 'page', 'limit', 'totalPages');\n\t}", "public function readAction()\n {\n }", "public function readAction(){\n\n //Pega o id do veiculo\n $veiculo = Application::getParam('id');\n if($veiculo === null){\n return json_encode(array(\n 'success' => false,\n 'message' => 'Veiculo é inválido ou não existe.',\n 'code' => 0\n ));\n }\n\n try {\n //Pega o veiculo solicitado\n $model = Veiculo::findOneBy(array('id' => $veiculo));\n }\n catch (\\Exception $e){\n\n //Caso algo dê errado, retorna uma menssagem de erro\n return json_encode(array(\n 'success' => false,\n 'message' => $e->getMessage(),\n 'code' => $e->getCode()\n ));\n }\n\n //Retorna os dados encontrados\n return json_encode(array(\n 'success' => true,\n 'data' => array($model->toArray()),\n 'total' => 1\n ));\n }", "public function index()\n {\n if (\\Request::exists('all')) {\n return $this->service\n ->with(['persons'])\n ->filters($this->filter)\n ->select('id', 'name')\n ->get();\n }\n\n $order = Str::contains(\\Request::get('orderBy'), ['asc', 'desc'])\n ? \\Request::get('orderBy')\n : 'desc';\n\n return $this->service\n ->showAll()\n ->orderBy('updated_at', $order)\n ->filters($this->filter)\n ->paginate(\n request(\n 'per_page',\n \\Request::get('per_page') ?? 15\n )\n );\n }", "public function index()\n {\n return Resource::collection(Query::get(request('query', 'default')));\n }", "public function findAllAction();", "public function indexForFilter(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $query = $this->{$this->main_model}->find();\n $this->CommonQuery->build_common_query($query,$user,[]); \n $q_r = $query->all();\n $items = array();\n foreach($q_r as $i){\n array_push($items,array(\n 'id' => $i->id, \n 'text' => $i->name\n ));\n } \n\n $this->set(array(\n 'items' => $items,\n 'success' => true,\n '_serialize' => array('items','success')\n ));\n }", "public function index($filter_by=null)\n {\n // dd($filter_by);\n $this->get(null, $filter_by);\n // return ;\n return ['data'=> $this->itemList];\n\n }", "public function loadDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n\n $filter = new Service_Api_Filter_Content();\n\n $filter->id = $this->_getParam('id');\n $filter->mimeType = $this->_getParam('mimeType');\n $filter->limit = $this->_getParam('limit');\n $filter->offset = $this->_getParam('offset');\n $filter->search = $this->_getParam('search');\n $filter->sources = $this->_getParam('sources');\n $filter->format = $this->_getParam('dim');\n $filter->properties = $this->_getParam('properties');\n $contents = $contentService->contentsRead($filter);\n $this->view->data = $contents;\n }", "public function read(){\n\t\t\t$recordPerPage = 25;\n\t\t\t//tinh so trang\n\t\t\t$numPage = ceil($this->modelTotal()/$recordPerPage);\n\t\t\t//goi ham de lay du lieu\n\t\t\t$listRecord = $this->modelRead($recordPerPage);\n\t\t\t//load view\n\t\t\tinclude \"Views/BlogsView.php\";\n\t\t}", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function getAll()\n {\n $model = new static::$model;\n\n $per_page = request('per_page');\n $query = $model::with($model::$localWith);\n $this->qualifyCollectionQuery($query);\n\n // Handle pagination, if applicable\n if( $per_page ) $model->setPerPage($per_page);\n\n $perPage = $model->getPerPage();\n if ($perPage) {\n $paginator = $query->paginate($perPage);\n return $this->response->paginator($paginator, $this->getTransformer());\n } else {\n $resources = $query->get();\n\n return $this->response->collection($resources, $this->getTransformer());\n }\n }", "public function index()\n {\n // return collection of articles\n return ArticleResource::collection(Article::orderBy('created_at', 'desc')->paginate(6));\n }", "public function index()\n {\n return TodoResource::collection(\n Todo::with('category', 'priority')->get()\n );\n }", "public function index()\n {\n //\n return OrderResource::collection(Order::paginate());\n }", "public function index(Request $request)\n {\n $search = $request->get('search', false);\n $order = $request->get('order', 'nama');\n $perpage = $this->getValidPerpage($request->get('perpage'));\n $order_direction = $request->get('order_direction', 'asc');\n\n $record = ReagenPCR::query();\n $record->when($search, function ($query) use ($search) {\n $query->where(function ($query) use ($search) {\n $query->where('nama', 'ilike', '%' . $search . '%');\n if (filter_var($search, FILTER_VALIDATE_INT)) {\n $query->orWhere('ct_normal', (int) $search);\n }\n });\n });\n $isAllowedOrder = ['nama', 'ct_normal'];\n $record->when(in_array($order, $isAllowedOrder), function ($query) use ($order, $order_direction) {\n $query->orderBy($order, $this->getValidOrderDirection($order_direction));\n });\n return ReagenPCRResource::collection($record->paginate($perpage));\n }", "public function read($id=null) {\n\t\tif(empty($id)) {\n\t\t\treturn $this->redirect('/');\n\t\t}\n\n\t\tif(preg_match('/[0-9a-f]{24}/', $id)) {\n\t\t\t$field = '_id';\n\t\t} else {\n\t\t\t$field = 'url';\n\t\t}\n\n\t\t$isAdmin = (isset($this->request->user['role']) && $this->request->user['role'] == 'administrator') ? true:false;\n\t\t$conditions = $isAdmin ? array($field => $id):array($field => $id, 'published' => true);\n\n\t\t// Requested content type must match. TODO: Allow pretty URLs to be duplicated if the _type is different.\n\t\tif(isset($this->request->contentType)) {\n\t\t\t$conditions['_type'] = $this->request->contentType;\n\t\t\t// It is possible to have snippets of text content. However, these documents shouldn't be seen on their own.\n\t\t\tif($this->request->contentType == 'text') {\n\t\t\t\treturn $this->redirect('/');\n\t\t\t}\n\t\t}\n\n\t\t$document = Content::find('first', array('conditions' => $conditions));\n\n\t\tif(empty($document) || !$document->published) {\n\t\t\tFlashMessage::write('Sorry, that content does not exist or is not published.');\n\t\t\treturn $this->redirect('/');\n\t\t}\n\n\t\t$defaultAppConfig = Libraries::get(true);\n\t\t$appPath = $defaultAppConfig['path'];\n\t\tif(!empty($document->_type)) {\n\t\t\t$this->_render['template'] = $document->_type . '/read';\n\t\t}\n\t\t$this->_render['paths']['template'] = array(\n\t\t\t$appPath . '/views/_libraries/blackprint/{:controller}/{:template}.{:type}.php',\n\t\t\t'{:library}/views/{:controller}/{:template}.{:type}.php',\n\t\t\t$appPath . '/views/_libraries/blackprint/{:controller}/read.{:type}.php',\n\t\t\t'{:library}/views/{:controller}/read.{:type}.php',\n\t\t);\n\t\t\n\t\t$options = $document->options ? $document->options->data():Content::$defaultOptions;\n\n\t\t// Set meta and OG tags\n\t\tif(isset($document->og)) {\n\t\t\tif(isset($this->request->blackprintConfig['og'])) {\n\t\t\t\t$this->request->blackprintConfig['og'] += $document->og->data();\n\t\t\t} else {\n\t\t\t\t$this->request->blackprintConfig['og'] = $document->og->data();\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->set(compact('document', 'options'));\n\t}", "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 index()\n {\n return AuthorResource::collection(Author::get()->take(3));\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 $query = Company::query();\n\n $parameters = $parameters = request()->query->all();\n\n $this->sortBy(Company::class, $query, $parameters);\n\n $this->filterBy(Company::class, $query, $parameters);\n \n return CompanyResource::collection($query->paginate(10));\n }", "public function index(Request $request): AnonymousResourceCollection\n {\n $sortField = $request->sort_field ?: 'created_at';\n\n if (!in_array($sortField, ['title', 'post_text', 'created_at'])) {\n $sortField = 'created_at';\n }\n\n $sortDirection = $request->sort_direction ?: 'desc';\n\n if (!in_array($sortDirection, ['asc', 'desc'])) {\n $sortDirection = 'desc';\n }\n\n $filled = array_filter(request()->only([\n 'title',\n 'post_text',\n 'created_at'\n ]));\n\n $categoryId = $request->category_id ?: '';\n\n $posts = Post::when(count($filled) > 0, function($query) use ($filled) {\n foreach ($filled as $column => $value) {\n $query->where($column, 'LIKE', '%' . $value . '%');\n }\n })->when(request('search', '') != '', function($query) {\n $query->where(function ($q) {\n $q->where('title', 'LIKE', '%' . request('search') . '%')\n ->orWhere('post_text', 'LIKE', '%' . request('search') . '%')\n ->orWhere('created_at', 'LIKE', '%' . request('search') . '%');\n });\n })->when($categoryId !== '', function ($query, $categoryId) {\n $query->where('category_id', $categoryId);\n })->orderBy($sortField, $sortDirection)->paginate(5);\n\n return PostResource::collection($posts);\n }", "public function read(){\n\t\t\t//quy dinh so ban ghi tren mot trang\n\t\t\t$recordPerPage = 20;\n\t\t\t//tinh so trang\n\t\t\t$numPage = ceil($this->totalRecord()/$recordPerPage);\n\t\t\t//goi ham ModelRead tu class UsersModel de lay ket qua\n\t\t\t$listRecord = $this->ModelRead($recordPerPage);\n\t\t\t//load view\n\t\t\tinclude \"Views/CategoriesRead.php\";\n\t\t}", "public function index()\n {\n //$lim = 5;\n /*\n $vars = [\n \"customers\" => CustomerResource::collection(Customer::all()),\n \"transactions\" => TransactionResource::collection(Transaction::paginate(5)),\n \"search\" => \"\"\n ];\n return $vars;\n */\n $transactions = Transaction::orderBy('updated_at', 'desc')->paginate(5);\n $t = TransactionResource::collection($transactions);\n return $t; \n }", "public function getOrderedListAction()\r\n {\r\n // merge filter and tFilter\r\n $jsonFilter = $this->params()->fromQuery('filter', '[]');\r\n $jsonTFilter = $this->params()->fromQuery('tFilter', '[]');\r\n $filterArray = Json::decode($jsonFilter, Json::TYPE_ARRAY);\r\n $tFilterArray = Json::decode($jsonTFilter, Json::TYPE_ARRAY);\r\n $filters = array_merge($tFilterArray, $filterArray);\r\n $sort = Json::decode($this->params()->fromQuery('sort', null), Json::TYPE_ARRAY);\r\n $start = Json::decode($this->params()->fromQuery('start', null), Json::TYPE_ARRAY);\r\n $limit = Json::decode($this->params()->fromQuery('limit', null), Json::TYPE_ARRAY);\r\n $mongoFilters = $this->_buildFilter($filters);\r\n return new JsonModel($this->_dataService->getOrderedList($mongoFilters, $sort, $start, $limit, false));\r\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function get_collection_params()\n {\n }", "public function index(): AnonymousResourceCollection\n {\n return CommerceResource::collection(Commerce::latest()->paginate());\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $posts = Post::latest()->with('author')->paginate(5);\n $filtered = $posts->whereIn('audience', ['public']);\n return PostResource::collection($filtered);\n }", "public function indexAction(): object\n {\n // Sets webpage title\n $title = \"Show all content with sorting and pagination\";\n\n // Sets extended webpage title\n $titleExtended = \" | Eshop\";\n\n // Framework variables\n $response = $this->app->response;\n $session = $this->app->session;\n\n // Verifies if user is logged in\n if (!$session->get(\"loggedIn\")) {\n $response->redirect(\"eshop/login\");\n };\n\n // Retrieves title\n $searchTitle = getGet(\"searchTitle\") ?? null;\n\n // Connects to db\n $this->app->db->connect();\n\n if ($searchTitle) {\n // Fetches data from db and stores in $resultset\n $resultset = $this->admin->getItem($searchTitle);\n } else {\n // Get number of hits per page\n $hits = getGet(\"hits\", 8);\n if (!(is_numeric($hits) && $hits > 0 && $hits <= 8)) {\n die(\"Not valid for hits.\");\n }\n\n // Get max number of pages\n $max = $this->admin->getMaxNumberOfItems();\n $max = ceil($max[0]->max / $hits);\n\n // Get current page\n $page = getGet(\"page\", 1);\n if (!(is_numeric($hits) && $page > 0 && $page <= $max)) {\n die(\"Not valid for page.\");\n }\n\n $offset = $hits * ($page - 1);\n\n // Only these values are valid\n $columns = [\"id\", \"title\", \"type\", \"published\", \"created\", \"updated\", \"deleted\"];\n $orders = [\"asc\", \"desc\"];\n\n // Get settings from GET or use defaults\n $orderBy = getGet(\"orderby\") ?: \"id\";\n $order = getGet(\"order\") ?: \"asc\";\n\n // Incoming matches valid value sets\n if (!(in_array($orderBy, $columns) && in_array($order, $orders))) {\n die(\"Not valid input for sorting.\");\n }\n\n // Calls sortBlogposts method and stores data in $resultset\n $resultset = $this->admin->sortItems($orderBy, $order, $hits, $offset);\n }\n\n // Data array\n $data = [\n \"title\" => $title,\n \"titleExtended\" => $titleExtended,\n \"resultset\" => $resultset,\n \"max\" => $max ?? null,\n \"searchTitle\" => $searchTitle\n ];\n\n // Includes admin header\n $this->app->page->add(\"content/header_admin\");\n\n // Adds route and sends data array to view\n $this->app->page->add(\"content/admin\", $data);\n\n // Renders page\n return $this->app->page->render($data);\n }", "public function getCollection() {\n return $this->gateway->find(\n $this->getFilter(),\n $this->order,\n $this->relations,\n $this->pager,\n !$this->excludeRepo\n );\n }", "public function index()\n {\n return PhotographResource::collection(Photograph::orderBy('sort', 'asc')->get());\n }", "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 index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function getSort(Request $request)\n {\n $this->repo->grabAllLists();\n\n $model = $this->repo->makeQuery();\n\n $sortable = true;\n\n if ($this->repo->isSortFilterFormConfigExists()){\n $sortable = false;\n\n if ($request->has('filter')) {\n $sortable = true;\n $filter = array_except($request->query(), $this->filterExcept);\n \n foreach ($filter as $item) {\n if (! $item) $sortable = false;\n }\n\n $model = $this->repo->filter($filter, $model);\n }\n\n view()->share('beforeSortShouldFilter', ! $sortable);\n view()->share('filterForm', Formaker::setModel($this->repo->getModel())->make($request->all()));\n }\n\n $limit = $request->input('perPage', $this->paginationCount);\n\n $items = $this->repo->showByPage($limit, $request->query(), $model->with($this->relations));\n\n $data = ['paginationCount'=>$limit, 'sortable'=>$sortable, 'rules'=>$this->functionRules];\n $lister = Lister::make($items, $this->listConfig, $data);\n \n event('controllerAfterAction', ['']);\n\n return $this->layout()->with('listEmpty', $items->isEmpty())\n ->with('sortable', $sortable)\n ->with('lister', $lister);\n }", "public function index()\n {\n $tasks = auth()->user()->tasks()->with('category', 'comments', 'files')->paginate(100);\n return TaskResource::collection($tasks);\n }", "public function index()\n {\n //if (\\Gate::allows('isAdmin') || \\Gate::allows('isAuthor')) {\n return Curso::latest()->paginate(5);\n //}\n }", "public function index(Request $request)\n {\n return FoodResource::collection(Food::paginate($request->perPage ?? 5));\n }", "public function getRmaCollection()\n {\n $id = $this->getRequest()->getParam('id');\n return $this->requestFactory->create()->load($id);\n }", "public function index(Request $request)\n {\n try {\n $model = $this->getModel();\n $lstRecords = $model->queryByModel($request->all());\n //return RestResource::collection($lstRecords);\n //return RestResource::collection($lstRecords);\n //return $lstRecords;\n //return RestResource::collection($lstRecords);\n return $lstRecords;\n } catch (\\Exception $ex) {\n return $this->respondError($ex);\n }\n }", "public static function readAll() {\n $tab_p = ModelProduit::selectAll();\n $controller = \"produit\";\n $view = \"listProduit\";\n $pagetitle = \"Liste des produits\";\n require File::build_path(array('view', 'view.php'));\n }", "public function run_read($filter = '', $sort = ''){\n $sql = $this->prepare_read($filter, $sort);\n $res = $this->run($sql);\n return mysqli_fetch_all($res, MYSQLI_ASSOC);\n }", "public function index()\n {\n //$articles = Articles::all(); //get all the articles\n //get a list of articles by pagination\n $articles = Articles::take(20)->paginate(10);\n return ArticlesApiResource::collection($articles);\n }", "public function index()\n {\n $post = Post::paginate(5);\n return postresource::collection($post);\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 $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function searchAction()\n {\n $collection = $this->search($this->getRequest());\n return $this->toJson($collection->toArray());\n }", "public function index()\n {\n $pages = Page::active()->orderBy('order' , 'DESC')->get();\n\n return PageResource::collection($pages);\n }", "public function readChildAction()\r\n {\r\n $filterJson = $this->params()->fromQuery('filter');\r\n if (isset($filterJson)) {\r\n $filters = Json::decode($filterJson, Json::TYPE_ARRAY);\r\n } else {\r\n $filters = null;\r\n }\r\n $sortJson = $this->params()->fromQuery('sort');\r\n if (isset($sortJson)) {\r\n $sort = Json::decode($sortJson, Json::TYPE_ARRAY);\r\n } else {\r\n $sort = null;\r\n }\r\n $parentId = $this->params()->fromQuery('node', 'root');\r\n $mongoFilters = $this->_buildFilter($filters);\r\n $dataValues = $this->_dataService->readChild($parentId, $mongoFilters, $sort, false);\r\n $response = array();\r\n $response['children'] = array_values($dataValues);\r\n $response['total'] = count($response['children']);\r\n $response['success'] = TRUE;\r\n $response['message'] = 'OK';\r\n return $this->_returnJson($response);\r\n }", "public function index_get() {\n $action = $this->get('action');\n switch ($action) {\n case \"listbookmark\":\n $this->listbookmark();\n break;\n case \"listbookmarkfilterbyname\":\n $this->listbookmarkfilterbyname();\n break;\n case \"retrieve_get\":\n $this->retrieve_get();\n break;\n default:\n $this->not_found();\n break;\n }\n }", "public function index()\n {\n //$this->authorize('view',Patient::class);\n return new PatientCollection(Patient::paginate(10));\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}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function index(){\n return CategoryResource::collection(Category::orderBy('id','DESC')->paginate(10));\n }", "public function processGet() {\n if (!isset($this->arguments[\"data\"])) {\n $this->inmueblesDestacados();\n } else if (is_numeric($this->arguments[\"data\"])) {\n $this->view((int) $this->arguments[\"data\"]);\n } else {\n $this->findByfilters($this->arguments[\"data\"]);\n }\n }", "public function getAction() {\r\n \t\r\n \t$data = $this->getMapper()->fetch($this->getRequest());\r\n \t\r\n \tif (is_array($data)) {\r\n \t\t$this->view->data = $data;\r\n \t} else {\r\n \t\t$this->view->data = $data->toArray();\r\n \t}\r\n \t$this->view->total = $this->getMapper()->rowCount();\r\n \treturn $this->view->data;\r\n }", "public function index()\n {\n //根据id查询,角色名查询,描述查询\n return $this->response()->paginator($this->repository->paginate(),new CommonTransformer());\n }", "public function index()\n {\n $requests = Requests::all();\n return RequestResource::collection($requests); \n }", "public function read( $id = null ){\n\n\t\t/* set method */\n\t\t$this->request_method = 'read';\n\t\t\n\t\t/* read the data from backbone */\n\t\t$this->parse_model_request();\n\n\t\tif($this->get_errors())\n\t\t\treturn;\n\t\t\t\t\n\t\t/* set id */\n\t\tif($id)\n\t\t\t$this->id = $id;\n\n\t\t/* when caching is enabled, try to get the cache */\n\t\tif($this->cache_time && false !== $this->get_cache()) {\n $query = $this->get_cache();\n $this->query = $query;\n\n\t\t/* call the database query */\n\t\t} else {\n \t\tif($this->id) \n \t\t\t$query = $this->_query_single();\n \t\telse\n \t\t\t$query = $this->_query_all();\t\t\t\t\t \t\t\n\t\t}\n\t\t\t\n\n\t\t/* format the retrieved models */\n\t\t$this->parse_model_response($query);\t\n\t\t\n do_action('bb-wp-api_after_read', $this->id, $this->properties, $this );\n\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }" ]
[ "0.71956176", "0.6952709", "0.69207686", "0.6442485", "0.6320944", "0.6320944", "0.63077927", "0.6276717", "0.6242123", "0.6203577", "0.6187756", "0.61778027", "0.61718285", "0.6163955", "0.61636657", "0.61635077", "0.6118013", "0.6116387", "0.6108365", "0.6090199", "0.60769534", "0.6072776", "0.6053837", "0.6044453", "0.6025228", "0.6023354", "0.6023354", "0.6016142", "0.6005948", "0.59680486", "0.59557915", "0.59455675", "0.5942005", "0.59395117", "0.59370565", "0.5936445", "0.592984", "0.5922803", "0.5921547", "0.5899671", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.5888373", "0.588749", "0.58750963", "0.5872337", "0.58653903", "0.58611536", "0.5854709", "0.58515", "0.583703", "0.58097166", "0.58052945", "0.5801704", "0.5799199", "0.57903904", "0.5779023", "0.57756734", "0.57724226", "0.5764601", "0.5763582", "0.57596755", "0.57516587", "0.57485974", "0.57474923", "0.5739088", "0.5734175", "0.5732912", "0.5727627", "0.57260084", "0.57136434", "0.57135177", "0.57084495", "0.5702288", "0.5698631", "0.56954074", "0.5694187", "0.56894034" ]
0.57027173
95
read child action Return the children of a node
public function readChildAction() { $filterJson = $this->params()->fromQuery('filter'); if (isset($filterJson)) { $filters = Json::decode($filterJson, Json::TYPE_ARRAY); } else { $filters = null; } $sortJson = $this->params()->fromQuery('sort'); if (isset($sortJson)) { $sort = Json::decode($sortJson, Json::TYPE_ARRAY); } else { $sort = null; } $parentId = $this->params()->fromQuery('node', 'root'); $mongoFilters = $this->_buildFilter($filters); $dataValues = $this->_dataService->readChild($parentId, $mongoFilters, $sort, false); $response = array(); $response['children'] = array_values($dataValues); $response['total'] = count($response['children']); $response['success'] = TRUE; $response['message'] = 'OK'; return $this->_returnJson($response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_children();", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren(): array;", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChilds();", "public function getChildNodes() {}", "public function getChildNodes() {}", "function children() {\n\t\t$this->load_children();\n\t\treturn $this->_children;\n\t}", "public function getChildrenQuery();", "public function getChildren()\n {\n }", "public function getChildren()\n {\n }", "public function getChildNodes();", "function getChildNodes() ;", "public function getChildren()\n {\n return $this->children;\n }", "public function get_children() {\n\t\treturn $this->children;\n\t}", "public function getChildren(): ?array;", "public function getChildren() \n {\n return $this->children;\n }", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->_children;\n\t}", "public function children($id);", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren() {\n\t\treturn $this->children;\n\t}", "public function getChildren()\r\n\t{\r\n\t\treturn $this->childrenNodes;\r\n\t}", "public function myChildren()\n {\n return File::get()->filter(\"ParentID\", $this->ID);\n }", "public function children()\r\n\t{\r\n\t\treturn $this->children;\r\n\t}", "public function getChildren()\n {\n return $this->_children;\n }", "function _gatherChildren($nid) {\n\t$return = array();\n\t$node =& $this->_allNodes[$nid];\n\tif (is_array ($this->_allParent[$node->id])) {\n\t\tforeach ($this->_allParent[$node->id] as $nodeZ) {\n\t\t$z =& $this->_allNodes[$nodeZ];\n\t\t// We found a child\n\t\t$this->_nodeArrayizeData($z);\n\t\t// Check for references\n\t\t$this->_makeReferences($z);\n\t\t// Merge with the big array we're returning\n\t\t// The big array being all the data of the children of our parent node\n\t\t$return = $this->_array_kmerge($return,$z->data);\n\t\t}\n\t}\n\treturn $return;\n\t}", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "public function getChildren()\n {\n return $this->children;\n }", "function get_children($args = '', $output = \\OBJECT)\n {\n }", "public function getChildren () {\n return $this->current ();\n }", "public function iterateChildren();", "public function children (){\n\t\treturn array();\n\t}", "function getChilds($id = NULL);", "public function getChildren()\n\t{\n\t\treturn $this->_auth->getItemChildren($this->_calendarId,$this->_name);\n\t}", "public function get_children() : array\n {\n return $this->children;\n }", "public function GetChildren() {\n\t\treturn $this->Children;\n\t}", "public function get_child($child_id)\n {\n }", "protected function getChildNodeData() {\n\t\treturn $this->nodeDataRepository->findByParentWithoutReduce($this->path, $this->workspace);\n\t}", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "public function getChildren()\n {\n // Singleton: both getChild and getChildren are called\n // by the Sabre_DAV_Browser_Plugin\n if (empty($this->children)) {\n $storedFiles = $this->fileStorage->get_directory_files(\n $this->storedFile->get_contextid(),\n $this->storedFile->get_component(),\n $this->storedFile->get_filearea(),\n $this->itemId,\n $this->storedFile->get_filepath(),\n false, // recursive\n true, // includedirs\n 'filepath ASC, filename ASC' // sort\n );\n\n foreach ($storedFiles as $storedFile) {\n if ($storedFile->is_directory()) {\n $this->children[][] = new DAVRootPoolDirectory($storedFile);\n } else {\n $this->children[][] = new DAVRootPoolFile($storedFile);\n }\n }\n }\n\n return $this->children;\n }", "public function getChildren() {\n $childNodes = $this->getNode()->getChildren();\n $children = array();\n foreach ($childNodes as $childNode) {\n $child = $childNode->getPage($this->getLang());\n if ($child) {\n $children[] = $child;\n }\n }\n return $children;\n }", "final public function getChildren() {\n\t\treturn array();\n\t}", "abstract protected function getCurrentChildren(): array ;", "public function children()\n {\n $this->buildTree();\n return $this->childrenInternal();\n }", "public function getChildren($id){\n return $this->getTable()->where($this->treeParentRow,$id);\n }", "public function children()\n {\n return (array) $this->children;\n }", "public function children()\n\t{\n\t\treturn $this->descendants(1);\n\t}", "public function findChildren()\n {\n return self::where('code_parrent',$this->id)->get();\n }", "public function getChildren() {\n\t\t$children = $this->categoryRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function getChildren(array $columns = ['*']);", "public function getChildren()\n\t{\n\t\t$children = $this->current()->getChildren();\n\n\t\t// Using ref as per PHP source\n\t\tif (empty($this->ref))\n\t\t{\n\t\t\t$this->ref = new \\ReflectionClass($this);\n\t\t}\n\n\t\treturn $this->ref->newInstance($children);\n\t}", "public function getChildren(): array\n {\n return $this->children->toArray();\n }", "public function getChildElements() {}", "public function getChildren() {\n\t\t$placeRepository = t3lib_div::makeInstance('Tx_Wpj_Domain_Repository_PlaceRepository');\n\t\t$children = $placeRepository->findAllChildren($this);\n\t\treturn $children;\n\t}", "public function &getChildren($id)\n {\n return $this->elts[$id]['children'];\n }", "protected function getChildren()\n\t{\n\t\t$listing = $this->modelListing->getListing($this->size, $this->offset);\n\t\treturn $listing;\n\t}", "public function getChilds()\n {\n return $this->childs;\n }", "public function children() {\n return $this->descendants(1);\n }", "public function children() {\n\t\treturn $this->hasMany(Forum::getSectionClass(), \"parent_id\")->orderBy(\"weight\", \"desc\");\n\t}", "public function getChildren()\n\t{\n\t\treturn $this->current()->getIterator();\n\t}", "function getPageChildren($parentId)\n{\n return $GLOBALS['conn']->query(\"SELECT * FROM `subjects` WHERE parent='$parentId'\");\n}", "public function childrenElements() {\n\t\treturn $this->hasMany('\\App\\Hierarchy', 'parent_id', 'id');\n\t}", "private function get_node_children(midgard_page $node)\n {\n $children = array();\n $mc = midgard_page::new_collector('up', $node->id);\n $mc->set_key_property('name');\n $mc->add_value_property('title');\n $mc->execute(); \n $pages = $mc->list_keys();\n foreach ($pages as $name => $array)\n {\n if (empty($name))\n {\n continue;\n }\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}{$name}/\", // FIXME: dispatcher::generate_url\n 'title' => $mc->get_subkey($name, 'title'),\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n }\n \n if ($_MIDCOM->context->page->id == $_MIDCOM->context->host->root)\n {\n // Additional \"special\" URLs\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}__snippets/\", // FIXME: dispatcher::generate_url\n 'title' => 'Code Snippets',\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n $children[] = array\n (\n 'uri' => \"{$_MIDCOM->context->prefix}__styles/\", // FIXME: dispatcher::generate_url\n 'title' => 'Style Templates',\n 'mimetype' => 'httpd/unix-directory',\n 'resource' => 'collection',\n );\n }\n\n return $children;\n }", "public function getChilds() {\n return $this->__childs;\n }", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "public function children()\n {\n return $this->belongsToMany(Node::class,'rbac_edges','parent_id','child_id')\n ->as('edge')->using(Edge::class);\n }", "function getChildrenRowCol( )\n\t{\n\t\t$childArray = array( );\n\t\t$previousRownum = 0;\n\t\t$ok = mysql_data_seek( $this->children, 0);\n\t\t$numRows = mysql_num_rows( $this->children );\n\n\t\tfor ( $i=0; $i<$numRows; $i++ )\n\t\t{\n\t\t\t$childResource = new Booking_resource( $this->children );\n\t\t\t$childResource->setEditable( $this->isEditable( ) );\n\t\t\t$childResource->setViewMode( $this->getViewMode( ) );\n\t\t\t$rownum = $childResource->getDbCol( \"row\" );\n\t\t\t$colnum = $childResource->getDbCol( \"col\" );\n\t\t\t$childArray[$rownum][$colnum] = $childResource;\n\t\t}\n\t\treturn ( $childArray );\n\t}", "function & getChilds() {\r\n // Load the data\r\n if (empty ($this->_childs)) {\r\n $database = $this->_db;\r\n /* retrieve values */\r\n $query = 'SELECT * FROM #__custom_properties_values' . ' WHERE parent_id = ' . $this->_id . ' ORDER BY ordering ';\r\n\r\n $database->setQuery($query);\r\n $this->_childs = $database->loadObjectList();\r\n }\r\n return $this->_childs;\r\n }", "public function getChildren(): array {\n return iterator_to_array(clone $this->children);\n }", "private function getChildList(){\n\t\tif ($this->_childList == null) {\n\t\t\t$this->_childList = $this->getStructureNode()->getChildren();\n\t\t\t$this->_childList = $this->_childList->sort(array(\n\t\t\t\tnew SortRule($this->_childList->exprMember('title'))));\n\t\t}\n\t\treturn $this->_childList;\n\t}", "public function getAllChildNode()\r\n {\r\n return $this->_childNodes;\r\n }", "public function children()\n {\n return $this->hasMany(static::class, 'parent_id')->orderBy('name', 'asc');\n }", "public function getChildren(NodeInterface $node)\r\n {\r\n $params = compact('node');\r\n $event = $this->getEventManager()->trigger(__FUNCTION__.'.pre', $this, $params);\r\n if ($event->stopped()) {\r\n return $event->last();\r\n }\r\n\r\n $result = $this->mapper->getChildren($node);\r\n\r\n $params['__RESULT__'] = $result;\r\n $this->getEventManager()->trigger(__FUNCTION__.'.post', $this, $params);\r\n\r\n return $result;\r\n }", "public function getChildrenRelationIndex();", "function getChildren($child_form_id, $cs, $string,$dec_ci){\n\t\t$arr = array();\n\t\t$sql_get_children = \"SELECT a.form_id, a.parent_form_id, a.form_order, a.form_name, a.navigation_name, a.mobile_page, a.description \n\t\t\t\t\t\t FROM cs_all_forms_new as a \n\t\t\t\t\t\t INNER JOIN cs_usertagged_forms_\".$dec_ci.\" as b\n\t\t\t\t\t\t ON a.form_id=b.form_id\n\t\t\t\t\t\t WHERE a.parent_form_id=\".$child_form_id.\"\n\t\t\t\t\t\t AND (\".$string.\")\";\n\t\t$exe_get_children = mysqli_query($cs, $sql_get_children);\n\n\t\tif($exe_get_children){\n\t\t\tif(mysqli_num_rows($exe_get_children)!=0){\n\t\t\t\twhile($fetch_get_children = mysqli_fetch_array($exe_get_children)){\n\t\t\t\t\textract($fetch_get_children);\n\t\t\t\t\tarray_push($arr,array($form_id, $parent_form_id, $form_order, $form_name, $navigation_name, $mobile_page, $description));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\treturn $arr;\n\t}", "function get_children($id)\n\t{\n\t\trequire_lang('catalogues');\n\t\trequire_code('catalogues');\n\t\trequire_code('catalogues2');\n\n\t\t$child=1;\n\n\t\t// If the node is not a root node then get the name of the node\n\t\t$name=$GLOBALS['SITE_DB']->query_value_null_ok('catalogue_categories','c_name',array('id'=>intval($id)));\n\n\t\t$pagelinks=get_catalogue_entries_tree($name,NULL,NULL,NULL,NULL,NULL,false);\n\n\t\tif(count($pagelinks)>0)\n\t\t{\n\t\t\tfor($i=0;$i<count($pagelinks);$i++)\n\t\t\t{\n\t\t\t\tif($pagelinks[$i]['id']==$id)\n\t\t\t\t{\n\t\t\t\t\t$child=$pagelinks[$i]['child_count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $child;\n\t}", "public function element_get_childs($id) {\n global $db;\n $child_nodes = $db->fetch_table(\"SELECT ID_KAT, KAT_TABLE FROM `\".$this->table.\"`\n WHERE ROOT=\".$this->root.\" AND PARENT=\".$id.\" ORDER BY ORDER_FIELD\");\n $childs = array();\n foreach ($child_nodes as $index => $data) {\n $childs[] = $this->element_read($data[\"ID_KAT\"]);\n }\n return $childs;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "public function getChildren(): Collection\n {\n return $this->children;\n }", "function &sql_fetch_children( $inQueryString, $rootNode, $idField = \"id\", $parentField = \"parent\") {\n\tsql_connect();\n\tglobal $defaultdb;\n\t$return = $defaultdb->fetch_children($inQueryString,$rootNode,$idField,$parentField);\n\treturn $return;\n}", "public function getChildDocuments() {}", "public static function getChild($cNode,$storyId = null){\n global $database;\n $fields = array('nodenext');\n if(is_null($storyId)){\n $where = array(\n 'nodeid' => $cNode,\n 'ORDER' =>array(\n 'priority' => 'ASC'\n )\n );\n }else{\n $where = array(\n 'AND' => array(\n 'nodeid' => $cNode,\n 'storyid' => $storyId\n ),\n 'ORDER' =>array(\n 'priority' => 'ASC'\n )\n );\n }\n $data = $database->select('edge',$fields,$where);\n $output = array();\n foreach ($data as $key => $value) {\n $output[] = intval($value['nodenext']);\n }\n return $output;\n }" ]
[ "0.77264273", "0.71590537", "0.71590537", "0.71590537", "0.7071325", "0.70659435", "0.70659435", "0.70659435", "0.70659435", "0.70659435", "0.70659435", "0.70659435", "0.70659435", "0.70659435", "0.70227295", "0.6914141", "0.69137156", "0.6863004", "0.6794241", "0.6781224", "0.6781224", "0.6768917", "0.6757946", "0.67380923", "0.67274886", "0.6723462", "0.6706473", "0.66998297", "0.66998297", "0.6662664", "0.66505855", "0.6649256", "0.6649256", "0.66093785", "0.6580546", "0.65641004", "0.6561886", "0.65577465", "0.65420467", "0.65420467", "0.65420467", "0.65420467", "0.65420467", "0.65420467", "0.65420467", "0.65420467", "0.65328574", "0.65183663", "0.6488233", "0.64814854", "0.64630574", "0.64250576", "0.6393937", "0.6361751", "0.633452", "0.63204587", "0.6308932", "0.63073677", "0.6257125", "0.62550634", "0.62546146", "0.6251458", "0.62505007", "0.62455195", "0.62429994", "0.6239041", "0.6229507", "0.6211084", "0.61657625", "0.6147305", "0.61426896", "0.6127261", "0.61109966", "0.61060417", "0.60669583", "0.6061297", "0.60575396", "0.6053442", "0.60410964", "0.6033749", "0.60323477", "0.6032342", "0.6001288", "0.5995242", "0.5990827", "0.5989959", "0.5988373", "0.59779817", "0.59772396", "0.59768605", "0.5967506", "0.5956694", "0.59502155", "0.59494376", "0.59487367", "0.5946564", "0.5946564", "0.59374595", "0.5933789", "0.5933265" ]
0.7977928
0
The create action of the CRUD API
public function createAction() { $data = $this->params()->fromPost('data'); if (!is_null($data)) { $insertData = Json::decode($data, Json::TYPE_ARRAY); if (is_array($insertData)) { if ($insertData["fields"]["lieuCommunautaire"] && $insertData["fields"]["lieuCommunautaire"]!="" && $insertData["fields"]["lieuCommunautaire"]!=null) { $contentId = $insertData["fields"]["lieuCommunautaire"]; // get place content Id and find it $lieu = $this->_dataService->findById($contentId, false, false); $insertData["fields"]["position"] = $lieu["fields"]["position"]; // get its position field $insertData["fields"]["positionName"] = $lieu["fields"]["text"]; } $insertData["target"] = isset($insertData["target"]) ? $insertData["target"] : array(); $returnArray = $this->_dataService->create($insertData, array(), false); } else { $returnArray = array( 'success' => false, "msg" => 'Not an array' ); } } else { $returnArray = array( 'success' => false, "msg" => 'No Data' ); } if (!$returnArray['success']) { $this->getResponse()->setStatusCode(500); } return $this->_returnJson($returnArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate() {}", "public function actionCreate() {}", "public function createAction()\r\n\t{\r\n\t\treturn $this->_crud();\r\n\t}", "public function create()\n {\n //Not Used because using API Route\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 create() {\n $this->operationsModel->create($_POST);\n $this->response('',200,'Success');\n }", "public function create()\n {\n //\n return response(\"\",405);\n }", "public function actionCreate() {\n $this->actionUpdate();\n }", "public function create()\n {\n //\n \n }", "public function create()\n {\n \n \n }", "public function create()\n {\n // \n }", "public function create()\n {\n\n //\n }", "public function create()\n {\n\n //\n }", "public function create()\n {\n\n //\n }", "public function create()\n {\n\n //\n }", "public function create()\n {\n\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n \n }", "public function create()\n {\n //\n \n }", "public function create()\n {\n //\n \n }", "public function create()\n {\n \n //\n }", "public function create()\n {\n \n\n\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function actionCreate()\n\t{\n $this->actionUpdate();\n\t}", "public function create()\r\n {\r\n //\r\n\r\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }" ]
[ "0.8343484", "0.8343484", "0.8164946", "0.80668724", "0.7913472", "0.7911597", "0.788851", "0.7771259", "0.7736378", "0.77246207", "0.7719395", "0.77157027", "0.77157027", "0.77157027", "0.77157027", "0.77157027", "0.77101797", "0.77101797", "0.77101797", "0.77101797", "0.7707282", "0.7707282", "0.7707282", "0.770396", "0.7692017", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7691264", "0.7690589", "0.7690589", "0.7680586", "0.76765317", "0.7675877", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459", "0.7671459" ]
0.0
-1
The update action of the CRUD API
public function updateAction() { $data = $this->params()->fromPost('data'); if (!is_null($data)) { $updateData = Json::decode($data, Json::TYPE_ARRAY); if (is_array($updateData)) { if ($updateData["fields"]["lieuCommunautaire"] && $updateData["fields"]["lieuCommunautaire"]!="" && $updateData["fields"]["lieuCommunautaire"]!=null ) { $contentId = $updateData["fields"]["lieuCommunautaire"]; $lieu = $this->_dataService->findById($contentId, false, false); $updateData["fields"]["position"] = $lieu["fields"]["position"]; $updateData["fields"]["positionName"] = $lieu["text"]; } $returnArray = $this->_dataService->update($updateData, array(), false); } else { $returnArray = array( 'success' => false, "msg" => 'Not an array' ); } } else { $returnArray = array( 'success' => false, "msg" => 'No Data' ); } if (!$returnArray['success']) { $this->getResponse()->setStatusCode(500); } return $this->_returnJson($returnArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate() {}", "public function actionUpdate() {}", "public function updateAction()\n {\n }", "public function update($request,$id) {\n \n\n }", "public function update($id)\n {\n\n\n }", "public function update(Request $request)\n {\n \n\n \n }", "public function update($id)\n {\n \n }", "public function update($id)\n {\n \n }", "public function update($id)\n {\n \n }", "public function update($id)\n {\n \n }", "public function update($id)\n {\n \n }", "public function update($id)\n {\n \n }", "public function update($id)\n {\n \n }", "public function update($id) {\n \n }", "public function update($id) {\n \n }", "protected function updateAction()\n {\n }", "public function update($id){\n //\n }", "public function update($id)\n {\n\n }", "public function update($id)\n {\n\n }", "public function update($id)\n {\n\n }", "public function update(Request $request) {\n \n \n }", "public function testUpdate(): void { }", "public function actionUpdate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n /*\r\n * Receive all the PUT parameters\r\n */\r\n parse_str(file_get_contents('php://input'), $put_params);\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>update</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model))\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n \r\n /*\r\n * assign PUT parameters to attributes\r\n */ \r\n foreach($put_params as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n *save the model\r\n */\r\n if($model->save()) {\r\n $this->_sendResponse(200, sprintf('The model <b>%s</b> with id <b>%s</b> has been updated.', $_GET['model'], $_GET['id']) );\r\n } else {\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't update model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n }", "public function update($id)\n {\n\n }", "public function update($id)\n {\n\n }", "public function update($id) {\n //\n }", "public function update($id)\n {\n \n }", "public function update($request, $id);", "public function update($id) {\r\n //\r\n }", "public function update($data) {}", "public function update($data) {}", "public function update(Request $request)\n {\n \n }", "public function update($id) {\n }", "public function update($id) {\n }", "public function testUpdate()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $newModel = $this->makeFactory();\n\n $this->json('PUT', static::ROUTE . '/' . $model->id, $newModel->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($newModel->toArray());\n }", "public function Update($data) {\n\n }", "public function update(Request $request)\n {\n \n }", "public\n function update($id)\n {\n //\n }", "public function update(Request $request, $id) //更新\n {\t\n\t\t//\n }", "public function update($id)\r\n {\r\n //\r\n }", "public function update(Request $request)\n {\n \n }", "public function update(Request $request)\n { }", "public function update(Request $request)\r\n {\r\n }", "public function update(Request $request)\r\n {\r\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update($id)\n {\n //\n }", "public function update(Request $request)\n { \n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id) {\n //\n }", "public function update($id)\n {\n //\n }", "public function update(Request $request, $id){}", "public function update(Request $request)\n {\n \n \n\t\t\n \n }", "public function update(Request $request, $id){\n \n \n }", "public function update($id)\n {\n }", "public function update($id)\n {\n }", "public function update($id)\n {\n }", "public function update($id)\n {\n }", "public function update($id)\n {\n }", "public function update($id)\n {\n }", "public function update($id)\n {\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function update(Request $request, $id)\n {\n \n \n }", "public function update(R $request, $id)\n {\n //\n }", "public function update( Request $request , $id )\n {\n //\n }", "public function update($id);", "public function update($id);", "public function update(Request $request)\n { \n }", "public function update(Request $req)\n { \n\n }", "public function update(Request $request) {\n }", "public function update(Request $request) {\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update($request, $id)\n {\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request)\n {\n\n }", "public function update(Request $request, $id)\n { \n\n }", "public function update($id, $input);", "public function update(Request $request,$id)\n {\n \n //\n }", "public function update(Request $request)\n {\n }", "public function update(Request $request, $id)\n {\n\n\n\n }", "public function update(Request $request, $id) {\n \n }", "public function update(Request $request, $id) {\n \n }", "public function update(Request $request)\n\t{\n\n\t}", "public function update(Request $request)\n {\n }" ]
[ "0.82840073", "0.82840073", "0.79120773", "0.7680142", "0.7621814", "0.7594674", "0.7525082", "0.7525082", "0.7525082", "0.7525082", "0.7525082", "0.7525082", "0.7525082", "0.75232524", "0.75232524", "0.7512577", "0.7506313", "0.7486142", "0.7486142", "0.7486142", "0.7478", "0.747348", "0.7467585", "0.74541867", "0.74541867", "0.7450047", "0.74469995", "0.74353385", "0.742991", "0.7425468", "0.7425468", "0.7417329", "0.74134654", "0.74134654", "0.74132204", "0.73899245", "0.73713505", "0.7369216", "0.73539305", "0.73500836", "0.7346393", "0.73416877", "0.7333086", "0.7333086", "0.7324621", "0.7324621", "0.7324621", "0.7324621", "0.7310957", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308458", "0.7308104", "0.7306637", "0.7297092", "0.7294933", "0.72916174", "0.72916174", "0.72916174", "0.72916174", "0.72916174", "0.72916174", "0.72916174", "0.72798336", "0.72752005", "0.7269084", "0.72687656", "0.7268564", "0.7268564", "0.7267184", "0.72661537", "0.7261252", "0.7261252", "0.7260794", "0.7260794", "0.7260794", "0.7260794", "0.7247491", "0.7247491", "0.7247491", "0.7247491", "0.7247491", "0.72448385", "0.72419333", "0.72406805", "0.7239957", "0.7236443", "0.7235819", "0.7235819", "0.7229721", "0.7227861" ]
0.0
-1
Return a list of ordered objects
public function getOrderedListAction() { // merge filter and tFilter $jsonFilter = $this->params()->fromQuery('filter', '[]'); $jsonTFilter = $this->params()->fromQuery('tFilter', '[]'); $filterArray = Json::decode($jsonFilter, Json::TYPE_ARRAY); $tFilterArray = Json::decode($jsonTFilter, Json::TYPE_ARRAY); $filters = array_merge($tFilterArray, $filterArray); $sort = Json::decode($this->params()->fromQuery('sort', null), Json::TYPE_ARRAY); $start = Json::decode($this->params()->fromQuery('start', null), Json::TYPE_ARRAY); $limit = Json::decode($this->params()->fromQuery('limit', null), Json::TYPE_ARRAY); $mongoFilters = $this->_buildFilter($filters); return new JsonModel($this->_dataService->getOrderedList($mongoFilters, $sort, $start, $limit, false)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrderings() ;", "public function order();", "public function getOrderings();", "public function getOrderings() {}", "public function getOrderList()\n {\n }", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function getOrder();", "public function &getOrderBy();", "public function findAllOrders()\n {\n return $this->createQueryBuilder('o')\n ->orderBy('o.createdDate' , 'DESC');\n }", "public function orders() {\n if ($this->orders != null)\n return $this->orders;\n $ids = Pdb::fetchAll('small_order', self::$table);\n return $this->orders = safe_array_map(function ($id) { return new Order($id); }, $ids); // no paging here\n }", "public function generateOrder();", "public function getOrder(): array;", "function getOrder();", "public function Orders()\n {\n return $this->getOrders();\n }", "public function getOrderList()\n {\n if ($this->_aOrderList === null) {\n $this->_aOrderList = array();\n\n // Load user Orderlist\n if ($oUser = $this->getUser()) {\n $iNrofCatArticles = (int) $this->getConfig()->getConfigParam('iNrofCatArticles');\n $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 1;\n $this->_iAllArtCnt = $oUser->getOrderCount();\n if ($this->_iAllArtCnt && $this->_iAllArtCnt > 0) {\n $this->_aOrderList = $oUser->getOrders($iNrofCatArticles, $this->getActPage());\n $this->_iCntPages = round($this->_iAllArtCnt / $iNrofCatArticles + 0.49);\n }\n }\n }\n\n return $this->_aOrderList;\n }", "function listObjects();", "public function getAllOrderedByName()\n {\n return $this->model->orderBy('name', 'asc')->get();\n }", "function productItemsOrdered( $asObject = true, $order = true )\n {\n return $this->productItems( $asObject, array( 'id' => ( $order ? 'asc' : 'desc' )) );\n }", "public function findAllByOrder()\n {\n return $this->findBy(array(), array('updatedAt'=>'desc', 'createdAt'=>'desc'));\n }", "public function all() {\r\n\t\t$objects = []\r\n\t\twhile($this->hasNext()) {\r\n\t\t\t$next = $this->next();\r\n\t\t\tif($next == FALSE) break;\r\n\t\t\t$objects->push($next);\r\n\t\t}", "public abstract function getObjects();", "static function getAll($order = \"_default_order\") {\n $CI = get_instance();\n $classname = get_called_class();\n eval('$object = new ' . $classname . '();');\n $CI->db->order_by($order == \"_default_order\" ? $object->_default_order() : $order);\n $result = $CI->db->get($object->_tablename())->result();\n $array = array();\n foreach ($result as $value) {\n eval('$array[] = new ' . $classname . '($value);');\n }\n return $array;\n }", "public static function getOrders()\n\t{\n $orders = DB::query(\"SELECT orderproducts.*, products.strName, products.strDescription, products.strFeatures, products.price, products.category_id, products.status_id, orders.totalAmount, orders.date, inventoryproducts.name AS inventoryproductsname\n FROM orderproducts\n LEFT JOIN orders ON orderproducts.orderId=orders.id\n LEFT JOIN products ON orderproducts.productId=products.id\n LEFT JOIN inventoryproducts ON products.inventoryproductsId=inventoryproducts.id\");\n\n // acting as a factory\n // empty array to avoid errors when nothing was found\n\t\t$ordersArray = array();\n\t\tforeach($orders as $order)\n\t\t{\n\t\t\t// create an instance / object for this SPECIFIC \n\t\t\t$ordersArray[] = new OrdersAdmin($order); // put this object onto the array\n }\n\t\t// return the list of objects\n\t\t//return $ordersArray;\n }", "public function fetchArchivingOrderInList() {\n $date = date('Y-m-d', (time() - MONTH));\n $list = $this->find('list', array(\n 'conditions' => array(\n 'Order.status' => 'Invoiced',\n 'Order.modified <' => $date\n ),\n 'fields' => array('order_number', 'id')\n ));\n $logData = implode(',', $list);\n return $list;\n }", "public function getJsonList()\n {\n return $this->Ascending()->lists('tax', 'tax_id');\n }", "function getAllObjects($instance, $sortBy='', $ascending=true, $limit='')\n{\n\t//eval('$instance = new '.$objectName.'();');\n\t//$instanceId = strtolower(get_class($instance)).\"Id\";\n\t//return $instance->GetList(array(array($instanceId, \">\", \"0\")));\n\treturn \t$instance->GetList(array(array(true)), $sortBy, $ascending, $limit);\n\t\n\t\n}", "abstract public function getOrderAble();", "public function getListaOcupaciones() {\n \n $listaOcupaciones = array();\n \n $dbAccess = new DBAccess();\n $result = $dbAccess->getSelect(\"SELECT * from ocupacion\");\n\n foreach($result as $row){\n \n $ocupacion = new Ocupacion($row['idocupacion'], $row['idempleado'], $row['fecha_ocupado']);\n array_push($listaOcupaciones, $ocupacion); \n }\n \n return $listaOcupaciones;\n }", "function getAll()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $priority_array = 0;\r\n\r\n $return_array = array();\r\n $priority_array = array();\r\n\r\n $db->array_query( $priority_array, \"SELECT ID FROM eZTodo_Priority ORDER BY Name\" );\r\n \r\n for ( $i = 0; $i < count( $priority_array ); $i++ )\r\n {\r\n $return_array[$i] = new eZPriority( $priority_array[$i][$db->fieldName( \"ID\" )], 0 );\r\n } \r\n return $return_array;\r\n }", "public function testGetList_SortingLimit()\n\t{\n\t\t$this->object->Save();\n\t\t$newObject1 = new object(\"efg\");\n\t\t$newObject2 = new object(\"abc\");\n\t\t$newObject3 = new object(\"d\");\n\n\t\t$newObject1->Save();\n\t\t$newObject2->Save();\n\t\t$newObject3->Save();\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", true, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"abc\", $objectList[0]->attribute);\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", false, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"obj att\", $objectList[0]->attribute);\n\t\t$this->assertEquals(\"efg\", $objectList[1]->attribute);\n\t}", "public function getOrderings()\n {\n return $this->orderings;\n }", "public function getAddedObjects() {}", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOrder()\n {\n // TODO: Implement getOrder() method.\n }", "public function getOpenOrders(): array;", "protected function getPositionObjects()\n {\n $object = $this->getOption('object');\n $selectedObjects = Doctrine::getTable($this->getOption('refClass'))\n ->createQuery('s')\n ->select('s.*, many.id as has_many_id')\n ->innerJoin('s.'.get_class($object).' obj')\n ->innerJoin('s.'.$this->getOption('hasManyClass').' many') \n ->where('obj.id = ?', $object->id) \n ->orderBy('s.'.$this->getOption('position_field').' ASC') \n ->execute();\n\n return $this->collectionToArray($selectedObjects, 'has_many_id');\n }", "public function getObjects()\n {\n return $this->objects;\n }", "public function getObjectivesList() {\n return $this->_get(9);\n }", "public function getSorting();", "public function getOrderedPhotos()\n {\n return $this->photos()->orderBy( 'photo_node.ordering', 'asc')->get();\n }", "public function getOrders()\n {\n return $this->orders;\n }", "function getOrders() {\n\t\t$orders = Mage::getModel ( 'sales/order' )->getCollection ()->addAttributeToSelect ( \"*\" )->addAttributeToFilter ( 'status', array ('complete') );\n\t\t$orders_data = $this->preapreOrdersTosend ( $orders );\n\t\treturn $orders_data;\n\t}", "public function all() : Collection\n {\n return Order::all();\n }", "function listInOrder()\n {\n global $BD3;\n global $BD1;\n global $ANO_REF;\n $res_sql=\"select $BD3.final.id,\n $BD3.final.matr,\n $BD1.empregados.nome,\n $BD3.final.cargo,\n $BD3.final.agrup\n from $BD3.final,$BD1.empregados\n where $BD1.empregados.matr=$BD3.final.matr\n AND $BD3.final.ano='$ANO_REF'\n order by $BD1.empregados.nome;\";\n return sql(\"$BD3\",$res_sql);\n }", "public function getObjectivesList() {\n return $this->_get(8);\n }", "static public function listObjects($filter = null, $return_keys = false, $order_for_mapping = false)\n\t{\n\t\t$constants = array();\n\t\t\t\n\t\tforeach (get_defined_constants() as $constant => $value)\n\t\t{\n\t\t\tif (substr($constant, 0, strlen('QUICKBOOKS_OBJECT_')) == 'QUICKBOOKS_OBJECT_')\n\t\t\t{\n\t\t\t\tif (!$return_keys)\n\t\t\t\t{\n\t\t\t\t\t$constant = $value;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($filter)\n\t\t\t\t{\n\t\t\t\t\tif (QuickBooks_Utilities::_fnmatch($filter, $constant))\n\t\t\t\t\t{\n\t\t\t\t\t\t$constants[] = $constant;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$constants[] = $constant;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\n\t\tif ($order_for_mapping)\n\t\t{\n\t\t\t// Sort with the very longest values first, to the shortest values last\n\t\t\t\n\t\t\t$func = create_function('$a, $b', ' if (strlen($a) > strlen($b)) { return -1; } return 1; ');\n\t\t\tusort($constants, $func);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsort($constants);\n\t\t}\n\t\t\t\n\t\treturn $constants;\n\t}", "public static function listOfObjectsByRank() {\n\t\t/*\n\t\t * Holds values to be assigned during query execution. Values do not need\n\t\t * to be escaped because they are injected into named place-holders in the\n\t\t * prepared query. Add items using $values[':PlaceHolder'] = $value;\n \t\t */\n\t\t$values = array();\n\n\t\t$query = '\n\t\t\tSELECT ID, coverImageID, trackID, status, rank, createDate\n\t\t\t FROM '.system::getConfig()->getDatabase('momusic_content').'.handpickedMusic\n\t\t\t ORDER BY rank desc';\n\n\t\tif ( $inOffset !== null ) {\n\t\t\t$query .= ' LIMIT '.$inOffset.','.$inLimit;\n\t\t}\n\n\t\t$list = array();\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\t\tif ( $oStmt->execute($values) ) {\n\t\t\tforeach ( $oStmt as $row ) {\n\t\t\t\t$oObject = new momusicHandpickedmusic();\n\t\t\t\t$oObject->loadFromArray($row);\n\t\t\t\t$list[] = $oObject;\n\t\t\t}\n\t\t}\n\t\t$oStmt->closeCursor();\n\n\t\treturn $list;\n\t}", "public function getOrders()\n {\n $result = array();\n\n if (!empty(\\XLite\\Core\\Request::getInstance()->order_ids)) {\n $orderIds = explode(',', \\XLite\\Core\\Request::getInstance()->order_ids);\n\n foreach ($orderIds as $orderId) {\n $orderId = trim($orderId);\n $order = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Order')->find(intval($orderId));\n if ($order) {\n $result[] = $order;\n }\n }\n\n } else {\n $result[] = $this->getOrder();\n }\n\n return $result;\n }", "public static function sortables()\n {\n return ['id', 'module_name'];\n }", "public function index()\n {\n $data = $this->repository->getAllOrderedByDate();\n return $data;\n }", "public function getOrder()\n {\n //Note: order by parts are not \"named\" so it's all or nothing\n return $this->_get('_order');\n }", "public function GetAllOrders() {\n return $this->orderManager->GetAllOrders();\n }", "private function GetOrders()\n\t{\t$orders = array();\n\t\t$where = array();\n\t\t\n\t\tif ($this->startdate)\n\t\t{\t$where[] = 'orderdate>=\"' . $this->startdate . ' 00:00:00\"';\n\t\t}\n\t\tif ($this->enddate)\n\t\t{\t$where[] = 'orderdate<=\"' . $this->enddate . ' 23:59:59\"';\n\t\t}\n\t\tif (!$this->showunpaid)\n\t\t{\t$where[] = 'NOT paiddate=\"0000-00-00 00:00:00\"';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM storeorders';\n\t\tif ($wstr = implode(' AND ', $where))\n\t\t{\t$sql .= ' WHERE ' . $wstr;\n\t\t}\n\t\t$sql .= ' ORDER BY orderdate DESC';\n\t\t\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$orders[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $orders;\n\t}", "static function orderList( $CustomID, $Email )\n {\n $db = eZDB::instance();\n $CustomID =(int) $CustomID;\n $Email = $db->escapeString( $Email );\n if ( $Email == false )\n {\n $orderArray = $db->arrayQuery( \"SELECT ezorder.* FROM ezorder\n WHERE user_id='$CustomID'\n AND is_archived='0'\n AND is_temporary='0'\n ORDER BY order_nr\" );\n }\n else\n {\n $orderArray = $db->arrayQuery( \"SELECT ezorder.* FROM ezorder\n WHERE user_id='$CustomID'\n AND is_archived='0'\n AND is_temporary='0'\n AND email='$Email'\n ORDER BY order_nr\" );\n }\n $retOrders = array();\n foreach( $orderArray as $orderRows )\n {\n $retOrders[] = new eZOrder( $orderRows );\n }\n return $retOrders;\n }", "public function getList()\n\t{\n\t\treturn $this->crud->orderby('id DESC')\n\t\t\t\t\t->read(10)\n\t\t;\t\n\t}", "protected function _getSortedObservers()\n {\n $array = $this->_splObjectStorageToArray($this->observers);\n\n usort($array, function ($a, $b) {\n return (int) $a['data'] < (int) $b['data'];\n });\n\n return array_map(function ($item) {\n return $item['obj'];\n }, $array);\n }", "public function getAll(): Collection\n {\n return $this->model->newQuery()->orderBy('disporder')->all();\n }", "public function getOrder()\n {\n\n }", "public function getSortOrder();", "public function getSortOrder();", "public function getSortOrder();", "public function getOrders(){\n if ( is_null($this->orders) ){\n $db = $this->getTable()->getAdapter();\n $sid = $this->getCourier()->getId();\n\n //get all orders of courier service\n $sql = sprintf(\"select id from orders\n where (billCourier=0 or billCourier is NULL)\n and courierId = %d\",$sid);\n \n $rows = $db->fetchAll($sql);\n $orders = new SplObjectStorage();\n foreach($rows as $o){\n try{\n $order = new Yourdelivery_Model_Order($o['id']);\n\n if ( $order->getMode() == \"great\" && $order->getState() != 2 &&\n //check for great which do not provide pfand\n //kreiner, gela\n !in_array($order->getCourier()->getId(),array(12123,12115)) ){\n continue;\n }\n\n if ( $order->getState() < 0 ){\n continue;\n }\n\n if ( $order->getDeliverTime() > $this->until ){\n continue;\n }\n\n $orders->attach($order);\n }\n catch ( Yourdelivery_Exception_Database_Inconsistency $e ){\n\n }\n }\n $this->orders = $orders;\n }\n return $this->orders;\n }", "public function orders()\n {\n return $this->morphMany(Checkout::orderModel(), 'customer');\n }", "public function fetchAll()\n {\n $objectArray = [];\n while($fetchedObject = $this->fetch())\n {\n $objectArray[] = $fetchedObject;\n }\n\n return $objectArray;\n }", "function issuu_api_folder_result_orders() {\n $result_orders = &drupal_static(__FUNCTION__);\n // Check if the array is not already initialized.\n if (!isset($result_orders)) {\n $result_orders = array(\n 'asc' => t('Ascending'),\n 'desc' => t('Descending'),\n );\n }\n return $result_orders;\n}", "public function listOrder($arr_params){\n //lay bien ket noi csdl\n $limit = $arr_params['limit'];\n $page = $arr_params['page'];\n $start = ($page - 1) * $limit;\n $start = ($page - 1) * $limit;\n $obj_select=$this->connection->prepare\n (\"select * from orders where TRUE $this->str_search \n order by orders.created_at desc LIMIT $start, $limit\");\n //lay tat ca ket qua tra ve\n $arr_select = [];\n $obj_select->execute($arr_select);\n $orders = $obj_select->fetchAll(PDO::FETCH_ASSOC);\n return $orders;\n }", "public function liste()\n {\n return $this->createQueryBuilder('a')\n ->orderBy('a.pseudonyme', 'ASC')\n ;\n }", "function getAllOrders()\n {\n $dataService = new OrderDataService();\n\n return $dataService->getAllOrders();\n }", "public function getUsuarios($order){\r\n\t$pdo = Database::connect();\r\n\t//verificamos el ordenamiento asc o desc:\r\nif($orden==true)//asc\r\n$sql = \"select * from usuario order by nombre\";\r\nelse //desc\r\n\t$sql = \"select * from usuario order by nombre desc\";\r\n\t$resultado = $pdo->query($sql);\r\n//transformamos los registros en objetos de tipo usuario:\r\n\t$listado = array();\r\n\tforeach ($resultado as $res){\r\n\t\t$usuario = new usuario();\r\n\t\t$usuario->setCodigo($res['codigo']);\r\n\t\t$usuario->setNombre($res['nombre']);\r\n\t\t$usuario->setPrecio($res['precio']);\r\n\t\t$usuario->setCantidad($res['cantidad']);\r\n\t\tarray_push($listado, $usuario);\r\n\t}\r\n\tDatabase::disconnect();\r\n//retornamos el listado resultante:\r\n\treturn $listado;\r\n}", "function getObjects() {\n return $this->objects;\n }", "function findAllOrdersDescPaginated();", "public function getAvailableOrders()\n {\n return [\n 'name-asc' => 'from-a-z',\n 'name-desc' => 'from-z-a',\n 'created_at-desc' => 'newest-first',\n 'created_at-asc' => 'oldest-first',\n 'price-asc' => 'cheapest-first',\n 'price-desc' => 'expensive-first'\n ];\n }", "public function getOrderItems()\n {\n return $this->hasMany(OrderItem::className(), ['order_id' => 'id'])->inverseOf('order');\n }", "protected function getAllOrders()\n {\n return Order::withTrashed()\n ->with(['address', 'user'])\n ->orderBy('id', 'DESC')\n ->get();\n }", "public function getElementSortOrder();", "public function getOrderArray($create = false) {}", "function allApprenticesAscending() {\n\n\t\t\t\t\treturn Apprentice::find('all', array('order'=>'name Asc'));\n\t\t\t\t}", "function getOrder()\n{\n\n}", "public function getSortOrders()\n {\n return Cache::rememberForever(self::sortOrderCacheKey($this->id), function () {\n return \\DB::table('offline_mall_category_product')\n ->where('product_id', $this->id)\n ->get(['category_id', 'sort_order',])\n ->pluck('sort_order', 'category_id')\n ->toArray();\n });\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "public function getObjects()\n {\n return get_object_vars($this);\n }", "function getObjectIDs() {\n\t\t$tmp = array();\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$tmp[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}", "public function orderProvider()\n {\n $data = array();\n\n $classname = \"\\\\OpenActive\\\\Models\\\\OA\\\\Order\";\n\n $data[0] = array(\n $classname::deserialize(\n file_get_contents(__DIR__ . \"/../order.json\")\n ),\n $classname\n );\n\n return $data;\n }", "public function getOrders($filter = array()) {\n return $this->getTable()->getOrders();\n }", "function asListObject($result)\n {\n $lista = array();\n while ($linha = $result->fetch(PDO::FETCH_OBJ)) {\n $lista[] = $this->asObject($linha);\n }\n return $lista;\n }", "public function toList();", "function allPartnersAscending() {\n\n\t\t\t\t\t/* Returns all partner companies in database in alphabetical order. */\n\n\t\t\t\t\treturn Partner::find('all', array('order'=>'name Asc'));\n\t\t\t\t}", "public function getXXXOrdering()\n\t{\n\t\treturn array('title_asc', 'title_desc');\n\t}", "public function objectList(){\n try {\n // Sparql11query.g:287:3: ( object ( COMMA object )* ) \n // Sparql11query.g:288:3: object ( COMMA object )* \n {\n $this->pushFollow(self::$FOLLOW_object_in_objectList998);\n $this->object();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:288:10: ( COMMA object )* \n //loop39:\n do {\n $alt39=2;\n $LA39_0 = $this->input->LA(1);\n\n if ( ($LA39_0==$this->getToken('COMMA')) ) {\n $alt39=1;\n }\n\n\n switch ($alt39) {\n \tcase 1 :\n \t // Sparql11query.g:288:11: COMMA object \n \t {\n \t $this->match($this->input,$this->getToken('COMMA'),self::$FOLLOW_COMMA_in_objectList1001); \n \t $this->pushFollow(self::$FOLLOW_object_in_objectList1003);\n \t $this->object();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop39;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function getItems()\n {\n sort($this->items);\n return $this->items;\n }", "public static function getOrder(): int;", "protected function obtainDataOrders()\n\t{\n\t\t$this->dbQueryResult['ORDERS'] = CSaleOrder::GetList(array($this->sortBy => $this->sortOrder), $this->filter);\n\t\t$this->dbQueryResult['ORDERS']->NavStart($this->arParams[\"ORDERS_PER_PAGE\"], false);\n\n\t\tif(empty($this->dbQueryResult['ORDERS']))\n\t\t\treturn;\n\n\t\twhile ($arOrder = $this->dbQueryResult['ORDERS']->GetNext())\n\t\t{\n\t\t\t$arOBasket = array();\n\t\t\t$dbBasket = CSaleBasket::GetList(array('NAME' => 'asc'), array(\"ORDER_ID\"=>$arOrder[\"ID\"]), false, false, array('*'));\n\t\t\twhile ($arBasket = $dbBasket->Fetch())\n\t\t\t{\n\t\t\t\tif (CSaleBasketHelper::isSetItem($arBasket))\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$arOBasket[] = $arBasket;\n\t\t\t}\n\n\t\t\t$this->dbResult['ORDERS'][] = array(\n\t\t\t\t\"ORDER\" => $arOrder,\n\t\t\t\t\"BASKET_ITEMS\" => $arOBasket,\n\t\t\t);\n\t\t}\n\t}", "protected function get_ordered_records()\n\t{\n\t\t$records = array();\n\n\t\t$ordering = function(array $branch) use(&$ordering, &$records) {\n\n\t\t\tforeach ($branch as $node)\n\t\t\t{\n\t\t\t\t$records[$node->nid] = $node->record;\n\n\t\t\t\tif ($node->children)\n\t\t\t\t{\n\t\t\t\t\t$ordering($node->children);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t$node = current($this->index);\n\n\t\tif (empty($node->record))\n\t\t{\n\t\t\t$this->populate();\n\t\t}\n\n\t\t$ordering($this->tree);\n\n\t\treturn $records;\n\t}", "public function getList()\n {\n if (isset($this->orderList)) {\n return $this->orderList;\n } else {\n return false;\n }\n\n }" ]
[ "0.7055862", "0.6956511", "0.6949284", "0.67653656", "0.6589244", "0.6573608", "0.6573608", "0.6573608", "0.6573608", "0.6573608", "0.6573608", "0.6554101", "0.64963144", "0.6456243", "0.6432741", "0.6295324", "0.6289937", "0.621744", "0.61739653", "0.6167981", "0.6122399", "0.61167955", "0.61139566", "0.61103743", "0.6063024", "0.59579754", "0.5944072", "0.5939101", "0.5922376", "0.5916007", "0.5913919", "0.58461666", "0.58405274", "0.5836964", "0.58348304", "0.58315", "0.5787391", "0.5787391", "0.5787391", "0.5776011", "0.57539123", "0.5738146", "0.57255495", "0.57235146", "0.5716605", "0.5686463", "0.567291", "0.56717396", "0.566913", "0.5668777", "0.56677043", "0.5667168", "0.5655185", "0.5644143", "0.564311", "0.5638375", "0.5617444", "0.56141764", "0.5599509", "0.5573208", "0.5568857", "0.55678076", "0.55658346", "0.5558043", "0.5558043", "0.5558043", "0.5549391", "0.5548555", "0.554543", "0.55353457", "0.553221", "0.55286425", "0.5526559", "0.55227697", "0.55226326", "0.5501317", "0.5500511", "0.5500355", "0.54949886", "0.5486063", "0.54847986", "0.54819304", "0.54763335", "0.54720473", "0.54664314", "0.5444332", "0.5444332", "0.54372025", "0.5429655", "0.5428806", "0.542654", "0.5425611", "0.54164225", "0.54158515", "0.540889", "0.540167", "0.5394518", "0.53935117", "0.5389363", "0.53856695" ]
0.64063704
15
Return result of applying one semigroup with another.
public function concat(Semigroup $value);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function append(SemigroupInterface $other)\n {\n if ($other instanceof static) {\n return new static(array_merge($this->value, $other->value));\n }\n\n $this->throwMismatchedDataTypeException($other);\n }", "public function group($group);", "function multiply ($other) {\n $this->getTool();\n return ($this->tool->multiply(&$this, $other));\n }", "public function &getGroupBy();", "abstract protected function _buildGroupBy( $group );", "function divide ($other) {\n $this->getTool();\n return ($this->tool->divide(&$this, $other));\n }", "function merge_perm( $one, $two ){\n\tif( empty( $one[ 0 ][ 'users' ] ) || empty( $two[ 0 ][ 'users' ] ) )\n\t\treturn $one;\n\n\t$one[ 0 ][ 'users' ] = array_merge( $one[ 0 ][ 'users' ], $two[ 0 ][ 'users' ] );\n\t$one[ 0 ][ 'groups' ] = array_merge( $one[ 0 ][ 'groups' ], $two[ 0 ][ 'groups' ] );\n\t$one[ 1 ][ 'users' ] = array_merge( $one[ 1 ][ 'users' ], $two[ 1 ][ 'users' ] );\n\t$one[ 1 ][ 'groups' ] = array_merge( $one[ 1 ][ 'groups' ], $two[ 1 ][ 'groups' ] );\n\treturn $one;\n}", "function group($s)\n{\n\t$this->tryModify();\n\t$this->query['group'] = $s;\n\treturn $this;\n}", "public function group($keys, $initial, $reduce, $options = array())\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function group(): Collection;", "public function groupId()\n {\n if (func_num_args() == 0) {\n return $this->getGroupId();\n }\n\n $this->setGroupId(func_get_arg(0));\n\n return $this;\n }", "public function groups();", "public function groups();", "public abstract function getGroupedAttributesForMatching();", "public function merge_group($oldid, $newid)\r\n\t{\r\n $this->delete_thread($oldid);\r\n $this->group_data_change($newid);\r\n\t}", "static function get_apigroup();", "public function visitGroupClause(\n /*IGroupClause*/ $node) /*: mixed*/ {\n $collection = /*(string)*/$node->getCollection()->accept($this);\n $key = /*(string)*/$node->getKey()->accept($this);\n\n return 'group '.$collection.' by '.$key;\n }", "public function testBuildGroupByWithTwoArguments()\n {\n $query = $this->getQuery()\n ->groupBy('param1')\n ->groupBy('param2')\n ;\n\n $this->assertSame(\n 'GROUP BY param1, param2',\n $query->buildGroupBy()\n );\n }", "public function implicitGroupby() {\n\t\treturn true;\n\t}", "public function group(string $group);", "function groupBy(callable $grouper, iterable $items) : iterable\n{\n $grouped = [];\n foreach ($items as $key => $value) {\n $group = $grouper($value, $key);\n $grouped[$group] []= $value;\n }\n return $grouped;\n}", "public function groupBy(callable $function);", "function getGroup() ;", "public function usergroupConditionMatchesSingleGroupId() {}", "public function usergroupConditionMatchesSingleGroupId() {}", "public function grouping(GroupInterface $group, $groupObject, array $otherObjects, $keySpecified = true)\n\t{\n\t\t$group->setGroup(\n\t\t\tnew Node(\n\t\t\t\t$this->getObjectNamse($groupObject), \n\t\t\t\t$groupObject\n\t\t\t)\n\t\t);\n\t\t\n\t\tforeach($otherObjects as $key => $other)\n\t\t{\n\t\t\t$group->addMember(\n\t\t\t\tnew Node(\n\t\t\t\t\t$this->getObjectNamse($other), \n\t\t\t\t\t$other\n\t\t\t\t),\n\t\t\t\t$keySpecified ? $key : spl_object_hash($other)\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $group;\n\t}", "static public function and ($a, $b) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:156: characters 5-61\n\t\treturn Future_Impl_::merge($a, $b, function ($a1, $b1) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:156: characters 46-60\n\t\t\treturn new MPair($a1, $b1);\n\t\t});\n\t}", "public function getGroup($groupId);", "public function merge_with(&$other)\n {\n }", "public function group()\n {\n $this->doGroup('group', \\func_get_args());\n }", "public function groupOrUnionGraphPattern(){\n try {\n // Sparql11query.g:213:3: ( groupGraphPattern ( UNION groupGraphPattern )* ) \n // Sparql11query.g:214:3: groupGraphPattern ( UNION groupGraphPattern )* \n {\n $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_groupOrUnionGraphPattern735);\n $this->groupGraphPattern();\n\n $this->state->_fsp--;\n\n // Sparql11query.g:214:21: ( UNION groupGraphPattern )* \n //loop27:\n do {\n $alt27=2;\n $LA27_0 = $this->input->LA(1);\n\n if ( ($LA27_0==$this->getToken('UNION')) ) {\n $alt27=1;\n }\n\n\n switch ($alt27) {\n \tcase 1 :\n \t // Sparql11query.g:214:22: UNION groupGraphPattern \n \t {\n \t $this->match($this->input,$this->getToken('UNION'),self::$FOLLOW_UNION_in_groupOrUnionGraphPattern738); \n \t $this->pushFollow(self::$FOLLOW_groupGraphPattern_in_groupOrUnionGraphPattern740);\n \t $this->groupGraphPattern();\n\n \t $this->state->_fsp--;\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop27;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "function get_by_key($withSetAttributeValue=FALSE) {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM umgroup \n\t\t\t\tWHERE GpID=?\";\n\t\t$query = $this->ums->query($sql, array($this->GpID));\n\t\tif ( $withSetAttributeValue ) {\n\t\t\t$this->row2attribute( $query->row() );\n\t\t} else {\n\t\t\treturn $query ;\n\t\t}\n\t}", "function o_div($a, $b) {\n\t\t\treturn Obj::singleton()->divide($a, $b);\n\t\t}", "function gtags_group_activity( $args ) {\n\t$defaults = array(\n\t\t'tag' => '', // the primary tag name\n\t\t'tag2' => '', // the secondary tag name to narrow our search\n\t\t'type' => 'intersect' // if two tags are passed, show the intersection or show the combination\n\t);\n\t$args = wp_parse_args( $args, $defaults );\t\n\textract( $args, EXTR_SKIP );\n\t\n\t$group_ids_tag = gtags_get_group_ids( $tag );\n\t$group_ids_tag2 = gtags_get_group_ids( $tag2 );\n\t\n\tif ( $tag && $tag2 && $type = 'intersect' )\n\t\t$group_ids = array_intersect( (array)$group_ids_tag, (array)$group_ids_tag2 );\n\telse\n\t\t$group_ids = array_merge( (array)$group_ids_tag, (array)$group_ids_tag2 );\t\n\t\n\treturn $group_ids;\n}", "public function currentGroup();", "function buildGroup($entity) {\n // The the standard group name.\n $group = parent::buildGroup($entity);\n // Add the scheme.\n if ($this->conf['group_by_scheme']) {\n // Get all stream wrappers.\n $stream_wrapper = file_get_stream_wrappers();\n $group .= ' · ' . $stream_wrapper[file_uri_scheme($entity->uri)]['name'];\n }\n return $group;\n }", "function sums($figuretwo, $figureone) {\n return $figureone * $figuretwo;\n }", "public function groupJoin($values);", "public abstract function getGroup();", "public function group($str) \n {\n $this->_data['group'] = $str;\n $this->_data['query'] .= ' GROUP BY '.$str;\n return $this;\n }", "function get_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->get_by($field, $match);\n\t}", "public function addGroup($attributes) {\n return $this->get('add_group', $attributes);\n }", "public function merge();", "public function groupBy()\n {\n $this->groupBy = func_get_args();\n return $this;\n }", "public function join(Result $another): Result;", "public function merge($first, $second) {\n throw new UnsupportedOperationException();\n }", "public function getSecondaryAggregation()\n {\n return $this->secondary_aggregation;\n }", "public function getSubgroup() {}", "public function merge_with(&$other)\r\n {\r\n foreach ($other->entries as $entry) {\r\n $this->entries[$entry->key()] = $entry;\r\n }\r\n }", "function somar($a, $b){\n\n\treturn $a + $b;\n}", "public function setPolicyRulesFromGroupPolicyMerged($val)\n {\n $this->_propDict[\"policyRulesFromGroupPolicyMerged\"] = $val;\n return $this;\n }", "protected static function mergeGroup($new, $old)\n {\n if (! empty($namespace = array_get($old, 'namespace'))) {\n $value = array_get($new, 'namespace');\n\n $new['namespace'] = ! empty($value) ? trim($namespace, '\\\\') .'\\\\' .trim($value, '\\\\') : $namespace;\n }\n\n if (! empty($prefix = array_get($old, 'prefix'))) {\n $value = array_get($new, 'prefix');\n\n $new['prefix'] = ! empty($value) ? trim($prefix, '/') .'/' .trim($value, '/') : $prefix;\n }\n\n $new['where'] = array_merge(\n array_get($old, 'where', array()),\n array_get($new, 'where', array())\n );\n\n return array_merge_recursive(\n array_except($old, array('namespace', 'prefix', 'where')), $new\n );\n }", "function ordenar_grupos_de_estudios ($a, $b) {\n global $agrupar_estudios_array;\n $a_pos = array_search($a, array_keys($agrupar_estudios_array)); \n $b_pos = array_search($b, array_keys($agrupar_estudios_array));\n\n $resultado = $a_pos - $b_pos;\n if ($a_pos == NULL) {\n $resultado = -1;\n } \n if ($b_pos == NULL) {\n $resultado = +1;\n }\n return $resultado;\n }", "function eio_grp_add($grp, $req)\n{\n}", "function new_groups()\n {\n \n }", "public function aggregate(): void;", "public function group_safe($keys, $initial, $reduce, $options = array())\n {\n if(is_string($keys)) {\n $keys = array($keys => 1);\n }\n if( ! $reduce instanceof MongoCode) {\n $reduce = new MongoCode($reduce);\n }\n $result = $this->__call('group', array($keys, $initial, $reduce, $options));\n if( empty($result['ok'])) {\n $message = json_encode($result); //isset($result['errmsg']) ? $result['errmsg'] : ;\n throw new MongoException($message);\n }\n return $result['retval'];\n }", "function bn_auto_group_join($userid, $x = 0, $y = 0){\r\n global $wpdb, $bp, $user_id;\r\n // get the user id\r\n if ($bp->loggedin_user->id && $x !== 'myid') {\r\n $userid = $bp->loggedin_user->id ; // current user if logged in. On activation, userid sent with do_action\r\n }\r\n\r\n // All users\r\n if($all_users_group = get_option('gaj_all_users_group')) {\r\n check_and_add_to_group($userid, $all_users_group);\r\n }\r\n\r\n // get profile fields with group linking\r\n $profiles = $wpdb->get_results(\"SELECT * FROM {$bp->profile->table_name_fields} WHERE group_link = 1\");\r\n foreach ($profiles as $profile) {\r\n\r\n // see what the person has for that field\r\n $profileinfo = $wpdb->get_results(\"SELECT value FROM {$bp->profile->table_name_data} WHERE user_id = $userid AND field_id = $profile->id\");\r\n foreach ($profileinfo as $profilevalue ) {\r\n\r\n // see if we can match the group\r\n $groupmatches = $wpdb->get_results(\"SELECT * FROM {$bp->groups->table_name} WHERE name like '$profile->group_pre_regex$profilevalue->value$profile->group_post_regex'\");\r\n foreach ($groupmatches as $groupmatch) {\r\n if(!check_and_add_to_group($userid, $groupmatch->id)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n}", "public function addSecond(string $groupId = ''){\n\t\tif (!isset($this->groupResults[$groupId])) throw new \\Exception('Group '.$groupId.' is not set for this team ('.$this->name.')');\n\t\t$this->groupResults[$groupId]['points'] += $this->groupResults[$groupId]['group']->getSecondPoints();\n\t\t$this->sumPoints += $this->groupResults[$groupId]['group']->getSecondPoints();\n\t\t$this->groupResults[$groupId]['second']++;\n\t\treturn $this;\n\t}", "function mGROUP(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$GROUP;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:166:3: ( 'group' ) \n // Tokenizer11.g:167:3: 'group' \n {\n $this->matchString(\"group\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function compute(): void\n {\n try {\n $this->emit(new Group\\Start($this->parser));\n $this->getLeftNode()->compute();\n $this->emit($this);\n $this->getRightNode()->compute();\n $this->emit(new Group\\End($this->parser));\n } catch (NodeHandledException $e) {\n return;\n }\n }", "public function group() {\n\t\t$this->addRule($v = new ValidationRuleGroup($this));\n\t\treturn $v;\n\t}", "private function computeGroup()\n {\n $this->group = [];\n\n foreach (range(1, $this->getSize()) as $number) {\n if (1 === $this->gcd($number, $this->getSize())) {\n $this->group[] = $number;\n }\n }\n }", "function variant_mul($left, $right) {}", "protected abstract function getGroupByClause(array $grouping);", "public function switchGroup($group);", "public function group($group, $context)\n\t{\n\t\treturn $this->_sort($group, $context, 'GROUP BY', false);\n\t}", "public function getGroup();", "public function getGroup();", "public function getGroup();", "public function getUsergroup() {}", "public function recursiveVariation($collectionA, $collectionB){\n if(count($collectionA) == 0){\n // Return The First Collection\n return $collectionB;\n }\n // Cross Join The 2 Collections\n return $collectionA->crossJoin($collectionB);\n }", "function aggregate($object, $class_name)\n{\n}", "public function assignGroup(...$groups): HasGroups;", "static public function merge ($this1, $other, $merger, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:63: lines 63-65\n\t\tif ($gather === null) {\n\t\t\t$gather = true;\n\t\t}\n\t\t$ret = $this1->flatMap(function ($t) use (&$other, &$merger) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:64: characters 14-66\n\t\t\treturn $other->map(function ($a) use (&$t, &$merger) {\n\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:64: characters 39-58\n\t\t\t\treturn $merger($t, $a);\n\t\t\t});\n\t\t});\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:63: lines 63-65\n\t\tif ($gather) {\n\t\t\treturn $ret->gather();\n\t\t} else {\n\t\t\treturn $ret;\n\t\t}\n\t}", "function system_add_group($paramv)\n{\n}", "function get_second_group($user)\n{\n $group = (int) (isset($user->group) ? $user->group : $user->power);\n if ($group === 1) {\n return (int) $user->ca;\n } elseif ($group === 2) {\n if (isset($user->temp_mod) && $user->temp_mod) {\n return 0;\n } elseif ((bool) (int) $user->trial_mod) {\n return 1;\n } else {\n return 2;\n }\n }\n return -1;\n}", "function get_this_group($grp_id)\n{\n\t$db=new db_util();\n\t$query_string=\"SELECT * FROM vm_group WHERE v_group_id=$grp_id\";\n\t$result=$db->query($query_string);\n\treturn $result;\n}", "function aggregate_new($group_CND,$nid_list) {\r\n global $user;\r\n if(!is_array($nid_list)) return FALSE;\r\n //create node\r\n $nid=0;\r\n $time=time();\r\n $desc=get_cud_description($group_CND);\r\n db_query(\"INSERT INTO {node_revisions} (uid,title,body,teaser,log,timestamp)\r\n\t\t\t VALUES (%d,'%s','%s','%s','Aggregazione automatica',%d)\",$user->uid,$desc,$desc,$desc,time());\r\n $vid=db_last_insert_id('{node_revisions}','vid');\r\n\r\n db_query(\"INSERT INTO {node} (vid,type,language,title,uid,\r\n\t\t created,changed,comment,promote)\r\n\t\tVALUES (%d,'gare','it','%s',%d ,\r\n\t\t%d,%d,2,1)\",$vid,$desc,$user->uid,$time,$time);\r\n $nid=db_last_insert_id('{node}','nid');\r\n\r\n db_query(\"UPDATE {node_revisions} SET nid=\".$nid.\" WHERE vid=\".$vid);\r\n set_status($nid,_PROPOSED);\r\n $res=$nid;\r\n foreach($nid_list as $key => $val) {\r\n if ($val) $res =(aggregate_node($nid,$key)?$res:FALSE);\r\n }\r\n $value=db_fetch_object(db_query(\"SELECT SUM(r.value) as value, SUM(r.qta) as qta FROM \"._REQUESTS_TABLE.\" r\r\n\t\t\t INNER JOIN \".query_aggregation($nid).\" ag ON ag.nid2=r.nid\r\n\t\t\t INNER JOIN {node} n ON n.nid=r.nid AND n.vid=r.vid \"));\r\n db_query(\"INSERT INTO \"._GARE_TABLE.\" (nid,vid,CND,value,qta)\r\n\t\t\t VALUES (%d,%d,'%s',%d,%d)\",$nid,$vid,$group_CND,$value->value,$value->qta);\r\n return $res;\r\n}", "public function get_group_by()\n\t{\n\t\treturn NULL;\n\t}", "public function __add($other) {\n return $this->add($other);\n }", "public function testGroupInGroup()\n {\n $_POST['foo'] = ['bar' => ['baz' => 'fizzbuz']];\n $form = new class extends Formulaic\\Post {};\n $form->attribute('id', 'test');\n $form[] = new Formulaic\\Element\\Group('foo', function ($group) {\n $group[] = new Formulaic\\Element\\Group('bar', function ($group) {\n $group[] = new Formulaic\\Text('baz');\n });\n });\n yield assert('fizzbuz' == $form['foo']['bar']['baz']->getValue());\n yield assert(\"$form\" == <<<EOT\n<form action=\"\" id=\"test\" method=\"post\">\n<input id=\"test-foo-bar-baz\" name=\"foo[bar][baz]\" type=\"text\" value=\"fizzbuz\">\n</form>\nEOT\n );\n }", "public function union(): self;", "public function groupBy($callback);", "public function merge($array1, $array2)\n\t\t{\n\t\t\t$intersection=array_intersect_key($array1, $array2);\n\t\t\t//merge the arrays, array_merge will cover the value that has same key\n\t\t\t$merged=array_merge($array1,$array2);\n\n\t\t\t//now reset the intersection part's value into the addition\n\t\t\tforeach ($intersection as $key => $value) {\n\t\t\t\tif(array_key_exists($key, $merged)){\n\t\t\t\t\t$merged[$key]=$array1[$key]+$array2[$key];\n\t\t\t\t}else{\n\t\t\t\t\techo \"error in merge! key disappeared\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $merged;\n\t\t}", "public function mergeNextWhere($group = true)\n {\n $this->mergeNextWhere = $group;\n return $this;\n }", "public function in($other)\n {\n $params = array();\n foreach ($other as $o) $params[] = $this->bindParam($o);\n $other = new Grouping(new ClauseList($params));\n return $this->compare(Operators::IN, $other);\n }", "public function setConnectionSecurityRulesFromGroupPolicyMerged($val)\n {\n $this->_propDict[\"connectionSecurityRulesFromGroupPolicyMerged\"] = $val;\n return $this;\n }", "public function addGroupBy($field)\n\t{\n\t\tparent::addGroupBy($field);\n\t\treturn $this;\n\t}", "public function getGroupObject() {\n return $this->groups[0];\n }", "public function getGroup(): GroupInterface;", "public function group($vals)\n {\n $vals = static::ensure_array($vals);\n foreach ($vals as $val) $this->group[] = self::quote_name($val);\n $this->group = array_unique($this->group);\n return $this;\n }", "public function combine($keyPath, $valuePath, $groupPath = null);", "public function divide( $A , $B );", "function array_add_by_key( $array1, $array2 ) {\n foreach ( $array2 as $k => $a ) {\n if ( array_key_exists( $k, $array1 ) ) {\n $array1[$k] += $a;\n } else {\n $array1[$k] = $a;\n }\n }\n return $array1;\n}", "function variant_add($left, $right) {}", "public function group($matches){\n\n foreach ((array) $matches as $match) {\n if($this->groups->contains($match)) return !0;\n }\n\n return !1;\n\n }", "function restore_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->restore_by($field, $match);\n\t}", "private function getSingleGroup()\n {\n if (!$this->result) {\n throw new \\Exception('This adapter must have a result set on it before being accessed');\n }\n $grouping = $this->result->getGrouping();\n $groups = reset($grouping);\n $group = reset($groups);\n\n return $group;\n }", "function merge($a,$b) {\n return $obj_merged = (object) array_merge((array) $b, (array) $a);\n // foreach($a as $k => $v) {\n // dump($k,$v);\n // $b->$k = $v;\n // } \n // return $b;\n}" ]
[ "0.5006125", "0.48509556", "0.4818769", "0.47442707", "0.46887252", "0.4685786", "0.46814954", "0.46423388", "0.45940766", "0.45835826", "0.45731094", "0.45561758", "0.45561758", "0.45542932", "0.4498245", "0.44929102", "0.4488084", "0.44859546", "0.4453181", "0.44419634", "0.4427938", "0.44115886", "0.44025183", "0.43887863", "0.43879348", "0.4380105", "0.43660626", "0.43531537", "0.43419322", "0.4324679", "0.43177304", "0.43039712", "0.42907232", "0.42653003", "0.4264458", "0.4259721", "0.42567134", "0.42363244", "0.4234135", "0.42254326", "0.42197707", "0.42134354", "0.42121413", "0.42027223", "0.41996828", "0.4181334", "0.41796723", "0.41746938", "0.4169788", "0.41637135", "0.4163436", "0.41547844", "0.414457", "0.41394567", "0.413527", "0.41341326", "0.4131683", "0.4124371", "0.41176677", "0.4112681", "0.4112621", "0.41117305", "0.41103178", "0.40971443", "0.40960753", "0.40920252", "0.4085444", "0.40846106", "0.40846106", "0.40846106", "0.40827107", "0.40775254", "0.40761623", "0.40751985", "0.4062262", "0.40615273", "0.40512356", "0.40436003", "0.40372926", "0.40352952", "0.4032976", "0.4019614", "0.40177715", "0.40166247", "0.40151697", "0.40121937", "0.40117463", "0.40108445", "0.40082595", "0.40044773", "0.39979178", "0.39949092", "0.39948484", "0.39937195", "0.3989193", "0.39888945", "0.39824763", "0.39799172", "0.39777836", "0.39637947" ]
0.57989866
0
check SiteController > index on how to use
protected function run() { //to use //$this->task is available here //$this->queue is available here //set $this->exit_response to any value before returning //with a EXIT_STATUS. This will be saved to response column of the $task object. //if you want to retry //return self::EXIT_STATUS_RETRY //if you do not want to retry //return self::EXIT_STATUS_RETRY //if success //return self::EXIT_STATUS_OK }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function singleIndexAction() {}", "public function indexAction()\n {\n //for real application\n }", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "protected function indexAction() {}", "public function actionIndex() {\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->layout = '//layouts/admin_iframe_main';\n\t\t$this->render('index');\n\t\t//$this->_actionManageBasicSiteInfo ();\n\t}", "public function actionIndex()\n\t{\n\t\t// do stuff that's not the main content?\n\t}", "public function actionIndex() {}", "public function actionIndex() {}", "public function actionIndex()\n {\n\t\t$id = 1;\n return $this->render('/backend/siteinfo/view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function indexAction() {\r\n }", "public function indexAction() {\n\t}", "public function indexAction() {\n\t}", "public function index()\n {\n\n //grab us some sites\n $this->data['sites'] = $this->sitemodel->all();\n\n// $sites_id = $this->sitemodel->getSiteId($this->ion_auth->get_user_id());\n //get all users\n $this->data['users'] = $this->usermodel->getAll();\n if (!$this->ion_auth->is_admin()) {\n if (count($this->data['sites']) <= 0) {\n redirect(site_url('sites/create'), 'location');\n } else {\n $this->template->load('main', 'sites', 'sites/show_sites', $this->data);\n }\n } else {\n $this->data['page'] = \"sites\";\n $this->data['pageHeading'] = $this->lang->line('sites_header');\n $this->data['css'] = array(\n '<link href=\"' . base_url() . 'assets/sites/less/flat-ui.css\" rel=\"stylesheet\">'\n );\n $this->data['js'] = array(\n '<script type=\"text/javascript\" src=\"' . base_url() . 'assets/sites/js/sites.js\"></script>',\n '<script type=\"text/javascript\" src=\"' . base_url() . '/assets/js/jquery.blockUI.js\"></script>',\n );\n $this->template->load('main', 'sites', 'sites/sites', $this->data);\n }\n }", "public function index(){\n\t\treturn view('site');\n\t}", "public function actionIndex()\n {\n return $this->render('site/index',['testParam'=>'test']);\n }", "public function indexAction() {\n\n\t}", "public function indexAction() {\n }", "public function indexAction() {\n }", "public function indexAction() {\r\n \r\n }", "public function action_index()\n {\n $this->request->response = $this->render_layout($this->widget_sites());\n }", "public function indexAction()\n {\n// $this->view = 'index';\n }", "public function index();", "public function index();", "public function index();", "public function indexAction ()\r\n {\r\n\r\n }", "public function indexAction(){}", "public function actionIndex()\n {\n return $this->redirect((array('site/index')));\n }", "public function indexAction(){\t\t\n\t}", "public function indexAction() {\n \n }", "public function actionIndex()\r\n\t{\r\n\t\t// renders the view file 'protected/views/site/index.php'\r\n\t\t// using the default layout 'protected/views/layouts/main.php'\r\n\t\t$this->render('index');\r\n\t}", "public function actionIndex() {\r\n // renders the view file 'protected/views/site/index.php'\r\n // using the default layout 'protected/views/layouts/main.php'\r\n $this->render('index');\r\n }", "public function indexAction() \n {\n \t\n }", "public function indexAction()\n {}", "public function index(){}", "public function index()\n\t{\t\n\t}", "public function index()\n {\n $data = Site::find(1);\n return view('Admin/site/index',['data'=>$data]);\n }", "public function indexAction() {\n\n }", "public function indexAction() {\n\n }", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t//$this->render('index');\n\t\t$this->redirect(array('/cpanel'));\n\t}", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function indexAction()\n {\n }", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('index');\n\t}", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $this->render('index');\n }", "public function indexAction() {\n $viewer = Engine_Api::_()->user()->getViewer();\n // $siteloginlinkedinwidget = Zend_Registry::isRegistered('siteloginlinkedinwidget') ? Zend_Registry::get('siteloginlinkedinwidget') : null; \n if (empty($viewer))\n return $this->setNoRender();\n\n $this->view->base_url = Zend_Controller_Front::getInstance()->getBaseUrl();\n $enabledSites = $this->_getParam('enabled_socialsites', array());\n foreach ($enabledSites as $socialsite) { \n $siteintegtration=$socialsite.'IntegrationEnabled';\n if($socialsite == 'facebook' || $socialsite == 'twitter'){ \n $siteEnabled=Engine_Api::_()->sitelogin()->$siteintegtration();\n } else { \n $siteEnabled = Engine_Api::_()->getDbtable($socialsite, 'sitelogin')->$siteintegtration();\n }\n if(!empty($siteEnabled))\n $integratedSites[]=$socialsite;\n }\n $this->view->enabledSites = $integratedSites;\n $settings = Engine_Api::_()->getDbtable('settings', 'core');\n }", "public function indexAction(){\r\n\t\t\t\r\n\t\t}", "public function actionIndex() {\n// $this->\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n $this->render('index');\n }", "public function Index()\n\t{\t\n\t}", "public function actionIndex()\n {}", "public function actionIndex()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\n\t\t$this->render('index');\n\t}", "public function indexAction()\n\t{\n\n\t}", "public function indexAction() {\n\n\n\n\n }", "public function actionIndex() {\n // renders the view file 'protected/views/site/index.php'\n // using the default layout 'protected/views/layouts/main.php'\n //$this->layout = 'layout';\n $this->pageTitle=\"KushGhar-Home\";\n $this->render('index');\n }", "public function Index() {\n $content = new CMContent();\n $modules = new CMModules();\n $controllers = $modules->AvailableControllers();\n $this->views->SetTitle('Sida')\n ->AddInclude(__DIR__ . '/index.tpl.php', array(\n 'content' => null,\n ), 'primary')\n ->AddInclude(__DIR__ . '/../adminsidebar.tpl.php', array('is_authenticated'=>$this->user['isAuthenticated'], \n 'user'=>$this->user,'controllers'=>$controllers,'contents'=>$content->ListAll(array('type'=>'post', 'order-by'=>'title', 'order-order'=>'DESC')),), 'sidebar');\n }", "public function index()\n\t{\n\t\t//if needed\n\t}", "function index() {\r\r\n $data = array();\r\r\n //load the view\r\r\n $data['sites'] = $this->sites_model->get_all_site($data);\r\r\n $data['main_content'] = 'admin/sites/list';\r\r\n $this->load->view('includes/template', $data);\r\r\n }", "public function indexAction()\n {\n\n }", "public function fullIndexAction() {}", "public function index() {}", "public function index() {}", "public function index()\n {\n $this->viewIs('tankvtank/index');\n }", "public function indexAction()\n {\n\n }", "public function indexAction()\n {\n\n }", "public function indexAction()\n {\n\n }", "public function indexAction()\n {\n\n }", "public function indexAction()\n {\n\n }", "public function indexAction()\n {\n\n }", "public function index()\r\n\t{\r\n\t\t//\r\n\t}", "public function showIndex()\r\n\t{\r\n\t\t return View::make('sites.index')\r\n ->with('title', 'Sites');\r\n\t}", "public function index(){\n\t \n\t\t\t\t\t}", "public function actionIndex()\n {\n //$this->redirect(array('site/login'));\n $this->render('home', array());\n }", "public function index(){\n\t\t//\n\t}" ]
[ "0.7648783", "0.76236945", "0.747488", "0.747371", "0.747371", "0.747371", "0.747371", "0.747371", "0.747371", "0.747371", "0.747371", "0.747371", "0.7472966", "0.74594134", "0.7387511", "0.73739916", "0.7368913", "0.7368913", "0.7332823", "0.73195225", "0.7292495", "0.7292495", "0.7275036", "0.72707045", "0.725284", "0.7248465", "0.7240245", "0.7240245", "0.7231929", "0.7228845", "0.72242695", "0.72021425", "0.72021425", "0.72021425", "0.7200096", "0.72000515", "0.71987927", "0.71922493", "0.7181094", "0.716936", "0.7167836", "0.71610856", "0.71610796", "0.7158789", "0.7158683", "0.7153461", "0.7148809", "0.7148809", "0.71484375", "0.71477026", "0.71477026", "0.71477026", "0.71477026", "0.71477026", "0.71477026", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.7135288", "0.713327", "0.7128754", "0.71266466", "0.71246743", "0.71241313", "0.71166974", "0.7111426", "0.7102701", "0.7093994", "0.7086535", "0.708418", "0.70713073", "0.70700985", "0.70687085", "0.70676124", "0.7064841", "0.7064841", "0.70607257", "0.70598567", "0.70598567", "0.70598567", "0.70598567", "0.70598567", "0.70598567", "0.7057364", "0.7056835", "0.70544255", "0.7053398", "0.70494074" ]
0.0
-1
Load configuration from file or from direct input
public function load ($configuration): void { if (!is_array($configuration) && !file_exists($configuration)) { throw new ParseInputException('Configuration format was not recognized'); } if (file_exists($configuration) && is_readable($configuration)) { $conf_file = $configuration; $configuration = []; // YAML support //if (!function_exists('yaml_parse_file')) { // throw new ConfigException('Package like php-pecl-yaml HAVE TO be installed!'); //} //$configuration = yaml_parse_file($conf_file, true); // INI support if (!$configuration) { $configuration = parse_ini_file($conf_file, true); } if (!$configuration) { throw new ParseFileException('Given config file ' . var_export($conf_file, true) . ' cannot be parsed!'); } } $this->config = $this->merge($this->config, $configuration); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function loadConfig();", "public abstract function loadConfig($fileName);", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function loadConfig($data);", "abstract public function loadConfig(array $config);", "abstract protected function loadConfiguration($name);", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "abstract protected function loadConfig(array $config);", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "private function _loadConfig($options) {\n\n $conf_file = NULL;\n if (isset($options ['config'])) {\n $conf_file = $options ['config'];\n } else if (isset($options ['c'])) {\n $conf_file = $options ['c'];\n }\n\n if ($conf_file !== NULL && !file_exists($conf_file)) {\n $this->log(\"file does not exists\", self::ERROR);\n exit;\n }\n\n if ($conf_file !== NULL && file_exists($conf_file)) {\n $this->_config = parse_ini_file($conf_file, true);\n return $this;\n }\n }", "static public function load($filename) {\n\t\t$filename .= '.php';\n\n\t\tif (!file_exists($filename)) {\n\t\t\tthrow new \\Exception('Configuration file not found: ' . $filename);\n\t\t}\n\n\t\tinclude $filename;\n\n\t\tif (!isset($config)) {\n\t\t\tthrow new \\Exception('No variable $config found in ' . $filename);\n\t\t}\n\n\t\tself::$values = $config;\n\t}", "public function loadYamlConfig($filepath);", "function load_config($path) {\n \n // Check path\n if(file_exists($path) == false) {\n throw new Exception(\"Unable to load configuration -- file not found: $path\");\n }\n \n // Check file\n if(is_file($path) == false) {\n throw new Exception(\"Unable to load configuration -- not a file: $path\");\n }\n \n // Check permissions\n if(is_readable($path) == false) {\n throw new Exception(\"Unable to load configuration -- access denied: $path\");\n }\n \n // Check size \n if(filesize($path) == 0) {\n throw new Exception(\"Unable to load configuration -- file is empty: $path\");\n }\n \n // Load parser\n require_once(YAML_PARSER);\n \n // Load config\n $config = Spyc::YAMLLoad($path);\n \n // Check result - if empty, throw an exception\n if(sizeof($config) == 0) {\n throw new Exception(\"Unable to load configuration -- parse error: $path\");\n }\n \n // General application options\n if(isset($config['info']['name'])) { $this->set_name($config['info']['name']); }\n if(isset($config['info']['admin email'])) { $this->set_admin_email($config['info']['admin email']); }\n if(isset($config['info']['admin name'])) { $this->set_admin_name($config['info']['admin name']); }\n if(isset($config['info']['base url'])) { $this->set_base_url($config['info']['base url']); }\n if(isset($config['info']['base directory'])) { $this->set_base_dir($config['info']['base directory']); }\n \n // Database\n if(isset($config['database']['name'])) { \n \n // Initialize db object\n $this->db = new StanfordDatabase();\n \n // Credentials\n if(isset($config['database']['name'])) { $this->db->set_database($config['database']['name']); }\n if(isset($config['database']['username'])) { $this->db->set_username($config['database']['username']); }\n if(isset($config['database']['password'])) { $this->db->set_password($config['database']['password']); }\n \n // Encryption\n if(isset($config['database']['use encryption'])) { $this->db->use_encryption($config['database']['use encryption']); }\n else { $this->db->use_encryption(false); }\n\n }\n \n // Use mysql sessions set to true\n if(isset($config['database']['use mysql sessions']) && $config['database']['use mysql sessions'] == true ) {\n \n // Check DB\n if($this->db instanceof StanfordDatabase) {\n \n // Enable MySQL sessions\n $this->db->setup_mysql_sessions();\n \n }\n else {\n \n // DB not configured\n throw new Exception(\"Cannot enable MySQL-based sessions -- database credentials not provided\"); \n \n }\n }\n \n // Logging\n if(isset($config['settings']['logging mode'])) {\n $this->util->set_error_reporting($config['settings']['logging mode']);\n }\n \n // Undo magic quotes\n if(isset($config['settings']['undo magic quotes']) && $config['settings']['undo magic quotes'] == true) {\n $this->util->undo_magic_quotes();\n }\n }", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "private function load_config() {\n $this->config = new Config();\n }", "public function load(): ConfigStoreInterface;", "function cfgLoader($loadType = null, $jsonFile = null, $iniFile = null , $fullPath = null, $arrayFile = null){\n $this->loadType = ($loadType==null) ? \"ANY\" : $loadType;\n\n //Default file names or provided names\n $this->jsonFile = ($jsonFile==null) ? \"config.json\" : $jsonFile;\n $this->iniFile = ($iniFile == null) ? \"config.ini\" : $iniFile;\n $this->arrayFile = ($arrayFile == null) ? \"arraycfg.php\" : $arrayFile;\n\n //Default folder for cfg files\n $this->fullPath = ($fullPath == null) ? \"../cfg/\" : $fullPath;\n\n switch ($this->loadType){\n case \"ANY\":\n $this->loadJson();\n $this->loadIni();\n $this->loadArray();\n break;\n\n case \"JSON\":\n $this->loadJson();\n break;\n\n case \"INI\":\n $this->loadIni();\n break;\n\n case \"ARRAY\":\n $this->loadArray();\n break;\n }\n }", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "abstract protected function loadSettings();", "public function testConfigFromSingleFile()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"view\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayNotHasKey(\"items\", $config);\n $this->assertContains(\"a view\", $config[\"config\"]);\n }", "function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}", "public static function loadConfig($configFile) {\n\t}", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "public static function load()\n {\n $configFile = self::getConfigFilePath();\n\n if (!is_file($configFile)) {\n self::save([]);\n }\n\n $config = require($configFile);\n\n if (!is_array($config))\n return array();\n\n return $config;\n }", "private function loadConfig() {\n $config = array();\n\n $this->config = $config;\n if (file_exists(__DIR__ . '/../config.php')) {\n require_once(__DIR__. '/../config.php');\n $this->config = array_merge($this->config, $config);\n //TODO check for required config entries\n } else {\n //TODO handle this nicer\n $this->fatalErr('NO_CFG', 'Unable to load config file');\n }\n\n if (array_key_exists('THEME', $this->config)) {\n $this->pageLoader->setTheme($this->config['THEME']);\n }\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::APP_CONFIG);\n $this->config = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal\n }\n\n $this->is_loaded = TRUE;\n }", "public function load($path = null)\n {\n // initialize / test basebath\n $this->initialize();\n\n // absolute path\n if( file_exists($path) )\n {\n $config = is_file($path)\n ? $path\n : realpath($path . '/paths.php');\n }\n\n // relative path\n else\n {\n // test if an actual config file was passed\n $path = preg_match('/paths\\.php$/', $path)\n ? $path\n : $this->basepath . '/' . $path . '/paths.php';\n\n // resolve real file\n $config = realpath($path);\n if( ! $config )\n {\n throw new \\InvalidArgumentException('Config path \"' .$path. '\" doesn\\'t resolve to a configuration file');\n }\n }\n\n // load config\n $paths = require $config;\n\n // detect directory separator if convertslashes is auto\n if($this->convertslashes === 'auto')\n {\n // set separator\n preg_match('%[\\/]%', implode('', $paths), $matches);\n $this->separator = count($matches) ? $matches[0] : DIRECTORY_SEPARATOR;\n }\n\n // convert base\n if($this->convertslashes)\n {\n $this->basepath = $this->fix($this->basepath);\n }\n\n // set paths\n foreach($paths as $key => $value)\n {\n $this->set($key, $value);\n }\n\n // return this\n return $this;\n }", "public static function load(array $arguments, string $file = self::DEFAULT_FILE_PATH)\n {\n // Generate default config instance.\n self::$config = new Config();\n self::setOption('php_version', phpversion());\n\n // If received file name is valid file, parses this file.\n if (is_file($file)) {\n Logger::getInstance()->info('Load: '.$file);\n $config_yaml = Yaml::parse(file_get_contents($file));\n if (is_iterable($config_yaml)) {\n foreach ($config_yaml as $key => $value) {\n // `format` can not be specified from the configuration file.\n if ($key === 'format') {\n throw new InvalidConfigOptionException('`format` is an invalid option in config file.');\n }\n self::setOption($key, $value);\n }\n // If object is not iterable, It judges that this configuration file is invalid.\n } else {\n throw new InvalidConfigFilePathException('`'.$file.'` is not a valid YAML.');\n }\n // If the configuration file name does not exist and is not the default, throw an exception.\n } elseif ($file !== self::DEFAULT_FILE_PATH) {\n throw new InvalidConfigFilePathException('`'.$file.'` is not found.');\n // If the configuration file name does not exist and is the default, does not throw an exception.\n } else {\n Logger::getInstance()->info(self::DEFAULT_FILE_PATH.' is not found.');\n }\n\n // If the arguments are given, set it.\n if ($arguments['php-version']) {\n self::setOption('php_version', $arguments['php-version']);\n }\n if ($arguments['ignore-tools']) {\n self::setOption('ignore_tools', $arguments['ignore-tools']);\n }\n if ($arguments['only-tools']) {\n self::setOption('only_tools', $arguments['only-tools']);\n }\n if ($arguments['ignore-paths']) {\n self::setOption('ignore_paths', $arguments['ignore-paths']);\n }\n if ($arguments['extensions']) {\n self::setOption('extensions', $arguments['extensions']);\n }\n if ($arguments['vendor']) {\n self::setOption('vendor', $arguments['vendor']);\n }\n if ($arguments['format']) {\n self::setOption('format', $arguments['format']);\n }\n\n // Append ignore tools based on only tools\n if (!empty(self::$config->only_tools)) {\n $ignore_tools = array_filter(ToolBox::VALID_TOOLS, function ($tool) {\n return !in_array($tool, self::$config->only_tools, true);\n });\n self::$config->ignore_tools = array_unique(array_merge(self::$config->ignore_tools, $ignore_tools));\n }\n\n // If disabled vendor flag, add `vendor` directory to ignore paths.\n if (!self::$config->vendor) {\n self::$config->ignore_paths[] = 'vendor';\n }\n\n // Resolve ignore_paths to file name and reset.\n self::$config->ignore_paths = array_map(function ($path) {\n return realpath($path);\n }, Loader::dig(self::$config->ignore_paths, self::$config));\n\n Logger::getInstance()->info('PHP version: '.self::$config->php_version);\n Logger::getInstance()->info('Ignore tools: '.var_export(self::$config->ignore_tools, true));\n Logger::getInstance()->info('Ignore paths: '.var_export(self::$config->ignore_paths, true));\n Logger::getInstance()->info('Extensions: '.var_export(self::$config->extensions, true));\n Logger::getInstance()->info('Vendor: '.var_export(self::$config->vendor, true));\n Logger::getInstance()->info('Format: '.self::$config->format);\n }", "public static function load()\n {\n if(!self::$loaded)\n {\n $GLOBALS['_EZMVC_SYS_CONFIG'] = require __DIR__ . '/system.config.php'; //Load config file\n $GLOBALS['_EZMVC_SYS_CONFIG'] = is_array($GLOBALS['_EZMVC_SYS_CONFIG']) ? $GLOBALS['_EZMVC_SYS_CONFIG'] : []; //Make sure its an array\n\n $GLOBALS['_EZMVC_APP_CONFIG'] = require dirname(__DIR__) . '/app/config/app.config.php';\n $GLOBALS['_EZMVC_APP_CONFIG'] = is_array($GLOBALS['_EZMVC_APP_CONFIG']) ? $GLOBALS['_EZMVC_APP_CONFIG'] : [];\n }\n }", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "function load(string $id) {\n\t\t$cstr = NULL;\n\t\t$conf = NULL;\n\n\t\t$this->mk_paths($id);\n\t\tif (!is_file($this->conf_path)) {\n\t\t\tthrow new ArgException(\"Slide $id doesn't exist.\");\n\t\t}\n\n\t\t// Read config.\n\t\t$cstr = file_lock_and_get($this->conf_path);\n\t\tif ($cstr === FALSE) {\n\t\t\tthrow new IntException(\"Slide config read error!\");\n\t\t}\n\t\t$conf = json_decode($cstr, $assoc=TRUE);\n\t\tif (\n\t\t\t$conf === NULL\n\t\t\t&& json_last_error() != JSON_ERROR_NONE\n\t\t) { throw new IntException(\"Slide config decode error!\"); }\n\n\t\t$this->import($conf, TRUE);\n\t\t$this->set_ready(TRUE);\n\t\t$this->lock_cleanup();\n\t\t$this->check_sched_enabled();\n\t}", "public function testConfigurationFromFile()\n {\n $path = __DIR__ . '/files/file1.config.php';\n\n $configuration = Factory::fromFile($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n $this->assertEquals(include $path, $configuration->getInternalContainer());\n }", "public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }", "public static function read_config()\n\t{\n\t\t$config = realpath(dirname(__FILE__) . '/../../config_local.php');\n\t\t$hosted_config = Utils::get_hosted_path() . '/config_local.php';\n\n\t\tif (is_readable($config)) \n\t\t{\n\t\t\trequire($config);\n\t\t\t$is_hosted = FALSE;\n\t\t\t\n\t\t// maybe we are hosted\n\t\t} elseif (file_exists($hosted_config) )\n\t\t{\n\t\t\trequire($hosted_config);\n\t\t\trequire_once(Utils::get_hosted_path() . '/htdocs/system/system.php');\n\t\t\t$is_hosted = TRUE;\n\n\t\t// lets try the normal config location\n\t\t} elseif (is_readable('config.php')) \n\t\t{\n\t\t\trequire('config.php');\n\t\t\t$is_hosted = FALSE;\n\n\t\t// redirect\n\t\t} else \n\t\t{\n\t\t\theader('Location: install/index.php');\n\t\t\t$is_hosted = FALSE;\n\t\t}\n\n\t\tdefine('IS_HOSTED', $is_hosted);\n\t}", "function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)\n {\n $file = ($file == '') ? 'config' : str_replace(EXT, '', $file);\n\n if (in_array($file, $this->is_loaded, TRUE))\n {\n return TRUE;\n }\n\n // {{{ Matchbox\n\n $ci = &get_instance();\n $module = $ci->matchbox->argument(3);\n\n if (!$filepath = $ci->matchbox->find('config/' . $file . EXT, $module)) {\n if ($fail_gracefully === true) {\n return false;\n }\n\n show_error('The configuration file ' . $file . EXT . ' does not exist.');\n }\n\n include($filepath);\n\n // }}}\n\n if ( ! isset($config) OR ! is_array($config))\n {\n if ($fail_gracefully === TRUE)\n {\n return FALSE;\n }\n show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.');\n }\n\n if ($use_sections === TRUE)\n {\n if (isset($this->config[$file]))\n {\n $this->config[$file] = array_merge($this->config[$file], $config);\n }\n else\n {\n $this->config[$file] = $config;\n }\n }\n else\n {\n $this->config = array_merge($this->config, $config);\n }\n\n $this->is_loaded[] = $file;\n unset($config);\n\n log_message('debug', 'Config file loaded: config/'.$file.EXT);\n return TRUE;\n }", "function load_configs($file, $is_global = true)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid config file found in configs folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__CONFIG__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "private function _readFile()\n {\n $content = file_get_contents($this->file);\n $this->config = json_decode(utf8_encode($content), true);\n\n if ($this->config == null && json_last_error() != JSON_ERROR_NONE)\n {\n throw new \\LogicException(sprintf(\"Failed to parse config file '%s'. Error: '%s'\", basename($this->file) , json_last_error_msg()));\n }\n }", "private function loadIni(){\n if(file_exists($this->fullPath.$this->iniFile)) {\n $arCfg = parse_ini_file($this->fullPath.$this->iniFile);\n $this->loadConfigs($arCfg);\n }\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "private function loadConfig()\n {\n $files = scandir($this->configPath());\n $configs = [];\n\n foreach ($files as $file) {\n $filePath = $this->configPath() . DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n $config = [basename($file, '.php') => include $filePath];\n if (is_array($config)) {\n $configs = array_merge($configs, $config);\n }\n }\n }\n\n $this->config = $configs;\n }", "public static function load()\n {\n $files = glob(BASEDIR . '/config/*.php');\n foreach ($files as $file){\n $key = str_replace('.php', '', basename($file));\n static::$values[$key] = include $file;\n }\n }", "public function loadConfiguration()\n\t{\n\t\t// Set the configuration file path for the application.\n\t\t$file = JPATH_CONFIGURATION . '/configuration.php';\n\n\t\t// Verify the configuration exists and is readable.\n\t\tif (!is_readable($file))\n\t\t{\n\t\t\tthrow new \\RuntimeException('Configuration file does not exist or is unreadable.');\n\t\t}\n\n\t\t// Load the configuration file into an object.\n\t\trequire $file ;\n\t\t$config = new JConfig;\n\n\t\tif ($config === null)\n\t\t{\n\t\t\tthrow new \\RuntimeException(sprintf('Unable to parse the configuration file %s.', $file));\n\t\t}\n\n\t\t// Get the FB config file path\n\t\t$file = JPATH_BASE . '/config_fb.json';\n\n\t\t// Verify the configuration exists and is readable.\n\t\tif (!is_readable($file))\n\t\t{\n\t\t\tthrow new \\RuntimeException('FB-Configuration file does not exist or is unreadable.');\n\t\t}\n\n\t\t// Load the configuration file into an object.\n\t\t$configFb = json_decode(file_get_contents($file));\n\n\t\tif ($configFb === null)\n\t\t{\n\t\t\tthrow new \\RuntimeException(sprintf('Unable to parse the configuration file %s.', $file));\n\t\t}\n\n\t\t// Merge the configuration\n\t\t$config->fb_app_id \t\t= $configFb->app_id;\n\t\t$config->fb_app_secret \t= $configFb->app_secret;\n\n\t\t$this->config->loadObject($config);\n\n\t\treturn $this;\n\t}", "protected function load_config() {\n $this->config = Kohana::$config->load('imagecache');\n $this->config_patterns = Kohana::$config->load('imagecache_patterns');\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "public function loadConfiguration()\n {\n \\Env::init();\n\n if (file_exists(SRC_ROOT . '/.env')) {\n $dotenv = new Dotenv(SRC_ROOT);\n $dotenv->load();\n $dotenv->required([\n 'DB_NAME',\n 'DB_USER',\n 'DB_PASSWORD',\n 'DB_HOST'\n ]);\n }\n\n define('APP_ENV', env('APP_ENV') ?: self::ENV_LIVE);\n\n if (!in_array(APP_ENV, $this->getAllowedEnvironments(), true)) {\n die('Invalid environment');\n }\n\n $configFileName = SRC_ROOT . '/config/env/' . APP_ENV . '.php';\n\n if (file_exists($configFileName)) {\n require $configFileName;\n }\n }", "public function supports_traditional_php_config_files()\n {\n $container = new ContainerBuilder;\n $loader = new PhpConfigFileLoader($container, new FileLocator);\n\n $loader->load(__DIR__ . '/Fixtures/traditional-php-config.php');\n\n self::assertEquals('bar', $container->getParameter('foo'));\n }", "private function loadConfiguration()\n {\n if (!Configuration::configurationIsLoaded()) {\n Configuration::loadConfiguration();\n }\n }", "public function loadConfig($file)\n {\n $options = [];\n try {\n $loader = new PhpConfig();\n $options = $loader->read($file);\n } catch (\\Exception $e) {\n Log::warning($e->getMessage());\n }\n\t\t$this->config('options', $options);\n\t}", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "public function loadConfig($file) {\n $config = array();\n if (file_exists(PATH_CONFIGS . $file))\n include(PATH_CONFIGS . $file);\n if (!empty($config)) {\n foreach ($config as $name => $array) {\n $this->configs[$name] = $array;\n }\n }\n }", "function read_config($file = false)\n{\n global $config, $databases;\n $ret = false;\n if (!$file) {\n $file = $config['config_file'];\n }\n // protect from including external files\n $search = array(':', 'http', 'ftp', ' ');\n $replace = array('', '', '', '');\n $file = str_replace($search, $replace, $file);\n\n if (is_readable($config['paths']['config'] . $file . '.php')) {\n // to prevent modern server from caching the new configuration we need to evaluate it this way\n clearstatcache();\n $f = implode('', file($config['paths']['config'] . $file . '.php'));\n $f = str_replace('<?php', '', $f);\n $f = str_replace('?>', '', $f);\n eval($f);\n $config['config_file'] = $file;\n $_SESSION['config_file'] = $config['config_file'];\n $ret = true;\n }\n\n return $ret;\n}", "function config_load() {\n\t\t$config_camera = '/^\\s*([^:]+)\\s*:\\s*([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})\\s+(\\d+)\\s*x\\s*(\\d+)\\s*$/iu';\n\t\t$config_gate = '/^\\s*(.+)\\s*\\((\\d+)\\s*,\\s*(\\d+)\\)\\s*\\((\\d+),(\\d+)\\)\\s*$/u';\n\n\t\t$data = file(CONFIG_PATH);\n\t\tif ($data === NULL) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$config = array();\n\n\t\t$status = 0;\n\t\tfor ($n=0; $n<sizeof($data); $n++) {\n\t\t\t$str = $data[$n];\n\t\t\n\t\t\tif (preg_match($config_camera, $str, $matches)) {\n\t\t\t\t$name = trim($matches[1]);\n\t\t\t\t$hw_id = $matches[2].$matches[3].$matches[4].$matches[5].$matches[6].$matches[7];\n\t\t\t\t$width = $matches[8];\n\t\t\t\t$height= $matches[9];\n\n\t\t\t\t$gates = array();\n\t\t\t\tarray_push($config, \n\t\t\t\t\t\t array(\"hw\" => $hw_id, \n\t\t\t\t\t\t \"name\" => $name, \n\t\t\t\t\t\t\t\t \"gates\" => &$gates,\n\t\t\t\t\t\t\t\t \"width\" => $width,\n\t\t\t\t\t\t\t\t \"height\"=> $height));\n\t\t\t\t$status = 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($status == 1 && preg_match($config_gate, $str, $matches)) {\n\t\t\t\tarray_push($gates, array(\"name\"=>trim($matches[1]),\n\t\t\t\t\t\t\t\t\t\t \"x1\" =>$matches[2],\n\t\t\t\t\t\t\t\t\t\t \"y1\" =>$matches[3],\n\t\t\t\t\t\t\t\t\t\t \"x2\" =>$matches[4],\n\t\t\t\t\t\t\t\t\t\t \"y2\" =>$matches[5]));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn $config;\n\t}", "function load_config($conf) {\n $this->conf = $conf; // Store configuration\n\n $this->pi_setPiVarDefaults(); // Set default piVars from TS\n $this->pi_initPIflexForm(); // Init FlexForm configuration for plugin\n\n // Read extension configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);\n\n if (is_array($extConf)) {\n $conf = t3lib_div::array_merge($extConf, $conf);\n\n }\n\n // Read TYPO3_CONF_VARS configuration\n $varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey];\n\n if (is_array($varsConf)) {\n\n $conf = t3lib_div::array_merge($varsConf, $conf);\n\n }\n\n // Read FlexForm configuration\n if ($this->cObj->data['pi_flexform']['data']) {\n\n foreach ($this->cObj->data['pi_flexform']['data'] as $sheetName => $sheet) {\n\n foreach ($sheet as $langName => $lang) {\n foreach(array_keys($lang) as $key) {\n\n $flexFormConf[$key] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], \n $key, $sheetName, $langName);\n\n if (!$flexFormConf[$key]) {\n unset($flexFormConf[$key]);\n\n }\n }\n }\n }\n }\n\n if (is_array($flexFormConf)) {\n\n $conf = t3lib_div::array_merge($conf, $flexFormConf);\n }\n\n $this->conf = $conf;\n\n }", "public function load()\n {\n $parser = new ezcConfigurationIniParser( ezcConfigurationIniParser::PARSE, $this->path );\n $settings = array();\n $comments = array();\n\n foreach ( new NoRewindIterator( $parser ) as $element )\n {\n if ( $element instanceof ezcConfigurationIniItem )\n {\n switch ( $element->type )\n {\n case ezcConfigurationIniItem::GROUP_HEADER:\n $settings[$element->group] = array();\n if ( !is_null( $element->comments ) )\n {\n $comments[$element->group]['#'] = $element->comments;\n }\n break;\n\n case ezcConfigurationIniItem::SETTING:\n eval( '$settings[$element->group][$element->setting]'. $element->dimensions. ' = $element->value;' );\n if ( !is_null( $element->comments ) )\n {\n eval( '$comments[$element->group][$element->setting]'. $element->dimensions. ' = $element->comments;' );\n }\n break;\n }\n }\n if ( $element instanceof ezcConfigurationValidationItem )\n {\n throw new ezcConfigurationParseErrorException( $element->file, $element->line, $element->description );\n }\n }\n\n $this->config = new ezcConfiguration( $settings, $comments );\n return $this->config;\n }", "public function loadConfig()\n {\n $fileName = \"setup.json\";\n\n if (! file_exists(WPADW_DIR . $fileName)) {\n $this->configParams = [];\n return $this;\n }\n\n $data = file_get_contents(WPADW_DIR . $fileName);\n\n $paramsArray = json_decode($data, true);\n\n $this->configParams = $paramsArray;\n\n return $this;\n }", "private function load()\n {\n if ($this->sites) {\n return;\n }\n $data = Yaml::parse(file_get_contents($this->file));\n $this->sites = $data['sites'];\n }", "abstract public function load();", "abstract public function load();", "function Load()\n\t{\n\t\tif (!is_readable($this->ConfigFile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->LoadSettings();\n\n\t\treturn true;\n\t}", "function loadConf($id, $file=CONFERENCES)\n{\n\t$confs = getJSON($file);\n\t$index = searchIndex($confs, $id);\n\t$result = NULL;\n\t\n\tif($index >= 0){\n\t\t$result = $confs[$index];\n\t}\n\treturn $result;\n}", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "function load($filename){\n\n\t\t//Check if the input is valid\n\t\tif(!\\lib_validation\\validate($filename, LV_STRING))\n\t\t\treturn null;\n\t\t\n\t\t//Escape characters just to be safe \n\t\t$filename = addslashes($filename);\n\t\t\n\t\t//Convert namespace to a file path\n\t\t$filename = \"configs/\" . $filename . \".json\";\n\t\t\n\t\t//Checks if the file exists\n\t\tif(!file_exists($filename))\n\t\t\treturn null;\n\t\t\n\t\t//Load the file\n\t\t$json = file_get_contents($filename);\n\t\t\n\t\t//Parse the file\n\t\t$data = json_decode($json, true);\n\t\t\n\t\t//Return the results (associative array)\n\t\treturn $data;\n\t}", "private function loadConfiguration()\n {\n /** @var ConfigurationManager $configurationManager */\n $configurationManager = ConfigurationManager::getInstance();\n $this->configuration = $configurationManager->getMainConfiguration();\n }", "function load_config()\n\t{\n\t\t$sql = \"SELECT * FROM config\";\n\n\t\t$dbdata = $this->conn->prepare($sql);\n\t\t$dbdata->execute();\n\n\t\tforeach ($dbdata->fetchAll(PDO::FETCH_OBJ) as $conf) {\n\t\t\tif ($conf->value == 'true') {\n\t\t\t\t$conf->value = true;\n\t\t\t} elseif ($conf->value == 'false') {\n\t\t\t\t$conf->value = false;\n\t\t\t}\n\n\t\t\t$this->config->set($conf->param, $conf->value);\n\t\t}\n\t}", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "public function loadConfiguration(): void\n {\n $config = $this->getConfig() + $this->defaults;\n $this->setConfig($config);\n\n $cb = $this->getContainerBuilder();\n\n $routingFilePath = $config['routingFile'];\n $neonRoutesLoader = $cb->addDefinition($this->prefix('neonRoutesLoader'));\n $neonRoutesLoader->setClass(NeonRoutesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters), $config['autoInternalIds']]);\n\n $neonLocalesLoader = $cb->addDefinition($this->prefix('neonLocalesLoader'));\n $neonLocalesLoader->setClass(NeonLocalesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters)]);\n\n $router = $cb->addDefinition($this->prefix('router'));\n $router->setClass(Router::class)\n ->addSetup('setAsSecured', [$config['isSecured']])\n ->addSetup('setFilesExtension', [$config['extension']]);\n }", "public function readConfigurationValues();", "public abstract function load();", "protected function _setConfig()\n {\n if ($this->_system) {\n $config = $this->_system . DIRECTORY_SEPARATOR . 'config.php';\n } else {\n $config = false;\n }\n\n // manually look for a --config argument that overrides the default\n $found = false;\n foreach ($this->_argv as $val) {\n if ($val == '--config') {\n // found the argument\n $found = true;\n // reset the default in preparation for the next argument\n $config = false;\n continue;\n }\n \n if ($found && substr($val, 0, 1) != '-') {\n $config = $val;\n break;\n }\n \n if (substr($val, 0, 9) == '--config=') {\n $found = true;\n $config = substr($val, 9);\n break;\n }\n }\n \n // if there was a --config but no param, that's a failure\n if ($found && ! $config) {\n echo \"Please specify a config file path after the --config option.\" . PHP_EOL;\n exit(1);\n }\n \n // was there a config file at all?\n if ($config) {\n $realpath = realpath($config);\n if ($realpath) {\n $this->_config = $realpath;\n $text = \"Using config file '$realpath'.\" . PHP_EOL;\n } else {\n echo \"Could not resolve real path to config file '$config'.\" . PHP_EOL;\n exit(1);\n }\n } else {\n $text = \"Not using a config file.\" . PHP_EOL;\n }\n \n if ($this->_verbose) {\n echo $text;\n }\n }", "protected function initConfiguration()\n {\n if (!file_exists(self::$config_file)) {\n // get the configuration directly from CMS\n $this->getConfigurationFromCMS();\n }\n elseif ((false === (self::$config_array = json_decode(@file_get_contents(self::$config_file), true))) || !is_array(self::$config_array)) {\n throw new ConfigurationException(\"Can't read the Doctrine configuration file!\");\n }\n }", "private function loadConfig()\n {\n $base = APP_ROOT.'config/';\n $filename = $base.'app.yml';\n if (!file_exists($filename)) {\n throw new ConfigNotFoundException('The application config file '.$filename.' could not be found');\n }\n\n $config = Yaml::parseFile($filename);\n\n // Populate the environments array\n $hostname = gethostname();\n $environments = Yaml::parseFile($base.'env.yml');\n foreach ($environments as $env => $hosts) {\n foreach ($hosts as $host) {\n if (fnmatch($host, $hostname)) {\n $this->environments[] = $env;\n\n // Merge the app config for the environment\n $filename = $base.$env.'/app.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config = array_merge($config, $envConfig);\n }\n }\n }\n }\n\n // Loop through each of the config files and add them\n // to the main config array\n foreach (glob(APP_ROOT.'config/*.yml') as $file) {\n $key = str_replace('.yml', '', basename($file));\n $config[$key] = Yaml::parseFile($file);\n\n // Loop through each of the environments and merge their config\n foreach ($this->environments as $env) {\n $filename = $base.$env.'/'.$key.'.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config[$key] = array_merge($config[$key], $envConfig);\n }\n }\n }\n\n // Create and store the config object\n return $this->config = new Config($config);\n }", "function LoadConfiguration()\r\n\t{\r\n\t\t$cinfFilePath = Site::GetConfigFilePath ();\r\n\t\t$config = simplexml_load_file ( $cinfFilePath );\r\n\t\t\r\n\t\t// load languages\r\n\t\tif (isset ( $config->languages ))\r\n\t\t{\r\n\t\t\t$langs = ( array ) $config->languages;\r\n\t\t\t$langsA = $langs ['language'];\r\n\t\t\t\r\n\t\t\tif (! is_array ( $langsA ))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$linkID = ( string ) $langsA->linkID;\r\n\t\t\t\t$linkName = ( string ) $langsA->linkName;\r\n\t\t\t\t$this->m_languages [$linkID] = $linkName;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach ( $langsA as $lang )\r\n\t\t\t\t{\r\n\t\t\t\t\t$linkID = ( string ) $lang->linkID;\r\n\t\t\t\t\t$linkName = ( string ) $lang->linkName;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->m_languages [$linkID] = $linkName;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$langKes = array_keys ( $this->m_languages );\r\n\t\t\t$this->m_languageDefault = $langKes [0];\r\n\t\t}\r\n\t\t\r\n\t\t// load templates\r\n\t\tif (isset ( $config->templates ))\r\n\t\t{\r\n\t\t\t$templates = ( array ) $config->templates;\r\n\t\t\t$langsA = $templates ['template'];\r\n\t\t\t\r\n\t\t\tif (! is_array ( $langsA ))\r\n\t\t\t{\r\n\t\t\t\t$this->m_templates = null;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->m_templates = array ();\r\n\t\t\t\t\r\n\t\t\t\tforeach ( $langsA as $lang )\r\n\t\t\t\t{\r\n\t\t\t\t\t$fileName = ( string ) $lang;\r\n\t\t\t\t\tarray_push ( $this->m_templates, $fileName );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// load siteURL\r\n\t\tif (isset ( $config->url ))\r\n\t\t{\r\n\t\t\t$this->m_URL = ( string ) $config->url;\r\n\t\t\t$this->m_URL = trim ( $this->m_URL );\r\n\t\t}\r\n\t\t\r\n\t\t// load siteURL\r\n\t\tif (isset ( $config->maxImageWidth ))\r\n\t\t{\r\n\t\t\t$this->m_maxImageWidth = ( int ) $config->maxImageWidth;\r\n\t\t}\r\n\t\t\r\n\t\t// secuirity-file root\r\n\t\tif (isset ( $config->securFolder ))\r\n\t\t{\r\n\t\t\t$this->m_sfRoot = ( string ) $config->securFolder;\r\n\t\t\t$this->m_sfRoot = trim ( $this->m_sfRoot );\r\n\t\t}\r\n\t\t\r\n\t\t// boxes\r\n\t\tif (isset ( $config->boxes ))\r\n\t\t{\r\n\t\t\t$boxes = ( array ) $config->boxes;\r\n\t\t\t$boxes = $boxes ['box'];\r\n\t\t\tif (! is_array ( $boxes ))\r\n\t\t\t{\r\n\t\t\t\t$this->m_boxes = array ($boxes );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->m_boxes = $boxes;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// product image root\r\n\t\tif (isset ( $config->productImageRoot ))\r\n\t\t{\r\n\t\t\t$str = ( string ) $config->productImageRoot;\r\n\t\t\t$this->m_prodImagRoot = trim ( $str );\r\n\t\t}\r\n\t\t\r\n\t\t// product image root\r\n\t\tif (isset ( $config->galleryRoot ))\r\n\t\t{\r\n\t\t\t$str = ( string ) $config->galleryRoot;\r\n\t\t\t$this->m_galleryImageRoot = trim ( $str );\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "function loadConfig($config = array())\n {\n // Loading default preferences\n $this->config =& $config;\n }", "private function loadConfig() {\n if (file_exists($this->_data['cache_config_file'])) {\n $data = unserialize(file_get_contents($this->_data['cache_config_file']));\n \n self::$_configInstance = (object)$data; //instance of stdClass with all the properties public\n //$this->_data = (array)$data; \n return true;\n } \n return false;\n }", "protected static function loadSingleExtLocalconfFiles() {}", "function loadConfigFile ($fileName) {\n\t\tif (file_exists ($fileName)) {\n\t\t\tif (is_readable ($fileName)) {\n\t\t\t\t$configItems = array ();\n\t\t\t\tinclude ($fileName);\n\t\t\t\t$this->loadConfigArray ($configItems);\n\t\t\t} else {\n\t\t\t\treturn new Error ('CONFIG_FILE_NOT_READABLE', $fileName);\n\t\t\t}\n\t\t} else {\n\t\t\treturn new Error ('CONFIG_FILE_NOT_FOUND', $fileName);\n\t\t}\n\t}", "protected function _load_config($type) {\r\n\t\t$this->regx_parse = new FileSystem_File(\r\n\t\t\tROOT_BACK.MODELS_DIRECTORY.DS.'Filesystem'.DS.'File'.DS.'settings',\r\n\t\t\t$type.'.xml'\r\n\t\t);\r\n\t\t$this->regx_parse->open('read','settings');\r\n }", "abstract protected function defineConfiguration();", "function loadFile($src){\n if(file_exists($src) && is_readable($src))\n {\n include $src;\n if(isset($CONFIG)) $this->add($CONFIG);\n }\n }", "protected function loadSettings() {}", "protected function loadSettings() {}", "protected function loadSettings() {}", "protected static function loadConfiguration()\n {\n if (null === self::$configuration) {\n self::$configuration = Register::getRegister();\n }\n }", "public function load_config($file = '')\n {\n return $this->{$this->_driver}->load_config($file);\n }" ]
[ "0.7931351", "0.7747518", "0.7396795", "0.70891684", "0.7068767", "0.70388204", "0.7030249", "0.6977918", "0.6922984", "0.68666667", "0.68529874", "0.68346614", "0.6811175", "0.680894", "0.6737179", "0.6722655", "0.6704872", "0.6653745", "0.6618646", "0.656093", "0.6560384", "0.65316206", "0.64821017", "0.6459052", "0.6456952", "0.6448664", "0.6438059", "0.6433049", "0.64218456", "0.6414435", "0.63980293", "0.639495", "0.6384006", "0.6338369", "0.63232833", "0.63047355", "0.6299533", "0.6272448", "0.62693965", "0.62645864", "0.62591606", "0.6245199", "0.623418", "0.6219668", "0.6211588", "0.617908", "0.61665165", "0.6164682", "0.6158758", "0.6153446", "0.61473596", "0.6143879", "0.6138344", "0.6137854", "0.6131365", "0.6121929", "0.61152536", "0.61045974", "0.6097536", "0.6092348", "0.6089435", "0.6085699", "0.6085699", "0.6085699", "0.6085699", "0.6064506", "0.606165", "0.6058346", "0.6051335", "0.6051194", "0.60482657", "0.6020707", "0.6005104", "0.6005104", "0.6000084", "0.5998553", "0.5996974", "0.59929425", "0.5981387", "0.59724766", "0.5971757", "0.59706604", "0.59606516", "0.5956205", "0.5951643", "0.5945661", "0.5943498", "0.59418017", "0.5936222", "0.59265", "0.59234405", "0.59226036", "0.59190667", "0.59106416", "0.590675", "0.590176", "0.590176", "0.59010184", "0.5888087", "0.5887486" ]
0.60972387
59
It returns configuration even from nested array
public function get (string ...$keys) { if (func_num_args() == 0) { return $this->config; } else { $key = array_pop($keys); $part = $this->get(...$keys); return (isset($part[$key])) ? $part[$key] : null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConfigArray() {}", "function get_config_array();", "abstract protected function configs(): array;", "public function getConfiguration(): array;", "public function getConfiguration(): array;", "public function convertValuedToNestedConfigurationDataProvider() {}", "public function getConfiguration()\n {\n return self::$config_array;\n }", "public function convertNestedToValuedConfigurationDataProvider() {}", "private function getConfig()\n {\n return [\n self::API_COUNTRY => [\n 'url' => 'https://restcountries.eu/rest/v2/',\n 'routes' => [\n 'name' => [\n 'route' => 'name',\n 'params' => [\n 'fullText' => 'bool'\n ],\n ],\n 'dialingCode' => [\n 'route' => 'callingcode',\n ],\n 'countryCode' => [\n 'route' => 'alpha',\n 'params' => [\n 'codes' => 'array'\n ],\n ],\n 'currency' => [\n 'route' => 'currency',\n ],\n 'languages' => [\n 'route' => 'lang',\n ],\n 'capital' => [\n 'route' => 'capital',\n ],\n 'region' => [\n 'route' => 'region',\n ],\n 'regionalbloc' => [\n 'route' => 'regionalbloc',\n ],\n ]\n ]\n ];\n }", "public function getConfiguration(): array\n {\n }", "public function getConfig(): array;", "protected abstract static function getConfig(): array;", "public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }", "protected function getSourceConfig()\n {\n return [\n 'config' => [\n 'form' => [\n 'umc_module' => [\n 'id' => 'umc_module',\n 'fieldset' => [\n 'settings' => [\n 'id' => 'settings',\n 'sort' => 10,\n 'collapsible' => true,\n 'translate' => 'label',\n 'label' => 'Module settings',\n 'field' => [\n 'qualified' => [\n 'id' => 'qualified',\n 'type' => 'select',\n 'required' => true,\n 'sort' => 10,\n 'system' => true,\n 'label' => 'Fully qualified class names',\n 'tooltip' => 'tooltip goes here',\n ],\n 'underscore' => [\n 'id' => 'underscore',\n 'type' => 'select',\n 'required' => true,\n 'sort' => 20,\n 'system' => true,\n 'label' => 'Use underscore',\n 'tooltip' => 'tooltip goes here',\n 'depends' => [\n 'type' => [\n 'depend' => [\n 'type' => [\n 'id' => 'type',\n 'type' => 'self',\n 'val' => [\n 1 => [\n 'id' => 1,\n 'value' => 1,\n ]\n ]\n ]\n ]\n ]\n ]\n ],\n 'disabled' => [\n 'id' => 'disabled',\n 'type' => 'text',\n 'required' => true,\n 'sort' => 30,\n 'system' => true,\n 'label' => 'Disabled field',\n 'disabled' => true\n ]\n ]\n ],\n 'disabled' => [\n 'id' => 'disabled',\n 'sort' => 20,\n 'collapsible' => true,\n 'translate' => 'label',\n 'label' => 'Disabled fieldset',\n 'disabled' => 'true',\n 'field' => [\n 'some_field' => [\n 'id' => 'some_field',\n 'type' => 'select',\n 'required' => true,\n 'sort' => 10,\n 'system' => true,\n 'label' => 'Some field',\n 'tooltip' => 'tooltip goes here',\n ],\n ]\n ]\n ]\n ]\n ]\n ]\n ];\n }", "public function getConfigurationValues() {}", "public function getConfigurationValues() {}", "public function getConfigurationValues() {}", "public function getConfigurationValues() {}", "public static function getConfig(){\n\t\tif(CoreConfig::$config == null){\n\t\t\t$query = \"SELECT module, name, value FROM config ORDER by module, name\";\n\t\t\t$table = DB::getTable($query);\n\t\t\tforeach($table as $row) {\n\t\t\t\tCoreConfig::$config[$row['module']][$row['name']] = $row['value'];\n\t\t\t}\n\t\t}\n\t\treturn CoreConfig::$config;\n\t}", "public function getConfig() {\r\n\r\n\t}", "private function prepareConfiguration()\n {\n $configuration = array();\n\n foreach ($this->configProvider->getIds() as $entityConfigId) {\n $className = $entityConfigId->getClassName();\n $fields = $this->configProvider->filter(\n function (ConfigInterface $fieldConfig) {\n return $fieldConfig->is('available_in_template');\n },\n $className\n );\n\n if (count($fields)) {\n $configuration[$className] = array();\n foreach ($fields as $fieldConfig) {\n $configuration[$className][] = 'get' . strtolower($fieldConfig->getId()->getFieldName());\n }\n }\n }\n\n return $configuration;\n }", "function configuration()\r\n {\r\n global $db;\r\n $default_conf = $this->default_configuration();\r\n $conf = $db->getAssoc('\r\n select configuration_key, configuration_value from !\r\n where module_key = ?\r\n ', false, array(TABLE_CONFIGURATION, $this->module_key()));\r\n return array_merge($default_conf, $conf);\r\n }", "public function infosConfig(){\n $get_configuration_infos = \\App\\Helpers\\ConfigurationHelper\\Configuration::get_configuration_infos(1);\n return $get_configuration_infos;\n }", "private function getConfigFieldsValues()\n {\n $config = [];\n foreach (ConfigFieldsNames::getConfigFields() as $key) {\n $config[$key] = Configuration::get($key);\n }\n for ($i = 1; $i < TPAY_CARD_MIDS; $i++) {\n foreach (ConfigFieldsNames::getCardConfigFields() as $key) {\n $config[$key.$i] = Configuration::get($key.$i);\n }\n }\n\n return $config;\n }", "private static function _getConfigArray()\n\t{\n\t\treturn explode('.', self::_getConfig());\n\t}", "private function lazy_get_config(): array\n\t{\n\t\treturn array_merge_recursive($this->configs['app'], $this->construct_options);\n\t}", "public static function getConfig($class = 'default'){\n\t\tif(!$class){\n\t\t\t$class = 'default';\n\t\t}\n\t\t$default_config = sfConfig::get('app_history_default', array());\n\t\t$config = sfConfig::get('app_history_'.$class, array());\n\t\t//$final = array_merge_recursive($default_config, $config); //Not exactly what we want\n\t\t//$final = array_replace($default_config, $config);//Nope, but almost\n\t\t$final = array_merge_array($default_config, $config);//This one is worse but looks like array_merge_recursive()\n\t\t//var_dump($final);\n\t\treturn $final;\n\t}", "public function getAllConfigs()\r\n\t{\r\n\t\treturn $this->arrConfig;\r\n\t}", "function getConfigurationValues() ;", "function arrayConfig($namespace = 'thirdParty')\n {\n return config($namespace);\n }", "private function getConfig()\n\t{\n\t\t$apiKey = $this->getApiKey();\n\t\t$configArray = array('api_key'=> $apiKey,'outputtype'=>Wp_WhitePages_Model_Api::API_OUTPUT_TYPE);\n\t\t\n\t\treturn $configArray;\n\t}", "public function configAll() {\n \n return $this->config;\n \n }", "public function getConfig()\n {\n return [\n 'payment' => [\n self::CODE => [\n // get setting values using events.xml section/group/field ids for path\n 'apiKey' => $this->helper->getConfig('payment/payio/integration/api_key'),\n 'apiTransactionPath' => $this->helper->getApiTransactionPath(),\n 'apiSettingsPath' => $this->helper->getApiSettingPath(),\n 'gatewayPath' => $this->helper->getGatewayPath(),\n 'checkoutUrl' => $this->helper->getCheckoutUrl(),\n 'paymentSuccessUrl' => $this->helper->getPaymentSuccessUrl(),\n 'currency' => $this->helper->getCurrentCurrencyCode(),\n 'cartTax' => $this->helper->getUKTaxRate(),\n 'shippingMethods' => $this->helper->getActiveShippingMethods()\n ]\n ]\n ];\n }", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "private function _Config() {\n $data['ttcConfig'] = $this->cNavMenuBuilder->Config();\n return $data;\n }", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public function getConfig();", "public static function config_get_configuration_array($data) {\n $config = array();\n\n if (isset($data->path)) {\n $config['path'] = $data->path;\n }\n if (isset($data->autocreate)) {\n $config['autocreate'] = $data->autocreate;\n }\n if (isset($data->singledirectory)) {\n $config['singledirectory'] = $data->singledirectory;\n }\n if (isset($data->prescan)) {\n $config['prescan'] = $data->prescan;\n }\n\n return $config;\n }", "public function testChildArrayToConfigObject()\n {\n $this->specify(\n \"Child node don't converted to the config object\",\n function () {\n $config = new Config(['childNode' => ['A', 'B', 'C']]);\n expect($config->childNode)->isInstanceOf('Phalcon\\Config');\n expect($config->get('childNode'))->isInstanceOf('Phalcon\\Config');\n expect($config->offsetGet('childNode'))->isInstanceOf('Phalcon\\Config');\n }\n );\n }", "public function toArray()\n {\n \n return $this->getConfig();\n }", "public function processConfigArray($config)\n {\n return $config;\n }", "public function getConfig()\n {\n if (!$this->config->getIsActive()) {\n return [];\n }\n\n return [\n 'payment' => [\n 'collector_checkout' => [\n 'image_remove_item' => $this->getViewFileUrl('Webbhuset_CollectorCheckout::images/times-solid.svg'),\n 'image_plus_qty' => $this->getViewFileUrl('Webbhuset_CollectorCheckout::images/plus-solid.svg'),\n 'image_minus_qty' => $this->getViewFileUrl('Webbhuset_CollectorCheckout::images/minus-solid.svg'),\n 'newsletter_url' => $this->getNewsletterUrl(),\n 'reinit_url' => $this->getReinitUrl(),\n 'update_url' => $this->getUpdateUrl(),\n 'delivery_checkout' => $this->config->getIsDeliveryCheckoutActive(),\n ],\n ],\n ];\n }", "public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }", "public function readConfigurationValues();", "protected function _getAdditionalConfig()\n {\n $configuration = array();\n\n foreach ($this->getAllowProducts() as $simpleProduct) {\n $configuration['simple_skus'][$simpleProduct->getId()] = $simpleProduct->getSku();\n }\n\n return $configuration;\n }", "public function getConfig() {}", "public function getConfig()\n {\n return [\n 'payment' => [\n self::CODE => [\n 'transactionResults' => [\n ClientMock::SUCCESS => __('Success'),\n ClientMock::FAILURE => __('Fraud')\n ]\n ]\n ]\n ];\n }", "public function getConfig()\n {\n $config = [\n 'payment' => [\n 'ccform' => [\n 'availableTypes' => [\n self::CODE => $this->getCardTypes()\n ],\n 'months' => [\n self::CODE => $this->getMonths()\n ],\n 'years' => [\n self::CODE => $this->getYears()\n ],\n 'hasVerification' => [\n self::CODE => $this->config->getValue('enable_cvv') ? true : false\n ],\n 'cvvImageUrl' => [\n self::CODE => $this->getCvvImageUrl()\n ],\n 'testMode' => [\n self::CODE => $this->config->getValue('test')\n ],\n 'jsToken' => [\n self::CODE => $this->config->getValue('js_token')\n ]\n ]\n ]\n ];\n return $config;\n }", "abstract protected function getConfig();", "public function getConfiguration();", "public function getConfiguration();", "public function getConfiguration();", "protected function getConfigFieldsValues()\n {\n return array(\n $this->mod_prefix.'SHOW_WEBPAGE' => Configuration::get($this->mod_prefix.'SHOW_WEBPAGE'),\n $this->mod_prefix.'SHOW_WEBSITE' => Configuration::get($this->mod_prefix.'SHOW_WEBSITE'),\n $this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX' => Configuration::get($this->mod_prefix.'SHOW_WEBSITE_SEARCHBOX'),\n $this->mod_prefix.'SHOW_ORGANIZATION' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION'),\n $this->mod_prefix.'SHOW_ORGANIZATION_LOGO' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_LOGO'),\n $this->mod_prefix.'SHOW_ORGANIZATION_CONTACT' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_CONTACT'),\n $this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL' => Configuration::get($this->mod_prefix.'ORGANIZATION_CONTACT_EMAIL'),\n $this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE' => Configuration::get($this->mod_prefix.'ORGANIZATION_CONTACT_TELEPHONE'),\n $this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK' => Configuration::get($this->mod_prefix.'SHOW_ORGANIZATION_FACEBOOK'),\n $this->mod_prefix.'ORGANIZATION_FACEBOOK' => Configuration::get($this->mod_prefix.'ORGANIZATION_FACEBOOK'),\n $this->mod_prefix.'SHOW_LOCALBUSINESS' => Configuration::get($this->mod_prefix.'SHOW_LOCALBUSINESS'),\n $this->mod_prefix.'LOCALBUSINESS_TYPE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_TYPE'),\n $this->mod_prefix.'LOCALBUSINESS_STORENAME' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_STORENAME'),\n $this->mod_prefix.'LOCALBUSINESS_DESC' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_DESC'),\n $this->mod_prefix.'LOCALBUSINESS_VAT' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_VAT'),\n $this->mod_prefix.'LOCALBUSINESS_PHONE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PHONE'),\n $this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PRANGE_SHOW'),\n //$this->mod_prefix.'LOCALBUSINESS_PRANGE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_PRANGE'),\n $this->mod_prefix.'LOCALBUSINESS_STREET' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_STREET'),\n $this->mod_prefix.'LOCALBUSINESS_COUNTRY' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_COUNTRY'),\n $this->mod_prefix.'LOCALBUSINESS_REGION' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_REGION'),\n $this->mod_prefix.'LOCALBUSINESS_CODE' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_CODE'),\n $this->mod_prefix.'LOCALBUSINESS_LOCALITY' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_LOCALITY'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_SHOW' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_SHOW'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_LAT' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_LAT'),\n $this->mod_prefix.'LOCALBUSINESS_GPS_LON' => Configuration::get($this->mod_prefix.'LOCALBUSINESS_GPS_LON')\n );\n }", "public function getAll()\n {\n return $this->config;\n }", "public function getConfiguration() {}", "public function getConfiguration() {}", "function get_config(){\n\t\t\t$arr = array();\n\t\t\n\t\t// Try to get the configuration data \n\t\t// from a cached config file\n\t\t// \n\t\t// Added a disable option in 1.2.1 - dpd\n\t\t\t$disable_cache = ($this->config->item('br_disable_system_cache') === TRUE) ? 1 : 0;\n\t\t\tif($disable_cache == 0){\n\t\t\t\tif($str=read_from_cache('config')){\n\t\t\t\t\t$arr = unserialize($str);\n\t\t\t\t\treturn $arr;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t// Get the store config \n\t\t\t$this->EE->db->select('\ts.*, \n\t\t\t\t\t\t\t\tc.code as currency,\n\t\t\t\t\t\t\t\tc.currency_id,\n\t\t\t\t\t\t\t\tc.marker as currency_marker')\n\t\t\t\t\t\n\t\t\t\t\t->from('br_store s')\n\t\t\t\t\t->join('br_currencies c','c.currency_id = s.currency_id');\t\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$arr[\"store\"][$row[\"site_id\"]] = $row;\n\t\t\t}\n\n\t\t// Get the config data for each item\n\n\t\t\t$this->EE->db->select('*')->from('br_config_data')->order_by('sort');\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$data[$row['config_id']][] = $row;\n\t\t\t}\n\t\t\t\n\t\t// Get the items\n\n\t\t\t$this->EE->db->select('*')->from('br_config')->order_by('sort');\n\t\t\t$query = $this->EE->db->get();\n\t\t\tforeach ($query->result_array() as $row){\n\t\t\t\t$arr[$row[\"type\"]][$row[\"site_id\"]][$row[\"code\"]] = $row;\n\t\t\t\tif(isset($data[$row[\"config_id\"]])){\n\t\t\t\t\t$arr[$row[\"type\"]][$row[\"site_id\"]][$row[\"code\"]][\"config_data\"] = $data[$row[\"config_id\"]];\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Save the new array to cache\n\t\t\tsave_to_cache('config',serialize($arr));\n\t\t\treturn $arr;\n\t}", "function getConfiguration() ;", "function tidy_get_config(tidy $object) {}", "abstract public function getConfig();", "function zarinpalwg_config() {\n $configarray = array(\n \"FriendlyName\" => array(\"Type\" => \"System\", \"Value\"=>\"زرین پال - وب گیت\"),\n \"merchantID\" => array(\"FriendlyName\" => \"merchantID\", \"Type\" => \"text\", \"Size\" => \"50\", ),\n \"Currencies\" => array(\"FriendlyName\" => \"Currencies\", \"Type\" => \"dropdown\", \"Options\" => \"Rial,Toman\", ),\n\t \"MirrorName\" => array(\"FriendlyName\" => \"نود اتصال\", \"Type\" => \"dropdown\", \"Options\" => \"آلمان,ایران,خودکار\", \"Description\" => \"چناانچه سرور شما در ایران باشد ایران دا انتخاب کنید و در غیر اینصورت آلمان و یا خودکار را انتخاب کنید\", ),\n \"afp\" => array(\"FriendlyName\" => \"افزودن کارمزد به قیمت ها\", \"Type\" => \"yesno\", \"Description\" => \"در صورت انتخاب 2.5 درصد به هزینه پرداخت شده افزوده می شود.\", ),\n );\n\treturn $configarray;\n}", "public function getConfiguration(): array\n {\n return $this->configuration;\n }", "public static function processConfig($configArray)\n {\n\n $baseCategories = [\n 'general_settings' => [\n 'display_name' => 'General Settings',\n 'display' => 'block',\n 'settings' => [\n 'CountUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Count Upgrades',\n 'tool_tip' => 'Count upgrades as building slots',\n 'description' => 'Count upgrades as building slots',\n ],\n 'NoSubsidies' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Town Subsidies',\n 'tool_tip' => 'Town subsidies at low population',\n 'description' => 'Town subsidies at low population',\n ],\n 'ElectionsOn' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Elections',\n 'tool_tip' => 'Elections enabled or not',\n 'description' => 'Election of Mayor and Presidents enabled',\n ],\n 'SendingMoney' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Money Transfers',\n 'tool_tip' => 'Allow money transfers between players',\n 'description' => 'Allow money transfers between players',\n ],\n 'AlliesPageOn' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Allies',\n 'tool_tip' => 'Allow player alliances',\n 'description' => 'Allow player alliances',\n ],\n 'TranscendingOn' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Transcendence',\n 'tool_tip' => 'Allow nobility gain through transcendence',\n 'description' => 'Allow nobility gain through transcendence',\n ],\n 'RandomSeasons' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Random Seasons',\n 'tool_tip' => 'Random game seasons in suppose to spring, summer, autumn, winter cycle',\n 'description' => 'Random game seasons in suppose to spring, summer, autumn, winter cycle',\n ],\n 'RelayEconomy' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Recession Code',\n 'tool_tip' => 'Whether recession code is active in simulation',\n 'description' => 'Whether recession code is active in simulation',\n ],\n 'MagnaAtApprentice' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Apprentice Magna',\n 'tool_tip' => 'If apprentices with enough nobility can create magna companies',\n 'description' => 'If apprentices with enough nobility can create magna companies',\n ],\n 'MaxInvestors' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Max World Players',\n 'tool_tip' => 'Maximum player allowed to join this world',\n 'description' => 'Maximum player allowed to join this world',\n ],\n 'NoTradeCenter' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'No Trade Centre',\n 'tool_tip' => 'Prevent trade centre sales',\n 'description' => 'Prevent trade centre sales',\n ],\n ],\n ],\n 'tycoon_upgrade_levels' => [\n 'display_name' => 'Tycoon Building Slots',\n 'display' => 'block',\n 'settings' => [\n 'Apprentice.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Apprentice',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Entrepreneur.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Entrepreneur',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Tycoon.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Tycoon',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Master.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Master',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Paradigm.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Paradigm',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n 'Legend.facLimit' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Legend',\n 'tool_tip' => 'Maximum building slots for this level',\n 'description' => 'Maximum building slots for this level',\n ],\n ],\n ],\n 'building_upgrade_levels' => [\n 'display_name' => 'Building Max Upgrades',\n 'display' => 'block',\n 'settings' => [\n 'CountUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Count Upgrades',\n 'tool_tip' => 'Count building upgrades as a building slot',\n 'description' => 'Count building upgrades as a building slot',\n ],\n 'MaxServiceUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Service Maximum',\n 'tool_tip' => 'Maximum upgrade level for services',\n 'description' => 'Maximum upgrade level for services',\n ],\n 'MaxOfficeUpgrades' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Office Maximum',\n 'tool_tip' => 'Maximum upgrade level for offices',\n 'description' => 'Maximum upgrade level for offices',\n ],\n 'ResMaxUpgrade' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Residential Maximum',\n 'tool_tip' => 'Maximum upgrade level for residencies',\n 'description' => 'Maximum upgrade level for residencies',\n ],\n 'MaxRCenterUpgrade' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Research Centre Maximum',\n 'tool_tip' => 'Maximum upgrade level for research centres',\n 'description' => 'Maximum upgrade level for research centres',\n ],\n ],\n ],\n 'misc_settings' => [\n 'display_name' => 'Misc Settings',\n 'display' => 'block',\n 'settings' => [\n 'Tutorial' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Tutorial Mode',\n 'tool_tip' => 'If enabled players are guided by a tutorial',\n 'description' => 'If enabled players are guided by a tutorial',\n ],\n 'RemoveVisitors' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Remove Visitors',\n 'tool_tip' => 'Prevent visitor access to the world',\n 'description' => 'Prevent visitor access to the world',\n ],\n 'RepairRoads' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Repair Roads',\n 'tool_tip' => 'Automatically repair roads',\n 'description' => 'Automatically repair roads',\n ],\n 'VoteLevel' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Vote Level',\n 'tool_tip' => 'Votes required for office',\n 'description' => 'Votes required for office',\n ],\n 'FightFacColonies' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Fighting faction colonies',\n 'tool_tip' => 'Fighting faction colonies',\n 'description' => 'Fighting faction colonies',\n ],\n 'LifeAfterLegend' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Life after Legend',\n 'tool_tip' => 'Whether Tycoon can continue level after legend',\n 'description' => 'Whether Tycoon can continue level after legend',\n ],\n 'ServiceBuysBatched' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Services Buy Batched',\n 'tool_tip' => 'Services buy supplies in batches',\n 'description' => 'Services buy supplies in batches',\n ],\n 'RoadZone' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Road Zone',\n 'tool_tip' => 'The zone that roads belong to',\n 'description' => 'The zone that roads belong to',\n ],\n 'MinTaxesPer' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Minimum Taxes',\n 'tool_tip' => 'Minimum tax level',\n 'description' => 'Minimum tax level',\n ],\n 'MinCivicsWage' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Minimum Civic Wages',\n 'tool_tip' => 'This is the minimum wage level a Tycoon can set for civic wages',\n 'description' => 'This is the minimum wage level a Tycoon can set for civic wages',\n ],\n 'MaxSubPop' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Maximum Subsidy Population',\n 'tool_tip' => 'The level of population after which subsidies will no longer be paid',\n 'description' => 'The level of population after which subsidies will no longer be paid',\n ],\n 'MixedPlanet' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Mixed Planet',\n 'tool_tip' => 'An as yet unknown setting',\n 'description' => 'An as yet unknown setting',\n ],\n 'MixedDesire' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Mixed Desire',\n 'tool_tip' => 'An as yet unknown setting',\n 'description' => 'An as yet unknown setting',\n ],\n ],\n ],\n 'boosts' => [\n 'display_name' => 'Simulation Boosts',\n 'display' => 'block',\n 'settings' => [\n 'ResInhabBoost' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Residential Boost',\n 'tool_tip' => 'Residential Boost',\n 'description' => 'Residential Boost',\n ],\n 'ConstBoost' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Construction Boost',\n 'tool_tip' => 'Construction Boost',\n 'description' => 'Construction Boost',\n ],\n 'CommerceBoost' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Commerce Boost',\n 'tool_tip' => 'Commerce Boost',\n 'description' => 'Commerce Boost',\n ],\n ],\n ],\n 'building_separation' => [\n 'display_name' => 'Building Separation',\n 'display' => 'block',\n 'settings' => [\n 'MinCommerceSep' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Commerce',\n 'tool_tip' => 'How far apart commerce buildings of the same class must be',\n 'description' => 'How far apart commerce buildings of the same class must be',\n ],\n 'MinOfficeSep' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Office',\n 'tool_tip' => 'How far apart office buildings of the same class must be',\n 'description' => 'How far apart office buildings of the same class must be',\n ],\n ],\n ],\n 'thread_speeds' => [\n 'display_name' => 'Thread Speeds',\n 'display' => 'none',\n 'settings' => [\n 'SimSpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Model Server',\n 'tool_tip' => 'Simulation Speed',\n 'description' => 'Simulation Speed',\n ],\n 'DASpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Direct Access',\n 'tool_tip' => 'Speed of something',\n 'description' => 'Speed of something',\n ],\n 'CacheSpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Cache Server',\n 'tool_tip' => 'Cache server speed',\n 'description' => 'Cache server speed',\n ],\n 'IntSpeed' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Interface Server',\n 'tool_tip' => 'Interface Server speed',\n 'description' => 'Interface Server speed',\n ],\n 'Trans' => [\n 'setting' => '',\n 'default' => '',\n 'display' => 'block',\n 'input_type' => 'text',\n 'display_name' => 'Transcendence',\n 'tool_tip' => 'Speed of transcendence',\n 'description' => 'Speed of transcendence',\n ],\n ],\n ],\n ];\n\n foreach ($baseCategories as $categoryKey => &$category) {\n foreach ($category['settings'] as $settingName => &$setting) {\n $setting['setting'] = $configArray[$settingName] ?? $setting['default'];\n }\n }\n\n return self::makeTables($baseCategories);\n }", "function get_settings_config_data() {\n $config = $this->config;//get instance config\n\n //if config doesn't exist - create it\n if (!isset($config)) {\n $config = new stdClass();\n }\n\n //if data doesn't exist = make it an empty array\n if (!isset($config->data))\n $config->data = array();\n\n //return config\n return $config;\n }", "public function getAll(){\n\t\treturn $this->configValues;\n\t}", "public function getConfig(){\n return $this->config;\n }", "function expliquer_config($cfg){\n $table = 'meta';\n $casier = null;\n $sous_casier = array();\n $cfg = explode('/',$cfg);\n\n // si le premier argument est vide, c'est une syntaxe /table/ ou un appel vide ''\n if (!reset($cfg) AND count($cfg)>1) {\n array_shift($cfg);\n $table = array_shift($cfg);\n if (!isset($GLOBALS[$table]))\n lire_metas($table);\n }\n\n // si on a demande #CONFIG{/meta,'',0}\n if (count($cfg)) {\n // pas sur un appel vide ''\n if ('' !== ($c = array_shift($cfg))) {\n $casier = $c;\n }\n }\n\n if (count($cfg))\n $sous_casier = $cfg;\n\n return array($table,$casier,$sous_casier);\n}", "public function getConfig()\n {\n $storeId = $this->session->getStoreId();\n return [\n 'payment' => [\n self::CODE => [\n 'isActive' => $this->config->isActive($storeId),\n 'ccTypesMapper' => $this->config->getCcTypesMapper(),\n 'availableCardTypes' => $this->config->getAvailableCardTypes($storeId),\n 'useCvv' => $this->config->isCvvEnabled($storeId),\n 'environment' => $this->config->getEnvironment($storeId),\n 'environmentUrl' => $this->config->getEnvironmentUrl(),\n 'use_sandbox' => $this->config->useSandbox($storeId),\n 'profile_id' => $this->config->getProfileId($storeId),\n 'profile_key' => $this->config->getProfileKey($storeId),\n 'ccVaultCode' => self::CC_VAULT_CODE,\n ]\n ],\n ];\n }", "public function getModuleConfiguration();", "private function getConfigFor($name)\n {\n list($module, $settingName) = explode('::', $name);\n\n $result = [];\n foreach (config(\"society.$module.settings\") as $sub) {\n $result = array_merge($result, $sub);\n }\n\n return Arr::get($result, \"$settingName\");\n }", "function getConfig($item) {\n if (array_key_exists($item, CONFIG)) return CONFIG[$item];\n if (array_key_exists($item, DEFAULTS)) return DEFAULTS[$item];\n}", "protected function defaultRawConfiguration()\n {\n return [\n 'negotiation' => [\n 'enabled' => false,\n ],\n 'serializer' => [\n 'enabled' => true\n ],\n 'normalizer' => [\n 'enabled' => false\n ],\n 'validator' => [\n 'enabled' => false\n ],\n 'types' =>\n [\n [\n 'name' => 'json',\n 'values'=> [\n 'application/json','text/json'\n ],\n 'restrict' => null\n ],\n [\n 'name' => 'xml',\n 'values' => [\n 'application/xml','text/xml'\n ],\n 'restrict' => null\n ]\n ],\n 'headers' =>\n [\n 'content_type' => 'content-type',\n 'accept_type' => 'accept'\n ]\n ];\n }", "public function get_default_list_config()\n {\n return '[[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_id\",false,\"LC__CMDB__OBJTYPE__ID\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_id\"]],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_title\",false,\"LC__UNIVERSAL__TITLE_LINK\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_title\"]],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"its_type\",\"isys_its_type__title\",\"LC__CMDB__CATG__TYPE\",\"isys_cmdb_dao_category_g_its_type::get_properties\",false],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_created\",false,\"LC__TASK__DETAIL__WORKORDER__CREATION_DATE\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_created\"]],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_changed\",false,\"LC__CMDB__LAST_CHANGE\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_changed\"]],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"purpose\",\"isys_purpose__title\",\"LC__CMDB__CATG__GLOBAL_PURPOSE\",\"isys_cmdb_dao_category_g_global::get_properties\",false],' . '[' . C__PROPERTY_TYPE__STATIC . ',\"category\",\"isys_catg_global_category__title\",\"LC__CMDB__CATG__GLOBAL_CATEGORY\",\"isys_cmdb_dao_category_g_global::get_properties\",false],' . '[' . C__PROPERTY_TYPE__DYNAMIC . ',\"_cmdb_status\",false,\"LC__UNIVERSAL__CMDB_STATUS\",\"isys_cmdb_dao_category_g_global::get_dynamic_properties\",[\"isys_cmdb_dao_category_g_global\",\"dynamic_property_callback_cmdb_status\"]]]';\n }", "private static function getBaseConfig(): array\n {\n return [\n 'aphiria' => [\n 'contentNegotiation' => [\n 'encodingMatcher' => AcceptCharsetEncodingMatcher::class,\n 'languageMatcher' => AcceptLanguageMatcher::class,\n 'mediaTypeFormatters' => [\n JsonMediaTypeFormatter::class\n ],\n 'supportedLanguages' => ['en']\n ]\n ]\n ];\n }", "private function get_configurations()\n {\n return [\n Configuration\\Comments::class,\n Configuration\\Editor::class,\n Configuration\\Media::class,\n Configuration\\Misc::class,\n Configuration\\Menu::class,\n Configuration\\Plugins::class,\n ];\n }", "protected function getMapping() : array\n {\n return [\n 'defaultValue' => [\n 'get' => 'config.hasDefaultValue() ? config.getDefaultValue() : null',\n 'set' => 'array[\"hasDefaultValue\"] ? config.setDefaultValue(array[\"defaultValue\"]) : \"\"',\n 'types' => []\n ],\n 'hasDefaultValue' => [\n 'get' => 'config.hasDefaultValue()',\n 'set' => 'null',\n 'types' => ['bool']\n ],\n 'description' => [\n 'get' => 'config.getDescription()',\n 'set' => 'config.setDescription(array[\"description\"])',\n 'types' => ['string', 'null']\n ],\n 'requiredState' => [\n 'get' => 'config.isRequired()',\n 'set' => 'array[\"requiredState\"] ? config.setRequired() : config.setUnRequired()',\n 'types' => ['bool']\n ]\n ];\n }", "protected function _configs()\n {\n return array(\n \t\t'collectionName' => 'comments_samx',\n \t'documentSchemaArray' => array(\n \t\t'content'\t=>\t'string',\n 'content_uf' => \"string\", //unfiltered content\n 'name' => \"string\", //sort of title for the comment. A substr of fcontent\n 'node' => $this->cSchema,\n \t 'pid' => 'string', //parent comment id \t\n \t\t'u'\t=>\t$this->cSchema, //user who posted this\n \t\t'ts'\t=>\t'int',\n \t\t'attachments' => array(\n \t\t\t\tarray(\n \t\t\t\t\t\t'u' => $this->cSchema,\n \t\t\t\t\t\t'id' => 'string',\n \t\t\t\t\t\t'ext' => 'string',\n \t\t\t\t\t\t'path' => 'string',\n \t\t\t\t\t\t'name' => 'string'\n \t\t\t\t)\n \t\t),\n \t 'counter' => array(\n \t 'vote' => 'int',\n 'spam' => 'int'\n \t ),\n 'status' => 'string', // approved|queued\n 'is_spam' => 'int', // 0 | 1\n \t));\n }", "public function getVariantConfig();", "function config(array $config);", "private function getDefaultConfig(){\n\t\t//Pretty simple. Multidimensional array of configuration values gets returned\n\t $defaultConfig = array();\n\t\t$defaultConfig['general'] = array('start_path'=>'.', 'disallowed'=>'php, php4, php5, phps',\n\t\t\t\t\t\t\t\t\t\t 'page_title'=>'OMFG!', 'files_label'=>'', 'folders_label'=>'');\n\t\t$defaultConfig['options'] = array('thumb_height'=>75, 'files_per_page'=>25, 'max_columns'=>3, \n\t\t\t\t\t\t\t\t\t\t 'enable_ajax'=>false, 'memory_limit'=>'256M', 'cache_thumbs'=>false, \n\t\t\t\t\t\t\t\t\t\t\t'thumbs_dir'=>'/.thumbs', 'icons_dir'=>'/.icons');\n\t\treturn $defaultConfig;\n\t}", "abstract protected function getMartyConfig(): array;", "public function getConfig(){\n\n $config = $this->propToConfig();\n return $config;\n\n }", "public function getContainedPluginConfiguration();", "private function getGiftOptionsConfigJson()\n {\n return $this->configProvider->getConfig();\n }", "protected function getConfiguration() {}", "function getAppConfig() {\n $appConfig = array(\n 'images' => array(\n 'thumbnail' => array (\n 'default_sizes' => array (600, 300, 150),\n 'cdn_prefix' => \"https://s3-us-west-2.amazonaws.com/marathimultiplex/images/thumbnail/\"\n ),\n 'banner' => array (\n 'default_sizes' => array(1000, 500),\n 'cdn_prefix' => \"https://s3-us-west-2.amazonaws.com/marathimultiplex/images/banner/\"\n )\n )\n );\n \n return $appConfig;\n }", "public function getConfig(){\n\t\treturn $this->_config;\n\t}", "public static function getConfiguration();", "public function getConfig() {\n \t\n \t// Return our configuration\n \treturn $this->aConfig;\n }", "public function getConfig()\n {\n\n $methodCode = self::CODE;\n $config = [];\n\n $testMode = $this->_config->getValue('payment/brick/test_mode');\n $publicTestKey = $this->_config->getValue('payment/brick/public_test_key');\n $publicKey = $this->_config->getValue('payment/brick/public_key');\n $autoFillCardInfo = $this->_config->getValue('payment/brick/auto_fill_card_info');\n $config = array_merge_recursive($config, [\n 'payment' => [\n 'ccform' => [\n 'availableTypes' => [$methodCode => $this->getCcAvailableTypes()],\n 'months' => [$methodCode => $this->getCcMonths()],\n 'years' => [$methodCode => $this->getCcYears()],\n 'hasVerification' => [$methodCode => true],\n 'hasSsCardType' => [$methodCode => false],\n 'ssStartYears' => [$methodCode => $this->getSsStartYears()],\n 'cvvImageUrl' => [$methodCode => $this->getCvvImageUrl()]\n ],\n $methodCode => [\n 'public_key' => $testMode ? $publicTestKey : $publicKey,\n 'auto_fill_card_info' => $autoFillCardInfo,\n 'isActive' => true\n ]\n ]\n ]);\n return $config;\n }", "protected function _getConfigArray(){\n \n return array(\n array(\n 'version' => '0.0.4',\n 'path' => 'bss_quickview/seting_theme/product_image_wrapper',\n 'value' => 'product-item-photo'\n ),\n array(\n 'version' => '0.0.5',\n 'path' => 'bss_quickview/success_popup_design/background_color',\n 'value' => '0088CC'\n ),\n array(\n 'version' => '0.0.5',\n 'path' => 'porto_settings/custom_settings/custom_style',\n 'value' => 'table.desc_spec_tbl{border-collapse:collapse}\ntable.desc_spec_tbl td{border:1px solid #dcdcdc}\n.product.description ul{list-style:disc}\n.page-header.type2.header-newskin .main-panel-top{border-bottom:1px solid rgba(248,248,248,0.2)}\n.page-header.type2.header-newskin .main-panel-inner{border:none}\n#phone-hrs{font-size:1.4em!important;color:#636363;padding-right:15px!important}\n#phone-hrs a{color:#08C!important}\n.page-header.type2.header-newskin .custom-block{width:100%!important;text-align:right!important;top:90%!important;right:0!important}\nh2.side-menu-title{margin:0;background-color:#FF7B0D;color:#fff;font-size:13px;font-weight:700;line-height:1;padding:14px 15px;border-radius:5px 5px 0 0;border-bottom:1px solid #ddd}\n.filterproduct-title{color:#fff!important;background-color:#08c!important;padding-left:20px!important}\n.products-grid.columns4{margin-left:0!important;margin-right:0!important}\n.home-side-menu h2.side-menu-title{color:#fff!important}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart:before,.page-header.type2.header-newskin .minicart-wrapper .action.showcart.active:before{font-size:33px;color:#08C!important}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart{padding-right:17px}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart .counter.qty{margin-top:-21px;background-color:#ff5b5b}\n.page-header.type2.header-newskin .minicart-wrapper .action.showcart:after{right:-6px}\n.homepage-bar{border:none;background-color:transparent}\n.homepage-bar .col-lg-4{border-color:#fff;padding-top:14px;padding-bottom:15px}\n.homepage-bar [class*=\" porto-icon-\"],.homepage-bar [class^=\"porto-icon-\"]{color:#465157}\n.homepage-bar .text-area{display:inline-block;vertical-align:middle;text-align:left;margin-left:5px}\n.homepage-bar h3{font-size:14px;font-weight:600;color:#465157;line-height:19px}\n.homepage-bar p{font-size:13px;font-weight:300;color:#839199;line-height:19px}\n.owl-theme .owl-dots .owl-dot span{width:13px;height:13px;border-radius:100%;border:solid 2px #d5d5d5;background:none;position:relative;margin:5px 2px}\n#banner-slider-demo-9.owl-bottom-narrow .owl-controls{text-align:left;padding-left:28px}\n#banner-slider-demo-9.owl-theme .owl-dots .owl-dot span{border:2px solid rgba(0,0,0,0.2);background:none}\n#banner-slider-demo-9.owl-theme .owl-dots .owl-dot.active span,#banner-slider-demo-9.owl-theme .owl-dots .owl-dot:hover span{border-color:#fff;background:none}\n.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{border-color:#05131c;background:none}\n.owl-theme .owl-controls .owl-dot.active span:before,.owl-theme .owl-dots .owl-dot:hover span:before{content:\"\";position:absolute;left:3px;top:3px;right:3px;bottom:3px;background-color:#05131c;border-radius:100%}\n#banner-slider-demo-9.owl-theme .owl-dots .owl-dot.active span:before,#banner-slider-demo-9.owl-theme .owl-dots .owl-dot:hover span:before{background-color:#fff}\n.owl-theme .owl-dots .owl-dot.active span:before,.owl-theme .owl-dots .owl-dot:hover span:before{background-color:#05131c}\n.block.block-subscribe.home-sidebar-block{border:none;background-color:#f4f4f4;text-align:center;border-radius:2px!important}\n.block.block-subscribe.home-sidebar-block .block-title strong{font-size:17px;font-weight:700;color:#05131c}\n.block.block-subscribe.home-sidebar-block .block-content p{line-height:24px;letter-spacing:.001em;color:#4a505e;font-size:14px}\n.block.block-subscribe.home-sidebar-block .newsletter .control input{height:45px;border-color:#e4e4e4;padding-right:10px;border-radius:3px;color:#05131c;text-transform:uppercase}\n.block.block-subscribe.home-sidebar-block button.subscribe{width:100%;margin:7px 0 0;height:auto;position:relative;left:auto;right:auto;top:auto;border-radius:5px;background-color:inherit}\n.block.block-subscribe.home-sidebar-block button.subscribe span{height:45px;text-transform:uppercase;background-color:#05131c;border:none;border-radius:3px;font-size:12px;letter-spacing:.005em;color:#fff;font-family:\"Oswald\";line-height:45px;display:block}\n#testimonials-slider-demo-9{padding:22px;border:solid 2px #0188cc;border-radius:2px}\n.cms-index-index .testimonial-author{margin:8px 0 0}\n.cms-index-index .testimonial-author .img-thumbnail{border:none;padding:0;margin-right:20px;border-radius:100%!important;overflow:hidden}\n.cms-index-index blockquote.testimonial{background-color:transparent;color:#62615e;font-size:14px;font-style:normal;line-height:24px;font-weight:400;font-family:\"Open Sans\";margin:0 -10px;padding:15px 30px 15px 43px;width:100%;float:left;margin-top:13px}\n.cms-index-index blockquote.testimonial:before{color:#0188cc;font-family:\"porto\";font-weight:400;font-size:54px}\n.cms-index-index blockquote.testimonial:after{color:#0188cc;font-family:\"porto\";font-weight:400;font-size:54px;right:-2px}\n.cms-index-index .testimonial-author p{line-height:20px}\n.cms-index-index .testimonial-author p >strong{text-transform:uppercase;font-size:13px;font-weight:700;letter-spacing:.0025em;color:#2b2b2d}\n.cms-index-index blockquote.testimonial p{line-height:24px;letter-spacing:.001em}\n#testimonials-slider-demo-6.owl-theme .owl-controls{text-align:left;padding-left:32px}\n.recent-posts .item{padding-top:40px}\n.recent-posts .post-date{display:block;float:none;text-align:left}\n.recent-posts .post-date .long-date{font-size:13px;font-weight:700;color:#0188cc;line-height:22px;text-transform:uppercase}\n.recent-posts .postTitle{min-height:auto}\n.recent-posts .postTitle h2{margin:0}\n.recent-posts .postTitle h2 a{font-size:17px;font-weight:600;line-height:22px;color:#2b2b2d}\n.recent-posts .postContent{margin:0;padding:0}\n.recent-posts .postContent>p{line-height:27px;letter-spacing:.001em}\n.recent-posts a.readmore{display:none}\n.recent-posts .owl-controls{text-align:left}\n.filterproduct-title{background:none;font-size:17px;color:#2b2b2d}\n.filterproduct-title .content{background:none;padding:0}\n.owl-top-narrow .owl-theme .owl-controls .owl-dots{margin-top:0}\n.small-list.products-grid .product-item .product-item-name{font-size:14px;font-weight:400;letter-spacing:.005em}\n.small-list.products-grid .product-item .product-reviews-summary{margin-top:0}\n.shop-features [class*=\" porto-icon-\"],.shop-features [class^=\"porto-icon-\"]{color:#0188cc;border-color:#0188cc}\n.shop-features h3{font-size:14px;font-weight:700}\n.shop-features p{color:#4a505e;line-height:27px;font-weight:400}\n.shop-features a{font-family:\"Oswald\";font-size:12.5px;text-transform:uppercase;color:#2b2b2d;letter-spacing:.0025em;line-height:26px;border:solid 1px #efefef;padding:7px 28px;background:none;box-shadow:none}\n.shop-features a:hover{background:none;color:#2b2b2d;border-color:#efefef}\n.owl-top-narrow{margin:0 -10px}\n.owl-top-narrow .owl-theme .owl-controls{right:8px}\n.owl-top-narrow .owl-carousel .owl-item > .item{padding:10px}\n@media (min-width: 768px) {\n.catalog-category-view .page-main,.catalog-product-view .page-main{padding-top:0}\n}\n.breadcrumbs li.home a{width:15px;display:inline-block;text-indent:30px;overflow:hidden;float:left;position:relative}\n.breadcrumbs li.home a:after{content:\"\\e883\";font-family:\"porto-icons\";position:absolute;left:0;top:0;text-indent:0}\n.sidebar.sidebar-main{position:relative}\n.block-category-list .block-title,.filter-options-title,.filter .filter-current-subtitle{border:none;background-color:transparent;padding:16px 20px 4px;font-size:15px;text-transform:uppercase;font-weight:600;color:#21293c;letter-spacing:.01em}\n.block-category-list .block-title{padding:0 20px 0}\n.block-category-list .block-title strong{font-weight:600}\n.block-category-list .block-content,.filter-options-content{border:none;background-color:transparent;padding:10px 20px 26px;border-bottom:#efefef solid 1px;position:relative;z-index:2;border-radius:0}\n.filter-current .items{border:none;background-color:transparent;position:relative;z-index:2}\n.filter-current .item{padding-left:20px}\n.filter-current .action.remove{right:20px;color:#21293c}\n.filter-actions{border:none;background-color:transparent;border-bottom:#efefef solid 1px;position:relative;z-index:2;padding-right:20px}\n.filter-actions a{color:#858585}\n.filter-options-title:after{content:\"\\f803\";border:none;color:#21293c;font-size:17px;margin-top:-6px}\n.filter-options-title:hover:after{background:none;color:#21293c}\n.active > .filter-options-title:after{content:\"\\f800\"}\n#ln_slider_price.ui-slider-horizontal{height:3px;box-shadow:none}\n#ln_slider_price .ui-slider-handle{width:12px;height:12px;border-radius:100%}\n.sidebar-title{font-size:15px;font-weight:600;color:#21293c;letter-spacing:.01em;margin-bottom:20px;padding-left:20px;padding-right:20px}\n.porto-icon-left-open-huge:before{content:\"\\f802\";color:#21293c}\n.porto-icon-right-open-huge:before{content:\"\\f801\";color:#21293c}\n.sidebar .owl-top-narrow .owl-theme .owl-controls{top:-40px;right:3px}\n.sidebar .owl-top-narrow .owl-theme .owl-controls .owl-nav div :before{color:#21293c}\n.sidebar .product-items .product-item-info .product-item-photo{max-width:25.19%}\n.sidebar .product-items .product-item-details{margin-left:calc(26% + 15px)}\n.sidebar .product-items .product-item-name a{font-size:12px;color:#5b5b5f;font-weight:400}\n.sidebar .sidebar-filterproducts{margin-bottom:30px;padding-bottom:40px;background:none;border-bottom:#efefef solid 1px}\n.sidebar .product-items .product-item .product-reviews-summary{display:block}\n.sidebar-filterproducts.custom-block + h2{font-size:15px!important;text-transform:uppercase;font-weight:600;color:#21293c!important;letter-spacing:.01em;padding:0 20px}\n.sidebar-filterproducts.custom-block + h2 +h5{font-family:\"Open Sans\"!important;font-weight:600!important;font-size:14px!important;color:#7a7d82!important;letter-spacing:.022em;padding:0 20px}\n.sidebar-filterproducts.custom-block + h2 + h5 + p{color:#21293c!important;font-size:15px!important;letter-spacing:.01em;padding:0 20px}\n.sidebar .custom-block{padding:0 20px}\n.category-boxed-banner.owl-theme .owl-controls{bottom:0}\n.page-products .toolbar .limiter{display:block}\n.page-with-filter .toolbar-amount{display:none}\n.full-width-image-banner{height:300px}\n.full-width-image-banner:after{display:none}\n.full-width-image-banner h2{font-size:36px;font-weight:900;letter-spacing:-.025em;text-transform:uppercase;line-height:38px}\n.full-width-image-banner p{font-size:18px;line-height:38px;font-weight:700;text-transform:uppercase}\n.full-width-image-banner .btn-default{font-size:14px;line-height:25px;letter-spacing:.025em;padding:10px 20px;background-color:#010204;color:#fff;font-family:\"Oswald\";text-transform:uppercase;border-radius:2px;margin-top:31px}\n.page-products .toolbar .limiter .limiter-text{display:none}\n.modes-mode.active{border:none;background:none;color:#111}\n.modes-mode,.modes-mode:hover{border:none;background:none;color:#111;width:15px}\n.toolbar select{border:1px solid #e4e4e4;height:37px;color:#7a7d82;font-weight:400;font-size:14px;text-transform:capitalize;padding:0 10px;padding-right:30px;line-height:31px}\n.toolbar-sorter .sorter-action{margin-top:6px;color:#21293c}\n.toolbar-sorter .sorter-action:before{color:#21293c}\n.pages a.page,.pages strong.page,.pages .action{width:32px;line-height:32px}\n.products-grid + .toolbar.toolbar-products{border-top:solid 1px #efefef;padding-top:25px}\n.filterproducts.products .product-item .product-item-photo{border:solid 1px #ececec}\n.product-item .product-reviews-summary{background:none}\n.price-box .price{font-family:\"Oswald\";font-weight:400;font-size:18px;color:#465157}\n.old-price .price{font-size:13px;color:#999}\n.catalog-product-view .sidebar .custom-block{border:none;color:#6b7a83;padding-bottom:0;margin-bottom:33px;background:none}\n.catalog-product-view .sidebar .custom-block-1>div i{color:#08c;border:none;font-size:40px;float:left}\n.catalog-product-view .sidebar .custom-block-1>div{min-height:65px;clear:both;padding:18px 0;border-bottom:solid 1px #dee5e8;margin-bottom:0}\n.catalog-product-view .sidebar .custom-block-1>div:last-child{border-bottom-width:0}\n.block-manufacturer{text-align:center;padding:10px 20px 0;margin-bottom:0}\n.block-manufacturer hr{border-color:#dee5e8;margin-bottom:0}\n.catalog-product-view .sidebar .custom-block-1>div h3{font-size:14px;font-weight:600;line-height:20px;letter-spacing:.005em;color:#6b7a83;margin-left:80px}\n.block.related{padding:0 20px}\n.block .title strong{font-size:15px;font-weight:600;color:#21293c;letter-spacing:.01em;margin-bottom:20px!important;padding-top:0;text-transform:uppercase}\n.block.related .product-items .product-item-actions{display:none}\n.product-info-main .page-title-wrapper h1{font-size:25px;font-weight:600;letter-spacing:-.01em;color:#21293c;margin:3px 0 15px}\n.prev-next-products a{color:#555}\n.product-reviews-summary .reviews-actions a{line-height:20px;font-size:14px;color:#bdbdbd}\n.product-info-main .product.overview{font-size:14px;font-weight:400;letter-spacing:.005em;line-height:27px;border-bottom:solid 1px #dae2e6}\n.product.media{padding-right:12px}\n.fotorama__stage__shaft{border:none}\n.fotorama__nav--thumbs .fotorama__thumb{border-color:#dae2e6}\n.product-options-bottom .price-box .price-container .price,.product-info-price .price-box .price-container .price{font-family:\"Oswald\";font-size:21px;font-weight:700;letter-spacing:.005em}\n.product-info-main .product-info-price .old-price .price-wrapper .price{font-size:16px;color:#2b2b2d;font-weight:400}\n.product-info-main .fieldset > .field.qty,.product-info-main .nested.options-list > .field.qty{position:relative;width:106px}\n.product-info-main .qty.field .control,.product-info-main .qty.field .qty-changer{margin-left:29px}\n.product-info-main .qty.field .qty-changer > a{position:absolute;top:0;left:0;height:43px;width:30px;line-height:41px;text-align:center;margin:0;border-color:#dae2e6}\n.product-info-main .qty.field .qty-changer > a:first-child{left:auto;right:4px}\n.product-info-main .box-tocart .input-text.qty{font-family:\"Oswald\";display:inline-block;vertical-align:middle;height:43px;width:44px!important;font-size:14px;font-weight:400;text-align:center;color:#61605a;margin:0;border-color:#dae2e6}\n.product-info-main .qty.field .qty-changer > a .porto-icon-up-dir:before{content:\"\\f882\"}\n.product-info-main .qty.field .qty-changer > a .porto-icon-down-dir:before{content:\"\\f883\"}\n.catalog-product-view:not(.weltpixel-quickview-catalog-product-view):not(.weltpixel_quickview-catalog_product-view) .box-tocart .action.tocart{height:43px;font-size:14px;letter-spacing:.05em;font-weight:400}\n.box-tocart .action.tocart:before{content:\"\\e87f\";font-family:\"porto-icons\";margin-right:7px;font-size:16px}\n.action.primary,.action.primary:active{font-family:\"Oswald\";letter-spacing:1px;text-transform:uppercase}\n.product-addto-links .action.towishlist,.product-addto-links .action.tocompare,.moved-add-to-links .action.mailto.friend,.product-social-links .action.mailto.friend{width:43px;height:43px;line-height:41px}\n.product.data.items > .item.content{background-color:#fff;box-shadow:none;border:none;border-top:#dae2e6 solid 1px;font-size:14px;font-weight:400;letter-spacing:.005em;line-height:27px}\n.main-upsell-product-detail .block.upsell .title strong{background:none}\n.block.upsell .title{background:none;border-bottom:#e1e1e1 solid 1px;font-weight:700;margin-bottom:16px;padding-bottom:10px;text-transform:uppercase;text-align:left}\n.block.upsell .title strong{font-size:14px;font-weight:400;font-family:\"Oswald\";color:#302e2a}\n.review-ratings .rating-label{display:block}\n.footer-middle{padding:62px 0 42px}\n.footer-ribbon{margin:-78px 0 25px}\n.footer-middle p{font-size:13px;line-height:20px;margin-bottom:0}\n.footer-middle .block .block-title{margin-bottom:15px}\n.footer-middle .block .block-title strong{font-size:16px;font-weight:700;text-transform:uppercase}\n.footer-middle ul.links li,.footer-middle ul.features li{padding:6px 0}\n.footer-container .validation-advice{position:absolute}\n.footer-middle .block.newsletter .form.subscribe{max-width:400px}\n.footer-middle .block.newsletter .control:before{line-height:48px;margin-left:20px}\n.footer-middle .block.newsletter .control{position:relative}\n.footer-middle .block.newsletter .control input{background-color:#fff;color:#686865;height:48px;border:none;font-size:14px;padding-left:10px}\n.footer-middle .block.newsletter .control div.mage-error{position:absolute;bottom:-22px}\n.footer-middle .block.newsletter .action.subscribe{height:48px;text-transform:uppercase;padding:0 22px}\n.footer-middle .block-bottom{border-top:1px solid #3d3d38;text-align:left;padding:27px 0;overflow:hidden}\n.footer-middle .social-icons a{background-image:none;background-color:#33332f;text-indent:0;color:#fff;border-radius:0;font-size:15px;width:37px;height:37px;text-align:center;margin-left:0;margin-right:4px;float:left;line-height:35px}\n.footer-middle .contact-info li:first-child{border-top-width:0}\n.footer-middle .contact-info li{padding:9px 0}\n.footer-middle .contact-info i{color:#e1ddc3!important;font-size:26px;line-height:28px}\n.footer-middle .contact-info p{line-height:1}\n.footer-middle .contact-info b{font-weight:400;font-size:13px;margin-bottom:7px;display:inline-block}\n.footer-bottom{padding:18px 0}\n.footer-bottom address{float:left}\n.footer-bottom .container{position:relative}\n.footer-bottom .container:before{content:\"\";position:absolute;background-color:#3d3d38;left:15px;right:15px;top:-18px;height:1px;width:calc(100% - 30px)}\n@media (max-width: 991px) {\n.footer .block .block-content{margin-bottom:30px}\n.footer-middle .block-content{min-width:auto!important;width:100%}\n}\n@media (max-width: 767px) {\n.navigation.sw-megamenu > .sticky-logo{display:none}\n.page-header.type2.header-newskin .custom-block{display:none}\n.homepage-bar .col-lg-4{text-align:left!important}\n#banner-slider-demo-9{margin-bottom:20px}\n.sidebar.sidebar-main{position:static}\n.page-products .toolbar .limiter{display:none}\n.product.data.items{margin:0}\n.prev-next-products .product-nav.product-next .product-pop{margin:0}\n.prev-next-products .product-nav.product-prev .product-pop{left:-20px}\n.product-info-main .fieldset > .field.qty{margin-bottom:20px}\n.fieldset > .actions{vertical-align:top}\n.catalog-product-view .sidebar .custom-block{padding:0}\n.footer-middle{padding:62px 0 0;margin-bottom:-20px}\n.footer .block .block-content{margin-bottom:30px}\n.footer-middle .block-content{float:none!important}\n.footer-middle .social-icons{overflow:hidden;float:none!important}\n.footer-bottom .custom-block.f-right{margin-left:0}\n}\n.page-products .sorter{float:left}\n.modes{float:right;margin-right:0;margin-left:20px;margin-top:7px}\n.modes-mode:before{content:\"\\e880\";font-size:14px}\n.mode-list:before{content:\"\\e87b\";font-size:14px}\n.products.wrapper ~ .toolbar .limiter{float:left}\n.products.wrapper ~ .toolbar .pages{float:right}\n@media (min-width: 768px) {\n.page-header.type2.header-newskin .minicart-wrapper{background-color:transparent;width:81px;height:41px;text-align:center;box-shadow:none;border-radius:0;border:none}\n.home-side-menu{background-color:transparent;border-color:#dae2e6;border-radius:2px}\n.home-side-menu h2.side-menu-title{color:#465157;font-size:14.5px;font-weight:700;letter-spacing:.001em}\n.navigation.side-megamenu a,.navigation.side-megamenu a:hover{color:#465157}\n.sw-megamenu.navigation.side-megamenu li.level0.parent > a:after{color:#838b90}\n.sw-megamenu.navigation.side-megamenu li.level0.parent:hover > a:after{color:#fff}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu{border:solid 1px #dae2e6;box-shadow:0 3px 15px -2px rgba(0,0,0,0.3);padding:10px 0 10px 15px}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:before,.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:after{border-bottom-style:solid;content:\"\";display:block;height:0;position:absolute;width:0}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:before{border:8px solid;border-color:transparent #fff transparent transparent;z-index:3;left:-16px;top:11px}\n.sw-megamenu.navigation.side-megamenu li.level0 > .submenu:after{border:9px solid;border-color:transparent #dae2e6 transparent transparent;z-index:2;left:-18px;top:10px;right:auto}\n.sw-megamenu.navigation li.level0.fullwidth .submenu li.level1 > a,.sw-megamenu.navigation li.level0.staticwidth .submenu li.level1 > a{font-size:13px;font-weight:700;color:#434d53;letter-spacing:-.001em;margin-top:9px}\n.sw-megamenu.navigation li.level0.fullwidth .submenu a,.sw-megamenu.navigation li.level0.staticwidth .submenu a,.sw-megamenu.navigation li.level0.classic .submenu a{font-size:13px;font-weight:600;color:#696969;line-height:inherit}\n.sidebar.sidebar-main:before{content:\"\";position:absolute;left:0;right:20px;border:solid 1px #dae2e6;top:0;bottom:0;border-radius:2px}\n.product.data.items > .item.title{padding:10px 30px 10px 0}\n.product.data.items > .item.title > .switch{font-size:14px;font-weight:700;color:#818692;text-transform:uppercase;border:none;border-radius:0;line-height:30px;background:none;padding:0}\n.product.data.items > .item.title:not(.disabled) > .switch:focus,.product.data.items > .item.title:not(.disabled) > .switch:hover{background:none;color:#818692}\n.product.data.items > .item.title.active > .switch,.product.data.items > .item.title.active > .switch:focus,.product.data.items > .item.title.active > .switch:hover{color:#21293c;position:relative;border-bottom:#08C solid 2px}\n.product.data.items > .item.content{padding:35px 0 0;margin-top:45px}\n}\n@media (min-widtH: 768px) {\n.page-header .switcher .options .action.toggle{color:#fff}\n}\n.products-grid .product-item .product-item-info .product-item-photo > a:not(.weltpixel-quickview):after{content:\"\";display:block;background-color:#000;opacity:0;width:100%;height:100%;position:absolute;left:0;top:0;z-index:2;visibility:hidden;transition:all .3s}\n.products-grid .product-item .product-item-info:hover .product-item-photo > a:not(.weltpixel-quickview):after{opacity:.1;visibility:visible}\n.page-header.type2.header-newskin.sticky-header .minicart-wrapper .block-minicart:after{right:38px}\n.page-header.type2.header-newskin.sticky-header .minicart-wrapper .block-minicart:before{right:39px}\n.swatch-attribute.size .swatch-option,.swatch-attribute.manufacturer .swatch-option{background:#fff;color:#636363;border-color:#e9e9e9}\n.swatch-option.text{min-width:26px;line-height:18px;padding:3px;height:26px}\n.pages a.page,.pages strong.page,.pages .action{background:transparent;color:#706f6c;font-size:15px;font-weight:600;line-height:30px}\n.pages a.page:hover,.pages a.action:hover{background-color:transparent;color:#706f6c}\n.pages a.action:hover:before{color:#706f6c!important}\n.pages .action{border-color:transparent}\n.product-info-main .product-info-stock-sku{color:#333;font-size:14px;padding-bottom:23px}\n.product-reviews-summary .reviews-actions a{color:#21293c}\n.product-info-main .product-info-stock-sku{color:#21293c}\n.catalog-product-view .sidebar .custom-block.custom-block-1{margin-top:-25px}\n.block-minicart .block-content > .actions > .secondary .action.viewcart{color:#333;font-weight:500;font-family:\"Oswald\"}\n.cms-index-index .single-images{margin-bottom:5px}\n.product-item .rating-summary .rating-result > span:before{color:#575f68}\n@media (max-width: 767px) {\n.block-category-list .block-title,.block-category-list .block-content,.sidebar-title,.sidebar .custom-block,.sidebar-filterproducts.custom-block + h2,.sidebar-filterproducts.custom-block + h2 +h5,.sidebar-filterproducts.custom-block + h2 + h5 + p{padding-left:0;padding-right:0}\n}\n.page-header .switcher .options .action.toggle{color:#bde1f5}\n.page-wrapper > .breadcrumbs{margin-bottom:0}\n.products-grid .product-item-details .product-item-actions .tocart{text-transform:uppercase;font-size:12.53px;font-family:\"Oswald\";font-weight:400;letter-spacing:.025em;color:#fff;line-height:30px;background-color:#08c;border-color:#08c;}\n.products-grid .product-item-details .product-item-actions .tocart:hover{background-color:#006496!important;border-color:#006496!important;color:#fff}\n.product-item .tocart:before{content:\"\\e87f\";font-size:17px;vertical-align:middle}\n.product-social-links .action.towishlist:before,.product-addto-links .action.towishlist:before,.block-bundle-summary .action.towishlist:before,.product-item .action.towishlist:before,.table-comparison .action.towishlist:before{content:\"\\e889\"}'\n ),\n array(\n 'version' => '0.0.6',\n 'path' => 'persistent/options/lifetime',\n 'value' => '14400'\n ),\n );\n }", "public function getConfigArray(): array\n {\n return [\n 'paths' => [\n 'migrations' => $this->getCorrectedPath(__DIR__ . '/_files/migrations'),\n ],\n 'environments' => [\n 'default_migration_table' => 'phinxlog',\n 'default_database' => 'production',\n 'production' => [\n 'adapter' => 'mysql',\n 'host' => MYSQL_DB_CONFIG['host'],\n 'name' => MYSQL_DB_CONFIG['name'],\n 'user' => MYSQL_DB_CONFIG['user'],\n 'pass' => MYSQL_DB_CONFIG['pass'],\n 'port' => MYSQL_DB_CONFIG['port']\n ]\n ]\n ];\n }", "private function getConfigNode() {\n// $jsonConfig = \\CloudConfig::get(\"platform/proxy_shequ\", \"test\");\n// $config = json_decode($jsonConfig, true);\n $array = \\Yosymfony\\Toml\\Toml::Parse(__DIR__ . '/../config.toml');\n\n foreach ($array as $key => $value) {\n if ($key == \"common\") {\n\n $ex = explode(\":\", $value['redis_host']);\n $this->redisHost = $ex[0];\n $this->redisPort = $ex[1];\n\n if (isset($value['redis_auth'])) {\n $this->redisAuth = $value['redis_auth'];\n }\n\n if (isset($value['slow_limit'])) {\n $this->slow_limit = (int) $value['slow_limit'];\n }\n\n if (isset($value['big_limit'])) {\n $this->big_limit = (int) $value['big_limit'];\n }\n\n $this->RECORD_QUERY = $value['record_query'];\n } else {//nodes\n// $node = $key;\n foreach ($value['db'] as $db) {\n $this->getEntry($db, $value);\n }\n }\n }\n if (isset($array['common']['include_path'])) {\n $this->getConfigChildNode($array['common']['include_path']);\n }\n }", "function addNewsConfig($params, &$pObj) {\n\t\t\treturn array_merge_recursive($params['config'], array(\n\t\t 'fileName' => array (\n\t\t 'index' => array (\n\t\t 'rss.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '100'\n\t\t ),\n\t\t ),\n\t\t 'rss091.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '101'\n\t\t ),\n\t\t ),\n\t\t 'rdf.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '102'\n\t\t ),\n\t\t ),\n\t\t 'atom.xml' => array (\n\t\t 'keyValues' => array (\n\t\t 'type' => '103'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t\t\t'postVarSets' => array (\n\t\t '_DEFAULT' => array (\n\t\t 'archive' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[year]'\n\t\t ),\n\t\t '1' => array (\n\t\t 'GETvar' => 'tx_ttnews[month]',\n\t\t 'valueMap' => array (\n\t\t 'jan' => '01',\n\t\t 'feb' => '02',\n\t\t 'mar' => '03',\n\t\t 'apr' => '04',\n\t\t 'may' => '05',\n\t\t 'jun' => '06',\n\t\t 'jul' => '07',\n\t\t 'aug' => '08',\n\t\t 'sep' => '09',\n\t\t 'oct' => '10',\n\t\t 'nov' => '11',\n\t\t 'dec' => '12'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t 'browse' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[pointer]',\n\t\t ),\n\t\t ),\n\t\t 'select_category' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[cat]',\n\t\t ),\n\t\t ),\n\t\t 'article' => array (\n\t\t '0' => array (\n\t\t 'GETvar' => 'tx_ttnews[tt_news]',\n\t\t 'lookUpTable' => array (\n\t\t 'table' => 'tt_news',\n\t\t 'id_field' => 'uid',\n\t\t 'alias_field' => 'title',\n\t\t 'addWhereClause' => ' AND NOT deleted',\n\t\t 'useUniqueCache' => '1',\n\t\t 'useUniqueCache_conf' => array (\n\t\t 'strtolower' => '1',\n\t\t 'spaceCharacter' => '-'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t '1' => array (\n\t\t 'GETvar' => 'tx_ttnews[swords]'\n\t\t ),\n\t\t ),\n\t\t ),\n\t\t )\n\t\t\t));\n\t\t\n\t\t}", "function getConfig($arg) {\n\t\t$dbo = & $this->_dbo;\n\t\t$dbo->dieOnQuery(FALSE);\n\t\tif (!is_array($arg))\n\t\t\t$arg = array($arg);\n\t\t\t\n\t\t$config = array();\n\t\tif ($arg[0] == 'all')\n\t\t\t$sql = 'SELECT config_name,config_value FROM '.$dbo->table['config'];\n\t\telse\n\t\t\t$sql = 'SELECT config_name,config_value FROM '.$dbo->table['config'].' WHERE config_name IN (\\''.implode('\\',\\'',$arg).'\\')';\n\t\t\n\t\twhile ($row = $dbo->getRows($sql)) \n\t\t\t\t$config[$row['config_name']] = $row['config_value'];\n\t\n\t\t$dbo->dieOnQUery(TRUE);\n\t\treturn $config;\n\t}" ]
[ "0.6867644", "0.670817", "0.66410536", "0.6533017", "0.6533017", "0.64468205", "0.6347179", "0.63418776", "0.6334443", "0.6321901", "0.62961584", "0.62693805", "0.62184304", "0.6114488", "0.6104361", "0.6104361", "0.6104361", "0.61037207", "0.60898066", "0.6089514", "0.6065204", "0.60634226", "0.6062713", "0.6058397", "0.6058262", "0.6055647", "0.60521644", "0.6051239", "0.6038742", "0.60386795", "0.6031918", "0.6012073", "0.5996851", "0.5993173", "0.5983474", "0.59795696", "0.59795696", "0.59795696", "0.59795696", "0.59795696", "0.59795696", "0.59795696", "0.59795696", "0.5969053", "0.5953757", "0.59526116", "0.59508544", "0.5949832", "0.5941377", "0.5923908", "0.59234077", "0.592052", "0.5918772", "0.59170663", "0.5910024", "0.59039086", "0.59039086", "0.59039086", "0.58874935", "0.5881351", "0.58799833", "0.5879459", "0.5872071", "0.5870225", "0.5834724", "0.582627", "0.5822862", "0.5816094", "0.5803638", "0.5796948", "0.5780079", "0.5778127", "0.57780004", "0.5770169", "0.5753788", "0.5749588", "0.5742337", "0.5741397", "0.5740038", "0.5733831", "0.5733322", "0.57314295", "0.5730376", "0.5725575", "0.5723415", "0.5721231", "0.57063675", "0.57028365", "0.5700906", "0.57001746", "0.5697074", "0.5688397", "0.5680395", "0.56802624", "0.56788725", "0.5678761", "0.56669253", "0.5665496", "0.56603897", "0.5659005", "0.5656549" ]
0.0
-1
array_merge() function cannot work with arrays within arrays All variable types can be inserted, if type differs it takes always the second one Values are rewritten by values which were given later
private function merge (...$configurations) { $out = []; // If there is more then two arguments, it will first merge first two, // then the result with third, then with forth, etc. if (count($configurations) > 2) { $out = array_shift($configurations); foreach ($configurations as $configuration) { $out = $this->merge($out, $configuration); } return $out; } $first = $configurations[0]; $second = $configurations[1]; // Only two arrays can be merged, when are types different always prefer second given value if (!is_array($first) || !is_array($second)) { return $second; } // Get all unique keys from both arrays foreach (array_unique(array_merge(array_keys($first), array_keys($second))) as $key) { // Both arrays have the same key > merge values under this keys if (isset($first[$key]) && isset($second[$key])) { $out[$key] = $this->merge($first[$key], $second[$key]); // If only one array has the key > add the value to output } else { $out[$key] = isset($first[$key]) ? $first[$key] : $second[$key]; } } // Return result return $out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_merge() {\n\t\t$args = func_get_args();\n\t\tforeach ($args as $k=>$value) {\n\t\t\tif (!is_array($value)) $value=array();\n\t\t\t$args[$k]=$value;\n\t\t}\n\t\treturn call_user_func_array(\"array_merge\", $args);\n\t}", "public function merge() {\n\t\t// Holds all the arrays passed\n\t\t$params = &func_get_args();\n\t\t\n\t\t// First array is used as the base, everything else overwrites on it\n\t\t$return = array_shift ( $params );\n\t\t\n\t\t// Merge all arrays on the first array\n\t\tforeach ( $params as $array ) {\n\t\t\tforeach ( $array as $key => $value ) {\n\t\t\t\t// Numeric keyed values are added (unless already there)\n\t\t\t\tif (is_numeric ( $key ) && (! in_array ( $value, $return ))) {\n\t\t\t\t\tif (is_array ( $value )) {\n\t\t\t\t\t\t$return [] = $this->merge ( $return [$key], $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$return [] = $value;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t// String keyed values are replaced\n\t\t\t\t} else {\n\t\t\t\t\tif (isset ( $return [$key] ) && is_array ( $value ) && is_array ( $return [$key] )) {\n\t\t\t\t\t\t$return [$key] = $this->merge ( $return[$key], $value );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$return [$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $return;\n\t}", "static function merge(/*...*/){\n $ar = array_filter(func_get_args(),'is_array'); // remove non-arrays\n $nc = count($ar);\n if($nc==0) return(NULL);\n if($nc==1) return($ar[0]);\n $res = call_user_func_array('array_merge_recursive',$ar);\n $res = ops_narray::_merge_reduce($res);\n return($res);\n }", "static public function array_merge()\r\n\t{\r\n\t\t$args \t\t= func_get_args();\r\n\t\t$results\t= array();\r\n\t\tforeach($args as $array) {\r\n\t\t\tforeach($array as $key => $value) {\r\n\t\t\t\t$results[$key] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $results;\r\n\t}", "function fusion_array_merge_recursive( array $array1, array $array2 ) {\n\t$merged = $array1;\n\n\tforeach ( $array2 as $key => $value ) {\n\t\tif ( is_array( $value ) && isset( $merged[ $key ] ) && is_array( $merged[ $key ] ) ) {\n\t\t\t$merged[ $key ] = fusion_array_merge_recursive( $merged[ $key ], $value );\n\t\t} elseif ( is_numeric( $key ) && isset( $merged[ $key ] ) ) {\n\t\t\t$merged[] = $value;\n\t\t} else {\n\t\t\t$merged[ $key ] = $value;\n\t\t}\n\t}\n\n\treturn $merged;\n}", "function mergeArrays (/*$array1, $array2, ...*/): array {\n\t$gluedArray = [];\n\t$arrays = func_get_args();\n\tforeach ($arrays as $array) {\n\t\tif (is_array($array)) $gluedArray = array_merge($gluedArray, $array);\n\t}\n\treturn $gluedArray;\n}", "function array_extend($array1, $array2){\n $array1 = (is_array($array1)) ? $array1 : array();\n $array2 = (is_array($array2)) ? $array2 : array();\n foreach($array2 as $k=>$v){\n if (is_array($v) && is_associative_array($v)){\n if(!isset($array1[$k])) $array1[$k] = $v;\n else $array1[$k] = array_extend($array1[$k], $v);\n } else {\n if(is_array($v)){\n if (isset($array1[$k]) && is_array($array1[$k])) $array1[$k] = array_merge($array1[$k], $v);\n else $array1[$k] = $v;\n } else $array1[$k] = $v;\n }\n }\n return $array1;\n}", "function array_extend(array $arrays) {\n $merged = array();\n\n foreach (func_get_args() as $array) {\n foreach ($array as $key => $value) {\n if (is_array($value) && array_has($merged, $key) && is_array($merged[$key])) {\n $merged[$key] = array_extend($merged[$key], $value);\n } else {\n $merged[$key] = $value;\n }\n }\n }\n\n return $merged;\n }", "function atk_array_merge_recursive($array1, $array2)\n{\n\t$arrays = func_get_args();\n\n\t$result = array();\n\n\tforeach ($arrays as $array)\n\t{\n\t\tforeach ($array as $key => $value)\n\t\t{\n\t\t\tif (isset($result[$key]) && is_array($result[$key]) && is_array($value))\n\t\t\t{\n\t\t\t\t$result[$key] = atk_array_merge_recursive($result[$key], $value);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $result;\n}", "static function merge() {\n\t\t$base = array();\n\t\t$args = func_get_args();\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tself::array_merge( $base, $arg );\n\t\t}\n\n\t\treturn $base;\n\t}", "static function merge($x,$y){\n\t\t$arrays = func_get_args();\n\t\t$result = [];\n\t\tforeach($arrays as $array){\n\t\t\tif(is_object($array)){\n\t\t\t\t$array = self::from($array);\n\t\t\t}\n\t\t\tif(is_array($array)){\n\t\t\t\t$result = array_merge($result,$array);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "protected static function array_merge( array &$base, array $overwrite ) {\n\t\tforeach ( $overwrite as $key => &$value ) {\n\t\t\tif ( is_int( $key ) ) {\n\t\t\t\t// add only if it doesn't exist\n\t\t\t\tif ( ! in_array( $overwrite[ $key ], $base ) ) {\n\t\t\t\t\t$base[] = $overwrite[ $key ];\n\t\t\t\t}\n\t\t\t} else if ( is_array( $value ) ) {\n\t\t\t\tif ( isset( $base[ $key ] ) && is_array( $base[ $key ] ) ) {\n\t\t\t\t\tself::array_merge( $base[ $key ], $value );\n\t\t\t\t} else { // does not exist or it's a non-array\n\t\t\t\t\t$base[ $key ] = $value;\n\t\t\t\t}\n\t\t\t} else { // not an array and not numeric key\n\t\t\t\t$base[ $key ] = $value;\n\t\t\t}\n\t\t}\n\t}", "public function array_merge_recursive_overwrite()\n {\n $arrays = func_get_args();\n $base = array_shift($arrays);\n\n foreach ($arrays as $array) {\n reset($base); //important\n //while (list($key, $value) = @each($array)) { // Deprecated php 7.2\n foreach ($array as $key => $value) {\n if (is_array($value) && @is_array($base[$key])) {\n $base[$key] = $this->array_merge_recursive_overwrite($base[$key], $value);\n } else {\n $base[$key] = $value;\n } // else\n } // while / for each\n } // foreach\n\n return $base;\n }", "function atk_array_merge($array1, $array2)\n{\n\t$res = Array();\n\n\t$arrays = func_get_args();\n\tfor ($i = 0, $_i = count($arrays); $i < $_i; $i++)\n\t{\n\t\tfor ($j = 0, $_j = count($arrays[$i]); $j < $_j; $j++)\n\t\t{\n\t\t\tif (!in_array($arrays[$i][$j], $res))\n\t\t\t{\n\t\t\t\t$res[] = $arrays[$i][$j];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $res;\n}", "private function arrayMergeDeep(array $array1, array $array2) : array\n {\n }", "public static function arrayMergeAssoc() {\n\t$result = array();\n\t$arrays = func_get_args();\n\tforeach($arrays as $array) {\n\t\tif ($array == null) {\n\t\t\tcontinue;\n\t\t}\n\t\tforeach($array as $key => $value) {\n\t\t\t$result[$key] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "function array_merge(/* $array, ... */): array\n{\n $merged = [];\n $arrays = array_reverse(func_get_args());\n while (!empty($arrays)) {\n $current = array_shift($arrays);\n if (!is_array($current)) {\n $current = [$current];\n }\n foreach (array_reverse($current) as $key => $value) {\n if (array_key_exists($key, $merged)) {\n if (is_array($value) && is_array($merged[$key])) {\n $merged[$key] = array_merge($value, $merged[$key]);\n }\n if (is_numeric($key)) {\n $merged[] = $value;\n }\n } else {\n $merged[$key] = $value;\n }\n }\n }\n\n return array_reverse($merged);\n}", "public static function mergeArray($a,$b)\n\t{\n\t\t$args=func_get_args();\n\t\t$res=array_shift($args);\n\t\twhile(!empty($args))\n\t\t{\n\t\t\t$next=array_shift($args);\n\t\t\tforeach($next as $k => $v)\n\t\t\t{\n\t\t\t\tif(is_integer($k))\n\t\t\t\t\tisset($res[$k]) ? $res[]=$v : $res[$k]=$v;\n\t\t\t\telse if(is_array($v) && isset($res[$k]) && is_array($res[$k]))\n\t\t\t\t\t$res[$k]=self::mergeArray($res[$k],$v);\n\t\t\t\telse\n\t\t\t\t\t$res[$k]=$v;\n\t\t\t}\n\t\t}\n\t\treturn $res;\n\t}", "private static function mergeArrayResult($a, $b)\r\n {\r\n // merge arrays if both variables are arrays\r\n if (is_array($a) && is_array($b)) {\r\n // loop through each right array's entry and merge it into $a\r\n foreach ($b as $key => $value) {\r\n if (isset($a[$key])) {\r\n $a[$key] = self::mergeArrayResult($a[$key], $value);\r\n } else {\r\n if($key === 0) {\r\n $a= array(0 => self::mergeArrayResult($a, $value));\r\n } else {\r\n $a[$key] = $value;\r\n }\r\n }\r\n }\r\n } else {\r\n // one of values is not an array\r\n $a = $b;\r\n }\r\n \r\n return $a;\r\n }", "function mergeArray($a,$b)\n{\n\tforeach($b as $k=>$v)\n\t\t$a[$k]=$v;\n\treturn $a;\n}", "function _safe_array_merge_recursive($array1, $array2) {\n if ($array1 === null) {\n $array1 = array();\n }\n if ($array2 === null) {\n $array2 = array();\n }\n return array_merge_recursive($array1, $array2);\n}", "abstract public function combineWith(array $array);", "function config_merge(array $array1) {\n\t$result = array();\n\tforeach (func_get_args() as $param) {\n\t\tforeach ($param as $key=>$value) {\n\t\t\tif (is_array($value) && array_key_exists($key, $result) && is_array($result[$key])) {\n\t\t\t\t$result[$key] = config_merge($result[$key], $value);\n\t\t\t} else {\n\t\t\t\t$result[$key] = $value;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}", "public static function merge(array $array1, array $array2): array\n {\n if (self::isAssoc($array2)) {\n foreach ($array2 as $key => $value) {\n if (is_array($value)\n && isset($array1[$key])\n && is_array($array1[$key])\n ) {\n $array1[$key] = self::merge($array1[$key], $value);\n } else {\n $array1[$key] = $value;\n }\n }\n } else {\n foreach ($array2 as $value) {\n if (!in_array($value, $array1, TRUE)) {\n $array1[] = $value;\n }\n }\n }\n\n if (func_num_args() > 2) {\n foreach (array_slice(func_get_args(), 2) as $array3) {\n if (self::isAssoc($array3)) {\n foreach ($array3 as $key => $value) {\n if (is_array($value)\n && isset($array1[$key])\n && is_array($array1[$key])\n ) {\n $array1[$key] = self::merge($array1[$key], $value);\n } else {\n $array1[$key] = $value;\n }\n }\n } else {\n foreach ($array3 as $value) {\n if (!in_array($value, $array1, TRUE)) {\n $array1[] = $value;\n }\n }\n }\n }\n }\n\n return $array1;\n }", "abstract public function combineTo(array $array);", "public static function merge( array $a1, array $a2 )\n\t{\n\t\t$result = array();\n\t\tfor ( $i = 0, $total = func_num_args(); $i < $total; $i++ ) {\n\t\t\t// Get the next array\n\t\t\t$arr = func_get_arg( $i );\n\n\t\t\t// Is the array associative?\n\t\t\t$assoc = Arr::isAssoc( $arr );\n\n\t\t\tforeach ( $arr as $key => $val ) {\n\t\t\t\tif ( isset( $result[$key] ) ) {\n\t\t\t\t\tif ( is_array( $val ) AND is_array( $result[$key] ) ) {\n\t\t\t\t\t\tif ( Arr::isAssoc( $val ) ) {\n\t\t\t\t\t\t\t// Associative arrays are merged recursively\n\t\t\t\t\t\t\t$result[$key] = Arr::merge( $result[$key], $val );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// Find the values that are not already present\n\t\t\t\t\t\t\t$diff = array_diff( $val, $result[$key] );\n\n\t\t\t\t\t\t\t// Indexed arrays are merged to prevent duplicates\n\t\t\t\t\t\t\t$result[$key] = array_merge( $result[$key], $diff );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ( $assoc ) {\n\t\t\t\t\t\t\t// Associative values are replaced\n\t\t\t\t\t\t\t$result[$key] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telseif ( !in_array( $val, $result, TRUE ) ) {\n\t\t\t\t\t\t\t// Indexed values are added only if they do not yet exist\n\t\t\t\t\t\t\t$result[] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// New values are added\n\t\t\t\t\t$result[$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function res_array_merge(array &$res1, $res2) {\n\t\tif (!is_array($res1) || empty($res2)) {\n\t\t\tthrow new IllegalArgumentException('res_array_merge requires first param to be an array and second != null. '.\n\t\t\t\t\tStrings::debugStr($res1));\n\t\t}\n\t\tif (!is_array($res2)) {\n\t\t\t$res1[] = $res2;\n\t\t} else {\n\t\t\tforeach ($res2 as $key => &$value) {\n\t\t\t\tif (is_string($key)) {\n\t\t\t\t\tif (is_array($value) && array_key_exists($key, $res1) && is_array($res1[$key])) {\n\t\t\t\t\t\t$this->res_array_merge($res1[$key],$value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$res1[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$res1[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function extend_array()\n\t{\n\t\t$args = func_get_args();\n\t\t$extended = array();\n\n\t\tif ( is_array( $args ) && count( $args ) )\n\t\t{\n\t\t\tforeach ( $args as $array )\n\t\t\t{\n\t\t\t\tif ( ! is_array( $array ) )\tcontinue;\n\t\t\t\t$extended = array_merge( $extended, $array );\n\t\t\t}\n\t\t}\n\n\t\treturn $extended;\n\t}", "protected function merge(array $a, array $b)\n {\n foreach ($b as $key => $value) {\n if (array_key_exists($key, $a)) {\n //if (is_int($key)) {\n // $a[] = $value;\n //} else\n if (is_array($value) && is_array($a[$key])) {\n $a[$key] = $this->merge($a[$key], $value);\n } else {\n $a[$key] = $value;\n }\n } else {\n $a[$key] = $value;\n }\n }\n\n return $a;\n }", "public static function halo_array_merge($array1, $array2 = null, $_ = null)\r\n {\r\n $varArray = func_get_args();\r\n $count = count($varArray);\r\n\r\n for ($index = 0; $index < $count; $index++) {\r\n if (!is_array($varArray[$index])) {\r\n $varArray[$index] = (array)$varArray[$index];\r\n }\r\n }\r\n return call_user_func_array('array_merge', $varArray);\r\n }", "function util_array_merge_overwrite($array1, $array2)\n{\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$array1[$key] = $value ;\n\t}\n\treturn $array1 ;\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 testArraysOperations()\n {\n // Union\n $arr1 = ['a', 'b'];\n $arr2 = ['c', 'd', 'e', 'key' => 'value'];\n //$this->assertEquals(?, $arr1 + $arr2);\n\n // array_merge — Merge one or more arrays\n $arr1 = ['a', 'b', 'key1' => 'value1', 'key2' => 'value2'];\n $arr2 = [1, 'key1' => 'value3', 'key3' => 'value4'];\n //$this->assertEquals(?, array_merge($arr1, $arr2));\n\n // array_replace — Replaces elements from passed arrays into the first array\n $arr1 = ['a', 'b', 'key1' => 'value1', 'key2' => 'value2'];\n $arr2 = [1, 'key1' => 'value3', 'key3' => 'value4'];\n //$this->assertEquals(?, array_replace($arr1, $arr2));\n }", "function unite_arrays($a, $b) {\n if(!$a || !is_array($a)) {\n $a = array();\n }\n\n if($b && is_array($b)) {\n $a = array_merge($a, $b);\n }\n\n return $a;\n}", "public function mergeFrom(array $data);", "function util_array_union($array1, $array2)\n{\n\t$result = $array1;\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$result[$key] = $value ;\n\t}\n\t\n\treturn $result ;\n}", "public static function arrayMergeRecursiveDistinct()\n {\n $arrays = func_get_args();\n $base = array_shift($arrays);\n if(!is_array($base)) $base = empty($base) ? array() : array($base);\n foreach($arrays as $append)\n {\n if(!is_array($append)) $append = array($append);\n foreach($append as $key => $value) {\n if(!array_key_exists($key, $base) and !is_numeric($key))\n {\n $base[$key] = $append[$key];\n continue;\n }\n if(is_array($value) or is_array($base[$key]))\n {\n $base[$key] = self::arrayMergeRecursiveDistinct($base[$key], $append[$key]);\n } else if(is_numeric($key))\n {\n if(!in_array($value, $base)) $base[] = $value;\n } else\n {\n $base[$key] = $value;\n }\n }\n }\n return $base;\n }", "public function testMerge()\n {\n $this->assertTrue(array_merge([1]) === [1]);\n // flush numeric keys\n $this->assertTrue(array_merge([1 => 1]) === [1]);\n // stay assoc keys\n $this->assertTrue(array_merge(['k' => 'v']) === ['k' => 'v']);\n $this->assertTrue(array_merge([1], [2]) === [1, 2]);\n $this->assertTrue(array_merge(['x'], ['y'], ['z']) === ['x', 'y', 'z']);\n // flush numeric keys\n $this->assertTrue(\n array_merge([1 => 'a'], [2 => 'b'], [3 => 'c']) === ['a', 'b', 'c']\n );\n\n // on double key - use last pair key-value\n $this->assertTrue(\n array_merge(['a' => 1], ['a' => 3], ['a' => 2]) === ['a' => 2]\n );\n\n // stay first key sequence\n $this->assertTrue(\n array_merge([1, 2, 3, 'a' => 4], [1, 2, 7, 'b' => 8], ['a' => 'x', 'b' => 'y']) === [1, 2, 3, 'a' => 'x', 1, 2, 7, 'b' => 'y']\n );\n }", "function array_dot_merge(array $array, array $patch) {\n\t$final = $array;\n\tforeach($patch as $k => $v) {\n\t\t$final = array_dot_set($final, $k, $v);\n\t}\n\treturn $final;\n}", "protected static function smart_array_merge ($array1, $array2) {\n\t\tif (isset($array1['class'], $array2['class'])) {\n\t\t\t$array1['class'] .= \" $array2[class]\";\n\t\t\tunset($array2['class']);\n\t\t}\n\t\tif (isset($array1['style'], $array2['style'])) {\n\t\t\t$array1['style'] = trim($array1['style'], ';').\";$array2[style]\";\n\t\t\tunset($array2['style']);\n\t\t}\n\t\treturn array_merge($array1, $array2);\n\t}", "public static function merge_arrays(array $a1, array $a2) {\n $args = func_get_args();\n if ( count($args) > 2 ){\n for ( $i = count($args) - 1; $i > 1; $i-- ){\n $args[$i-1] = self::merge_arrays($args[$i-1], $args[$i]);\n }\n $a2 = $args[1];\n }\n if ( self::is_assoc($a1) && self::is_assoc($a2) ){\n $keys = array_unique(array_merge(array_keys($a1), array_keys($a2)));\n $r = [];\n foreach ( $keys as $k ) {\n if ( !array_key_exists($k, $a1) && !array_key_exists($k, $a2) ){\n continue;\n }\n else if ( !array_key_exists($k, $a2) ){\n $r[$k] = $a1[$k];\n }\n else if ( !array_key_exists($k, $a1) || !is_array($a2[$k]) || !is_array($a1[$k]) || is_numeric(key($a2[$k])) ){\n $r[$k] = $a2[$k];\n }\n else{\n $r[$k] = self::merge_arrays($a1[$k], $a2[$k]);\n }\n }\n }\n else{\n $r = array_merge($a1, $a2);\n }\n return $r;\n }", "function array_merge_recursive_overrule($arr0,$arr1,$notAddKeys=0,$includeEmtpyValues=true) {\n\t\treset($arr1);\n\t\twhile(list($key,$val) = each($arr1)) {\n\t\t\tif(is_array($arr0[$key])) {\n\t\t\t\tif (is_array($arr1[$key]))\t{\n\t\t\t\t\t$arr0[$key] = tx_kbshop_misc::array_merge_recursive_overrule($arr0[$key],$arr1[$key],$notAddKeys);\n\t\t\t\t} else\t{\n\t\t\t\t\tif ($notAddKeys) {\n\t\t\t\t\t\tif (isset($arr0[$key])) {\n\t\t\t\t\t\t\tif ($includeEmtpyValues OR $val) {\n\t\t\t\t\t\t\t\t$arr0[$key] = $val;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($includeEmtpyValues OR $val) {\n\t\t\t\t\t\t\t$arr0[$key] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($notAddKeys) {\n\t\t\t\t\tif (isset($arr0[$key])) {\n\t\t\t\t\t\tif ($includeEmtpyValues OR $val) {\n\t\t\t\t\t\t\t$arr0[$key] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($includeEmtpyValues OR $val) {\n\t\t\t\t\t\t$arr0[$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treset($arr0);\n\t\treturn $arr0;\n\t}", "public static function merge(array $a, array $b)\n {\n foreach ($b as $key => $value) {\n if (! isset($a[$key]) && ! array_key_exists($key, $a)) {\n $a[$key] = $value;\n continue;\n }\n\n if (null === $value && array_key_exists($key, $a)) {\n // Leave as-is if value from $b is null\n continue;\n }\n\n if (is_int($key)) {\n $a[] = $value;\n continue;\n }\n\n if (is_array($value) && is_array($a[$key])) {\n $a[$key] = static::merge($a[$key], $value);\n continue;\n }\n\n $a[$key] = $value;\n }\n\n return $a;\n }", "function InPlaceCache_mergeTo(&$arrayDest, &$arraySrc)\r\n{\r\n\tif(is_array($arraySrc))\r\n\t\tforeach($arraySrc as $k => $v)\r\n\t\t{\r\n\t\t\tif(is_array($v))\r\n\t\t\t\tInPlaceCache_mergeTo($arrayDest[$k],$v);\r\n\t\t\telse $arrayDest[$k] = $v;\r\n\t\t}\r\n}", "public function customArrayMerge($source, & $destination) {\n if (is_array($source) && (is_array($destination) || is_object($destination))) {\n foreach ($source as $key => $item) {\n $destination[\"{$key}\"] = $item;\n }\n }\n }", "private function merge(array $a, array $b): array\n\t{\n\t\tforeach ($b as $key => $value)\n\t\t{\n\t\t\t$a[$key] = $value;\n\t\t}\n\n\t\treturn $a;\n\t}", "function w3_array_union_recursive($array1,$array2)\n {\n $retval=$array1+$array2;\n foreach($array1 as $key=>$value)\n {\n if(is_array($array1[$key]) && is_array($array2[$key]))\n $retval[$key]=w3_array_union_recursive($array1[$key],$array2[$key]);\n }\n return $retval;\n }", "function array_push_ex(array &$arr1,$arr2) {\n foreach ($arr2 as $key => $value) {\n $arr2[$key] = ($value);\n }\n array_push($arr1,$arr2);\n}", "public static function mergeArrays($arr1, $arr2) {\n $keys = array_keys($arr2);\n foreach ($keys as $key) {\n if (isset($arr1[$key]) && is_array($arr1[$key]) && is_array($arr2[$key])) {\n $arr1[$key] = self::mergeArrays($arr1[$key], $arr2[$key]);\n } else {\n $arr1[$key] = $arr2[$key];\n }\n }\n return $arr1;\n }", "function array_extend_distinct(array $arrays) {\n $merged = array();\n\n foreach (func_get_args() as $array) {\n foreach ($array as $key => $value) {\n if (is_array($value) &&\n array_has($merged, $key) &&\n is_array($merged[$key])\n ) {\n if (array_is_associative($value) && array_is_associative($merged[$key])) {\n $merged[$key] = array_extend_distinct($merged[$key], $value);\n\n continue;\n }\n }\n\n $merged[$key] = $value;\n }\n }\n\n return $merged;\n }", "public function merge(/* $items1 [, $items2...$itemsN] */);", "public function arrayMergeKeepsIndexesAfterMerge() {}", "function array_merge_recursive_distinct ()\n\t{\n\t\t$arrays = func_get_args();\n\t\t$base = array_shift($arrays);\n\t\tif(!is_array($base)) $base = empty($base) ? array() : array($base);\n\t\tforeach($arrays as $append)\n\t\t{\n\t\t\tif(!is_array($append)) $append = array($append);\n\t\t\tforeach($append as $key => $value)\n\t\t\t{\n\t\t\t\tif(!array_key_exists($key, $base) and !is_numeric($key))\n\t\t\t\t{\n\t\t\t\t\t$base[$key] = $append[$key];\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif(is_array($value) or is_array($base[$key]))\n\t\t\t\t{\n\t\t\t\t\t$base[$key] = array_merge_recursive_distinct($base[$key], $append[$key]);\n\t\t\t\t}\n\t\t\t\telse if(is_numeric($key))\n\t\t\t\t{\n\t\t\t\t\tif(!in_array($value, $base)) $base[] = $value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$base[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $base;\n\t}", "protected function mergeArrays($Arr1, $Arr2)\r\n {\r\n foreach($Arr2 as $key => $Value)\r\n {\r\n if(array_key_exists($key, $Arr1) && is_array($Value))\r\n $Arr1[$key] = $this->MergeArrays($Arr1[$key], $Arr2[$key]);\r\n\r\n else\r\n $Arr1[$key] = $Value;\r\n\r\n }\r\n\r\n return $Arr1;\r\n\r\n }", "public static function merge(&$array_primary, $array_secondary) {\n $array_primary = array_merge($array_primary, $array_secondary);\n }", "public function merge();", "public static function array_merge_recursive_overwrite($Arr1, $Arr2) {\n foreach($Arr2 as $key => $Value) {\n if(array_key_exists($key, $Arr1) && is_array($Value)) {\n $Arr1[$key] = Arr::array_merge_recursive_overwrite($Arr1[$key], $Arr2[$key]);\n } else {\n $Arr1[$key] = $Value;\n }\n }\n return $Arr1;\n }", "public function mergeArrays($a1, $a2) {\r\n $risultato = $a1;\r\n\r\n foreach ($a2 as $riga) {\r\n array_push($risultato, $riga);\r\n }\r\n return $risultato;\r\n }", "function arrayReplace()\n {\n $a = func_get_args();\n // Do not make this reference,\n // it helpful if you just pass pure array without assign.\n $new = $a[0];\n if (!isArray($new)) {\n return triggerJson(\n '\\PMVC\\arrayReplace Param1 should be array type.',\n ['Array' => $new]\n );\n }\n for ($i = 1, $j = count($a); $i < $j; $i++) {\n // This is for handle empty array not empty value\n if (is_null($a[$i])) {\n continue;\n }\n if (!isArray($a[$i])) {\n $new[] = $a[$i];\n } else {\n foreach ($a[$i] as $k => $v) {\n $new[$k] = $v;\n }\n }\n }\n\n return $new;\n }", "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 }", "abstract public function mergeTo(array $array, $recursively = false);", "abstract public function mergeWith(array $array, $recursively = false);", "function mergeRecursive($paArray1, $paArray2)\n\t{\n\t if (!is_array($paArray1) or !is_array($paArray2)) { return $paArray2; }\n\t foreach ($paArray2 AS $sKey2 => $sValue2)\n\t {\n\t $paArray1[$sKey2] = cmfcArray::mergeRecursive(@$paArray1[$sKey2], $sValue2);\n\t }\n\t return $paArray1;\n\t}", "public function concatArrays($array1, $array2, ...$arrays): static;", "function array_merge_recursive_distinct() {\n $arrays = func_get_args();\n $base = array_shift($arrays);\n if (!is_array($base))\n $base = empty($base)? array(): array($base);\n foreach ($arrays as $append) {\n if (!is_array($append)) $append = array($append);\n foreach ($append as $key => $value) {\n if(!array_key_exists($key, $base) and !is_numeric($key)) {\n $base[$key] = $append[$key];\n continue;\n }\n if (is_array($value) or is_array($base[$key]))\n $base[$key] = array_merge_recursive_distinct($base[$key], $append[$key]);\n else if (is_numeric($key))\n if(!in_array($value, $base)) $base[] = $value;\n else\n $base[$key] = $value;\n }\n }\n return $base;\n}", "public function arrayMergeRecursive($one, $two)\n {\n foreach($two as $key => $value)\n {\n if(array_key_exists($key, $one) && is_array($value)) {\n $one[$key] = $this->arrayMergeRecursive($one[$key], $two[$key]);\n } else {\n $one[$key] = $value;\n }\n }\n\n return $one;\n }", "public static function mergeConfig(): array\n {\n $args = \\func_get_args();\n $res = array_shift($args) ?: [];\n foreach ($args as $items) {\n if (!\\is_array($items)) {\n continue;\n }\n foreach ($items as $k => $v) {\n if ($v instanceof \\yii\\helpers\\UnsetArrayValue || $v instanceof \\Yiisoft\\Arrays\\UnsetArrayValue) {\n unset($res[$k]);\n } elseif ($v instanceof \\yii\\helpers\\ReplaceArrayValue || $v instanceof \\Yiisoft\\Arrays\\ReplaceArrayValue) {\n $res[$k] = $v->value;\n } elseif (\\is_int($k)) {\n /// XXX skip repeated values\n if (\\in_array($v, $res, true)) {\n continue;\n }\n if (isset($res[$k])) {\n $res[] = $v;\n } else {\n $res[$k] = $v;\n }\n } elseif (\\is_array($v) && isset($res[$k]) && \\is_array($res[$k])) {\n $res[$k] = self::mergeConfig($res[$k], $v);\n } else {\n $res[$k] = $v;\n }\n }\n }\n\n return $res;\n }", "function acf_merge_attributes($array1, $array2)\n{\n}", "public static function array_merge_recursive(array $array)\n\t{\n\t\t$args = func_get_args();\n\t\t$num = func_num_args();\n\t\tif ($num == 1)\n\t\t\treturn $array;\n\t\t\n\t\t$merged = $array;\n\t\t\n\t\tfor ($i = 1; $i < $num; $i++) {\n\t\t\t$merge = $args[$i];\n\t\t\tforeach ($merge as $key => $val) {\n\t\t\t\tif (is_array($val) && isset($merged[$key]) && is_array($merged[$key])) {\n\t\t\t\t\t$merged[$key] = static::array_merge_recursive($merged[$key], $val);\n\t\t\t\t} else {\n\t\t\t\t\t$merged[$key] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $merged;\n\t\t\n\t}", "public function toMergedArray(): array;", "function array_replace_recursive($array, $array1) {\n $args = func_get_args();\n $array = $args[0];\n if (!is_array($array)) {\n return $array;\n }\n for ($i = 1; $i < count($args); $i++) {\n if (is_array($args[$i])) {\n $array = _array_replace_recursive_recurse($array, $args[$i]);\n }\n }\n return $array;\n }", "function _add_array($array = array(), $keys, $value)\n{\n\t// while fn needs to go deeper into array\n\tif(count($keys) > 1)\n\t{\n\t\t// get current key\n\t\treset($keys);\n\t\t$key = $keys[key($keys)];\n\t\t// remove current key from keys\n\t\tunset($keys[key($keys)]);\n\t\t// if key exists merge\n\t\tif( isset($array[$key]) )\n\t\t{\n\t\t\t$array[$key] = _add_array($array[$key], $keys, $value);\n\t\t}\n\t\t// if key does not exists add\n\t\telse\n\t\t{\n\t\t\t$array[$key] = false;\n\t\t\t$array[$key] = _add_array($array[$key], $keys, $value);\t\n\t\t}\n\t}\n\t// if right depth in array is reached\n\telse\n\t{\n\t\t// get current key\n\t\t$key = $keys[key($keys)];\n\t\t// if key exists merge\n\t\tif( isset($array[$key]) && is_array($array[$key]) )\n\t\t{\n\t\t\t$array[$key] = array_merge($array[$key], (array) $value);\t\t\n\t\t}\n\t\t// if key does not exists add\n\t\telse\n\t\t{\n\t\t\t$array[$key] = $value;\t\t\t\n\t\t}\n\t}\n\t// return new array\n\treturn $array;\n}", "public static function array_merge__save_numeric_keys__recursive($arr1, $arr2)\n\t{\n\t\tforeach($arr2 as $key => $val){\n\t\t\t\n\t\t\t// Array | array => array\n\t\t\tif(isset($arr1[$key]) && is_array($arr1[$key]) && is_array($val)){\n\t\t\t\t$arr1[$key] = self::array_merge__save_numeric_keys__recursive($arr1[$key], $val);\n\t\t\t\t\n\t\t\t// Scalar | array => array\n\t\t\t}elseif(isset($arr1[$key]) && !is_array($arr1[$key]) && is_array($val)){\n\t\t\t\t$tmp = $arr1[$key] =\n\t\t\t\t$arr1[$key] = $val;\n\t\t\t\t$arr1[$key][] = $tmp;\n\t\t\t\t\n\t\t\t// array | scalar => array\n\t\t\t}elseif(isset($arr1[$key]) && is_array($arr1[$key]) && !is_array($val)){\n\t\t\t\t$arr1[$key][] = $val;\n\t\t\t\t\n\t\t\t// scalar | scalar => scalar\n\t\t\t}else{\n\t\t\t\t$arr1[$key] = $val;\n\t\t\t}\n\t\t}\n\t\treturn $arr1;\n\t}", "function give_import_core_settings_merge_data( $json_to_array, $type, $host_give_options ) {\n\tif ( 'merge' === $type ) {\n\t\t$json_to_array_merge = array_merge( $host_give_options, $json_to_array );\n\t\t$json_to_array = $json_to_array_merge;\n\t}\n\n\treturn $json_to_array;\n}", "public function testMerge()\n {\n $merges = func_get_args();\n $test = array_shift($merges);\n $check = $test;\n\n $data = new ArrayObject($test);\n\n $this->assertFalse($data->isDirty());\n\n foreach ($merges as $merge) {\n $check = array_merge($check, $merge);\n $data->merge($merge);\n $this->assertTrue($data->isDirty());\n $this->assertEquals($data->getArrayCopy(), $check);\n }\n }", "function array_merge_recursive_distinct(array &$array1, array &$array2){\n $merged = $array1;\n foreach($array2 as $key => &$value){\n if(is_array($value) && isset ($merged[$key]) && is_array($merged[$key])){\n $merged[$key] = array_merge_recursive_distinct($merged[$key], $value);}\n else{\n $merged[$key] = $value;}}\n return $merged;}", "function array_insert(array $array, $before_key, array $array2) {\n if (!\\array_key_exists($before_key, $array))\n \\trigger_error(\"The key '$before_key' does not exist in \\$array.\", \\E_USER_ERROR);\n $new_array = array();\n foreach ($array as $key => $value) {\n if ($key === $before_key) {\n foreach ($array2 as $key2 => $value2) {\n if (!\\array_key_exists($key2, $new_array))\n $new_array[$key2] = $value2;\n }\n $before_key = null;\n }\n if (!\\array_key_exists($key, $new_array))\n $new_array[$key] = $value;\n }\n return $new_array;\n}", "public function merge($array=array())\n {\n $class = $this->instance();\n return new $class(array_merge($this->_data, self::convert($array)->toArray()));\n }", "function _array_kmerge($arr1,$arr2) {\n\tif(!is_array($arr1)) $arr1 = array();\n\tif(!is_array($arr2)) $arr2 = array();\n\n\t$keys = array_merge(array_keys($arr1),array_keys($arr2));\n\t$vals = array_merge(array_values($arr1),array_values($arr2));\n\t$ret = array();\n\tforeach($keys as $key) {\n\t\tlist($unused,$val) = each($vals);\n\t\tif (isset($ret[$key]) and is_int($key)) $ret[] = $val; else $ret[$key] = $val;\n\t}\n\treturn $ret;\n\t}", "function combineArrays($arrAlph,$arrNums)\r\n\t{\r\n\t $result = []; //declare an empty array\r\n\t for($i = 0; $i < count($arrNums); $i++)\r\n\t {\r\n\t\tarray_push($result,$arrAlph[$i]);\r\n\t\tarray_push($result,$arrNums[$i]);\r\n\t }\r\n\t return $result;\r\n\t}", "public static function arrayMergeRecursive($arrayA, $arrayB) {\n\t\t// merge arrays if both variables are arrays\n\t\tif (is_array($arrayA) && is_array($arrayB)) {\n\t\t\t// loop through each right array's entry and merge it into $arrayA\n\t\t\tforeach ($arrayB as $key => $value) {\n\t\t\t\tif (isset($arrayA[$key])) {\n\t\t\t\t\t$arrayA[$key] = self::arrayMergeRecursive($arrayA[$key], $value);\n\t\t\t\t} else {\n\t\t\t\t\tif ($key === 0) {\n\t\t\t\t\t\t$arrayA= array(0 => self::arrayMergeRecursive($arrayA, $value));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arrayA[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// one of values is not an array\n\t\t\t$arrayA = $arrayB;\n\t\t}\n\n\t\treturn $arrayA;\n\t}", "function _handle_array_var_append($key, $val, &$vars)\n{\n $val2 = mixed();\n\n foreach ($val as $key2 => $val2) {\n if (!is_string($key2)) {\n $key2 = strval($key2);\n }\n\n if (is_array($val2)) {\n _handle_array_var_append($key . '[' . $key2 . ']', $val2, $vars);\n } else {\n if (get_magic_quotes_gpc()) {\n $val2 = stripslashes($val2);\n }\n\n $vars[$key . '[' . $key2 . ']'] = $val2;\n }\n }\n}", "function atk_array_merge_keys()\n{\n\t$args = func_get_args();\n\t$result = array();\n\tforeach($args as $array)\n\t{\n\t\tforeach($array as $key=>$value)\n\t\t{\n\t\t\t$result[$key] = $value;\n\t\t}\n\t}\n\treturn $result;\n}", "protected function merge(array $base, array $subject): array\n {\n foreach ($subject as $k => $v) {\n if (is_numeric($k)) {\n $base[] = $v;\n } elseif (array_key_exists($k, $base) && (is_array($v) || is_array($base[$k]))) {\n $base[$k] = $this->merge((array) $base[$k], (array) $v);\n } else {\n $base[$k] = $v;\n }\n }\n\n return $base;\n }", "public function merge() {}", "protected function _mergeConfig(array $array1, array $array2) {\n\t\t$merged = $array1;\n\t\tforeach ($array2 as $key => $value) {\n\t\t\tif (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {\n\t\t\t\t$merged[$key] = $this->_mergeConfig($merged[$key], $value);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$merged[$key] = $value;\n\t\t}\n\n\t\treturn $merged;\n\t}", "public function merge(array $messages);", "private static function arrayMerge(array $self, array $array)\n {\n foreach ($self as $val) {\n $s[$val] = null;\n }\n\n return array_merge($s, $array);\n }", "function array_replace_recursive($array, $array1)\r\n\t{\r\n\t\t$args = func_get_args();\r\n\t\t$array = $args[0];\r\n\t\tif (!is_array($array))\r\n\t\t{\r\n\t\t\treturn $array;\r\n\t\t}\r\n\t\tfor ($i = 1; $i < count($args); $i++)\r\n\t\t{\r\n\t\t\tif (is_array($args[$i]))\r\n\t\t\t{\r\n\t\t\t\t$array = recurse($array, $args[$i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $array;\r\n\t}", "public static function mergeDeep(&$array1, &$array2)\n {\n $merged = $array1;\n\n foreach ($array2 as $key => &$value) {\n if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) {\n $merged[$key] = self::mergeDeep($merged[$key], $value);\n } else if (is_numeric($key)) {\n if (!in_array($value, $merged))\n $merged[] = $value;\n } else\n $merged[$key] = $value;\n }\n\n return $merged;\n }", "function array_replace_recursive($array, $array1)\n\t{\n\t\t$args = func_get_args();\n\t\t$array = $args[0];\n\t\tif (!is_array($array))\n\t\t{\n\t\t return $array;\n\t\t}\n\t\tfor ($i = 1; $i < count($args); $i++)\n\t\t{\n\t\t if (is_array($args[$i]))\n\t\t {\n\t\t\t$array = recurse($array, $args[$i]);\n\t\t }\n\t\t}\n\t\treturn $array;\n\t}", "public function merge($arr = [])\n {\n $newData = array_merge($this->toArray(), $arr);\n return $this->reset($newData);\n }", "function array_replace_recursive($array, $array1) {\n\t\t$args = func_get_args();\n\t\t$array = $args[0];\n\t\tif (!is_array($array)) {\n\t\t\treturn $array;\n\t\t}\n\t\tfor ($i = 1; $i < count($args); $i++) {\n\t\t\tif (is_array($args[$i])) {\n\t\t\t\t$array = recurse($array, $args[$i]);\n\t\t\t}\n\t\t}\n\t\treturn $array;\n\t}", "function mergeArrays($current, $new) {\n\t\t//array_merge() doesn't work for some reason\n\n\t\t$array = array();\n\t\tforeach ($new as $id) {\n\t\t\t$array[$id] = $id;\n\t\t}\n\t\tforeach ($current as $id) {\n\t\t\t$array[$id] = $id;\n\t\t}\n\n\t\t$array = array_filter($array, 'strlen');\n\t\t$array = array_filter($array);\n\t\treturn $array;\n\n\t}", "function concatAll($array) {\n\t$results = array();\n\tforeach ($array as $item) {\n\t\t// Merge arrays...\n\t\tif (is_array($item)) {\n\t\t\t$results = array_merge($results, $item);\n\t\t\tcontinue;\n\t\t}\n\t\t// ...push anything else.\n\t\t$results[] = $item;\n\t}\n\treturn $results;\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 }", "function appendArray($a,$b,$index)\n \t{\n \t\tif(empty($a))\n \t\t\treturn $b;\n \t\tif(empty($b))\n \t\t\treturn $a;\n \t\t\t\n \t\t$length_a=count($a);\n \t\t$length_b=count($b);\n\t\t\n\t\tfor($i=0;$i<$length_b;$i++)\n\t\t{\n\t\t\tfor($j=0;$j<$length_a;$j++)\n\t\t\t{\n\t\t\t\tif($b[$i][$index]==$a[$j][$index])\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\n\t\t\t}\t\n\t\t\tif($j<=$length_a)\n\t\t\t\t$a[$length_a+$i]=$b[$i];\n \t}\n \treturn $a;\n \t}", "protected function _safeAssociativeArrayMerge(array $in_associative_array_1, array $in_associative_array_2) {\r\n $result = $in_associative_array_1;\r\n foreach ($in_associative_array_2 as $_key => $_value) {\r\n if (array_key_exists($_key, $result)) {\r\n if ($result[$_key] !== $_value) {\r\n trigger_error(\r\n sprintf('Merging two associative arrays with identical key \"%s\" (with different values).', $_key),\r\n E_USER_WARNING\r\n );\r\n } else {\r\n trigger_error(\r\n sprintf('Merging two associative arrays with identical key \"%s\" (with same values).', $_key),\r\n E_USER_WARNING\r\n );\r\n }\r\n }\r\n\r\n $result[$_key] = $_value;\r\n }\r\n return $result;\r\n }", "protected function mergeArraysPreferNonNullValues(array $arr1, array $arr2): array\n {\n $resultArray = array_diff_key($arr1, $arr2) + array_diff_key($arr2, $arr1);\n $commonArrayKeys = array_keys(array_intersect_key($arr1, $arr2));\n foreach ($commonArrayKeys as $key) {\n $resultArray[$key] = $arr2[$key] ?: $arr1[$key];\n }\n\n return $resultArray;\n }", "public function mergeQuery(array $queryToBeAppended);" ]
[ "0.76868737", "0.76136935", "0.748844", "0.71584415", "0.71053654", "0.7054332", "0.7027641", "0.698479", "0.6980889", "0.6904085", "0.6892235", "0.68613726", "0.684881", "0.68436575", "0.6810824", "0.67946887", "0.67337453", "0.67173415", "0.6695104", "0.66826546", "0.6670576", "0.6635056", "0.66319823", "0.6612734", "0.65950936", "0.6569477", "0.6561236", "0.65561086", "0.65546584", "0.65480125", "0.6529259", "0.64768726", "0.64522505", "0.6423628", "0.64125365", "0.6395529", "0.63839173", "0.63828975", "0.63802046", "0.6373138", "0.6366977", "0.63387895", "0.6312581", "0.6310289", "0.6278357", "0.6249572", "0.62431735", "0.6151131", "0.61417353", "0.61296725", "0.61291635", "0.61227584", "0.60948825", "0.60808516", "0.6076505", "0.60637563", "0.60490507", "0.6041228", "0.5991137", "0.59902024", "0.5984541", "0.5981008", "0.5974095", "0.5967057", "0.5961948", "0.59431195", "0.5917843", "0.5916659", "0.5909719", "0.5887924", "0.58879054", "0.5880658", "0.5878856", "0.5865963", "0.58361316", "0.5831747", "0.5830702", "0.5824736", "0.58232003", "0.581596", "0.58051676", "0.5794785", "0.577744", "0.57768315", "0.5767332", "0.5763929", "0.57637495", "0.57612395", "0.57531816", "0.5740611", "0.5735141", "0.57217544", "0.5717299", "0.5704999", "0.5671902", "0.56704426", "0.56587267", "0.5655128", "0.5608864", "0.55893004" ]
0.5714421
93
Create a new job instance.
public function __construct() { infolog('[BulkInventory] __construct at '. now()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "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}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n {}", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function create()\n {\n //TODO\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6920272", "0.6905722", "0.6905722", "0.6869542", "0.6808916", "0.65271425", "0.65184414", "0.64918077", "0.6489135", "0.6468623", "0.6425879", "0.64058304", "0.63938236", "0.63899404", "0.63753885", "0.6304669", "0.6256802", "0.6241474", "0.620155", "0.61789167", "0.60741454", "0.60695714", "0.6047274", "0.60462874", "0.6028435", "0.6027225", "0.6021894", "0.60214204", "0.59231514", "0.58802027", "0.5874528", "0.58576655", "0.58098435", "0.5805053", "0.58005697", "0.5789109", "0.57851434", "0.57767034", "0.5775661", "0.5755982", "0.5702295", "0.5683395", "0.5683395", "0.5683395", "0.5683376", "0.5679739", "0.5678496", "0.5659406", "0.56529284", "0.56470996", "0.5634536", "0.5632702", "0.5632702", "0.5628215", "0.5625956", "0.5621957", "0.56141514", "0.56048644", "0.5604791", "0.5601149", "0.5601067", "0.5599652", "0.5595376", "0.55932534", "0.55932534", "0.55932015", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55362236", "0.5534658", "0.5531583", "0.55224913", "0.5522197", "0.5517534", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.5514842", "0.549955", "0.5497938", "0.54876786", "0.54876786", "0.54876786" ]
0.0
-1
Pull down stock that's changed and write it to a file.
public function writeEbayMipFile() { $result=false; try{ infolog('[BulkInventory.writeEbayMipFile] Preparing update file... '. now()); //todo!!!! ISSUE WITH THIS QUERY: CHECK IT! $all=Product::join("ebay_details AS ed","ed.product_id","=","products.id")->whereNotNull("ed.listingid")->whereRaw("(products.updated_at > ed.synced_at OR ed.synced_at IS NULL)")->get(); $counter=0; if(count($all)){ $filename="inventory_".date("YmdHis").".csv"; $this->ifile=public_path('files/ebay/'.$filename); if($fp = fopen($this->ifile, 'w')){ fputcsv($fp, ["SKU","Channel ID","List Price","Total Ship to Home Quantity"]); foreach($all as $product){ fputcsv($fp, [$product->sku,"EBAY_AU",$product->listing_price,$product->qty]); $counter++; } fclose($fp); } }else{ infolog('[BulkInventory.writeEbayMipFile] ERROR no items found as a result of the query at '. now()); } if($counter>0){ infolog('[BulkInventory.writeEbayMipFile] SUCCESSFULLY UPDATED '.$counter.' ITEMS at '. now()); $result=true; } }catch(\Exception $e) { infolog('[BulkInventory.writeEbayMipFile] ERROR updating eBay/MIP ('.$e->getMessage().') at '. now()); } return($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function commitChanges() {\r\n\t\tglobal $file;\r\n\t\tglobal $expenses;\r\n\r\n\t\tsortExpensesDate();\r\n\t\trenumber(&$expenses);\r\n\r\n\t\t$xmlString = toXML();\r\n\r\n\t\t$fp = fopen($file.\".bak\", \"w\");\r\n\t\tflock($fp, LOCK_EX);\r\n\t\tfputs($fp, $xmlString);\r\n\t\tflock($fp, LOCK_UN);\r\n\t\tfclose($fp);\r\n\r\n\t\tswapFiles();\r\n\t}", "private function exportStoreStock()\n {\n if (!is_numeric($this->getArg(self::EXPORT_STORE_STOCK))) {\n echo $this->usageHelp();\n return;\n }\n\n $file = Mage::getModel('factfinder/export_type_stock')->saveExport($this->getArg(self::EXPORT_STORE_STOCK));\n printf(\"Successfully generated stock export to: %s\\n\", $file);\n }", "public function extractHistorical($document, $stockID) {\n\t\t\t\n\t\t\t//used to ignore first line of CSV file\n\t\t\t$isFirst = true;\n\t\t\t//parse CSV file into lines\n\t\t\t$sourceLines = str_getcsv($document, \"\\n\");\n\t\t\t//connect to database\n\t\t\t$this->dbConnection->connect();\n\t\t\t//prepare insertion statement\n\t\t\t$this->dbConnection->prepare($this->query->insert_historical());\n\t\t\t//for each line\n\t\t\tforeach($sourceLines as $line) {\n\t\t\t\t//parse contents of each line into an array\n\t\t\t\t$contents = str_getcsv( $line );\n\t\t\t\t\n\t\t\t\t//skip first line\n\t\t\t\tif ($isFirst) {\n\t\t\t\t\t$isFirst = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//bind necessary values to SQL statement\n\t\t\t\t$this->dbConnection->bind(1, $stockID);\n\t\t\t\t$this->dbConnection->bind(2, $contents[0]);\n\t\t\t\t$this->dbConnection->bind(3, $contents[1]);\n\t\t\t\t$this->dbConnection->bind(4, $contents[2]);\n\t\t\t\t$this->dbConnection->bind(5, $contents[3]);\n\t\t\t\t$this->dbConnection->bind(6, $contents[4]);\n\t\t\t\t$this->dbConnection->bind(7, $contents[5]);\n\t\t\t\t$this->dbConnection->bind(8, $contents[6]);\n\t\t\t\t\n\t\t\t\t//execute query\n\t\t\t\t$this->dbConnection->execute();\n\t\t\t}\n\t\t\t//disconnect from databases\n\t\t\t$this->dbConnection->disconnect();\n\t\t}", "function sellPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price, $unixTime, $threshold) {\n\t$filename = $moduleName. '-';\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . $folioEntry['pairSymbol']. '-emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\t$history = file_get_contents($filepath);\n\t$history = json_decode($history, true);\n\n\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\tif (!isset($history)) {\n\t\tprint ('zero history');\n\t}\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n\t// Sell if higher than threshold\n\t// || $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow']\n\n\tif ($folioEntry['dumpable']==0 || $ohlcOld[$lastKey]['close']>=$emaSet[$lastKey]['priceEMASlow']) {\n\t\t$devPercent = $currentPercent - $folioEntry['targetPercent'];\n\t\t$dev = round($devPercent*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t$toSell = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\n\t\t$soldValue = $toSell*$price;\n\t\t$fee = 0.004*$soldValue;\n\t\t$soldValue = $soldValue- $fee; // fee and drift\n\n\t\t//$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\t\t//$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t// History Stuff\n\t\t$originalValue = $toSell*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$toSell,\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t// Main Stuff\n\n\t\t$newAveragePrice = round(($main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toSell * $price)/($main[$mainEntry]['quantity'] + $toSell),5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] -=$toSell;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold');\n\t}\n\n\t// Sell all aka dump. Only dumpable ones apply.\n\n\tif ($folioEntry['dumpable']==1 && $ohlcOld[$lastKey]['close']<$emaSet[$lastKey]['priceEMASlow'] && $devPercent>$threshold) {\n\n\t\t$soldValue = $main[$mainEntry]['quantity']*$price;\n\t\t$soldValue -= 0.004*$soldValue; // fee and drift\n\n\t\t$fee = 0.004*$soldValue;\n\n\t\t// History Stuff\n\t\t$originalValue = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'];\n\t\t$profitPercent = round(($soldValue-$originalValue)/$originalValue*100, 2, PHP_ROUND_HALF_UP);\n\n\t\t$profitValue = $soldValue-$originalValue;\n\n\t\t$history['ledger'][] = array (\n\t\t\t'time'=>$unixTime,\n\t\t\t'volume'=>$main[$mainEntry]['quantity'],\n\t\t\t'value'=>$soldValue,\n\t\t\t'fee'=>$fee,\n\t\t\t'profitPercent'=>$profitPercent,\n\t\t\t'profitValue'=>$profitValue,\n\t\t);\n\n\t\t$history['totals']['profit'] += $profitPercent;\n\t\t$history['totals']['quoteProfit'] += $profitValue;\n\t\t$history['totals']['totalDiff'] += $fee;\n\t\t$history['totals']['count'] += 1;\n\n\t\tif ($profitValue>0) {\n\t\t\t$history['totals']['positive'] += 1;\n\t\t\t$history['totals']['posPercent'] = round($history['totals']['positive']/$history['totals']['count']*100, 2, PHP_ROUND_HALF_UP);\n\t\t}\n\n\t\t$main[$mainEntry]['quantity'] = 0;\n\t\t$main[$mainEntry]['averageBuyPrice'] = 0;\n\n\t\t$main[$mainLast]['quantity'] += $soldValue;\n\n\t\tprint ($folioEntry['pairSymbol'].' sold (dump)');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\t$filepath = '' . $moduleName. '-'. $folioEntry['pairSymbol'].'-' . 'history.json';\n\tfile_put_contents($filepath, json_encode($history));\n}", "public function get_branch_stock_correction() {\n $branch_stock_list = $this->Branch_stock_Model->get_branch_stock();\n $date = get_current_date();\n if (!empty($branch_stock_list)) {\n $arr = array();\n foreach ($branch_stock_list as $branch_stock) {\n if ($branch_stock->product_id == 103) {\n $branchwise_product_store_from_previous_date_by_product_id_branch_id = $this->db->query(\"SELECT * FROM branchwise_product_store WHERE product_store_date <= '$date' AND product_id='$branch_stock->product_id' AND branch_id='$branch_stock->branch_id' ORDER BY id DESC LIMIT 1\")->row();\n $branch_stock_data = array(\n 'id' => $branch_stock->id,\n 'branchwise_product_store' => $branchwise_product_store_from_previous_date_by_product_id_branch_id->id,\n 'product_id' => $branchwise_product_store_from_previous_date_by_product_id_branch_id->product_id,\n 'branch_id' => $branchwise_product_store_from_previous_date_by_product_id_branch_id->branch_id,\n 'stock' => (int) $branchwise_product_store_from_previous_date_by_product_id_branch_id->closing_stock,\n );\n array_push($arr, $branch_stock_data);\n// $this->db->where('id', $branch_stock_data['id']);\n// $this->Branch_stock_Model->db->update('branch_stock', $branch_stock_data);\n }\n }\n echo 'branch Stock';\n echo '<br>';\n echo '<pre>';\n print_r($arr);\n echo '</pre>';\n die();\n }\n }", "public function processInventory()\n\t{\n\t\tif (($handle = fopen($this->outboundDir.$this->archivedFile, \"r\")) !== FALSE) {\n while (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n if($i!=0)\n\t\t{\n\t\t\t$stock = (int) $data[1];\n $sku = $data[0];\n\t\t\t$this->blinkeInventory[$sku]['blinke'] = $stock;\n\t\n\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t\tfclose($handle);\n\t\t}\n\t\tMage::log(\"Total sku count from blinke- \" .count($this->blinkeInventory),null,$this->logfile);\n\t\n\t\tforeach($this->blinkeInventory as $sku=>$array)\n\t\t{\n\t\t\t$fstock = $array['blinke'];\n // calclulate stock by substracting stock for on hold orders\n if(array_key_exists($sku, $this->onHoldOrders))\n {\n Mage::log(\"On hold stock for $sku is. \".$this->onHoldOrders[$sku],null,$this->logfile);\n\t\t\t\t$this->blinkeInventory[$sku]['onHold'] = $this->onHoldOrders[$sku];\n Mage::log(\"Blinke stock for $sku is. \".$fstock,null,$this->logfile);\n $fstock = (int) ($fstock - $this->onHoldOrders[$sku]);\n\t\t\t\t$this->blinkeInventory[$sku]['finalMagento'] = $fstock;\n Mage::log(\"EDIT :: Final stock for $sku is $fstock\",null,$this->logfile); \n }\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->blinkeInventory[$sku]['finalMagento'] = $fstock;\n\t\t\t}\n\t\t\t\n\n\t\t\t//process inventory for the sku\n\t\t\t$product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);\n\t\t\tif($product)\n\t\t {\n\t\t\t\ttry { $productId = $product->getIdBySku($sku); }\n\t\t catch(Exception $e)\n \t\t{\n \t\t\t Mage::log(\"Special SKU: $sku not found in magento\",null,$this->logfile);\n \t\t continue;\n\t\t }\n\n\t\t\t\t$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\n\t\t $stockItemId = $stockItem->getId();\n \t\tif (!$stockItemId) {\n\t Mage::log(\"STOCK ID for SKU: $sku doesnot exist\",null,$this->logfile);\n \t continue;\n \t\t} else {\n \t$stock = $stockItem->getData();\n \t\t}\n\t\t\t\t\n\t\t\t\t$originalStock = $stock['qty'];\n\t\t\t\t$this->blinkeInventory[$sku]['currentMagento'] = $originalStock;\n\t\t\t\tif($originalStock != $fstock)\n {\n \t\tif($fstock > 0)\n\t\t {\n \t\t $stock['qty'] = $fstock;\n\t\t $stock['is_in_stock'] = '1';\n\t\t $stock['manage_stock'] = '1';\n\t \t\t}\n\t\t\t\telse\n\t\t {\n \t\t $stock['qty'] = 0;\n \t\t}\n\t\t\t\t foreach($stock as $field => $value) {\n\t $stockItem->setData($field, $value?$value:0);\n \t\t }\n \t\ttry{\n \t\t$stockItem->save();\n\t\t }\n\t\t catch(Exception $e)\n \t\t{\n\t\t\t\t\tMage::log(\"cannot save inventory for $sku\",null,$this->logfile);\n\t\t continue;\n \t\t}\n\t\t Mage::log(\"Inventory updated for: $sku with value: $fstock from $originalStock\",null,$this->logfile);\n \t\tunset($stockItem);\n\t\t unset($product);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tMage::log(\"Inventory not updated for: $sku with value: $fstock from $originalStock\",null,$this->logfile);\n\t\t\t\t}\n\n\t\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t Mage::log(\"Special SKU: $sku not found in magento\",null,$this->logfile);\n\t\t\t}\n\t\t}\n\t}", "public function cleanProductCacheOnStockChange(Varien_Event_Observer $observer) {\n /**\n * @var $engine Brim_PageCache_Model_Engine\n * @var $stockItem Mage_CatalogInventory_Model_Stock_Item\n * @var $productRelation Mage_Catalog_Model_Resource_Product_Relation\n * @var $writeConnection Varien_Db_Adapter_Interface\n */\n $engine = Mage::getSingleton('brim_pagecache/engine');\n if (!$engine->isEnabled()) {\n return;\n }\n\n\n $stockItem = $observer->getEvent()->getItem();\n\n $engine->devDebug(__METHOD__);\n $engine->devDebug($stockItem->getOrigData());\n $engine->devDebug($stockItem->getData());\n\n // Original data is empty when called from the checkout and is only called when the stock status changes.\n if ($stockItem->getOrigData() == null\n || $stockItem->getData('is_in_stock') != $stockItem->getOrigData('is_in_stock')) {\n // stock status has changed\n $tags = $this->_findRelatedProductTags($stockItem->getProductId());\n $engine->devDebug($tags);\n\n Mage::app()->getCacheInstance()->clean($tags);\n }\n\n return;\n }", "function detect_dispensing_changes($order) {\n\n $day_changes = [];\n $qty_changes = [];\n $mysql = new Mysql_Wc();\n\n //Normall would run this in the update_order_items.php but we want to wait for all the items to change so that we don't rerun multiple times\n foreach ($order as $item) {\n\n //! $updated['order_date_dispensed'] otherwise triggered twice, once one stage: Printed/Processed and again on stage:Dispensed\n if ($item['days_dispensed_default'] != $item['days_dispensed_actual'])\n $day_changes[] = \"rx:$item[rx_number] qty:$item[qty_dispensed_default] >>> $item[qty_dispensed_actual] days:$item[days_dispensed_default] >>> $item[days_dispensed_actual] refills:$item[refills_dispensed_default] >>> $item[refills_dispensed_actual] item:\".json_encode($item);\n\n //! $updated['order_date_dispensed'] otherwise triggered twice, once one stage: Printed/Processed and again on stage:Dispensed\n if ($item['qty_dispensed_default'] != $item['qty_dispensed_actual'] OR (( ! is_null($item['refills_dispensed_actual']) AND $item['refills_dispensed_default']+0) != $item['refills_dispensed_actual']))\n $qty_changes[] = \"rx:$item[rx_number] qty:$item[qty_dispensed_default] >>> $item[qty_dispensed_actual] days:$item[days_dispensed_default] >>> $item[days_dispensed_actual] refills:$item[refills_dispensed_default] >>> $item[refills_dispensed_actual] item:\".json_encode($item);\n\n //! $updated['order_date_dispensed'] otherwise triggered twice, once one stage: Printed/Processed and again on stage:Dispensed\n $sig_qty_per_day_actual = $item['days_dispensed_actual'] ? round($item['qty_dispensed_actual']/$item['days_dispensed_actual'], 1) : 'NULL';\n $mysql->run(\"\n UPDATE gp_rxs_single SET sig_qty_per_day_actual = $sig_qty_per_day_actual WHERE rx_number = $item[rx_number]\n \");\n\n if ($item['days_dispensed_actual'] AND $item['refills_dispensed'] AND ! $item['qty_left'] AND ($item['days_dispensed_actual'] > DAYS_MAX OR $item['days_dispensed_actual'] < DAYS_MIN))\n log_error(\"check days dispensed is not within limits and it's not out of refills: \".DAYS_MIN.\" < $item[days_dispensed_actual] < \".DAYS_MAX, $item);\n else if ($sig_qty_per_day_actual != 'NULL' AND $sig_qty_per_day_actual != round($item['sig_qty_per_day_default'], 1) AND $sig_qty_per_day_actual != round($item['sig_qty_per_day_default']*2, 1)) { // *2 is a hack for \"as needed\" being different right now\n log_error(\"sig parsing error Updating to Actual Qty_Per_Day '$item[sig_actual]' $item[sig_qty_per_day_default] (default) != $sig_qty_per_day_actual $item[qty_dispensed_actual]/$item[days_dispensed_actual] (actual)\", $item);\n }\n }\n\n log_notice(\"update_order_cp detect_dispensing_changes\", ['order' => $order, 'day_changes' => $day_changes, 'qty_changes' => $qty_changes]);\n return ['day_changes' => $day_changes, 'qty_changes' => $qty_changes];\n }", "function wplastfm_update($file, $src) {\r\n global $wplastfm_options;\r\n \r\n if (time()-$wplastfm_options['cache'] > @filemtime($file)) {\r\n $data = wplastfm_get_recenttracks($src);\r\n if (!empty($data)) {\r\n $handle = fopen($file, \"w\");\r\n fwrite($handle, $data);\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public function writeRevision()\n {\n $locRev = $this->git->localRevision();\n $temp = tempnam(sys_get_temp_dir(), 'gitRevision');\n\n file_put_contents($temp, $locRev);\n ftp_put($this->connection, $this->revisionFile, $temp, FTP_BINARY);\n unlink($temp);\n }", "public function updateStock(array $stock) {\n\t\t$saved = true;\n\t\tforeach ($stock as $k => $v) {\n\t\t\tif (!empty($v[$this->ShopBranchStockLog->alias])) {\n\t\t\t\t$v = $v[$this->ShopBranchStockLog->alias];\n\t\t\t}\n\t\t\t$saved = $saved && $this->updateAll(\n\t\t\t\tarray($this->alias . '.stock' => $this->find('totalProductStock', $v) + $v['change']),\n\t\t\t\tarray(\n\t\t\t\t\t$this->alias . '.shop_branch_id' => $v['shop_branch_id'],\n\t\t\t\t\t$this->alias . '.shop_product_variant_id' => $v['shop_product_variant_id'],\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $saved;\n\t}", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function getStock()\n {\n return $this->stock;\n }", "public function updateProductStockStatuses($command)\n {\n // Load all products\n $products = $this->sqlRepository->use(Product::class)->findAll();\n $command->info($products->count() . ' products loaded...');\n $num_of_products = $products->count();\n $num_of_items = 0;\n $in_stock_items = 0;\n $out_of_stock_items = 0;\n\n /** @var Product $product */\n foreach($products as $product)\n {\n $this->sqlRepository->beginTransaction();\n\n $command->line('Evaluating product ID: ' . $product->id);\n $items = $product->items;\n\n if($items->isNotEmpty())\n {\n /** @var Item $item */\n foreach($items as $item)\n {\n $command->line('Evaluating item ID: ' . $item->id);\n $item->calculateStockStatus();\n $command->comment('Item ID: ' . $item->id . ' is ' . $item->calculated_stock_status);\n\n if($item->calculated_stock_status == 'in_stock')\n {\n $in_stock_items++;\n }\n elseif($item->calculated_stock_status == 'out_of_stock')\n {\n $out_of_stock_items++;\n }\n\n $item->save();\n $num_of_items++;\n }\n }\n else\n {\n $command->line('Evaluating item ID: ' . $product->default_item_id);\n $product->default_item->calculateStockStatus();\n $command->comment('Item ID: ' . $product->default_item_id . ' is ' . $product->default_item->calculated_stock_status);\n $product->default_item->save();\n\n if($product->default_item->calculated_stock_status == 'in_stock')\n {\n $in_stock_items++;\n }\n elseif($product->default_item->calculated_stock_status == 'out_of_stock')\n {\n $out_of_stock_items++;\n }\n\n $num_of_items++;\n }\n\n $this->sqlRepository->commitTransaction();\n }\n\n $command->info('Number of Products Evaluated: ' . $num_of_products . ' | Number of Items Evaluated: ' . $num_of_items);\n $command->info('Number of In Stock Items: ' . $in_stock_items . ' | Number of Out Of Stock Items: ' . $out_of_stock_items);\n\n $command->info('Done!');\n }", "public function onAfterWrite() {\n parent::onAfterWrite();\n $item = $this->Item();\n $variation = $this->Object();\n\t if ($variation && $variation->exists() && $variation instanceof Variation) {\n\t $item->updateStockLevels();\n\t }\n\t}", "public static function getRemoteWasteWaterFile() {\n\n //return false;\n // HET RIVM heeft een fout bron bestand. Even niet update dus!!!!\n\n\n\n\n\n\n\n\n // we got a new file. Let's download it\n $contents = file_get_contents( self::RIVM_REMOTE_SOURCE_WASTE_WATER_CSV_FILE );\n if( ! $contents ) return false;\n\n $date = date( 'Ymd', filemtime( self::RIVM_SOURCE_WASTE_WATER_CSV_FILE ) );\n $newFileName = substr( self::RIVM_SOURCE_WASTE_WATER_CSV_FILE, 0, -4 ) . \".\" . $date . \".csv\";\n if( rename( self::RIVM_SOURCE_WASTE_WATER_CSV_FILE, $newFileName ) ) {\n if ( file_put_contents( self::RIVM_SOURCE_WASTE_WATER_CSV_FILE, $contents, LOCK_EX ) ) {\n $cacheFile = self::CACHE_JAVASCRIPT_FILE_WASTE_WATER_PLANT_LOCATIONS;\n if( file_exists( $cacheFile ) ) unlink( $cacheFile );\n $cacheFile = self::CACHE_WASTE_WATER_SERIES_SORTED_BY_LOCATION;\n if( file_exists( $cacheFile ) ) unlink( $cacheFile );\n $cacheFile = self::CACHE_WASTE_WATER_TOTALS_BY_WEEK_NUMBER;\n if( file_exists( $cacheFile ) ) unlink( $cacheFile );\n $cacheFile = self::CACHE_WASTE_WATER_TOTALS_BY_DAY;\n if( file_exists( $cacheFile ) ) unlink( $cacheFile );\n FileUtils::writeCookie( self::COOKIE_LAST_FETCH_WASTE_WATER, time() );\n return true;\n }\n }\n return false;\n }", "function source_handle_on_daily() {\n \n require_once(ANGIE_PATH.'/classes/xml/xml2array.php');\n \n $results = 'Repositories updated: ';\n \n $repositories = Repositories::findByUpdateType(REPOSITORY_UPDATE_DAILY);\n foreach ($repositories as $repository) {\n // don't update projects other than active ones\n $project = Projects::findById($repository->getProjectId());\n if ($project->getStatus() !== PROJECT_STATUS_ACTIVE) {\n continue;\n } // if\n \n $repository->loadEngine();\n $repository_engine = new RepositoryEngine($repository, true);\n \n $last_commit = $repository->getLastCommit();\n $revision_to = is_null($last_commit) ? 1 : $last_commit->getRevision();\n \n $logs = $repository_engine->getLogs($revision_to);\n \n if (!$repository_engine->has_errors) {\n $repository->update($logs['data']);\n $total_commits = $logs['total'];\n \n $results .= $repository->getName().' ('.$total_commits.' new commits); ';\n \n if ($total_commits > 0) {\n $repository->sendToSubscribers($total_commits, $repository_engine);\n $repository->createActivityLog($total_commits);\n } // if\n } // if\n \n } // foreach\n \n return is_foreachable($repositories) && count($repositories) > 0 ? $results : 'No repositories for daily update';\n }", "public function getStock();", "public function update(){\n $file = fopen(\"update.txt\",\"w\") or die (\"Cannot open file!\");\n foreach($this->accounts as $account){\n $line = $account->id.\" \".$account->balance.\"\\n\";\n fwrite($file,$line);\n }\n fclose($file);\n }", "function getprices()\n{\n global $replay;\n global $pricefh;\n\n if($replay == 0)\n {\n $api = new Binance\\API(\"<api key>\",\"<secret>\");\n $mp = $api->prices();\n $pricefh = fopen(\"BTC-prices.txt\",\"a\") or die(\"Cannot open file\");\n fwrite($pricefh, serialize($mp) . \"\\n\");\n fclose($pricefh);\n }\n else\n {\n if (!$pricefh)\n {\n $pricefh = fopen(\"BTC-prices.txt\",\"r\") or die(\"Cannot open replay file\");\n }\n $mp = unserialize(fgets($pricefh));\n if ($mp == NULL) die(\"end of price data reached.\\n\");\n }\n return $mp;\n}", "public function get_branchwise_product_stock_correction() {\n $branchwise_product_store_list = $this->Branchwise_product_store_Model->get_branchwise_product_store();\n if (!empty($branchwise_product_store_list)) {\n $arr = array();\n foreach ($branchwise_product_store_list as $branchwise_product_store) {\n $branchwise_product_store_from_previous_date_by_product_id_branch_id = $this->Branchwise_product_store_Model->get_branchwise_product_store_from_previous_date_by_product_id_branch_id($branchwise_product_store->product_store_date, $branchwise_product_store->product_id, $branchwise_product_store->branch_id);\n $open_stock = !empty($branchwise_product_store_from_previous_date_by_product_id_branch_id) ? $branchwise_product_store_from_previous_date_by_product_id_branch_id->closing_stock : 0;\n $closing_stock = (int) ($open_stock + $branchwise_product_store->receive_stock - $branchwise_product_store->transfer_stock - $branchwise_product_store->sale_from_stock - $branchwise_product_store->damage_stock);\n $branchwise_product_store_data = array(\n 'id' => $branchwise_product_store->id,\n 'product_store_date' => $branchwise_product_store->product_store_date,\n 'product_id' => $branchwise_product_store->product_id,\n 'branch_id' => $branchwise_product_store->branch_id,\n 'open_stock' => $open_stock,\n 'receive_stock' => $branchwise_product_store->receive_stock,\n 'transfer_stock' => $branchwise_product_store->transfer_stock,\n 'sale_from_stock' => $branchwise_product_store->sale_from_stock,\n 'damage_stock' => $branchwise_product_store->damage_stock,\n 'closing_stock' => $closing_stock,\n );\n array_push($arr, $branchwise_product_store_data);\n //$this->db->where('id', $branchwise_product_store_data['id']);\n //$this->Branchwise_product_store_Model->db->update('branchwise_product_store', $branchwise_product_store_data);\n }\n echo 'branchwise product store';\n echo '<br>';\n echo '<pre>';\n print_r($arr);\n echo '</pre>';\n die();\n }\n }", "public function getStock()\n {\n return $this->Stock;\n }", "function check_branch($appid,$steamcmd) { \t\n \n$cmd = \"$steamcmd +app_info_update 1 +app_info_print $appid +quit 2>/dev/null\"; \n$data= shell_exec($cmd);\nfile_put_contents(\"$appid.txt\",$data);\n$kv = VDFParse(\"$appid.txt\");\nunlink(\"$appid.txt\");\nreturn $kv[$appid]['depots']['branches']; // just send the branches back\n}", "function _set_stock_info(&$data)\n\t{\n\t\tforeach ($this->cart->contents() as $item)\n\t\t{\n\t\t\t$prod_id = $item['id'];\n\t\t\t$product = $this->database->GetProductById($prod_id);\n\n\t\t\t//Check stock and set stock info\n\t\t\t$data['products'][$item['rowid'].'stock_state'] = $this->_set_stock_state($product, $item);\n\n\t\t\t$data['products'][$prod_id] = $product;\n\t\t}\n\t}", "public function flush()\n {\n $f = fopen($this->file, 'w');\n\n foreach ($this->duplicates as $hash => $similarFiles) {\n $lines = implode(\"\\r\\n\", $similarFiles) . \"\\r\\n\\r\\n\";\n fwrite($f, $lines);\n }\n\n fclose($f);\n }", "function store_watches() {\n\t\tif (count($this->watches) > 0) {\n\t\t\t$s = serialize($this->watches);\n\n\t\t\t$fp = fopen($this->watchfile(), \"w\");\n\t\t\tfputs($fp, $s);\n\t\t\tfclose ($fp);\n\t\t} else {\n\t\t\tif (is_writable($this->watchfile()))\n\t\t\t\tunlink ($this->watchfile());\n\t\t}\n\t}", "private function save_log_file(){\n\n $file = MD5_HASHER_DIR . $this->file_change;\n if(is_file($file) && is_writable($file)){\n $fh = fopen($file, 'w');\n fwrite($fh, date('d/m/Y H:i:s').\" Changed Files(\".count($this->md5_changed_output).\"):\\n\");\n\n $changes = $this->order_changed_log();\n foreach($changes as $ext => $log_type){\n fwrite($fh, \"\\nFile Type (\".$ext.\"): \\n\");\n foreach($log_type as $k => $v){\n fwrite($fh, $v['real_path'].' => '.$v['modified']. \"\\n\");\n }\n }\n\n fwrite($fh, \"\\n\");\n fclose($fh);\n return true;\n }\n\n return false;\n }", "public function testExportWithStock(): void\n {\n $maxSaleQty = '19187';\n $minSaleQty = '179';\n /** @var StockItemRepositoryInterface $stockRepository */\n $stockRepository = $this->objectManager->get(StockItemRepositoryInterface::class);\n /** @var StockConfigurationInterface $stockConfiguration */\n $stockConfiguration = $this->objectManager->get(StockConfigurationInterface::class);\n\n $product = $this->productRepository->get('simple');\n /** @var Item $stockItem */\n $stockItem = $product->getExtensionAttributes()->getStockItem();\n $stockItem->setMaxSaleQty($maxSaleQty);\n $stockItem->setMinSaleQty($minSaleQty);\n $stockRepository->save($stockItem);\n\n $this->model->setWriter(\n $this->objectManager->create(\n \\Magento\\ImportExport\\Model\\Export\\Adapter\\Csv::class\n )\n );\n $exportData = $this->model->export();\n $this->assertStringContainsString((string)$stockConfiguration->getMaxSaleQty(), $exportData);\n $this->assertStringNotContainsString($maxSaleQty, $exportData);\n $this->assertStringNotContainsString($minSaleQty, $exportData);\n $this->assertStringContainsString('Simple Product Without Custom Options', $exportData);\n }", "function update_jackpot()\n {\n //read info about the bingo\n $bingo_info = fopen('global/bingo.txt','r+');\n //price of a ticket is on the first line\n $price = fgets($bingo_info);\n $price = (int)str_replace(\"price:\",\"\",$price);\n \n //total jackpot is on the second\n $char_jackpot = fgets($bingo_info);\n $char_jackpot = str_replace(\"jackpot:\",\"\",$char_jackpot);\n $jackpot = (int)$char_jackpot;\n \n $new_jackpot = $jackpot + $price;\n \n //new pointer will be before the value of the jackpot, ftell calls the current position of the cursor\n $pointer = ftell($bingo_info)-strlen($char_jackpot);\n //Move the cursor to the new pointer\n fseek($bingo_info,$pointer);\n //Write the new jackpot\n fputs($bingo_info,$new_jackpot);\n }", "protected function pullEvent(){\n $result = shell_exec('cd '.$this->projectPath.' && git pull' );\n if($this->doctrineUpdate) {\n $result .= shell_exec('cd ' . $this->projectPath . ' && php -d bin/console doctrine:schema:update');\n }\n shell_exec('cd '.$this->projectPath.' && php -d memory_limit=1G bin/console cache:clear --env=prod');\n shell_exec('cd '.$this->projectPath.' && php -d memory_limit=1G bin/console cache:clear --env=dev');\n return $result;\n }", "public function modify_stock( $by ) {\n\t\tglobal $wpdb;\n\t\t\n\t\t// Only do this if we're updating\n\t\tif ( ! $this->managing_stock() )\n\t\t\treturn false;\n\n\t\t// +- = minus\n\t\t$this->stock = $this->stock + $by;\n\t\t$amount_sold = ( ! empty( $this->stock_sold ) ? $this->stock_sold : 0 ) + $by;\n\n\t\t// Update & return the new value\n\t\tupdate_post_meta( $this->variation_id, 'stock', $this->stock );\n\t\tupdate_post_meta( $this->variation_id, 'stock_sold', $amount_sold );\n\t\t\n\t\tif ( self::get_options()->get_option('jigoshop_notify_no_stock_amount') >= 0\n\t\t\t&& self::get_options()->get_option('jigoshop_notify_no_stock_amount') >= $this->stock\n\t\t\t&& self::get_options()->get_option( 'jigoshop_hide_no_stock_product' ) == 'yes' ) {\n\t\t\t\n\t\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'draft' ), array( 'ID' => $this->variation_id ) );\n\t\t\t\n\t\t} else if ( $this->stock > self::get_options()->get_option('jigoshop_notify_no_stock_amount')\n\t\t\t&& get_post_status( $this->variation_id ) == 'draft'\n\t\t\t&& self::get_options()->get_option( 'jigoshop_hide_no_stock_product' ) == 'yes' ) {\n\t\t\t\n\t\t\t$wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $this->variation_id ) );\n\t\t}\n\t\t\n\t\treturn $this->stock;\n\t}", "public function read_stocks() {\n return $this->yahooStock->getQuotes();\n }", "protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }", "function _upd_product_stock($prod_id=0,$mrp=0,$bc='',$loc_id=0,$rb_id=0,$p_stk_id=0,$qty=0,$update_by=0,$stk_movtype=0,$update_by_refid=0,$mrp_change_updated=-1,$msg='')\r\n {\r\n $user = $this->erpm->auth();\r\n\r\n if(!$prod_id)\r\n show_error(\"Invalid product 0 given\");\r\n\r\n if(!$p_stk_id)\r\n {\r\n // check if product stock entry is availble\r\n if(!$this->db->query(\"select count(*) as t from t_stock_info where product_id = ? and available_qty >= 0 \",$prod_id)->row()->t)\r\n {\r\n // create stock entry and update log for new insertion\r\n $p_stk_id = $this->_create_stock_entry($prod_id,$mrp,$bc,$loc_id,$rb_id);\r\n }else\r\n {\r\n\r\n // process stock info to get most relavent stock entry by barcode,mrp,location\r\n $stk_det_res = $this->db->query(\"select stock_id,product_id,mrp,product_barcode,bc_match,\r\n length(product_barcode) as bc_len,length(?) as i_bc_len,\r\n location_id,rack_bin_id,available_qty,sum(mrp_match+bc_match) as r from (\r\n select a.stock_id,a.product_id,mrp,if(mrp=?,1,0) as mrp_match,\r\n product_barcode,if(product_barcode=?,1,0) as bc_match,\r\n location_id,rack_bin_id,available_qty\r\n from t_stock_info a\r\n where product_id = ? and available_qty >= 0 and location_id=? and rack_bin_id= ?\r\n having mrp_match and if(length(?),(length(product_barcode) = 0 or bc_match = 1),1)\r\n order by mrp_match desc,bc_match desc ) as g\r\n group by stock_id\r\n order by r desc\",array($bc,$mrp,$bc,$prod_id,$loc_id,$rb_id,$bc));\r\n// echo $this->db->last_query();die();\r\n \r\n // if no data found create new stock entry Considering mrp for the product is not found\r\n if(!$stk_det_res->num_rows())\r\n {\r\n $this->_create_stock_entry($prod_id,$mrp,$bc,$loc_id,$rb_id);\r\n }\r\n else\r\n {\r\n // Product stock relavent data fetched which has matching mrp with stock mrp\r\n $stk_det = $stk_det_res->row_array();\r\n\r\n // update stock with the requested qty where best match stock id is known\r\n $p_stk_id = $stk_det['stock_id'];\r\n\r\n if(strlen($bc) > 0 && $stk_det['bc_length'] == 0)\r\n {\r\n // update product stock with the given barcode for suggestion.\r\n $this->db->query(\"update t_stock_info set product_barcode = ?,modified_by=?,modified_on=now() where stock_id = ? \",array($bc,$user['userid'],$p_stk_id));\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n // update product stock available qty by stock id\r\n // update stock log\r\n\r\n if(!$qty)\r\n return $p_stk_id;\r\n\r\n $this->db->query(\"update t_stock_info set available_qty=available_qty\".($stk_movtype==1?\"+\":\"-\").\"?,modified_by=?,modified_on=now() where stock_id = ? and available_qty >= 0 \",array($qty,$user['userid'],$p_stk_id));\r\n\r\n // if by grn\r\n $ins_data = array();\r\n $ins_data['product_id'] = $prod_id;\r\n $ins_data['update_type'] = $stk_movtype;\r\n\r\n if($update_by == 1)\r\n $ins_data['p_invoice_id'] = $update_by_refid; // stock update by proforma invoice\r\n else if($update_by == 2)\r\n $ins_data['corp_invoice_id'] = $update_by_refid; // stock update by corp invoicing\r\n else if($update_by == 3)\r\n $ins_data['invoice_id'] = $update_by_refid; // stock update by invoice cancel\r\n else if($update_by == 4)\r\n $ins_data['grn_id'] = $update_by_refid; // stock update by stock intake\r\n else if($update_by == 5)\r\n $ins_data['voucher_book_slno'] = $update_by_refid; // stock update by voucher book\r\n else if($update_by == 6)\r\n $ins_data['return_prod_id'] = $update_by_refid; // stock update by product return ref id\r\n\r\n $ins_data['qty'] = $qty;\r\n $ins_data['current_stock'] = $this->_get_product_stock($prod_id);\r\n $ins_data['msg'] = $msg;\r\n $ins_data['mrp_change_updated'] = $mrp_change_updated;\r\n $ins_data['stock_info_id'] = $p_stk_id;\r\n $ins_data['stock_qty'] = $this->_get_product_stock_bystkid($p_stk_id);\r\n $ins_data['created_on'] = cur_datetime();\r\n $ins_data['created_by'] = $user['userid'];\r\n\r\n $this->db->insert(\"t_stock_update_log\",$ins_data);\r\n if($this->db->affected_rows() == 1)\r\n return true;\r\n\r\n return false;\r\n\r\n }", "function installHistory ($api, $moduleName, $folioArray, $installTime) {\n\n\t$pairSymbols = array_column ($folioArray, 'pairSymbol');\n\tarray_pop ($pairSymbols);\n\n\t$pairsString = implode(\", \",$pairSymbols);\n\n global $exchange;\n $ticker = getTicker ($api, $exchange, $folioArray);\n\n\t$pairCount = count($folioArray)-1;\n\n\tfor ($i=0; $i<$pairCount; $i++) {\n\t\t$pairSymbol = $folioArray[$i]['pairSymbol'];\n\t\t$coinSymbol = $folioArray[$i]['coinSymbol'];\n\n\t\t/*\n\t\tif (isset($balance['result'][$coinSymbol])) {\n\t\t\t$quantity = $balance['result'][$coinSymbol];\n\t\t\tsettype($quantity,'float');\n\t\t} else {\n\t\t\t$quantity = 0;\n\t\t}\n\t\t*/\n\n\t\tif ($i<$pairCount) {\n\t\t\t$price = $ticker[$i];\n\t\t\tsettype ($price, 'float');\n\t\t} else {\n\t\t\t$price = 1;\n\t\t}\n\n\t\t$quantity = round($folioArray[$i]['targetPercent']/$price*10, 5, PHP_ROUND_HALF_UP);\n\n\n\t\t$main[$i] = array ('pairSymbol'=>$pairSymbol, 'coinSymbol'=> $coinSymbol, 'targetPercent'=>$folioArray[$i]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>$price, 'startQuantity'=>$quantity);\n\n\t\t$historyTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\n\t\t$history = array ('ledger'=>null, 'totals'=>$historyTotals);\n\n\t\t$filename = $moduleName. '-'. $folioArray[$i]['pairSymbol'].'-';\n\t\t$filepath = '' . $filename . 'history.json';\n\t\tfile_put_contents($filepath, json_encode($history));\n\t}\n\n\n\t$quantity = $folioArray[$pairCount]['targetPercent']*10;\n\t$main[] = array ('pairSymbol'=>'ZUSD', 'coinSymbol'=>'ZUSD','targetPercent'=>$folioArray[$pairCount]['targetPercent'], 'quantity'=>$quantity, 'averageBuyPrice'=>1, 'startQuantity'=>$quantity);\n\t$filename = $moduleName. '-';\n\t$filepath = '' . $filename . 'main.json';\n\tfile_put_contents($filepath, json_encode($main));\n\n\n\t$quickExt = array ('lastPosInt'=>$installTime, 'pairIndex'=>0, 'updateTime'=>$installTime, 'indicCurrent'=>'current');\n\t$filepath = '' . $filename . 'QuickExt.json';\n\tfile_put_contents($filepath, json_encode($quickExt));\n\n\n\t$ledgerTotals = array ('profit'=>0, 'quoteProfit'=>0, 'totalDiff'=>0, 'count'=>0, 'positive'=>0, 'posPercent'=>0);\n\n\t$ledger = array ('ledger'=>null, 'totals'=>$ledgerTotals);\n\n\t$filepath = '' . $moduleName . '-ledger.json';\n\tfile_put_contents($filepath, json_encode($ledger));\n}", "function generate_recent_json_file() {\n // Open new file to write\n $json_file = new SplFileObject(\"../CCNice5RecentAudioFiles.json\", \"w\");\n $json_file->fwrite(\"[\\n\");\n\n // Retrieve all non new entries from the database\n $result = $this->pdo->query('SELECT * FROM files WHERE publishedfile = 1 ORDER BY date DESC LIMIT 5');\n\n // For each file generate json entry to be used for presentation\n foreach( $result as $i ){\n\n unset($i['newfile']);\n unset($i['flaggedfile']);\n unset($i['flagcomment']);\n unset($i['md5_sign']);\n unset($i['publishedfile']);\n unset($i['translated']);\n unset($i['downloads']);\n unset($i['filepath']);\n\n $readable_size = $this->convert_file_size($i['size']);\n $i['size'] = $readable_size;\n\n $json_file->fwrite(json_encode($i) . \",\\n\");\n }\n\n $json_file->fseek(-2, SEEK_CUR);\n\n $json_file->fwrite(\"\\n]\");\n $json_file = null;\n\n return;\n }", "public function stock_history(){\n\t\treturn $stock_info = $this->db->select('*')\n\t\t ->from('store')\n\t\t ->where('isactive',1)\n\t\t ->get()\n\t\t ->result();\n\t}", "public function getOldFileOffenders()\n\t{\n\t $this->load->model('cleanup','',FALSE);\n\t $this->load->model('configuration');\n\t $dbList = $this->configuration->getDBList();\n\t foreach($dbList->result() as $db) {\n\t \t//if($db == \"som\") {\n\t \techo \"Starting Old File Detection For: \".$db->friendlyName;\n\t \techo \"<br />\";\n\t \t$this->cleanup->getOldFiles($db->dbGroup,$db->fullpath,$db->fsInodeNumber,$db->friendlyName);\n\t \techo \"<hr /><br />\";\n\t //}\n\t }\n\t //$this->cleanup->sendNotices(\"oldfile\");\n\t}", "function update_stock($idx, $stock, $qty, $digital)\n{\n global $current_user_id, $config, $db_prefix;\n\n // if manage stock disabled\n if (!$config['cart']['manage_stock']) {\n return true;\n }\n\n // if digital => do NOT decrease stock!\n if ($digital) {\n return true;\n }\n\n // if it is actually out-of-stock (how can someone checkout for out-of-stock items?)\n if (!$stock) {\n sql_query(\"DELETE FROM \".$db_prefix.\"orders WHERE idx = '$idx' LIMIT 1\");\n return false;\n } else {\n // if this is the last stock, delete all un-checked-out orders related to the item\n if ($stock == 1) {\n sql_query(\"DELETE FROM \".$db_prefix.\"orders WHERE idx = '$idx' LIMIT 1\");\n }\n\n // decrease stock condition\n if ($stock < $qty) {\n $qty = $stock;\n }\n sql_query(\"UPDATE \".$db_prefix.\"products SET stock = stock-$qty WHERE idx = '$idx' LIMIT 1\");\n\n return true;\n }\n}", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "function mainPull()\n {\n x_echoFlush('<pre>');\n x_EchoFlush('<h2>Looking For Andromeda Version</h2>');\n x_EchoFlush(\"\");\n\n // First take care of where we are pulling version\n // information from\n $def = \"http://andro.svn.sourceforge.net/svnroot/andro/releases/\";\n $row = SQL_OneRow(\n \"Select * from applications where application='andro'\"\n );\n if (!isset($row['svn_url'])) {\n x_EchoFlush(\"-- This looks like the first time this node has\");\n x_EchoFlush(\" been upgraded from Subversion. Using default\");\n x_echoFlush(\" URL to look for releases:\");\n x_EchoFlush(\" \".$def);\n $url = $def;\n } else {\n if (is_null($row['svn_url']) || trim($row['svn_url'])=='') {\n x_EchoFlush(\"-- Setting the Subversion URL to default:\");\n x_EchoFlush(\" \".$def);\n $url = $def;\n $row['svn_url'] = $def;\n SQLX_Update('applications', $row);\n } else {\n $url = trim($row['svn_url']);\n x_EchoFlush(\"-- Using the following URL for Subversion:\");\n x_EchoFlush(\" \".$url);\n }\n }\n\n // Find out what the latest version is\n x_EchoFlush(\"\");\n x_EchoFlush(\"-- Querying for latest version...\");\n $command = 'svn list '.$url;\n x_EchoFlush(\" Command is: \".$command);\n $rawtext = `$command`;\n if ($rawtext=='') {\n x_EchoFlush(\"-- NO VERSIONS RETRIEVED!\");\n x_EchoFlush(\" It may be that the Sourceforge site is down?\");\n x_EchoFlush(\"\");\n x_echoFlush(\" ---- Stopped Unexpectedly --- \");\n return;\n }\n $rawtext = str_replace(\"\\r\", \"\", $rawtext);\n $lines = explode(\"\\n\", $rawtext);\n // Pop off empty entry at end, then get latest version\n array_pop($lines);\n $latest=array_pop($lines);\n if (substr($latest, -1)=='/') {\n $latest = substr($latest, 0, strlen($latest)-1);\n }\n\n x_EchoFlush(\" Latest published version: \".$latest);\n\n // now find out what version we have\n x_EchoFlush(\" \");\n x_EchoFlush(\"-- Finding out what version the node manager is at\");\n $file=$GLOBALS['AG']['dirs']['application'].'_andro_version_.txt';\n x_EchoFlush(\" Looking at file: $file\");\n if (!file_exists($file)) {\n x_EchoFlush(\" File not found, it appears this is the first time\");\n x_EchoFlush(\" this node has been upgraded this way. Will proceed\");\n x_EchoFlush(\" to get latest version.\");\n } else {\n $version = file_get_contents($file);\n x_EchoFlush(\" Current version is \".$version);\n \n if ($version == $latest) {\n x_echoFlush(\" This node is current! Nothing to do!\");\n x_EchoFlush(\"\");\n x_echoFlush(\" ---- Processing completed normally ---- \");\n return;\n } else {\n x_echoFlush(\" Newer version available, will get latest.\");\n }\n }\n \n // now get the latest code\n $dir = $GLOBALS['AG']['dirs']['root'];\n $command = 'svn export --force '.$url.$latest.' '.$dir;\n x_EchoFlush(\"\");\n x_EchoFlush(\"-- Overwriting Node Manager now\");\n x_echoFlush(\" Command is \".$command);\n `$command`;\n x_echoFlush(\"\");\n file_put_contents($file, $latest);\n x_EchoFlush(\" ---- Processing completed normally ---- \");\n\n }", "private function getStock()\n {\n $article = oxNew('oxArticle');\n $article->load($this->testArticleId);\n return $article->oxarticles__oxstock->value;\n }", "private function writeCurrenciesToFile() {\n createFile(\n \"currencies.xml\",\n $this->currencies[0]->asXML()\n );\n }", "public function getDownload($revision_one, $revision_two)\n {\n $this->setMetadataVariables($revision_one, $revision_two);\n if (sizeof($this->metadata_changes) > 0)\n {\n $headers = array_keys(current($this->latest_metadata));\n $headers[] = \"change_status\";\n $headers[] = \"changed_fields\";\n $headers[] = \"change_details (field: old values)\";\n \n $filename = \"comparison_of_changes.csv\";\n\n header('Content-Description: File Transfer');\n header('Content-Type: application/csv');\n header('Content-Disposition: attachment; filename=\"' . $filename . '\"');\n\n $file = fopen(\"php://output\", \"w\");\n\n fprintf($file, chr(0xEF).chr(0xBB).chr(0xBF)); // Use UTF-8 encoding\n\n // Write headers to file\n if (fputcsv($file, $headers) == \"FALSE\")\n {\n REDCap::logEvent(\"Data Dictionary Revisions External Module - Error\", \"Error writing headers to $filename.\", null, null, null, $this->getProjectId());\n }\n\n foreach($this->metadata_changes as $field => $metadata) \n {\n $metadata = array_values($metadata);\n $csv_row = array();\n $changed_fields = \"\";\n $change_details = \"\";\n\n foreach($metadata as $i => $attr)\n {\n $attr = strip_tags($attr);\n if (is_null($this->furthest_metadata[$field]) || is_null($this->latest_metadata[$field])) // field value is missing\n { \n $value = $attr ? $attr : \"\";\n $csv_row[] = $value;\n }\n else\n {\n $old_value = strip_tags($this->furthest_metadata[$field][$headers[$i]]);\n if ($attr != $old_value)\n {\n $value = $attr ? $attr : \"\";\n $old_value = $old_value ? $old_value : \"\";\n $csv_row[] = $value;\n $changed_fields .= $headers[$i] . \"\\r\\n\";\n $change_details .= $headers[$i] . \": \" . $old_value . \"\\r\\n\";\n }\n else\n {\n $value = $attr ? $attr : \"\";\n $csv_row[] = $value;\n }\n }\n }\n\n if (is_null($this->furthest_metadata[$field])) // New Field\n {\n $csv_row[] = \"New field\";\n }\n else if (is_null($this->latest_metadata[$field])) // Deleted Field\n {\n $csv_row[] = \"Deleted field\";\n }\n else\n {\n $csv_row[] = \"Field with changes\";\n }\n\n $csv_row[] = $changed_fields;\n $csv_row[] = $change_details;\n\n if (fputcsv($file, $csv_row) == FALSE)\n {\n REDCap::logEvent(\"Data Dictionary Revisions External Module - Error\", \"Error writing changes to $filename.\", null, null, null, $this->getProjectId());\n }\n }\n\n if (fclose($file) === FALSE)\n {\n REDCap::logEvent(\"Data Dictionary Revisions External Module - Error\", \"Error closing $filename.\", null, null, null, $this->getProjectId());\n }\n }\n }", "function update_recently_edited($file)\n {\n }", "public function run() {\n try {\n $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT);\n \n $products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter('preorder_calender', array('date' => true, 'to' => $todayDate));\n $emailContent = '';\n $emailContent .= $todayDate.\"\\n\";\n echo 'Preorder-InStock process started @ '.$todayDate.' :'.\"\\n\\n\";\n echo 'Name'.\"\\t\".'SKU'.\"\\n\\n\";\n\n // Write into CSV\n $io = new Varien_Io_File();\n $path = Mage::getBaseDir('var') . DS . 'export' . DS;\n $name = md5(microtime());\n $file = $path . DS . $name . '.csv';\n $io->setAllowCreateFolders(true);\n $io->open(array('path' => $path));\n $io->streamOpen($file, 'w+');\n $io->streamLock(true);\n\n $header = array(\"Name\",\"SKU\");\n $io->streamWriteCsv($header);\n\n foreach ($products as $product) {\n $product->load();\n $data = array();\n $data[] = $product->getName();\n $data[] = $product->getSku();\n $io->streamWriteCsv($data);\n $stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());\n $stock->setData('is_in_stock', 1);\n $stock->save();\n\n $product->setData('preorder_calender', null);\n $product->setData('custom_stock_status', 14);\n\n $product->save();\n $output = $product->getName().\"\\t\".$product->getSku();\n echo $output.\"\\n\";\n }\n\n // Send email with configuration in System > Configuration > Preoder Instock Updates > Receivers\n $emailTemplate = Mage::getModel('core/email_template')\n ->loadDefault('preoder_stock_email');\n\n $emailTemplate->setSenderName('Milan Direct Administrator');\n $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/email'));\n $emailTemplate->setTemplateSubject('Preorder-InStock process started @ '.$todayDate);\n\n $emailTemplateVariables = array();\n $emailTemplateVariables['message'] = 'Preorder-InStock process finished with '.$products->count().' updated';\n $processedTemplate = $emailTemplate->getProcessedTemplate($emailTemplateVariables);\n\n // Add attachment\n $emailTemplate->getMail()->createAttachment(\n file_get_contents($file),\n Zend_Mime::TYPE_OCTETSTREAM,\n Zend_Mime::DISPOSITION_ATTACHMENT,\n Zend_Mime::ENCODING_BASE64,\n 'preorder_stock_report.csv'\n );\n\n $names = array();\n $receivers = explode(\",\", Mage::getStoreConfig('notification/general/email'));\n\n foreach($receivers as $receiver)\n {\n $names[] = 'Milan Direct Staff';\n }\n\n $emailTemplate->send($receivers,$names, $emailTemplateVariables);\n\n echo 'Preorder-InStock process finished with '.$products->count().' updated'.\"\\n\";\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::log($e->getMessage(), 1, 'preorder_instock.log');\n }\n }", "public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }", "public function checkForStaleFiles($drop);", "public function updateStockQty()\n\t{\n\t\t\n\t\t$this->autoLayout = 'ajax';\n\t\t$this->autoRender = false;\n\t\t$this->loadModel('ProductDesc');\n\t\tApp::import('Vendor', 'PHPExcel/IOFactory');\n\t\t\t\t\n\t\t\t\t$objPHPExcel = new PHPExcel();\n\t\t\t\t$objReader= PHPExcel_IOFactory::createReader('CSV');\n\t\t\t\t$objReader->setReadDataOnly(true);\t\t\t\t\n\t\t\t\t$objPHPExcel=$objReader->load('files/update_stock.csv');\n\t\t\t\t$objWorksheet=$objPHPExcel->setActiveSheetIndex(0);\n\t\t\t\t$lastRow = $objPHPExcel->getActiveSheet()->getHighestRow();\n\t\t\t\t$colString\t=\t $highestColumn = $objPHPExcel->getActiveSheet()->getHighestColumn();\n\t\t\t\t$colNumber = PHPExcel_Cell::columnIndexFromString($colString);\n\t\t\t\t\t\t \n\t\t\tfor($i=2;$i<=$lastRow;$i++) \n\t\t\t{\n\t\t\t\t$sku\t\t=\t$objWorksheet->getCellByColumnAndRow(0,$i)->getValue();\n\t\t\t\t$qty\t\t=\t$objWorksheet->getCellByColumnAndRow(1,$i)->getValue();\n\t\t\t\t$this->Product->updateAll(array('Product.uploaded_stock' => $qty ), array('Product.product_sku' => $sku));\n\t\t\t}\n\t\t\t\n\t}", "public function updateFeedsStatusesFile()\n {\n $data = json_encode($this->last_feeds_statuses);\n return file_put_contents($this->feeds_statuses_file, $data);\n }", "function getProjectList() {\n\n\t$outFileNew = \"/var/www/html/projectList.new\";\n\t$outFileOrig = \"/var/www/html/projectList.txt\";\n\t$repos = array();\n\t$lodRE = '/br_[0-9]+.[0-9]+.[0-9]+/';\n\t$github_repos_url = 'https://github.com/api/v2/json/repos/show/CanoeVentures'; \n\t$curlResponse = curlRequest($github_repos_url);\n\n\tif (empty($curlResponse)) {\n\t\tprint \"Sorry - no data was returned.<p>\";\n\t}\n\telse {\n\t\t$jsonResult = json_decode($curlResponse);\t\t\n\t\tforeach($jsonResult->repositories as $r) {\n\t\t\t$repos[] = $r->name;\t\n\t\t}\n\t}\n\tsort($repos);\n\t$valid_branch = \" \";\n $valid_tag = \" \";\n\t$fileHandle = fopen($outFileNew, 'w') or die(\"cannot open file \" . $outFileNew);\n\tforeach ($repos as $repo) {\n\t\t$curlResponse = curlRequest($github_repos_url . '/' . $repo . '/branches');\t\t\n\t\t$jsonResult = json_decode($curlResponse);\n\t\tsleep(2);\n\t\t\n\t\tforeach($jsonResult->branches as $key => $val) {\n\t\t\tif (preg_match($lodRE, $key)) {\n\t\t\t\t$valid_branch = \"true\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$valid_branch = \"false\";\n\t\t\t}\n\t\t}\n\t\tif ($valid_branch == \"true\") {\n\t\t\tfwrite($fileHandle, $repo . \"=enabled\\n\");\n\t\t\t$valid_branch = \"false\";\n\t\t}\n\t\telse {\n\t\t\tfwrite($fileHandle, $repo . \"=disabled\\n\");\n\t\t}\t\t\n\t}\n\tfclose($fileHandle);\n\t// may need to put in a semaphore here\n\tcopy($outFileNew, $outFileOrig);\n}", "function stockDecrement($product, $quantity)\n{\n\tinclude 'setup.php';\n\n\tclearstatcache();\n\tif(file_exists($STOCKFILE) && is_readable($STOCKFILE) && filesize($STOCKFILE) > 0)\n\t{\n\t\t$handle = fopen($STOCKFILE, \"r+\");\n\t\tflock($handle, 2);\t// get an exclusive lock\n\n\t\t$stocks = unserialize(fread($handle, filesize($STOCKFILE)));\n\t\tif($stocks == FALSE)\n\t\t{\n\t\t\t$retval = -2;\t// error reading stocks\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(($stocks[$product][instock] - $quantity) < 0)\n\t\t\t{\n\t\t\t\t$retval = -1;\t// not enough available\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$stocks[$product][instock] -= $quantity;\n\t\t\t\t$retval = $stocks[$product][instock];\n\t\t\t\t$stocks[$product][sold] += $quantity;\n\n\t\t\t\trewind($handle);\n\t\t\t\tif(fwrite($handle, serialize($stocks), strlen(serialize($stocks))) == FALSE)\n\t\t\t\t\t$retval = -2;\t// error storing new stock amounts\n\t\t\t}\n\t\t}\n\n\t\tflock($handle, 3);\t// release lock again\n\t\tfclose($handle);\n\t}\n\telse\n\t\t$retval = -1;\n\n\treturn $retval;\n}", "protected function processChangedAndNewFiles() {}", "private function downloadHistoricFile($filename)\n\t{\n\t\t$this->ftpConnection->getOne($filename, $this->localdir . \"/\" . $filename);\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 testBackup_website_only_changed_files() {\n\t\t$this->testBackup_website_full_successful_backup();\n\t\tsleep( 1 );\n\n\t\t$this->writeToFiles();\n\t\t$this->mock_dropbox_facade->reset_files_processed();\n\n\t\t$this->config->set_in_progress( true );\n\t\t$this->config->log( WP_Backup::BACKUP_STATUS_STARTED );\n\n\t\t$this->backup = new WP_Backup( $this->mock_dropbox_facade, $this->config );\n\n\t\t$this->assertTrue( $this->backup->backup_path( ABSPATH, './') );\n\t\t$this->config->log( WP_Backup::BACKUP_STATUS_FINISHED );\n\n\t\t$files_processed = $this->mock_dropbox_facade->get_files_processes();\n\n\t\t$this->assertNotEmpty( $files_processed );\n\t\t$this->assertEquals( 2, count( $files_processed ) );\n\n\t\t$dir = dirname( __FILE__ );\n\t\t$expected = array(\n\t\t\t\"$dir/Out/changed_file_one.txt\",\n\t\t\t\"$dir/Out/changed_file_two.txt\",\n\t\t);\n\n\t\t$this->assertEquals( $expected, $files_processed );\n\n\t\t$this->writeToFiles( 1 );\n\t\t$this->mock_dropbox_facade->reset_files_processed();\n\n\t\t$this->config->log( WP_Backup::BACKUP_STATUS_STARTED );\n\t\t$this->assertTrue( $this->backup->backup_path( ABSPATH, 'Out') );\n\t\t$this->config->log( WP_Backup::BACKUP_STATUS_FINISHED );\n\n\t\t$files_processed = $this->mock_dropbox_facade->get_files_processes();\n\n\t\t$this->assertNotEmpty( $files_processed );\n\t\t$this->assertEquals( 1, count( $files_processed ) );\n\n\t\t$dir = dirname( __FILE__ );\n\t\t$expected = array(\n\t\t\t\"$dir/Out/changed_file_one.txt\",\n\t\t);\n\n\t\t$this->assertEquals( $expected, $files_processed );\n\t}", "public function transferWarehouseProductToMagentoStockItem();", "public function updated(Stock $stock)\n {\n $product = Product::find($stock->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($stock->product_id);\n $product->save();\n }", "function do_process_update()\n{\n global $dbh;\n check_post_token();\n # iterate through the POST keys. If they contain a ; then they must\n # be product codes.\n $amounts_to_update = Array(); # Array of arrays (product_code, product_id, qty)\n foreach ($_POST as $key => $value) {\n if (strpos($key, ';') !== FALSE) {\n # Product code, from \"reference\" column.\n $product_id = get_product_id_by_reference($key);\n $qty = (float) $value;\n if ($qty > 0) {\n $amounts_to_update[] = Array($key, $product_id, $qty);\n tfc_log_to_db($dbh, \"Found product: $key adding stock: $qty\");\n }\n }\n }\n $location = '0'; # Stock location ID, from locations table.\n tfc_log_to_db($dbh, \"Updating stocks...\");\n $dbh->beginTransaction();\n foreach ($amounts_to_update as $amount) {\n list ($product_code, $product_id, $qty) = $amount;\n # If we have no record in stockcurrent, add one.\n $stockcurrent_st = $dbh->prepare(\"SELECT COUNT(*) FROM stockcurrent\" .\n \" WHERE product=? AND location=?\");\n $stockcurrent_st->execute(Array($product_id, $location));\n $stockcurrent_row = $stockcurrent_st->fetch();\n if ($stockcurrent_row[0]) {\n # Stock already exists.\n } else {\n # Need to insert a new row.\n # With initially zero stock, we will immediately update it.\n $dbh->prepare(\"INSERT INTO stockcurrent (product, location, units) \".\n \" VALUES (?,?,0)\")\n ->execute(Array($product_id, $location));\n }\n # Update the stock\n $dbh->prepare(\"UPDATE stockcurrent SET units = units + ? \" .\n \" WHERE product=? AND location = ?\")\n ->execute(Array($qty, $product_id, $location));\n # Create stock movement in diary.\n $dbh->prepare(\"INSERT INTO stockdiary (ID, datenew, reason, \" .\n \" location, product, units, price) VALUES (uuid(), NOW(),?,?,?,?, \".\n \" (select pricebuy from products where id=?) )\")\n ->execute(Array( 1, # Reason 1 = incoming\n $location, $product_id, $qty, $product_id));\n }\n tfc_log_to_db($dbh, \"Stock update complete.\");\n $dbh->commit();\n return $amounts_to_update;\n}", "public function updateStock()\n {\n// foreach($this->detalle_compras as $detalle)\n// {\n// $producto= Producto::model()->findByPk($detalle->producto);\n// $producto->stock+=$detalle->cantidad;\n// $producto->save();\n// }\n }", "function saveRepo($name) {\n\tglobal $repos, $counter;\n\t$counter++;\n\tif(!array_key_exists($name, $repos)) {\n\t\t$repos[$name] = $name;\n\t\tfile_put_contents('repos.txt', implode(\"\\r\\n\",$repos));\n\t\t//echo sizeof($repos).\"/$counter\\n\";\n\t}\n}", "function writeGames($new) {\n\tfile_put_contents(\"data/games.json\", json_encode($new));\n\n\treturn $new;\n}", "function update_magento_stocks($token,$items){\r\n\r\n $headers = array('Content-Type:application/json','Authorization:Bearer '.$token);\r\n\r\n $ch = curl_init();\r\n\r\n foreach($items as $item){\r\n \r\n try {\r\n $apiProdUrl = \"https://your-domain/rest/V1/products/\".$item[\"code\"];\r\n \r\n $product = [ \r\n \"product\" => [ \r\n \"sku\" => $item[\"code\"],\r\n \"extension_attributes\"=> [ \r\n \"stock_item\"=> [ \r\n \"qty\"=> $item[\"stock\"],\r\n \"is_in_stock\"=> 1\r\n ]\r\n ]\r\n ]\r\n ];\r\n \r\n \r\n $product_string = json_encode($product);\r\n \r\n $ch = curl_init();\r\n curl_setopt($ch,CURLOPT_URL, $apiProdUrl);\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $product_string);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n $response = curl_exec($ch);\r\n \r\n $response = json_decode($response, TRUE);\r\n curl_close($ch);\r\n \r\n echo \"Item with sku: \". $item[\"code\"] . \" updated into magento!\";\r\n \r\n }\r\n catch(Exception $e){\r\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n }\r\n\r\n }\r\n\r\n \r\n \r\n\r\n\r\n}", "public function restored(Stock $stock)\n {\n //\n }", "function updateLogged($aUnQuery, $aFileName) {\r\n echo \"</br><b>maintenance started</b></br>\";\r\n $fileAr = file($aFileName);\r\n $uidCtr = 0;\r\n\r\n foreach ($fileAr as $i => $elem) {\r\n $line = $fileAr[$i];\r\n $delim = ':';\r\n $data = str_getcsv($line, $delim);\r\n\r\n if ($data[1] == 0) {\r\n $sqlError = sqlUnsubscribe($aUnQuery, $data[0]);\r\n if($sqlError == false){\r\n $data[1] = 1;\r\n $fileAr[$i] = $data[0] . $delim . $data[1] . \"\\n\";\r\n echo \"</br>Unsubscribing: \" . $data[0];\r\n $uidCtr++;\r\n } else {\r\n echo \"</br>Error with database connection.\";\r\n break;\r\n }\r\n }\r\n }\r\n file_put_contents($aFileName, implode('', $fileAr), LOCK_EX);\r\n \r\n echo \"</br><b>maintenance finished - UUIDs processed: </b>\" . ($uidCtr - 1)\r\n . \"</br>\";\r\n}", "function WriteForexDataFromFile()\n{\n\t$uscny_sql = new UscnyHistorySql();\n\t$hkcny_sql = new HkcnyHistorySql();\n $file = fopen('/debug/cny2018.csv', 'r');\n// $file = fopen('/debug/cny2017.csv', 'r');\n// $file = fopen('/debug/cny2016.csv', 'r');\n// $file = fopen('/debug/cny2015.csv', 'r');\n// $file = fopen('/debug/cny2014.csv', 'r');\n if ($file == false)\n {\n \tDebugString('Can not open read file');\n \treturn;\n }\n \n while (!feof($file))\n {\n $strLine = fgets($file);\n $arWord = explode(',', $strLine);\n if (count($arWord) >= 5)\n {\n \t$strDate = $arWord[0];\n \t$strUSD = $arWord[1];\n \t$strHKD = $arWord[4];\n// \tDebugString($strDate.' '.$strUSD.' '.$strHKD);\n \t\n \t\t$uscny_sql->Write($strDate, $strUSD);\n \t\t$hkcny_sql->Write($strDate, $strHKD);\n }\n }\n fclose($file);\n}", "public function writeData($data, $instrument_code, $file)\n {\n\n $data = $data->groupBy('market_id');\n\n $strToadd = '';\n\n foreach ($data as $trade_date => $instrumentData) {\n\n $instrumentData = $instrumentData->unique('total_volume')->values();\n\n\n $i = 0;\n foreach ($instrumentData as $row) {\n $last_minute_total_volume = $row->total_volume;\n\n if (isset($instrumentData[$i + 1]))\n $prev_minute_of_lastminute_volume = $instrumentData[$i + 1]->total_volume;\n else\n {\n $prev_minute_of_lastminute_volume = 0;\n\n }\n\n\n $last_minute_traded_vol = $last_minute_total_volume - $prev_minute_of_lastminute_volume;\n\n if($last_minute_traded_vol<0) // skip some negative value specially for dsex\n continue;\n\n $time_formated = $row['lm_date_time']->format('H:i');\n $date_formated = $row['lm_date_time']->format('d/m/Y');\n\n\n if ($this->debug) {\n $strToadd .= $instrument_code . ',' . $time_formated . ',' . $date_formated . ',' . $row->close_price . ',' . $row->close_price . ',' . $row->close_price . ',' . $row->close_price . ',' . $last_minute_traded_vol . ',' . $row->total_volume . \"\\n\";\n dump(\"last_minute_total_volume=$last_minute_total_volume | prev_minute_of_lastminute_volume=$prev_minute_of_lastminute_volume = $last_minute_traded_vol\");\n } else {\n $strToadd .= $instrument_code . ',' . $time_formated . ',' . $date_formated . ',' . $row->close_price . ',' . $last_minute_traded_vol . \"\\n\";\n\n }\n\n $i++;\n }\n\n\n }\n\n Storage::append($file, $strToadd);\n\n if (!$this->debug) {\n $zipper = new \\Chumper\\Zipper\\Zipper;\n $files = glob(storage_path() . '/app/plugin/intra/*');\n $zipper->make(storage_path() . '/app/plugin/intra.zip')->add($files)->close();\n }\n\n\n }", "public function getStock(): int\n {\n return $this->stock;\n }", "function inv_tss(){\n\trequire(\"../includes/resource/db.php\");\n\tset_time_limit(720);\n\t/*\n\techo substr(sprintf('%o', fileperms('shoebuy/')), -4);\n\techo substr(sprintf('%o', fileperms('shoebuy/peppergate-ip.csv')), -4).\"<br>\";\n\t*/\n\t\n\t/* ************************************************************************ */\n\t/* ***************** Variables to change for each vendor ****************** */\n\t/* ************************************************************************ */\n\t\n\t$name = \"theshoestore/tssinv.csv\";\n\t//header\n\t$line = \"ProductId,AO_Code,AO_Sufix,AO_Name,AO_Cost,AO_stock,AO_Weight\\r\\n\";\n\t$company = \"ALG\";\n\t$replenishmentdate = \"\";\n\t$season = \"ALG5\";\n\t\n\t$ao_code = \"2272\";\n\t/* ************************************************************************ */\n\t/* ************** EOF Variables to change for each vendor ***************** */\n\t/* ************************************************************************ */\n\t\n\t\n\t\n\t$file = fopen( $name, \"w\" );\n\t\n\t$time = date(\"H_i_s\");\n\n\t\n\t$linkID = mysql_connect($inhost, $inuser, $inpass) or die ('Error connecting to mysql');\n\tmysql_select_db($indatabase, $linkID);\n\t\n\t$query = \"SELECT * FROM $intable WHERE class = '\".$season.\"' ORDER BY itemNo ASC\";\n\t//$query = \"SHOW COLUMNS FROM $intable WHERE class = '\".$season.\"' ORDER BY itemNo ASC\";\n\n\n\t$result = mysql_query($query, $linkID) or die(\"Data not found. 1st\"); \n\t\n\t\n\t\n\tfputs($file, $line);\n\t\n\twhile($row = mysql_fetch_assoc($result)){\n\t\t\n\t\t\n\t\t\n\t\t//loop through size 35 to 42\n\t\tif(strpos($row['color'], 'Exclusive') === false){ \n\t\t\tif(strpos($row['color'], 'Scrubwear') === false){\t\n\t\t\t\n\t\t\tinclude(\"resource/variables_mysql.php\");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$tmpUPC\t\t=trim($row1['UPC_CD'],\" \");\n\t\t\t\n\t/* ************************************************************************ */\n\t/* ***************** Variables to change for each vendor ****************** */\n\t/* ************************************************************************ */\t\n\t\t\tif ($tmpStock <= 10){ $tmpStock = 0;} else { $tmpStock = $tmpStock;}\n\t\t\t\n\t\t\tif ($tmpSize == 35){ $sizeChart = \"35 (US 5 - 5.5)\";}\n\t\t\tif ($tmpSize == 36){ $sizeChart = \"36 (US 6 - 6.5)\";}\n\t\t\tif ($tmpSize == 37){ $sizeChart = \"37 (US 7 - 7.5)\";}\n\t\t\tif ($tmpSize == 38){ $sizeChart = \"38 (US 8 - 8.5)\";}\n\t\t\tif ($tmpSize == 39){ $sizeChart = \"39 (US 9 - 9.5)\";}\n\t\t\tif ($tmpSize == 40){ $sizeChart = \"40 (US 10)\";}\n\t\t\tif ($tmpSize == 41){ $sizeChart = \"41 (US 10.5)\";}\n\t\t\tif ($tmpSize == 42){ $sizeChart = \"42 (US 11)\";}\n\t\t\t\n\t\t/*\tif ($tmpItemNo == \"ALG-101\"){$pID = \"1\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-112\"){$pID = \"2\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-117\"){$pID = \"3\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-123\"){$pID = \"4\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-124\"){$pID = \"5\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-126\"){$pID = \"6\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-205\"){$pID = \"7\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-206\"){$pID = \"8\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-211\"){$pID = \"9\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-311\"){$pID = \"10\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-316\"){$pID = \"11\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-ASP-6146\"){$pID = \"49\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-ASP-6156\"){$pID = \"50\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-101\"){$pID = \"51\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-123\"){$pID = \"52\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-126\"){$pID = \"53\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-419\"){$pID = \"54\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-423\"){$pID = \"55\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-601\"){$pID = \"56\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-602\"){$pID = \"57\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-604\"){$pID = \"58\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-CAR-611\"){$pID = \"59\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DEB-600\"){$pID = \"60\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DEB-601\"){$pID = \"61\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-114\"){$pID = \"62\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-314\"){$pID = \"63\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-315\"){$pID = \"64\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-339\"){$pID = \"65\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-515\"){$pID = \"66\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-516\"){$pID = \"67\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-517\"){$pID = \"68\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-519\"){$pID = \"69\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-600\"){$pID = \"70\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-DON-601\"){$pID = \"71\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-101\"){$pID = \"72\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-102\"){$pID = \"73\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-205\"){$pID = \"74\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-206\"){$pID = \"75\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-211\"){$pID = \"76\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-326\"){$pID = \"77\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-327\"){$pID = \"78\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-345\"){$pID = \"79\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-346\"){$pID = \"80\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-347\"){$pID = \"81\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-412\"){$pID = \"82\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-416\"){$pID = \"83\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-420\"){$pID = \"84\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-507\"){$pID = \"85\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-509\"){$pID = \"86\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-601\"){$pID = \"87\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-205\"){$pID = \"96\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-206\"){$pID = \"97\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-211\"){$pID = \"98\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-305\"){$pID = \"99\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-604\"){$pID = \"100\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAR-611\"){$pID = \"101\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-101\"){$pID = \"102\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-112\"){$pID = \"103\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-123\"){$pID = \"104\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-124\"){$pID = \"105\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-205\"){$pID = \"106\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-206\"){$pID = \"107\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-208\"){$pID = \"108\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-209\"){$pID = \"109\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-211\"){$pID = \"110\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-311\"){$pID = \"111\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-323\"){$pID = \"112\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-324\"){$pID = \"113\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-325\"){$pID = \"114\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-333\"){$pID = \"115\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-334\"){$pID = \"116\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-402\"){$pID = \"117\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-406\"){$pID = \"118\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-407\"){$pID = \"119\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-410\"){$pID = \"120\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-421\"){$pID = \"121\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-424\"){$pID = \"122\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-504\"){$pID = \"123\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-514\"){$pID = \"124\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-600\"){$pID = \"125\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-601\"){$pID = \"126\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-602\"){$pID = \"127\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-604\"){$pID = \"128\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-701\"){$pID = \"129\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-702\"){$pID = \"130\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-802\"){$pID = \"131\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PAL-804\"){$pID = \"132\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-101\"){$pID = \"133\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-123\"){$pID = \"134\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-126\"){$pID = \"135\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-604\"){$pID = \"136\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-611\"){$pID = \"137\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-615\"){$pID = \"138\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-PIS-618\"){$pID = \"139\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-420\"){$pID = \"168\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-422\"){$pID = \"169\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-604\"){$pID = \"170\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-611\"){$pID = \"171\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-TUS-614\"){$pID = \"172\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-999\"){$pID = \"224\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-999W\"){$pID = \"225\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-205\"){$pID = \"226\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-206\"){$pID = \"227\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-211\"){$pID = \"228\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-412\"){$pID = \"229\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-416\"){$pID = \"230\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-508\"){$pID = \"231\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-521\"){$pID = \"232\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-601\"){$pID = \"233\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SED-602\"){$pID = \"234\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-101\"){$pID = \"235\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-1121\"){$pID = \"236\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-122\"){$pID = \"237\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-1231\"){$pID = \"238\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-126\"){$pID = \"239\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-3211\"){$pID = \"240\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-3221\"){$pID = \"241\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-339\"){$pID = \"242\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-5211\"){$pID = \"243\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-5221\"){$pID = \"244\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-5231\"){$pID = \"245\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-525\"){$pID = \"246\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-600\"){$pID = \"247\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-601\"){$pID = \"248\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-602\"){$pID = \"249\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-701\"){$pID = \"250\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-702\"){$pID = \"251\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-711\"){$pID = \"252\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-SEV-712\"){$pID = \"253\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-101\"){$pID = \"254\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-123\"){$pID = \"255\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-126\"){$pID = \"256\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-305\"){$pID = \"257\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-422\"){$pID = \"258\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-423\"){$pID = \"259\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-604\"){$pID = \"260\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-VER-611\"){$pID = \"261\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAD-101\"){$pID = \"262\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAD-126\"){$pID = \"263\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-MAD-420\"){$pID = \"264\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-709\"){$pID = \"265\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-320\"){$pID = \"266\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-321\"){$pID = \"267\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-322\"){$pID = \"268\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-323\"){$pID = \"269\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-330\"){$pID = \"270\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-336\"){$pID = \"271\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-337\"){$pID = \"272\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-407\"){$pID = \"273\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-410\"){$pID = \"274\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-412\"){$pID = \"275\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-416\"){$pID = \"276\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-421\"){$pID = \"277\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-424\"){$pID = \"278\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-504\"){$pID = \"279\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-505\"){$pID = \"280\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-509\"){$pID = \"281\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-511\"){$pID = \"282\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-512\"){$pID = \"283\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-513\"){$pID = \"284\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-601\"){$pID = \"285\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-602\"){$pID = \"286\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-604\"){$pID = \"287\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-701\"){$pID = \"288\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-702\"){$pID = \"289\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-709\"){$pID = \"290\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-714\"){$pID = \"291\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-715\"){$pID = \"292\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-716\"){$pID = \"293\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-802\"){$pID = \"294\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-804\"){$pID = \"295\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-814\"){$pID = \"296\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-925\"){$pID = \"297\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-710\"){$pID = \"298\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-713\"){$pID = \"299\";}\t\n\t\t\tif ($tmpItemNo == \"ALG-FEL-714\"){$pID = \"300\";}\t\n\t\t\t*/\n\t\t\tif ($tmpItemNo == \"ALG-128\"){$pID = \"375\";}\n\t\t\tif ($tmpItemNo == \"ALG-381\"){$pID = \"376\";}\n\t\t\tif ($tmpItemNo == \"ALG-382\"){$pID = \"377\";}\n\t\t\tif ($tmpItemNo == \"ALG-383\"){$pID = \"378\";}\n\t\t\tif ($tmpItemNo == \"ALG-535\"){$pID = \"379\";}\n\t\t\tif ($tmpItemNo == \"ALG-536\"){$pID = \"380\";}\n\t\t\tif ($tmpItemNo == \"ALG-537\"){$pID = \"381\";}\n\t\t\tif ($tmpItemNo == \"ALG-631\"){$pID = \"382\";}\n\t\t\tif ($tmpItemNo == \"ALG-633\"){$pID = \"383\";}\n\t\t\tif ($tmpItemNo == \"ALG-635\"){$pID = \"384\";}\n\t\t\tif ($tmpItemNo == \"ALG-637\"){$pID = \"385\";}\n\t\t\tif ($tmpItemNo == \"ALG-723\"){$pID = \"386\";}\n\t\t\tif ($tmpItemNo == \"ALG-ABB-362\"){$pID = \"387\";}\n\t\t\tif ($tmpItemNo == \"ALG-ABB-363\"){$pID = \"388\";}\n\t\t\tif ($tmpItemNo == \"ALG-ABB-526\"){$pID = \"389\";}\n\t\t\tif ($tmpItemNo == \"ALG-BAL-101\"){$pID = \"390\";}\n\t\t\tif ($tmpItemNo == \"ALG-BAL-201\"){$pID = \"391\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-201\"){$pID = \"392\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-204\"){$pID = \"393\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-241\"){$pID = \"394\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-242\"){$pID = \"395\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-246\"){$pID = \"396\";}\n\t\t\tif ($tmpItemNo == \"ALG-CAR-247\"){$pID = \"397\";}\n\t\t\tif ($tmpItemNo == \"ALG-CHA-101\"){$pID = \"398\";}\n\t\t\tif ($tmpItemNo == \"ALG-CHA-702\"){$pID = \"399\";}\n\t\t\tif ($tmpItemNo == \"ALG-CHA-703\"){$pID = \"400\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-103\"){$pID = \"401\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-353\"){$pID = \"402\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-354\"){$pID = \"403\";}\n\t\t\tif ($tmpItemNo == \"ALG-DAY-624\"){$pID = \"404\";}\n\t\t\tif ($tmpItemNo == \"ALG-DEB-731\"){$pID = \"405\";}\n\t\t\tif ($tmpItemNo == \"ALG-DEB-732\"){$pID = \"406\";}\n\t\t\tif ($tmpItemNo == \"ALG-DON-129\"){$pID = \"407\";}\n\t\t\tif ($tmpItemNo == \"ALG-DON-354\"){$pID = \"408\";}\n\t\t\tif ($tmpItemNo == \"ALG-DON-550\"){$pID = \"409\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-181\"){$pID = \"410\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-551\"){$pID = \"411\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-552\"){$pID = \"412\";}\n\t\t\tif ($tmpItemNo == \"ALG-FEL-555\"){$pID = \"413\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-556\"){$pID = \"414\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-557\"){$pID = \"415\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-600\"){$pID = \"416\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAI-601\"){$pID = \"417\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-347\"){$pID = \"418\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-349\"){$pID = \"419\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-522\"){$pID = \"420\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-537\"){$pID = \"421\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-701\"){$pID = \"422\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-705\"){$pID = \"423\";}\n\t\t\tif ($tmpItemNo == \"ALG-KAR-951\"){$pID = \"424\";}\n\t\t\tif ($tmpItemNo == \"ALG-KLE-101\"){$pID = \"425\";}\n\t\t\tif ($tmpItemNo == \"ALG-KLE-137\"){$pID = \"426\";}\n\t\t\tif ($tmpItemNo == \"ALG-KLE-723\"){$pID = \"427\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-133\"){$pID = \"428\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-210\"){$pID = \"429\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-411\"){$pID = \"430\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-522\"){$pID = \"431\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-642\"){$pID = \"432\";}\n\t\t\tif ($tmpItemNo == \"ALG-PAL-645\"){$pID = \"433\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-624\"){$pID = \"434\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-641\"){$pID = \"435\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-643\"){$pID = \"436\";}\n\t\t\tif ($tmpItemNo == \"ALG-PES-647\"){$pID = \"437\";}\n\t\t\tif ($tmpItemNo == \"ALG-SEV-581\"){$pID = \"438\";}\n\t\t\tif ($tmpItemNo == \"ALG-SEV-583\"){$pID = \"439\";}\n\t\t\tif ($tmpItemNo == \"ALG-TUS-553\"){$pID = \"440\";}\n\t\t\tif ($tmpItemNo == \"ALG-TUS-723\"){$pID = \"441\";}\n\t\t\tif ($tmpItemNo == \"ALG-TUS-951\"){$pID = \"442\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-601\"){$pID = \"443\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-703\"){$pID = \"444\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-705\"){$pID = \"445\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-706\"){$pID = \"446\";}\n\t\t\tif ($tmpItemNo == \"ALG-VER-710\"){$pID = \"447\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-210\"){$pID = \"448\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-553\"){$pID = \"449\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-601\"){$pID = \"450\";}\n\t\t\tif ($tmpItemNo == \"ALG-VIO-720\"){$pID = \"451\";}\n\n\t\n\n\t\t\t//content/data\n\t\t\t//$line = $pID.\",\".$row['DESCRIP'].\",,\".$tmpItemNo.\"-\".$tmpSize.\",\".$sizeChart.\",0,\".$tmpStock.\",0\\r\\n\";\n\t\t\t$line = $pID.\",\".$ao_code.\",\".$tmpItemNo.\"-\".$tmpSize.\",\".$sizeChart.\",0,\".$tmpStock.\",0\\r\\n\";\n\t\t\t\n\t\t\t$ao_code++;\n\t\t\t\n\t/* ************************************************************************ */\n\t/* ************** EOF Variables to change for each vendor ***************** */\n\t/* ************************************************************************ */\n\t\t\t\t//echo $line.\"<br>\";\n\t\t\t\tfputs($file, $line);\n\t\t\t}\n\t\t}\n\t\t\t\n\t}\n\tfclose($file);\n\techo \"TSS created<br>\";\n}", "public static function updateStockHistory($partId,$refNo,$qty,$text){\n $stockHistory = new StockHistory();\n $stockHistory->part_id = $partId;\n $stockHistory->type = $text;\n $stockHistory->qty = $qty;\n $stockHistory->reference_no = $refNo;\n $stockHistory->related_user = Yii::$app->user->identity->id;\n $stockHistory->datetime = date(\"Y-m-d H:i:s\");\n $stockHistory->save();\n\n }", "function sellStock($data){\n //retrieve data and set variables accordingly\n $sym = $data[\"Symbol\"];\n $username = $data[\"Username\"];\n $qtyRequested = $data[\"Quantity\"];\n \n //grab the information needed\n $jsonObj = getInfo($sym);\n //decode the structure\n $newObj = json_decode($jsonObj);\n //Single out the Closing price aka Current Price\n $currentCost = $newObj->Close[0];\n //var_dump($newObj->Close[0]); //display the closing price\n\n //check how many of the stock you own\n $qtyYouOwn = getStockQuantity($username,$sym);\n \n //Make sure you have more or equal qty in portfolio compared to what you wanna sell\n if($qtyYouOwn >= $qtyRequested)\n {\n //Calculate the total value of your sell.\n $totalValue = $currentCost * $qtyRequested;\n }\n else //Placeholder for now, should probably not do this.\n {\n //Sell only the amount that you have in portfolio\n $totalValue = $currentCost * $qtyYouOwn;\n }\n \n \n //Call addtoAccountBalance and add $totalValue to the account balance\n $currentBalance = addtoAccountBalance($username,$totalValue,$sym);\n \n //Call deleteFromPortfolioDB and delete the previous entry\n deleteFromPortfolioDB($username, $qtyRequested, $sym);\n\n $returnString = \"Sell Order Confirmed!\";\n \n return($returnString);\n}", "public function addMarkToFile( ){\n if( isset( $GLOBALS['config']['dir_database'] ) ){\n file_put_contents( $GLOBALS['config']['dir_database'].'database-last-modification', time( ) );\n }\n }", "function createHistory(RosaSymbol $symbol) {\n $symbolName = $symbol->getName();\n $startDay = (int)$symbol->getHistoryStartM1('U'); // FXT\n $startDay -= $startDay%DAY; // 00:00 FXT Starttag\n $today = ($today=fxTime()) - $today%DAY; // 00:00 FXT aktueller Tag\n\n\n // MT4-HistorySet erzeugen\n $config = Application::getConfig();\n $directory = $config['app.dir.data'].'/history/mt4/'.$config['rt.metatrader.server-name'];\n $hstSet = HistorySet::create($symbol, $format=400, $directory);\n\n\n // Gesamte Zeitspanne tageweise durchlaufen\n for ($day=$startDay, $lastMonth=-1; $day < $today; $day+=1*DAY) {\n $shortDate = gmdate('D, d-M-Y', $day);\n $month = (int) gmdate('m', $day);\n if ($month != $lastMonth) {\n echoPre('[Info] '.gmdate('M-Y', $day));\n $lastMonth = $month;\n }\n\n // ausser an Wochenenden: RT-History verarbeiten\n if (!isWeekend($day)) {\n if (is_file($file=getVar('rtFile.compressed', $symbolName, $day))) {} // wenn komprimierte RT-Datei existiert\n else if (is_file($file=getVar('rtFile.raw' , $symbolName, $day))) {} // wenn unkomprimierte RT-Datei existiert\n else {\n echoPre('[Error] '.$symbolName.' Rosatrader history for '.$shortDate.' not found');\n return false;\n }\n // Bars einlesen und der MT4-History hinzufuegen\n $bars = Rost::readBarFile($file, $symbolName);\n $hstSet->appendBars($bars);\n }\n Process::dispatchSignals(); // check for Ctrl-C\n }\n $hstSet->close();\n\n echoPre('[Ok] '.$symbolName);\n return true;\n}", "public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }", "public static function postUpdate(Event $event) {\n $composer = $event->getComposer();\n $io = $event->getIO();\n $executor = new ProcessExecutor($io);\n $command = 'git -C %s rev-parse --abbrev-ref HEAD';\n $branch_result = self::executeCommand($executor, $command, getcwd());\n $branch_name = trim($branch_result);\n $extra = $event->getComposer()->getPackage()->getExtra();\n\n if (isset($extra['drupal-env'])) { \n $drupal_env_extra = $extra['drupal-env'];\n foreach ($drupal_env_extra as $filename => $filename_mapping) {\n $file_path = self::getFilePath($event, $filename);\n if (!isset($filename_mapping[$branch_name])) {\n $io->write('<comment>DrupalEnv: no actions taken for branch '. trim($branch_name) . '</comment>');\n continue;\n }\n $source_filename = $filename_mapping[$branch_name];\n $source_filepath = self::getFilePath($event, $source_filename);\n if (!file_exists($file_path)) {\n $io->write('<error>Skipping file ' . $file_path . '. File does not exists.</error>');\n }\n else {\n if (!file_exists($source_filepath)) {\n $io->write('<error>Source file ' . $source_filename . ' does not exists. Skipping...</error>');\n }\n else {\n // Replace the destinatio file with the source file.\n if (!copy($source_filepath, $file_path)) {\n $io->write('<error>Cannot copy ' . $source_filename . ' to ' . $filepath . '</error>');\n }\n }\n }\n }\n }\n }", "public static function stockOut($partId,$quantitySelected) {\n $stocks = Stock::find()->where(['part_id' => $partId])->andWhere(['>','quantity','0'])->all();\n $data = array();\n $quantityNeeded = $quantitySelected;\n foreach ($stocks as $stock){\n $stockId = $stock->id;\n\n /* if quantity needed already fulfilled */\n if ( $quantityNeeded > 0 ) {\n $data['stock_id'][] = $stockId;\n $stockQuantity = $stock->quantity;\n /* if st_qty is enough for stock out */\n if ( $stockQuantity >= $quantityNeeded ) {\n /* A :: stock 11 .... selected 10 */\n /* deduct stock quantity see how much left */\n $stockQuantity -= $quantityNeeded;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $quantityNeeded;\n\n /* set quantity to zero as the stock is already enough */\n $quantityNeeded = 0;\n /* A :: stockQuantity become 1 */\n\n\n } else if ( $stockQuantity < $quantityNeeded) {\n /* B :: stock 10 .... selected 11 */\n /* see how many more stock needed */\n $quantityNeeded -= $stockQuantity;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $stockQuantity;\n \n /* set stockQuantity to zero as all the stock will be used for the needed */\n $stockQuantity = 0;\n /* A :: stockQuantity become 0 */\n }\n\n /* AB :: update stock quantity */\n $updateStock = Stock::find()->where(['id' => $stockId])->one();\n $updateStock->quantity = $stockQuantity;\n $updateStock->save();\n $data['stock_quantity'][] = $stockQuantity;\n\n }\n }\n \n return $data;\n }", "public function updateStock(Entry $entry)\n {\n\n $account = $entry->getInventoryAccount();\n $prod = $entry->getProduct();\n\n $qty = bcsub($entry->getDebit(), $entry->getCredit(), 2);\n\n // get stock\n $stock_repo = $this->em->getRepository('GistInventoryBundle:Stock');\n $stock = $stock_repo->findOneBy(array('inv_account' => $account, 'product' => $prod));\n if ($stock == null)\n {\n $stock = new Stock($account, $prod, $qty);\n\n // persist the new stock object\n $this->em->persist($stock);\n }\n else\n {\n // add quantity\n $old_qty = $stock->getQuantity();\n $new_qty = bcadd($qty, $old_qty, 2);\n $stock->setQuantity($new_qty);\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 }", "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}", "function update_inventory($store_prod_id, $store_qty, $discontinued, $attribute_id, $status = 1, $website_id = 1, $stock_id = 1)\n\t{\n\t\t$resource\t= Mage::getSingleton('core/resource');\n\t\t$invStockItemTable = $resource->getTableName('cataloginventory_stock_item');\n\t\t$invStockStatusTable = $resource->getTableName('cataloginventory_stock_status');\n\t\t$prodDateTimeTable = $resource->getTableName('catalog_product_entity_datetime');\n\t\t\n\t\t$write \t= $resource->getConnection('core_write');\n\t\t$read = $resource->getConnection('core_read');\n\t\t\n\t\tif ($store_qty <= 0 || $discontinued == 1) {\n\t\t\t$status = 0;\n\t\t} else {\n\t\t\t$status = 1;\n\t\t}\n\t\t\n\t\tif (is_null($store_qty)) {\n\t\t\t$store_qty = 0;\n\t\t\t$status = 0;\n\t\t}\n\t\t\n\t\t$sql\t= \"UPDATE \" . $invStockItemTable . \" \n\t\t\t\t\tSET\tqty = :qty, \n\t\t\t\t\t\tis_in_stock = :is_in_stock \n\t\t\t\t\tWHERE product_id = :product_id \";\n\t\t$binds\t= array(\n\t\t\t'qty'\t\t\t=> $store_qty,\n\t\t\t'is_in_stock'\t=> $status,\n\t\t\t'product_id'\t=> $store_prod_id,\n\t\t);\n\t\t$result = $write->query($sql, $binds);\n\t\t\n\t\t$sql\t= \"SELECT * FROM \" . $invStockStatusTable . \" \n\t\t\t\t\tWHERE product_id\t= :product_id \n\t\t\t\t\tAND website_id \t= :website_id \n\t\t\t\t\tAND stock_id \t= :stock_id \";\n\t\t$binds\t= array(\n\t\t\t'product_id'\t=> $store_prod_id,\n\t\t\t'website_id'\t=> $website_id,\n\t\t\t'stock_id'\t\t=> $stock_id,\n\t\t); \n\t\t$chk = $read->fetchRow($sql, $binds);\n\t\tif (empty($chk)) {\n\t\t\t$sql\t= \"INSERT INTO \" . $invStockStatusTable . \" \n\t\t\t\t\t\t\tSET qty = :qty, \n\t\t\t\t\t\t\tstock_status = :stock_status, \n\t\t\t\t\t\t\tstock_id = :stock_id, \n\t\t\t\t\t\t\twebsite_id = :website_id, \n\t\t\t\t\t\t\tproduct_id = :product_id \";\n\t\t\t\t\t\t\t\n\t\t\t$binds\t= array(\n\t\t\t\t'qty'\t\t\t=> $store_qty,\n\t\t\t\t'stock_status'\t=> $status,\n\t\t\t\t'stock_id'\t\t=> $stock_id,\n\t\t\t\t'website_id'\t=> $website_id,\n\t\t\t\t'product_id'\t=> $store_prod_id,\n\t\t\t);\n\t\t\t$result2 = $write->query($sql, $binds);\n\t\t} else { // do update \n\t\t\t$sql\t= \"UPDATE \" . $invStockStatusTable . \"\n\t\t\t\t\t\t\tSET\tqty = :qty, stock_status = :stock_status \n\t\t\t\t\t\t\tWHERE product_id = :product_id \";\n\t\t\t$binds\t= array(\n\t\t\t\t'qty'\t\t\t=> $store_qty,\n\t\t\t\t'stock_status'\t=> $status,\n\t\t\t\t'product_id'\t=> $store_prod_id,\n\t\t\t);\n\t\t\t$result2 = $write->query($sql, $binds);\n\t\t}\n\t\t\n\t\t// Update saleswarp_last_inventory_update fields \n\t\t$sql = \"SELECT * FROM \" . $prodDateTimeTable . \" \n\t\t\t\t\tWHERE entity_type_id = 4 \n\t\t\t\t\tAND entity_id = $store_prod_id\n\t\t\t\t\tAND attribute_id = $attribute_id\";\n\t\t$chk = $read->fetchAll($sql);\n\t\t\n\t\tif (empty($chk)) { // insert it \n\t\t\t$sql\t= \"INSERT INTO \" . $prodDateTimeTable . \" \n\t\t\t\t\t\tSET value = NOW(), \n\t\t\t\t\t\tentity_type_id = 4,\n\t\t\t\t\t\tstore_id = 0, \n\t\t\t\t\t\tentity_id = $store_prod_id, \n\t\t\t\t\t\tattribute_id = $attribute_id\";\n\t\t$insert_result = $write->query($sql);\n\t\t} else { // update it \n\t\t$sql\t= \"UPDATE \" . $prodDateTimeTable . \" \n\t\t\t\t\t\tSET value = NOW()\n\t\t\t\t\t\tWHERE entity_type_id = 4 \n\t\t\t\t\t\tAND entity_id = $store_prod_id\n\t\t\t\t\t\tAND attribute_id = $attribute_id\"; \n\t\t$update_result = $write->query($sql);\n\t\t}\n\t\t\n\t\tif ($result && $result2) {\n\t\t\treturn \"Saved inventory record\";\n\t\t} else {\n\t\t\treturn \"FAILED save() inventory update\";\n\t\t}\n\t}", "function buyPotential ($api, $moduleName, $currentPercent, $folioEntry, $totalValue, $price) {\n\t$filename = $moduleName. '-'. $folioEntry['pairSymbol'].'-';\n\n\t$filepath = 'indic/' . $filename . 'ohlcOld.json';\n\t$ohlcOld = file_get_contents($filepath);\n\t$ohlcOld = json_decode($ohlcOld, true);\n\n\t$filepath = 'indic/' . $filename . 'emaSet.json';\n\t$emaSet = file_get_contents($filepath);\n\t$emaSet = json_decode($emaSet, true);\n\n\t$filepath = '' . $moduleName . '-main.json';\n\t$main = file_get_contents($filepath);\n\t$main = json_decode($main, true);\n\n\n\tend($ohlcOld);\n\t$lastKey = key($ohlcOld);\n\n\t$pairSymbol = $folioEntry['pairSymbol'];\n\t$haystack = array_column($main, 'pairSymbol');\n\t$mainEntry = array_search($pairSymbol, $haystack, TRUE);\n\n\t$mainLast = count($main)-1;\n\n global $exchange;\n $price = getPrice ($api, $exchange, $pairSymbol);\n\n\tif (!isset($price)) {\n\t\tprint ('no price');\n\t}\n\n\n\t// Buy if lower than threshold\n\tif ($currentPercent>1 && $ohlcOld[$lastKey]['close']>$emaSet[$lastKey]['priceEMAMed'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent']-$currentPercent;\n\t\t$dev = round($dev*$totalValue/100, 2, PHP_ROUND_HALF_DOWN);\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy-$toBuy*0.004; // fee and drift\n\t\t$newAveragePrice = $main[$mainEntry]['quantity']*$main[$mainEntry]['averageBuyPrice'] + $toBuy * $price;\n\t\t$newAveragePrice = $newAveragePrice/($main[$mainEntry]['quantity'] + $toBuy);\n\t\t$newAveragePrice = round($newAveragePrice,5, PHP_ROUND_HALF_UP);\n\n\t\t$main[$mainEntry]['quantity'] +=$toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $newAveragePrice;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought');\n\t}\n\n\t// Re-buy if preveiously sold all. Only dumpable ones apply.\n\n\tif ($currentPercent<=1 && $ohlcOld[$lastKey]['close']<$ohlcOld[$lastKey-1]['close'] && $emaSet[$lastKey]['priceEMA']>$emaSet[$lastKey]['priceEMASlow'] && isset($price)) {\n\t\t$dev = $folioEntry['targetPercent'];\n\t\t$dev = $dev*$totalValue/100;\n\n\t\t// check there is enough USD\n\t\tif ($main[$mainLast]['quantity']>$dev) {\n\t\t\t\t$toBuy = round($dev/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t} else {\n\t\t\t\t$toBuy = $main[$mainLast]['quantity']*0.92;\n\t\t\t\t$toBuy = round($toBuy/$price, 5, PHP_ROUND_HALF_DOWN);\n\t\t}\n\n\t\t$toBuy = $toBuy- $toBuy*0.004; // fee and drift\n\n\t\t$main[$mainEntry]['quantity'] = $toBuy;\n\t\t$main[$mainEntry]['averageBuyPrice'] = $price;\n\n\t\t$main[$mainLast]['quantity'] -= $dev;\n\n\t\tprint ($folioEntry['pairSymbol'].' bought from zero');\n\t}\n\n\n\n\t$filepath = '' . $moduleName . '-main.json';\n\tfile_put_contents($filepath, json_encode($main));\n}", "function pushFile($source,$hash);", "public function update_wc_product_stock($product) {\n if(isset($product) && $product->managing_stock()) {\n\n\t if( defined( 'WOOCOMMERCE_VERSION' ) && version_compare( WOOCOMMERCE_VERSION, '3.0', '>=' ) ) {\n\t\t if($product instanceof \\WC_Product_Variation) {\n\t $id = $product->get_id();\n\t } else {\n\t $id = $product->get_id();\n\t }\n\n\t\t }\n\t\t else{\n\n\t if($product instanceof \\WC_Product_Variation) {\n\t $id = $product->variation_id;\n\t } else {\n\t $id = $product->get_id();\n\t }\n }\n\n if (isset($_POST[\"product\"])) {\n update_post_meta($id, \"_warehouse_enabled\", 1);\n } else {\n delete_post_meta($id, \"_warehouse_enabled\");\n }\n $repository = new IM_Warehouse_Repository();\n $repository_product_stock_log = new IM_Stock_Log_Repository();\n $repository_product_warehouse = new IM_Product_Warehouse_Repository();\n // create rows for this product\n $repository_product_warehouse->refresh_relations($id);\n $warehouses = $repository->get_all();\n $total = 0;\n foreach ($warehouses as $warehouse) {\n $warehouse_id = $warehouse->id;\n $old_stock = $repository_product_warehouse->getByProductWarehouseID($id, $warehouse_id)->stock;\n $new_stock = ((isset($_POST[\"product\"])) ? $_POST[\"product\"] : null);\n // check if a stock value for the current combination exists..\n if (isset($new_stock[$id][$warehouse_id])) {\n $new_stock = $new_stock[$id][$warehouse_id];\n $repository_product_warehouse->updateStock($id, $warehouse_id, $new_stock);\n $total += $new_stock;\n if($new_stock !== $old_stock){\n // Issue #19\n $repository_product_stock_log->addStockLog($id, $warehouse_id, $new_stock, \"direct change\");\n // end issue #19\n }\n }\n $priority = ((isset($_POST[\"product-priority\"])) ? $_POST[\"product-priority\"] : null);\n // check if a priority value for the current combination exists..\n if (isset($priority[$id][$warehouse_id])) {\n $priority = $priority[$id][$warehouse_id];\n $repository_product_warehouse->updatePriority($id, $warehouse_id, $priority);\n }\n // dummy in case if a plugin tries to check in the database\n update_post_meta($id, \"_warehouse_\" . $warehouse->id, 0);\n }\n //update_post_meta($id, \"_stock\", $total);\n //$product->stock = $total;\n\n // Issue #66\n IM_Online_Warehouse::get_instance()->checkOnlineWarehouseStatus($id);\n // end issue #66\n }\n }", "function getMovementsStock($name) {\n $res = $this->some('code', $name);\n $newRes = array();\n \n $index = count($res) - 1;\n \n //stores queried data into array\n while($index > 0) {\n $tmpRes = array();\n array_push($tmpRes, $res{$index}->datetime, $res{$index}->action, $res{$index}->amount);\n array_push($newRes, $tmpRes);\n $index--;\n }\n return $newRes;\n }", "public function get_single_stock() {\n\n\t\t$inventory = $this->get_inventory();\n\n\t\treturn ! empty( $inventory ) ? current( $inventory ) : null;\n\t}", "function setAmount($product, $instock)\n{\n\tinclude 'setup.php';\n\n\t$stocks = getStocks();\n\tif($stocks == -1)\n\t\treturn -1;\n\n\tif(isset($stocks[$product]))\n\t\t$stocks[$product][instock] = intval($instock);\n\telse\n\t\t$stocks[$product] = array(instock => intval($instock), sold => 0);\n\n\t$handle = fopen($STOCKFILE, \"w\");\n\tif($handle == FALSE)\n\t{\n\t\treturn -1;\n\t}\n\telse\n\t{\n\t\tflock($handle, 2);\t// get exclusive lock\n\t\tif(fwrite($handle, serialize($stocks), strlen(serialize($stocks))) == FALSE)\n\t\t\t$retval = -1;\n\t\telse\n\t\t\t$retval = 0;\n\n\t\tflock($handle, 3);\t// release lock after write\n\t\tfclose($handle);\n\t\treturn $retval;\n\t}\n}", "public function updateStockClosingPriceForSymbols(array $symbols)\n {\n foreach ($symbols as $symbol) {\n $lastClosingPrice = $this->getSymbolLastStoredClosingPriceDate($symbol);\n $yesterday = (new \\DateTime())->sub(new \\DateInterval('P1D'));\n \n //We only want to update if the last closing price we have is not from yesterday\n if ((is_null($lastClosingPrice)) || ($lastClosingPrice->format('Y-m-d') !== $yesterday->format('Y-m-d'))) {\n try {\n $historicPrices = $this->client->fetchDailyStockTimeSeries($symbol, $lastClosingPrice);\n } catch (\\Exception $e) {\n throw new \\Exception(\"{$symbol} cant be fetched\", 0, $e);\n }\n\n $stock = $this->findOrCreateStock($symbol);\n $this->batchInsertStockClosingPrices($stock, $historicPrices);\n }\n }\n }", "function add_last_changes($dir,$name,$count = false){\n\n\t$info = json_decode(file_get_contents($dir.'_info.json'));\n\n\tdate_default_timezone_set('Europe/Minsk');\n\n\tif($count){\n\t\tif(!is_dir($dir.$name)){\n\t\t\t$json = json_decode(file_get_contents($dir.$name.'.json'));\n\t\t\t$records = count($json);\n\t\t} else {\n\t\t\t$json = json_decode(file_get_contents($dir.$name.'/_info.json'));\n\t\t\t$records = count($json);\n\t\t}\n\t}\n\n\tfor($i = 0; $i < count($info); $i++){\n\t\tif($info[$i]->name == $name){\n\t\t\t$info[$i]->last_changes = date(\"d.m.Y / H:i:s\");\n\t\t\tif($count){\n\t\t\t\t$info[$i]->total = $records;\n\t\t\t}\n\t\t}\n\t}\n\n\t$fp = fopen($dir.'_info.json','w');\n\tfwrite($fp,json_encode($info));\n\tfclose($fp);\n}", "private function updateStockItem($inventoryProduct,$answerCode,$qty,$manageStock,$logFile)\n\t{ \n\t\t$stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($inventoryProduct->getId());\n\t\t\t\n\t\tif($stockItem->getId() == \"\")\n\t\t{\n\t\t\t$stockItem = $this->createStockItem($inventoryProduct, $logFile);\n\t\t}\n\n\t\tswitch ($answerCode)\n\t\t{\n\t\t\t//back order\n\t\t\t//in stock\n\t\t\tcase 'NYP':\n\t\t\tcase 'BRP': \n\t\t\t\t$backorder = 2;\n\t\t\t\t$isInStock = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'TOS':\n\t\t\tcase 'COS':\n\t\t\t\t$backorder = 0;\n\t\t\t\tif ($qty < 1)\n\t\t\t\t\t$isInStock = 0;\n\t\t\t\telse\n\t\t\t\t\t$isInStock = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'REM':\n\t\t\tcase 'OSI':\n\t\t\tcase 'CNR':\n\t\t\tcase 'OOP':\n\t\t\tcase 'CFE':\n\t\t \tcase 'NIP':\n\t\t \tcase 'POD':\n\t\t\t\t$backorder = 0;\n\t\t\t\tif ($qty <=5)\n\t\t\t\t\t$isInStock = 0;\n\t\t\t\telse\n\t\t\t\t\t$isInStock = 1;\n\t\t\t\tbreak;\n\t\t\tcase 'CAN':\n\t\t\tcase 'NLA':\n\t\t\t\t$isInStock = 0;\n\t\t\t\t$backorder = 0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$isInStock = 1;\n\t\t\t\t$backorder = 1;\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t\t\n\t\tif($isInStock == 0)\n\t\t{\n\t\t\t$manageStock = 1;\n\t\t}\n\t\t\t\t\t\n\t\t$stockItem->setData('manage_stock', $manageStock);\n\t\t$stockItem->setData('is_in_stock', $isInStock);\n\t\t$stockItem->setData('stock_id', 1);\n\t\t$stockItem->setData('qty', $qty);\n\t\t$stockItem->setData('backorders', $backorder);\n\t\t$stockItem->save();\n\t}", "function kvell_edge_woocommerce_product_out_of_stock() {\n\t\tglobal $product;\n\t\t\n\t\tif ( ! $product->is_in_stock() ) {\n\t\t\tprint '<span class=\"edgtf-out-of-stock\">' . esc_html__( 'Sold', 'kvell' ) . '</span>';\n\t\t}\n\t}", "public function load_stocks() {\n\t\t\t$res = $this->Restaurant_model->loading_stocks();\n\t\t\techo $res;\n\t\t}", "public function UpdateStatusFromBookings()\n\t{\tif ($this->id)\n\t\t{\t$this->UpdateStatus(count($this->GetBookings()) >= $this->details['tqty'] ? 'sold_out' : 'in_stock');\n\t\t}\n\t}", "public function log_pull() {}", "public function analyzeModifications()\n {\n $this->logManager->logMessage(lang('Revision.analyzeModifications'));\n\n foreach ($this->files as $file) {\n // Compare the previous snapshot with the new snapshot from update.\n $oldCopy = $this->workspace . 'oldSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n $project = $this->config->rootPath . $file['destination'];\n $doCopy = true;\n\n // If hashes are different, this can be new or modified.\n if (! FileManager::areIdenticalFiles($oldCopy, $file['origin'])\n || ($this->config->fallThroughToProject && ! FileManager::areIdenticalFiles($project, $file['origin']))\n ) {\n $newCopy = $this->workspace . 'newSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n\n try {\n if (! is_file($oldCopy) || ! is_file($project)) {\n $this->fileManager->createdFiles[] = $file['destination']; // @codeCoverageIgnore\n } elseif (is_file($file['origin'])) {\n $this->fileManager->modifiedFiles[] = $file['destination'];\n } else {\n // @codeCoverageIgnoreStart\n $this->fileManager->deletedFiles[] = $file['destination'];\n $doCopy = false;\n // @codeCoverageIgnoreEnd\n }\n\n if ($doCopy) {\n $this->filesystem->copy($file['origin'], $newCopy, true);\n }\n\n // @codeCoverageIgnoreStart\n } catch (IOExceptionInterface $e) {\n $this->logManager->logMessage($e->getMessage(), 'error');\n // @codeCoverageIgnoreEnd\n }\n }\n }\n\n // Log the update results\n $cc = \\count($this->fileManager->createdFiles);\n $mc = \\count($this->fileManager->modifiedFiles);\n $dc = \\count($this->fileManager->deletedFiles);\n\n $cs = 1 === $cc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ms = 1 === $mc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ds = 1 === $dc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n\n $this->logManager->logMessage([\n lang('Revision.createdFilesAfterUpdate', [$cc, $cs]),\n lang('Revision.modifiedFilesAfterUpdate', [$mc, $ms]),\n lang('Revision.deletedFilesAfterUpdate', [$dc, $ds]),\n ]);\n }", "function stock_array() {\n\t\t$row = 0;\n\t\t$stock_array = array();\n\t\t\t\t\n\t\tif ($handle = fopen(STOCK_CSV, \"r\")) {\n\t\t\t while ($data = fgetcsv($handle, 1000, \",\")) {\n\t\t\t\t$new_tick = array();\n\t\t\t\tif ($row != 0) {\n\t\t\t\t\t$new_tick['ticker'] = $data[0];\n\t\t\t\t\t$new_tick['name'] = $data[1];\n\t\t\t\t\t$new_tick['exchange'] = $data[2];\n\t\t\t\t\t\n\t\t\t\t\tarray_push($stock_array, $new_tick);\n\t\t\t\t\t}\n\t\t\t\t$row++;\n\t\t\t }\n\t\t\t fclose($handle);\n\t\t\t}\n\t\telse {\n\t\t\techo \"Could not open file\";\n\t\t\t}\n\t\treturn $stock_array;\n\t}" ]
[ "0.5764854", "0.54556626", "0.5321875", "0.5282815", "0.52233326", "0.5221064", "0.5173942", "0.5168852", "0.5160336", "0.51121914", "0.509885", "0.50608575", "0.50608575", "0.50608575", "0.50608575", "0.50608575", "0.50586665", "0.50586665", "0.50387144", "0.49953738", "0.49891064", "0.496923", "0.49614927", "0.49527052", "0.49440336", "0.48978326", "0.4897315", "0.48930418", "0.4866407", "0.4856877", "0.4853235", "0.4847708", "0.48457092", "0.4824849", "0.4815552", "0.48146302", "0.47995824", "0.47864833", "0.47639492", "0.47621143", "0.47590107", "0.4753608", "0.47478986", "0.4703953", "0.4698759", "0.46985146", "0.46837348", "0.4683691", "0.468203", "0.46733153", "0.46609053", "0.46569273", "0.4635556", "0.4631775", "0.46230713", "0.46220756", "0.461463", "0.46056196", "0.4600735", "0.45972708", "0.45963022", "0.4591376", "0.45891133", "0.45795494", "0.45699716", "0.45529196", "0.45395002", "0.4535501", "0.45222363", "0.45204845", "0.4516499", "0.4510151", "0.44921163", "0.44879982", "0.44848144", "0.44835404", "0.44718766", "0.4467429", "0.44668767", "0.44637623", "0.44599235", "0.44534254", "0.44436538", "0.44419447", "0.44354606", "0.44340432", "0.44340006", "0.44318092", "0.4427106", "0.4426844", "0.44257733", "0.44250363", "0.44239593", "0.44210032", "0.44182023", "0.44128296", "0.43950197", "0.43932548", "0.4389401", "0.43844548" ]
0.48830703
28
Push the eBay MIP file to the MIP server.
public function pushEbayMipFile() { $result=false; try{ infolog('[BulkInventory.pushEbayMipFile] Preparing to send file... '. now()); Storage::disk('mip')->put('inventory/'.basename($this->ifile), file_get_contents($this->ifile)); infolog('[BulkInventory.pushEbayMipFile2] SUCCESS at '. now()); $result=true; }catch(\Exception $e) { infolog('[BulkInventory.pushEbayMipFile] ERROR updating eBay/MIP ('.$e->getMessage().') at '. now()); } return($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function uploadApkPostAction() {\n\t $ret = Common::uploadApk('apk', 'gdtdelivery');\n\t $this->assign('code' , $ret['data']);\n\t $this->assign('msg' , $ret['msg']);\n\t $this->assign('data', $ret['data']);\n\t $apkId = $this->getInput('apkId');\n\t $this->assign('apkId', $apkId);\n\t $this->getView()->display('common/uploadApk.phtml');\n\t exit;\n\t}", "function pushFile($source,$hash);", "private function sendAPN() {\n try {\n $this->apnProvider->pushToAll($this->apn);\n echo \"Successfully pushed notification.\\n\";\n } catch (Exception $e) {\n echo \"Failed to push notification.\\n\";\n throw $e;\n }\n }", "protected function testIosPush($args) {\n\n if ($_FILES['ent_ios_cer'] == '' || $args['ent_cer_pass'] == '' || $args['ent_message'] == '' || $args['ent_push_token'] == '')\n return $this->_getStatusMessage(1, 58);\n\n $allowedExts = array(\"pem\");\n $_FILES[\"file\"] = $_FILES['ent_ios_cer'];\n\n $temp = explode(\".\", $_FILES[\"file\"][\"name\"]);\n $extension = end($temp);\n if (in_array($extension, $allowedExts)) {\n if ($_FILES[\"file\"][\"error\"] > 0) {\n echo \"Error: \" . $_FILES[\"file\"][\"error\"] . \"<br>\";\n } else {\n\n if (file_exists(\"test/\" . $_FILES[\"file\"][\"name\"]))\n unlink($_FILES[\"file\"][\"name\"]);\n\n move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"test/\" . $_FILES[\"file\"][\"name\"]);\n echo $_FILES[\"file\"][\"name\"] . \" -->Stored\";\n\n $this->ios_cert_path = \"test/\" . $_FILES[\"file\"][\"name\"];\n $this->ios_cert_pwd = $args['ent_cer_pass'];\n\n if ($args['ent_cer_type'] == '1')\n $this->ios_cert_server = \"ssl://gateway.sandbox.push.apple.com:2195\";\n else\n $this->ios_cert_server = \"ssl://gateway.push.apple.com:2195\";\n\n\n echo 'Path:' . $this->ios_cert_path . ',Pwd:' . $this->ios_cert_pwd . ',Server:' . $this->ios_cert_server;\n\n $tokenArr = array($args['ent_push_token']);\n\n print_r($tokenArr);\n\n $return_res = $this->_sendApplePush($tokenArr, array('alert' => $args['ent_message']));\n print_r($return_res);\n if ($return_res['errorNo'] == 44)\n return array('push' => 'sent');\n else if ($return_res['errorNo'] == 30)\n return array('error' => \"Connection failed\", 'msg' => $return_res['error']);\n else\n return array('push' => 'failed');\n }\n } else {\n return array('error' => \"Please provice a .pem file\");\n }\n }", "public function push()\n\t{\n\t\t\n\t\t/*\n\t\t * This happens when the user has an active session with the application,\n\t\t * and not represented by an application. We assume that there's no intermediary.\n\t\t *\n\t\t * Applications should log into the application using their signature, and\n\t\t * while they will receive very open privileges, Ping likes to be\n\t\t * transparent about where pings originated from.\n\t\t */\n\t\tif ($this->user) {\n\t\t\t$srcid = $this->user->id;\n\t\t\t$authapp = $this->authapp instanceof AppAuthentication? $this->authapp->getSrc()->getId() : null;\n\t\t}\n\t\telse {\n\t\t\tthrow new PublicException('Authentication required', 403);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Default optional input to null. Spitfire already handles validation via\n\t\t * the @validate annotation, so we just have to assume that we need to set\n\t\t * fields that were empty to null.\n\t\t */\n\t\t$tgtid = $_POST['target']?? null;\n\t\t$content = str_replace(\"\\r\", '', $_POST['content']);\n\t\t$url = $_POST['url']?? null;\n\t\t$media = $_POST['media']?? null;\n\t\t$poll = $_POST['poll']?? null;\n\t\t$irt = $_POST['irt']?? null;\n\t\t$explicit = !!($_POST['explicit']?? false);\n\t\t\n\t\t#There needs to be a src user. That means that somebody is originating the\n\t\t#notification. There has to be one, and no more than one.\n\t\t$src = AuthorModel::get(db()->table('user')->get('_id', $srcid)->first());\n\t\t\n\t\tif (!$src) {\n\t\t\t$src = UserModel::makeFromSSO($this->sso->getUser($srcid));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Check whether the source defined a target for this ping. If the target\n\t\t * can be traced to an author, we will record that.\n\t\t */\n\t\t$target = $tgtid === null? null : AuthorModel::find($tgtid);\n\t\t\n\t\t/*\n\t\t * If there is a target, and it's not an author known to the server, then\n\t\t * we must stop the application from creating the ping.\n\t\t */\n\t\tif (!($target instanceof AuthorModel || $target === null)) {\n\t\t\tthrow new PublicException('Invalid target', 400);\n\t\t}\n\t\t\n\t\t#Make it a record\n\t\t$notification = db()->table('ping')->newRecord();\n\t\t$notification->src = $src;\n\t\t$notification->authapp = $authapp;\n\t\t$notification->target = $target;\n\t\t$notification->content = Mention::mentionsToId($content);\n\t\t$notification->url = $url;\n\t\t$notification->explicit= $explicit;\n\t\t$notification->irt = $irt? db()->table('ping')->get('_id', $irt)->first(true) : null;\n\t\t$notification->processed = false;\n\t\t$notification->locked = false;\n\t\t\n\t\t\n\t\t/**\n\t\t * @todo This method should be deprecated in favor of batch processing the\n\t\t * files\n\t\t */\n\t\tif (is_string($media)) {\n\t\t\t$notification->media = $media;\n\t\t\t\n\t\t\t$media = [];\n\t\t}\n\t\t\n\t\t/**\n\t\t * If the user uploaded a file instead, we process it. This should be DRYed\n\t\t * so it doesn't repeat the code from the media::upload action.\n\t\t */\n\t\tif ($media instanceof \\spitfire\\io\\Upload) {\n\t\t\t$local = $media->store();\n\t\t\t$media = media()->load($local);\n\t\t\t\n\t\t\t/**\n\t\t\t * We need to determine what kind of content the user uploaded. If the user has a video\n\t\t\t * file without audio we treat it as image.\n\t\t\t */\n\t\t\t$type = $media instanceof FFMPEGManipulator && $media->hasAudio()? 'video' : 'image';\n\t\t\t\n\t\t\t$record = db()->table('media\\media')->newRecord();\n\t\t\t$record->file = $local->uri();\n\t\t\t$record->source = null;\n\t\t\t$record->type = $type;\n\t\t\t$record->secret = base64_encode(random_bytes(50));\n\t\t\t$record->store();\n\t\t\t\n\t\t\t$media = [sprintf('%s:%s', $record->_id, $record->secret)];\n\t\t}\n\t\t\n\t\t/*\n\t\t * Once all the validation has been performed and we are sure that data can\n\t\t * be handled properly by the database we send it to the event handler that\n\t\t * will execute the code appropriately.\n\t\t */\n\t\t$this->core->feed->push->do(function ($notification) use ($poll, $media) {\n\t\t\t$notification->store();\n\t\t\t\n\t\t\t#Attach the media\n\t\t\tforeach (array_filter($media?: []) as $file) {\n\t\t\t\tlist($id, $secret) = explode(':', $file);\n\t\t\t\t$record = db()->table('media\\media')->get('_id', $id)->where('secret', $secret)->first(true);\n\t\t\t\t$record->ping = $notification;\n\t\t\t\t$record->store();\n\t\t\t}\n\t\t\t\n\t\t\t#Create poll options\n\t\t\tforeach (array_filter($poll?: []) as $option) {\n\t\t\t\t$record = db()->table('poll\\option')->newRecord();\n\t\t\t\t$record->ping = $notification;\n\t\t\t\t$record->text = $option;\n\t\t\t\t$record->store();\n\t\t\t}\n\t\t}, $notification);\n\t\t\n\t\t/*\n\t\t * This will notify the cron job, allowing the system to process the ping\n\t\t * immediately as it is received.\n\t\t */\n\t\ttry {\n\t\t\t$sem = new FlipFlop(spitfire()->getCWD() . '/bin/usr/.media.cron.lock');\n\t\t\t$sem->notify();\n\t\t}\n\t\tcatch (Exception $ex) {\n\t\t\t#Notifying the cron-job failed. Gracefully recover.\n\t\t}\n\t\t\n\t\t$this->view->set('ping', $notification);\n\t}", "public function push($zone, $file, $datasource = null);", "public function execute(): void\n {\n $fileDirectoryPath = $this->filesystem->getDirectoryWrite(DirectoryList::PUB);\n $fileName = 'googleshopping.xml';\n try {\n $xmldata = $this->xmlFeed->getFeed();\n if (strlen($xmldata) > 500) {\n $fileDirectoryPath->writeFile($fileName, $xmldata);\n } else {\n $this->logger->error('Google Shopping XML Data not generated correctly');\n }\n } catch (\\Exception $exception) {\n $this->logger->error($exception->getMessage());\n }\n }", "protected function publishPhonesFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Phones\\PhonesServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Phones\\PhonesServiceProvider\",\n ]);\n }", "public function publishFiles()\n {\n $this->call('vendor:publish', [\n '--provider' => OxyNovaServiceProvider::class,\n '--tag' => ['config', 'translations', 'views', 'database'],\n ]);\n }", "function push_file($remote_file, $file, $format = null)\n {\n $only = null;\n if ($format != '') {\n $only = $this->only_format($remote_file, $format);\n if ($only == false) {\n echo \"Толькo формати jpg, png, gif\\n\";\n\n return false;\n }\n }\n\n if (ftp_put($this->connect, $remote_file, $file, FTP_ASCII)) {\n echo \"$file успешно загружен на сервер\\n\";\n } else {\n echo \"Не удалось загрузить $file на сервер\\n\";\n }\n }", "public function create_upload()\n {\n $this->add_to_log('Create upload', 'Determined that action to perform is create and upload xml for MMS order');\n \n // Fetch latest MMS orders from MAX Live DB with status Delivered and customer MEAF and save the first matching order\n $this->pick_order();\n \n // Create the XML files for the order\n $this->create_xml_file();\n \n // Check if xml file mms order for accepted state does exist before attempting an upload to Test platform\n if (isset($this->_mms_order['Accepted']['xml_file'])) {\n if (file_exists($this->_mms_order['Accepted']['xml_file'])) {\n \n // Upload the created XML files to the Test platform\n $this->upload_xml_file($this->_mms_order['Accepted']['xml_file'], 'Accepted', $this->get_shipment_number());\n } else {\n $this->addErrorRecord('ERROR: Did not upload MMS. MMS order accepted state xml file not found', $this->_mms_order['Accepted']['xml_file'], __FUNCTION__);\n }\n } else {\n $this->addErrorRecord('ERROR: Did not upload MMS. MMS order accepted state property called xml_file not set', implode(',', $this->_mms_order['Accepted']), __FUNCTION__);\n }\n }", "protected function publishEmailsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Emails\\EmailsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Emails\\EmailsServiceProvider\",\n ]);\n }", "public function pushToFareye() {\r\n Mage::getModel('marketplace/fareyedataqueue')->pushToFareye();\r\n }", "public function collect_logs()\n {\n $body = file_get_contents(\"php://input\");\n $r = @file_get_contents('/tmp/apple.push.log');\n file_put_contents('/tmp/apple.push.log', $r . $body);\n return 'success'; \n }", "public function put()\n\t{\n\t\t$this->parse_body();\n\t\tFsb::$db->insert('notify', array(\n\t\t\t'notify_method' =>\t$this->method,\n\t\t\t'notify_time' =>\tCURRENT_TIME,\n\t\t\t'notify_subject' =>\t$this->subject,\n\t\t\t'notify_body' =>\t$this->body,\n\t\t\t'notify_bcc' =>\t\timplode(\"\\n\", $this->bcc),\n\t\t\t'notify_try' =>\t\t0,\n\t\t));\n\t\tFsb::$db->destroy_cache('notify_');\n\t}", "public function upload_to_fb()\n {\n if(array_key_exists('output_file', $this->config))\n {\n // build md5 hash of previous stored xml without <mod_time> Elements\n $oldphonebhash = md5(preg_replace(\"/<mod_time>(\\\\d{10})/\",\"\",file_get_contents($this->config['output_file'],'r'),-1,$debugoldtsreplace));\n $output = fopen($this->config['output_file'], 'w');\n if($output)\n {\n fwrite($output, $this->fbxml);\n fclose($output);\n print \" Saved to file \" . $this->config['output_file'] . PHP_EOL;\n }\n\t if (array_key_exists('output_and_upload', $this->config) and $this->config['output_and_upload'])\n\t {\n\t \t$newphonebhash = md5(preg_replace(\"/<mod_time>(\\\\d{10})/\",\"\",file_get_contents($this->config['output_file'],'r'),-1,$debugnewtsreplace));\n\t \tprint \" INFO: Compare old and new phonebook file versions.\" . PHP_EOL . \" INFO: old version: \" . $oldphonebhash . PHP_EOL . \" INFO: new version: \" . $newphonebhash . PHP_EOL;\n\t \tif($oldphonebhash === $newphonebhash)\n \t{\n \tprint \" INFO: Same versions ==> No changes in phonebook or images\" . PHP_EOL . \" EXIT: No need to upload phonebook to the FRITZ!Box.\". PHP_EOL;\n \treturn 0;\n \t}\n \telse\n \tprint \" INFO: Different versions ==> Changes in phonebook.\" . PHP_EOL . \" INFO: Changes dedected! Continue with upload.\" . PHP_EOL;\n }\n\t else\n return 0; \n }\n // now we upload the photo jpgs first being stored in the\n // temp directory.\n\n // perform an ftps-connection to copy over the photos to a specified directory\n $ftp_server = $this->config['fritzbox_ip_ftp'];\n $conn_id = ftp_ssl_connect($ftp_server);\n if($conn_id == false)\n {\n print \" WARNING: Secure connection to FTP-server '\" . $ftp_server . \"' failed, retrying without SSL.\" . PHP_EOL;\n $conn_id = ftp_connect($ftp_server);\n }\n\n if($conn_id != false)\n {\n ftp_set_option($conn_id, FTP_TIMEOUT_SEC, 60);\n $login_result = ftp_login($conn_id, $this->config['fritzbox_user'], $this->config['fritzbox_pw']);\n if($login_result === true)\n {\n ftp_pasv($conn_id, true);\n\n // create remote photo path on FRITZ!Box if it doesn't exist\n $remote_path = $this->config['usb_disk'] . \"/FRITZ/fonpix\";\n $all_existing_files = ftp_nlist($conn_id, $remote_path);\n if($all_existing_files == false)\n {\n ftp_mkdir($conn_id, $remote_path);\n $all_existing_files = array();\n }\n\n // now iterate through all jpg files in tempdir and upload them if necessary\n $dir = new DirectoryIterator($this->tmpdir);\n foreach($dir as $fileinfo)\n {\n if(!$fileinfo->isDot())\n {\n if($fileinfo->getExtension() == \"jpg\")\n {\n $file = $fileinfo->getFilename();\n\n print \" FTP-Upload '\" . $file . \"'...\";\n if(!in_array($remote_path . \"/\" . $file, $all_existing_files))\n {\n if(!ftp_put($conn_id, $remote_path . \"/\" . $file, $fileinfo->getPathname(), FTP_BINARY))\n {\n // retry when a fault occurs.\n print \" retrying... \";\n $conn_id = ftp_ssl_connect($ftp_server);\n if($conn_id == false)\n {\n print \" WARNING: Secure re-connection to FTP-server '\" . $ftp_server . \"' failed, retrying without SSL.\" . PHP_EOL;\n $conn_id = ftp_connect($ftp_server);\n }\n\n if($conn_id == false)\n {\n print \" ERROR: couldn't re-connect to FTP server '\" . $ftp_server . \"', abortіng.\" . PHP_EOL;\n break;\n }\n\n $login_result = ftp_login($conn_id, $this->config['fritzbox_user'], $this->config['fritzbox_pw']);\n if($login_result === false)\n {\n print \" ERROR: couldn't re-login to FTP-server '\" . $ftp_server . \"' with provided username/password settings.\" . PHP_EOL;\n break;\n }\n\n ftp_pasv($conn_id, true);\n if(!ftp_put($conn_id, $remote_path . \"/\" . $file, $fileinfo->getPathname(), FTP_BINARY))\n print \" ERROR: while uploading file \" . $fileinfo->getFilename() . PHP_EOL;\n else\n print \" ok.\" . PHP_EOL;\n }\n else\n print \" ok.\" . PHP_EOL;\n\n // cleanup old files\n foreach($all_existing_files as $existing_file)\n {\n if(strpos($existing_file, $remote_path . \"/\" . substr($file, 0, -10)) !== false)\n {\n print \" FTP-Delete: \" . $existing_file . PHP_EOL;\n ftp_delete($conn_id, $remote_path . \"/\" . basename($existing_file));\n }\n }\n }\n else\n print \" already exists.\" . PHP_EOL;\n }\n }\n }\n }\n else\n print \" ERROR: couldn't login to FTP-server '\" . $ftp_server . \"' with provided username/password settings.\" . PHP_EOL;\n\n // close ftp connection\n ftp_close($conn_id);\n }\n else\n print \" ERROR: couldn't connect to FTP server '\" . $ftp_server . \"'.\" . PHP_EOL;\n \n // lets post the phonebook xml to the FRITZ!Box\n print \" Uploading Phonebook XML to \" . $this->config['fritzbox_ip'] . PHP_EOL;\n try\n {\n $fritz = new fritzbox_api($this->config['fritzbox_pw'],\n $this->config['fritzbox_user'],\n $this->config['fritzbox_ip'],\n $this->config['fritzbox_force_local_login']);\n\n $formfields = array(\n 'PhonebookId' => $this->config['phonebook_number']\n );\n\n $filefileds = array('PhonebookImportFile' => array(\n 'type' => 'text/xml',\n 'filename' => 'updatepb.xml',\n 'content' => $this->fbxml,\n )\n );\n\n $raw_result = $fritz->doPostFile($formfields, $filefileds); // send the command\n $msg = $this->_parse_fb_result($raw_result);\n unset($fritz); // destroy the object to log out\n\n print \" FRITZ!Box returned message: '\" . $msg . \"'\" . PHP_EOL;\n }\n catch(Exception $e)\n {\n print \" ERROR: \" . $e->getMessage() . PHP_EOL; // show the error message in anything failed\n return false;\n }\n return true;\n }", "protected function publishFaxesFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Faxes\\FaxesServiceProvider\",\n ]);\n }", "public function pushConfig()\n {\n $cmds[] = 'push gitoliteorigin master';\n $this->runGitCommand($cmds);\n }", "public function push_point_info() {\n\t\t$this->_check_access(); //拒绝非法IP执行任务\n\t\t$this->_write_log(__FUNCTION__);\n\t\t$this->load->model('soma/sales_point_model', 'sp_model');\n\t\t$res = $this->sp_model->push_point_info();\n\t\techo $res ? 'SUCCESS' : 'Failed';\n\t}", "private function eightpack_exec($app, $source_file, $dest_file = NULL)\n {\n $this->exec(self::config(\"eightpack.$app\").\" $source_file\");\n $file = $dest_file?:$source_file;\n file_put_contents($file, $this->stdout);\n }", "public function _DO_push()\n {\n// $res = $this->tim->group_send_group_msg('admin', 'L5900888378d29-T', 'hello');\n// $res = servTIM::sole(null)->systemMessage('L591a745be656f-T', 'hint', '老师暂时离开');\n $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-D', 'hint', '老师暂时离开');\n print_r($res);\n// $res = servTIM::sole(null)->systemMessage('L598bfa8b8da85-T', 'hint', '老师暂时离开');\n// print_r($res);\n }", "public function postNewPushOnParse(){\n\t\t$this->generateChannel();\n\t\t$ch = curl_init();\n\t\t$headers = array( \"X-Parse-Application-Id: $this->PARSEAPPID\",\n \"X-Parse-REST-API-Key: $this->PARSEAPIKEY\",\n \"Content-Type: application/json\");\n $url = \"https://api.parse.com/1/classes/\" . $this->STORAGECLASS;\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(\"sender\" => $this->sender, \"message\" => $this->push, \"channel\" => $this->channel, \"sent\" => 0)));\n\t\t$result = curl_exec($ch);\n\t\tcurl_close($ch);\n \t\treturn $result;\n\t}", "public function actionProductUpdateUsingFile()\n\t{\n\t\t$filePath = Yii::getAlias('@webroot').'/frontend/modules/walmart/filestorage/product/update';\n\t\t$files = scandir($filePath);\n\t\tforeach($files as $file){\n\t\t\t$fullFilePath = $filePath.'/'.$file;;\n\t\t\tif(!is_dir($fullFilePath)){\n\t\t\t\t$storedData = require $fullFilePath;\n\t\t\t\t$merchant_id = str_replace('.php','',$file);\n\t\t\t\t$xmlDir = $filePath.'/xml/'.$merchant_id;\n\t\t\t\tif (!file_exists($xmlDir)) {\n\t\t mkdir($xmlDir, 0775, true);\n\n\t\t }\n\t\t $xmlFile = $xmlDir. '/MPProduct-' . time() . '.xml';\n\t\t $xml = new Generator();\n $xml->arrayToXml($storedData)->save($xmlFile);\n Walmartapi::unEscapeData($xmlFile);\n $walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$merchant_id.\"'\",'one','select');\n $walmartApi = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key']);\n $response = $walmartApi->postRequest(Walmartapi::GET_FEEDS_ITEMS_SUB_URL, ['file' => $xmlFile]);\n $response = str_replace('ns2:', \"\", $response);\n\n $responseArray = [];\n $responseArray = Walmartapi::xmlToArray($response);\n if (isset($responseArray['FeedAcknowledgement'])) {\n $result = [];\n unlink($fullFilePath);\n $feedId = isset($responseArray['FeedAcknowledgement']['feedId']) ? $responseArray['FeedAcknowledgement']['feedId'] : '';\n if ($feedId != '') {\n $result = $walmartApi->getFeeds($feedId);\n if (isset($results['results'][0], $results['results'][0]['itemsSucceeded']) && $results['results'][0]['itemsSucceeded'] == 1) {\n $result = ['feedId' => $feedId, 'feed_file' => $xmlFile];\n }\n $result = ['feedId' => $feedId, 'feed_file' => $xmlFile];\n }\n } elseif ($responseArray['errors']) {\n $error['feedError'] = $responseArray['errors'];\n }\n\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t\tdie;\n\t}", "public function commitAndPush()\n {\n try {\n // Add files to git index, commit and push to client remote\n $this->git->add()->all()->execute();\n $this->git->commit()->message($this->commit_msg)->execute();\n $this->git->push()->execute($this->client_remote, $this->branch);\n } catch (GitException $e) {\n $this->logger->error('Failed to commit to Git repository. Error: '\n . $e->getMessage());\n }\n }", "public function forPushPackage()\n {\n $this->router->group([], function ($router) {\n $router->post('{version}/pushPackages/{websitePushId}', [\n 'uses' => 'PackageController@show',\n ]);\n });\n }", "public function make(){\r\n $token = Config::get(\"ipnet.token\");\r\n $url = self::$download_url . '?token=' . $token . '&type=datx';\r\n $this->download($url);\r\n }", "private function submitFile()\n {\n\n $encoded_url = urlencode($this->getFileUrl());\n\n wp_remote_get(self::GOOGLE_WEBMASTER_TOOLS_URL . $encoded_url);\n wp_remote_get(self::BING_WEBMASTER_TOOLS_URL . $encoded_url);\n\n }", "private function performAction() {\n\t\t\theader('Cache-Control: no-cache, no-store, must-revalidate');\n\t\t\theader('Expires: 0');\n\n\t\t\t// Open mailbox backup system on the provided folder\n\t\t\t$mailboxBackupSystem = new MailboxBackupSystem($this->folder, $this->username, $this->password);\n\t\t\t$mailboxBackupSystem->open();\n\n\t\t\t// Read existing files and order by date (newest first)\n\t\t\t$files = $mailboxBackupSystem->getFiles();\n\t\t\t$lastDate = FALSE;\n\t\t\tif(count($files) > 0) {\n\t\t\t\tusort($files, \"MailboxFile::compareNewestFirst\");\n\t\t\t\t$lastDate = $files[0]->getDate();\n\t\t\t}\n\n\t\t\t// Handle request action\n\t\t\tswitch($this->action) {\n\t\t\t\tcase 'HEAD':\n\t\t\t\t\tif($lastDate) {\n\n\t\t\t\t\t\t// Only set necessary header\n\t\t\t\t\t\theader('Last-Modified: ' . $lastDate->format('D, d M Y H:i:s') . ' GMT');\n\n\t\t\t\t\t\t// Success\n\t\t\t\t\t\t$this->responseCode = RESPONSE_SUCCESS;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// No resource available, ie Resource not found\n\t\t\t\t\t\t$this->responseCode = RESPONSE_RESOURCE_NOT_FOUND;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'GET':\n\t\t\t\t\tif($lastDate) {\n\n\t\t\t\t\t\t// Read file content\n\t\t\t\t\t\t$fileContent = $mailboxBackupSystem->readFile($files[0]);\n\n\t\t\t\t\t\t// Set necessary headers\n\t\t\t\t\t\theader('Last-Modified: ' . $lastDate->format('D, d M Y H:i:s') . ' GMT');\n\t\t\t\t\t\theader(\"Content-Length: \" . strlen($fileContent));\n\t\t\t\t\t\theader('Content-Transfer-Encoding: binary');\n\n\t\t\t\t\t\t// Add file content\n\t\t\t\t\t\tprint($fileContent);\n\n\t\t\t\t\t\t// Success\n\t\t\t\t\t\t$this->responseCode = RESPONSE_SUCCESS;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// No resource available, ie Resource not found\n\t\t\t\t\t\t$this->responseCode = RESPONSE_RESOURCE_NOT_FOUND;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'PUT':\n\n\t\t\t\t\t// Read content\n\t\t\t\t\t$fileContent = file_get_contents('php://input');\n\t\t\t\t\tif($fileContent !== FALSE) {\n\n\t\t\t\t\t\t// Create file\n\t\t\t\t\t\t$file = MailboxFile::fromContent($fileContent);\n\n\t\t\t\t\t\t// Store file\n\t\t\t\t\t\t$mailboxBackupSystem->addFile($file);\n\n\t\t\t\t\t\t// Apply backup policy (ie remove files not within policy)\n\t\t\t\t\t\t$this->applyPolicy($mailboxBackupSystem, $files);\n\n\t\t\t\t\t\t// Resource created\n\t\t\t\t\t\t$this->responseCode = RESPONSE_RESOURCE_CREATED;\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror_log('MailboxBackupSystem: No file content for PUT.');\n\n\t\t\t\t\t\t// Bad request?\n\t\t\t\t\t\t$this->responseCode = RESPONSE_BAD_REQUEST;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\terror_log('MailboxBackupSystem: Unknown method/action \"' . $this->action . '\".');\n\n\t\t\t\t\t// Bad request\n\t\t\t\t\t$this->responseCode = RESPONSE_BAD_REQUEST;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function getMethod()\n {\n return 'putRemoteFile';\n }", "public function getMethod()\n {\n return 'putRemoteFile';\n }", "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "protected function pushArchive()\n {\n $branch = $this->getCurrenBranch();\n\n $source = $this->createArchive();\n\n // upload to s3\n $this->sync($source, $this->getConfig()->get('app.bucket'), $this->getRepoName().'/'.$branch.'/archives/'.basename($source));\n\n // remove local tmp copy\n $this->getFilesystem()->delete($source);\n\n return $this->getRepoName().'/archives/'.basename($source);\n }", "function transfer()\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$this->file_perms\t= 0644;\n\t\t$this->dir_perms\t= 0777;\n\n\t\t// We use the store directory as temporary path to circumvent open basedir restrictions\n\t\t$this->tmp_path = $phpbb_root_path . 'store/';\n\t}", "public function testPushFileToLocal()\n {\n //\n \t$path = base_path('tests/data/artist_images');\n \t$file_path = $path. '/Marter.png';\n \tprintf(\"\\n\" . $file_path);\n \t$resource = file_get_contents($file_path);\n \t$relativePath = Storage::disk('local')->put('artist/artist.png', $resource, 'public');\n \tprintf(\"\\nrelativePath = \" . $relativePath);\n }", "public function writeEbayMipFile()\n {\n $result=false;\n try{\n infolog('[BulkInventory.writeEbayMipFile] Preparing update file... '. now());\n //todo!!!! ISSUE WITH THIS QUERY: CHECK IT!\n $all=Product::join(\"ebay_details AS ed\",\"ed.product_id\",\"=\",\"products.id\")->whereNotNull(\"ed.listingid\")->whereRaw(\"(products.updated_at > ed.synced_at OR ed.synced_at IS NULL)\")->get();\n $counter=0;\n if(count($all)){\n $filename=\"inventory_\".date(\"YmdHis\").\".csv\";\n $this->ifile=public_path('files/ebay/'.$filename);\n if($fp = fopen($this->ifile, 'w')){\n fputcsv($fp, [\"SKU\",\"Channel ID\",\"List Price\",\"Total Ship to Home Quantity\"]);\n foreach($all as $product){\n fputcsv($fp, [$product->sku,\"EBAY_AU\",$product->listing_price,$product->qty]);\n $counter++;\n }\n fclose($fp);\n }\n }else{\n infolog('[BulkInventory.writeEbayMipFile] ERROR no items found as a result of the query at '. now());\n }\n if($counter>0){\n infolog('[BulkInventory.writeEbayMipFile] SUCCESSFULLY UPDATED '.$counter.' ITEMS at '. now());\n $result=true;\n }\n }catch(\\Exception $e) {\n infolog('[BulkInventory.writeEbayMipFile] ERROR updating eBay/MIP ('.$e->getMessage().') at '. now());\n }\n return($result);\n }", "public function deployPostReceive($path) {\n $this->getDriver()->activateHook('post-receive', $path);\n $hook = '. '.$GLOBALS['sys_pluginsroot'].'git/hooks/post-receive 2>/dev/null';\n $this->addBlock($path.'/hooks/post-receive', $hook);\n }", "function push_writelog($msg_body, $address, $logfile) {\n\t// todo push the message to client, if cannot, write it to db and record this incident in cache\n if(!($fd = fopen($logfile, 'w+'))) {\n $err_msg = 'file:[ ' . __FILE__ . ']; function: [' . __FUNCTION__ . ']; error [openfile '.$logfile.' failed. ]'.\"\\n\";\n exit($err_msg);\n }\n\t$now = date(\"Y-m-d H:i:s\");\n\t$log_msg1 = \"[$now] get the msg [$msg_body]. \\n\";\n fwrite($fd, $log_msg1);\n\t$now = date(\"Y-m-d H:i:s\");\n\t$log_msg2 = \"[$now] trying to push msg [$msg_body] to [$address]. \\n\";\n fwrite($fd, $log_msg2);\n //\tsleep(3);\n\t//$url = 'http://dl.gipsa.name/receive_push.php';\n\t//$data = array( 'msg' => $msg_body, 'time' => time(),);\n\t//$post_string = http_build_query($data, '', '&amp;');\n\t//http_post_data($url, $post_string);\n\t// todo wait for client's ack\n\t$now = date(\"Y-m-d H:i:s\");\n\t$log_msg3 = \"[$now] write the message [$msg_body] into DB after 3 trail of push for [$address]. \\n\";\n fwrite($fd, $log_msg3);\n fclose($fd);\n\treturn 0;\n}", "private function store() {\n\n\t\tforeach ($this->filesToStore as $fileToStore) {\n\t\t\t$storedFile = null;\n\n\t\t\t$title = strtoupper($fileToStore['type']) . \"-\" . $fileToStore['host'] . \"-\" . $fileToStore['file_name'];\n\t\t\t$name = strtoupper($fileToStore['type']) . \"-\" . $fileToStore['host'] . \"-\" . $fileToStore['backup_name'];\n\t\t\t$description = strtoupper($fileToStore['type']) . \" on \" . $fileToStore['host'] . \" backup file\";\n\n\t\t\t//store files to remote storage or local\n\t\t\tforeach ($this->storages as $storage) {\n\n\t\t\t\t//store it to google drive\n\t\t\t\tif (isset($storage['type']) && $storage['type'] == strtolower('gdrive')) {\n\n\t\t\t\t\t$drive = new MaratusGoogleDrive($storage);\n\n\t\t\t\t\t$storedFile = $drive->store($fileToStore['file_path'], $title, $description);\n\n\t\t\t\t}\n\t\t\t\t//store it to dropbox\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('dropbox')) {\n\n\t\t\t\t\t$dBox = new MaratusDropbox($storage);\n\n\t\t\t\t\t$storedFile = $dBox->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it to copy.com\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('copy')) {\n\n\t\t\t\t\t$copy = new MaratusCopy($storage);\n\n\t\t\t\t\t$storedFile = $copy->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it to local place\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('local')) {\n\n\t\t\t\t\t$localStorage = new MaratusLocalStorage($storage);\n\n\t\t\t\t\t$storedFile = $localStorage->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it on ftp server\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('ftp')) {\n\n\t\t\t\t\t$localStorage = new MaratusFtp($storage);\n\n\t\t\t\t\t$storedFile = $localStorage->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\n\t\t\t\t//add result\n\t\t\t\t$this->filesStored[] = array(\n\t\t\t\t\t'type' => $storage['type'],\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'file_name' => $title,\n\t\t\t\t\t'description' => $description,\n\t\t\t\t\t'storege_result' => is_object($storedFile) ? (array) $storedFile : $storedFile,\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Remove backup file from disk\n\t\t\t */\n\t\t\t$filesystem = new Filesystem();\n\t\t\t$filesystem->remove($fileToStore['file_path']);\n\t\t}\n\t}", "public function process()\n {\n parent::process();\n try {\n $this->profile = Teleport::loadProfile($this->profile);\n\n $this->getMODX($this->profile);\n\n $this->tpl = $this->loadTpl($this->tpl);\n\n $this->package = $this->createPackage($this->getName(), $this->getVersion(), $this->getSequence());\n\n if (isset($this->tpl['attributes'])) {\n foreach ($this->tpl['attributes'] as $attribute => $attributeValue) {\n if (is_array($attributeValue) && isset($attributeValue['sourceType']) && isset($attributeValue['source'])) {\n switch ($attributeValue['sourceType']) {\n case 'fileContent':\n $attributeValue = file_get_contents($attributeValue['source']);\n break;\n }\n }\n $this->package->setAttribute($attribute, $attributeValue);\n }\n }\n\n foreach ($this->tpl['vehicles'] as $vehicle) {\n $this->createVehicles($vehicle);\n }\n\n if (!$this->package->pack()) {\n throw new ActionException($this, \"Error packing {$this->package->signature}.transport.zip\");\n }\n $this->request->log(\"Successfully extracted {$this->package->signature}.transport.zip from instance {$this->profile->code}\");\n if ($this->target && $this->push) {\n if (!$this->push($this->package->path . $this->package->signature . '.transport.zip', $this->target . $this->package->signature . '.transport.zip')) {\n throw new ActionException($this, \"Error pushing {$this->package->signature}.transport.zip to {$this->target}\");\n }\n\n if (!$this->preserveWorkspace && $this->modx->getCacheManager()) {\n $this->modx->cacheManager->deleteTree($this->package->path . $this->package->signature);\n @unlink($this->package->path . $this->package->signature . '.transport.zip');\n }\n\n $this->request->log(\"Successfully pushed {$this->package->signature}.transport.zip to {$this->target}\");\n $this->request->log(\"{$this->target}{$this->package->signature}.transport.zip\", false);\n } else {\n $this->request->log(\"{$this->package->path}{$this->package->signature}.transport.zip\", false);\n }\n } catch (\\Exception $e) {\n throw new ActionException($this, \"Error Extracting snapshot: \" . $e->getMessage(), $e);\n }\n }", "public function push();", "public function push();", "function oncall_save_uploaded_message($file, $name) {\n if (!empty($file->fid)) {\n if (!$file->status) {\n\n // Prepare the oncall directory.\n $msg_directory = file_default_scheme() . '://oncall';\n file_prepare_directory($msg_directory, FILE_CREATE_DIRECTORY);\n $destination = file_stream_wrapper_uri_normalize($msg_directory . '/' . $name . '-' . REQUEST_TIME . '.mp3');\n\n // Move the temporary file into the final location.\n if ($file = file_move($file, $destination, FILE_EXISTS_RENAME)) {\n $file->status = FILE_STATUS_PERMANENT;\n $file = file_save($file);\n variable_set('oncall_' . $name, $file->fid);\n }\n\n }\n }\n}", "public function uploadApkAction() {\n\t $apkId = $this->getInput('apkId');\n\t $this->assign('apkId', $apkId);\n\t $this->getView()->display('common/uploadApk.phtml');\n\t exit;\n\t}", "public function mamethodeAction ()\r\n {\r\n\t global $appID,$devID,$certID,$RuName,$serverUrl, $userToken,$compatabilityLevel, $siteID;\r\n\t initKeys();\r\n\r\n\r\n // \r\n\t session_start();\r\n\t $ebay = new Ebay($appID,$devID,$certID,$RuName,$serverUrl, $userToken,$compatabilityLevel, $siteID);\r\n\t $ebay->getStuff();\r\n\t $item = new Item();\r\n\t $item = $ebay->getItemData(221455735202); \r\n\t $cat = $this->checkCreateCategoryTree($item->categoryName);\t \r\n\t $this->checkCreateProduct($cat);\r\n\t $this->downloadImages();\r\n\t\r\n }", "protected function pushFiles()\n {\n $branch = $this->getCurrenBranch();\n\n $dir = HOME.'/repos/'.$this->getRepoName().'/'.$branch.'/files/';\n\n if (!$this->getFilesystem()->exists($dir)) {\n $this->getFilesystem()->makeDirectory($dir);\n }\n\n foreach ($this->getAllFiles() as $file) {\n if (empty($file)) {\n continue;\n }\n\n $sourceDir = pathinfo($file, PATHINFO_DIRNAME);\n if (!$this->getFilesystem()->exists($dir.$sourceDir)) {\n $this->getFilesystem()->makeDirectory($dir.$sourceDir);\n }\n\n $source = $this->repository->getDirectory().'/'.$file;\n $this->getFilesystem()->copy($source, $dir.$file);\n }\n\n $this->sync($dir, $this->getConfig()->get('app.bucket'), $this->getRepoName().'/'.$branch.'/files');\n $this->getFilesystem()->deleteDirectory($dir);\n\n return $this->getRepoName().'/'.$branch.'/files';\n }", "protected function publishConfigurationFile()\n {\n // Determine the Local Configuration Path\n $source = $this->getLocalConfigurationPath();\n\n // Determine the Application Configuration Path\n $destination = $this->getApplicationConfigPath();\n\n // Publish the Configuration File\n $this->publishes([$source => $destination], 'config');\n }", "public function deploy(){\n\t\t\t// load all configuration, payload, etc\n\t\t\t$this->load();\n\n\t\t\t// setup directories\n\t\t\t$this->setup_dirs();\n\n\t\t\t// initialise local git repositories\n\t\t\t$this->init_repo();\n\n\t\t\t// run the deployment\n\t\t\t$this->_deploy();\n\t\t}", "function push_curl_post($msg_body, $address) {\n\t$now = date(\"Y-m-d H:i:s\");\n\techo \"[$now] get the msg [$msg_body]. \\n\";\n\t$now = date(\"Y-m-d H:i:s\");\n\techo \"[$now] trying to push msg [$msg_body] to [$address]. \\n\";\n//\tsleep(3);\n\t$url = 'http://dl.gipsa.name/receive_push.php';\n\t$data = array(\n\t\t'msg' => $msg_body,\n\t\t'time' => time(),\n\t);\n\t// $post_string = http_build_query($data, '', '&amp;');\n\t// http_post_data($url, $post_string);\n\tcurl_single_post($url, $data);\n\t// todo wait for client's ack\n\t$now = date(\"Y-m-d H:i:s\");\n\techo \"[$now] write the message [$msg_body] into DB after 3 trail of push for [$address]. \\n\";\n\treturn 0;\n}", "public function upload() {\n // FYI. We are on master now.\n $m_ftp = new \\Model_Ftp();\n $m_ftp->user_id = $this->user_id;\n $branch = $this->branch;\n // Get ftp data for the respective branch\n $ftp_data = $m_ftp->get($branch['ftp_id']);\n\n if (count($ftp_data) !== 1) {\n $this->log('Failed: Enviornment does not have a Linked FTP account.');\n throw new Exception(\"No Linked FTP for enviornment.\");\n } else {\n $ftp_data = $ftp_data[0];\n }\n\n // Testing if the FTP server works.\n try {\n $ftp_data['user'] = $ftp_data['username'];\n $ftp_url = http_build_url($ftp_data);\n// $ftp_test = utils::test_ftp($ftp_url);\n $ftp_test = new \\Banago\\Bridge\\Bridge($ftp_url);\n if ($ftp_test) {\n $this->log('ftp_connect', 'connected');\n }\n } catch (Exception $e) {\n $this->log('ftp_connect', 'connection failed: ' . $e->getMessage());\n throw new Exception('We are sending msg here.' . $e->getMessage());\n }\n\n // LOG --------------------------------\n $this->log('deploy_branch', $branch['branch_name']);\n $this->log('deploy_branch_env', $branch['name']);\n $this->output('Deploy to branch name: ' . $branch['branch_name']);\n // LOG END ----------------------------\n\n /*\n * Data is ready, need to get ready with repository state.\n * Has to be checked out to the branch specified\n * and has to be checked out to the commit specified.\n */\n\n /*\n * pull and clone done,\n * checkout to branch now.\n */\n\n $this->output('Checkout to ' . $branch['branch_name']);\n \\Utils::gitCommand(\"checkout \" . $this->branch['branch_name']);\n $this->log('revision_on_server_before', $branch['revision']);\n $this->output('Revision on FTP: ' . $branch['revision']);\n\n // Setting options for gitcore\n $options = array(\n 'record_id' => $this->record_id,\n 'repo' => $this->repo_dir,\n 'debug' => $this->debug,\n 'deploy_id' => $this->deploy_id,\n 'server' => 'default',\n 'ftp' => array(\n 'default' => array(\n 'scheme' => $ftp_data['scheme'],\n 'host' => $ftp_data['host'],\n 'user' => $ftp_data['username'],\n 'pass' => $ftp_data['pass'],\n 'port' => $ftp_data['port'],\n 'path' => $ftp_data['path'],\n 'passive' => TRUE,\n 'skip' => unserialize($this->branch['skip_path']),\n 'purge' => unserialize($this->branch['purge_path']),\n )\n ),\n 'remoteRevision' => $branch['revision'],\n );\n\n // if type_rollback.\n if ($this->record['record_type'] == $this->m_record->type_rollback && !empty($this->record['hash'])) {\n // checkout the the specific hash.\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // if type_sync\n if ($this->record['record_type'] == $this->m_record->type_sync) {\n // upload all files please.\n $options['remoteRevision'] = '';\n }\n\n if ($this->record['record_type'] == $this->m_record->type_service_push) {\n // push from github/bitbucket.\n if (!empty($this->record['hash']))\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // else its update\n\n $localRevision = \\Utils::gitCommand('rev-parse HEAD');\n if (isset($localRevision[0])) {\n $localRevision = trim($localRevision[0]);\n $options['localRevision'] = $localRevision;\n }\n\n if ($options['localRevision'] == $options['remoteRevision']) {\n $this->output('FTP server has the latest changes!');\n $this->log('FTP server has the latest changes!');\n }\n\n $this->output($localRevision);\n\n $gitcore = new \\Gitcore($options);\n try {\n // todo: we're inside.\n $gitcore->startDeploy();\n } catch (Exception $e) {\n // Store logs from GITCORE.\n $this->log('deploy_log', $gitcore->log);\n $this->output($this->log);\n throw new \\Exception($e->getMessage());\n }\n\n // Store Logs from GITCORE.\n $this->log['deploy_log'] = $gitcore->log;\n $this->output($this->log);\n\n $before_revision = $this->log['deploy_log']['remoteRevision_before'];\n $current_revision = $this->log['deploy_log']['remoteRevision_after'];\n\n // Storing output from GITCORE.\n $this->m_record->set($this->record_id, array(\n 'raw' => serialize($this->log),\n 'amount_deployed' => $this->log['deploy_log']['deployed']['human'],\n 'amount_deployed_raw' => $this->log['deploy_log']['deployed']['data'],\n 'file_add' => $this->log['deploy_log']['files']['upload'],\n 'file_remove' => $this->log['deploy_log']['files']['delete'],\n 'file_skip' => $this->log['deploy_log']['files']['skip'],\n 'hash' => $current_revision,\n 'hash_before' => $before_revision,\n ));\n\n // OK,\n // Update branch to ready,\n // Update branch revision.\n $this->m_branches->set($branch['id'], array(\n 'ready' => 1,\n 'revision' => $current_revision\n ));\n\n // OK, checkout to master.\n \\Utils::gitCommand('checkout master');\n }", "public function add_image_post() {\n $itemId = $this->input->post('item_id');\n $uploadResult= $this->upload();\n if ($uploadResult['upload'] === 'ok') {\n $fileData = $uploadResult['fileData'];\n $updatePayload = array(\n 'photo' => $fileData['file_name']\n );\n $res = $this->model->update($itemId, $updatePayload);\n return $this->response(\n array(\n \"status\" => \"ok\",\n \"result\" => $res\n ),\n parent::HTTP_ACCEPTED\n );\n\n }else{\n return $this->response(\n array( 'status' => 'UPLOADING FAILED', \n 'code' => '200', \n 'message' => $uploadResult['err']), \n parent::HTTP_BAD_GATEWAY );\n }\n }", "public function push($message);", "public function addFileToBasket()\n {\n\n /*$header = $this->file->getHeader();\n if($header !== array('type','title','isbn','price','authors')){\n throw new Exception('File header is not correct');\n }*/\n\n $data = $this->getFileData();\n\n foreach ($data as $key => $value) {\n $bookFactory = new BookFactory();\n $book = $bookFactory->makeBook($value['title'], $value['authors'], $value['isbn'], $value['price'], $value['type']);\n\n $this->basket->addBook($book);\n }\n }", "function rabbitMqNotify(){\n $ini_file = parse_ini_file(\"/etc/airtime/airtime.conf\", true);\n $url = \"http://localhost/api/rabbitmq-do-push/format/json/api_key/\".$ini_file[\"general\"][\"api_key\"];\n\n echo \"Contacting $url\".PHP_EOL;\n $ch = curl_init($url);\n curl_exec($ch);\n curl_close($ch); \n}", "public function uploadMeta()\n\t{\n global $mysql;\n\n Debug::log('<hr><h1>Beginning meta update</h1><hr>', LEVEL_MAIN);\n \n $startTime = new DateTime();\n\n\t\t$version = $this->getVersionNumberFromFolder($this->folderlocation);\n\n\t\tif ($this->getVersionExistsInDatabase($version, $this->versionId) == null)\n\t\t{\n Debug::log('New version detected', LEVEL_MINIMUM);\n\n // Todo: Migrate to stored procedure\n $mysql->insert('wot_versions', array('version' => $version, 'published' => time()));\n\n $this->versionId = $mysql->getLastUpdatedId();\n\t\t}\n \n $this->deserializeWoTMetaFiles();\n $this->copyTranslationFiles();\n $this->updateTranslations();\n \n $this->vehicles_path = 'versions/' . $this->version . '/';\n \n $this->ImportEquipment();\n $this->ImportTankInformation();\n\n\n Debug::log('<hr><h1>Completed meta upate</h1>', LEVEL_MAIN);\n Debug::log('Meta update took '.$startTime->diff(new DateTime())->format('%I minutes and %S seconds'), LEVEL_MAIN);\n \n\t}", "public function pushRepository($dir, $target_project);", "function imscp_send_request($ip, $post_arr = array()){\n\t$rv = '';\n\t$post_str = '';\n\n\tforeach ($post_arr as $var => $value){\n\t\t$post_str .= urlencode($var) .'='. urlencode($value) .'&';\n\t}\n\n\t$req = 'POST /bridge.php HTTP/1.1' . \"\\r\\n\";\n\t$req .= \"Host: $ip\\r\\n\";\n\t$req .= \"User-Agent: Mozilla/5.0 Firefox/3.6.12\\r\\n\";\n\t$req .= \"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\\r\\n\";\n\t$req .= \"Accept-Language: en-us,en;q=0.5\\r\\n\";\n\t$req .= \"Accept-Encoding: deflate\\r\\n\";\n\t$req .= \"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\\r\\n\";\n\n\t$post_str = substr($post_str, 0, -1);\n\t$req .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t$req .= 'Content-Length: '. strlen($post_str) . \"\\r\\n\\r\\n\";\n\t$req .= $post_str;\n\n\tif (($fp = @fsockopen($ip, WHMCS_IMSCP_SERVER_PORT, $errno, $errstr)) == false){\n\t\treturn \"Error: Can not connect to $ip:\". WHMCS_IMSCP_SERVER_PORT .\"\\n$errno: $errstr\\n\";\n\t}\n\n\tstream_set_timeout($fp, 0, WHMCS_IMSCP_TIMEOUT * 1000);\n\n\tfputs($fp, $req);\n\twhile ($line = fgets($fp)){\n\t\t$rv .= $line;\n\t}\n\tfclose($fp);\n\n\t$rv = substr($rv, strpos($rv, \"\\r\\n\\r\\n\") + 4);\n\tif(!$rv){\n\t\t$rv = \"Error: Unknown error\\n\";\n\t}\n\n\treturn $rv;\n}", "public function publish()\n {\n $this->move('config/auth.php', config_path(), 'auth.php');\n $this->move('config/services.php', config_path(), 'services.php');\n\n $this->notify('Publishing: Config Files');\n }", "function send_message ($message)\t\t\t\t\n\t{\n\t\t$con = new Stomp('tcp://'.ACTIVEMQ_SERVER.':61613');\n\t\t$con->connect();\n\t\t$con->send(\"/queue/s3backup\", $message);\n\t\n\t}", "function save_config()\n\t{\n\t\t$pop3=post_param_integer('pop3',-1);\n\t\tif ($pop3!=-1)\n\t\t{\n\t\t\t$dpop3=post_param('dpop3');\n\t\t\t$GLOBALS['SITE_DB']->query_insert('prices',array('name'=>'pop3_'.$dpop3,'price'=>$pop3));\n\t\t\tlog_it('POINTSTORE_ADD_MAIL_POP3',$dpop3);\n\t\t}\n\t\t$this->_do_price_mail();\n\t}", "public function pushData($bigBody)\n {\n\n $ctx = stream_context_create();\n stream_context_set_option($ctx, 'ssl', 'local_cert',$this->localcert);\n stream_context_set_option($ctx, 'ssl', 'passphrase', $this->passphrase);\n \n // Open a connection to the APNS server\n //$fp = stream_socket_client(“ssl://gateway.push.apple.com:2195“, $err, $errstr, 60, //STREAM_CLIENT_CONNECT, $ctx);\n \n $fp = stream_socket_client(\n 'ssl://gateway.sandbox.push.apple.com:2195', $err,\n $errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);\n\t\n \n if (!$fp)\n exit(\"Failed to connect: $err $errstr\" . PHP_EOL);\n\n echo 'Connected to APNS' . PHP_EOL;\n\n // 消息\n // $payload =json_encode($body);\n for ($i = 0; $i < count($this ->deviceToken); $i++){\n\t $body['aps'] = array(\n 'alert' => $bigBody[$i]['aps']['alert'],\n 'sound' => $bigBody[$i]['aps']['sound'],\n 'badge' => (int)$bigBody[$i]['aps']['badge'] //this badge is pns in deviceAndStudent table.\n \t\t\t );\n \t\t $body['moduleName'] = $bigBody[$i]['moduleName'];\n \t\t $body['content'] = $bigBody[$i]['content'];\n\t\t//print_r($body);\n \n $payload =json_encode($body);\n // Build the binary notification\n $msg = chr(0) . pack('n', 32) . pack('H*', $this ->deviceToken[$i]) . pack('n', strlen($payload)) . $payload;\n // Send it to the server\n $result = fwrite($fp, $msg, strlen($msg));\n }\n\n if (!$result)\n {\n echo 'Message not delivered' . PHP_EOL;\n }\n else\n {\n echo 'Message successfully delivered' . PHP_EOL;\n }\n echo $result;\n // Close the connection to the server\n fclose($fp);\n }", "public function writeAndPush()\n {\n $this->gitConfig();\n $this->writeFullConfFile();\n $this->writeUsers();\n if($this->commitConfig()) $this->pushConfig();\n }", "protected function publishBookmarksFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Bookmarks\\BookmarksServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Bookmarks\\BookmarksServiceProvider\",\n ]);\n }", "public function createSmil(){\n\n try {\n\n $smil = $this->song->songId.\"_song.smil\";\n $streamUrl = 'vod/smil:'.$smil.'/playlist.m3u8';\n /* $this->song->smilFile = $slim;\n $this->song->streamUrl = $streamUrl;*/\n $this->song->update([\n 'smilFile' => $smil,\n 'streamUrl' => $streamUrl,\n ]);\n\n $smilfile = fopen(\"newfile.smil\", \"w\") or die(Log::error(\"something went wrong\"));\n $txt = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <smil title=\"Audio SMIL\">\n <body>\n <switch><audio src=\"mp3:'.$this->song->songId.'_song.mp3\"> \n <param name=\"audioBitrate\" value=\"128000\" valuetype=\"data\"></param> \n </audio>\n </switch>\n </body>\n </smil>';\n fwrite($smilfile, $txt);\n fclose($smilfile);\n\n // $extn = $smilfile->getClientOriginalExtension();\n $smil_fileName = $smil;\n $imageController = new ImageController();\n $trackPath = $imageController->UploadSmil('smil', $smilfile, $smil_fileName, $this->song->songId);\n }catch (Exception $exception){\n Log::error($exception->getMessage());\n }\n\n\n\n }", "public function backup() {\n $result = $this->dumpDatabase();\n $size = $this->getFilesize($this->filename);\n $this->sendMail($result, $size);\n echo $this->lang['all_done'];\n }", "protected function publishApprovalsFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Approvals\\ApprovalsServiceProvider\",\n ]);\n }", "public function run()\n {\n $attachment=new Image('https://picsum.photos/200/300');\n $response=OutgoingMessage::create('Este es mi nuevo producto')\n ->withAttachment($attachment);\n $this->say($response);\n $this->returnOrExit(Interactives::class);\n }", "private function publishConfig()\n\t{\n\t\t$config = __DIR__ . '/config/workflow.php';\n\n\t\t$this->publishes([$config => config_path('workflow.php')]);\n\n\t\t$this->mergeConfigFrom($config, 'workflow');\n\t}", "private function putPoster($file_name) {\n\t\t$bytes = File::size($file_name);\n\t\tif ($bytes > 0) {\n\t\t\t//Send the\n\t\t\t$info = new \\SplFileInfo($file_name);\n\t\t\t$key = sprintf('posters/%s', $info->getFilename());\n\t\t\t//Send File back up to S3.\n\t\t\t$options = array(\n\t\t\t\t'Bucket' => $this->s3->request['bucket'],\n\t\t\t\t'Key' => $key,\n\t\t\t\t'CacheControl' => 'max-age=172800',\n\t\t\t\t'SourceFile' => $file_name,\n\t\t\t);\n\t\t\t$this->s3->put($options);\n\t\t}\n\t}", "public function add(){\n\t\t\n\t\t// Open or create file\n\t\t$f = fopen($this->file, 'wb');\n\t\tfclose($f);\n\t}", "public function uploadNzb($filename, $category, $addToTop, $nzb)\n {\n error_log('filename: '.$filename);\n error_log('category: '.$category);\n error_log('addToTop: '.$addToTop);\n error_log('nzb: '.$nzb);\n\n $args = [$filename, $category, $addToTop, base64_encode($nzb)];\n\n return $this->sendrequest('append', $args);\n }", "protected function publishNotesFiles(): void\n {\n $this->call('vendor:publish', [\n '--tag' => 'migrations',\n '--provider' => \"Nesiasoft\\Core\\Notes\\NotesServiceProvider\",\n ]);\n\n $this->call('vendor:publish', [\n '--tag' => 'config',\n '--provider' => \"Nesiasoft\\Core\\Notes\\NotesServiceProvider\",\n ]);\n }", "public function execute()\n { //load model\n /* @var $paymentMethod \\Magento\\Authorizenet\\Model\\DirectPost */\n $paymentMethod = $this->_objectManager->create('Sslwireless\\Sslcommerz\\Model\\Sslcommerz');\n if(!empty($this->getRequest()->getPostValue()))\n {\n $data = $this->getRequest()->getPostValue();\n $resp = $paymentMethod->ipnAction($data);\n \n $ipn_log = fopen(\"SSLCOM_IPN_LOG.txt\", \"a+\") or die(\"Unable to open file!\");\n $ipn_result = array('Transaction ID:' => $data['tran_id'],'Date Time:' => $data['tran_date'],'Val ID:' => isset($data['val_id']) ? $data['val_id'] : '','Amount:' => $data['amount'],'Card Type:' => $data['card_type'],'Card Type:' => $data['card_type'],'Currency:' => $data['currency'],'Card Issuer:' => $data['card_issuer'],'Store ID:' => $data['store_id'],'Status:' => $data['status'],'IPN Response:'=>$resp);\n\n fwrite($ipn_log, json_encode($ipn_result).PHP_EOL);\n fclose($ipn_log);\n }\n else\n {\n echo \"<span align='center'><h2>IPN only accept POST request!</h2><p>Remember, We have set an IPN URL in first step so that your server can listen at the right moment when payment is done at Bank End. So, It is important to validate the transaction notification to maintain security and standard.As IPN URL already set in script. All the payment notification will reach through IPN prior to user return back. So it needs validation for amount and transaction properly.</p></span>\";\n }\n }", "public function uploadPokemons(array $pokemons): void;", "public function upload_xml()\n {\n $this->upload_xml_file();\n }", "protected function publishAllVendorFiles()\n {\n $this->info('[START] Publishing all vendor files..........');\n\n $this->call('vendor:publish', ['--all' => true]);\n\n $this->info('[DONE ] Publishing all vendor files.');\n }", "public function run()\n\t{\n\t\t$this->getOnHoldOrders();\n\t\tMage::log(\"On Hold orders compilation completed\",null,$this->logfile);\n\t\t\n\t\t// move file to archive location and rename to today's date\n\t\t$this->archiveFile();\n\t\tMage::log(\"Files archived with name \".$this->archivedFile,null,$this->logfile);\t\n\t\t\n\t\t// process inventory\n\t\t$this->processInventory();\n\t\tMage::log(\"Inventory Sync Completed for \".$this->archivedFile,null,$this->logfile);\t\n\t\n\t\t// write final csv and mail the attachment\n\t\t$this->writecsv();\n\t\t\n\t\t$this->sendMail();\n }", "function addToModelsList($fileid)\n{\n#echo $userid;\n#echo $fileid;\n#update eval/model list \n$listfile = \"/home/dingz/bob.spear-1.1.8/eggs/xbob.db.voxforge-0.1.0-py2.7.egg/xbob/db/voxforge/lists/eval/for_models.lst\";\n$content = file_get_contents($listfile);\n#echo \"bp2\";\n$content .= (\"0/\" . $fileid . \" Unknown Unknown\\n\");\nfile_put_contents($listfile,$content);\n#echo \"File list updated!\\n\";\n#echo \"bp3\";\n}", "private function publishesConfig(): void\n {\n $this->publishes([\n __DIR__.'/../config/invite-codes.php' => config_path('invite-codes.php'),\n ], 'invite-codes-config');\n }", "public function deploy(ServerData $server, File $path, array $files);", "public function importFileCommand(string $fileName)\n {\n if (! file_exists($fileName)) {\n $this->outputLine('The file \"' . $fileName . '\" does not exist.');\n $this->quit(1);\n }\n\n // Setup, needed for CLI request\n $_SERVER['REQUEST_METHOD'] = 'POST';\n\n // Copy the file to a temporary location, as the h5p core actually deletes it after import.\n $copyPath = FLOW_PATH_DATA . 'Temporary/H5P/__import';\n $copyFilename = $copyPath . '/currentimport.h5p';\n Files::createDirectoryRecursively($copyPath);\n copy($fileName, $copyFilename);\n\n // Start the library import\n $this->h5peditor->ajax->action(\\H5PEditorEndpoints::LIBRARY_UPLOAD, 'dummy', $copyFilename, null);\n\n $this->outputLine(\"\");\n $this->outputLine(\"=======================================\");\n $this->outputLine(\"Done importing H5P file.\");\n\n // Publish the h5p library collection so the library files are made available\n $cliRequest = new Request();\n $cliRequest->setControllerObjectName('Neos\\Flow\\Command\\ResourceCommandController');\n $cliRequest->setControllerCommandName('publish');\n $cliRequest->setArguments([\n 'collection' => 'h5p-libraries'\n ]);\n $cliResponse = new Response();\n $this->dispatcher->dispatch($cliRequest, $cliResponse);\n\n // Publish the h5p content collection so the library files are made available\n $cliRequest = new Request();\n $cliRequest->setControllerObjectName('Neos\\Flow\\Command\\ResourceCommandController');\n $cliRequest->setControllerCommandName('publish');\n $cliRequest->setArguments([\n 'collection' => 'h5p-content'\n ]);\n $cliResponse = new Response();\n $this->dispatcher->dispatch($cliRequest, $cliResponse);\n }", "public function actionPush(){\n\t\t$postData = CJSON::decode(file_get_contents('php://input'));\n\t\tif($postData['device_id'] && $postData['status']){\n\t\t\t$criteria = new CDbCriteria;\n\t\t\t$criteria->addInCondition('device_id', array($postData['device_id']));\n\t\t\t$device = NeDevice::model()->find($criteria);\n\t\t\tif($device){\n\t\t\t\t$device->enable = $postData['status'];\n\t\t\t\t$device->save();\n\t\t\t}\n\t\t}\n\t}", "public function upload_local_file()\n\t{\n if ($this->local_file) {\n \t$s3 = AWS::createClient('s3');\n $s3->putObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location,\n 'SourceFile' => $this->local_file,\n 'ContentType' => $this->mime,\n 'StorageClass' => $this->storage,\n 'ServerSideEncryption' => $this->encryption\n )\n );\n }\n\t}", "public function process_mkarapuz_price_file() {\n $xml = file_get_contents('http://www.mkarapuz.com.ua/price/mamaclub.xml');\n $xml = $movies = new SimpleXMLElement($xml);\n $storeId = 131;\n\n foreach ($xml->item as $item) {\n $barCode = (string)$item->EAN[0];\n\n $parameterGroup = ManagerHolder::get('ParameterGroup')->getOneWhere(array('bar_code' => $barCode), 'e.*, product.*');\n if (empty($parameterGroup)) {\n $product = ManagerHolder::get('Product')->getOneWhere(array('bar_code' => $barCode), 'e.*');\n } else {\n $product = $parameterGroup['product'];\n }\n\n if (empty($product)) {\n continue;\n }\n\n $where = array('product_id' => $product['id'], 'bar_code' => $barCode, 'store_id' => $storeId);\n $exists = ManagerHolder::get('StoreInventory')->existsWhere($where);\n $entity = array();\n $entity['qty'] = (int)$item->qty[0];\n\n if (!empty($parameterGroup)) {\n $entity['product_group_id'] = $parameterGroup['id'];\n }\n\n $entity['update_by_admin_id'] = '';\n $entity['update_source'] = 'web';\n $entity['updated_at'] = date(DOCTRINE_DATE_FORMAT);\n\n if ($exists) {\n ManagerHolder::get('StoreInventory')->updateAllWhere($where, $entity);\n } else {\n $entity = array_merge($entity, $where);\n ManagerHolder::get('StoreInventory')->insert($entity);\n }\n\n $productUpdate = array();\n $productUpdate['price'] = $item->rrc;\n $productUpdate['cost_price'] = $item->price;\n ManagerHolder::get('Product')->updateAllWhere(array('id' => $product['id']), $productUpdate);\n }\n }", "function sendBaToFTP($ba,$srvip,$login,$passw,$filename)\n\t{\n\t\t//if(!file_exists($this->output_dir) || !is_writeable($this->output_dir))\n\t\t//\ttrigger_error (\"please create a 'temp' directory first with write access\", E_USER_ERROR);\n\n\t\t$data = $ba->data;\n\n\t\tfile_put_contents(\"./badges/\".$filename, $data);\n\n\t\t$ftp_server = $srvip;\n\t\t$ftp_user = $login;\n\t\t$ftp_passwd = $passw;\n\n\t\t$result = false;\n\t\trequire_once \"ftp.api.php\";\n\t\tif ( $ftp = ftp_connect($ftp_server) ) {\n\t\t\tif (ftp_login($ftp,$ftp_user,$ftp_passwd)) {\n\t\t\t\t$result = ftp_put($ftp,$filename,\"./badges/\".$filename,FTP_BINARY);\n\t\t\t}\n\t\t} else {\n\t\t\t$result = false;\n\t\t}\n\t\tftp_close($ftp);\n\n\t\treturn $result;\n\t}", "public function store(): void\r\n {\r\n echo \"\\nStoring in cloud...\";\r\n }", "private function publishModule()\n {\n $from = base_path('vendor/typicms/things/src');\n $to = base_path('Modules/' . $this->module);\n\n if ($this->files->isDirectory($from)) {\n $this->publishDirectory($from, $to);\n } else {\n $this->error(\"Can’t locate path: <{$from}>\");\n }\n }", "public function upload()\n\t{\n\t\t/** @var \\Akeeba\\Backup\\Admin\\Model\\Transfer $model */\n\t\t$model = $this->getModel();\n\n\t\tif ($this->input->getBool('start', false))\n\t\t{\n\t\t\t$model->resetUpload();\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t$config = $model->getFtpConfig();\n\t\t\t$uploadResult = $model->uploadChunk($config);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$uploadResult = (object)[\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $e->getMessage(),\n\t\t\t\t'totalSize' => 0,\n\t\t\t\t'doneSize' => 0,\n\t\t\t\t'done' => false\n\t\t\t];\n\t\t}\n\n\t\t$result = (object)$uploadResult;\n\n\t\t@ob_end_clean();\n\t\techo '###' . json_encode($result) . '###';\n\t\t$this->container->platform->closeApplication();\n\t}", "function rdeploy() {\n\t\techo BR, TAB, TAB, '### checkOnce', BR;\n\t\t$this->checkOnce();\n\n\t\techo BR, TAB, TAB, '### pushAll', BR;\n\t\t$this->pushAll();\n\t\ttry {\n\t\t\t$exists = $this->rexists();\n\t\t} catch (\\SystemCommandException $e) {\n\t\t\t$exists = false;\n\t\t}\n\n\t\techo 'The destination folder ', $this->getVersionPath() . ($exists ? ' exists' : 'does not exist'), BR, BR;\n\t\tif ($exists) {\n\t\t\techo BR, TAB, TAB, '### rpull', BR;\n\t\t\t$this->rpull();\n\t\t\t$this->rcomposer();\n\t\t\t$this->postinstall();\n\t\t\t$this->rinstall();\n\t\t} else {\n\t\t\techo BR, TAB, TAB, '### mkdir', BR;\n\t\t\t$this->mkdir();\n\n\t\t\techo BR, TAB, TAB, '### rclone', BR;\n\t\t\t$this->rclone();\n\t\t}\n\n\t\techo BR, TAB, TAB, '### rupdate', BR;\n\t\t$this->rupdate();\n\n\t\techo BR, TAB, TAB, '### rcomposer', BR;\n\t\t$this->rcp('composer.json');\n\t\t$this->rcp('composer.lock');\n\t\t$this->rcomposer();\n\n\t\techo BR, TAB, TAB, '### postinstall', BR;\n\t\t$this->rpostinstall();\n\n\t\techo BR, TAB, TAB, '### rinstall', BR;\n\t\t$this->rinstall();\n\n\t\techo BR, TAB, TAB, '### rstatus', BR;\n\t\t$this->rstatus();\n\n\t\techo BR, TAB, TAB, '### deployDependencies', BR;\n\t\t$this->deployDependencies();\n\t\t$nr = $this->getMain()->nr();\n\t\t$this->exec('start http://'.$this->liveServer.'/v'.$nr);\n\t}", "public function uploadtoserver() {\r\n $targetDir = $_SERVER['DOCUMENT_ROOT'] . '/uploads/items/';\r\n\r\n //$cleanupTargetDir = false; // Remove old files\r\n //$maxFileAge = 60 * 60; // Temp file age in seconds\r\n // 5 minutes execution time\r\n @set_time_limit(5 * 60);\r\n\r\n // Uncomment this one to fake upload time\r\n // usleep(5000);\r\n // Get parameters\r\n $chunk = isset($_REQUEST[\"chunk\"]) ? $_REQUEST[\"chunk\"] : 0;\r\n $chunks = isset($_REQUEST[\"chunks\"]) ? $_REQUEST[\"chunks\"] : 0;\r\n $fileName = isset($_REQUEST[\"name\"]) ? $_REQUEST[\"name\"] : '';\r\n // Clean the fileName for security reasons\r\n $fileName = preg_replace('/[^\\w\\._]+/', '', $fileName);\r\n\r\n // Make sure the fileName is unique but only if chunking is disabled\r\n if ($chunks < 2 && file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName)) {\r\n unlink($targetDir . DIRECTORY_SEPARATOR . $fileName);\r\n /*$ext = strrpos($fileName, '.');\r\n $fileName_a = substr($fileName, 0, $ext);\r\n $fileName_b = substr($fileName, $ext);\r\n\r\n $count = 1;\r\n while (file_exists($targetDir . DIRECTORY_SEPARATOR . $fileName_a . '_' . $count . $fileName_b))\r\n $count++;\r\n\r\n $fileName = $fileName_a . '_' . $count . $fileName_b;*/\r\n }\r\n\r\n // Create target dir\r\n if (!file_exists($targetDir))\r\n @mkdir($targetDir);\r\n\r\n if (isset($_SERVER[\"HTTP_CONTENT_TYPE\"]))\r\n $contentType = $_SERVER[\"HTTP_CONTENT_TYPE\"];\r\n\r\n if (isset($_SERVER[\"CONTENT_TYPE\"]))\r\n $contentType = $_SERVER[\"CONTENT_TYPE\"];\r\n\r\n // Handle non multipart uploads older WebKit versions didn't support multipart in HTML5\r\n if (strpos($contentType, \"multipart\") !== false) {\r\n if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {\r\n // Open temp file\r\n $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? \"wb\" : \"ab\");\r\n if ($out) {\r\n // Read binary input stream and append it to temp file\r\n $in = fopen($_FILES['file']['tmp_name'], \"rb\");\r\n\r\n if ($in) {\r\n while ($buff = fread($in, 4096))\r\n fwrite($out, $buff);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\r\n fclose($in);\r\n fclose($out);\r\n @unlink($_FILES['file']['tmp_name']);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 103, \"message\": \"Failed to move uploaded file.\"}, \"id\" : \"id\"}');\r\n }\r\n else {\r\n // Open temp file\r\n $out = fopen($targetDir . DIRECTORY_SEPARATOR . $fileName, $chunk == 0 ? \"wb\" : \"ab\");\r\n if ($out) {\r\n // Read binary input stream and append it to temp file\r\n $in = fopen(\"php://input\", \"rb\");\r\n\r\n if ($in) {\r\n while ($buff = fread($in, 4096))\r\n fwrite($out, $buff);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\r\n\r\n fclose($in);\r\n fclose($out);\r\n }\r\n else\r\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\r\n }\r\n // Return JSON-RPC response\r\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\"}');\r\n }", "protected function publishFiles()\n {\n $this->publishes([\n __DIR__.'/Config/installer.php' => config_path('installer.php'),\n ], 'nickelcms');\n\n // $this->publishes([\n // __DIR__.'/assets' => resource_path('nicklecms/admin'),\n // ], 'nickelcms_assets');\n\n }", "public function modifyBmp($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'GET');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "private function home_marketplace_upload_attach(Request $request, $id) {\n Session::put('menu_item_parent', 'home');\n Session::put('menu_item_child', 'home_marketplace');\n Session::put('menu_item_child_child', '');\n $getfiles = $request->file('uploadedFileImage'); \n \n $fileName = $id.'.jpg'; \n \n SiteHelper::resizeAndUploadImage($getfiles,'HOMEMARKETPLACE',$fileName,[]);\n HomeMarketplace::find($id)->update(['image' => $fileName]);\n return \"true\";\n }", "public static function push(string $image, ?string $cwd = null)\n {\n self::runCommand(sprintf('push %s', $image), $cwd);\n }", "public function upload_postAction() {\n\t\t$ret = Common::upload('img', 'fanfan_topic');\n\t\t$imgId = $this->getPost('imgId');\n\t\t$this->assign('code' , $ret['data']);\n\t\t$this->assign('msg' , $ret['msg']);\n\t\t$this->assign('data', $ret['data']);\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "private function sendToRepository($package, $submissionid, $sword) {\n global $CFG,$DB;\n \n $dir= sys_get_temp_dir().'mets_swap_package.zip'; \n \n\t\t \n\t\t // The URL of the service document\n\t\t $url = $sword->url;\n\t\t \n\t\t \n\t\t // The user (if required)\n\t\t $user = $sword->username;\n\t\t \n\t\t // The password of the user (if required)\n\t\t $pw = $sword->password;\n\t\t \n\n\t\t // Atom entry to deposit\n\t\t $atomentry = \"test-files/atom_multipart/atom\";\n\t\t \n\t\t \n\n\t\t // The test content zip file to deposit\n\t\t $zipcontentfile = $dir;\n\n\n\n\t\t // The content type of the test file\n\t\t $contenttype = \"application/zip\";\n\n\t\t $packageformat=\"http://purl.org/net/sword-types/METSDSpaceSIP\";\n\t\t \n\t\t \n\t\t \n\t\t require_once($CFG->dirroot .'/mod/sword/api/swordappclient.php');\n\t\t \n\t\t \n\t\t \n\t\t $error = false;\n\t\t try{\n\t\t $sac = new SWORDAPPClient();\n\t\t \n\t\t $dr = $sac->deposit($url, $user, $pw, '', $package, $packageformat,$contenttype, false);\t\t \t\t \n\t\t \n\t\t\tif ($dr->sac_status!=201) { \n\t\t\t $status='error';\n\t\t\t $error = true;\n\t\t\t} else {\n\t\t\t $status='send';\n\t\t\t $error = false;\n\t\t\t}\n\t\t\n\t\t } catch(Exception $e){\t\n\t\t \n\t\t $status='error';\n\t\t $error = true;\n\t\t }\n\t\t \n\t\t \n\t\t $previous_submission = $DB->get_record('sword_submissions',array('submission'=>$submissionid, 'sword'=>$sword->id,'type'=>'assignment'));\n\t\t if ($previous_submission != NULL) {\t\t \n\t\t $previous_submission->status = $status;\n\t\t $DB->update_record('sword_submissions', $previous_submission);\n\t\t } else {\n\t\t $sword_submission=new stdClass();\n\t\t $sword_submission->submission=$submissionid;\n\t\t $sword_submission->sword=$sword->id;\n\t\t $sword_submission->type='assignment';\n\t\t $sword_submission->status=$status;\n\t\t $DB->insert_record('sword_submissions', $sword_submission);\n\t\t }\n\t\t \n\t\t \n\t\t \n\t\t return $error;\n \n }", "public function createModifiedBmp($request)\n {\n $returnType = '\\SplFileObject';\n $isBinary = true;\n $hasReturnType = true;\n $request = $this->getHttpRequest($request, 'POST');\n $options = $this->createHttpClientOptions();\n \n try {\n $response = $this->client->send($request, $options);\n return $this->processResponse($request, $response, $hasReturnType, $returnType, $isBinary);\n } catch (RequestException $e) {\n $this->processException($e);\n }\n }", "private function create_xml_file()\n {\n $this->add_to_log(__FUNCTION__, 'Attempting to create xml file for each state of the MMS order');\n $this->add_to_log(__FUNCTION__, implode(',', $this->_mms_order['Accepted']));\n \n if (($this->_mms_order['Accepted'] || $this->_mms_order['Delivered'] || $this->_mms_order['Disbanded']) && $this->get_shipment_number()) {\n foreach ($this->_mms_order as $_key => $_value) {\n if ($_key != \"ShipmentNumber\" && count($_value) >= 1) {\n // Save cleaned xml value into MMS order array property\n $_xml_value = $this->prepare_xml_string($this->_mms_order[$_key]['payload']);\n $this->_mms_order[$_key]['xml'] = $_xml_value;\n \n $_filename = date(\"Y-m-d\") . \"_\" . $this->get_shipment_number() . \"_\" . strtolower($_key) . \".xml\";\n $_file = $this->_config['data']['path'] . SELF::DS . $_filename;\n \n if ($this->write_to_file($_file, $_xml_value)) {\n \n if (file_exists($_file)) {\n $this->_mms_order[$_key]['xml_file'] = $_file;\n $this->add_to_xml_history($_key, $_file, $this->get_shipment_number(), 'created');\n }\n }\n }\n }\n }\n }", "public function invtZoneImgUplaod_post()\n {\n $data = $this->post();\n //print_r($data);\n //echo $data['kp_InventoryZoneID'];\n $inventoryZoneID = $data['kp_InventoryZoneID'];\n\n if(!empty($_FILES['file']['name']))\n {\n //echo \"not empty\";\n $msg = $this->inventoryzonemodel->doInvtZoneCustomUpload($inventoryZoneID);\n\n if($msg)\n {\n $this->response($msg, 200); // 200 being the HTTP response code\n }\n else\n {\n $this->response($msg, 404);\n }\n\n }\n\n\n\n }", "public function add_to_basket_post() {\n $user_id = $this -> post('user_id') ? $this -> post('user_id') : \"\";\n $special_id = $this -> post('special_id') ? $this -> post('special_id') : \"\";\n $product_id = $this -> post('product_id') ? $this -> post('product_id') : \"\";\n $product_count = (int) $this -> post('product_count') ? (int) $this -> post('product_count') : \"1\";\n \n $retailerId = (int) $this->post('retailer_id') ? (int)$this->post('retailer_id') : 0;\n $storeId = (int) $this->post('store_id') ? (int) $this->post('store_id') : 0;\n \n \n $allToAdd = \"No\";\n \n if($storeId > 0 )\n {\n $storeDetails = $this -> basketmodel -> get_store_retailer_details($storeId);\n $storeTypeId = $storeDetails['StoreTypeId'];\n }else{\n # Get user preference\n $user_preference = $this -> usermodel ->get_user_preference($user_id);\n if($user_preference)\n {\n $retailerId = $user_preference['RetailerId'];\n $storeTypeId = $user_preference['StoreTypeId'];\n $storeId = $user_preference['StoreId'];\n }\n }\n \n # Get products StorePrice \n $productStorePrice = $this -> productmodel ->get_product_store_price($product_id,$retailerId,$storeTypeId,$storeId);\n \n if($productStorePrice > 0 )\n {\n $allToAdd = \"Yes\"; \n }\n \n if($allToAdd == \"Yes\")\n {\n $result = $this -> basketmodel -> add_to_basket($special_id, $product_id, $user_id, $product_count);\n\n //$basket_count = $this -> basketmodel -> get_basket_count($user_id);\n $basket_count = $this -> basketmodel -> get_user_basket_count($user_id,$retailerId,$storeId);\n \n if ($result == 'duplicate') {\n $message = \"Product already added to basket\";\n $result = 0;\n }\n else {\n $message = \"Product added to basket successfully\";\n }\n\n if ($result) {\n $retArr['status'] = SUCCESS;\n $retArr['message'] = $message;\n $retArr['basket_count'] = $basket_count;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n else {\n $retArr['status'] = FAIL;\n $retArr['message'] = $message;\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die;\n }\n \n }else{\n $retArr['status'] = FAIL;\n $retArr['message'] = \"Not allow to add this product.\";\n $this -> response($retArr, 200); // 200 being the HTTP response code\n die; \n }\n }", "public function handle()\n {\n $stores = Config::get('amazon-mws.store');\n\n $pendingSkus = MarketplaceSkuMapping::where('process_status', '&', self::PENDING_PRICE)\n ->where('marketplace_sku_mapping.listing_status', '=', 'Y')\n ->where('marketplace_id', 'like', '%AMAZON')\n ->get();\n\n $pendingSkuGroups = $pendingSkus->groupBy('mp_control_id');\n\n foreach ($pendingSkuGroups as $mpControlId => $pendingSkuGroup) {\n $marketplaceControl = MpControl::find($mpControlId);\n $marketplace = $marketplaceControl->marketplace_id.$marketplaceControl->country_id;\n\n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\"?>';\n $xml .= '<AmazonEnvelope xsi:noNamespaceSchemaLocation=\"amzn-envelope.xsd\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">';\n $xml .= '<Header>';\n $xml .= '<DocumentVersion>1.01</DocumentVersion>';\n $xml .= '<MerchantIdentifier>'.$stores[$marketplace]['merchantId'].'</MerchantIdentifier>';\n $xml .= '</Header>';\n $xml .= '<MessageType>Price</MessageType>';\n\n foreach ($pendingSkuGroup as $index => $pendingSku) {\n $messageDom = '<Message>';\n $messageDom .= '<MessageID>'.++$index.'</MessageID>';\n $messageDom .= '<Price>';\n $messageDom .= '<SKU>'.$pendingSku->marketplace_sku.'</SKU>';\n $messageDom .= '<StandardPrice currency=\"DEFAULT\">'.$pendingSku->price.'</StandardPrice>';\n $messageDom .= '</Price>';\n $messageDom .= '</Message>';\n\n $xml .= $messageDom;\n }\n\n $xml .= '</AmazonEnvelope>';\n\n $platformProductFeed = new PlatformProductFeed();\n $platformProductFeed->platform = $marketplace;\n $platformProductFeed->feed_type = '_POST_PRODUCT_PRICING_DATA_';\n\n $feed = new AmazonFeed($marketplace);\n $feed->setFeedType('_POST_PRODUCT_PRICING_DATA_');\n $feed->setMarketplaceIds($stores[$marketplace]['marketplaceId']);\n $feed->setFeedContent($xml);\n\n if ($feed->submitFeed() === false) {\n $platformProductFeed->feed_processing_status = '_SUBMITTED_FAILED';\n } else {\n $pendingSkuGroup->transform(function ($pendingSku) {\n $pendingSku->process_status ^= self::PENDING_PRICE;\n $pendingSku->process_status |= self::COMPLETE_PRICE;\n $pendingSku->save();\n });\n $response = $feed->getResponse();\n $platformProductFeed->feed_submission_id = $response['FeedSubmissionId'];\n $platformProductFeed->submitted_date = $response['SubmittedDate'];\n $platformProductFeed->feed_processing_status = $response['FeedProcessingStatus'];\n }\n $platformProductFeed->save();\n }\n }" ]
[ "0.51826084", "0.5121605", "0.5018611", "0.5000457", "0.49861905", "0.49823323", "0.49602786", "0.49558124", "0.49434078", "0.48499784", "0.48164496", "0.4805267", "0.48006034", "0.47724742", "0.4767228", "0.47614112", "0.47601822", "0.47166955", "0.4707483", "0.47058022", "0.4682376", "0.4681981", "0.46774414", "0.4667758", "0.4663602", "0.4659472", "0.46481737", "0.46455568", "0.46446586", "0.46446586", "0.46442625", "0.46235156", "0.46219918", "0.46139643", "0.46096742", "0.4559392", "0.45528474", "0.4531183", "0.4523095", "0.45181996", "0.45181996", "0.44910094", "0.44896117", "0.44866827", "0.4485992", "0.4484177", "0.44829112", "0.44770247", "0.4476161", "0.44739813", "0.44651735", "0.4463126", "0.44559073", "0.4450503", "0.44469875", "0.44468114", "0.44420287", "0.44395745", "0.44238138", "0.4413887", "0.4410989", "0.44068784", "0.43999493", "0.4377283", "0.436103", "0.43522906", "0.43359476", "0.43260482", "0.43245766", "0.43195534", "0.43168393", "0.43130586", "0.43108884", "0.4309388", "0.43029207", "0.42909977", "0.42839512", "0.4283502", "0.4276826", "0.42710966", "0.4266793", "0.42628253", "0.42610887", "0.42560625", "0.42539015", "0.42493677", "0.4246667", "0.4244159", "0.42421052", "0.4240322", "0.4226787", "0.42201424", "0.42182595", "0.42121494", "0.42084083", "0.4208275", "0.42022327", "0.42008832", "0.41989124", "0.41975948" ]
0.6761898
0
Update the Sync Date so we know what was updated and when.
public function updateSyncDate() { $result=false; try{ infolog('[BulkInventory.updateSyncDate] Preparing to update sync date... '. now()); $sQl=" UPDATE products p, ebay_details ed SET ed.synced_at=NOW() WHERE p.id=ed.product_id AND ed.listingid IS NOT NULL AND (p.updated_at > ed.synced_at OR ed.synced_at IS NULL) ; "; DB::connection()->getpdo()->exec($sQl); infolog('[BulkInventory.updateSyncDate] SUCCESS at '. now()); $result=true; }catch(\Exception $e) { infolog('[BulkInventory.updateSyncDate] ERROR updating sync date ('.$e->getMessage().') at '. now()); } return($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}", "protected function _syncModDate() {}", "public function refreshUpdated()\n {\n $this->setUpdated(new \\DateTime());\n }", "public function setSyncTime(): void\n {\n }", "public function beforeUpdate()\n {\n $this->owner->{$this->updatedAtField} = date($this->format);\n }", "public function beforeUpdate()\n {\n\t\t// Asignar fecha y hora de ultima actualizacion\n// $this->updatedon = time();\n }", "public function updateSyncStamp()\n {\n throw new Horde_ActiveSync_Exception('Not supported in this state driver.');\n }", "public function preUpdate()\n {\n $this->dateUpdated = new \\DateTime();\n }", "protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function onPreUpdate()\n {\n $this->dateUpdated = new DateTime('now');\n }", "public function _update()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function refreshUpdated(): void\n {\n $this->setUpdatedAt(new \\DateTime());\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}", "public function onPreUpdate()\n {\n $this->lastUpdatedDateTime = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime(\"now\");\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }", "public function onPreUpdate()\r\n {\r\n $this->updated_at = new \\DateTime(\"now\");\r\n }", "protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }", "public function onPreUpdate()\n {\n $this->updated = new \\DateTime('now');\n }", "public function refreshUpDated()\n {\n $this->setUpdated(new \\DateTime());\n }", "public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "public function onPreUpdate(): void\n {\n $this->updated = new DateTime(\"now\", new DateTimeZone(\"UTC\"));\n }", "public function getUpdatedDate()\n {\n return $this->updated;\n }", "public function markLastUpdate()\n {\n if (!$this->updatedAtOveridden) {\n $this->updatedAt = new \\DateTime();\n }\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function getDateUpdate()\n {\n return $this->dateUpdate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "protected function _update()\n {\n $this->oxnews__oxdate->setValue(oxRegistry::get(\"oxUtilsDate\")->formatDBDate($this->oxnews__oxdate->value, true));\n\n\n parent::_update();\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function addUpdated()\n {\n try {\n $date = new DateTime();\n $this->updated_at = $date->format('Y-m-d H:i:s');\n $this->updated_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "public function preUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function preUpdate()\n {\n $this->updatedAt = new \\DateTime;\n }", "function getUpdateDate() {\n\t\treturn $this->_UpdateDate;\n\t}", "public function onPreUpdate()\n {\n $this->fechaUltimaModificacion = new \\DateTime(\"now\");\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getDateUpdated() {\n return $this->dateUpdated;\n }", "public function preUpdate()\n {\n \t$this->dateFound = new \\DateTime(\"now\");\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime('now');\n }", "public function beforeUpdate()\n {\n $this->modified_in = date('Y-m-d H:i:s');\n }", "public function onPreUpdate()\n {\n $this->setUpdated(new \\DateTime(\"now\"));\n }", "public function getUpdatedDate()\n {\n return $this->updated_date;\n }", "public function preUpdate()\n {\n $this->dateModification = new \\DateTime();\n }", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function refreshUpdateAt() {\n // Get session\n $securitySession = $this->getSecuritySession();\n if($securitySession != null) {\n $securitySession[self::SESS_UPDATED_AT] = time();\n $this->setSecuritySessionFromArray($securitySession);\n }\n }", "public function updatedTimestamps()\n {\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }", "public function getUpdate_date(){\n return $this->update_date;\n }", "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "public function doPreUpdate()\n {\n $this->updatedAt = new \\DateTime( 'now', new \\DateTimeZone( 'UTC' ) );\n }", "public function getUpdateTime()\r\n {\r\n return $this->update_time;\r\n }", "public function updateTopicModifiedDate()\n {\n $this->setAttribute( 'modified', time() );\n $this->store();\n }", "public function updatedTimestamps() {\n $this->setCreated(new \\DateTime(date('Y-m-d H:i:s')));\n\n if ($this->getCreated() == null) {\n $this->setCreated(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }", "public function updateDateCreated()\n\t\t{\n\t\t\t$db = $this->getDatabaseInstance(self::DB_INST_WRITE);\n\n\t\t\t$query = \"UPDATE status_history\n\t\t\t\t\t SET date_created=?\n\t\t\t\t\t WHERE application_id=?\n\t\t\t\t\t\tAND application_status_id=?\";\n\n\t\t\t$values = array($this->date_created, $this->application_id, $this->application_status_id);\n\n\t\t\t$st = $db->prepare($query);\n\t\t\t$st->execute($values);\n\n $this->setDataSynched();\n }", "public function getVersionUpdateTime()\n {\n return $this->version_update_time;\n }", "protected function _syncCreationDate() {}", "public function beforeUpdate()\n {\n $this->update_at=time();\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function getUpdateTime()\n {\n return $this->update_time;\n }", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }", "public function getUpdateTime() {\n return $this->update_time;\n }", "public function updatedTimestamps()\n {\n $this->setUpdatedAt(new \\DateTime(date('d-m-Y H:i')));\n\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('d-m-Y H:i')));\n }\n }", "public function getUpdate_time()\r\n {\r\n return $this->update_time;\r\n }", "private function updatePublishOnDate()\n {\n $this->owner->PublishOnDate = $this->owner->DesiredPublishDate;\n // Remove the DesiredPublishDate.\n $this->owner->DesiredPublishDate = null;\n }" ]
[ "0.7180906", "0.7105985", "0.6791538", "0.65797913", "0.6517309", "0.6515964", "0.649983", "0.6487567", "0.64808726", "0.6479388", "0.6479388", "0.6421553", "0.6416609", "0.64085025", "0.63902056", "0.63709426", "0.63574404", "0.63574404", "0.63495964", "0.63368946", "0.63363165", "0.6327176", "0.6322694", "0.6315765", "0.6315765", "0.63071495", "0.6304101", "0.62831897", "0.62831897", "0.62556875", "0.6238863", "0.6229897", "0.6229897", "0.6224953", "0.6224953", "0.6223379", "0.622172", "0.622172", "0.622172", "0.622172", "0.62189895", "0.6213966", "0.6213966", "0.6212832", "0.62117976", "0.6201533", "0.61939996", "0.6192227", "0.6176596", "0.6176596", "0.61760944", "0.61729217", "0.6167897", "0.6161422", "0.61588454", "0.6114865", "0.6114727", "0.6106165", "0.6106165", "0.60875744", "0.6050551", "0.6049242", "0.6030654", "0.6021459", "0.6020531", "0.601718", "0.6012544", "0.6008743", "0.60012364", "0.600009", "0.5978568", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.5975051", "0.59674746", "0.59674746", "0.5951362", "0.5946775", "0.59412915", "0.59127015", "0.5904584" ]
0.6708891
3
Run the database seeds.
public function run() { // when trying seed, possible error "Unique violation: // duplicate key value violates unique constraint "association_user_actions_user_id_action_id_unique" factory(AssociationUserAction::Class, 20)->create(); }
{ "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
funcion que contiene la relacion de la tabla Type_Users
public function user(){ return $this->hasMany('App\User'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTypeUsers(){\n $query = \"SELECT * FROM rol\";\n return $this->consulta($query);\n }", "function getUsers($user_type){\r\n global $pdo;\r\n\t\t\t$select = $pdo->prepare(\"SELECT * ,users.id AS userId \r\n FROM users \r\n\t\t\tLEFT JOIN user_types ON users.type = user_types.id\r\n\t\t\tWHERE user_types.type = ?\");\r\n\t\t\t//$res = mysql_query($select);\r\n $select->execute(array($user_type));\r\n\t\t return $select->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t}", "public function getLTIUsers();", "public function loadUserTypes(){\n\t\t\t$stmt = $this->db->executequery('select id_type_user, type_user, date_modification_type_user, description_type_user from type_user order by type_user asc');\n\t\t\tif (!$userTypes = $stmt->fetchall()) return array(); \n\t\t\tfor ($i = 0; $i < count($userTypes); $i++) {\n\t\t\t\t$userTypes[$i] = new UserType($userTypes[$i]['id_type_user'], $userTypes[$i]['type_user'], $userTypes[$i]['description_type_user'], $userTypes[$i]['date_modification_type_user']);\n\t\t\t}\n\t\t\treturn $userTypes;\n\t\t}", "function tablaUsuarios($consulta) {\n\tglobal $Buscador;\n\techo \"<tr class='tr-th'><td>Id</td><td>Tipo</td><td>Nombre</td><td>Email</td><td align='right'>\".$Buscador.\"</td></tr>\";\n\twhile($reg=mysql_fetch_array($consulta))\n\t{ \n\t\tif($reg['tipoUsuario']==\"Administrador\")\n\t\t\t$classTipoUser=\"flaticon-important\";\n\t\telse \n\t\t\t$classTipoUser=\"flaticon-user91\";\n\t\techo \"<tr class='tr'><td align='center'>\".$reg['IdUsuario'].\"</td><td width='100'><span class='\".$classTipoUser.\"'></span> \".$reg['tipoUsuario'].\"</td><td>\".$reg['Nombres'].\" \".$reg['Apellidos'].\"</td><td>\".$reg['Email'].\"</td><td align='right'><span class='flaticon-expand span-btn-admin' title='Detalles' onclick='expandDetails(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span><span class='flaticon-black322 span-btn-admin' title='Editar' onclick='editRows(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span><span class='flaticon-delete81 span-btn-admin' title='Borrar' onclick='deleteUser(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span></td></tr>\";\n\t}\n}", "function getTypeUser($a_s_login) {\n\t$connect = connectDB();\n\t$select = \"SELECT id_type_utilisateur FROM guichetdb.utilisateur WHERE \";\n\t$select .= \"login = '\".$a_s_login['login'].\"'\";\n\t$result = mysqli_query($connect, $select);\n\t\n\tif ( $row = mysqli_fetch_assoc($result) ){\n\t\tdisconnectDB($connect);\n\t\treturn $row['id_type_user'];\n\t}\n}", "public function getAllUsers() {\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM `tbl_users` WHERE `usr_type` = 0 ORDER BY `usr_id` ASC\");\n\t\t$stmt->execute();\n\t\t$result = getResult($stmt);\n\t\t$stmt->close();\n\t\treturn $result;\n\t}", "public function getUserType();", "public function getUserType();", "function modeloUserGetAll (){\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $db = AccesoDatos::getModelo();\n $tusuarios = $db->getUsuarios();\n foreach ($tusuarios as $clave=>$user){\n \n $tabla[$user->id]= ['nombre'=>$user->nombre,\n 'correo'=>$user->correo,\n 'plan'=>PLANES[$user->plan],\n 'estado'=>ESTADOS[$user->estado],\n ];\n }\n return $tabla;\n}", "public function userList(){\n $this->db->select(\"ui.user_id,\n CONCAT(ui.lname, ', ' ,ui.fname, ' ', ui.mname) name, u.user_type,\n ui.fname f_name,ui.lname l_name, ui.mname m_name , ui.email, \n u.username, u.password, uat.article_type_id, at.type article_type\n \")\n ->from(\"tbl_user_info ui\")\n ->join(\"tbl_user u\",\"ON u.id = ui.user_id\",\"inner\")\n ->join(\"tbl_user_article_type uat\",\"ON uat.user_id = ui.user_id\",\"left\")\n ->join(\"tbl_article_type at\",\"ON at.id = uat.article_type_id\",\"left\");\n $this->db->where(\"u.status\", \"saved\");\n $this->db->order_by(\"ui.lname\");\n $query = $this->db->get();\n \n foreach($query->result() as $each){\n $each->password = $this->encryptpass->pass_crypt($each->password, 'd');\n }\n\n return $query->result();\n }", "function get_all_usertype()\n\t\t{\n\t\t\t$query=\"SELECT * from tbl_user_type\";\n\t\t\t$result = execute_query($query);\n\t\t\treturn new readonlyresultset($result);\n\t\t}", "function get_usersTable(){\n $result = array();\n $users = selectQuery(TAB_USERS, \"\", \"id DESC\");\n $user_groups =\n $i = 0;\n\n foreach($users as $user){\n $id = $user['id'];\n $result[$i]['id'] = $id;\n $result[$i]['username'] = $user['username'];\n $result[$i]['password'] = \"**********\";\n $result[$i]['email'] = $user['email'];\n $result[$i]['group'] = selectJoin(TAB_USR_ROLE, TAB_GROUPS, \"groupId = id\", \"userId = $id\")[0]['role'];\n $i++;\n }\n return $result;\n}", "function users(){\n\t$listado= mysql_query(\"select us.name as name, us.email as email , co.name as pais\n\tfrom users us\n\tjoin country co on co.Code=us.countryCode\");\n\t\n\t$i = 1;\n\t\n\twhile ($reg = mysql_fetch_array($listado)) {\n\t\techo '<tr>';\n\t\techo '<td >' . $i . '</td>';\n\t\techo '<td >' . mb_convert_encoding($reg['name'], \"UTF-8\") . '</td>';\n\t\techo '<td >' . mb_convert_encoding($reg['email'], \"UTF-8\") . '</td>';\n\t\techo '<td >' . mb_convert_encoding($reg['pais'], \"UTF-8\") . '</td>';\n\t\techo '</tr>';\n\t\t$i++;\n\t}\n}", "function getEmpleados($columns){\n\t\t$sql = \"\n\t\tSELECT $columns\n\t\tFROM users \n\t\tWHERE ( user_type = 2 OR user_type = 1)\n\t\t/*AND\t\tuser_status = 0*/\n\t\tORDER BY user_last_name\";\n\t\treturn db_loadHashList( $sql );\n\t\t\n\t}", "function selectTypeUsu($user)\n{\n $c = conectar();\n $select = \"select tipo from USUARIOS where username='$user'\";\n $resultado = mysqli_query($c, $select);\n $fila = mysqli_fetch_assoc($resultado); //recoge la consulta msquli_query y escoge solo la fila que coincide con el select\n if ($fila == null) {\n $fila == 0;\n } else {\n $tipoUsuario = $fila[\"tipo\"];\n desconectar($c);\n return $tipoUsuario;\n }\n}", "function getype($usern){\r\n\r\n\tglobal $conn;\r\n\r\n\t$q = \"SELECT * FROM users WHERE username='\".$usern.\"' \";\r\n\r\n\t$result = mysql_query($q,$conn);\r\n\r\n\t$row=mysql_fetch_array($result);\r\n\r\n\treturn $row['type'];\r\n\r\n}", "public function listarUsuarios(){\r\n $sql = \"SELECT U.IdUsuario, U.NombreCompleto, U.Usuario, U.Correo, U.Estado, U.IdRol, R.Rol\r\n FROM usuarios AS U\r\n INNER JOIN roles AS R ON U.IdRol = R.IdRol;\";\r\n $tabla = $this->conexion->getTable($sql);\r\n return $tabla;\r\n}", "public function getUsersTable() {\n return $this->param['tblUsers'];\n }", "public function fetchAllUser() {\n try {\n // Select all users\n $query = \"\n select * \n from tb_user \n \";\n // Create object to connect to MySQL using PDO\n $mysqlPDO = new MySQLPDO();\n // Prepare the query\n $statement = $mysqlPDO->getConnection()->prepare($query);\n // Execute the query without paramters\n $statement->execute();\n // Get affect rows in associative array\n $rows = $statement->fetchAll();\n // Foreach row in array\n foreach ($rows as $row) {\n // Create a User object\n $user = new User($row);\n //Create datatable row\n $tmp_data[] = array(\n $user->getEmail(),\n $user->getUsername(),\n \"********\",\n \"<div style='text-align:center'>\".$user->getAccess().\"</div>\",\n $user->getState() == \"0\" ? '<div style=\"text-align:center\"><i class=\"fas fa-times\" style=\"color:red\"></i></div>' : '<div style=\"text-align:center\"><i class=\"fas fa-check\" style=\"text-align: center; color:green;\"></i></div>',\n \"<div style='text-align:center'><a href='javascript:update(\".json_encode($user).\")' class='btn btn-info'><i class='fas fa-edit'></i></a></div>\",\n \"<div style='text-align:center'><a href='javascript:remove(\".$user->getId().\")' class='btn btn-danger'><i class='far fa-trash-alt'></i></a></div>\"\n );\n }\n // Export into DataTable json format if there's any record in $tmp_data\n if (isset($tmp_data) && count($tmp_data) > 0) {\n $data = array(\n \"data\" => $tmp_data\n );\n } else {\n $data = array(\n \"data\" => array()\n );\n }\n return $data;\n } catch (PDOException $e) {\n die(\"Error message: \" . $e->getMessage());\n }\n }", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }", "private function secundaryUserTypes() {\n $query = \"select * from secondary_users_types;\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n return $this->AccentialApi->urlRequestToGetData('users', 'query', $params);\n }", "function FetchAllUserListData(){\n $this->db->select('BaseTbl.userId, BaseTbl.email, BaseTbl.name, BaseTbl.mobile, BaseTbl.createdDtm,BaseTbl.updatedDtm, BaseTbl.status, BaseTbl.is_emailVerify,BaseTbl.is_mobileVerify, Role.role');\n $this->db->from('users as BaseTbl');\n $this->db->join('user_roles as Role', 'Role.roleId = BaseTbl.roleId','left');\n\n $this->db->where('BaseTbl.isDeleted', 0);\n $this->db->where('BaseTbl.roleId !=', 1);\n $this->db->order_by('BaseTbl.userId', 'DESC');\n $query = $this->db->get();\n \n $result = $query->result(); \n return $result;\n }", "function listerUtilisateur()\n\t{\n\t\t$req=\"select idUti, nomUti, prenomUti, photoUti, telPorUti, mailUti, statutUti from utilisateur\";\n\t\t$exereq = mysql_query($req) or die(mysql_error());\n\t\n\t\twhile($ligne=mysql_fetch_array($exereq))\n\t\t{\n\t\t\t$tab[]=$ligne;\n\t\t}\n\n\t\treturn $tab;\n\t}", "function buscarTipoUsuario(){\n\t$queryUsuario = sprintf(\"SELECT id_usuario, nombre_usuario,\n CONCAT_WS(' ', nombre_empleado, apellido) AS nombre,\n clave_filtro,\n\t\t(CASE clave_filtro\n\t\t\t WHEN 1 THEN 'Ventas'\t\t\n WHEN 2 THEN 'Ventas'\n\t\t\t WHEN 4 THEN 'Postventa'\n WHEN 5 THEN 'Postventa'\n WHEN 6 THEN 'Postventa'\n WHEN 7 THEN 'Postventa'\n WHEN 8 THEN 'Postventa'\n WHEN 26 THEN 'Postventa'\n WHEN 400 THEN 'Postventa'\n\t\tEND) AS tipo\n \n\tFROM pg_usuario\n\t\tINNER JOIN pg_empleado ON pg_usuario.id_empleado = pg_empleado.id_empleado\n\t\tINNER JOIN pg_cargo_departamento ON pg_empleado.id_cargo_departamento = pg_cargo_departamento.id_cargo_departamento\n\tWHERE id_usuario = %s \",\n\tvalTpDato($_SESSION['idUsuarioSysGts'],\"int\"));\n\t\n\t$rsUsuario = mysql_query($queryUsuario);\n\tif (!$rsUsuario) return array(false, mysql_error().\"\\nError Nro: \".mysql_errno().\"\\nLine: \".__LINE__.\"\\n\".$queryUsuario);\n\t$row = mysql_fetch_array($rsUsuario);\n\n\treturn array(true, $row['tipo']);\n}", "function getUserTypes($Field='', $Input=array(), $multiRecords=FALSE){\r\n\r\n\t\t$Params = array();\r\n\t\tif(!empty($Field)){\r\n\t\t\t$Params = array_map('trim',explode(',',$Field));\r\n\t\t}\r\n\r\n\t\t$this->db->select('UT.UserTypeID UserTypeIDForUse, UT.UserTypeGUID, UT.UserTypeName, UT.IsAdmin,(SELECT COUNT(*) FROM `tbl_users` WHERE `UserTypeID` = UT.UserTypeID) AS UserCount');\r\n\t\t$this->db->select($Field,false);\r\n\t\t$this->db->from('tbl_users_type UT');\r\n\r\n\t\tif(!empty($Input['UserTypeID'])){\r\n\t\t\t$this->db->where('UT.UserTypeID',$Input['UserTypeID']);\r\n\t\t\t$this->db->limit(1);\t\t\t\r\n\t\t}\r\n\r\n\t\tif(!empty($Input['UserTypeGUID'])){\r\n\t\t\t$this->db->where(\"UT.UserTypeGUID\",$Input['UserTypeGUID']);\r\n\t\t\t$this->db->limit(1);\r\n\t\t}\r\n\r\n\t\t/* Total records count only if want to get multiple records */\r\n\t\tif($multiRecords){ \r\n\t\t\t$TempOBJ = clone $this->db;\r\n\t\t\t$TempQ = $TempOBJ->get();\r\n\t\t\t$Return['Data']['TotalRecords'] = $TempQ->num_rows();\r\n\t\t}else{\r\n\t\t\t$this->db->limit(1);\r\n\t\t}\r\n\r\n\t\t$Query = $this->db->get();\r\n\t\tif($Query->num_rows()>0){\r\n\t\t\tforeach($Query->result_array() as $Record){\r\n\t\t\t\t$ModuleData = $this->getModules(\"M.ModuleTitle, M.ModuleName, ModelType\", array(\"UserTypeID\" => $Record['UserTypeIDForUse'], \"Permitted\" => (@$Input['Permitted'] ? TRUE:'')), TRUE);\r\n\t\t\t\t$Record['PermittedModules'] = ($ModuleData ? $ModuleData['Data']['Records'] : new stdClass());\r\n\t\t\t\t$Record['UserTypeID'] \t\t= $Record['UserTypeIDForUse'];\t\t\r\n\t\t\t\tunset($Record['UserTypeIDForUse']);\t\t\r\n\t\t\t\tif(!$multiRecords){\r\n\t\t\t\t\treturn $Record;\r\n\t\t\t\t}\r\n\t\t\t\t$Records[] = $Record;\r\n\t\t\t}\r\n\t\t\t$Return['Data']['Records'] = $Records;\r\n\t\t\treturn $Return;\r\n\t\t}\r\n\t\treturn FALSE;\t\t\r\n\t}", "function modele_get_liste_user() {\n\n\t\t$req = 'SELECT * FROM p_user ';\n\n\t\t$reqPrep = self::$connexion->prepare($req);\n\n\t\t$reqPrep->execute();\n\n\t\t$enregistrement = $reqPrep->fetchall(PDO::FETCH_ASSOC);\n\n\t\treturn $enregistrement;\n\t}", "function get_user_type()\r\r\n {\r\r\n $CI =& get_instance();\r\r\n $CI->load->library(\"session\");\r\r\n\t\t$CI->load->model('user_model');\r\r\n $user_type_query = array(\r\r\n 'select' => array('user_type.*'),\r\r\n ); \r\r\n $user_type = $CI->user_model->get_rows($user_type_query,'user_type');\r\r\n return $user_type;\r\r\n }", "public function getFullUserDetailsTypeWise($type)\n{\n\tif(!empty($type)){\n\t$this->sql = \"SELECT * FROM \".USER.\" AS U INNER JOIN \".USER_DETAILS.\" AS D ON U.user_id = D.user_id WHERE U.user_type = '\".$type.\"'\";\n\t$this->exe = $this->db->query($this->sql);\n\treturn $this->exe->result_array();\n\t}\n}", "public function ddl_user()\r\n\t {\r\n\t $link = $this->connect();\r\n\t $search = \"SELECT user_id,user_name,user_type,password FROM user\";\r\n\t $resultq = mysqli_query($link, $search);\r\n\t $usr = array();\r\n\t $usrArr = array();\r\n\t while ($row = mysqli_fetch_row($resultq)) {\r\n\t $usr['user_id'] = $row[0];\r\n\t $usr['username'] = $row[1];\r\n\t $usr['user_type'] = $row[2];\r\n\t $usr['password'] = $row[3];\r\n\t $usrArr[] = $usr;\r\n\t }\r\n\t return $usrArr;\r\n\t }", "public function getdata(){\n\n $type = \\Request::query('only');\n\n $user = DB::table('users');\n $user->select('*');\n\n if($type=='admins'){\n $user->where('usertype', '=', 'Admin');\n }elseif($type=='staff'){\n $user->where('usertype', '=', 'Staff');\n }elseif($type=='banned'){\n $user->where('usertype','=', 'banned');\n }\n\n\n\n return Datatables::of($user)\n\n ->addColumn('icon', function ($user) {\n\n return view('._admin._particles.datatable.userlist.icon', compact('user'))->render();\n\n })->addColumn('username', function ($user) {\n\n return view('._admin._particles.datatable.userlist.username', compact('user'))->render();\n\n })->addColumn('email', function ($user) {\n\n return view('._admin._particles.datatable.userlist.email', compact('user'))->render();\n\n })->addColumn('status', function ($user) {\n\n return view('._admin._particles.datatable.userlist.status', compact('user'))->render();\n\n })->addColumn('created_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.created_at', compact('user'))->render();\n\n })->addColumn('updated_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.updated_at', compact('user'))->render();\n\n })->addColumn('action', function ($user) {\n\n return view('._admin._particles.datatable.userlist.action', compact('user'))->render();\n\n })->make(true);\n\n }", "public function users_telem($id,$tipo){\n $sql=\"SELECT * FROM users_phone_numbers WHERE type = $tipo AND user_id=$id\";\n //echo $sql.\"<br>\";\n $resultado=$this->consultar($sql);\n return $resultado;\n }", "public function getListUser()\n {\n $users = User::query()->orderBy('created_at', 'desc');\n\n return Datatables::of($users)\n ->editColumn('name', function($users){\n if (Entrust::can([\"users-detail\"])) {\n return '<a onclick=\"viewUser(' . $users->id . ')\" data-toggle=\"modal\" href=\"#viewUser\">'.$users->name.'\n </a> ';\n }else{\n return $users->name;\n }\n })\n \n ->addColumn('created_at', function($user){\n $time = $user->created_at;\n $time_numb = strtotime($time);\n\n return date(\"H:i | d-m-Y\", $time_numb);\n })\n \n ->addColumn('action', function ($user) {\n\n $string = '';\n if (Entrust::can([\"users-manager\"])) {\n $string = $string . ' <a href=\"users/'. $user->id . '/roles\" class=\"btn green btn-xs\" style=\"text-transform:none;\" data-tooltip=\"tooltip\" title=\"Vai trò\">\n <i class=\"icon-lock ion\" aria-hidden=\"true\"></i> \n </a> ';\n\n $string = $string . ' <a onclick=\"editUser(' . $user->id . ')\" class=\"btn yellow btn-xs btn-withdrawal\" style=\"text-transform:none;\" data-toggle=\"modal\" href=\"#editUser\" data-tooltip=\"tooltip\" title=\"Cập nhật\">\n <i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i> \n </a> ';\n\n $string = $string . ' <a href=\"javascript:;\" data-id=\"'. $user->id .'\" type=\"button\" class=\"btn btn-xs red btn-delete\" style=\"text-transform:none;\" data-tooltip=\"tooltip\" title=\"Xóa\">\n <i class=\"fa fa-trash-o\"></i> \n </a> ';\n }\n\n return $string;\n })\n ->addIndexColumn()\n ->rawColumns(['action', 'name'])\n ->make(true);\n }", "function obtenerNameUserType($identificador)\n{\n\tglobal $database_softPark, $softPark, $mysqli;\n\t#mysql_select_db($database_softPark, $softPark)\n\t$query_consultafuncion = sprintf(\"SELECT usertype.Name FROM usertype WHERE id= %s\",$identificador);\n\t$consultafuncion = $mysqli->query($query_consultafuncion) or die(mysqli_error());\n\t$row_consultafuncion = $consultafuncion->fetch_assoc();\n\t#$totalRows_consultafuncion = $row_consultafuncion->num_rows;\n\treturn $row_consultafuncion['Name']; \n\tmysqli_free_result($consultafuncion);\n}", "function login_user_type(){\n\t\t$fa=$this->session->userdata('flexi_auth');\n\t\t$email=$fa['user_identifier'];\n\t\t//$this->firephp->log(\"User type for:\".$email);\n\t\t$this->db->select($this->flexi_auth->db_column('user_acc', 'group_id'));\t\n\t\t$this->db->where($this->flexi_auth->db_column('user_acc', 'email'),$email);\t\n\t\t$qres=$this->db->get('user_accounts');\n\t\tif ($qres->num_rows() > 0) {\n\t\t\t$row=$qres->row_array();\n\t\t\t//$this->firephp->log($row['uacc_group_fk'].\"for email=\".$email);\n\t\t\tswitch ($row['uacc_group_fk']) {\n\t\t\t case 1:\n\t\t\t return \"Parent\";\n\t\t\t case 2:\n\t\t\t return \"Student\";\n\t\t\t case 3:\n\t\t\t return \"Admin\";\n\t\t\t\tdefault:\n\t\t\t\t\treturn NULL;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->firephp->log(\"Could not determine user group for user\");\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getUserDetails($user_id){\r\n\t\r\n\t\t$select = \"SELECT users.*, user_types.type as user_type from users \r\n\t\t\tLEFT JOIN user_types ON user_types.id = users.type\r\n\t\t\tWHERE users.id = ?\";\r\n\t\t\r\n global $pdo;\r\n\t\t$stmt = $pdo->prepare($select);\r\n\t\t$stmt->execute(array($user_id));\r\n\t\t$result_array = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\treturn $result_array;\r\n\t}", "public static function showUserTable() {\n echo \"<table id='users'>\n <tr>\n <th></th>\n <th>Utilisateur</th>\n <th>Mail</th>\n <th>Date de naissance</th>\n <th>Note</th>\n <th>Voitures</th>\n <th>Commentaires</th>\n </tr>\";\n for ($i = 0; $i < count(User::$listOfUsers); $i++ ) {\n echo \"<tr>\";\n echo \"<td>\";\n $iLink = $i + 1;\n echo \"<a href='users.php?user=$iLink'>Voir</a>\";\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getFirstName() . \" \" . User::$listOfUsers[$i]->getLastName();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getEmail();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getBirthDate();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getRate();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getListOfCars();\n echo \"</td>\";\n echo \"<td>\";\n echo User::$listOfUsers[$i]->getListOfComments();\n echo \"</td>\";\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "public function user_type($data = array())\n {\n $condition = \"username =\" . \"'\" . $data['username'] .\"'\";\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from($this->user);\n\t\t\t$this->db->where($condition);\n\t\t\t$this->db->limit(1);\n\t\t\t$query = $this->db->get();\n\t\t\tif ($query->num_rows() == 1)\n\t\t\t{\n\t\t\t\treturn $query->result();\n\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t}\n }", "public static function createUser($array){\n $db = new model();\n $db->prepare(\"SHOW COLUMNS FROM Users\");\n $usertable = $db->GetAll();\n $usertablenames = [];\n foreach($usertable as $table){\n array_push($usertablenames,$table['Field']);\n }\n $db->prepare(\"SHOW COLUMNS FROM Personal\");\n $personaltable = $db->GetAll();\n $personaltablenames = [];\n foreach($personaltable as $table){\n array_push($personaltablenames,$table['Field']);\n }\n $keynames = array_keys($array);\n $i = 0;\n $userkomma = false;\n $personalkomma = false;\n $userquery1 = \"\";\n $binduser = \"\";\n $personalquery1 = \"\";\n $bindpersonal = \"\";\n $personal = [];\n $uservalue = [];\n $array['username'] = strtolower( $array['username']);\n if($array['username'] == \"dashboard\"){\n echo \"username\";\n die();\n }\n $array['password'] = hash('sha512',$array['password'].$array['username']);\n foreach($array as $item){\n if(in_array($keynames[$i],$personaltablenames)){\n if($personalkomma){\n $personalquery1 = $personalquery1.\",\"; \n $bindpersonal = $bindpersonal.\",\";\n }\n $personalkomma = True;\n $personalquery1 = $personalquery1.$keynames[$i];\n $bindpersonal = $bindpersonal.\":\".$keynames[$i];\n $tempar = [\":\".$keynames[$i],$item];\n array_push($personal,$tempar);\n }else if(in_array($keynames[$i],$usertablenames)){\n if($userkomma){\n $userquery1 = $userquery1.\",\";\n $binduser = $binduser.\",\"; \n }\n $userkomma = True;\n $userquery1 = $userquery1.$keynames[$i];\n $binduser = $binduser.\":\".$keynames[$i];\n $tempar = [\":\".$keynames[$i],$item];\n array_push($uservalue,$tempar);\n }else{\n echo \"Not exist\";\n } \n $i++;\n }\n $db->prepare(\"SELECT * FROM Users WHERE username=:user\");\n $db->bind(\":user\",$array['username']);\n $result = $db->GetAll();\n if(count($result) >=1){\n echo \"username\";\n die();\n }\n $query1 = \"INSERT INTO Personal($personalquery1) VALUES($bindpersonal)\";\n $db->prepare($query1);\n foreach($personal as $bindvalue){\n $db->bind($bindvalue[0],$bindvalue[1]);\n }\n $db->execute();\n $id = $db->dbh->lastInsertId();\n $query1 = \"INSERT INTO Users($userquery1,Personal) VALUES($binduser,:id)\";\n $db->prepare($query1);\n foreach($uservalue as $bindvalue){\n $db->bind($bindvalue[0],$bindvalue[1]);\n }\n $db->bind(\":id\",$id);\n $db->execute();\n $id = $db->dbh->lastInsertId();\n $db->prepare(\"INSERT INTO userRole(user,role) VALUES(:user,2)\");\n $db->bind(\":user\",$id);\n $db->execute();\n echo \"Done\";\n }", "public function users();", "public function users();", "public function users();", "public function users();", "function eve_api_user_list_user_general_page($id, $type) {\n $header = array(\n 'characterName' => array(\n 'data' => t('Name'),\n 'field' => 'c.characterName',\n ),\n 'corporationName' => array(\n 'data' => t('Corporation'),\n 'field' => 'c.corporationName',\n ),\n 'allianceName' => array(\n 'data' => t('Alliance'),\n 'field' => 'c.allianceName',\n ),\n 'joined' => array(\n 'data' => t('Joined'),\n ),\n 'access' => array(\n 'data' => t('Last Login'),\n ),\n );\n\n $options = $output = array();\n\n $query = db_select('users', 'u')\n ->extend('PagerDefault')\n ->extend('TableSort');\n $query_join = $query->join('eve_api_characters', 'c', 'u.uid = c.uid');\n $query->addField($query_join, 'characterID', 'cID');\n $query->fields('u', array(\n 'created',\n 'access',\n 'uid',\n 'characterID',\n ))\n ->fields('c', array(\n 'characterName',\n 'corporationID',\n 'corporationName',\n 'corporationTicker',\n 'allianceID',\n 'allianceName',\n 'allianceTicker',\n ));\n\n if (isset($id)) {\n $or = db_or();\n $or->condition('c.allianceID', $id, '=');\n $or->condition('c.corporationID', $id, '=');\n $query->condition($or);\n }\n\n $query->condition('c.deleted', 0, '=')\n ->condition('u.status', 1, '=')\n ->condition('u.characterID', 0, '!=')\n ->limit(20)\n ->orderByHeader($header);\n $result = $query->execute();\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $options[] = array(\n 'characterName' => l($row->characterName, 'eve_api/user_list/' . $row->cID),\n 'corporationName' => l($row->corporationName, 'eve_api/user_list/' . $row->corporationID) . check_plain(' [' . $row->corporationTicker . ']'),\n 'allianceName' => ($row->allianceID == 0) ? l(t('None'), 'eve_api/user_list/0') : l($row->allianceName, 'eve_api/user_list/' . $row->allianceID) . check_plain(' [' . $row->allianceTicker . ']'),\n 'joined' => ($row->characterID == $row->cID) ? check_plain(date('Y-m-d H:i:s', $row->created)) : '',\n 'access' => ($row->characterID == $row->cID) ? ($row->access == 0) ? '' : check_plain(date('Y-m-d H:i:s', $row->access)) : '',\n );\n }\n }\n\n switch ($type) {\n default:\n case 0:\n $title = t('List of All Characters and some basic information.');\n break;\n\n case 1:\n $title = t('List of Corporation Characters and some basic information.');\n break;\n\n case 2:\n $title = t('List of Alliance Characters and some basic information.');\n break;\n }\n\n $output['user_list_description'] = array(\n '#type' => 'item',\n '#title' => $title,\n '#weight' => 0,\n );\n\n $output['user_list'] = array(\n '#type' => 'markup',\n '#markup' => theme('table', array(\n 'header' => $header,\n 'rows' => $options,\n )),\n '#weight' => 10,\n );\n\n $output['page'] = array(\n '#theme' => 'pager',\n '#weight' => 20,\n );\n\n return $output;\n}", "public function TipoUser($idmail){\n $tipo=0; //1= admon con mail \n $objA=new admonDAO(); //2=medico con mail 3=medico con id\n $objM=new medicoDAO(); //4=paciente con mail 5=paciente con id\n $objP=new pacienteDAO(); //0=no existe\n $resul1=$objA->readall();\n $resul2=$objM->readall();\n $resul3=$objP->readall();\n for($i=0;$i<count($resul1);$i++){\n if($resul1[$i]['correo'] == $idmail){\n $tipo=1;//es admin \n }\n }\n for($i=0;$i<count($resul2);$i++){\n if($resul2[$i]['correo'] == $idmail ){\n $tipo=2;//es medico con mail\n }\n if( $resul2[$i]['id_medico'] == $idmail){\n $tipo=3;//es medico con id\n }\n }\n for($i=0;$i<count($resul3);$i++){\n if($resul3[$i]['correo'] == $idmail){\n $tipo=4;//es paciente con correo\n }\n if($resul3[$i]['id_paciente'] == $idmail ){\n $tipo=5;//es paciente con id\n }\n }\n return $tipo;\n }", "function getUsers($Field = '', $Where = array(), $multiRecords = FALSE, $PageNo = 1, $PageSize = 15) {\n /* Additional fields to select */\n $Params = array();\n if (!empty($Field)) {\n $Params = array_map('trim', explode(',', $Field));\n $Field = '';\n $FieldArray = array(\n 'RegisteredOn' => 'DATE_FORMAT(E.EntryDate, \"' . DATE_FORMAT . ' %h:%i %p\") RegisteredOn',\n 'LastLoginDate' => 'DATE_FORMAT(UL.LastLoginDate, \"' . DATE_FORMAT . ' %h:%i %p\") LastLoginDate',\n 'Rating' => 'E.Rating',\n 'UserTypeName' => 'UT.UserTypeName',\n 'SocialSecurityNumber' => 'U.SocialSecurityNumber',\n 'IsAdmin' => 'UT.IsAdmin',\n 'UserID' => 'U.UserID',\n 'UserTypeID' => 'U.UserTypeID',\n 'FirstName' => 'U.FirstName',\n 'MiddleName' => 'U.MiddleName',\n 'LastName' => 'U.LastName',\n 'CitizenStatus' => 'U.CitizenStatus',\n 'AllowPrivateContestFree' => 'U.AllowPrivateContestFree',\n 'ProfilePic' => 'IF(U.ProfilePic IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/profile/picture/\",\"default.jpg\"),CONCAT(\"' . BASE_URL . '\",\"uploads/profile/picture/\",U.ProfilePic)) AS ProfilePic',\n 'ProfileCoverPic' => 'IF(U.ProfilePic IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/profile/cover/\",\"default.jpg\"),CONCAT(\"' . BASE_URL . '\",\"uploads/profile/picture/\",U.ProfileCoverPic)) AS ProfileCoverPic',\n 'About' => 'U.About',\n 'About1' => 'U.About1',\n 'About2' => 'U.About2',\n 'Email' => 'U.Email',\n 'EmailForChange' => 'U.EmailForChange',\n 'Username' => 'U.Username',\n 'UserTeamCode' => 'U.UserTeamCode',\n 'Gender' => 'U.Gender',\n 'BirthDate' => 'U.BirthDate',\n 'Address' => 'U.Address',\n 'Address1' => 'U.Address1',\n 'Postal' => 'U.Postal',\n 'CountryCode' => 'U.CountryCode',\n 'CountryName' => 'CO.CountryName',\n 'CityName' => 'U.CityName',\n 'StateName' => 'U.StateName',\n 'PhoneNumber' => 'U.PhoneNumber',\n 'Email' => 'U.Email',\n 'PhoneNumberForChange' => 'U.PhoneNumberForChange',\n 'Website' => 'U.Website',\n 'FacebookURL' => 'U.FacebookURL',\n 'TwitterURL' => 'U.TwitterURL',\n 'GoogleURL' => 'U.GoogleURL',\n 'InstagramURL' => 'U.InstagramURL',\n 'LinkedInURL' => 'U.LinkedInURL',\n 'WhatsApp' => 'U.WhatsApp',\n 'WalletAmount' => 'U.WalletAmount',\n 'WinningAmount' => 'U.WinningAmount',\n 'CashBonus' => 'U.CashBonus',\n 'TotalCash' => '(U.WalletAmount + U.WinningAmount + U.CashBonus) AS TotalCash',\n 'ReferralCode' => '(SELECT ReferralCode FROM tbl_referral_codes WHERE tbl_referral_codes.UserID=U.UserID LIMIT 1) AS ReferralCode',\n 'ReferredByUserID' => 'U.ReferredByUserID',\n 'Status' => 'CASE E.StatusID\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"1\" then \"Pending\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"2\" then \"Verified\"\n when \"5\" then \"Verified\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"3\" then \"Deleted\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"4\" then \"Blocked\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"8\" then \"Hidden\"\t\t\n\t\t\t\t\t\t\t\t\t\t\tEND as Status',\n 'PanStatus' => 'CASE U.PanStatus\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"1\" then \"Pending\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"2\" then \"Verified\"\n when \"3\" then \"Rejected\" \n\t\t\t\t\t\t\t\t\t\t\t\twhen \"9\" then \"Not Submitted\" \n\t\t\t\t\t\t\t\t\t\t\tEND as PanStatus',\n 'BankStatus' => 'CASE U.BankStatus\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"1\" then \"Pending\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"2\" then \"Verified\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"3\" then \"Rejected\"\t\n when \"9\" then \"Not Submitted\" \n\t\t\t\t\t\t\t\t\t\t\tEND as BankStatus',\n 'ReferredCount' => '(SELECT COUNT(*) FROM `tbl_users` WHERE `ReferredByUserID` = U.UserID) AS ReferredCount',\n 'TotalWithdrawals' => '(SELECT SUM(W.Amount) TotalWithdrawals FROM tbl_users_withdrawal W WHERE W.UserID = U.UserID AND W.StatusID=5) AS TotalWithdrawals',\n 'SourceID' => 'CASE UL.SourceID\n when \"1\" then \"Direct\"\n when \"2\" then \"Facebook\"\n when \"3\" then \"Twitter\"\n when \"4\" then \"Google\"\n when \"5\" then \"LinkedIn\" \n END as Source',\n 'StatusID' => 'E.StatusID',\n 'PanStatusID' => 'U.PanStatus',\n 'BankStatusID' => 'U.BankStatus',\n 'PushNotification' => 'US.PushNotification',\n 'PhoneStatus' => 'if(U.PhoneNumber is null, \"Pending\", \"Verified\") as PhoneStatus',\n 'EmailStatus' => 'if(U.Email is null, \"Pending\", \"Verified\") as EmailStatus'\n );\n foreach ($Params as $Param) {\n $Field .= (!empty($FieldArray[$Param]) ? ',' . $FieldArray[$Param] : '');\n }\n }\n $this->db->select('U.UserGUID, U.UserID, CONCAT_WS(\" \",U.FirstName,U.LastName) FullName');\n if (!empty($Field))\n $this->db->select($Field, FALSE);\n\n\n /* distance calculation - starts */\n /* this is called Haversine formula and the constant 6371 is used to get distance in KM, while 3959 is used to get distance in miles. */\n if (!empty($Where['Latitude']) && !empty($Where['Longitude'])) {\n $this->db->select(\"(3959*acos(cos(radians(\" . $Where['Latitude'] . \"))*cos(radians(E.Latitude))*cos(radians(E.Longitude)-radians(\" . $Where['Longitude'] . \"))+sin(radians(\" . $Where['Latitude'] . \"))*sin(radians(E.Latitude)))) AS Distance\", false);\n $this->db->order_by('Distance', 'ASC');\n\n if (!empty($Where['Radius'])) {\n $this->db->having(\"Distance <= \" . $Where['Radius'], null, false);\n }\n }\n /* distance calculation - ends */\n\n $this->db->from('tbl_entity E');\n $this->db->from('tbl_users U');\n $this->db->where(\"U.UserID\", \"E.EntityID\", FALSE);\n\n if (array_keys_exist($Params, array('UserTypeName', 'IsAdmin')) || !empty($Where['IsAdmin'])) {\n $this->db->from('tbl_users_type UT');\n $this->db->where(\"UT.UserTypeID\", \"U.UserTypeID\", FALSE);\n }\n $this->db->join('tbl_users_login UL', 'U.UserID = UL.UserID', 'left');\n $this->db->join('tbl_users_settings US', 'U.UserID = US.UserID', 'left');\n\n if (array_keys_exist($Params, array('CountryName'))) {\n $this->db->join('set_location_country CO', 'U.CountryCode = CO.CountryCode', 'left');\n }\n\n if (!empty($Where['Keyword'])) {\n $Where['Keyword'] = trim($Where['Keyword']);\n if (validateEmail($Where['Keyword'])) {\n $Where['Email'] = $Where['Keyword'];\n } elseif (is_numeric($Where['Keyword'])) {\n $Where['PhoneNumber'] = $Where['Keyword'];\n } else {\n $this->db->group_start();\n $this->db->like(\"U.FirstName\", $Where['Keyword']);\n $this->db->or_like(\"U.LastName\", $Where['Keyword']);\n $this->db->or_like(\"U.Email\", $Where['Keyword']);\n $this->db->or_like(\"U.PhoneNumber\", $Where['Keyword']);\n $this->db->or_like(\"U.SocialSecurityNumber\", $Where['Keyword']);\n $this->db->or_like(\"U.StateName\", $Where['Keyword']);\n $this->db->or_like(\"U.CitizenStatus\", $Where['Keyword']);\n $this->db->or_like(\"CONCAT_WS('',U.FirstName,U.Middlename,U.LastName)\", preg_replace('/\\s+/', '', $Where['Keyword']), FALSE);\n $this->db->group_end();\n }\n }\n\n if (!empty($Where['SourceID'])) {\n $this->db->where(\"UL.SourceID\", $Where['SourceID']);\n }\n\n if (!empty($Where['Withdrawal'])) {\n $this->db->having(\"TotalWithdrawals >= \" . $Where['Withdrawal'], null, false);\n }\n\n if (!empty($Where['UserTypeID'])) {\n $this->db->where_in(\"U.UserTypeID\", $Where['UserTypeID']);\n }\n\n if (!empty($Where['UserTypeIDNot']) && $Where['UserTypeIDNot'] == 'Yes') {\n $this->db->where(\"U.UserTypeID!=\", $Where['UserTypeIDNot']);\n }\n\n if (!empty($Where['ListType'])) {\n $this->db->where(\"DATE(E.EntryDate) =\", date(\"Y-m-d\"));\n }\n\n if (!empty($Where['UserID'])) {\n $this->db->where(\"U.UserID\", $Where['UserID']);\n }\n if (!empty($Where['UserIDNot'])) {\n $this->db->where(\"U.UserID!=\", $Where['UserIDNot']);\n }\n if (!empty($Where['UserArray'])) {\n $this->db->where_in(\"U.UserGUID\", $Where['UserArray']);\n }\n if (!empty($Where['UserGUID'])) {\n $this->db->where(\"U.UserGUID\", $Where['UserGUID']);\n }\n \n if (!empty($Where['ReferredByUserID'])) {\n $this->db->where(\"U.ReferredByUserID\", $Where['ReferredByUserID']);\n }\n\n if (!empty($Where['Username'])) {\n $this->db->where(\"U.Username\", $Where['Username']);\n }\n\n if (!empty($Where['UserTeamCode'])) {\n $this->db->where(\"U.UserTeamCode\", $Where['UserTeamCode']);\n }\n\n if (!empty($Where['Email'])) {\n $this->db->where(\"U.Email\", $Where['Email']);\n }\n if (!empty($Where['PhoneNumber'])) {\n $this->db->where(\"U.PhoneNumber\", $Where['PhoneNumber']);\n }\n\n if (!empty($Where['LoginKeyword'])) {\n $this->db->group_start();\n $this->db->where(\"U.Email\", $Where['LoginKeyword']);\n $this->db->or_where(\"U.Username\", $Where['LoginKeyword']);\n $this->db->or_where(\"U.PhoneNumber\", $Where['LoginKeyword']);\n $this->db->group_end();\n }\n if (!empty($Where['Password'])) {\n $this->db->where(\"UL.Password\", md5($Where['Password']));\n }\n\n if (!empty($Where['IsAdmin'])) {\n $this->db->where(\"UT.IsAdmin\", $Where['IsAdmin']);\n }\n if (!empty($Where['StatusID'])) {\n if ($Where['StatusID']==2 || $Where['StatusID']==5) {\n $this->db->where_in(\"E.StatusID\", array(2,5));\n }else{\n $this->db->where(\"E.StatusID\", $Where['StatusID']);\n }\n }\n if (!empty($Where['PanStatus'])) {\n $this->db->where(\"U.PanStatus\", $Where['PanStatus']);\n }\n if (!empty($Where['BankStatus'])) {\n $this->db->where(\"U.BankStatus\", $Where['BankStatus']);\n }\n\n if (!empty($Where['OrderBy']) && !empty($Where['Sequence']) && in_array($Where['Sequence'], array('ASC', 'DESC'))) {\n $this->db->order_by($Where['OrderBy'], $Where['Sequence']);\n } else {\n $this->db->order_by('U.UserID', 'DESC');\n }\n\n\n /* Total records count only if want to get multiple records */\n if ($multiRecords) {\n $TempOBJ = clone $this->db;\n $TempQ = $TempOBJ->get();\n $Return['Data']['TotalRecords'] = $TempQ->num_rows();\n $this->db->limit($PageSize, paginationOffset($PageNo, $PageSize)); /* for pagination */\n } else {\n $this->db->limit(1);\n }\n\n $Query = $this->db->get();\n // echo $this->db->last_query();\n if ($Query->num_rows() > 0) {\n foreach ($Query->result_array() as $Record) {\n\n /* get attached media */\n if (in_array('MediaPAN', $Params)) {\n $MediaData = $this->Media_model->getMedia('E.EntityGUID MediaGUID, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,\"110_\",M.MediaName) AS MediaThumbURL, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,M.MediaName) AS MediaURL,\tM.MediaCaption', array(\"SectionID\" => 'PAN', \"EntityID\" => $Record['UserID']), FALSE);\n $Record['MediaPAN'] = ($MediaData ? $MediaData : new stdClass());\n }\n\n if (in_array('MediaBANK', $Params)) {\n $MediaData = $this->Media_model->getMedia('E.EntityGUID MediaGUID, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,\"110_\",M.MediaName) AS MediaThumbURL, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,M.MediaName) AS MediaURL,\tM.MediaCaption', array(\"SectionID\" => 'BankDetail', \"EntityID\" => $Record['UserID']), FALSE);\n $Record['MediaBANK'] = ($MediaData ? $MediaData : new stdClass());\n }\n\n /* Get Wallet Data */\n if (in_array('Wallet', $Params)) {\n $WalletData = $this->getWallet('Amount,Currency,PaymentGateway,TransactionType,TransactionID,EntryDate,Narration,Status,OpeningBalance,ClosingBalance', array('UserID' => $Where['UserID'], 'TransactionMode' => 'WalletAmount'), TRUE);\n $Record['Wallet'] = ($WalletData) ? $WalletData['Data']['Records'] : array();\n }\n\n /* Get Wallet Data */\n if (in_array('PrivateContestFee', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"PrivateContestFee\" LIMIT 1');\n $Record['PrivateContestFee'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('LeaveContestCharge', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"LeaveContestCharge\" LIMIT 1');\n $Record['LeaveContestCharge'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('MinimumWithdrawalLimitBank', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"MinimumWithdrawalLimitBank\" LIMIT 1');\n $Record['MinimumWithdrawalLimitBank'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('MinimumDepositLimit', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"MinimumDepositLimit\" LIMIT 1');\n $Record['MinimumDepositLimit'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('MaximumDepositLimit', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"MaximumDepositLimit\" LIMIT 1');\n $Record['MaximumDepositLimit'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n\n /* Get Playing History Data */\n if (in_array('PlayingHistory', $Params)) {\n\n $PlayingHistory = $this->db->query(\"SELECT TotalJoinedContest,TotalJoinedContestWinning FROM \n (select COUNT(JC.ContestID) as TotalJoinedContest from sports_contest_join JC,sports_contest C where JC.UserID = '\".$Record['UserID'].\"' AND JC.ContestID=C.ContestID AND C.Privacy='No' ) TotalJoinedContest,\n (select COUNT(JC.ContestID) as TotalJoinedContestWinning from sports_contest_join JC,sports_contest C where JC.UserID = '\".$Record['UserID'].\"' AND JC.ContestID=C.ContestID AND JC.UserWinningAmount > 0 ) TotalJoinedContestWinning\")->row();\n $Record['PlayingHistory'] = ($PlayingHistory) ? $PlayingHistory : array();\n }\n\n if (!$multiRecords) {\n return $Record;\n }\n $Records[] = $Record;\n }\n\n $Return['Data']['Records'] = $Records;\n return $Return;\n }\n return FALSE;\n }", "function fetchTabelaUsersPorAprovar($conn) {\n $sql = \"SELECT U.*, T.descricao FROM utilizador U, tipoUtilizador T WHERE tipoUtilizador = '4' AND T.idTipoUtilizador = U.tipoUtilizador\";\n $retval = mysqli_query($conn, $sql);\n if(mysqli_num_rows($retval) != 0) {\n while($row = mysqli_fetch_array($retval, MYSQLI_ASSOC)) {\n mostrarDadosTabela($row);\n }\n } else {\n echo \"\n <tr>\n <td colspan='6' class='has-text-centered'>\n Não foram encontrados registos nesta tabela.\n </td>\n </tr>\n \";\n }\n mysqli_close($conn);\n}", "function getUserType(){\r\n\t\t$select = \"SELECT user_types.type FROM user_types \r\n\t\t\tLEFT JOIN users ON user_types.id = users.type\r\n\t\t\tWHERE users.id = $this->user_id\";\r\n\r\n global $pdo;\r\n $stmt = $pdo->query($select);\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\treturn $row['type'];\r\n\t}", "function GetAllUsersForUsersPage($strWhere,$fieldaArray = \"\"){\r\n\t\tglobal $link;\r\n\t\treset($fieldaArray);\r\n\t\tforeach ($fieldaArray as $field){\r\n\t\t\t$strFields .= \"\".$field . \" ,\";\r\n\t\t} \r\n\t\t$strFields = substr($strFields, 0, strlen($strFields) - 1);\t\r\n\t\tif(!in_array(2, (array)$_SESSION['user_in_groups'])){\r\n\t\t\t$sql = \"SELECT $strFields FROM \". USERS .\" join `Company` on \".USERS.\".CompanyID = `Company`.ID LEFT JOIN \".ZONES.\" ON \".ZONES.\".ID = \".USERS.\".ZoneID WHERE $strWhere \" or die(\"Error in the consult..\" . mysqli_error($link));\r\n\t\t\t\r\n\t\t}elseif(in_array(2, (array)$_SESSION['user_in_groups'])){\r\n\t\t\t$sql = \"SELECT $strFields FROM \". USERS .\" LEFT JOIN \".ZONES.\" ON \".ZONES.\".ID = \".USERS.\".ZoneID WHERE $strWhere \" or die(\"Error in the consult..\" . mysqli_error($link));\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$result = mysqli_query($link,$sql) ;\r\n\t\tif($result){\r\n\t\t\twhile($row = mysqli_fetch_array($result)){\r\n\t\t\t\t$arr[] = $row;\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn $arr; \r\n\t}", "public function getUserTable() {\n return $this->param['tblUser'];\n }", "public function getUserTable() {\n return $this->param['tblUser'];\n }", "function pnUserGetAll()\r\n{\r\n list($dbconn) = pnDBGetConn();\r\n $pntable = pnDBGetTables();\r\n\r\n $userstable = $pntable['users'];\r\n $userscolumn = &$pntable['users_column'];\r\n $sql = \"SELECT $userscolumn[uname],\r\n $userscolumn[uid],\r\n $userscolumn[name],\r\n $userscolumn[email],\r\n $userscolumn[url],\r\n $userscolumn[user_avatar]\r\n FROM $userstable\";\r\n $result = $dbconn->Execute($sql);\r\n\r\n if($dbconn->ErrorNo() != 0) {\r\n return;\r\n }\r\n\r\n if ($result->EOF) {\r\n return false;\r\n }\r\n\r\n $resarray = array();\r\n while(!$result->EOF) {\r\n list($uname, $uid, $name, $email, $url, $user_avatar) = $result->fields;\r\n $result->MoveNext();\r\n $resarray[$uid] = array('uname' => $uname,\r\n 'uid' => $uid,\r\n 'name' => $name,\r\n 'email' => $email,\r\n 'url' => $url,\r\n 'avatar' => $user_avatar);\r\n }\r\n $result->Close();\r\n\r\n return $resarray;\r\n}", "function GetUsers($strRole='A',$strValue='',$strOrder='name')\n{\n global $oDB;\n \n $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE role=\"A\" ORDER BY '.$strOrder;\n\n if ( $strRole=='M' ) $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE role=\"A\" OR role=\"M\" ORDER BY '.$strOrder;\n if ( $strRole=='M-' ) $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE role=\"M\" ORDER BY '.$strOrder;\n if ( $strRole=='name') $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE name=\"'.$strValue.'\" ORDER BY '.$strOrder;\n if ( substr($strRole,-1,1)=='*' )\n {\n $like = 'LIKE'; if ( $oDB->type=='pg' ) $like = 'ILIKE';\n $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE name '.$like.' \"'.substr($strRole,0,-1).'%\" ORDER BY '.$strOrder;\n }\n\n $oDB->Query($strQ);\n\n $arrUsers = array();\n $i=1;\n while ($row=$oDB->Getrow())\n {\n $arrUsers[$row['id']]=$row['name'];\n $i++;\n if ( $i>200 ) break;\n }\n return $arrUsers;\n}", "public function tampilUser()\n {\n return $this->db->get('tb_user');\n }", "public static function get_public_users()\n {\n $connection = Yii::$app->getDb();\n /*$users = Yii::$app->db->createCommand(\"SELECT core_users.*,(SELECT core_sessions.date_created FROM core_sessions WHERE core_sessions.user_id = core_users.user_id ORDER BY core_sessions.date_created DESC LIMIT 1) last_login FROM core_users where core_users.user_type =:user_type\")\n ->bindValue(':user_type', 1)\n ->queryAll();*/\n $users = Yii::$app->db->createCommand(\"SELECT core_users.*,\"\n . \"(SELECT core_sessions.date_created FROM core_sessions WHERE core_sessions.user_id = core_users.user_id ORDER BY core_sessions.date_created DESC LIMIT 1) last_login,\"\n . \"(SELECT core_user_roles.role_name FROM core_user_roles WHERE core_user_roles.role_id = core_users.user_type) role_name FROM core_users \"\n . \"where core_users.user_type = 1\")->queryAll();\n /*$users = $connection->createCommand(\"SELECT core_users.*,(SELECT core_sessions.date_created FROM core_sessions WHERE core_sessions.user_id = core_users.user_id ORDER BY core_sessions.date_created DESC LIMIT 1) last_login FROM core_users where core_users.user_type = 1\")->queryAll();*/\n /*$users = $query->select(['core_users.*','core_sessions.date_created'])->from('core_users')\n ->innerJoin('core_sessions','core_users.user_id = core_sessions.user_id')\n ->where(\"core_users.user_type = '1'\")\n ->orderBy(['core_sessions.date_created' => SORT_DESC])\n ->groupBy('core_sessions.user_id')\n ->All();*/\n return $users;\n }", "public function findUsers();", "public function findUsers();", "public function userlist($type = 'user')\n {\n\n if ($type == 'user') {\n $data['users'] = $this->UserModel->showusers();\n $this->load->view('template/inc/header.php');\n $this->load->view('template/user/viewuser.php', $data);\n $this->load->view('template/inc/footer.php');\n }\n if ($type == 'admin') {\n echo \"I am admin\";\n }\n\n }", "public function utilisateurListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"Utilisateur\");//type array\n\t}", "public function get_users($organization_id, $user_type);", "function listUser()\n {\n $conn = new mysqli(SERVER, USER, PASSWORD, DB);\n $sql = \"SELECT id_user, tb_user.nombre, apellidos, tb_tip_doc.tip_doc AS tip_doc,num_doc, correo,\n celular, password, tb_tip_user.nombre AS tip_user, tb_business.nombre AS nombreempresa, date_create\n FROM tb_user\n INNER JOIN tb_tip_doc ON tb_user.id_tip_doc=tb_tip_doc.id_tip_doc\n INNER JOIN tb_tip_user ON tb_user.id_tip_user=tb_tip_user.id_tip_user\n INNER JOIN tb_business ON tb_user.id_business=tb_business.id_business \";\n $result = $conn->query($sql);\n if ($result->num_rows > 0)\n {\n $table = \"\";\n $table .=\"<table id='example2' class='table table-bordered table-hover'>\";\n $table .=\"<thead>\";\n $table .=\"<tr>\";\n $table .=\"<th>ID</th>\";\n $table .=\"<th>NOMBRE</th>\";\n $table .=\"<th>APELLIDOS</th>\";\n $table .=\"<th>TIP DOC</th>\";\n $table .=\"<th>DOCUMENTO</th>\";\n $table .=\"<th>CORREO</th>\";\n $table .=\"<th>CELULAR</th>\";\n $table .=\"<th>TIP USUARIO</th>\";\n $table .=\"<th>EMPRESA</th>\";\n $table .=\"<th>CREACION</th>\";\n $table .=\"<th>OPCIONES</th>\";\n $table .=\"</tr>\";\n $table .=\"</thead>\";\n // output data of each row\n while($row = $result->fetch_assoc())\n {\n $table .=\"<thead>\";\n $table .= \"<tr>\";\n $table .= \"<td>\".$row['id_user'].\"</td>\";\n $table .= \"<td>\".$row['nombre'].\"</td>\";\n $table .= \"<td>\".$row['apellidos'].\"</td>\";\n $table .= \"<td>\".$row['tip_doc'].\"</td>\";\n $table .= \"<td>\".$row['num_doc'].\"</td>\";\n $table .= \"<td>\".$row['correo'].\"</td>\";\n $table .= \"<td>\".$row['celular'].\"</td>\";\n $table .= \"<td>\".$row['tip_user'].\"</td>\";\n $table .= \"<td>\".$row['nombreempresa'].\"</td>\";\n $table .= \"<td>\".$row['date_create'].\"</td>\";\n $table .= \"<td><a href=''><i class='nav-icon fas fa-edit' style='color:#239200;'></i></a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\";\n $table .= \"<a href=''><i class='nav-icon fas fa-trash-alt' style='color:red;'></i></a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\";\n $table .= \"<a href=''><i class='nav-icon fas fa-info-circle' style='color:blue;'></i></td>\";\n $table .= \"</tr>\";\n $table .=\"</thead>\";\n }\n $table .=\"</table>\";\n return $table;\n\n }\n\n }", "function get_user_type($username){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'SELECT type '.\r\n\t\t\t 'FROM user '.\r\n\t\t\t 'WHERE username = \\''. $username .'\\'';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\treturn 0;\r\n\t}\r\n\telse {\r\n\t\t$row = mysqli_fetch_object($result);\r\n\t\treturn $row->type;\r\n\t}\r\n}", "function fetchTabelaUsersAtivos($conn) {\n $sql = \"SELECT U.*, T.descricao FROM utilizador U, tipoUtilizador T WHERE tipoUtilizador <> '4' AND tipoUtilizador <> '6' AND T.idTipoUtilizador = U.tipoUtilizador ORDER BY U.data\";\n $retval = mysqli_query($conn, $sql);\n if(mysqli_num_rows($retval) != 0) {\n while($row = mysqli_fetch_array($retval, MYSQLI_ASSOC)) {\n mostrarDadosTabela($row); \n }\n } else {\n return false;\n }\n mysqli_close($conn);\n}", "public function createUnifiedUserTable () {\n\n\t\t$this->output( \"\\n# Creating unified user table. \\n\" );\n\n\t\t$this->userArrayForInsert = array();\n\t\twhile( $row = array_pop( $this->userArray ) ) {\n\n\t\t\t$i = count( $this->userArrayForInsert );\n\t\t\tforeach( $this->userTableRows as $key ) {\n\n\t\t\t\t// if $key doesn't start with \"user_\" then skip it (it's not a valid field name)\n\t\t\t\tif ( strpos( $key, \"user_\" ) !== 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this->userArrayForInsert[$i][$key] = $row[$key];\n\t\t\t}\n\n\t\t}\n\n\t\t$db = $this->wikiDBs[$this->primeWiki];\n\t\t$db->query( 'DELETE FROM user' );\n\t\t$db->insert(\n\t\t\t'user',\n\t\t\t$this->userArrayForInsert,\n\t\t\t__METHOD__\n\t\t);\n\t\t$autoInc = count( $this->userArrayForInsert ) + 1;\n\t\t$db->query( \"ALTER TABLE user AUTO_INCREMENT = $autoInc;\" );\n\n\t}", "function findUsers($key){\r\n // echo \"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\";\r\n $result = $this->connector->query(\"SELECT * FROM `users` WHERE full_name LIKE '%$key%'\");\r\n $x = 0;\r\n while ($row = $this->connector->fetchArray($result)) {\r\n $x++;\r\n $user[$x] = new User();\r\n $user[$x]->setId($row['id']);\r\n $user[$x]->setFull_name($row['full_name']);\r\n $user[$x]->setUsername($row['username']);\r\n $user[$x]->setPassword($row['password']);\r\n $user[$x]->setEmail($row['email']);\r\n $user[$x]->setDate($row['date']);\r\n $user[$x]->setRandom($row['random']);\r\n $user[$x]->setActivated($row['activated']);\r\n $user[$x]->setUserlevel($row['userlevel']);\r\n \r\n \t}\r\n return $user;\r\n }", "public function get_users_data($userid = \"\")\n\t{\n\t\t$result = $this->db->from(\"users\")->where(array(\"user_type\" => $userid))->where('user_status',1)->orderby(\"firstname\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "function d4os_io_db_070_os_user_load($data = array()) {\n\n if (is_numeric($data)) {\n\n // get the user by uid\n $UUID = db_result(db_query(\"SELECT UUID FROM {d4os_ui_users} WHERE uid = %d\", array($data)));\n\n if (!$UUID) {\n return FALSE;\n }\n\n $query = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE ua.PrincipalID='%s'\";\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($query, $UUID));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n }\n\n // get only inworld fields\n $user_fields = d4os_ui_users_get_grid_fields();\n\n // Dynamically compose a SQL query:\n $query = array();\n $values = array();\n\n // get the user by keys\n foreach ($data as $key => $value) {\n if (in_array($key, $user_fields)) {\n switch ($key) {\n case 'UUID':\n $query[]= \"ua.PrincipalID = '%s'\";\n $values[] = $value;\n break;\n case 'username':\n $query[]= \"ua.FirstName = '%s'\";\n $values[] = $value;\n break;\n case 'lastname':\n $query[]= \"ua.LastName = '%s'\";\n $values[] = $value;\n break;\n case 'email':\n $query[]= \"ua.Email = '%s'\";\n $values[] = $value;\n break;\n case 'created':\n $query[]= \"ua.Created = %d\";\n $values[] = $value;\n break;\n case 'godLevel':\n $query[]= \"ua.UserLevel = %d\";\n $values[] = $value;\n break;\n }\n }\n }\n $sql = \"SELECT * FROM {UserAccounts} AS ua\"\n . \" LEFT JOIN {auth} AS a ON a.UUID=ua.PrincipalID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=ua.PrincipalID\"\n . \" WHERE \". implode(' AND ', $query);\n\n d4os_io_db_070_set_active('os_robust');\n $user = db_fetch_object(db_query($sql, $values));\n d4os_io_db_070_set_active('default');\n \n if ($user) {\n $uid = db_result(db_query(\"SELECT uid FROM {d4os_ui_users} WHERE UUID = '%s'\", array($user->PrincipalID)));\n $user->uid = $uid;\n $user = _d4os_io_db_070_os_070_to_grid($user);\n d4os_io_db_070_users_add_extra_fields($user);\n return $user;\n }\n else {\n return FALSE;\n }\n}", "public static function modeloUserGetAll ():array {\n // Genero lo datos para la vista que no muestra la contraseña ni los códigos de estado o plan\n // sino su traducción a texto\n $stmt=self::$db->query(\"select * from Usuarios\");\n $usuarios=[];\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n while ($cod=$stmt->fetch()) {\n $datosuser= [\n $cod[\"nombre\"],\n $cod[\"email\"],\n PLANES[$cod[\"plan\"]],\n ESTADOS[$cod[\"estados\"]]\n ];\n $usuarios[$cod[\"user\"]]=$datosuser;\n }\n return $usuarios;\n}", "function dataGetDataByUsername($p_username)\n {\n $p_username = parent::escape($p_username);\n \n $sql = 'SELECT id, ';\n $sql .= 'fkusertypeid,';\n $sql .= 'userpwd, ';\n $sql .= 'saltpwd, ';\n $sql .= 'firstname, ';\n $sql .= 'lastname, ';\n $sql .= 'email, ';\n $sql .= 'DATE_FORMAT(datelastlogin, \\'%d %b %Y %H:%i\\'), ';\n $sql .= 'isactive ';\n $sql .= 'FROM user ';\n $sql .= 'WHERE username = \\'' . $p_username . '\\' ';\n $sql .= 'AND isdeleted = 0 '; \n \n $result_mysqli = parent::query($sql);\n $result = parent::fetchAllRows($result_mysqli);\n parent::clear($result_mysqli); \n\n return $result; \n }", "public function getUserTable(){\n\t \t if(!$this->usersTAble){\n\t \t \t$sm=$this->getServiceLocator();\n\t\t\t$this->usersTAble=$sm->get('User\\Model\\UserTable'); \n\t \t \t//$this->usersTAble=new TableGateway('users',$this->getServiceLocator()->get('Zend\\Db\\Adapter\\Adapter'));\n\t \t }\n\t \t return $this->usersTAble;\n\t }", "public function user_type($id){\n\t\tglobal $con;\n\t\t$query=\"SELECT * FROM user_admin WHERE id='$id' LIMIT 1\";\n\t\t$result=array();\n\t\t$user_type='';\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$user_type=$value['type'];\n\t\t}\n\t\treturn $user_type;\n\t}", "function getUsers(){\n }", "function getUsers(){\n }", "function tampil_data_user()\n\t{\n\t\t$data = mysqli_query($this->connect, \"select * from user\");\n\t\twhile ($d = mysqli_fetch_array($data)) {\n\t\t\t$hasil[] = $d;\n\t\t}\n\t\treturn $hasil;\n\t}", "function getUserData($idUser,$idData){\n\n $usr_q = listAll(\"user_det\", \"WHERE id_user = '$idUser' AND id_data = '$idData'\");\n\n $usr_data = mysql_fetch_object($usr_q);\n return $usr_data;\n\t\n}", "function getUserInfo($id){\n\t\n\t$usr_info = mysql_fetch_object(listAll(\"user\", \"WHERE id = '$id'\"));\n\t$descripcion = getUserData($id, \"2\");\n\t$user_img = getUserData($id, \"1\");\n\t$direccion = getUserData($id, \"3\");\n\t$ciudad = getUserData($id, \"10\");\n\t$cp = getUserData($id, \"4\");\n\t$pais = getUserData($id, \"5\");\n\t$telefono = getUserData($id, \"6\");\n\t$movil =getUserData($id, \"7\");\n\t$exp = getUserData($id, \"14\");\n\t$cam = getUserData($id, \"11\");\n\t$lentes = getUserData($id, \"12\");\n\t$equip = getUserData($id, \"13\");\n\t$cover = getUserData($id, \"16\");\n\t$user_pago = getUserData($id, \"17\");\n $escuelaFotografia = getUserData($id, \"18\");\n $masEducacion = getUserData($id, \"19\");\n $experienciaLaboral = getRecentUserData($id, \"20\");\n $idiomas = getUserData($id, \"22\");\n $habilidades = getUserData($id, \"21\");\n $rut = getUserData($id, \"23\");\n\t\n\tif($usr_info->gender == \"H\"){\n\t\t$gender = \"Hombre\";\n\t}else{\n\t\t$gender = \"Mujer\";\n\t}\n\n\t$paisf = listAll(\"paises\",\"WHERE iso = '$pais->description'\");\n\t$rs_paisf = mysql_fetch_object($paisf);\n\t\n\t$user['id'] = $usr_info->id;\n\t$user['user_type'] = $usr_info->user_type;\n\t$user['email'] = $usr_info->user;\n $user['new_email'] = $usr_info->new_email;\n $user['new_email_code'] = $usr_info->new_email_code;\n\t$user['descripcion'] = $descripcion->description;\n\t$user['user_img']= $user_img->description;\n\t$user[\"name\"] = $usr_info->name;\n\t$user['lastname'] = $usr_info->lastname;\n\t$user['dob']= DateHelper::getLongDate($usr_info->dob);\n $user['user_dob'] = DateHelper::getShortDate($usr_info->dob, 'd/m/Y');\n\t$user['sex']= $gender;\n\t$user['act']= $usr_info->act;\n\t$dob = explode(\"-\",$usr_info->dob);\n\t$user['ano'] = $dob[0];\n\t$user['mes'] = $dob[1];\n\t$user['dia'] = $dob[2];\n\t$user['direccion'] = $direccion->description;\n\t$user['ciudad'] = $ciudad->description;\n\t$user['cp'] = $cp->description;\n\t$user['pais'] = utf8_encode($rs_paisf->nombre);\n\t$user['pais_ab'] = utf8_encode($rs_paisf->iso);\n\t$user['telefono'] = $telefono->description;\n\t$user['movil'] = $movil->description;\n\t$user['exp'] = $exp->description;\n $user['escuela-fotografia'] = $escuelaFotografia->description;\n $user['mas-educacion'] = $masEducacion->description;\n $user['experiencia-laboral'] = json_decode($experienciaLaboral->description);\n $user['idiomas'] = json_decode($idiomas->description);\n $user['habilidades'] = json_decode($habilidades->description);\n $user['rut'] = $rut->description;\n\t$user['cam'] = json_decode($cam->description);\n\t$user['lentes'] = json_decode($lentes->description);\n\t$user['equip'] = json_decode($equip->description);\n\t$user[\"act_code\"] = $usr_info->act_code;\n $user[\"profile_completed\"] = $usr_info->profile_completed;\n $user[\"wizard_completed\"] = $usr_info->wizard_completed;\n $user[\"wizard_contact_creative_completed\"] = $usr_info->wizard_contact_creative_completed;\n\t$user['user_cover'] = $cover->description;\n\t$user['user_pago'] = $user_pago->description;\n\t$user['full_name'] = ucwords($user[\"name\"] . \" \" . $user['lastname']);\n //TODO make it an external function\n //TODO set a default image if file does not exists\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/profile.jpg\")){\n $user['profile_image_url'] = \"profiles/\".sha1($usr_info->id).\"/profile.jpg\";\n } else {\n if ($user['user_type'] == User::USER_TYPE_PHOTOGRAPHER) {\n $user['profile_image_url'] = \"images/profile_default_photographer.jpg\";\n } else {\n $user['profile_image_url'] = \"images/profile_default_client.jpg\";\n }\n }\n\n if (file_exists(FConfig::getBasePath().\"/profiles/\".sha1($usr_info->id).\"/cover.jpg\")){\n $user['cover_image_url'] = \"profiles/\".sha1($usr_info->id).\"/cover.jpg\";\n } else {\n $user['cover_image_url'] = \"images/cover_default.jpg\";\n }\n\n return $user;\n}", "public function DataUser()\n\t{\n\t\t$data['username'] = $this->session->userdata('username');\n\t\n\t\tif ($this->uri->segment(4) == 'view') {\n\t\t\t$id = $this->uri->segment(3);\n\t\t\t$tampil = $this->MSudi->GetDataWhere('tbl_user', 'id', $id)->row();\n\t\t\t$data['detail']['id'] = $tampil->id;\n\t\t\t$data['detail']['username'] = $tampil->username;\n\t\t\t$data['detail']['password'] = $tampil->password;\n\t\t\t$data['detail']['fullname'] = $tampil->fullname;\n\t\t\t// $data['detail']['hak_akses'] = $tampil->hak_akses;\n\t\t\t$data['content'] = 'VFormUpdateUser';\n\t\t} else {\n\t\t\t// $join=\"tbl_staff.kd_staff = tbl_users.kd_staff AND tbl_pegawai.kd_pegawai = tbl_staff.kd_pegawai\";\n\t\t\t// $data['DataUser']=$this->MSudi->GetData2Join('tbl_users','tbl_staff','tbl_pegawai', $join)->result();\n\t\t\t$data['DataUser'] = $this->MSudi->GetData('tbl_user');\n\t\t\t$data['content'] = 'VUser';\n\t\t}\n\t\t$this->load->view('welcome_message', $data);\n\t}", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "public function getUsersList()\n {\n }", "public function fieldsSchema($rows,$userid,$type)\n\t{\n\t\tif(empty($rows))\n\t\t{\n\t\t return array();\t\n\t\t}\n\t\t\n\t\t$lang = JFactory::getLanguage();\n\t\t$lang->load('com_easysocial', JPATH_ADMINISTRATOR, '', true);\n\t\t\n\t\t$user = FD::user($userid);\n\t\t\n\t\tif(count($rows)>0)\n\t\t{\n\t\t\t$data = array();\n\t\t\t$fmod_obj = new EasySocialModelFields();\n\t\t\tforeach($rows as $row)\n\t\t\t{\n\t\t\t\t$fobj = new fildsSimpleSchema();\n\t\t\t\t\n\t\t\t\t$fobj->field_id = $row->id;\n\t\t\t\t$fobj->unique_key = $row->unique_key;\n\t\t\t\t$fobj->title = JText::_($row->title);\n\t\t\t\t$fobj->field_name = JText::_($row->title);\n\t\t\t\t$fobj->step = $row->step_id;\n\t\t\t\t$fobj->field_value = $fmod_obj->getCustomFieldsValue($row->id,$userid, $type);\n\n\t\t\t\tif($fobj->field_name == 'Name')\n\t\t\t\t{\n\t\t\t\t\t$fobj->field_value = $user->name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($fobj->field_name == 'Gender' && $fobj->field_value != null )\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$gender = $user->getFieldValue('GENDER');\n \t\t\t\t\t//$fobj->field_value = $gender->data;\n\t\t\t\t\t$fobj->field_value = ( $gender->data == 1 )?'male':'female';\n\t\t\t\t}\n\n\t\t\t\t// Rework on this work\n\t\t\t\tif($fobj->field_name == 'Birthday' && $fobj->field_value != null )\n\t\t\t\t{\n\t\t\t\t\t$birthday = $user->getFieldValue('BIRTHDAY');\n\t\t\t\t\tif(date('Y') == $birthday->value->year){\n\t\t\t\t\t\t$fobj->field_value = null;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$date = new DateTime($birthday->data);\t\n\t\t\t\t\t\t$fobj->field_value = $date->format('d-m-Y');\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\tif(substr( $fobj->unique_key, 0, 3 ) == \"URL\" && $fobj->field_value != null)\n\t\t\t\t{\n\t\t\t\t\tif(substr( $fobj->field_value, 0, 4 ) != \"http\")\n\t\t\t\t\t\t$fobj->field_value = 'http://'.$fobj->field_value;\n\n\t\t\t\t\t$fobj->field_value = '<a href=\"'.$fobj->field_value.'\">'.$fobj->field_value.'</a>';\n\t\t\t\t}\n\n\t\t\t\t//to manage relationship\n\t\t\t\tif($fobj->unique_key == 'RELATIONSHIP' )\n\t\t\t\t{\n\t\t\t\t\t$rs_vl = json_decode($fobj->field_value);\n\t\t\t\t\t$fobj->field_value = $rs_vl->type;\n\t\t\t\t}\n\t\t\t\t//vishal - runtime solution for issue, need rework\n\t\t\t\tif (preg_match('/[\\'^[]/', $fobj->field_value))\n\t\t\t\t{\n\t\t\t\t\t$fobj->field_value = implode(\" \",json_decode($fobj->field_value));\n\t\t\t\t}\n\n\t\t\t\t//Vishal - code for retrive checkbox value - need ES code \n\t\t\t\tif( $row->element == 'checkbox')\n\t\t\t\t{\n\t\t\t\t\t$uval = explode(' ',$fobj->field_value);\n\n\t\t\t\t\t$oarr = array();\n\t\t\t\t\t$ftbl = FD::table('field');\n\t\t\t\t\t$ftbl->load($fobj->field_id);\n\t\t\t\t\t$options = $ftbl->getOptions();\n\n\t\t\t\t\t//retrive selected option title\n\t\t\t\t\tforeach($options['items'] as $item)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(in_array(ucfirst($item->value),$uval))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$oarr[] = $item->title;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$fobj->field_value = implode(',',$oarr);\n\t\t\t\t}\n\t\t\t\t//end\t\t\t\t\t\t\n\t\t\t\t$fobj->params = json_decode($row->params);\n\t\t\t\t$data[] = $fobj; \n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t}", "function GetUserId($UserTypeId=false,$languageID=false)\n\t{\n\t\t$this->db->query(\"select rp_user_to_type.userID,rp_user_type_details.userTypeName from rp_user_to_type,rp_user_type_details where rp_user_to_type.UserTypeId='$UserTypeId' and rp_user_to_type.userTypeID=rp_user_type_details.userTypeID and rp_user_type_details.languageID='$languageID'\");\n\t}", "public function change()\n {\n $tableAdmin=$this-> table('wtv_user',['id' => false, 'primary_key' => ['user_id']]);\n $tableAdmin\n ->addColumn('user_id','integer')\n ->addColumn('user_code','string',['limit'=>100,'null' => false])\n ->addColumn('user_first_name','string',['limit'=>100,'null' => false])\n ->addColumn('user_last_name','string',['limit'=>300,'null' => false])\n ->addColumn('user_full_name','string',['limit'=>300,'null' => false])\n ->addColumn('user_login_name','string',['limit'=>300,'null' => false])\n ->addColumn('user_login_pass','string',['limit'=>300,'null' => false])\n ->addColumn('user_email','string',['limit'=>300,'null' => false])\n ->addColumn('user_phone','string',['limit'=>300,'null' => false])\n ->addColumn('user_city','string',['limit'=>300,'null' => false])\n ->addColumn('user_district','string',['limit'=>300,'null' => false])\n ->addColumn('user_address','string',['limit'=>300,'null' => false])\n ->addColumn('user_birthday','date',['null' => false])\n ->addColumn('user_url_image_alias','string',['limit'=>300,'null' => false])\n ->addColumn('user_url_background','string',['limit'=>300,'null' => false])\n ->addColumn('user_jog_present','string',['limit'=>300,'null' => false])\n ->addColumn('user_type_account','integer',['default'=>0,'null' => false])\n ->addColumn('created','date')\n ->save();\n }", "function insertUser($F_Name,$L_Name,$Alias,$Email,$UserLogin,$UserPassword,$Type, $Address,$Address2,$City,$StateId,$Zip) {\n $iUserId = $this->getUserIdByLogin($UserLogin);\n\tif($UserPassword) {\n\t\t$EncryptedPW = $this->dbencrypt($UserPassword);\n\t}\n\tif (!$Alias){$Name = $FName .\" \" .$LName;}else{\t$Name = $Alias;}\n\n\tif($iUserId == 0)\n\t{\t\t\n\t\tif($Type == \"MEMBER\"){$TypeId = 1; } \n\t\telseif($Type == \"HOST\"){$TypeId = 2; }\n\t\telseif($Type == \"ADMIN\"){$TypeId = 3; }\n\t\telse {$TypeId = 0;}\n\n \t$dbQuery = \"INSERT INTO djdb_tblUser (fldFName,fldLName, fldEmail,fldLogin, fldPassword, fldTypeId, fldCreateDTS,fldAddress,fldAddress2,fldCity,fkState,fldZip, fldEncryptedPW) \n\t\t\tVALUES('$F_Name','$L_Name','$Email','$UserLogin','$UserPassword',$TypeId, NOW(), '$Address','$Address2','$City','$StateId','$Zip', '$EncryptedPW')\";\n \t$dbResultSet = mysql_query($dbQuery) or die(\"Insert execute error: \" .mysql_error() .\" for: \".$dbQuery);\n\t\t$iUserId = $this->getUserIdByLogin($UserLogin);\n\t\t// If User Type is Player create Player profile.\n\t\tif($Type == \"MEMBER\")\n\t\t{\n\t\t\t$MemberId\t= $this->insertMember($Name,$iUserId);\n\t\t\t$msgstring = \"Completed Successfully\";\n\t\t\t\n\t\t}\n\t\telseif($Type == \"Host\")\n\t\t{\n\t\t\t$HostId\t= $this->insertDj($Name,$iUserId);\n\t\t\t$msgstring = \"Completed Successfully\";\n\t\t\t\n\t\t}\n\t\telse{$msgstring = \"Completed Successfully\";}\n\n\t\t\n\t}\n\telse\n\t{\t\n\t\t$msgstring = \"<br>Username already exist. userid:\" .$iUserId;\n\t}\n\t\n return $msgstring;\n }", "function workbench_post_get_role_user_types() {\n $roles = user_roles(TRUE);\n $users = array();\n foreach ($roles as $rid => $label) {\n $role_user = new RoleUserType($rid);\n $users[$role_user->user_string] = $role_user;\n }\n return $users;\n}", "function user($id){\n \n \n$db = new Database();\n$db->connect();\n\n$db->select(\"user\",'*',null,'id_user ='.$id); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$res = $db->getResult();\n\nforeach($res as $x => $x_value){\n /****************************/\n$id_nationality=$x_value[\"id_nationality\"];\n$db->select(\"nationalities\",'*',null,'id_nationalities='.$id_nationality); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$nationalities = $db->getResult();\n $res[0][\"id_nationality\"]=$nationalities[0];\n\n /*************************/\n $id_rules=$x_value[\"id_rules\"];\n$db->select(\"rules\",'*',null,'id_rules='.$id_rules); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$rules = $db->getResult();\n $res[0][\"id_rules\"]=$rules[0];\n\n\n\n /********************************/\n $id_direct_manger=$x_value[\"id_direct_manger\"];\n$db->select(\"user\",'*',null,'id_user='.$id_direct_manger); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$direct = $db->getResult();\n $name_user=$direct[0][\"f_name_user\"].\" \".$direct[0][\"m_name_user\"].\" \".$direct[0][\"l_name_user\"];\n $res[0][\"id_direct_manger\"]=$name_user;\n\n\n /***************************************/\n $id_payroll_groups=$x_value[\"id_payroll_groups\"];\n$db->select(\"payroll_groups\",'*',null,'id_payroll_groups='.$id_payroll_groups); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$payroll_groups = $db->getResult();\n$res[0][\"payroll_groups\"]=$payroll_groups[0];\n\n$db->select(\"pay_grou_valu\",'*',null,'id_payroll_groups='.$id_payroll_groups); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pay_grou_valu = $db->getResult();\n$res[0][\"payroll_groups\"]=$pay_grou_valu;\n\n\nforeach($pay_grou_valu as $xx => $x_valuee)\n {\n $db->select(\"payroll_value\",'*',null,'id_payroll_value='.$res[0][\"payroll_groups\"][$xx][\"id_payroll_value\"]); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$payroll_value = $db->getResult();\n//echo $xx;\n $res[0][\"payroll_groups\"][$xx][\"id_payroll_value\"]=$payroll_value[0];\n\n }\n\n\n\n\n\n\n\n\n /***************************************/\n\n $id_categories=$x_value[\"id_categories\"];\n$db->select(\"categories\",'*',null,'id_categories='.$id_categories); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$categories = $db->getResult();\n $res[0][\"id_categories\"]=$categories[0];\n\n /***************************************/\n\n $id_departments=$x_value[\"id_departments\"];\n$db->select(\"departments\",'*',null,'id_departments='.$id_departments); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$departments = $db->getResult();\n $res[0][\"id_departments\"]=$departments[0];\n\n /***************************************/\n\n $id_positions=$x_value[\"id_positions\"];\n$db->select(\"positions\",'*',null,'id_positions='.$id_positions); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$positions = $db->getResult();\n$res[0][\"id_positions\"]=$positions[0];\n//echo '<pre>';\n//print_r($res[0]);\n//echo '<pre>';\n /***************************************/\n\n $id_user=$x_value[\"id_user\"];\n\n$db->select(\"attendance\",'*',null,'user_id='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$attendance = $db->getResult();\n$res[0][\"attendance\"]=$attendance;\n\n\n/***************************************/\n\n$db->select(\"pr_user_insurance\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_insurance = $db->getResult();\n\nforeach ($pr_user_insurance as $key => $valu){\n $valu[\"id_insurance\"];\n\n $db->select(\"insurance_setup\",'*',null,\"`name_insurance`='\".$valu[\"id_insurance\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$insurance_setup = $db->getResult();\n//echo $xx;\n $res[0][\"insurance\"][$key]=$insurance_setup[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_languages\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_languages = $db->getResult();\n$i=0;\nforeach ($pr_user_languages as $key => $valu){\n $valu[\"id_languages\"];\n\n $db->select(\"languages\",'*',null,\"`name_languages`='\".$valu[\"id_languages\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$languages = $db->getResult();\n//echo $xx;\n $res[0][\"languages\"][$key]=$languages[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_licenes\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_licenes = $db->getResult();\n$i=0;\nforeach ($pr_user_licenes as $key => $valu){\n $valu[\"id_licenes\"];\n $db->select(\"licenses\",'*',null,\"`name_licenses`='\".$valu[\"id_licenes\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$licenes = $db->getResult();\n//echo $xx;\n $res[0][\"licenses\"][$key]=$licenes[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_skills\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_skills = $db->getResult();\n$i=0;\nforeach ($pr_user_skills as $key => $valu){\n $valu[\"id_skills\"];\n $db->select(\"skills\",'*',null,\"`name_skills`='\".$valu[\"id_skills\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$skills = $db->getResult();\n//echo $xx;\n $res[0][\"skills\"][$key]=$skills[0];\n\n};\n\n/*************************/\n$db->select(\"pr_user_tax\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_tax = $db->getResult();\n$i=0;\nforeach ($pr_user_tax as $key => $valu){\n $valu[\"id_tax\"];\n\n\n $db->select(\"tax\",'*',null,\"`name_tax`='\".$valu[\"id_tax\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$tax = $db->getResult();\n//echo $xx;\n $res[0][\"tax\"][$key]=$tax[0];\n\n};\n/*************************/\n$db->select(\"pr_user_leaves\",'*',null,'id_user='.$id_user); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$pr_user_leaves = $db->getResult();\n$i=0;\nforeach ($pr_user_leaves as $key => $valu){\n $valu[\"id_leaves\"];\n\n $db->select(\"leaves_rules\",'*',null,\"`name`='\".$valu[\"id_leaves\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$leaves = $db->getResult();\n//echo $xx;\n $res[0][\"leaves\"][$key]=$leaves[0];\n $leaves[0][\"name\"];\n\n $db->select(\"my_leaves\",'*',null,\"`id_leaves`='\".$leaves[0][\"name\"].\"' AND `id_user`='\".$res[0][\"id_user\"].\"'\"); // Table name, Column Names, JOIN, WHERE conditions, ORDER BY conditions\n$my_leaves = $db->getResult();\nforeach ($my_leaves as $keys => $valus){\n\n $res[0][\"leaves\"][$key][\"my_leaves\"][$keys]=$valus;\n\n}\n};\n\n\n\n\n\n\n}\n\n\n\n $return=$res[0];\nreturn $return;\n\n \n \n\n \n}", "public function listForTable (){\r\n //generamo la query final que precisamos\r\n $queryResult= \"SELECT id,dni,nombre,apellido,mail FROM usuario.usuario ORDER BY id;\";\r\n\r\n //Ejecutamos la query\r\n $this->stmt=pg_query($this->link,$queryResult) or die(\"Error en la consulta,function listForTable :\".preg_last_error());\r\n\r\n return $this->stmt;\r\n }", "public static function getAllByType(Mysql $mysql, $type){\n $q=\"SELECT tc.*, tr.dsname AS 'role' FROM tcuser tc, tcrole tr \" .\n\t\t\t\" WHERE tr.idtcrole = tc.fnidrole AND tc.fnidrole = $type \".\n \t\t\" ORDER BY idtcuser ASC \".Mysql::getQueryLimit($page);\n \t\t//echo \"<br />\".$q;\n \treturn $mysql->execute($q);\n\t}", "static function getUsersList($arr)\r\n\t{\r\n\t\t$country = isset($arr['co'])?funcs::check_input($arr['co']):\"\";\r\n\t\t$city = isset($arr['ci'])?funcs::check_input($arr['ci']):\"\";\r\n\t\t$state = isset($arr['s'])?funcs::check_input($arr['s']):\"\";\r\n\t\t$gender = isset($arr['g'])?funcs::check_input($arr['g']):\"\";\r\n\t\t$look_for_gender = isset($arr['lg'])?funcs::check_input($arr['lg']):\"\";\r\n\t\t$search_username = isset($arr['u'])?funcs::check_input($arr['u']):\"\";\r\n\t\t$surname = isset($arr['l'])?funcs::check_input($arr['l']):\"\";\r\n\t\t$email = isset($arr['e'])?funcs::check_input($arr['e']):\"\";\r\n\t\t$mt = isset($arr['mt'])?funcs::check_input($arr['mt']):\"\";\r\n\t\t$order = isset($arr['order'])?funcs::check_input($arr['order']):\"\";\r\n\t\t$type = isset($arr['type'])?funcs::check_input($arr['type']):\"\";\r\n\t\t$date_range = isset($arr['r'])?funcs::check_input($_GET['r']):\"\";\r\n\t\t$fake = isset($arr['f'])? funcs::check_input($arr['f']) : null;\r\n\t\t$from = isset($arr['from'])?funcs::check_input($arr['from']):\"\";\r\n\t\t$to = isset($arr['to'])?funcs::check_input($arr['to']):\"\";\r\n\t\t$min_age = isset($arr['min_age'])?funcs::check_input($arr['min_age']):0;\r\n\t\t$max_age = isset($arr['max_age'])?funcs::check_input($arr['max_age']):999;\r\n\t\t$isactive = isset($arr['showNotActivated'])?\"1\":\"t1.isactive=1\";\r\n\t\t#Pakin Change this static function\r\n\t\t$username = $_SESSION['sess_username'];\r\n\t\t$CONDITION =\"\";\r\n\t\t/*$SuperUser = array('superadmin','bigbrother','heiko','cyric');\r\n\t\tif(!in_array($username,$SuperUser)){\r\n\t\t\t$condman = \" (\".TABLE_MEMBER_COUNT.\" <=\".MALE_MEMBERS_FLAG_PER_CITY.\") AND (\".TABLE_MEMBER_GENDER.\"= 1)\";\r\n\t\t\t$condwoman = \" (\".TABLE_MEMBER_COUNT.\" <=\".FEMALE_MEMBERS_FLAG_PER_CITY.\") AND (\".TABLE_MEMBER_GENDER.\"= 2)\";\r\n\t\t\t$CONDITION = \" AND ( $condman OR $condwoman ) AND \".TABLE_MEMBER_FLAG.\" != 1\" ;\r\n\t\t}*/\r\n\r\n\t\t$sqlGetMember = \"SELECT t1.username AS username, t1.password as password, t1.flag as flag, t1.signup_datetime as registred, t1.id as user_id, t1.mobileno as mobileno, t1.vcode_mobile_insert_time,\r\n\t\t\t\t\t\t\t\t\t\tt1.picturepath as picturepath, t4.name as \".TABLE_MEMBER_CITY.\",\r\n\t\t\t\t\t\t\t\t\t\tt3.name as \".TABLE_MEMBER_STATE.\", t2.name as \".TABLE_MEMBER_COUNTRY.\",\r\n\t\t\t\t\t\t\t\t\t\tt1.type as type, t1.agent, t1.fake, t1.email, t1.isactive, t1.isactive_datetime\r\n\t\t\t\t\t\t\t\t\tFROM \".TABLE_MEMBER.\" t1\r\n\t\t\t\t\t\t\t\t\t\tLEFT OUTER JOIN xml_countries t2\r\n\t\t\t\t\t\t\t\t\t\t\tON t1.country = t2.id\r\n\t\t\t\t\t\t\t\t\t\tLEFT OUTER JOIN xml_states t3\r\n\t\t\t\t\t\t\t\t\t\t\tON t1.state=t3.id\r\n\t\t\t\t\t\t\t\t\t\tLEFT OUTER JOIN xml_cities t4\r\n\t\t\t\t\t\t\t\t\t\t\tON t1.city=t4.id\r\n\t\t\t\t\t\t\t\t\tWHERE $isactive $CONDITION \"; // AND (t1.\".TABLE_MEMBER_PICTURE.\" !='')\";\r\n\r\n\t\tif($country!=0 && $country!=''){\r\n\t\t\t $sqlGetMember .= \" AND (t1.country='$country')\";\r\n\t\t}\r\n\r\n\t\tif($city!=0 && $city!=''){\r\n\t\t\t$sqlGetMember .= \" AND (t1.city='$city')\";\r\n\t\t}\r\n\r\n\t\tif($state!=0 && $state!=''){\r\n\t\t\t$sqlGetMember .= \" AND (t1.state='$state')\";\r\n\t\t}\r\n\r\n\t\tif($gender!=0 && $gender!=''){\r\n\t\t\t$sqlGetMember .= \" AND (t1.gender='$gender')\";\r\n\t\t}\r\n\r\n\t\tif($look_for_gender=='1'){\r\n\t\t\t$sqlGetMember .= \" AND (t1.lookmen=1)\";\r\n\t\t}\r\n\t\telseif($look_for_gender=='2'){\r\n\t\t\t$sqlGetMember .= \" AND (t1.lookwomen=1)\";\r\n\t\t}\r\n\r\n\t\tif($search_username!=\"\"){\r\n\t\t\t$sqlGetMember .= \" AND (t1.username like '$search_username%')\";\r\n\t\t}\r\n\r\n\t\tif($surname!=\"\"){\r\n\t\t\t$sqlGetMember .= \" AND (t1.surname like '$surname%')\";\r\n\t\t}\r\n\r\n\t\tif($email!=\"\"){\r\n\t\t\t$sqlGetMember .= \" AND (t1.email like '$email%')\";\r\n\t\t}\r\n\r\n\t\tif(($fake === '0') || ($fake === '1'))\r\n\t\t{\r\n\t\t\t$sqlGetMember .= \" AND (t1.fake = '$fake')\";\r\n\t\t}\r\n\r\n\t\tif($mt != '')\r\n\t\t{\r\n\t\t\t$sqlGetMember .= \" AND (t1.type = '$mt')\";\r\n\t\t}\r\n\r\n\t\tif($date_range == 'today')\r\n\t\t\t$sqlGetMember .= \" AND (DATE(t1.signup_datetime) = CURDATE())\";\r\n\t\telseif($date_range == 'yesterday')\r\n\t\t\t$sqlGetMember .= \" AND (DATE(t1.signup_datetime) = CURDATE() - INTERVAL 1 DAY)\";\r\n\t\telseif($date_range == 'week')\r\n\t\t\t$sqlGetMember .= \" AND (DATE(t1.signup_datetime) >= CURDATE() - INTERVAL 7 DAY)\";\r\n\t\telseif($date_range == 'month')\r\n\t\t\t$sqlGetMember .= \" AND (DATE(t1.signup_datetime) >= CURDATE() - INTERVAL 30 DAY)\";\r\n\t\telseif($date_range == 'search')\r\n\t\t\t$sqlGetMember .= \" AND ((DATE(t1.signup_datetime) >= '\".$from.\"') AND (DATE(t1.signup_datetime) <= '\".$to.\"'))\";\r\n\r\n\t\tif(($min_age!=\"\") && ($max_age))\r\n\t\t{\r\n\t\t\t/*$mny = date('Y')-$min_age;\r\n\t\t\t$mxy = date('Y')-$max_age;\r\n\t\t\t$mindate = $mny.\"-01-01\";\r\n\t\t\t$maxdate = $mxy.\"-01-01\";\r\n\r\n\t\t\t$sqlGetMember .= \" and (DATEDIFF(NOW(), t1.birthday ) >= DATEDIFF(NOW(), '$mindate' )\";\r\n\t\t\t$sqlGetMember .= \" and DATEDIFF(NOW(), t1.birthday ) <= DATEDIFF(NOW(), '$maxdate' ))\";*/\r\n\t\t\t$sqlGetMember .= \" AND (YEAR(NOW()) - YEAR(t1.birthday)) >= \".$min_age;\r\n\t\t\t$sqlGetMember .= \" AND (YEAR(NOW()) - YEAR(t1.birthday)) <= \".$max_age;\r\n\t\t}\r\n\r\n\t\tswitch($order)\r\n\t\t{\r\n\t\t\tcase 'city':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY t4.name\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'state':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY t3.name\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'country':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY t2.name\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'flag':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY t1.flag\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'name':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY username\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'type':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY type\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'signup':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY signup_datetime\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'activated':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY isactive\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'email':\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY email\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"desc\")?\" DESC\":\" ASC\";\r\n\t\t\t\t$sqlGetMember .= \", picturepath DESC, username ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\t$sqlGetMember .= \" ORDER BY user_id\";\r\n\t\t\t\t$sqlGetMember .= (strtolower($type)==\"asc\")?\" ASC\":\" DESC\";\r\n\t\t\t\t$sqlGetMember .= \", \".TABLE_MEMBER_USERNAME.\" ASC\";\r\n\t\t\t\t$sqlCountMember = $sqlGetMember;\r\n\t\t\t\t$sqlGetMember .= \" LIMIT \".SmartyPaginate::getCurrentIndex().\", \".SmartyPaginate::getLimit();\r\n\t\t\t\t//$rec = MESSAGE_RECORD_LIMIT-count($data);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tif(isset($arr['getAll']) && ($arr['getAll'] == true))\r\n\t\t\t$data = DBconnect::assoc_query_2D($sqlCountMember);\r\n\t\telse\r\n\t\t\t$data = DBconnect::assoc_query_2D($sqlGetMember);\r\n\r\n\t\t$sqlCountMember = \"select count(*) \" . substr($sqlCountMember, strpos($sqlCountMember, \"F\"));\r\n\t\t$sqlCountMember = substr($sqlCountMember,0, strpos($sqlCountMember, \"ORDER BY\"));\r\n\t\t$countMember = DBconnect::retrieve_value($sqlCountMember);\r\n\t\t//print_r($data);\r\n\r\n\t\treturn array(\"data\" => $data, \"count\" => $countMember);\r\n\t}", "function add_user ($User_name, $User_password, $User_email, $user_type)\n\t{\n\t\tglobal $conn;\n\n $sql_i = \"INSERT INTO login_db(user_name, user_password, user_email, user_type) VALUES \" .\n \"('$User_name', '$User_password', '$User_email', '$user_type')\";\n\n run_update($sql_i);\n\t}", "function fetch_user_type() //get all records from database \n\t{\n\t $result;\n\t $csrf_token=$this->security->get_csrf_hash();\n\t $this->load->model('Sup_admin');\n\t $query=$this->Sup_admin->fetch_user_type();\n\t\t $res=$query->result();\n\t if($res){\n\t\t $data;\n\t\t $i = 0;\n\t \t foreach($res as $r){\n\t\t\t $code = $r->user_type_id_pk;\n\t\t\t $type = $r->desig;\n\t\t\t $level= $r->user_level;\n\t\t\t $data[$i] = array('code'=>$code,'type'=>$type,'level'=>$level);\n\t\t\t $i = $i+1;\n\t\t }\n\t\t $result = array('status'=>1,'message'=>'data found','data'=>$data,'csrf_token'=>$csrf_token);\n\t }else{\n\t\t $result = array('status'=>0,'message'=>'no data found','csrf_token'=>$csrf_token);\n\n\t }\n\t echo json_encode($result);\n\t }", "private function tbl_usuarios() {\r\n\t\t\t$this->usuarios = $this->esquema->createTable('USUARIOS');\r\n\t\t\t$this->usuarios->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('USUARIO', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Usuario de Ingreso'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('PASSWORD', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Contraseña de Ingreso'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombres del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('APELLIDO', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Apellidos del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('CEDULA', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Cedula del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('USUARIO_RR', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Usuario de RR'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('CORREO', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Correo electronico del Usuario'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del Usuario [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('EMPRESA', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la Empresa del Usuario [ID de la tabla USUARIOS_EMPRESA]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('CARGO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Cargo del Usuario [ID de la tabla USUARIOS_CARGO]'\r\n\t\t\t));\r\n\t\t\t$this->usuarios->addColumn('PERMISO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Permiso del Usuario [ID de la tabla PERMISOS]'\r\n\t\t\t));\r\n\t\t\t\r\n\t\t\t$this->usuarios->setPrimaryKey(array('ID'));\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->usuarios_empresa, array('EMPRESA'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->usuarios_cargo, array('CARGO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->usuarios->addForeignKeyConstraint($this->permisos, array('PERMISO'), array('ID'), $this->opcForeign);\r\n\t\t}", "public function creer(){ /*** Cree un utilisateur par insertion d'un tuple dans la table UserTab ***/\r\n \r\n \r\n // $this -> setInscrit(1);\r\n $this -> insertDb();//Insertion en Bd d'un tuple user\r\n\t\t\t\r\n }", "function get_user() {\n $query = $this->db->where('user_type', 'user')->get('user');\n return $query->result_array();\n }", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "function cadena_sql($tipo,$variable=\"\") {\n\n\t\t$prefijo=$this->miConfigurador->getVariableConfiguracion(\"prefijo\");\n\t\t$idSesion=$this->miConfigurador->getVariableConfiguracion(\"id_sesion\");\n\n\t\tswitch($tipo) {\n\n\t\t\t/**\n\t\t\t * Clausulas específicas\n\t\t\t */\n\n\t\t\tcase \"dataUserByID\":\n\t\t\t\t$cadena_sql=\"SELECT \";\n\t\t\t\t$cadena_sql.=\"id_usuario USUARIOID, \";\n\t\t\t\t$cadena_sql.=\"nombre NOMBRE \";\n\t\t\t\t$cadena_sql.=\"FROM \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user \";\n\t\t\t\t$cadena_sql.=\"WHERE \";\n\t\t\t\t$cadena_sql.=\"id_usuario ='\".$variable.\"'\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"buscarUsuarioAplicativo\":\n\t\t\t\t$cadena_sql=\"SELECT \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.id_usuario USUARIOID, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.clave CLAVE, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.usuario, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.id_subsistema ROL, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.estado, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.estilo TEMA, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.idioma IDIOMA, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"page.nombre PAGINA, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"page.modulo MODULE, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.tipo \";\n\t\t\t\t$cadena_sql.=\"FROM \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user, \";\n $cadena_sql.=$prefijo.\"page, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"role, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role \";\n\t\t\t\t$cadena_sql.=\"WHERE \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.usuario='\".$variable[\"usuario\"].\"' \";\n\t\t\t\t$cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.clave='\".$variable['clave'].\"' \";\n\t\t\t\t$cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.id_subsistema=\".$prefijo.\"role.id_subsistema \";\n $cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"page.id_pagina=\".$prefijo.\"role.id_pagina \";\n\t\t\t\t$cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.estado=1 \";\n\t\t\t\t$cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.id_usuario=\".$prefijo.\"user_role.id_usuario \";\n\t\t\t\tbreak;\n\n\t\t\tcase \"buscarIndexUsuario\":\n\t\t\t\t$cadena_sql=\"SELECT \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.id_usuario USUARIOID, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.usuario, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.id_subsistema ROL, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.estado, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.estilo TEMA, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.idioma IDIOMA, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"role.pagina PAGINA, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.tipo \";\n\t\t\t\t$cadena_sql.=\"FROM \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"role, \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role \";\n\t\t\t\t$cadena_sql.=\"WHERE \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.id_usuario='\".$variable[\"usuario\"].\"' \";\n\t\t\t\t$cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.id_subsistema=\".$prefijo.\"role.id_subsistema \";\n\t\t\t\t$cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user_role.estado=1 \";\n\t\t\t\t$cadena_sql.=\"AND \";\n\t\t\t\t$cadena_sql.=$prefijo.\"user.id_usuario=\".$prefijo.\"user_role.id_usuario \";\n\t\t\t\tbreak;\n\n\n\t\t\tcase \"iniciarTransaccion\":\n\t\t\t\t$cadena_sql=\"START TRANSACTION\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"finalizarTransaccion\":\n\t\t\t\t$cadena_sql=\"COMMIT\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"cancelarTransaccion\":\n\t\t\t\t$cadena_sql=\"ROLLBACK\";\n\t\t\t\tbreak;\n\n\t\t}\n\t\t//echo \"<br/>\".$tipo.\"=\".$cadena_sql;\n\t\treturn $cadena_sql;\n\n\t}", "public function usuarios()\n {\n \treturn $this->hasMany(reciclausers::class, 'perfilId', 'id');\n \t// nombre del modelo con el que se relaciona, llave foranea, llave de la tabla.\n }", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "private function getUserTypeAccess(UserType $userType){\n\t\t\t$stmt =$this->db->executeQuery(\"SELECT id_type_access, id_section from access where id_type_user=?\", array($userType->id));\n\t\t\tif (!$accessType = $stmt->fetchall()) return array();\n\t\t return $accessType;\t\n\t\t}", "public function getUsers(){\n $query = \"SELECT * FROM usuario \";\n return self::getInstance()->consulta($query);\n }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function tampilUserTerakhir()\n {\n $this->db->order_by('id_user','DESC');\n return $this->db->get('tb_user',1);\n }" ]
[ "0.7246618", "0.69559604", "0.65022975", "0.6410035", "0.63891953", "0.6331422", "0.6225756", "0.6192659", "0.6192659", "0.61711675", "0.6150333", "0.6141662", "0.6138367", "0.61130226", "0.60958815", "0.60869753", "0.6085064", "0.6082112", "0.60760975", "0.607591", "0.60545486", "0.6053273", "0.60414076", "0.6036691", "0.60352635", "0.6032656", "0.6029446", "0.60248464", "0.60159224", "0.60098207", "0.5998344", "0.5995686", "0.598121", "0.5979469", "0.5949774", "0.59469193", "0.59435433", "0.5938813", "0.59235835", "0.59131503", "0.59131503", "0.59131503", "0.59131503", "0.5906689", "0.59053487", "0.58930784", "0.5891034", "0.58904266", "0.5881905", "0.5880088", "0.5880088", "0.5862903", "0.5854654", "0.5847804", "0.58377", "0.58359647", "0.58359647", "0.58328134", "0.5821472", "0.58156556", "0.58153164", "0.58100945", "0.58018863", "0.57948226", "0.5792226", "0.5773786", "0.5771688", "0.5771212", "0.57669574", "0.576477", "0.5760231", "0.57566476", "0.57566476", "0.57546693", "0.5751791", "0.5728351", "0.5724732", "0.5724324", "0.57193035", "0.57141614", "0.5714153", "0.57060415", "0.569755", "0.5687011", "0.56824344", "0.5678883", "0.5678881", "0.56758225", "0.5671276", "0.56712383", "0.566944", "0.56663024", "0.566534", "0.5660707", "0.5657653", "0.56528795", "0.56502223", "0.5649308", "0.5645268", "0.56345046", "0.5633482" ]
0.0
-1
Display a listing of the resource.
public function index() { $Product = Product::with('category','brand')->latest()->get(); return view('backend.admin.product.index', compact('Product')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $Category = Category::where('status',1)->latest()->get(); $Brand = Brand::where('status',1)->latest()->get(); return view('backend.admin.product.create', compact('Category','Brand')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // Product input validation $request->validate([ 'product_name' => 'required|unique:products,product_name', 'product_code' => 'required', 'product_price' => 'required', 'product_quantity' => 'required', 'category' => 'required', 'brand' => 'required', 'short_description' => 'required', 'long_description' => 'required', 'image_thumbnail' => 'required|mimes:jpg,png,jpeg', 'image_gallery_one' => 'required|mimes:jpg,png,jpeg', 'image_gallery_two' => 'required|mimes:jpg,png,jpeg' ]); // Product image upload file $thumbnail = $request->file('image_thumbnail'); $img = md5(time().uniqid()).'.'.$thumbnail->getClientOriginalExtension(); Image::make($thumbnail)->resize(270,270)->save(public_path('backend/img/product/').$img); $img_gallery = $request->file('image_gallery_one'); $image = md5(time().uniqid()).'.'.$img_gallery->getClientOriginalExtension(); Image::make($img_gallery)->resize(270,270)->save(public_path('backend/img/product/').$image); $image_gallerys = $request->file('image_gallery_two'); $images = md5(time().uniqid()).'.'.$image_gallerys->getClientOriginalExtension(); Image::make($image_gallerys)->resize(270,270)->save(public_path('backend/img/product/').$images); // Product Create in database if(isset($request->publish)){ $status = 1; } else{ $status = 0; } $Product = Product::create([ 'user_id' => Auth::user()->id, 'category_id' => $request->category, 'brand_id' => $request->brand, 'product_name' => $request->product_name, 'product_slug' => Str::of($request->product_name)->slug('-'), 'product_code' => $request->product_code, 'product_qty' => $request->product_quantity, 'product_price' => $request->product_price, 'short_description' => $request->short_description, 'long_description' => $request->long_description, 'thumbnail_image' => $img, 'image_one' => $image, 'image_two' => $images, 'status' => $status ]); // Confirm Message if ($Product) { $notification = array( 'message' => 'Product created successfull !', 'alert-type' => 'success' ); return redirect()->route('admin.product.index')->with($notification); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $Edit = Product::findOrFail($id); $Category = Category::latest()->get(); $Brand = Brand::latest()->get(); return view('backend.admin.product.edit', compact('Edit','Category','Brand')); }
{ "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) { // Validation $request->validate([ 'product_name' => 'required', 'product_code' => 'required', 'product_price' => 'required', 'product_quantity' => 'required', 'category' => 'required', 'brand' => 'required', 'short_description' => 'required', 'long_description' => 'required' ]); // Old Image $thumbnail_one = $request->one_thum_old; $thumbnail_two = $request->two_thum_old; $thumbnail_three = $request->three_thum_old; if(isset($request->image_thumbnail) && isset($request->image_gallery_one) && isset($request->image_gallery_two)){ // Old Image delete unlink(public_path('backend/img/product/').$thumbnail_one); unlink(public_path('backend/img/product/').$thumbnail_two); unlink(public_path('backend/img/product/').$thumbnail_three); // Product image upload file $thumbnail = $request->file('image_thumbnail'); $img = md5(time().uniqid()).'.'.$thumbnail->getClientOriginalExtension(); Image::make($thumbnail)->resize(270,270)->save(public_path('backend/img/product/').$img); $img_gallery = $request->file('image_gallery_one'); $image = md5(time().uniqid()).'.'.$img_gallery->getClientOriginalExtension(); Image::make($img_gallery)->resize(270,270)->save(public_path('backend/img/product/').$image); $image_gallerys = $request->file('image_gallery_two'); $images = md5(time().uniqid()).'.'.$image_gallerys->getClientOriginalExtension(); Image::make($image_gallerys)->resize(270,270)->save(public_path('backend/img/product/').$images); Product::find($id)->update([ 'thumbnail_image' => $img, 'image_one' => $image, 'image_two' => $images, ]); } else{ Product::find($id)->update([ 'thumbnail_image' => $thumbnail_one, 'image_one' => $thumbnail_two, 'image_two' => $thumbnail_three ]); } // Product Create in database if(isset($request->publish)){ $status = 1; } else{ $status = 0; } // Product Update $ProductUpdate = Product::find($id)->update([ 'user_id' => Auth::user()->id, 'category_id' => $request->category, 'brand_id' => $request->brand, 'product_name' => $request->product_name, 'product_slug' => Str::of($request->product_name)->slug('-'), 'product_code' => $request->product_code, 'product_qty' => $request->product_quantity, 'product_price' => $request->product_price, 'short_description' => $request->short_description, 'long_description' => $request->long_description, 'status' => $status ]); // Confirm Message if ($ProductUpdate) { $notification = array( 'message' => 'Product updated successfull !', 'alert-type' => 'success' ); return redirect()->route('admin.product.index')->with($notification); } }
{ "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) { // Find image name $image = Product::find($id); $one = $image->thumbnail_image; $two = $image->image_one; $three = $image->image_two; $del = unlink(public_path('backend/img/product/').$one); $del = unlink(public_path('backend/img/product/').$two); $del = unlink(public_path('backend/img/product/').$three); $Delete = Product::find($id)->delete(); // Confirm Message if ($del && $Delete) { $notification = array( 'message' => 'Product deleted successfull !', 'alert-type' => 'success' ); return redirect()->route('admin.product.index')->with($notification); } }
{ "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
$columns is an array of strings, representing the names of the columns
public function mysql_insert(database $db,array $columns,array $values,$flags=0) { // $values is an array of associative arrays $cl = []; $cls = []; foreach($columns as $col) if(isset($this->columns[$col])) { $cls[] = $col; $cl[] = $db->field($col); } if(empty($cl)) return false; $column_list = ' ('.implode(', ',$cl).')'; $value_list = []; foreach($values as $touple) { $tl = []; foreach($cls as $c) $tl[] = isset($touple[$c]) && !is_null($touple[$c])? $this->columns[$c]->clean($touple[$c]): 'NULL'; $value_list[] = '('.implode(', ',$tl).')'; } return "INSERT INTO ".$this->mysql_ref($db). $column_list."\nVALUES\n\t". implode(",\n\t",$value_list).";\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function columns(): array;", "abstract protected function columns();", "public function admin_table_columns($_columns)\n {\n }", "public function setColumns(array $columns);", "function ColumnNames($columnNames = null);", "abstract public function tableColumns();", "public function getColumnNames();", "public function setColumns(array $columns);", "abstract public function listColumns();", "public function getValidColumns(array $columns);", "function ganesh_set_ganesh_contact_columns($columns){\r\n\t$newColumns = array();\r\n\t$newColumns['title'] = 'Full Name';\r\n\t$newColumns['message'] = 'Message';\r\n\t$newColumns['email'] = 'Email';\r\n\t$newColumns['date'] = 'Date';\r\n\treturn $newColumns;\r\n}", "function addColumns($columns)\n {\n if (is_array($columns)) {\n foreach ($columns as $column) {\n if (!isset($this->columns_list[$column])) {\n $this->columns[] = $column;\n $this->columns_list[$column] = 1;\n }\n }\n }\n else {\n if (!isset($this->columns_list[$columns])) {\n $this->columns[] = $columns;\n $this->columns_list[$columns] = 1;\n }\n }\n }", "abstract protected function getColumns(): array;", "function getColumns() {return $this->_columns;}", "function hub_columns( $columns ) {\r\n $columns['hub_title'] = 'HUB Title';\r\n $columns['client'] = 'Client';\r\n\r\n unset( $columns['title'] );\r\n unset( $columns['date'] );\r\n\r\n $columns['date'] = 'Date';\r\n\r\n return $columns;\r\n }", "public function getColumns(): array;", "function select_columns($table,$columns_name){\n $columns = null;\n $i=0;\n $query = \"SELECT * FROM $table\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result){\n $_SESSION['message'] = \"Eroare la select_columns\".Database::getInstance()->getConnection()->error;\n $_SESSION['status'] = \"danger\";\n $_SESSION['icon'] = \"exclamation-sign\";\n echo status_baloon();\n die(\"mort!!\");\n }\n while ($row = $result->fetch_assoc()){\n $i++;\n foreach ($columns_name as $column)\n $columns[$i][$column] = $row[$column];\n }\n $result->free_result();\n return $columns;\n}", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "abstract protected function getColumnsHeader(): array;", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "abstract public function getColNames();", "public function tableColumns($table,$column);", "public function getColumnNames()\r\n\t\t{\r\n\t\t\t$nameColumns = $this->getColumnsArray();\r\n\t\t\treturn implode(\",\", $nameColumns);//Retornando uma lista de colunas separadas por vígula\r\n\t\t}", "public static function contributor_list_table_columns($columns) {\n\t\treturn \\Podlove\\PHP\\array_insert($columns, 'episodes', ['flattr' => __('Flattr', 'podlove-podcasting-plugin-for-wordpress')]);\n\t}", "private function table_columns(){\n $column = array();\n $query = $this->db->select('column_name')\n ->from('information_schema.columns')\n ->where('table_name', $this::$table_name)\n ->get($this::$table_name)->result_array();\n //return individual table column\n foreach($query as $column_array){\n foreach($column_array as $column_name){\n $column[] = $column_name;\n }\n }\n return $column;\n }", "private function setColumns(array $columns)\n {\n $this->columns = $columns;\n }", "abstract public function loadColumns();", "public function columns($table_name);", "public static function contributor_list_table_search_db_columns($columns) {\n\t\t$columns[] = 'flattr';\n\t\treturn $columns;\n\t}", "public function select($columns);", "function get_export_file_columns()\n\t{\n\t\t$columns = array(\n\t\t\t'FIRST NAME',\n\t\t\t'MIDDLE NAME',\n\t\t\t'LAST NAME',\n\t\t\t'JOB TITLE',\n\t\t\t'COMPANY NAME',\n\t\t\t'WORK PHONE',\n\t\t\t'HOME PHONE',\n\t\t\t'ADDRESS LINE 1',\n\t\t\t'ADDRESS LINE 2',\n\t\t\t'ADDRESS LINE 3',\n\t\t\t'CITY',\n\t\t\t'STATE',\n\t\t\t'STATE/PROVINCE (US/CANADA)',\n\t\t\t'COUNTRY',\n\t\t\t'POSTAL CODE',\n\t\t\t'SUB POSTAL CODE',\n\t\t);\n\n\t\t$new = array();\n\n\t\tforeach($columns as $column):\n\t\t\t$new[$column] = $column;\n\t\tendforeach;\n\n\t\treturn $new;\n\t}", "public function columns( $columns ) {\n\n\t\t// Removes columns.\n\n\t\tunset( $columns['date'] );\n\n\t\t// Adds columns.\n\n\t\t$new_columns = [\n\t\t\t'url' => __( 'URL', 'the-guide' ),\n\t\t\t'steps' => __( 'Steps', 'the-guide' ),\n\t\t\t'enabled' => __( 'Enabled', 'the-guide' ),\n\n\t\t\t'date' => __( 'Date' ), // Moves it back to the end.\n\t\t];\n\n\t\treturn array_merge( $columns, $new_columns );\n\t}", "static function getColumns()\n {\n }", "function wpc_client_my_columns( $columns ) {\r\n $columns['clients'] = 'Clients';\r\n $columns['groups'] = 'Client Circles';\r\n\r\n unset($columns['date']);\r\n $columns['date'] = 'Date';\r\n\r\n return $columns;\r\n }", "public function returning($columns);", "public function getColumns(){\n $rows = array();\n return $rows; \n }", "public function set_columns( $columns ) {\n\n\t\t$date_column = $columns['date'];\n\t\t$author_column = $columns['author'];\n\n\t\tunset( $columns['date'] );\n\t\tunset( $columns['author'] );\n\n\t\t$columns['type'] = esc_html__( 'Type', 'elementskit' );\n\t\t$columns['condition'] = esc_html__( 'Conditions', 'elementskit' );\n\t\t$columns['date'] = $date_column;\n\t\t$columns['author'] = $author_column;\n\n\t\treturn $columns;\n\t}", "function kt_invoices_columns_add($columns) {\n\tunset($columns['date']);\n\t// unset($columns['package']);\n\tunset($columns['price']);\n\tunset($columns['payment_option']);\n\tunset($columns['title']);\n\t$columns['user'] \t\t= pll__('User','docdirect_core');\n\t$columns['package'] \t\t\t= pll__('Package','docdirect_core');\n\t$columns['payment_option'] \t\t= pll__('Payment Method','docdirect_core');\n\t$columns['price'] \t\t= pll__('Price','docdirect_core');\n \n\t\treturn $columns;\n}", "function get_columns(){\n $columns = array(\n 'title' => 'Contact Name',\n 'date_created' => 'Date Created',\n 'contact_name' => 'Created By'\n );\n return $columns;\n\t}", "public function add_new_columns($columns){\n $column_meta = array( 'username' => __( 'Username', 'drophtml' ) );\n $columns = array_slice( $columns, 0, 6, true ) + $column_meta + array_slice( $columns, 6, NULL, true );\n return $columns;\n }", "function register_column_headers($screen, $columns)\n {\n }", "public function get_columns() {\n\t\treturn array(\n\t\t\t'id' => '%d',\n\t\t\t'user_id' => '%d',\n\t\t\t'username' => '%s',\n\t\t\t'name' => '%s',\n\t\t\t'email' => '%s',\n\t\t\t'product_count' => '%d',\n\t\t\t'sales_count'\t => '%d',\n\t\t\t'sales_value'\t => '%f',\n\t\t\t'status'\t\t => '%s',\n\t\t\t'notes' => '%s',\n\t\t\t'date_created' => '%s',\n\t\t);\n\t}", "public function getColumns()\r\n {\r\n }", "function get_columns() {\n return $columns= array(\n 'col_what'=>__('What','wpwt'),\n 'col_user'=>__('User Name','wpwt'),\n 'col_groupName'=>__('Group Name','wpwt'),\n 'col_application'=>__('Application','wpwt')\n );\n }", "public function setSearchColumns(array $columns);", "public static function setColumns($columns) {\n\t\tself::$columns = $columns;\n\t}", "public function set_columns($cols) { $this->cols = $cols + 0; }", "function type_column_header( $columns ) {\r\n\t\tunset( $columns['date'] );\r\n\t\treturn $columns;\r\n\t}", "protected static function getColumn( $columns ) {\n\n\t\tif ( $columns && is_array( $columns ) ) {\n\t\t\t$column = '';\n\n\t\t\tforeach ( $columns AS &$value ) {\n\n\t\t\t\tif ( '*' != $value\n\t\t\t\t\t\t&& false === strpos( $value, '(')\n\t\t\t\t\t\t&& false === strpos( $value, ')' ) ) {\n\t\t\t\t//特殊查询列不加`号\n\n\t\t\t\t\t$value = '`' . $value . '`';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$column = implode( ',', $columns );\n\t\t}\n\t\telse {\n\t\t\t$column = '*';\n\t\t}\n\n\t\treturn $column;\n\t}", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "function jeg_post_columns($columns)\n{\n\t$columns['posttype'] = 'Blog Post Type';\n\treturn $columns;\n}", "function sb_slideshow_columns( $columns ) {\n\tunset( $columns['date'] ); // remove date column\n\t$columns['id'] = 'ID';\n\t$columns['shortcode'] = 'Shortcode';\n\t$columns['date'] = 'Date'; // add date column back, at the end\n\n\treturn $columns;\n}", "function slb_subscriber_column_headers($columns) {\n\n\t// creating custom column header data\n\t$columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'title' => __('Subscriber Name'),\n\t\t'email' => __('Email Address'),\n\t);\n\n\t// returning new columns\n\treturn $columns;\n}", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'id' \t\t => '%d',\n\t\t\t'name' \t\t => '%s',\n\t\t\t'date_created' \t=> '%s',\n\t\t\t'date_modified' => '%s',\n\t\t\t'status'\t\t=> '%s',\n\t\t\t'ical_hash'\t\t=> '%s'\n\t\t);\n\n\t}", "function overview_columns($columns) {\r\n\r\n $overview_columns = apply_filters('wpi_overview_columns', array(\r\n 'cb' => '',\r\n 'post_title' => __('Title', WPI),\r\n 'total' => __('Total Collected', WPI),\r\n 'user_email' => __('Recipient', WPI),\r\n 'post_modified' => __('Date', WPI),\r\n 'post_status' => __('Status', WPI),\r\n 'type' => __('Type', WPI),\r\n 'invoice_id' => __('Invoice ID', WPI)\r\n ));\r\n\r\n /* We need to grab the columns from the class itself, so we instantiate a new temp object */\r\n foreach ($overview_columns as $column => $title) {\r\n $columns[$column] = $title;\r\n }\r\n\r\n return $columns;\r\n }", "function tracks_list_columns($columns) {\n\tif (!$columns['ag-state']) {\n\t\t$new_columns = array();\n\t\tforeach($columns as $column_key => $column_val) {\n\t\t\t$new_columns[$column_key] = $column_val;\n\t\t\tif ($column_key == 'title') {\n\t\t\t\t$new_columns['ag-state'] = 'State';\n\t\t\t\t$new_columns['ag-speciality'] = 'Speciality';\n\t\t\t\t$new_columns['ag-featured'] = 'Featured';\n\t\t\t}\n\t\t}\n\t\t$columns = $new_columns;\n\t}\n return $columns;\n}", "function listColumns($tablename);", "public function getColumnNames(): array\r\n {\r\n return array_keys($this->columns);\r\n }", "function custom_columns( $columns ) {\n\t$columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'title' => 'Title',\n\t\t'featured_image' => 'Photo',\n\t\t'date' => 'Date'\n\t);\n\treturn $columns;\n}", "abstract protected function _getColumnNames($rs);", "public function get_columns()\n\t{\n\t\t$columns = array();\n\t\t$class = $this->activeRecordClass;\n\t\t\n\t\tif ( ! empty( $this->bulkActions ) )\n\t\t{\n\t\t\t$columns[ 'cb' ] = '<input type=\"checkbox\" />';\n\t\t}\n\t\t\n\t\tif ( isset( $this->columns ) )\n\t\t{\n\t\t\t$columns = array_merge( $columns, $this->columns );\n\t\t\treturn $columns;\n\t\t}\n\t\t\n\t\tforeach( $class::$columns as $key => $column )\n\t\t{\n\t\t\t$slug = NULL;\n\t\t\t$title = NULL;\n\t\t\t\n\t\t\tif ( is_array( $column ) )\n\t\t\t{\n\t\t\t\t$slug = $class::$prefix . $key;\n\t\t\t\tif ( isset( $column[ 'title' ] ) and is_string( $column[ 'title' ] ) )\n\t\t\t\t{\n\t\t\t\t\t$title = $column[ 'title' ];\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( is_string( $column ) )\n\t\t\t{\n\t\t\t\t$slug = $class::$prefix . $column;\n\t\t\t}\n\t\t\t\n\t\t\tif ( ! $title )\n\t\t\t{\n\t\t\t\t$title = str_replace( '_', ' ', $slug );\n\t\t\t\t$title = ucwords( $title );\n\t\t\t}\n\t\t\t\n\t\t\t$columns[ $slug ] = $title;\n\t\t}\n\t\t\n\t\treturn $columns;\n\t}", "private function columnHeader(array $columns)\n {\n if (is_array($columns)) {\n $columns[Launcher::SLUG.'_status'] = __('Rejected Status', 'reject-notify');\n }\n\n return $columns;\n }", "public function setColumns($columns = \"*\")\n {\n //$sql = '';\n if ($columns == \"*\") {\n $this->select_list = '*';\n } elseif (!empty($columns)) {\n foreach ($columns as $item) {\n\n $this->select_list .= $item . ',';\n }\n $this->select_list = rtrim($this->select_list, ',');\n }\n// echo \"column set to \".$this->getColumns(); die;\n\n }", "public function getColumns() {\n $columns = array();\n foreach($this->mapping as $key => $value) {\n array_push($columns, $value);\n }\n return $columns;\n }", "public static function add_column(array $columns): array {\r\n\t\t\r\n\t\t$columns = array_merge(\r\n\t\t\t$columns, \r\n\t\t\t// drama per object\r\n\t\t\t[Drama_Manager::DRAMA_META => self::get_column_name()],\r\n\t\t);\r\n\t\t\r\n\t\treturn $columns;\r\n\t}", "protected function loadColumns(){\n\t\t\t$this->columns = array_diff(\n\t\t\t\tarray_keys(get_class_vars($this->class)),\n\t\t\t\t$this->getIgnoreAttributes()\n\t\t\t);\n\t\t}", "public function setColumns($columns) {\n\t\t$this->columns = $columns;\n\t}", "protected function parseColumns(array $columns): string\n {\n // define string\n $sql = '';\n\n if (!empty($columns)) {\n $i = 0;\n foreach ($columns as $column => $label) {\n // add trailing comma\n $sql .= ($i != 0 ? ', ' : '');\n\n // check for AS syntax\n if (is_int($column)) {\n list($table, $column) = $this->parseColumn($label);\n $label = $column;\n } else {\n list($table, $column) = $this->parseColumn($column);\n }\n\n // Build SQL\n $sql .= $table . '.' . $column . ' AS ' . $table . self::COLUMN_SEPERATOR . $column . self::ALIAS_SEPERATOR . $label;\n\n $i++;\n }\n } else {\n // Empty column selection are not supported - there breaking the parsing\n $this->log(new ConnectionException('Empty column selections are not supported!'), Environment::E_LEVEL_ERROR);\n\n // return an empty string if exceptions are disabled\n return '';\n }\n\n // return string\n return $sql;\n }", "public static function getColumns()\n {\n return array();\n }", "public function all($columns = ['*']);", "public function columnsUpdate($columns){\n $columns = explode(\",\",$columns);\n $resultColomnsUpdate=\"\";\n foreach ($columns as $col) {\n $resultColomnsUpdate.= $col.\" = ? , \";\n }\n $resultColomnsUpdate = substr($resultColomnsUpdate, 0, -2);\n return $resultColomnsUpdate;\n }", "public function setColumns($columns)\n {\n $this->columns = $columns;\n }", "public function get_columns()\r\n\t{\r\n\t\treturn [\r\n\t\t\t'name' => __( 'Name', 'giga-messenger-bots' ),\r\n\t\t\t'email' => __( 'Email', 'giga-messenger-bots' ),\r\n\t\t\t'phone' => __( 'Phone', 'giga-messenger-bots' ),\r\n\t\t\t'subscribe' => __( 'Subscribe', 'giga-messenger-bots' ),\r\n 'auto_stop' => __( 'Status', 'giga-messenger-bots' ),\r\n\t\t\t'created_at' => __( 'Created At', 'giga-messenger-bots' ),\r\n\t\t];\r\n\t}", "public function columns($columns = array('*'))\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function select($columns = array('*'));", "function &columns() {\n // return by reference\n //ts('Contact Id') => 'contact_id',\n $columns = array(\n ts('Name') => 'sort_name',\n ts('Job Title') => 'job_title',\n ts('media') => 'current_employer',\n );\n return $columns;\n }", "public function getTableColumns()\n\t{\n\t}", "public function previewColumns();", "private function initColumnArrays()\n {\n foreach ($this->columns as $key => $column) {\n $dql = $this->accessor->getValue($column, 'dql');\n $data = $this->accessor->getValue($column, 'data');\n\n $currentPart = $this->entityShortName;\n $currentAlias = $currentPart;\n $metadata = $this->metadata;\n\n if (true === $this->accessor->getValue($column, 'customDql')) {\n $columnAlias = str_replace('.', '_', $data);\n\n // Select\n $selectDql = preg_replace('/\\{([\\w]+)\\}/', '$1', $dql);\n $this->addSelectColumn(null, $selectDql.' '.$columnAlias);\n // Order on alias column name\n $this->addOrderColumn($column, null, $columnAlias);\n // Fix subqueries alias duplication\n $searchDql = preg_replace('/\\{([\\w]+)\\}/', '$1_search', $dql);\n $this->addSearchColumn($column, null, $searchDql);\n } elseif (true === $this->accessor->getValue($column, 'selectColumn')) {\n $parts = explode('.', $dql);\n\n while (count($parts) > 1) {\n $previousPart = $currentPart;\n $previousAlias = $currentAlias;\n\n $currentPart = array_shift($parts);\n $currentAlias = ($previousPart === $this->entityShortName ? '' : $previousPart.'_').$currentPart;\n\n if (!array_key_exists($previousAlias.'.'.$currentPart, $this->joins)) {\n $this->addJoin($previousAlias.'.'.$currentPart, $currentAlias, $this->accessor->getValue($column, 'joinType'));\n }\n\n $metadata = $this->setIdentifierFromAssociation($currentAlias, $currentPart, $metadata);\n }\n\n $this->addSelectColumn($currentAlias, $this->getIdentifier($metadata));\n $this->addSelectColumn($currentAlias, $parts[0]);\n $this->addSearchOrderColumn($column, $currentAlias, $parts[0]);\n } else {\n // Add Order-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'orderColumn') && true === $this->accessor->getValue($column, 'orderable')) {\n $orderColumn = $this->accessor->getValue($column, 'orderColumn');\n $orderParts = explode('.', $orderColumn);\n if (count($orderParts) < 2) {\n $orderColumn = $this->entityShortName.'.'.$orderColumn;\n }\n $this->orderColumns[] = $orderColumn;\n } else {\n $this->orderColumns[] = null;\n }\n\n // Add Search-Field for VirtualColumn\n if ($this->accessor->isReadable($column, 'searchColumn') && true === $this->accessor->getValue($column, 'searchable')) {\n $searchColumn = $this->accessor->getValue($column, 'searchColumn');\n $searchParts = explode('.', $searchColumn);\n if (count($searchParts) < 2) {\n $searchColumn = $this->entityShortName.'.'.$searchColumn;\n }\n $this->searchColumns[] = $searchColumn;\n } else {\n $this->searchColumns[] = null;\n }\n }\n }\n\n return $this;\n }", "static function get_columns(): array {\r\n return [\r\n 'title' => 'Title',\r\n self::qcol('link') => 'Link',\r\n self::qcol('date_from') => 'In use from',\r\n self::qcol('date_till') => 'In use till',\r\n self::qcol('main') => 'Main website'\r\n ];\r\n }", "protected function columns(array $columns = []): array\n {\n if ( !empty( $columns ) ) {\n $this->_columns = $columns;\n }\n return $this->_columns ?? [];\n }", "public function getColumnsList(){\n return $this->_get(3);\n }", "public function set_custom_column( $columns )\n {\n /* We are going to rearrange the information */\n $title = $columns['title'];\n $date = $columns['date'];\n unset ( $columns['title'] , $columns['date'] );\n\n $columns['name'] = 'Author Name';\n $columns['title'] = $title;\n $columns['approved'] = 'Approved';\n $columns['featured'] = 'Featured';\n $columns['date'] = $date;\n return ( $columns );\n }", "public static function getColumns(): array {\n return ['invoice_id', 'appointment_id', 'create_time', 'update_time', 'state', 'tax_rate',\n 'amount_due', 'amount_payed', 'discount_rate'];\n }", "public function getColumns(): array\n {\n return $this->columns;\n }", "public function getColumns(): array\n {\n return $this->columns;\n }", "public static function columns()\n {\n return filterColumnByRole([\n 'plot_ref' => trans('system.code'),\n 'plot_name' => trans_title('plots'),\n 'user.name' => trans_title('users'),\n 'city.city_name' => trans_title('cities'),\n 'plot_percent_cultivated_land' => sections('plots.cultivated_land'),\n 'plot_real_area' => sections('plots.real_area'),\n 'plot_start_date' => sections('plots.start_date'),\n 'plot_active' => trans('persona.contact.active'),\n 'plot_green_cover' => sections('plots.green_cover'),\n 'plot_pond' => sections('plots.pond'),\n 'plot_road' => sections('plots.road'),\n ],\n $roleFilter = Credentials::isAdmin(),\n $newColumns = ['client.client_name' => trans_title('clients')],//Admits multiple arrays\n $addInPosition = 3\n );\n }", "private function getColumns() : array\r\n {\r\n return [\r\n self::column('id'),\r\n self::column('type_id'),\r\n self::column('region_id'),\r\n self::column('district_id'),\r\n self::column('phone'),\r\n self::column('fax'),\r\n self::column('zip'),\r\n self::column('rate'),\r\n self::column('discount'),\r\n self::column('website'),\r\n self::column('email'),\r\n self::column('active'),\r\n self::column('closed'),\r\n self::column('legal_address'),\r\n self::column('legal_name'),\r\n self::column('lat'),\r\n self::column('lng'),\r\n self::column('lng'),\r\n self::column('city_tax_include'),\r\n self::column('contact_full_name'),\r\n self::column('contact_position'),\r\n self::column('contact_email'),\r\n self::column('contact_first_phone'),\r\n self::column('contact_second_phone'),\r\n self::column('checkin_from'),\r\n self::column('checkin_to'),\r\n self::column('checkout_from'),\r\n self::column('checkout_to'),\r\n self::column('payment_time'),\r\n self::column('breakfast'),\r\n self::column('has_restaurant'),\r\n self::column('restaurant_opening'),\r\n self::column('restaurant_closing'),\r\n self::column('center_distance'),\r\n self::column('penality_enabled'),\r\n self::column('penality_not_taken_after'),\r\n self::column('penality_not_later_arrival'),\r\n self::column('penality_cancelation_item'),\r\n self::column('penality_cancelation_type'),\r\n self::column('penality_percentage'),\r\n self::column('penality_percentage_type'),\r\n self::column('card_required'),\r\n HotelTranslationMapper::column('lang_id'),\r\n HotelTranslationMapper::column('name'),\r\n HotelTranslationMapper::column('address'),\r\n HotelTranslationMapper::column('description')\r\n ];\r\n }", "public function setColumns($columns)\n {\n $this->columns = array();\n $this->aliases = array();\n $this->customColumns = array();\n foreach ($columns as $columnIndex => $column) {\n // Is custom Column\n if (array_key_exists($column, $this->builtInCustomColumns) ||\n isset($this->columnProperties[$column]['callback'])) {\n if (array_key_exists($column, $this->builtInCustomColumns)) {\n $column = $this->builtInCustomColumns[$column];\n } elseif (isset($this->columnProperties[$column]['callback'])) {\n $column = $this->columnProperties[$column];\n unset($column['width']);\n }\n $this->addCustomColumn($column);\n } else {\n $alias = $this->getAliasColumn($column);\n // Check column alias or not\n if ($alias) {\n // Set alias columns\n $this->aliases[$alias] = $column;\n $columnIdentifier = $alias;\n } else {\n // Add prefix entity or table name to column name ( support column name only )\n $columnIdentifier = $this->addPrefixEntity($column);\n }\n $this->columns[] = $columnIdentifier;\n }\n }\n }", "public function getColumns()\n {\n // code...\n return $this->__COLUMNS__ ?? [];\n }" ]
[ "0.75051", "0.74370253", "0.74145895", "0.7267179", "0.7158874", "0.71196157", "0.7102883", "0.7057539", "0.704516", "0.7021971", "0.6999432", "0.69876426", "0.69788724", "0.6972669", "0.69641966", "0.6953564", "0.6924094", "0.6898114", "0.6898114", "0.6898114", "0.6898114", "0.6898114", "0.6898114", "0.6898114", "0.68855107", "0.688119", "0.688119", "0.688119", "0.688119", "0.688094", "0.688094", "0.68378997", "0.6806211", "0.679819", "0.6781929", "0.6769184", "0.6768271", "0.67556745", "0.6731739", "0.67279804", "0.66855663", "0.6681758", "0.66651356", "0.6661088", "0.66580015", "0.6628462", "0.6613855", "0.66013676", "0.65913707", "0.6580668", "0.6571475", "0.6571115", "0.6566741", "0.65638137", "0.6549836", "0.6547248", "0.65471333", "0.65455526", "0.6543493", "0.6543243", "0.653423", "0.6532592", "0.6531682", "0.65250224", "0.65222716", "0.65138274", "0.6512491", "0.65101254", "0.6506369", "0.64998275", "0.64993757", "0.64991343", "0.6496137", "0.64949995", "0.648998", "0.6488154", "0.64860076", "0.64839774", "0.6479115", "0.6472787", "0.6471898", "0.64708406", "0.64696115", "0.6464445", "0.6450435", "0.6450344", "0.64480835", "0.64446616", "0.6439921", "0.6436506", "0.6433867", "0.6431783", "0.643075", "0.6429825", "0.64266145", "0.64155585", "0.64155585", "0.6408131", "0.64073074", "0.64063156", "0.64046884" ]
0.0
-1
$updates is an associative array of the form 'column_name'=>'value to update'
public function mysql_update(database $db, array $updates, array $where, $flags=0) { // $where is an associative array of the form 'column_name'=>'value to match' $assigns = []; foreach($updates as $col=>$val) { if(!isset($this->columns[$col])) continue; $assigns[] = $this->columns[$col]->assign($db,$val); } $conditions = []; foreach($where as $col=>$val) { if(!isset($this->columns[$col])) continue; preg_match('/^(\W{0,2})(.*)/',$val,$m); $conditions[] = $this->columns[$col]->comp($db,$m[2],$m[1]); } return "UPDATE ".$this->mysql_ref($db)." SET\n\t". implode(",\n\t",$asigns)."\nWHERE\n\t". implode("\nAND\t",$conditions).";\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function update($updates) {\n\t\t\tglobal $db;\n\n\t\t\t$sql = \"UPDATE \".static::$table_name.\" SET \";\n\t\t\t$sql1 = \"\";\n\t\t\tforeach ($updates as $key => $value) {\n\t\t\t\t$sql1 .= \"`\".$db->prep_sql($key).\"`\".\"='\".$db->prep_sql($value).\"',\";\n\t\t\t}\n\t\t\t$sql1 = substr($sql1, 0, strlen($sql1)-1);\n\n\t\t\t$sql .= $sql1.\" WHERE id=\".$db->prep_sql($updates['id']);\n\n\t\t\t$result = $db->execute_query($sql);\n\t\t\t//$db->close_connection();\n\n\t\t\treturn $db->get_affected_rows();\n\t\t}", "public function update(array $update);", "protected function setUpdateArray() {\n $column_names = getColumnNames($this->table_name);\n foreach ($column_names as $column_name) {\n if (isset($_POST[$column_name])) {\n $this->update[$column_name] = Mysql::SQLValue($_POST[$column_name]);\n } else if (isset($_GET[$column_name])) {\n $this->update[$column_name] = Mysql::SQLValue($_GET[$column_name]);\n }\n }\n }", "private function updateChunk($updates){\n\t\t$ids = [];\n\t\tforeach ($updates as $upd) {\n\t\t\t$ids[] = $upd['collection']->id;\n\t\t}\n\n\t\t//buat array parameter update\n\t\t$update_parameter = [];\n\t\tforeach ($updates as $up) {\n\t\t\tforeach (array_keys( $up['updates'] ) as $k) {\n\t\t\t\t$update_parameter[ $k ][] = [\n\t\t\t\t\t'value' => $up['updates'][$k],\n\t\t\t\t\t'id' => $up['collection']->id\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\n\t\t$table = $updates[0]['collection']->getTable();\n\t\t$query = \"update \";\n\t\t$query .= $table . \" \";\n\t\t$kedua = false;\n\t\t$timestamp = date('Y-m-d H:i:s');\n\t\tforeach ($update_parameter as $key => $upd) {\n\t\t\tif ($kedua) {\n\t\t\t\t$query .= \",\" . $key . \" = ( CASE id \";\n\t\t\t} else {\n\t\t\t\t$query .= \"SET \" . $key . \" = ( CASE id \";\n\t\t\t}\n\t\t\tforeach ($upd as $up) {\n\t\t\t\t$query .= \"WHEN '\" . $up['id'] . \"' THEN '\" . $up['value'] . \"' \";\n\t\t\t}\n\t\t\t$query .= \"END) \";\n\t\t\t$kedua = true;\n\t\t}\n\n\t\t$query .= \", updated_at = '$timestamp' \";\n\t\t$query .= \"WHERE id in \";\n\t\tforeach ($ids as $k => $id) {\n\t\t\tif ($k == 0) {\n\t\t\t\t$query .= \"('\" . $id . \"'\";\n\t\t\t} else {\n\t\t\t\t$query .= \" ,'\" . $id .\"'\";\n\t\t\t}\n\t\t}\n\t\t$query .= \")\";\n\t\tDB::statement($query);\n\t}", "function parse_db_updates($updates) {\n if (!is_array($updates)) {\n $this->updates = null;\n }\n $this->updates = $updates;\n return true;\n }", "public function update($updates)\n {\n return $this->query->batchUpdate($updates, $this->filter);\n }", "function adv_update($table, array $data, array $where);", "public function update($update_array){\n $date = new DateTime(\"now\",new DateTimeZone(DATETIMEZONE));\n $update_array['last_updated'] = $date->format('c');\n $this->db->update('use_case', $update_array, array('usecase_id' => $update_array['usecase_id']));\n return $this->db->affected_rows();\n }", "protected function listUpdates() {}", "abstract protected function getAllUpdates();", "function _applyUserTaskUpdates ($updates, $params) {\n $userObj = $params['user'];\n $userID = $userObj['id'];\n $tasksDone = $userObj['tasks_done'];\n\n $result = [\n 'userUpdatedEntries' => [],\n 'devlogEntries' => []\n ];\n\n $userQueryElements = [];\n $userQueryElements[] = \"`tasks_done` = '{$tasksDone}'\";\n\n if (!empty($updates['user'])) {\n foreach ($updates['user'] as $Key => $Value2Add) {\n $userQueryElements[] = \"`{$Key}` = `{$Key}` + {$Value2Add}\";\n\n $result['userUpdatedEntries'][] = [\n 'key' => $Key,\n 'value' => $Value2Add\n ];\n }\n }\n\n doquery(\n (\n \"UPDATE {{table}} SET \" .\n \" \" . implode(',', $userQueryElements) . \" \" .\n \"WHERE \" .\n \"`id` = {$userID} \" .\n \";\"\n ),\n 'users'\n );\n\n return $result;\n}", "public function update($table, array $fields_arr, $where) {\n }", "function updates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['updates'] == 1 ) ? 'Database Update' : 'Database Updates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'reverted' : 'executed';\n\t\t\n\t\tforeach ( $this->xml_array['updates_group']['update'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['new_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( $v['old_value'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_update( \"{$v['table']['VALUE']}\", array( \"{$v['key']['VALUE']}\" => \"{$v['old_value']['VALUE']}\" ), \"{$v['where']['VALUE']}\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['updates']} {$object} {$operation}....\" );\n\t}", "public function addKeysToUpdates()\n\t{\n\t\t$keys = $this->database->getNewKeys();\n\n\t\tif (!empty($keys)) {\n\t\t\t$this->addToUpdates($keys);\n\t\t}\n\t}", "public function update($table, $keyColumnName, $id, $update_values) {\n foreach($update_values as $key=>$value) {\n $sets[] = $key.'=\\''.$value.'\\'';\n }\n $sets = implode(',', $sets);\n $sql = \"UPDATE $table SET $sets WHERE $keyColumnName = '$id'\";\n mysql_query($sql);\n }", "public function db_update() {}", "public function addToUpdates($updates) {\n $this->updates = Arr::mergeDeep($this->updates, $updates);\n }", "public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\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 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 }", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "public function update($table, array $values, array $where);", "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}", "public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "public function update($tblUpdate);", "function update($values){\n\n $id = $values['id'];\n unset($values['id']);\n $query = \" UPDATE \" . $this->tableName;\n $separator = \" SET \";\n\n foreach ($values as $key => $value){\n $query .= $separator . $key . \" = '\" . $value . \"'\";\n $separator = \", \";\n\n }\n $query .= \" where id = $id \";\n $query .= \";\";\n return $this->dbh->query($query);\n \n }", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "static function update($updates, $conditions, $debug = false) {\n\t\t\tself::$bind_params = [ ];\n\t\t\t\n\t\t\tif ((is_array($conditions) && count($conditions) == 0) ||\n\t\t\t\t(!is_array($conditions) && !($conditions instanceof Condition))) {\n\t\t\t\t$res = new TMResult(TMResult::InvalidConditions);\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t$t_name = &self::getTableName();\n\t\t\t\n\t\t\t// Validate updates\n\t\t\t$errors = self::validateArray($updates); // [col => val, ...]\n\t\t\tif (count($errors)) {\n\t\t\t\t$res = new TMResult(TMResult::InvalidData);\n\t\t\t\t$res->errors = $errors;\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t// Validate conditions\n\t\t\t$errors = self::validateConditions($conditions);\n\t\t\tif (count($errors)) {\n\t\t\t\t$res = new TMResult(TMResult::InvalidConditions);\n\t\t\t\t$res->errors = $errors;\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\t\n\t\t\t$set_subqs = [ ];\n\t\t\tforeach ($updates as $c => $v) {\n\t\t\t\t$set_subqs []= \"$c = ?\";\n\t\t\t\tself::$bind_params []= $v;\n\t\t\t}\n\t\t\t$set_subqs = 'set ' . implode(', ', $set_subqs);\n\t\t\t\n\t\t\t$cond = self::getCondStr_AndAddBindParams($conditions);\n\t\t\t\n\t\t\t$q = \"update $t_name $set_subqs $cond\";\n\t\t\tif ($debug) var_dump($q);\n\t\t\t$st = self::$pdo->prepare($q);\n\t\t\t\n\t\t\tself::bindBindParams($st);\n\t\t\t\n\t\t\t$r = $st->execute();\n\t\t\tif ($r) {\n\t\t\t\t$res = new TMResult(TMResult::Success);\n\t\t\t\t$res->result = $st->rowCount();\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$res = new TMResult(TMResult::InternalError);\n\t\t\t\t$res->errors = $st->errorInfo();\n\t\t\t\treturn $res;\n\t\t\t}\n\t\t}", "public function SQL_UPDATE() {\r\n\t}", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function update(array $update = [])\n {\n if (!empty($update)) {\n $this->setAttributes($update);\n }\n\n $primary = $this->getPrimaryKey();\n\n return $this->serve(false)\n ->where($primary, $this->{$primary})\n ->update($this->getAttributes());\n }", "public function update()\n {\n return [\n [self::DRUSH, 'updatedb']\n ];\n }", "public function update(array $data);", "public function update(array $data);", "public function update(array $data);", "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}", "public function update($targets=[],$ignores=[],$debug=false) {\n if (!static::hasSerial()) $this->checkPKForUpdate();\n $diff = \\Fandisus\\Lolok\\Basic::objDiff($this->_oldVals, $this);\n if (!count($diff)) throw new \\Exception('Tidak ada perubahan data');\n $onlyUpdateTarget = (count($targets) === 0) ? false : true;\n $cols = []; $bindings=[];\n $ignores[] = '_addedFields'; $ignores[] = '_removedFields'; //2021-10-17 & 27, added default ignores, so extra fields will not be checked\n foreach ($diff as $col=>$obj) {\n if (in_array($col, $ignores)) continue; //ignores fields specified in ignore.\n if ($onlyUpdateTarget && !in_array($col, $targets)) continue;\n $cols[] = \"$col=:$col\";\n $bindings[$col] = $obj->new; //Hasil dari objDiff. Ada prop 'new' dan 'old'\n }\n foreach (static::PK() as $PK) $bindings[\"old$PK\"] = $this->_oldVals->$PK;\n $this->prepareForDB($bindings);\n \n $sql = 'UPDATE '.static::tableName().' SET ';\n $sql.= implode(', ', $cols);\n $conds = array_map(function($PK) { return \"$PK=:old$PK\"; }, static::PK());\n $sql.= ' WHERE '.implode(' AND ', $conds);\n// if ($debug) {\n// Debug::print_r($bindings);\n// die ($sql);\n// }\n DB::exec($sql, $bindings);\n }", "function update($where_clause=null)\n {\n $db = $this->getDb();\n \n $sets = array();\n $values = array();\n// Kint::dump($this->fields);\n foreach( array_keys( $this->fields ) as $field )\n {\n //echo \"<br> field \".Kint::dump($field,'Field',false);\n if(!is_null($where_clause) && $field == $this->id_name){\n \techo \"Skipping primary key '$field' & $this->id_name since there is another WC '$where_clause' \";\n \tcontinue;\n }\t\n if('0'==$field ){\n \tcontinue;\n }\n elseif(is_int($field)){\n \t//Kint::dump($field);\n \t//Kint::dump(array_keys($this->fields));\n \tcontinue;\n }\n elseif (!isset($this->fields[$field]))\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n }\n elseif ($field == 'updated')\n {\n \t//echo \"<br> Empty field $field \";\n \tcontinue;\n } \n else{\t\n \t$sets []= $field.'=?';\n \t$values []= $this->fields[ $field ];\n }\n }\n $set = join( \", \", $sets );\n \n if(is_null($where_clause)){\n \tif($this->id<0)\n \t\tdie(kint::dump('ERROR: this->id was not set on DBObject',$this));\n \t//$values []= $this->id;\n \t$where_clause = $this->id_name.'='.$this->id; \t\n }\n if(!str_contains($set, 'updated')){\n \t$set .= ',updated = null ';\n }\n\t$sql = 'UPDATE '.$this->table.' SET '.$set.\n \t' WHERE '.$where_clause;\n\t//$this->execute($sql,$values);\n\t//die ('SQL in Update<br/>'.$sql.'<br/>'.var_dump($values));\n //Kint::dump('UpdateSQL',$sql);\n //die('TEST');\n $cmd = 'prepare';\n\ttry{\n\t\t$sth = $db->prepare( $sql );\n\t\t$cmd = 'execute';\n\t\t$this->execute( $sth, $values );\n\t}\n catch(exception $e){\n \t$debug=Zend_Debug::dump('Statement with error',$sql);\t\n \tdie(__LINE__.'Exception in DBObject::'.$cmd.'() while cmd='.$cmd.' SQL='.$sql\n \t\t.' with values <br>'.$values\n \t\t.__LINE__.'Exception:<br>'.nl2br($e)\n \t\t.'<hr/>'.$debug);\n } \t\n }", "public function fetchUpdates()\n\t{\n\t}", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(!in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function update(DataObject $updateObject, array $updateKeys, Database_Config $databaseConfig = NULL);", "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}", "function Update($array){\n\n }", "function editNewsDB($update_arr=array(),$condition_arr=array()) {\n\t\t$this->db->where($condition_arr);\n\t\t$update= $this->db->update('dipp_news', $update_arr);\n\t\t//echo $this->db->last_query(); die();\n\t\tif($update) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function update(array $array)\r\n {\r\n $sql = \"UPDATE $this->table \";\r\n foreach ($array as $key => $value) {\r\n $sql .= \"SET $key = $value \";\r\n }\r\n $sql .= \"WHERE id = \" . $array['id'];\r\n return $this->conn->prepare($sql)->execute();\r\n }", "public function update( array $params );", "public function update($table_name, $fields_values = array(), $where = array())\r\n {\r\n }", "function ApplyUpdates($update_dir, $update_list)\n\t{\n\t\t$update_files = $this->GetUpdatesFilesList($update_dir);\n\t\t//var_dump($update_files);\n\t\t\n\t\tforeach ($update_list as $update_item) {\n\t\t\t//list($update_rev, $update_type) = explode('-', $update_item);\n\t\t\t//$update_type = strtoupper($update_type);\n\t\t\t\n\t\t\tif (!empty($update_files[$update_item])) {\n\t\t\t\t$itm =& $update_files[$update_item];\n\t\t\t\t\n\t\t\t\t// try to apply update\n\t\t\t\tswitch ($itm['type']) {\n\t\t\t\t\tcase 'SQL':\n\t\t\t\t\t\t$query = file_get_contents($update_dir.$itm['filename']);\n\n\t\t\t\t\t\t$this->db->exception_on_error = false;\n\t\t\t\t\t\t$is_error = !$this->db->script($query);\n\t\t\t\t\t\t$this->db->exception_on_error = true;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$ids = array (\n\t\t\t\t\t\t\t'rev_num' => $itm['rev_num'],\n\t\t\t\t\t\t\t'type' => $itm['type'],\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// check db for current update\n\t\t\t\t\t\t$this->db->q('SELECT rev_num, type, status FROM #_PREF_updates', $ids);\n\t\t\t\t\t\t$res = $this->db->fetchAssoc();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// try to apply update\n\t\t\t\t\t\tif (is_array($res)) {\n\t\t\t\t\t\t\tif ($res['status'] != 'ok') {\n\t\t\t\t\t\t\t\t$this->db->qI('#_PREF_updates', array ('status' => $is_error ? 'error' : 'ok'), 'UPDATE', $ids);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$ids['status'] = $is_error ? 'error' : 'ok';\n\t\t\t\t\t\t\t$this->db->qI('#_PREF_updates', $ids);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\n\t\t\n\t}", "public function updateData($name, $id, array $updates) {\n $data = $this->getData($name, $id);\n foreach($updates as $columnName => $columnValue) {\n $data->{$columnName} = $columnValue;\n }\n \n return this;\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 list_core_update($update)\n {\n }", "public function update(array $update)\n {\n $update['dtstamp'] = gmdate('Ymd\\THis\\Z', time());\n $update['dtstart'] = gmdate('Ymd\\THis\\Z', strtotime($update['startTime']));\n $update['dtend'] = gmdate('Ymd\\THis\\Z', strtotime($update['endTime']));\n \n parent::update($update);\n }", "public function update(array $data, array $where);", "private function internalUpdate()\n {\n $param = array();\n\n // Run before update methods and stop here if the return bool false\n if ($this->runBefore('update') === false)\n return false;\n\n // Define fieldlist array\n $fieldlist = array();\n\n // Build updatefields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n $val = $this->checkFieldvalue($fld, $val);\n $type = $val == 'NULL' ? 'raw' : $this->getFieldtype($fld);\n\n $fieldlist[] = $this->alias . '.' . $fld . '={' . $type . ':' . $fld . '}';\n $param[$fld] = $val;\n }\n\n // Create filter\n $filter = ' WHERE ' . $this->alias . '.' . $this->pk . '={' . $this->getFieldtype($this->pk) . ':' . $this->pk . '}';\n\n // Even if the pk value is present in data, we set this param manually to prevent errors\n $param[$this->pk] = $this->data->{$this->pk};\n\n // Build fieldlist\n $fieldlist = implode(', ', $fieldlist);\n\n // Create complete sql string\n $sql = \"UPDATE {db_prefix}{$this->tbl} AS {$this->alias} SET {$fieldlist}{$filter}\";\n\n // Run query\n $this->db->query($sql, $param);\n\n // Run after update event methods\n if ($this->runAfter('update') === false)\n return false;\n }", "public static function updateAll()\r\n\t{\r\n\t}", "public function update(UpdateRequest $request, Updates $updates)\n\t{\n $updates->update($request->all());\n flash()->success(\"Atualização atualizada com sucesso!\");\n return redirect('admin/updates');\n\t}", "function _applyPlanetTaskUpdates ($updates, $params) {\n $userObj = $params['user'];\n $planetID = $userObj['id_planet'];\n $unixTimestamp = $params['unixTimestamp'];\n\n $result = [\n 'userUpdatedEntries' => [],\n 'devlogEntries' => []\n ];\n\n if (empty($updates['planet'])) {\n return $result;\n }\n\n $queryElements = [];\n\n foreach ($updates['planet'] as $Key => $Value2Add) {\n $queryElements[] = \"`{$Key}` = `{$Key}` + {$Value2Add}\";\n }\n\n doquery(\n (\n \"UPDATE {{table}} SET \" .\n \" \" . implode(', ', $queryElements) . \" \" .\n \"WHERE \" .\n \"`id` = {$planetID} \" .\n \" LIMIT 1 \" .\n \";\"\n ),\n 'planets'\n );\n\n if (!empty($updates['devlog'])) {\n $entryElements = [];\n\n foreach ($updates['devlog'] as $DevLogKey => $DevLogRow) {\n $entryElements[] = \"{$DevLogKey},{$DevLogRow}\";\n }\n\n $result['devlogEntries'][] = [\n 'PlanetID' => $planetID,\n 'Date' => $unixTimestamp,\n 'Place' => 30,\n 'Code' => '0',\n 'ElementID' => '0',\n 'AdditionalData' => implode(';', $entryElements)\n ];\n }\n\n return $result;\n}", "protected function _update()\n\t{\n\t}", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function update(array $values = [])/*# : UpdateStatementInterface */;", "public function update($table_name, $arr, $conds) {\r\n // TODO: make the arr dynamic\r\n $this->writeToHistory($table_name, $conds);\r\n $query = \"UPDATE (f1, f2, f5) \".$table_name.\" VALUES (f1_value, f2_value, f5_value) WHERE\" ;\r\n\r\n }", "function update($table, $target, $columns);", "function update($table='', $keyandvalue, ...$wherekeys) { \n if ( ! is_array( $keyandvalue ) || ! isset($table) || $table=='' ) {\n\t\t\t$this->setParamaters();\n return false;\n }\n \n $sql=\"UPDATE $table SET \";\n \n foreach($keyandvalue as $key=>$val) {\n if(strtolower($val)=='null') {\n\t\t\t\t$sql.= \"$key = NULL, \";\n } elseif(in_array(strtolower($val), array( 'current_timestamp()', 'date()', 'now()' ))) {\n\t\t\t\t$sql.= \"$key = CURRENT_TIMESTAMP(), \";\n\t\t\t} else {\n\t\t\t\tif ($this->getPrepare()) {\n\t\t\t\t\t$sql.= \"$key = \"._TAG.\", \";\n\t\t\t\t\t$this->setParamaters($val);\n\t\t\t\t} else \n\t\t\t\t\t$sql.= \"$key = '\".$this->escape($val).\"', \";\n\t\t\t}\n }\n \n $where = $this->where(...$wherekeys);\n if (is_string($where)) { \n $sql = rtrim($sql, ', ') . $where;\n return (($this->getPrepare()) && !empty($this->getParamaters())) ? $this->query($sql, true) : $this->query($sql) ; \n } else {\n\t\t\t$this->setParamaters();\n return false;\n\t\t}\n }", "public function parseUpdate(&$arguments)\n {\n $arguments['action'] = 'update';\n $arguments['table'] = $this->getNextWord();\n\n if (strpos($arguments['table'], '.')) {\n list($arguments['db'], $arguments['table']) = explode('.', $arguments['table']);\n }\n\n /* Look for some main keywords */\n while ($word = $this->getNextWord()) {\n switch (true) {\n /* Grab the value-set */\n case (strtolower(substr($word, 0, 3)) == 'set'):\n {\n $this->c -= strlen($word) + 1;\n $this->getValueSet($arguments);\n\n break;\n }\n\n /* Parse the where clause */\n case (strtolower($word) == 'where'):\n {\n $this->parseWhere($arguments);\n $this->c--;\n\n break;\n }\n\n /* Parse the orderby clause */\n case (strtolower($word) == 'orderby'):\n {\n $this->parseOrderBy($arguments);\n\n break;\n }\n\n /* Parse the limit clause */\n case (strtolower($word) == 'limit'):\n {\n $this->parseLimit($arguments);\n\n break;\n }\n }\n }\n\n /* Return whatever results we got back */\n return $arguments;\n }", "abstract public function mass_update();", "function s_m_put_txt_data_update($rows, $ref_id_db_arr, $ref_data, $store_id_db_arr, $store_data){\r\n // if update is needed, use column names in $store_id_db_arr to overwrit with $store_data\r\n for($r = 0; $r < count($rows); $r++){\r\n $update_this = 1;\r\n for($k = 0; $k < count($ref_id_db_arr); $k++){\r\n // notice: only = is supported\r\n if($rows[$r][$ref_id_db_arr[$k]] != $ref_data[$k]){\r\n $update_this = 0;\r\n break;\r\n }\r\n }\r\n if($update_this == 1){\r\n // yes, update (some) columns of this row\r\n for($k = 0; $k < count($store_id_db_arr); $k++){\r\n $rows[$r][$store_id_db_arr[$k]] = $store_data[$k];\r\n }\r\n }\r\n }\r\n return $rows;\r\n}", "public function getUpdateValues(): array;", "public function flushUpdates();", "public function update($args = null) {\n\t\tglobal $config;\n\t\t\n\t\t$updates = array();\n\t\tforeach($args as $key => $val){\n\t\t\tif($this->data[$key] != $val){\n\t\t\t\tif(!get_magic_quotes_gpc()){\n\t\t\t\t\tif(is_string($val))\n\t\t\t\t\t\t$val = $config['database']->real_escape_string($val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$updates[$key] = $val;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$count = 0;\n\t\t$len = count($updates);\n\t\tforeach($updates as $key => $val){\n\t\t\t$count++;\n\t\t\tif($key == 'options')\n\t\t\t\t$val = json_encode($val);\n\t\t\n\t\t\tif($count != $len){\n\t\t\t\tif(is_int($val) || is_float($val)) $values .= $key.' = '.$val.', ';\n\t\t\t\telseif(is_string($val)) $values .= $key.\" = '\".$val.\"', \";\n\t\t\t}else{\n\t\t\t\tif(is_int($val) || is_float($val)) $values .= $key.' = '.$val;\n\t\t\t\telseif(is_string($val)) $values .= $key.\" = '\".$val.\"'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!empty($updates)){\n\t\t\t$result = $config['database']->query(\"\n\t\t\t\tUPDATE nuusers\n\t\t\t\tSET $values\n\t\t\t\tWHERE id = {$this->data['id']}\n\t\t\t\tLIMIT 1\n\t\t\t\");\n\t\t\t\n\t\t\tif($result){\n\t\t\t\tforeach($updates as $key => $val){\n\t\t\t\t\t$this->data[$key] = $val;\n\t\t\t\t\tif($key == 'level_pts'){\n\t\t\t\t\t\t$this->data['level'] = $this->loadLevel();\n\t\t\t\t\t\t$this->data['levelProgress'] = $this->loadLevelProgress();\n\t\t\t\t\t\t$this->data['rank'] = $this->loadRank();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $result;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "public function getForUpdateSQL();", "function dbupdate($table, $fields, $where = [1=>0], $funcs = null ) {\r\n\tglobal $msq;\r\n\t$parts = [];\r\n\tforeach ($fields as $k => $v)\r\n\t\t$parts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\tif ($funcs != null) {\r\n\t\tforeach ($funcs as $k => $v) {\r\n\t\t\t$parts []= $k.' = '.$v;\r\n\t\t}\r\n\t}\r\n\t$whparts = [];\r\n\tforeach ($where as $k => $v)\r\n\t\t$whparts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\t$q = \"update \".$table.\" set \".implode(\", \",$parts).\" where \".implode(\" and \",$whparts);\r\n\treturn dbcommit($q);\r\n}", "public function update($table, $fieldValues, $conditions, $bind = []);", "public function hasUpdates();", "public function updateMultiple_data()\n {\n \n }", "public function DoUpdate()\n\t{\n\n\t\treturn db_update_records($this->fields, $this->tables, $this->values, $this->filters);\n\t}", "public function updateRecords($recordIds, array $updates = [], $opts = false)\n {\n $options = (new ZohoOperationParams($this->token, $this->recordType))\n ->setNewFormat(null);\n if (is_array($recordIds)){\n $formedUpdates = [];\n if(count($updates) === 0) {\n foreach ($recordIds as $id => $updateArray) {\n if (!is_array($updateArray)) {\n throw new \\Exception('Updates should be passed as an associated array \"Field Name\" => \"New Value ...\"');\n }\n $updateArray['Id'] = $id;\n $formedUpdates[] = $updateArray;\n }\n $options->setVersion(4);\n }else { // count of $updates param is not 0\n foreach ($recordIds as $id) {\n $updates['Id'] = $id;\n $formedUpdates[] = $updates;\n }\n if (count($recordIds) == 1){\n $options->setId($recordIds[0]);\n }else {\n $options->setVersion(4);\n }\n }\n $options->setXmlData(Zoho::generateXML($formedUpdates, $this->recordType));\n }else {\n $options->setId($recordIds)\n ->setXmlData(Zoho::generateXML($updates, $this->recordType));\n }\n if ($opts) {\n $options = $this->setOpts($options, $opts);\n }\n return Zoho::execute($options);\n }", "function batch_update($datas)\n\t{\n\t\t$ci = &get_instance();\n\t\t$ci->db->trans_strict(TRUE);\n\t\t$ci->db->trans_start();\n\n\t\tif (IS_LOCAL) $ci->load->helper('logger');\n\n\t\tforeach($datas as $table => $data) {\n\t\t\t$ci->db->update($table, $data[0], $data[1]);\n\n\t\t\tif (IS_LOCAL)\tlogme('UPDATE_QUERY', 'info', $ci->db->last_query());\n\t\t}\n\n\t\t$ci->db->trans_complete();\n\t\tif ($ci->db->trans_status() === FALSE)\n\t\t{\n\t\t\tif (IS_LOCAL)\tlogme('ERROR_QUERY', 'info', 'Database Error: '.$ci->db->error()['message']);\n\t\t\treturn [FALSE, ['message' => F::_err_msg('err_commit_data')]];\n\t\t}\n\n\t\treturn [TRUE, NULL];\n\t}", "public function database_update($table, $requestArray)\n\t{\n\t\t$returnArray\t\t\t\t\t\t\t\t= array();\n\t\t$returnArray['result']\t\t\t\t\t= false;\n\n\t\tif (isset($requestArray['ID']))\n\t\t\t$tableQuery \t\t\t= \"SELECT * FROM \".$table.\" WHERE ID=\".$requestArray['ID'];\n\t\telse\n\t\t\t$tableQuery \t\t\t= \"SELECT * FROM \".$table.\" WHERE \".$requestArray['FIELDNAME'].\"=\".$requestArray['FIELDCRITERIA'];\n\n\t\tunset($requestArray['FIELDNAME']);\n\t\tunset($requestArray['FIELDCRITERIA']);\n\n\t\t$selectQuery\t\t= $this->db_user->Execute($tableQuery);\n\t\t$updateQuery\t= $this->db_user->GetUpdateSQL($selectQuery,$requestArray,true);\n\n\t\tif ($this->db_user->Execute($updateQuery))\n\t\t{\n\t\t\t$returnArray['result']\t\t\t\t\t= true;\n\t\t\t$returnArray['rows_affected']\t\t= $this->db_user->Affected_Rows();\n\t\t}\n\t\treturn $returnArray;\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 _applyFreePremiumTaskUpdates ($updates, $params) {\n $userObj = $params['user'];\n $userID = $userObj['id'];\n\n $result = [\n 'userUpdatedEntries' => [],\n 'devlogEntries' => []\n ];\n\n if (empty($updates['free_premium'])) {\n return $result;\n }\n\n $queryElements = [];\n\n foreach ($updates['free_premium'] as $ItemID) {\n $queryElements[] = \"(NULL, {$userID}, UNIX_TIMESTAMP(), 0, 0, {$ItemID}, 0)\";\n }\n doquery(\n (\n \"INSERT INTO {{table}} VALUES \" .\n \" \" . implode(', ', $queryElements) . \" \" .\n \";\"\n ),\n 'premium_free'\n );\n\n return $result;\n}", "public function updateColumns()\n\t{\n\t\treturn $this->updateColumns;\n\t}", "public function update(array $array, $data = array()) {\n $this->sql = 'UPDATE `' . static::$tableName . '` SET ';\n $properties = (!empty($data) && count($data) > 0) ? $data : $this->properties;\n foreach ($properties as $key => $value) {\n $this->sql.=\"`$key`=\" . $this->db->quote($value); //PDO quote is wrap the value within signle quotes 'value'\n }\n $this->sql = trim($this->sql, \",\");\n $this->where($array);\n return $this->execute();\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "function fn_update($table, $param, $condition) {\r\n foreach ($param as $key => $value) {\r\n $this->query(\"update $table set $key = $value where $condition\");\r\n }\r\n }", "public function update( $sql, $params=array());", "public function updateRecords($requestUpdateValues,$params,$ids){\n \n $this->params = $params;\n $this->requestUpdateValues = $requestUpdateValues;\n $this->updateIds = $ids;\n\n $result = $this->modifyRecords();\n\n return array (\n 'success' => true,\n 'results' => $result != false ? $this->recordsUpdated : $this->noRecords\n );\n }", "protected function performUpdate() {}", "protected function _update($table, $values, $where) {\n\t\tforeach ($values as $key => $val) {\n\t\t\t$valstr[] = $key.' = '.$val;\n\t\t}\n\n\t\treturn $this->query('UPDATE '.$table.' SET '.implode(', ', $valstr) . $this->_compile_wh($where));\n\t}", "public function UpdateChequeDetails($update) {\n $arr = [];\n $i = 0;\n foreach ($update as $key => $val) {\n $arr[$key]['cheque_num'] = $val['cheque_num'][0];\n $arr[$key]['expiry_date'] = $val['expiry_date'][0];\n $arr[$key]['amount'] = $val['amount'][0];\n $i++;\n }\n foreach ($arr as $key => $value) {\n $aditional = \\common\\models\\ChequeDetails::findOne($key);\n $aditional->cheque_no = $value['cheque_num'];\n $aditional->due_date = date(\"Y-m-d\", strtotime($value['expiry_date']));\n $aditional->amount = $value['amount'];\n $aditional->save();\n }\n }", "function update_data($update_data,$where_arr,$tbl_name)\n\t{\n\t\tif(!empty($update_data))\n\t\t{\n\t\t\t$this->db->where($where_arr);\n\t\t\t$this->db->update($tbl_name,$update_data);\n\t\t\t\n\t\t\tif($this->db->affected_rows()>0)\n\t\t\t{\n\t\t\t\treturn TRUE;\t\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "function update($table, $items, $field, $key)\n {\n\t\t$this->db->where($field, $key);\n $this->db->update($table, $items);\n }", "public static function update($options = array()) {\n if (empty($options['table'])) {\n $options['table'] = static::$tableName; \n }\n $sql = new Sql(static::getDb()); \n $set = array();\n $where = array();\n foreach (static::$properties as $property) {\n if (isset($options['set'][$property])) { \n $set[$property] = $options['set'][$property];\n }\n if (isset($options['where'][$property])) { \n $where[$property] = $options['where'][$property];\n }\n }\n if (empty($set) || empty($options['where'])) {\n static::errorParamInvalid('set/where');\n return false;\n } \n if (in_array('updated', static::$properties)) {\n $set['updated'] = new Expression('UNIX_TIMESTAMP()'); \n }\n $update = $sql->update()\n ->table($options['table'])\n ->set($set);\n if (!empty($where)) {\n $update->where($where);\n }\n foreach ($options['where'] as $where) {\n if ($where instanceof Expression) {\n $update->where($where);\n }\n }\n $updateString = $sql->getSqlStringForSqlObject($update); \n Log::info('Update SQL', $updateString);\n if (static::getDb()->query($updateString, Adapter::QUERY_MODE_EXECUTE)) {\n return true;\n }\n return false;\n }", "public function getUpdates()\n {\n $query = \"SELECT * FROM events WHERE id > ? AND game_id = ? AND player = ?\";\n $result = $this->oDB->getAll($query, array(\n $this->oData->getLastIdEvents(),\n $this->oData->getIdGames(),\n $this->oData->getOtherNumber()\n ));\n\n $updates = array();\n foreach ($result as $value) {\n switch ($value['event_type']) {\n case \"name_update\":\n $this->oData->setOtherName($value['event_value']);\n break;\n\n case \"start_game\":\n $this->oData->setOtherShips($value['event_value']);\n break;\n\n case \"shot\":\n $this->oData->appendOtherShots($value['event_value']);\n break;\n }\n\n $lastIdEvents = max($this->oData->getLastIdEvents(), $value['id']);\n $this->oData->setLastIdEvents($lastIdEvents);\n\n if ($value['event_type'] == \"chat\") {\n $eventValue = new \\stdClass();\n $eventValue->text = $value['event_value'];\n $eventValue->timestamp = $value['timestamp'];\n } elseif ($value['event_type'] == 'start_game') {\n $eventValue = true;\n } else {\n $eventValue = $value['event_value'];\n }\n\n $updates[ $value['event_type'] ][] = $eventValue;\n $updates['lastIdEvents'] = array($lastIdEvents);\n }\n\n return $updates;\n }", "public function update(){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"UPDATE \".$table.\" SET \";\n foreach($this as $k=>$v){\n $sql .= $k.\" = '\".$v.\"',\";\n }\n $sql = trim($sql, ',');\n $sql .= \" WHERE \".$keyColumn.\" = \".$this->keyColumn;\n mysqli_query(static::$conn, $sql);\n }", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "public function update($table, array $fields);", "private function Update()\n {\n $return = false;\n $action = $this->Action();\n $values = $this->Values();\n $table = $this->Table();\n $where = $this->Where();\n $errorInfo = $this->ERROR_INFO(__FUNCTION__);\n if(MySQLChecker::isAction($action, $errorInfo) && MySQLChecker::isTable($table, $errorInfo) &&\n Checker::isArray($values, false, $errorInfo) && Checker::isArray($where, false, $errorInfo) ) {\n if (isset($values[Where::VALUES]) && isset($values[self::COLUMNS]) && isset($where[Where::VALUES])) {\n $columns = $values[self::COLUMNS];\n $values = $values[Where::VALUES] + $where[Where::VALUES];\n if (Checker::isArray($columns, false, $errorInfo) && Checker::isArray($values, false, $errorInfo)) {\n $return[Where::QUERY] = \"$action $table SET \";\n foreach($columns as $column => $key)\n {\n $return[Where::QUERY] .= \"$column=$key, \";\n }\n $return[Where::QUERY] = trim($return[Where::QUERY],\", \");\n $return[Where::QUERY] .= $where[Where::QUERY];\n $return[Where::VALUES] = $values;\n }\n } else $this->addError(__FUNCTION__, \"Values and Query are not set!\", $values);\n }\n return $return;\n }", "function update() {\n $col_names = array('first_name', 'last_name', 'category_id', 'active');\n $dat_param = array(':fn', ':ln', ':ci', ':ac');\n $sani_type = array('str', 'str', 'int', 'flag');\n $sub_check = array(false, false, false, false);\n $dat_types = array(PDO::PARAM_STR, PDO::PARAM_STR, PDO::PARAM_INT, PDO::PARAM_INT);\n\n $any_sub = false;\n\n //make sure non-optional data is set\n if (!isset($this->id)) throw new Exception('id must be provided');\n if (!isset($this->updated_by)) throw new Exception('updated_by must be provided'); \n\n $update_string = \"updated_by=:ub\";\n \n //check if updateable data exists, sanitize it, build up the update string:\n //a) loop through the updateable parameters\n for ($i = 0; $i < count($col_names); $i++) {\n\n //b) if it is set, attempt to sanitize/check it for update\n if (isset($this->{$col_names[$i]})) {\n $any_sub = true;\n $sub_check[$i] = true;\n $update_string .= \", {$col_names[$i]}={$dat_param[$i]}\";\n\n //c) sanitize/check by type\n if ($sani_type[$i] === 'str') {\n $this->{$col_names[$i]} = htmlspecialchars(strip_tags($this->{$col_names[$i]}));\n\n } elseif ($sani_type[$i] === 'flag') {\n if ( !($this->{$col_names[$i]} === 0 || $this->{$col_names[$i]} === 1) ) {\n throw new Exception(\"{$col_names[$i]} must be either 0 or 1\");\n }\n } elseif ($sani_type[$i] === 'int') {\n if (filter_var($this->{$col_names[$i]}, FILTER_VALIDATE_INT) === false) {\n throw new Exception('category_id does not conform');\n }\n }\n }\n } \n\n if (!$any_sub) throw new Exception('no data was submitted for staff member update.');\n \n $sql = \"UPDATE \n {$this->table_name}\n SET\n {$update_string}\n WHERE\n id=:id\";\n\n $stmt = $this->conn->prepare($sql);\n \n //bind the non-optional data to the query\n $stmt->bindParam(':id', $this->id, PDO::PARAM_INT);\n $stmt->bindParam(':ub', $this->updated_by, PDO::PARAM_STR);\n\n //if the data was found and sanitized, then bind the data to the parameter\n for ($i=0; $i < count($col_names); $i++) { \n if ($sub_check[$i] === true) {\n $stmt->bindParam($dat_param[$i], $this->{$col_names[$i]}, $dat_types[$i]);\n }\n }\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function update($arr) {\n\t\tglobal $query, $wtcDB, $lang;\n\n\t\t$update = $wtcDB->massUpdate($arr);\n\n\t\t// Execute!\n\t\tnew Query($query['lang_words']['update'], Array(1 => $update, 2 => $this->wordid), 'query', false);\n\t\t\n\t\tLanguage::cache();\n\t}", "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}" ]
[ "0.7651236", "0.76098573", "0.74142003", "0.7406572", "0.7088397", "0.69487536", "0.68882394", "0.68782127", "0.6818406", "0.6692337", "0.66538024", "0.6647281", "0.660413", "0.65639263", "0.6557426", "0.65460145", "0.6539663", "0.6531155", "0.65224665", "0.6515195", "0.6497285", "0.64815694", "0.6478819", "0.6462466", "0.64596754", "0.64552945", "0.64438003", "0.6434346", "0.6419332", "0.64131874", "0.64075494", "0.63859653", "0.63618374", "0.63618374", "0.63618374", "0.6359881", "0.6356851", "0.63322645", "0.6321653", "0.6308994", "0.63075536", "0.63052344", "0.62993085", "0.6295458", "0.62716377", "0.62681013", "0.62581223", "0.6250884", "0.62280035", "0.62263656", "0.6220212", "0.62180185", "0.621346", "0.62125987", "0.6209847", "0.6186426", "0.61835045", "0.6182896", "0.6181477", "0.61765134", "0.6172755", "0.6166997", "0.6143894", "0.61414605", "0.6140012", "0.613838", "0.61375976", "0.61372524", "0.61364514", "0.613411", "0.6126143", "0.61250705", "0.61169356", "0.6114539", "0.6113509", "0.6109903", "0.6105141", "0.6101899", "0.60950315", "0.6093815", "0.60915893", "0.6091169", "0.60885584", "0.6084576", "0.608413", "0.60799587", "0.6079588", "0.60782", "0.6072615", "0.6069904", "0.6068347", "0.60595953", "0.6059357", "0.60567474", "0.6055481", "0.60500926", "0.60455316", "0.6039931", "0.60337245", "0.60285205" ]
0.6538181
17
$columns is a list of column names; or null or empty array for all columns.
public function mysql_select(database $db, array $columns=null, array $where=[], array $orderby=[], $flags=0) { // $where is an associative array of the form 'column_name'=>'value to match' // $orderby is a list of column names, which might be preceded by a sign. if(empty($columns)) $columns_list = '*'; else { $cl = []; $cls = []; foreach($columns as $col) if(isset($this->columns[$col])) { $cls[] = $col; $cl[] = $db->field($col); } if(empty($cl)) return false; $column_list = ' ('.implode(', ',$cl).')'; } $conditions = []; foreach($where as $col=>$val) { if(!isset($this->columns[$col])) continue; preg_match('/^([!~<=>]{0,3})(.*)/',$val,$m); $conditions[] = $this->columns[$col]->comp($db,$m[2],$m[1]); } $orders = []; foreach($orderby as $scol) { $col = trim($col,'+-'); if(!isset($this->columns[$col])) continue; $f = $db->field($col); if(substr($scol,0,1)=='-') $f.=' DESC'; if(substr($scol,0,1)=='+') $f.=' ASC'; $orders[] = $f; } return "SELECT ".$column_list." FROM ".$this->mysql_ref($db). (empty($conditions)?'':"\nWHERE\n\t".implode("\nAND\t",$conditions)). (empty($orders)?'':"\nORDER BY\n\t".implode(",\n\t",$orders)).";\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setColumns(array $columns);", "public function setColumns(array $columns);", "protected function columns(array $columns = []): array\n {\n if ( !empty( $columns ) ) {\n $this->_columns = $columns;\n }\n return $this->_columns ?? [];\n }", "public function setColumns($columns = \"*\")\n {\n //$sql = '';\n if ($columns == \"*\") {\n $this->select_list = '*';\n } elseif (!empty($columns)) {\n foreach ($columns as $item) {\n\n $this->select_list .= $item . ',';\n }\n $this->select_list = rtrim($this->select_list, ',');\n }\n// echo \"column set to \".$this->getColumns(); die;\n\n }", "public function admin_table_columns($_columns)\n {\n }", "function addColumns($columns)\n {\n if (is_array($columns)) {\n foreach ($columns as $column) {\n if (!isset($this->columns_list[$column])) {\n $this->columns[] = $column;\n $this->columns_list[$column] = 1;\n }\n }\n }\n else {\n if (!isset($this->columns_list[$columns])) {\n $this->columns[] = $columns;\n $this->columns_list[$columns] = 1;\n }\n }\n }", "public static function setColumns($columns) {\n\t\tself::$columns = $columns;\n\t}", "function ColumnNames($columnNames = null);", "public function setColumns($columns) {\n\t\t$this->columns = $columns;\n\t}", "public function all($columns = ['*']);", "private function setColumns(array $columns)\n {\n $this->columns = $columns;\n }", "public function setColumns($columns)\n {\n $this->columns = $columns;\n }", "public function all($columns = ['*'])\n {\n\n }", "public static function all($columns = ['*']);", "public function getValidColumns(array $columns);", "public function columns($columns = [])\n {\n if (0 === func_num_args()) {\n return $this->columns;\n }\n\n if (1 === func_num_args() && is_array($columns)) {\n foreach ($columns as $column => $label) {\n $this->column($column, $label);\n }\n\n return;\n }\n\n foreach (func_get_args() as $column) {\n $this->column($column);\n }\n }", "public function columns($columns = array('*'))\r\n {\r\n return call_user_func_array(array($this,'select'), func_get_args());\r\n }", "public function setColumns($columns)\n {\n $this->columns = array();\n $this->aliases = array();\n $this->customColumns = array();\n foreach ($columns as $columnIndex => $column) {\n // Is custom Column\n if (array_key_exists($column, $this->builtInCustomColumns) ||\n isset($this->columnProperties[$column]['callback'])) {\n if (array_key_exists($column, $this->builtInCustomColumns)) {\n $column = $this->builtInCustomColumns[$column];\n } elseif (isset($this->columnProperties[$column]['callback'])) {\n $column = $this->columnProperties[$column];\n unset($column['width']);\n }\n $this->addCustomColumn($column);\n } else {\n $alias = $this->getAliasColumn($column);\n // Check column alias or not\n if ($alias) {\n // Set alias columns\n $this->aliases[$alias] = $column;\n $columnIdentifier = $alias;\n } else {\n // Add prefix entity or table name to column name ( support column name only )\n $columnIdentifier = $this->addPrefixEntity($column);\n }\n $this->columns[] = $columnIdentifier;\n }\n }\n }", "public function toArray($columns=null) {}", "public function setColumns($columns)\n\t{\n\t\tif(false == is_array($columns))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tforeach($columns as $name => $options)\n\t\t{\n\t\t\t$column = new Column;\n\n\t\t\t$type = $this->getOptionByKey(\"type\", $options);\n\t\t\t$length = $this->getOptionByKey(\"length\", $options);\n\t\t\t$notNull = $this->getOptionByKey(\"notNull\", $options);\n\t\t\t$autoIncrement = $this->getOptionByKey(\"autoIncrement\", $options);\n\t\t\t$index = $this->getOptionByKey(\"index\", $options);\n\t\t\t$collate = $this->getOptionByKey(\"collate\", $options);\n\n\t\t\t$column->setName($name);\n\n\t\t\t// Set all options if set\n\t\t\tif(false != $type)\n\t\t\t{\n\t\t\t\t$column->setType($type);\n\t\t\t}\n\n\t\t\tif(false != $length)\n\t\t\t{\n\t\t\t\t$column->setLength($length);\n\t\t\t}\n\n\t\t\tif(false != $notNull)\n\t\t\t{\n\t\t\t\t$column->setNotNull($notNull);\n\t\t\t}\n\n\t\t\tif(false != $autoIncrement)\n\t\t\t{\n\t\t\t\t$column->setAutoIncrement($autoIncrement);\n\t\t\t}\n\n\t\t\tif(false != $index)\n\t\t\t{\n\t\t\t\t$column->setIndex($index);\n\t\t\t}\n\n\t\t\tif(false != $collate)\n\t\t\t{\n\t\t\t\t$column->setCollate($collate);\n\t\t\t}\n\n\t\t\t// Add column\n\t\t\t$this->columns[] = $column;\n\t\t}\n\n\t}", "public function set_columns( $columns ) {\n\n\t\t$date_column = $columns['date'];\n\t\t$author_column = $columns['author'];\n\n\t\tunset( $columns['date'] );\n\t\tunset( $columns['author'] );\n\n\t\t$columns['type'] = esc_html__( 'Type', 'elementskit' );\n\t\t$columns['condition'] = esc_html__( 'Conditions', 'elementskit' );\n\t\t$columns['date'] = $date_column;\n\t\t$columns['author'] = $author_column;\n\n\t\treturn $columns;\n\t}", "abstract protected function columns();", "public function select($columns = array('*'));", "public function setSearchColumns(array $columns);", "public function columns( $columns ) {\n\n\t\t// Removes columns.\n\n\t\tunset( $columns['date'] );\n\n\t\t// Adds columns.\n\n\t\t$new_columns = [\n\t\t\t'url' => __( 'URL', 'the-guide' ),\n\t\t\t'steps' => __( 'Steps', 'the-guide' ),\n\t\t\t'enabled' => __( 'Enabled', 'the-guide' ),\n\n\t\t\t'date' => __( 'Date' ), // Moves it back to the end.\n\t\t];\n\n\t\treturn array_merge( $columns, $new_columns );\n\t}", "public static function list_columns( $columns ) {\n\n\t\t/**\n\t\t * Remove some unwanted default columns, that does not provide any useful\n\t\t * information.\n\t\t */\n\t unset( $columns['author'] );\n\t\tunset( $columns['date'] );\n\t\tunset( $columns['taxonomy-drsa_campaigns'] );\n\n\t\t/**\n\t\t * Merge our custom columns with rest of default ones, and re-set column for\n\t\t * drsa_campaigns in new position.\n\t\t */\n\t\t$columns = array_merge( $columns,\n\t \tarray(\n\t\t\t\t'drsa_timing_start'\t\t\t\t=> __( 'Näyttö alkaa', 'dude-really-simple-ads' ),\n\t\t\t\t'drsa_timing_end'\t\t\t\t\t=> Dude_Really_Simple_Ads::ad_visibility_by_show_count() ? __( 'Näyttökertojen yläraja', 'dude-really-simple-ads' ) : __( 'Näyttö loppuu', 'dude-really-simple-ads' ),\n\t\t\t\t'drsa_placement'\t\t\t\t\t=> __( 'Mainospaikka', 'dude-really-simple-ads' ),\n 'taxonomy-drsa_campaigns' => __( 'Kampanja', 'dude-really-simple-ads' ),\n\t\t\t\t'drsa_stats'\t\t\t\t\t\t\t=> __( 'Luvut', 'dude-really-simple-ads' ),\n\t\t\t\t'drsa_src'\t\t\t\t\t\t\t\t=> __( 'Esikatselu', 'dude-really-simple-ads' ),\n\t\t\t)\n\t\t);\n\n if ( ! Dude_Really_Simple_Ads::enable_campaigns() ) {\n unset( $columns['taxonomy-drsa_campaigns'] );\n }\n\n return $columns;\n\t}", "public function getList(array $columns = SELECT_ALL);", "public function getAll($columns);", "function getColumns() {return $this->_columns;}", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->type = Column::STRING;\n $columns->text = Column::STRING + Column::NOT_NULL;\n }", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->oneId = OneABBR::columns()->id;\n $columns->createdAt = Column::TIMESTAMP;\n $columns->updatedAt = Column::TIMESTAMP;\n $columns->info = Column::create(Column::STRING)->setIndexed();\n }", "public function setColumns(array $columns)\n {\n $this->clearColumns();\n return $this->addColumns($columns);\n }", "abstract protected function columns(): array;", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'complete_name';\n\t\t\t$this->defaultColumns[] = 'address';\n\t\t\t$this->defaultColumns[] = 'city_id';\n\t\t\t$this->defaultColumns[] = 'province_id';\n\t\t\t$this->defaultColumns[] = 'post_code';\n\t\t\t$this->defaultColumns[] = 'house_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone';\n\t\t\t$this->defaultColumns[] = 'mobile_phone2';\n\t\t\t$this->defaultColumns[] = 'birth_place';\n\t\t\t$this->defaultColumns[] = 'birth_date';\n\t\t\t$this->defaultColumns[] = 'sex';\n\t\t\t$this->defaultColumns[] = 'religion';\n\t\t\t$this->defaultColumns[] = 'homepage';\n\t\t\t$this->defaultColumns[] = 'origin_status';\n\t\t\t$this->defaultColumns[] = 'origin_address';\n\t\t\t$this->defaultColumns[] = 'origin_city_id';\n\t\t\t$this->defaultColumns[] = 'origin_province_id';\n\t\t\t$this->defaultColumns[] = 'hobby';\n\t\t\t$this->defaultColumns[] = 'photo';\n\t\t\t$this->defaultColumns[] = 'status';\n\t\t\t$this->defaultColumns[] = 'child';\n\t\t\t$this->defaultColumns[] = 'is_data_changed';\n\t\t\t$this->defaultColumns[] = 'swt_users_id';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "abstract public function listColumns();", "public function getGridColumn($columns=null) {\r\n\t\tif($columns !== null) {\r\n\t\t\tforeach($columns as $val) {\r\n\t\t\t\t/*\r\n\t\t\t\tif(trim($val) == 'enabled') {\r\n\t\t\t\t\t$this->defaultColumns[] = array(\r\n\t\t\t\t\t\t'name' => 'enabled',\r\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\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$this->defaultColumns[] = $val;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//$this->defaultColumns[] = 'book_id';\r\n\t\t\t$this->defaultColumns[] = 'publish';\r\n\t\t\t$this->defaultColumns[] = 'publisher_id';\r\n\t\t\t$this->defaultColumns[] = 'isbn';\r\n\t\t\t$this->defaultColumns[] = 'title';\r\n\t\t\t$this->defaultColumns[] = 'description';\r\n\t\t\t$this->defaultColumns[] = 'cover';\r\n\t\t\t$this->defaultColumns[] = 'edition';\r\n\t\t\t$this->defaultColumns[] = 'publish_city';\r\n\t\t\t$this->defaultColumns[] = 'publish_year';\r\n\t\t\t$this->defaultColumns[] = 'paging';\r\n\t\t\t$this->defaultColumns[] = 'sizes';\r\n\t\t\t$this->defaultColumns[] = 'creation_date';\r\n\t\t\t$this->defaultColumns[] = 'creation_id';\r\n\t\t\t$this->defaultColumns[] = 'modified_date';\r\n\t\t\t$this->defaultColumns[] = 'modified_id';\r\n\t\t}\r\n\r\n\t\treturn $this->defaultColumns;\r\n\t}", "public function addHeaderColumns($columns)\n {\n return $columns;\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function columnsUpdate($columns){\n $columns = explode(\",\",$columns);\n $resultColomnsUpdate=\"\";\n foreach ($columns as $col) {\n $resultColomnsUpdate.= $col.\" = ? , \";\n }\n $resultColomnsUpdate = substr($resultColomnsUpdate, 0, -2);\n return $resultColomnsUpdate;\n }", "public function select($columns);", "function sunset_set_columns_list($columns)\n{\n unset($columns['title']);\n unset($columns['date']);\n unset($columns['author']);\n\n $columns['title'] = 'Full Name';\n $columns['message'] = 'Message';\n $columns['email'] = 'Email';\n $columns['date'] = 'Date';\n\n return $columns;\n}", "public function returning($columns);", "public function findAll(array $columns = ['*']);", "public function __construct(Array $columns)\n {\n $this->Columns = $columns;\n }", "public static function contributor_list_table_search_db_columns($columns) {\n\t\t$columns[] = 'flattr';\n\t\treturn $columns;\n\t}", "public function setColumns($columns)\n {\n $columns = MySQLParser::Columns($columns);\n if($columns) $this->columns = $columns;\n return (bool)($columns);\n }", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'title';\n\t\t\t$this->defaultColumns[] = 'alias_url';\n\t\t\t$this->defaultColumns[] = 'description';\n\t\t\t$this->defaultColumns[] = 'image';\n\t\t\t$this->defaultColumns[] = 'image_position';\n\t\t\t$this->defaultColumns[] = 'published';\n\t\t\t$this->defaultColumns[] = 'ordering';\n\t\t\t$this->defaultColumns[] = 'access';\n\t\t\t$this->defaultColumns[] = 'params';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'subject';\n\t\t\t$this->defaultColumns[] = 'messege';\n\t\t\t$this->defaultColumns[] = 'from_user_id';\n\t\t\t$this->defaultColumns[] = 'from_user_name';\n\t\t\t$this->defaultColumns[] = 'to_user_id';\n\t\t\t$this->defaultColumns[] = 'to_user_name';\n\t\t\t$this->defaultColumns[] = 'is_read';\n\t\t\t$this->defaultColumns[] = 'sent_time';\n\t\t\t$this->defaultColumns[] = 'is_deleted_by_sender';\n\t\t\t$this->defaultColumns[] = 'is_deleted_by_receiver';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "protected static function getColumn( $columns ) {\n\n\t\tif ( $columns && is_array( $columns ) ) {\n\t\t\t$column = '';\n\n\t\t\tforeach ( $columns AS &$value ) {\n\n\t\t\t\tif ( '*' != $value\n\t\t\t\t\t\t&& false === strpos( $value, '(')\n\t\t\t\t\t\t&& false === strpos( $value, ')' ) ) {\n\t\t\t\t//特殊查询列不加`号\n\n\t\t\t\t\t$value = '`' . $value . '`';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$column = implode( ',', $columns );\n\t\t}\n\t\telse {\n\t\t\t$column = '*';\n\t\t}\n\n\t\treturn $column;\n\t}", "public function __construct(\r\n array $columns = []\r\n ) {\r\n $this->lastError = '';\r\n $this->columns = [];\r\n foreach ($columns as $id => $rules) {\r\n $this->addColumn($id, $rules);\r\n }\r\n }", "public function add_columns($columns)\r\n\t{\r\n\t\tforeach ($columns as $column) {\r\n\t\t\t$this->add_column($column);\r\n\t\t}\r\n\t}", "public function findAll( array $columns = ['*'] );", "public function set_columns($cols) { $this->cols = $cols + 0; }", "public static function contributor_list_table_columns($columns) {\n\t\treturn \\Podlove\\PHP\\array_insert($columns, 'episodes', ['flattr' => __('Flattr', 'podlove-podcasting-plugin-for-wordpress')]);\n\t}", "public function first(array $columns = ['*'])\n {\n }", "public function dtPerformColumnFilter($columns);", "static function setUpColumns($columns)\n {\n $columns->id = Column::AUTO_ID;\n $columns->name = Column::create(Column::STRING + Column::NOT_NULL)->setUnique();\n $columns->address = Column::STRING;\n $columns->createdAt = Column::TIMESTAMP;\n }", "function ganesh_set_ganesh_contact_columns($columns){\r\n\t$newColumns = array();\r\n\t$newColumns['title'] = 'Full Name';\r\n\t$newColumns['message'] = 'Message';\r\n\t$newColumns['email'] = 'Email';\r\n\t$newColumns['date'] = 'Date';\r\n\treturn $newColumns;\r\n}", "public function setColumns(...$columns)\n {\n $this->columns = [];\n\n foreach ($columns as $column) {\n if (is_string($column))\n $this->addColumn($column);\n elseif (is_array($column)) {\n $this->addColumnsFromArray($column);\n } else\n throw new InvalidArgumentException(\"Argument should be a string or array\");\n }\n\n if (!$columns)\n $this->addColumn('*');\n\n return $this;\n }", "function kt_invoices_columns_add($columns) {\n\tunset($columns['date']);\n\t// unset($columns['package']);\n\tunset($columns['price']);\n\tunset($columns['payment_option']);\n\tunset($columns['title']);\n\t$columns['user'] \t\t= pll__('User','docdirect_core');\n\t$columns['package'] \t\t\t= pll__('Package','docdirect_core');\n\t$columns['payment_option'] \t\t= pll__('Payment Method','docdirect_core');\n\t$columns['price'] \t\t= pll__('Price','docdirect_core');\n \n\t\treturn $columns;\n}", "public function set_custom_column( $columns )\n {\n /* We are going to rearrange the information */\n $title = $columns['title'];\n $date = $columns['date'];\n unset ( $columns['title'] , $columns['date'] );\n\n $columns['name'] = 'Author Name';\n $columns['title'] = $title;\n $columns['approved'] = 'Approved';\n $columns['featured'] = 'Featured';\n $columns['date'] = $date;\n return ( $columns );\n }", "public function validate ($columns = null)\n {\n return true;\n }", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t//$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'bank_id';\n\t\t\t$this->defaultColumns[] = 'account_number';\n\t\t\t$this->defaultColumns[] = 'owner_name_alias';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "public static function add_column(array $columns): array {\r\n\t\t\r\n\t\t$columns = array_merge(\r\n\t\t\t$columns, \r\n\t\t\t// drama per object\r\n\t\t\t[Drama_Manager::DRAMA_META => self::get_column_name()],\r\n\t\t);\r\n\t\t\r\n\t\treturn $columns;\r\n\t}", "public function getColumns()\n {\n // code...\n return $this->__COLUMNS__ ?? [];\n }", "public function setColumns()\r\n\t{\r\n\t\t$columns = array_filter($this->getRules(), function($rule) {\r\n\t\t\tif($rule instanceof ColumnInterface) {\r\n\t\t\t\treturn $rule;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t$columns = array_map(function(ColumnInterface $rule) {\r\n\t\t\treturn $rule->getTitle();\r\n\t\t}, $columns);\r\n\r\n\t\t$this->columns = $columns;\r\n\t}", "protected function loadColumns(){\n\t\t\t$this->columns = array_diff(\n\t\t\t\tarray_keys(get_class_vars($this->class)),\n\t\t\t\t$this->getIgnoreAttributes()\n\t\t\t);\n\t\t}", "public function getColumns()\r\n {\r\n }", "public function setColumns(array $columns): void\n {\n foreach ($columns as $column => [$type, $size]) {\n $this->columns[$column] = [(int)$type, (int)$size];\n }\n }", "public static function manage_sortable_columns( $columns ) {\n unset( $columns['wpseo-focuskw'] );\n unset( $columns['wpseo-score'] );\n unset( $columns['wpseo-title'] );\n unset( $columns['wpseo-metadesc'] );\n unset( $columns['date'] );\n $columns['expiration'] = 'expiration';\n $columns['registrar'] = 'registrar';\n return $columns;\n }", "public function setColumns(array $columns)\n {\n $this->_columns = $columns;\n return $this;\n }", "public function add_new_columns($columns){\n $column_meta = array( 'username' => __( 'Username', 'drophtml' ) );\n $columns = array_slice( $columns, 0, 6, true ) + $column_meta + array_slice( $columns, 6, NULL, true );\n return $columns;\n }", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getGridColumn($columns=null) {\n\t\tif($columns !== null) {\n\t\t\tforeach($columns as $val) {\n\t\t\t\t/*\n\t\t\t\tif(trim($val) == 'enabled') {\n\t\t\t\t\t$this->defaultColumns[] = array(\n\t\t\t\t\t\t'name' => 'enabled',\n\t\t\t\t\t\t'value' => '$data->enabled == 1? \"Ya\": \"Tidak\"',\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\t$this->defaultColumns[] = $val;\n\t\t\t}\n\t\t}else {\n\t\t\t$this->defaultColumns[] = 'id';\n\t\t\t$this->defaultColumns[] = 'group_login';\n\t\t\t$this->defaultColumns[] = 'group_name';\n\t\t\t$this->defaultColumns[] = 'name';\n\t\t\t$this->defaultColumns[] = 'params';\n\t\t}\n\n\t\treturn $this->defaultColumns;\n\t}", "function overview_columns($columns) {\r\n\r\n $overview_columns = apply_filters('wpi_overview_columns', array(\r\n 'cb' => '',\r\n 'post_title' => __('Title', WPI),\r\n 'total' => __('Total Collected', WPI),\r\n 'user_email' => __('Recipient', WPI),\r\n 'post_modified' => __('Date', WPI),\r\n 'post_status' => __('Status', WPI),\r\n 'type' => __('Type', WPI),\r\n 'invoice_id' => __('Invoice ID', WPI)\r\n ));\r\n\r\n /* We need to grab the columns from the class itself, so we instantiate a new temp object */\r\n foreach ($overview_columns as $column => $title) {\r\n $columns[$column] = $title;\r\n }\r\n\r\n return $columns;\r\n }", "protected function getColumns(): array\n {\n if (is_null(self::$_columns)) {\n self::$_columns = parent::addColumns();\n }\n return self::$_columns;\n }", "protected function parseColumns(array $columns): string\n {\n // define string\n $sql = '';\n\n if (!empty($columns)) {\n $i = 0;\n foreach ($columns as $column => $label) {\n // add trailing comma\n $sql .= ($i != 0 ? ', ' : '');\n\n // check for AS syntax\n if (is_int($column)) {\n list($table, $column) = $this->parseColumn($label);\n $label = $column;\n } else {\n list($table, $column) = $this->parseColumn($column);\n }\n\n // Build SQL\n $sql .= $table . '.' . $column . ' AS ' . $table . self::COLUMN_SEPERATOR . $column . self::ALIAS_SEPERATOR . $label;\n\n $i++;\n }\n } else {\n // Empty column selection are not supported - there breaking the parsing\n $this->log(new ConnectionException('Empty column selections are not supported!'), Environment::E_LEVEL_ERROR);\n\n // return an empty string if exceptions are disabled\n return '';\n }\n\n // return string\n return $sql;\n }", "public function columns($columns = '*'): self\n {\n return $this->select($columns);\n }", "public function define_columns( $columns ) {\n\t\tif ( empty( $columns ) && ! is_array( $columns ) ) {\n\t\t\t$columns = array();\n\t\t}\n\n\t\tunset( $columns['title'], $columns['comments'], $columns['date'] );\n\n\t\t$show_columns = array();\n\t\t$show_columns['cb'] = '<input type=\"checkbox\" />';\n\t\t$show_columns['thumb'] = '<span class=\"wc-image tips\" data-tip=\"' . esc_attr__( 'Image', 'woocommerce' ) . '\">' . __( 'Image', 'woocommerce' ) . '</span>';\n\t\t$show_columns['name'] = __( 'Name', 'woocommerce' );\n\n\t\tif ( wc_product_sku_enabled() ) {\n\t\t\t$show_columns['sku'] = __( 'SKU', 'woocommerce' );\n\t\t}\n\n\t\tif ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) {\n\t\t\t$show_columns['is_in_stock'] = __( 'Stock', 'woocommerce' );\n\t\t}\n\n\t\t$show_columns['price'] = __( 'Price', 'woocommerce' );\n\t\t$show_columns['product_cat'] = __( 'Categories', 'woocommerce' );\n\t\t$show_columns['product_tag'] = __( 'Tags', 'woocommerce' );\n\t\t$show_columns['featured'] = '<span class=\"wc-featured parent-tips\" data-tip=\"' . esc_attr__( 'Featured', 'woocommerce' ) . '\">' . __( 'Featured', 'woocommerce' ) . '</span>';\n\t\t$show_columns['date'] = __( 'Date', 'woocommerce' );\n\n\t\treturn array_merge( $show_columns, $columns );\n\t}", "protected function exportExtendColumns($columns)\n {\n return $columns;\n }", "public function columns(array $columns): self {\n\t\t$this->columns = array_values($columns);\n\n\t\treturn $this;\n\t}", "public function all(array $columns = ['*']): Collection;", "protected function guessColumns()\n {\n $models = $this->dataProvider->getModels();\n $model = reset($models);\n if (is_array($model) || is_object($model)) {\n foreach ($model as $name => $value) {\n if ($value === null || is_scalar($value) || is_callable([$value, '__toString'])) {\n $this->columns[] = (string) $name;\n }\n }\n }\n }", "public function setAllowSearchColumn($columns){\n\t\tif(is_array($columns))\n\t\t{\n\t\t\tforeach($columns AS $column)\n\t\t\t{\n\t\t\t\t$this->allowSearchColumns[] = $this->tablename . \".\" . $column;\n\t\t\t}\n\t\t} else {\n\t\t\t$this->allowSearchColumns[] = $this->tablename . \".\" . $columns;\n\t\t}\n\t}", "static function getColumns()\n {\n }", "public function columns(array $columns)\n {\n $this->_columns = array_merge($this->_columns, $columns);\n return $this;\n }", "public function column_headers( $columns = array() ) {\n\t\t\t$new_columns = array(\n\t\t\t\t'cat_talks' => _x( 'Categories', 'talks admin category column header', 'wordcamp-talks' ),\n\t\t\t\t'tag_talks' => _x( 'Tags', 'talks admin tag column header', 'wordcamp-talks' ),\n\t\t\t);\n\n\t\t\tif ( ! wct_is_rating_disabled() ) {\n\t\t\t\t$new_columns['rates'] = '<span class=\"vers\"><span title=\"' . esc_attr__( 'Average Rating', 'wordcamp-talks' ) .'\" class=\"talk-rating-bubble\"></span></span>';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * @param array $new_columns the specific columns\n\t\t\t */\n\t\t\t$new_columns = apply_filters( 'wct_admin_column_headers', $new_columns );\n\n\t\t\t$temp_remove_columns = array( 'comments', 'date' );\n\t\t\t$has_columns = array_intersect( $temp_remove_columns, array_keys( $columns ) );\n\n\t\t\t// Reorder\n\t\t\tif ( $has_columns == $temp_remove_columns ) {\n\t\t\t\t$new_columns['comments'] = $columns['comments'];\n\t\t\t\t$new_columns['date'] = $columns['date'];\n\t\t\t\tunset( $columns['comments'], $columns['date'] );\n\t\t\t}\n\n\t\t\t// Merge\n\t\t\t$columns = array_merge( $columns, $new_columns );\n\n\n\t\t\tif ( ! empty( $this->downloading_csv ) ) {\n\t\t\t\tunset( $columns['cb'], $columns['date'] );\n\n\t\t\t\tif ( ! empty( $columns['title'] ) ) {\n\t\t\t\t\t$csv_columns = array(\n\t\t\t\t\t\t'title' => $columns['title'],\n\t\t\t\t\t\t'talk_content' => esc_html_x( 'Content', 'downloaded csv content header', 'wordcamp-talks' ),\n\t\t\t\t\t\t'talk_link' => esc_html_x( 'Link', 'downloaded csv link header', 'wordcamp-talks' ),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$columns = array_merge( $csv_columns, $columns );\n\n\t\t\t\t// Replace dashicons to text\n\t\t\t\tif ( ! empty( $columns['comments'] ) ) {\n\t\t\t\t\t$columns['comments'] = esc_html_x( '# comments', 'downloaded csv comments num header', 'wordcamp-talks' );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['rates'] ) ) {\n\t\t\t\t\t$columns['rates'] = esc_html_x( 'Average rating', 'downloaded csv rates num header', 'wordcamp-talks' );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * User this filter to only add columns for the downloaded csv file\n\t\t\t\t *\n\t\t\t\t * @param array $columns the columns specific to the csv output\n\t\t\t\t */\n\t\t\t\t$columns = apply_filters( 'wct_admin_csv_column_headers', $columns );\n\t\t\t}\n\n\t\t\treturn $columns;\n\t\t}", "private function columnHeader(array $columns)\n {\n if (is_array($columns)) {\n $columns[Launcher::SLUG.'_status'] = __('Rejected Status', 'reject-notify');\n }\n\n return $columns;\n }", "function type_column_header( $columns ) {\r\n\t\tunset( $columns['date'] );\r\n\t\treturn $columns;\r\n\t}", "public function first($columns = ['*']);" ]
[ "0.74022114", "0.733141", "0.73166895", "0.72951746", "0.7202835", "0.7135698", "0.713421", "0.70865303", "0.7064822", "0.70646155", "0.70634896", "0.70590675", "0.7028957", "0.7003866", "0.69968444", "0.6993338", "0.6901982", "0.67878973", "0.67622983", "0.674821", "0.67087114", "0.6700518", "0.6694517", "0.6674616", "0.6653116", "0.66518897", "0.66308254", "0.66284436", "0.6623146", "0.6595281", "0.6583112", "0.65681696", "0.65614814", "0.65586376", "0.6549243", "0.65484285", "0.6546174", "0.6534474", "0.6534474", "0.6533591", "0.6533591", "0.6533591", "0.6533591", "0.65283453", "0.6524164", "0.65207165", "0.65139896", "0.6513197", "0.650097", "0.64965487", "0.6496538", "0.64942634", "0.6476066", "0.646514", "0.64651364", "0.64647335", "0.64414704", "0.64378935", "0.642903", "0.64184386", "0.6412133", "0.64078885", "0.6377439", "0.6375308", "0.6360384", "0.6358165", "0.63442713", "0.6341979", "0.63200253", "0.6318696", "0.6314329", "0.6296606", "0.62926257", "0.6290042", "0.62898356", "0.6287729", "0.62849826", "0.6283858", "0.6283858", "0.6283858", "0.6283858", "0.6283858", "0.6283858", "0.6283858", "0.6283497", "0.62746716", "0.62634534", "0.62531614", "0.62475735", "0.6245913", "0.6238044", "0.6231978", "0.6214215", "0.6213532", "0.6213319", "0.62086284", "0.6202144", "0.6199695", "0.61964273", "0.6181102", "0.61711705" ]
0.0
-1
/ Plugin Name: BuddyPress Block Activity Stream Types Plugin URI: Description: Blocks an activity record (based on types) from being saved to the database
function etivite_bp_activity_block_init() { require( dirname( __FILE__ ) . '/bp-activity-block.php' ); if ( file_exists( dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' ) ) { load_textdomain( 'bp-activity-block', dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bp_register_activity_actions()\n {\n Fossil::register_buddypress_activities( Fossil::POST_TYPE );\n FossilDimension::register_buddypress_activities( FossilDimension::POST_TYPE );\n FossilLocation::register_buddypress_activities( FossilLocation::POST_TYPE );\n Stratum::register_buddypress_activities( Stratum::POST_TYPE );\n Taxon::register_buddypress_activities( Taxon::POST_TYPE );\n FossilTaxa::register_buddypress_activities( FossilTaxa::POST_TYPE );\n TimeInterval::register_buddypress_activities( TimeInterval::POST_TYPE );\n }", "function bp_register_activity_actions() {\n\tdo_action( 'bp_register_activity_actions' );\n}", "function bp_mpo_activity_filter( $a, $activities ) {\n\tglobal $bp;\n\n\tif ( is_super_admin() )\n\t\treturn $activities;\n\n\tforeach ( $activities->activities as $key => $activity ) {\n\t\tif ( $activity->type == 'new_blog_post' || $activity->type == 'new_blog_comment' ) {\n\n\t\t\t$current_user = $bp->loggedin_user->id;\n\n\t\t\t// Account for bp-groupblog\n\t\t\tif ( $activity->component == 'groups' ) {\n\t\t\t\t$group_id = $activity->item_id;\n\t\t\t\t$blog_id = groups_get_groupmeta( $group_id, 'groupblog_blog_id' );\n\t\t\t} else {\n\t\t\t\t$blog_id = $activity->item_id;\n\t\t\t}\n\n\t\t\t$privacy = get_blog_option( $blog_id, 'blog_public' );\n\n\t\t\t$remove_from_stream = false;\n\n\t\t\tswitch ( $privacy ) {\n\t\t\t\tcase '1':\n\t\t\t\t\tcontinue;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '0':\n\t\t\t\t\tif ( $current_user != 0 ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$remove_from_stream = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase '-1':\n\t\t\t\t\tif ( $current_user != 0 )\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$remove_from_stream = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '-2':\n\t\t\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t\t\t$meta_key = 'wp_' . $blog_id . '_capabilities';\n\t\t\t\t\t\t$caps = get_user_meta( $current_user, $meta_key, true );\n\n\t\t\t\t\t\tif ( !empty( $caps ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$remove_from_stream = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$remove_from_stream = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '-3':\n\t\t\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t\t\tswitch_to_blog( $blog_id );\n\n\t\t\t\t\t\t$user = new WP_User( $current_user );\n\n\t\t\t\t\t\tif ( in_array( 'administrator', $user->roles ) )\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$remove_from_stream = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trestore_current_blog();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$remove_from_stream = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tif ( $remove_from_stream ) {\n\t\t\t\t$activities->activity_count = $activities->activity_count - 1;\n\t\t\t\tunset( $activities->activities[$key] );\n\n\t\t\t}\n\t\t}\n\t}\n\n\t$activities_new = array_values( $activities->activities );\n\t$activities->activities = $activities_new;\n\n\treturn $activities;\n}", "public function activityFeedAction() {\n // GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_activity_feed');\n $aafmodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('advancedactivity');\n if(!empty ($aafmodule))\n $this->view->isAAFModule=true;\n //FILTER FORM\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_ActivityFeed();\n //CHECK POST\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n $api = Engine_Api::_()->getApi(\"settings\", \"core\");\n foreach ($values as $key => $value) {\n $api->setSetting($key, $value);\n }\n $enable = $form->sitestore_feed_type->getValue();\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $activityfeed_array = array(\"sitestorealbum_admin_photo_new\", \"sitestoredocument_admin_new\", \"sitestoreevent_admin_new\", \"sitestoremusic_admin_new\", \"sitestorenote_admin_new\", \"sitestoreoffer_admin_new\", \"sitestorepoll_admin_new\", \"sitestorevideo_admin_new\", \"sitestore_admin_topic_create\", \"sitestore_admin_topic_reply\");\n foreach ($activityfeed_array as $value) {\n $activit_type_sql = \"UPDATE `engine4_activity_actiontypes` SET `enabled` = $enable WHERE `engine4_activity_actiontypes`.`type` = '$value' LIMIT 1\";\n $db->query($activit_type_sql);\n }\n }\n }", "public function i_add_the_cul_activity_feed_block() {\n try {\n // Try with pluginname (Boost flat navigation).\n $this->execute('behat_blocks::i_add_the_block', ['CUL Activity Feed']);\n } catch (Exception $e) {\n // Try with block title (Classic Add a block).\n try {\n $this->execute('behat_blocks::i_add_the_block', ['Activity feed']);\n } catch (Exception $e) {\n $this->execute('behat_blocks::i_add_the_block', ['Module updates']);\n }\n }\n }", "public function publish_to_stream($activity)\n {\n\n }", "public function registerBlock()\n {\n register_block_type( 'mtk-plugin/cptshortcode' , array (\n 'editor_script' => 'mtk_cptshortcode_editor',\n 'editor_style' => 'mtk_cptshortcode_editor',\n 'style' => 'mtk_cptshortcode',\n ) );\n\n }", "function pushActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access,$integration_option,$params='')\n\t{\n\t\t$activityintegrationstream= new activityintegrationstream();\n\t\tif($integration_option=='joomla')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if($integration_option=='Community Builder')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_comprofiler');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToCBActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='JomSocial' )\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_community');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToJomsocialActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='Jomwall')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_awdwall');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToJomwallActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access,$params);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='EasySocial')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_easysocial');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToEasySocialActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function f1_api_feed_block_handler($atts)\n{\n\treturn f1_api_feed();\n}", "function bp_activity_action_spam_activity( $activity_id = 0 ) {\n\tglobal $bp;\n\n\t// Not viewing activity, or action is not spam, or Akismet isn't present\n\tif ( !bp_is_activity_component() || !bp_is_current_action( 'spam' ) || empty( $bp->activity->akismet ) )\n\t\treturn false;\n\n\tif ( empty( $activity_id ) && bp_action_variable( 0 ) )\n\t\t$activity_id = (int) bp_action_variable( 0 );\n\n\t// Not viewing a specific activity item\n\tif ( empty( $activity_id ) )\n\t\treturn false;\n\n\t// Is the current user allowed to spam items?\n\tif ( !bp_activity_user_can_mark_spam() )\n\t\treturn false;\n\n\t// Load up the activity item\n\t$activity = new BP_Activity_Activity( $activity_id );\n\tif ( empty( $activity->id ) )\n\t\treturn false;\n\n\t// Check nonce\n\tcheck_admin_referer( 'bp_activity_akismet_spam_' . $activity->id );\n\n\t// Call an action before the spamming so plugins can modify things if they want to\n\tdo_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity );\n\n\t// Mark as spam\n\tbp_activity_mark_as_spam( $activity );\n\t$activity->save();\n\n\t// Tell the user the spamming has been succesful\n\tbp_core_add_message( __( 'The activity item has been marked as spam and is no longer visible.', 'buddypress' ) );\n\n\tdo_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id );\n\n\t// Check for the redirect query arg, otherwise let WP handle things\n \tif ( !empty( $_GET['redirect_to'] ) )\n\t\tbp_core_redirect( esc_url( $_GET['redirect_to'] ) );\n\telse\n\t\tbp_core_redirect( wp_get_referer() );\n}", "public function changetypeAction()\n {\n \t// disable view rendering\n \t//$this->_helper->viewRenderer->setNoRender();\n \t// check for lead type and lead id\n\t\t$this->leadType = $this->_request->getParam('type',null);\n\t\t$this->leadId = $this->_request->getParam('id',null);\n\n\t\tif (!$this->leadType) {\n\t\t\t$this->_redirect('error/show/?NO_LEAD_TYPE');\n\t\t}\n\t\tif (!$this->leadId) {\n\t\t\t$this->_redirect('error/show/?NO_LEAD_ID');\n\t\t}\n\n\t\t$db = Zend_Registry::get('db');\n\n\t\t// if we have post, we need to change lead\n\t\tif ($this->_request->isPost()) {\n\t\t\tif ($this->leadType == 'leads') {\n\t\t\t\t$leadData = $db->fetchRow('SELECT * FROM leads WHERE id = '.$this->leadId);\n\t\t\t\tif (!$leadData) {\n\t\t\t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=CHANGE_TYPE_FAIL');\n\t\t\t\t}\n\n\t\t\t\t//$leadData['total_amount'] = $this->_request->getParam('total_amount','');\n\t\t\t\t$leadData['ev_day_cname'] = $this->_request->getParam('ev_day_cname','');\n\t\t\t\t$leadData['ev_day_cno'] = $this->_request->getParam('ev_day_cno','');\n\t\t\t\t$leadData['event_date'] = $this->_request->getParam('event_date','');\n\t\t\t\t$leadData['approval'] = 'change';\n\t\t\t\tunset($leadData['id']);\n\t\t\t\tunset($leadData['next_followup']);\n\n\t\t\t\t// move the lead to enrollments table\n\t\t\t\tif (!$db->insert('booked',$leadData)) {\n\t\t\t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=CHANGE_TYPE_FAIL');\n\t\t\t\t}\n\t\t\t\t$newLeadId = $db->lastInsertId();\n\t\t\t\t// delete the lead from leads table\n\t\t\t\t$db->delete('leads','id = '.$this->leadId);\n\n\t\t\t\t// update data in the communication table\n\t\t\t\t$db->update('communication',array('user_id' => $newLeadId, 'user_type' => 'booked'),'user_id = '.$this->leadId.' AND user_type = \\'leads\\'');\n\t\t\t\t// update data in the payments table\n\t\t\t\t$db->update('payments',array('user_id' => $newLeadId, 'user_type' => 'booked'),'user_id = '.$this->leadId.' AND user_type = \\'leads\\'');\n\t\t\t\t// update data in the quotes table\n\t\t\t\t$db->update('quotes',array('user_id' => $newLeadId, 'user_type' => 'booked'),'user_id = '.$this->leadId.' AND user_type = \\'leads\\'');\n\n\t\t\t\t$this->_redirect('booked?message=CHANGE_STATUS');\n\t\t\t}\n\t\t}\n\n\t\t// cancel cold or dead lead\n \tif ($this->_request->__isset('nocold')) {\n \t\tif (!$db->update($this->leadType,array('cold_lead' => '0'),'id = '.$this->leadId))\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=CHANGE_TYPE_FAIL');\n \t\telse\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&message=CHANGE_TYPE_SUCC');\n \t}\n\n\t\t// mark as cold lead\n \tif ($this->_request->__isset('tocold')) {\n \t\tif (!$db->update($this->leadType,array('cold_lead' => '1'),'id = '.$this->leadId))\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=TO_COLDLEAD_FAIL');\n \t\telse\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&message=TO_COLDLEAD_SUCC');\n \t}\n\n \t// mark as dead lead\n \tif ($this->_request->__isset('todead')) {\n \t\tif (!$db->update($this->leadType,array('cold_lead' => '2'),'id = '.$this->leadId))\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=TO_DEADLEAD_FAIL');\n \t\telse\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&message=TO_DEADLEAD_SUCC');\n \t}\n\n \t// display a form for type change\n \t$this->view->leadType = $this->leadType;\n \t$this->view->leadId = $this->leadId;\n\n \t// get the event date\n \t// fetch event date if quote exists\n \t$evDate = $db->fetchOne('SELECT event_date FROM quotes WHERE user_id = ' . $this->leadId . ' LIMIT 1');\n \t$this->view->formData = array();\n \t$this->view->formData['event_date'] = !empty($evDate) ? $evDate : '';\n }", "public function activityVerb()\n {\n return 'post';\n }", "protected function validateType(array $type):void {\n if(count(array_intersect(array_map('strtolower', $type), ACTIVITIES)) > 0) {\n if (isset($this->logger))\n $this->logger->warning(\"(UId: '\" . $this->getId() . \"')\"\n . \"Does not have an Activity Stream 2.0 Activity Type.\");\n\n }\n }", "function bp_activity_action_sitewide_feed() {\n\tglobal $bp;\n\n\tif ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) )\n\t\treturn false;\n\n\t// setup the feed\n\tbuddypress()->activity->feed = new BP_Activity_Feed( array(\n\t\t'id' => 'sitewide',\n\n\t\t/* translators: Sitewide activity RSS title - \"[Site Name] | Site Wide Activity\" */\n\t\t'title' => sprintf( __( '%s | Site Wide Activity', 'buddypress' ), bp_get_site_name() ),\n\n\t\t'link' => bp_get_activity_directory_permalink(),\n\t\t'description' => __( 'Activity feed for the entire site.', 'buddypress' ),\n\t\t'activity_args' => 'display_comments=threaded'\n\t) );\n}", "function bigbluebuttonbn_get_recent_mod_activity(&$activities, &$index, $timestart, $courseid, $cmid, $userid=0, $groupid=0) {\n}", "public function ct_fb_mapping(){\n if (!defined('WPB_VC_VERSION')) {\n return;\n }\n\n // Map the block with vc_map()\n vc_map(\n array(\n 'name' => __('CT Facebook Feeds', 'text-domain'),\n 'base' => 'ct_facebook',\n 'description' => __('Displaying facebook feeds', 'text-domain'),\n 'category' => __('CT Test Plugins', 'text-domain'),\n 'params' => array(\n array(\n 'type' => 'dropdown',\n 'heading' => 'Style',\n 'description'=> 'Select widget coloristic style',\n 'param_name' => 'style',\n 'value' => array( '', 'dark', 'light' )\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Page ID',\n 'description' => 'Your Facebook Fan Paged ID',\n 'param_name' => 'id',\n 'value' => ''\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Access Token',\n 'description' => 'Access Token is needed to conect with Facebook API and so on to take page posts content',\n 'param_name' => 'access_token',\n 'value' => ''\n ),\n\n array(\n 'type' => 'checkbox',\n 'heading' => 'Embed Images',\n 'description' => 'Check for embeding images to feeds',\n 'param_name' => 'embed_images',\n 'value' => 'false'\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Posts Limit',\n 'description' => 'Limit of displaying posts',\n 'param_name' => 'limit',\n 'value' => 3\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Char Limit',\n 'description' => 'Limit of displaying chars per post',\n 'param_name' => 'length_limit',\n 'value' => 100\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Cache',\n 'description' => 'How often widget has got to refresh (in seconds)? Default it is 300 seconds',\n 'param_name' => 'cache',\n 'value' => 300\n )\n ),\n )\n );\n }", "public function activityVerb();", "public function displayAjaxSaveBlockContent()\n {\n $errors = [];\n\n $picto = Tools::getValue('picto');\n $id_block = empty(Tools::getValue('id_block')) ? null : Tools::getValue('id_block');\n $type_link = (int) Tools::getValue('typelink');\n $id_cms = Tools::getValue('id_cms');\n $psr_languages = (array) json_decode(Tools::getValue('lang_values'));\n\n $blockPsr = new ReassuranceActivity($id_block);\n if (!$id_block) {\n // Last position\n $blockPsr->position = Db::getInstance()->getValue('SELECT MAX(position) AS max FROM ' . _DB_PREFIX_ . 'psreassurance');\n $blockPsr->position = $blockPsr->position ? $blockPsr->position + 1 : 1;\n $blockPsr->status = false;\n }\n $blockPsr->handleBlockValues($psr_languages, $type_link, $id_cms);\n $blockPsr->icon = $picto;\n if (empty($picto)) {\n $blockPsr->custom_icon = '';\n }\n $blockPsr->date_add = date('Y-m-d H:i:s');\n $blockPsr->date_update = date('Y-m-d H:i:s');\n\n if (isset($_FILES) && !empty($_FILES)) {\n $customImage = $_FILES['file'];\n $fileTmpName = $customImage['tmp_name'];\n $filename = $customImage['name'];\n\n // validateUpload return false if no error (false -> OK)\n $validUpload = ImageManager::validateUpload($customImage);\n if (is_bool($validUpload) && $validUpload === false) {\n move_uploaded_file($fileTmpName, $this->module->folder_file_upload . $filename);\n $blockPsr->custom_icon = $this->module->img_path_perso . '/' . $filename;\n $blockPsr->icon = '';\n } else {\n $errors[] = $validUpload;\n }\n }\n if (empty($errors)) {\n if ($id_block) {\n $blockPsr->update();\n } else {\n $blockPsr->add();\n }\n }\n\n // Response\n $this->ajaxRenderJson(empty($errors) ? 'success' : 'error');\n }", "function facebook_live_sermon() {\n \n\t// Set UI labels for Custom Post Type\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Sermon Videos', 'Post Type General Name', 'twentytwenty' ),\n\t\t\t'singular_name' => _x( 'Sermon Video', 'Post Type Singular Name', 'twentytwenty' ),\n\t\t\t'menu_name' => __( 'Sermon Videos', 'twentytwenty' ),\n\t\t\t'parent_item_colon' => __( 'Parent Sermon Video', 'twentytwenty' ),\n\t\t\t'all_items' => __( 'All Sermon Videos', 'twentytwenty' ),\n\t\t\t'view_item' => __( 'View Sermon Video', 'twentytwenty' ),\n\t\t\t'add_new_item' => __( 'Add New Sermon Video', 'twentytwenty' ),\n\t\t\t'add_new' => __( 'Add New', 'twentytwenty' ),\n\t\t\t'edit_item' => __( 'Edit Sermon Video', 'twentytwenty' ),\n\t\t\t'update_item' => __( 'Update Sermon Video', 'twentytwenty' ),\n\t\t\t'search_items' => __( 'Search Sermon Video', 'twentytwenty' ),\n\t\t\t'not_found' => __( 'Not Found', 'twentytwenty' ),\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'twentytwenty' ),\n\t\t);\n\t\t \n\t// Set other options for Custom Post Type\n\t\t $desc = \"Go to https://developers.facebook.com/docs/plugins/embedded-video-player and paste the facebook url and click on get code, copy that code and put in content\";\n\t\t$args = array(\n\t\t\t'label' => __( 'Sermon Videos', 'twentytwenty' ),\n\t\t\t'description' => __( 'Sermon Video news and reviews', 'twentytwenty' ),\n\t\t\t'labels' => $labels,\n\t\t\t// Features this CPT supports in Post Editor\n\t\t\t'supports' => array( 'title', 'editor', 'excerpt', 'revisions' ),\n\t\t\t/* A hierarchical CPT is like Pages and can have\n\t\t\t* Parent and child items. A non-hierarchical CPT\n\t\t\t* is like Posts.\n\t\t\t*/ \n\t\t\t'menu_icon' => 'dashicons-video-alt',\n\t\t\t'description' => $desc,\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t'can_export' => true,\n\t\t\t'has_archive' => true,\n 'rewrite' => array('slug' => 'sermon-gallery'),\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'show_in_rest' => true,\n\t \n\t\t);\n\t\t \n\t\t// Registering your Custom Post Type\n\t\tregister_post_type( 'sermon-video', $args );\n\n\n\n\n\n\n\n\n\t\t \n\t// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Church Gallery', 'Post Type General Name', 'twentytwenty' ),\n\t\t'singular_name' => _x( 'Church Gallery', 'Post Type Singular Name', 'twentytwenty' ),\n\t\t'menu_name' => __( 'Church Gallery', 'twentytwenty' ),\n\t\t'parent_item_colon' => __( 'Parent Church Gallery', 'twentytwenty' ),\n\t\t'all_items' => __( 'All Church Gallery', 'twentytwenty' ),\n\t\t'view_item' => __( 'View Church Gallery', 'twentytwenty' ),\n\t\t'add_new_item' => __( 'Add New Church Gallery', 'twentytwenty' ),\n\t\t'add_new' => __( 'Add New', 'twentytwenty' ),\n\t\t'edit_item' => __( 'Edit Church Gallery', 'twentytwenty' ),\n\t\t'update_item' => __( 'Update Church Gallery', 'twentytwenty' ),\n\t\t'search_items' => __( 'Search Church Gallery', 'twentytwenty' ),\n\t\t'not_found' => __( 'Not Found', 'twentytwenty' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'twentytwenty' ),\n\t);\n\t \n// Set other options for Custom Post Type\n\t\t$args = array(\n\t\t'label' => __( 'Church Gallery', 'twentytwenty' ),\n\t\t'description' => __( 'Church Gallery news and reviews', 'twentytwenty' ),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'revisions' ),\n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/ \n\t\t'menu_icon' => 'dashicons-format-gallery',\n\t\t'description' => $desc,\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite' => array('slug' => 'sermon-video'),\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t\t'show_in_rest' => true,\n \n\t);\n\t \n\t// Registering your Custom Post Type\n\tregister_post_type( 'sermon-gallery', $args );\n\n\n\n\n\t\n\t\t \n\t// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Media Message', 'Post Type General Name', 'twentytwenty' ),\n\t\t'singular_name' => _x( 'Media Message', 'Post Type Singular Name', 'twentytwenty' ),\n\t\t'menu_name' => __( 'Media Message', 'twentytwenty' ),\n\t\t'parent_item_colon' => __( 'Parent Media Message', 'twentytwenty' ),\n\t\t'all_items' => __( 'All Media Message', 'twentytwenty' ),\n\t\t'view_item' => __( 'View Media Message', 'twentytwenty' ),\n\t\t'add_new_item' => __( 'Add New Media Message', 'twentytwenty' ),\n\t\t'add_new' => __( 'Add New', 'twentytwenty' ),\n\t\t'edit_item' => __( 'Edit Media Message', 'twentytwenty' ),\n\t\t'update_item' => __( 'Update Media Message', 'twentytwenty' ),\n\t\t'search_items' => __( 'Search Media Message', 'twentytwenty' ),\n\t\t'not_found' => __( 'Not Found', 'twentytwenty' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'twentytwenty' ),\n\t);\n\t \n// Set other options for Custom Post Type\n\t\t$args = array(\n\t\t'label' => __( 'Media Message', 'twentytwenty' ),\n\t\t'description' => __( 'Media Message news and reviews', 'twentytwenty' ),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor', 'excerpt', 'revisions' ),\n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/ \n\t\t'menu_icon' => 'dashicons-text-page',\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite' => array('slug' => 'media-message'),\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t\t'show_in_rest' => true,\n \n\t);\n\t \n\t// Registering your Custom Post Type\n\tregister_post_type( 'media-message', $args );\n\t \n\t}", "function bp_follow_screen_activity_following() {\n\tbp_update_is_item_admin( is_super_admin(), 'activity' );\n\tdo_action( 'bp_activity_screen_following' );\n\tbp_core_load_template( apply_filters( 'bp_activity_template_following', 'members/single/home' ) );\n}", "public function run()\n {\n $type = 'feed';\n\n $receiver = (object) [\n 'id' => '1',\n 'name' => 'Toan Pham',\n ];\n $faker = \\Faker\\Factory::create();\n app('activity')->add(\n (object) ['id' => '2', 'name' => $faker->name, 'avatar_url' => $faker->imageUrl(100, 100, 'people') ],\n $type,\n (object) ['id' => '1', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Lorem ipsum dolor sit amet, <a href=\"#\"># consectetur adipiscing </a>', 'object_type' => 'Post' ],\n $receiver\n );\n\n app('activity')->add(\n (object) ['id' => '3', 'name' => $faker->name, 'avatar_url' => $faker->imageUrl(100, 100, 'people') ],\n $type,\n (object) ['id' => '1', 'content' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n Lorem ipsum dolor <a href=\"#\"># ipsum dolor </a>adipiscing elit.', 'object_type' => 'Post' ],\n $receiver\n );\n\n app('activity')->add(\n (object) ['id' => '3', 'name' => $faker->name, 'avatar_url' => $faker->imageUrl(100, 100, 'people') ],\n $type,\n (object) ['id' => '1', 'content' => 'Lorem ipsum dolor <a href=\"#\"># sit amet</a> sit amet, consectetur adipiscing elit.', 'object_type' => 'Post' ],\n $receiver\n );\n\n }", "function wp_apply_generated_classname_support($block_type)\n {\n }", "protected function addactivity($activity_type, $event_object, $fanpage_id, $target_user_id, $target_name, $message ){\r\n\t\t$data['activity_type'] = $activity_type;\r\n\t\t$data['event_object'] = $event_object;\r\n\t\t$data['facebook_user_id'] = $this->_user->facebook_user_id;\r\n\t\t$data['facebook_user_name'] = $this->_user->facebook_user_name;\r\n\t\t$data['fanpage_id'] = $fanpage_id;\r\n\t\t$data['target_user_id'] = $target_user_id;\r\n\t\t$data['target_user_name'] = $target_name;\r\n\t\t$data['message'] = $message;\r\n\t\t$act = new Model_FancrankActivities();\r\n\t\t$post = new Model_Posts();\r\n\t\t/*\r\n\t\tif ($data['activity_type'] == \"like-status\" || $data['activity_type'] == \"like-photo\" || \r\n\t\t\t $data['activity_type'] == \"like-video\" || $data['activity_type'] == \"like-link\"){\r\n\t\t\t$post->addLikeToPost($data['event_object']);\r\n\t\t}else if ($data['activity_type'] == \"unlike-status\" || $data['activity_type'] == \"unlike-photo\" || \r\n\t\t\t $data['activity_type'] == \"unlike-video\" || $data['activity_type'] == \"unlike-link\"){\r\n\t\t\t$post->subtractLikeToPost($data['event_object']);\r\n\t\t}else if ($data['activity_type'] == \"comment-status\" || $data['activity_type'] == \"comment-photo\" || \r\n\t\t\t $data['activity_type'] == \"comment-video\" || $data['activity_type'] == \"comment-link\"){\r\n\t\t\t$post->addCommentToPost($data['event_object']);\r\n\t\t}\r\n\t\t*/\r\n\t\t$act -> addActivities($data);\r\n\t}", "public function accept($actor) {\n $arr = [\n \"type\" => \"Accept\",\n \"object\" => $this->activity_array,\n \"actor\" => $this->obj\n ];\n $accept = new Activity();\n $accept->fill($arr);\n // post new activity to the outbox\n return $accept; \n }", "function bp_activity_action_post_update() {\n\n\t// Do not proceed if user is not logged in, not viewing activity, or not posting\n\tif ( !is_user_logged_in() || !bp_is_activity_component() || !bp_is_current_action( 'post' ) )\n\t\treturn false;\n\n\t// Check the nonce\n\tcheck_admin_referer( 'post_update', '_wpnonce_post_update' );\n\n\t// Get activity info\n\t$content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] );\n\n\tif ( ! empty( $_POST['whats-new-post-object'] ) ) {\n\t\t$object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] );\n\t}\n\n\tif ( ! empty( $_POST['whats-new-post-in'] ) ) {\n\t\t$item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] );\n\t}\n\n\t// No activity content so provide feedback and redirect\n\tif ( empty( $content ) ) {\n\t\tbp_core_add_message( __( 'Please enter some content to post.', 'buddypress' ), 'error' );\n\t\tbp_core_redirect( wp_get_referer() );\n\t}\n\n\t// No existing item_id\n\tif ( empty( $item_id ) ) {\n\t\t$activity_id = bp_activity_post_update( array( 'content' => $content ) );\n\n\t// Post to groups object\n\t} else if ( 'groups' == $object && bp_is_active( 'groups' ) ) {\n\t\tif ( (int) $item_id ) {\n\t\t\t$activity_id = groups_post_update( array( 'content' => $content, 'group_id' => $item_id ) );\n\t\t}\n\n\t// Special circumstance so let filters handle it\n\t} else {\n\t\t$activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content );\n\t}\n\n\t// Provide user feedback\n\tif ( !empty( $activity_id ) )\n\t\tbp_core_add_message( __( 'Update Posted!', 'buddypress' ) );\n\telse\n\t\tbp_core_add_message( __( 'There was an error when posting your update, please try again.', 'buddypress' ), 'error' );\n\n\t// Redirect\n\tbp_core_redirect( wp_get_referer() );\n}", "public function group_video_meeting_content_action() {\n\t\techo $this->get_instance( BuddyPressVideo::class )->groupmeet_switch();\n\t}", "public function Admin_Action_UpdateBlock() {\n $blockId = $this->_getPOSTRequest ( 'blockid', 0 );\n $tagId = $this->_getPOSTRequest ( 'tagid', 0 );\n $name = $this->_getPOSTRequest ( 'name', 0 );\n $rules = $this->_getPOSTRequest ( 'rules', 0 );\n $activated = $this->_getPOSTRequest ( 'activated', 0 );\n $sortorder = $this->_getPOSTRequest ( 'sortorder', -1 );\n\n if (intval($activated) == 1) {\n \t$query = \"UPDATE [|PREFIX|]dynamic_content_block \"\n . \" SET activated = '0' \"\n . \" WHERE tagid = '\".intval($tagId).\"'\";\n $result = $this->db->Query ( $query );\n }\n\n\n $query = \"UPDATE [|PREFIX|]dynamic_content_block \"\n . \" SET name = '\".$this->db->Quote($name).\"'\"\n . \", rules = '\".$this->db->Quote($rules).\"'\"\n . \", activated = '\".intval($activated).\"'\"\n . \", sortorder = '\".$sortorder.\"'\"\n . \" WHERE blockid = '\".intval($blockId).\"'\";\n if (strlen($blockId) == 32) {\n $query = \"INSERT INTO [|PREFIX|]dynamic_content_block (tagid, name, rules, activated, sortorder) VALUES ('$tagId', '{$this->db->Quote($name)}', '{$this->db->Quote($rules)}', '$activated', '$sortorder')\";\n }\n $result = $this->db->Query ( $query );\n if ($result && strlen($blockId) == 32) {\n $blockId = $this->db->LastId('[|PREFIX|]dynamic_content_block');\n }\n\n echo $blockId;\n return;\n }", "function theme_allowed_block_types($allowed_blocks, $post) {\n\n // if(get_page_template_slug( $post ) === 'template-name.php') {\n // return array();\n // }\n\n return array(\n 'acf/xxx',\n 'acf/home-hero',\n 'acf/text-image-right',\n 'acf/image-left-text', \n 'acf/prospectives-listen',\n 'acf/perspectives-read',\n 'acf/perspectives-learn', \n 'acf/perspectives-generic', \n );\n}", "function change_course_type_activity($course_type_ids)\r\n {\r\n if ($course_type_ids)\r\n {\r\n if (! is_array($course_type_ids))\r\n {\r\n $course_type_ids = array($course_type_ids);\r\n }\r\n\r\n $success = true;\r\n\r\n foreach ($course_type_ids as $course_type_id)\r\n {\r\n $course_type = $this->retrieve_course_type($course_type_id);\r\n if (Request :: get('extra'))\r\n {\r\n $course_type->set_active(Request :: get('extra') == 'enable' ? 1 : 0);\r\n }\r\n else\r\n $course_type->set_active(! $course_type->get_active());\r\n\r\n if (! $course_type->update())\r\n $success = false;\r\n }\r\n\r\n $this->redirect(Translation :: get($success ? 'CourseTypeUpdated' : 'CourseTypeNotUpdated'), ($success ? false : true), array(Application :: PARAM_ACTION => WeblcmsManager :: ACTION_ADMIN_COURSE_TYPE_BROWSER));\r\n }\r\n }", "public function blockunblockusercomments($type = \"\", $commentsid = \"\")\n {\n $status = 0;\n if($type == 1){\n $status = 1;\n }\n $result = $this->db->update(\"discussion\", array(\"discussion_status\" => $status), array(\"discussion_id\" => $commentsid));\n return count($result);\n }", "public function blockunblockusercomments($type = \"\", $commentsid = \"\")\n {\n $status = 0;\n if($type == 1){\n $status = 1;\n }\n $result = $this->db->update(\"discussion\", array(\"discussion_status\" => $status), array(\"discussion_id\" => $commentsid));\n return count($result);\n }", "function get_block_types() {\n\treturn array(\n\t\t'Text'=>TextBlock::GetLabel(),\n\t\t'RSS'=>RSSBlock::GetLabel(),\n\t\t'Timeline'=>TimelineBlock::GetLabel(),\n\t\t'Quote'=>QuoteBlock::GetLabel(),\n\t\t'Links'=>LinksBlock::GetLabel(),\n\t\t'Calendar'=>CalendarBlock::GetLabel()\n\t);\n}", "function register_dynamic_block_action() {\n\n\twp_register_script(\n\t\t'my-first-dynamic-gutenberg-block-script',\n\t\tplugins_url( 'myblock.js', __FILE__ ),\n\t\tarray( 'wp-blocks', 'wp-element' ),\n\t\ttrue\n\t);\n\n\tregister_block_type(\n\t\t'my-first-dynamic-gutenberg-block/latest-post',\n\t\tarray(\n\t\t\t'editor_script' => 'my-first-dynamic-gutenberg-block-script',\n\t\t\t'render_callback' => 'my_plugin_render_block_latest_post',\n\t\t)\n\t);\n\n}", "function hook_culturefeed_social_activity_link_alter(array &$build, $activity_type, CultuurNet\\Search\\ActivityStatsExtendedEntity $extended_entity) {\n}", "public function getRedirectBlockType() {\r\r\n return $this->_redirectBlockType;\r\r\n }", "function bp_activity_action_permalink_router() {\n\n\t// Not viewing activity\n\tif ( ! bp_is_activity_component() || ! bp_is_current_action( 'p' ) )\n\t\treturn false;\n\n\t// No activity to display\n\tif ( ! bp_action_variable( 0 ) || ! is_numeric( bp_action_variable( 0 ) ) )\n\t\treturn false;\n\n\t// Get the activity details\n\t$activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) );\n\n\t// 404 if activity does not exist\n\tif ( empty( $activity['activities'][0] ) ) {\n\t\tbp_do_404();\n\t\treturn;\n\t} else {\n\t\t$activity = $activity['activities'][0];\n\t}\n\n\t// Do not redirect at default\n\t$redirect = false;\n\n\t// Redirect based on the type of activity\n\tif ( bp_is_active( 'groups' ) && $activity->component == buddypress()->groups->id ) {\n\n\t\t// Activity is a user update\n\t\tif ( ! empty( $activity->user_id ) ) {\n\t\t\t$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';\n\n\t\t// Activity is something else\n\t\t} else {\n\n\t\t\t// Set redirect to group activity stream\n\t\t\tif ( $group = groups_get_group( array( 'group_id' => $activity->item_id ) ) ) {\n\t\t\t\t$redirect = bp_get_group_permalink( $group ) . bp_get_activity_slug() . '/' . $activity->id . '/';\n\t\t\t}\n\t\t}\n\n\t// Set redirect to users' activity stream\n\t} else if ( ! empty( $activity->user_id ) ) {\n\t\t$redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . bp_get_activity_slug() . '/' . $activity->id . '/';\n\t}\n\n\t// If set, add the original query string back onto the redirect URL\n\tif ( ! empty( $_SERVER['QUERY_STRING'] ) ) {\n\t\t$query_frags = array();\n\t\twp_parse_str( $_SERVER['QUERY_STRING'], $query_frags );\n\t\t$redirect = add_query_arg( urlencode_deep( $query_frags ), $redirect );\n\t}\n\n\t// Allow redirect to be filtered\n\tif ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) {\n\t\tbp_core_redirect( bp_get_root_domain() );\n\t}\n\n\t// Redirect to the actual activity permalink page\n\tbp_core_redirect( $redirect );\n}", "function set_form_activity_type( $post_types ) {\r\n\r\n\t\t// Get Activity Type.\r\n\t\t$activity_type = isset( $_POST['activity_type'] ) ? $_POST['activity_type'] : null;\r\n\r\n\t\tif ( empty( $activity_type ) ) {\r\n\t\t\treturn $post_types;\r\n\t\t}\r\n\r\n\t\tforeach ( $post_types as $key => $post_type ) {\r\n\t\t\tif ( $post_type['id'] != $activity_type ) {\r\n\t\t\t\tunset( $post_types[ $key ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $post_types;\r\n\t}", "function loadActivity(){\n\t\t\t$this->articleEvents->add( $this->db->getUserActivity($this->getName()) ,true );\t\t\t\n\t\t}", "public function register_blocks() {\n\t\tif ( function_exists( 'register_block_type' ) ) {\n\t\t\tregister_block_type(\n\t\t\t\t\"civil/{$this->slug}\",\n\t\t\t\t[\n\t\t\t\t\t'editor_script' => 'block-js-' . $this->slug,\n\t\t\t\t\t'render_callback' => function( array $attributes ) {\n\t\t\t\t\t\treturn $this->render_block_data( $attributes );\n\t\t\t\t\t},\n\t\t\t\t\t'attributes' => [\n\t\t\t\t\t\t'title' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Title', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Description', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'cta_button_text' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => __( 'CTA Button', 'civil-first-fleet' ),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter' => [\n\t\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'newsletter_list' => [\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function notify_blog_post( $post, $type ) {\n\t\tif ( defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$user_id = 'new' === $type ? $post->post_author : get_current_user_id();\n\t\t$user = get_user_by( 'id', $user_id );\n\n\t\t$content = wp_trim_words(\n\t\t\tstrip_shortcodes( has_excerpt( $post ) ? $post->post_excerpt : $post->post_content ),\n\t\t\t55\n\t\t);\n\n\t\t$args = array(\n\t\t\t'action' => 'wporg_handle_activity',\n\t\t\t'type' => $type,\n\t\t\t'source' => 'wordpress',\n\t\t\t'user' => $user->user_login,\n\t\t\t'post_id' => $post->ID,\n\t\t\t'blog' => get_bloginfo( 'name' ),\n\t\t\t'blog_url' => site_url(),\n\t\t\t'post_type' => $post->post_type,\n\t\t\t'title' => get_the_title( $post ),\n\t\t\t'content' => $content,\n\t\t\t'url' => get_permalink( $post->ID ),\n\t\t);\n\n\t\tProfiles\\api( $args );\n\t}", "function register_blocks() {\n\trequire_once DKOO_BLOCKS_PATH . 'blocks/background-video/index.php';\n\tBackgroundVideo\\register_block();\n}", "function time_tracker_activity_save(&$entity) {\n return entity_get_controller('time_tracker_activity')->save($entity);\n}", "function wp_playlist_scripts($type)\n {\n }", "function charangoten_custom_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {\n if ($op == 'insert' || $op == 'update') {\n if (isset($node->stream_publish) && $node->stream_publish) {\n //dpm($node, \"dff_custom_nodeapi, publishing to stream\");\n // http://wiki.developers.facebook.com/index.php/Attachment_(Streams)\n $attachment = array(\n 'name' => $node->title,\n 'href' => url('node/' . $node->nid, array('absolute' => TRUE)),\n 'description' => $node->teaser,\n );\n\n $user_message = t('Check out my latest post on !site...',\n array('!site' => variable_get('site_name', t('my Drupal for Facebook powered site'))));\n $actions = array();\n $actions[] = array('text' => t('Read More'),\n 'href' => url('node/'.$node->nid, array('absolute' => TRUE)),\n );\n fb_stream_publish_dialog(array('user_message' => $user_message,\n 'attachment' => $attachment,\n 'action_links' => $actions,\n ));\n }\n }\n\n\n}", "public function saveBlock()\n\t{\n\t}", "function after_block( $instance ) {\n\t\t}", "public function Admin_Action_ShowBlockForm() {\n $ssf = new SendStudio_Functions ( );\n $action = 'new';\n $GLOBALS ['blockid'] = (isset ( $_GET ['id'] ) && $_GET ['id'] > 0) ? $_GET ['id'] : md5(rand ( 1, 100000000 ));\n $GLOBALS ['tagid'] = (isset ( $_GET ['tagId'] ) && $_GET ['tagId'] > 0) ? $_GET ['tagId'] : 0;\n $GLOBALS ['blockaction'] = (isset ( $_GET ['id'] ) && $_GET ['id'] > 0) ? 'edit' : 'new';\n $GLOBALS ['BlockEditor'] = $ssf->GetHTMLEditor ( '', false, 'blockcontent', 'exact', 260, 630 );\n $GLOBALS ['CustomDatepickerUI'] = $this->template_system->ParseTemplate('UI.DatePicker.Custom_IEM', true);\n $this->template_system->ParseTemplate ( 'dynamiccontentblocks_form' );\n }", "public function action_block_content_incoming_links($block, $theme)\n\t{\n\t\t$block->incoming_links = $this->theme_incoming_links();\n\t\t$block->link = \"http://blogsearch.google.com/?scoring=d&amp;num=10&amp;q=link:\" . Site::get_url( 'habari' );;\n\t}", "public function getActivities()\n\t{\n\t\t// Load component tables\n\t\tJTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_activitystream/tables');\n\n\t\t// Variable to store activity data fetched\n\t\t$result = array();\n\n\t\t// Variable to store request response\n\t\t$result_arr = array();\n\n\t\t$ActivityStreamModelActivities = $this->getModel('Activities');\n\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$type = $jinput->get(\"type\", '', 'STRING');\n\n\t\t// Return result related to specified activity type\n\t\tif (empty($type))\n\t\t{\n\t\t\t$result_arr['success'] = false;\n\t\t\t$result_arr['message'] = JText::_(\"COM_ACTIVITYSTREAM_ERROR_ACTIVITY_TYPE\");\n\n\t\t\techo json_encode($result_arr);\n\n\t\t\tjexit();\n\t\t}\n\n\t\t$actor_id = $jinput->get('actor_id', '', 'CMD');\n\t\t$object_id = $jinput->get('object_id', '', 'CMD');\n\t\t$target_id = $jinput->get('target_id', '', 'STRING');\n\t\t$from_date = $jinput->get('from_date', '');\n\t\t$start = $jinput->get('start', '0');\n\t\t$limit = $jinput->get('limit');\n\t\t$filter_condition = $jinput->get('filter_condition', '', 'STRING');\n\n\t\t// Set model state\n\t\t$ActivityStreamModelActivities->setState(\"type\", $type);\n\t\t$ActivityStreamModelActivities->setState(\"actor_id\", $actor_id);\n\t\t$ActivityStreamModelActivities->setState(\"object_id\", $object_id);\n\t\t$ActivityStreamModelActivities->setState(\"target_id\", $target_id);\n\t\t$ActivityStreamModelActivities->setState(\"from_date\", $from_date);\n\t\t$ActivityStreamModelActivities->setState(\"list.limit\", $limit);\n\t\t$ActivityStreamModelActivities->setState(\"access\", \"1\");\n\t\t$ActivityStreamModelActivities->setState(\"state\", '1');\n\t\t$ActivityStreamModelActivities->setState(\"list.start\", $start);\n\t\t$ActivityStreamModelActivities->setState(\"filter_condition\", $filter_condition);\n\n\t\t$result['results'] = $ActivityStreamModelActivities->getItems();\n\n\t\t// If no activities found then return the error message\n\t\tif (empty($result['results']))\n\t\t{\n\t\t\t$result_arr['success'] = false;\n\t\t\t$result_arr['message'] = JText::_(\"COM_ACTIVITYSTREAM_NO_ACTIVITY\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result_arr['success'] = true;\n\t\t\t$result_arr['data'] = $result;\n\t\t\t$result_arr['data']['total'] = $ActivityStreamModelActivities->getTotal();\n\t\t}\n\n\t\techo json_encode($result_arr);\n\n\t\tjexit();\n\t}", "public function block() {\n $friendship_relation_exists = $this->micro_relation_exists($this->from, $this->to, \"F\");\n $exists = $this->micro_relation_exists($this->from, $this->to, \"B\");\n\n if($friendship_relation_exists) {\n // Unblock\n if($exists) {\n $this->db->query(\"DELETE FROM user_relation WHERE `from` = ? AND `to` = ? AND `status` = ?\"\n ,array(\n $this->from,\n $this->to,\n \"B\"\n ));\n // Block\n } else {\n $this->db->query(\"INSERT INTO user_relation (`from`, `to`, `status`, `since`) \n VALUES (?, ?, ?, ?)\", array(\n $this->from,\n $this->to,\n \"B\",\n date(\"Y/m/d h:i:s\")\n ));\n }\n\n return true;\n }\n\n return false;\n }", "public function log_activity() {\n\t\t$data = array();\n\t\t$data['page'] = current_url();\n\t\t$data['ip_address'] = $this->_ci->input->ip_address();\n\t\t$data['user_agent'] = $this->_ci->agent->agent_string(); \n\t\t$data['request_method'] = $this->_ci->input->server('REQUEST_METHOD');\n\t\t$data['request_params'] = serialize($this->_ci->input->get_post(NULL, TRUE)); \n\t\t$data['uri_string'] = $this->_ci->uri->uri_string();\n\t\t$data['created_at'] = date('Y-m-d h:i:s');\n\n\t\tif($this->verify_activity()) {\n\t\t\t// And write it to the database\n\t\t\t$this->_ci->db->insert('hooks', $data);\n\t\t}\n\t}", "public function notifyByActivity($activity=\"general\", $type=\"neweb\") {\n $provider = $this->createServiceProvider($type);\n $notify \t = $this->createUserNotify($activity);\n $tradeResult = $_POST;\n\n $this->receiveNotify($provider, $notify, $tradeResult);\n $this->responser->send(array() , $this->responser->OK());\n }", "public function onPublishSlot( Content $content );", "function gallery2_sidebarblock_modify($blockinfo)\n{\n // get current content\n if (!is_array($blockinfo['content'])) {\n $vars = @unserialize($blockinfo['content']);\n } else {\n $vars = $blockinfo['content'];\n }\n\n $vars['blockid'] = $blockinfo['bid'];\n return $vars;\n}", "function getActivity()\n\t\t{\n\t\t\t$userID = $_POST[\"userID\"];\n\t\t\t$title = \"userPost\";\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t\n\t\t\techo $this->postActivity($userID, $title, $description, $link);\n\t\t}", "function bfox_bp_plans_my_plans_screen_view() {\n\tadd_action('bp_template_content', 'bfox_bp_plans_my_plans_screen_view_content');\n\tbfox_bp_core_load_template(apply_filters('bfox_bp_plans_my_plans_screen_template', 'members/single/plugins'));\n}", "function unblock_process($blocker) {\n set_field('block_courseprefs_config', 'value', 'DONE', 'name', $blocker);\n}", "function use_block_editor_for_post_type($post_type)\n {\n }", "public function setActivity($value)\n {\n return $this->set('Activity', $value);\n }", "public function onSaveSuccess($type, $id) {\nglobal $_LW;\nif (!isset($_LW->ENV->editors[$_LW->page])) {\n\t// if not saving from the editor, this is coming from the ->update() API and these steps can be skipped\n\treturn false;\n}\nif ($type=='events' && ($_LW->page=='events_edit' || $_LW->page=='events_sub_edit')) { // if saving an event from the editor\n\t$_LW->setCustomFields($type, $id, ['sample_textarea'=>@$_LW->_POST['sample_textarea']], []); // store the value entered for sample_textarea, allowing the sample_textarea field full visibility (on details pages, in widget results, and /live/* requests such as /live/json)\n\t/*\n\tNote:\n \tTo optionally hide the field (i.e. store it in the database but not expose it to the public on the frontend web site or API requests, add \"sample_textarea\" to the empty array above, registering it as a hidden field).\n\tNon-hidden fields may be added to a details template via <xphp var=\"details_custom_sample_textarea\"/> or to a widget format arg via {custom_sample_textarea}.\n\t*/\n\t$_LW->setCustomFields($type, $id, ['sample_text'=>@$_LW->_POST['sample_text']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_select'=>@$_LW->_POST['sample_select']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_checkbox'=>@$_LW->_POST['sample_checkbox']], []); // store the value\n\t$_LW->setCustomFields($type, $id, ['sample_radio'=>@$_LW->_POST['sample_radio']], []); // store the value\n};\n}", "public function filter_dashboard_block_list($block_list)\n\t{\n\t\t$block_list['incoming_links'] = 'Incoming Links';\n\t\t$this->add_template( 'dashboard.block.incoming_links', __DIR__ . '/dashboard.block.incoming_links.php' );\n\t\treturn $block_list;\n\t}", "public function testUpdateChallengeActivityTemplate()\n {\n }", "public function block1_mapping() {\n\t\tvc_map( array(\n\t\t\t'name' => esc_html__( 'News Block1', 'gnews-vc' ),\n\t\t\t'base' => 'gnews_vc_block1',\n\t\t\t'icon' => GNEWS_VC_PLUGIN_URL_VC . 'assets/images/blog_list.png',\n\t\t\t'category' => esc_html__( 'By Gnews-VC', 'gnews-vc' ),\n\t\t\t'description' => esc_html__( 'Gnews-VC News Block1', 'gnews-vc' ),\n\t\t\t'params' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Widget title', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'title',\n\t\t\t\t\t'description' => esc_html__( 'Enter text used as widget title (Note: located above content element).', 'gnews-vc' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Show', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'post_type',\n\t\t\t\t\t'value' => array(\n\t\t\t\t\t\tesc_html__( 'All posts', 'gnews-vc' ) => 'posts',\n\t\t\t\t\t\tesc_html__( 'Recent posts', 'gnews-vc' ) => 'recent_posts',\n\t\t\t\t\t\tesc_html__( 'Posts by categories', 'gnews-vc' ) => 'category',\n\t\t\t\t\t\tesc_html__( 'Posts by tags', 'gnews-vc' ) => 'tags',\n\t\t\t\t\t),\n\t\t\t\t\t'std' => 'category',\n\t\t\t\t),\n\t\t\t\t// post auto-complete\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'autocomplete',\n\t\t\t\t\t'heading' => esc_html__( 'Choose posts', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'posts',\n\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t'multiple' => true,\n\t\t\t\t\t\t'min_length' => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'save_always' => true,\n\t\t\t\t\t'description' => esc_html__( 'Field accept post ID, title. Leave empty to show all posts.', 'gnews-vc' ),\n\t\t\t\t\t'dependency' => array(\n\t\t\t\t\t\t'element' => 'post_type',\n\t\t\t\t\t\t'value' => 'posts',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t// category auto-complete\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'autocomplete',\n\t\t\t\t\t'heading' => esc_html__( 'Choose post categories', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'category',\n\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t'multiple' => true,\n\t\t\t\t\t\t'min_length' => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'save_always' => true,\n\t\t\t\t\t'description' => esc_html__( 'Field accept category ID, title, slug. Leave empty to show all posts.', 'gnews-vc' ),\n\t\t\t\t\t'dependency' => array(\n\t\t\t\t\t\t'element' => 'post_type',\n\t\t\t\t\t\t'value' => 'category',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t// tags auto-complete\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'autocomplete',\n\t\t\t\t\t'heading' => esc_html__( 'Choose tags', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'tags',\n\t\t\t\t\t'settings' => array(\n\t\t\t\t\t\t'multiple' => true,\n\t\t\t\t\t\t'min_length' => 0,\n\t\t\t\t\t),\n\t\t\t\t\t'save_always' => true,\n\t\t\t\t\t'description' => esc_html__( 'Field accept tag ID, title, slug. Leave empty to show all posts.', 'gnews-vc' ),\n\t\t\t\t\t'dependency' => array(\n\t\t\t\t\t\t'element' => 'post_type',\n\t\t\t\t\t\t'value' => 'tags',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t// show featured\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show featured image?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_featured',\n\t\t\t\t\t// 'description' => esc_html__( 'Show featured image?', 'gnews-vc' ),\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t),\n\t\t\t\t// show post type icon\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show post type icon?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_post_type_icon',\n\t\t\t\t\t// 'description' => esc_html__( 'Show post type icon?', 'gnews-vc' ),\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t),\n\t\t\t\t// show post title\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show post title?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_post_title',\n\t\t\t\t\t// 'description' => esc_html__( 'Show post title?', 'gnews-vc' ),\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'dropdown',\n\t\t\t\t\t'heading' => esc_html__( 'Post title size', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'post_title_size',\n\t\t\t\t\t'value' => array(\n\t\t\t\t\t\t'H1' => 'h1',\n\t\t\t\t\t\t'H2' => 'h2',\n\t\t\t\t\t\t'H3' => 'h3',\n\t\t\t\t\t\t'H4' => 'h4',\n\t\t\t\t\t\t'H5' => 'h5',\n\t\t\t\t\t\t'H6' => 'h6',\n\t\t\t\t\t),\n\t\t\t\t\t'std' => 'h3',\n\t\t\t\t\t'dependency' => array(\n\t\t\t\t\t\t'element' => 'show_post_title',\n\t\t\t\t\t\t'value' => 'true',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show underline for post title?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_underline_title',\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t\t'dependency' => array(\n\t\t\t\t\t\t'element' => 'show_post_title',\n\t\t\t\t\t\t'value' => 'true',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t// show post sub title\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show post sub title?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_post_sub_title',\n\t\t\t\t\t// 'description' => esc_html__( 'Show post sub title?', 'gnews-vc' ),\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t),\n\t\t\t\t// show author name\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show author name?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_author_name',\n\t\t\t\t\t// 'description' => esc_html__( 'Show author name?', 'gnews-vc' ),\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t),\n\t\t\t\t// show comments\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show comments?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_comments',\n\t\t\t\t\t// 'description' => esc_html__( 'Show comments?', 'gnews-vc' ),\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t),\n\t\t\t\t// show related posts\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t'heading' => esc_html__( 'Show related posts?', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'show_related_posts',\n\t\t\t\t\t// 'description' => esc_html__( 'Show related posts?', 'gnews-vc' ),\n\t\t\t\t\t'std' => 'true',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Number of related posts', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'related_posts',\n\t\t\t\t\t'value' => esc_html__( '0', 'gnews-vc' ),\n\t\t\t\t\t'description' => esc_html__( 'Max value is 3.', 'gnews-vc' ),\n\t\t\t\t\t'dependency' => array(\n\t\t\t\t\t\t'element' => 'show_related_posts',\n\t\t\t\t\t\t'value' => 'true',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t// extra class\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'textfield',\n\t\t\t\t\t'heading' => esc_html__( 'Extra class name', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'el_class',\n\t\t\t\t\t'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'gnews-vc' ),\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'css_editor',\n\t\t\t\t\t'heading' => esc_html__( 'CSS box', 'gnews-vc' ),\n\t\t\t\t\t'param_name' => 'css',\n\t\t\t\t\t'group' => esc_html__( 'Design Options', 'gnews-vc' ),\n\t\t\t\t),\n\t\t\t),\n\t\t) );\n\t}", "function unregister_block_type($name)\n {\n }", "public function register_cpt_blocks() {\n /* Include CPT creation file */\n //include_once( ILIO_BLOCKS_INCLUDES_DIR . '/blockss.post-type.php' );\n }", "function bp_activity_action_friends_feed() {\n\tif ( ! bp_is_active( 'friends' ) || ! bp_is_user_activity() || ! bp_is_current_action( bp_get_friends_slug() ) || ! bp_is_action_variable( 'feed', 0 ) ) {\n\t\treturn false;\n\t}\n\n\t// setup the feed\n\tbuddypress()->activity->feed = new BP_Activity_Feed( array(\n\t\t'id' => 'friends',\n\n\t\t/* translators: Friends activity RSS title - \"[Site Name] | [User Display Name] | Friends Activity\" */\n\t\t'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ),\n\n\t\t'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ),\n\t\t'description' => sprintf( __( \"Activity feed for %s's friends.\", 'buddypress' ), bp_get_displayed_user_fullname() ),\n\t\t'activity_args' => 'scope=friends'\n\t) );\n}", "function view_special_blocks($type) {\n if (strpos($type, '-setsblocks') === 0) {\n // avoid interfering with the admin forms.\n if (arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'views') {\n return;\n }\n\n list($type, $variant) = explode('_', $type, 2);\n\n $variant = base64_decode($variant);\n $args = explode('/', $variant);\n\n $this->view->set_arguments($args);\n\n $info = $this->view->execute_display();\n if ($info) {\n $info['view'] = $this->view;\n }\n return $info;\n }\n else {\n return parent::view_special_blocks($type);\n }\n }", "public function register_blocks() {\n\n\t\t// Return early if this function does not exist.\n\t\tif ( ! function_exists( 'register_block_type' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Shortcut for the slug.\n\t\t$slug = $this->_slug;\n\n\t\tregister_block_type(\n\t\t\t$slug . '/accordion',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/alert',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/author',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/click-to-tweet',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/dynamic-separator',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gif',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gist',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/highlight',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-carousel',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-masonry',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t\tregister_block_type(\n\t\t\t$slug . '/gallery-stacked',\n\t\t\tarray(\n\t\t\t\t'editor_script' => $slug . '-editor',\n\t\t\t\t'editor_style' => $slug . '-editor',\n\t\t\t\t'style' => $slug . '-frontend',\n\t\t\t)\n\t\t);\n\t}", "public function action_recent() {\n\t\t// Request parameters\n\t\t$format = $this->request->param('format', 'html');\n\t\t$limit = Arr::get($_GET, 'limit', 10);\n\n\t\t// Start compiling the items\n\t\t$items = array();\n\t\tforeach (OActivity::stream($limit, $this->request->query('object')) as $item) {\n\t\t\t$model = substr(str_replace('Model_', '', Text::alpha($item['target']['guid'], '_')), 0, -1);\n\t\t\t$model = OModel::factory($model);\n\n\t\t\t$views = $model->view('activity');\n\t\t\t$type = str_replace('_', '/', $item['type']);\n\t\t\tif ($views !== null && isset($views[$item['type']]) && isset($views[$item['type']][$item['verb']])) {\n\t\t\t\t$item['view'] = $views[$item['type']][$item['verb']];\n\t\t\t}\n\t\t\telse if (Kohana::find_file('views', 'activity/'.$type.'/'.$item['verb']) !== false) {\n\t\t\t\t$item['view'] = 'activity/'.$type.'/'.$item['verb'];\n\t\t\t}\n\t\t\telse if (Kohana::find_file('views', 'activity/'.$item['verb']) !== false) {\n\t\t\t\t$item['view'] = 'activity/'.$item['verb'];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($format == 'html') {\n\t\t\t\t\tthrow new Kohana_View_Exception('Could not load view for activity :verb for :type.', array(\n\t\t\t\t\t\t':verb' => $item['verb'],\n\t\t\t\t\t\t':type' => $item['type']\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$item['view'] = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Load the actor object\n\t\t\t$actor = OModel::factory('User', $item['actor']['id']);\n\t\t\t$item['actor'] += array(\n\t\t\t\t'avatar' => $actor->profile_photo('thumbnail'),\n\t\t\t\t'avatar_url' => $actor->profile_photo_url('thumbnail'),\n\t\t\t\t'object' => $actor,\n\t\t\t);\n\n\t\t\t// Load the target object\n\t\t\t$target = OModel::factory($item['type'], $item['target']['id'])->find();\n\t\t\t$item['target']['object'] = $target;\n\n\t\t\t// Load the view\n\t\t\t$items[] = $item;\n\n\t\t\t// Remove the instance\n\t\t\tunset($model);\n\t\t}\n\n\t\t$body = '';\n\t\tif ($format == 'html') {\n\t\t\tif ($this->request->query('object') !== null) {\n\t\t\t\t$body = OActivity::as_list($items);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$body = View::factory('activity/shell', array(\n\t\t\t\t\t'items' => $items\n\t\t\t\t))->render();\n\t\t\t}\n\t\t}\n\t\telse if ($format == 'json') {\n\t\t\t$body = json_encode($items);\n\t\t}\n\n\t\t// Set the response body\n\t\t$this->response->body($body);\n\t}", "function ctools_block_content_type_render($subtype, $conf) {\n list($module, $delta) = _ctools_block_get_module_delta($subtype, $conf);\n $block = (object) module_invoke($module, 'block', 'view', $delta);\n\n if (empty($block)) {\n return;\n }\n\n $block->module = $module;\n $block->delta = $delta;\n\n if ($module == 'block' && empty($conf['override_title'])) {\n $block->subject = db_query('SELECT title FROM {blocks} WHERE module = :module AND delta = :delta', array(':module' => 'block', ':delta' => $delta))->fetchField();\n }\n\n if (isset($block->subject)) {\n $block->title = $block->subject;\n }\n else {\n $block->title = NULL;\n }\n\n if (user_access('administer blocks')) {\n $block->admin_links = array(\n array(\n 'title' => t('Configure block'),\n 'alt' => t(\"Configure this block's 'block settings' in administer >> site building >> blocks\"),\n 'href' => \"admin/build/block/configure/$module/$delta\",\n 'query' => drupal_get_destination(),\n ),\n );\n }\n\n // TEMP: Disabling block visibility checking. Ultimately we may be able to\n // finally just say it's not supported.\n return $block;\n\n // This seems extra but it prevents an unnecessary query sometimes.\n if (empty($conf['block_visibility']) && $block->module != 'block') {\n return $block;\n }\n\n // Test for block visibility\n $block_visibility = db_query('SELECT title, pages, visibility FROM {blocks} WHERE module = :module AND delta = :delta', array(':module' => $block->module, ':delta' => $block->delta))->fetchObject();\n\n if ($block->module == 'block') {\n $block->title = $block_visibility->title;\n }\n\n if (empty($conf['block_visibility'])) {\n return $block;\n }\n\n if ($block_visibility && $block_visibility->pages) {\n if ($block_visibility->visibility < 2) {\n $path = drupal_get_path_alias($_GET['q']);\n $regexp = '/^('. preg_replace(array('/(\\r\\n?|\\n)/', '/\\\\\\\\\\*/', '/(^|\\|)\\\\\\\\<front\\\\\\\\>($|\\|)/'), array('|', '.*', '\\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\\2'), preg_quote($block_visibility->pages, '/')) .')$/';\n $page_match = !($block_visibility->visibility xor preg_match($regexp, $path));\n }\n else if (module_exists('php')) {\n $page_match = php_eval($block_visibility->pages);\n }\n }\n else {\n $page_match = TRUE;\n }\n\n if ($page_match) {\n return $block;\n }\n}", "function postflight($type, $parent)\n\t{\n\t\t// $parent is the class calling this method\n\t\t// $type is the type of change (install, update or discover_install)\n\t\t//echo '<p>' . JText::_('COM_BDGALLERY_POSTFLIGHT_' . $type . '_TEXT') . '</p>';\n\t}", "public function hideActivity($activityId = null)\n {\n if (empty($activityId)) $activityId = $this->postId();\n return TfBuildingActivity::where('activity_id', $activityId)->update(['action' => 0]);\n\n }", "public static function allowed_block_types($allowed_blocks): array\n {\n return [\n// 'core-embed/amazon-kindle',\n// 'core-embed/animoto',\n// 'core-embed/cloudup',\n// 'core-embed/collegehumor',\n// 'core-embed/crowdsignal',\n// 'core-embed/dailymotion',\n// 'core-embed/facebook',\n// 'core-embed/flickr',\n// 'core-embed/imgur',\n// 'core-embed/instagram',\n// 'core-embed/issuu',\n// 'core-embed/kickstarter',\n// 'core-embed/meetup-com',\n// 'core-embed/mixcloud',\n// 'core-embed/polldaddy',\n// 'core-embed/reddit',\n// 'core-embed/reverbnation',\n// 'core-embed/screencast',\n// 'core-embed/scribd',\n// 'core-embed/slideshare',\n// 'core-embed/smugmug',\n// 'core-embed/soundcloud',\n// 'core-embed/speaker',\n// 'core-embed/speaker-deck',\n// 'core-embed/spotify',\n// 'core-embed/ted',\n// 'core-embed/tiktok',\n// 'core-embed/tumblr',\n// 'core-embed/twitter',\n// 'core-embed/videopress',\n// 'core-embed/vimeo',\n// 'core-embed/wordpress',\n// 'core-embed/wordpress-tv',\n 'core-embed/youtube',\n// 'core/archives',\n// 'core/audio',\n// 'core/block',\n// 'core/button',\n// 'core/buttons',\n// 'core/calendar',\n// 'core/categories',\n// 'core/code',\n 'core/column',\n 'core/columns',\n// 'core/cover',\n// 'core/embed',\n// 'core/file',\n// 'core/freeform',\n// 'core/gallery',\n// 'core/group',\n 'core/heading',\n// 'core/html',\n 'core/image',\n// 'core/latest-comments',\n// 'core/latest-posts',\n 'core/list',\n// 'core/media-text',\n// 'core/missing',\n// 'core/more',\n// 'core/nextpage',\n 'core/paragraph',\n 'core/preformatted',\n// 'core/pullquote',\n 'core/quote',\n// 'core/rss',\n// 'core/search',\n// 'core/separator',\n// 'core/shortcode',\n// 'core/social-link',\n// 'core/social-links',\n// 'core/spacer',\n// 'core/subhead',\n 'core/table',\n// 'core/tag-cloud',\n// 'core/text-columns',\n// 'core/verse',\n 'core/video',\n ];\n }", "public function addActivity($data);", "function wp_register_duotone_support($block_type)\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 iqor_blocks_register_block_type($block, $options = array()) {\n register_block_type(\n 'iqor-blocks/' . $block,\n array_merge(\n array(\n 'editor_script' => 'iqor-blocks-editor-script',\n 'editor_style' => 'iqor-blocks-editor-style',\n 'script' => 'iqor-blocks-script',\n 'style' => 'iqor-blocks-style'\n ),\n $options\n )\n );\n\n}", "public function ModRecord($type)\n\t{\n\t\tmysql_query(\"INSERT INTO modlogs (uid, ip, agent, date, script, request_url) VALUES ('\" . $this->UserArray[1] . \"', '\".$_SERVER['REMOTE_ADDR'].\"', '\".$_SERVER['HTTP_USER_AGENT'].\"', '\".time().\"', '\".$type.\"', '\".mysql_real_escape_string($_SERVER['REQUEST_URI']).\"')\");\n\t}", "public function action_block(Request $request)\n {\n\n\n $data = DB::table('posts')->where('posts.id_product','=',$request['id']);\n\n $data = $data->select('id')->first();\n\n $post = post::find($data->id);\n\n $post->status_post = $request['action_block'];\n\n $post->save();\n\n return redirect(url('buy_user'));\n }", "function approve_block_more_users($users_id, $users_type){\n\t\tif( isset($_POST[$users_id]) ){\n\t\t\tglobal $base;\n\t\t\t\n\t\t\tuser::users_manipulation($_POST[$users_id], $_POST[$users_type]);\n\t\t\tredirect('../../master_admin.php');\n\t\t}\n\n\t}", "function type_url_form_video()\n {\n }", "function ctools_block_ctools_content_types() {\n return array(\n // And this is just the administrative title.\n // All our callbacks are named according to the standard pattern and can be deduced.\n 'title' => t('Block'),\n );\n}", "public function run()\n {\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'قطع غيار جديدة',\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'قطع غيار تشليح'\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'إطارات'\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'العناية بالسيارات'\n \n ]);\n\n $activity_type = \\App\\Activity_type::create([\n 'name' => 'زيوت'\n \n ]);\n }", "function timetracking_type_save(timetrackingType $type) {\n $type->save();\n}", "function dashboard($widget_id = NULL) {\n\t\t$clean = new Sanitize();\n\t\t$my = $this->core['my'];\n\t\t$user = $my;\n\t\t$id = $my['id'];\n\t\t$streamname = NULL;\n\t\tif(isset($this->params['streamname']))\n\t\t\t$streamname = $this->params['streamname'];\t\n\t\t\t\t\t\n\t\tif(empty($my['id'])){\n\t\t\tif(isset($streamname)){\n\t\t\t\t$this->redirect(array('controller'=> 'streams', 'action'=>'pub', 'streamname' => $streamname));\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash(__('Incorrect collection link, please check the URL you entered', true));\n\t\t\t\t$this->redirect(array('controller'=> 'hello', 'action'=>'about'));\t\t\t\n\t\t\t}\n\t\t}else if($my['hasConfirmed'] == 0)\n\t\t\t$this->Session->setFlash(__('Please check your inbox to confirm your email address.', 'default', array(), 'error'));\n\n\n\t\t\t\n\t\t$streamsResults = $this->Stream->getByStreamname($streamname, $this->core['my']['id']);\n\t\t\t\n\t\tif(empty($streamsResults)){\n\t\t\t$this->Session->setFlash(__('The Collection was not found. Please check that you entered the correct link.', true));\n\t\t\t$this->redirect(array('controller'=> 'users', 'action'=>'dashboard', 'username'=>$my['username']));\t\t\n\t\t}else{\n\t\t\t$stream_id = $streamsResults[0]['Stream']['id'];\n\t\t\t$this->pageTitle = $streamsResults[0]['Stream']['stream'];\n\t\t}\n\t\t//debug($streamsResults);\n\t\t$streamsList = $this->Stream->getStreamsList_server($streamsResults, $my);\n\t\t//debug($streamsList);\n\t\t\n\t\t$this->Stream->getStreamname($streamsResults[0]['Stream']['stream']);\n\t\t\n\t\t$streamListTypesToAvoid = array(\"Requested\");\n\t\tif ($id != $my['id'])\n\t\t{\n\t\t\t$streamListTypesToAvoid[] = \"Hidden\";\n\t\t\t$streamListTypesToAvoid[] = \"Closed\";\n\t\t\t$streamListTypesToAvoid[] = \"Archive\";\n\t\t}\n\t\t\n\t\t$getStreamIdsAndActiveStreamIdResults = $this->Stream->__getStreamIdsAndActiveStreamId($stream_id, $streamsList, array(\"Default\", \"Invited\", \"Requested\", \"Hidden\", \"Closed\", \"Open\", \"Archive\"), $streamListTypesToAvoid);\n\n\t\t$selectStreamId = $getStreamIdsAndActiveStreamIdResults['selectStreamId'];\n\t\t$streamsIds = $getStreamIdsAndActiveStreamIdResults['streamsIds']; //compiles the list of stream ids that were retrieved\n\t\t//debug($selectStreamId);\n\t\t\n\t\t$widgetsResults = $this->Stream->User->UsersWidget->__getWidgetsForUser($my['id'], $my['id']);\n\t\t$widgetsList = $widgetsResults;\n\t\t\n\t\t$selectWidgetId = $widget_id;\n\t\t//debug($widgetsList);\n\n\t\t$contextUser = \"thinkPanda.Context.clear();thinkPanda.Context.setUser('#userBox_\".$user['id'].\"', '.contextItem', \".$user['id'].\");\";\n\t\t//.\"thinkPanda.Widget.load();\"\n\t\t$shortcuts = array(\n\t\t\tarray(\n\t\t\t\t'id' => \"notificationProfiles\",\n\t\t\t\t'onclick'\t=> \"thinkPanda.Widget.set('#widget_button_profiles', '.widget_button', '#workspace_default', 'profiles');\". $contextUser,\n\t\t\t\t'title' => $user['fullname'].'\\'s Profile',\n\t\t\t\t'image' => '/profiles/img/icon.png'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => \"notificationThinkers\",\n\t\t\t\t'onclick'\t=> \"thinkPanda.Widget.set('#widget_button_thinkers', '.widget_button', '#workspace_default', 'thinkers');\". $contextUser,\n\t\t\t\t'title' => $user['fullname'].'\\'s Thinkers Network',\n\t\t\t\t'image' => '/thinkers/img/icon.png'\n\t\t\t),\t\t\t\n\t\t\tarray(\n\t\t\t\t'id' => \"notificationThoughts\",\n\t\t\t\t'onclick'\t=> \"thinkPanda.Widget.set('#widget_button_thoughts', '.widget_button', '#workspace_default', 'thoughts');\". $contextUser,\n\t\t\t\t'title' => $user['fullname'].'\\'s Thoughts',\n\t\t\t\t'image' => '/thoughts/img/icon.png'\n\t\t\t),\n\t\t);\n\n\t\t// SET VARIABLES\n\t\t\n\t\t//$this->pageTitle = $this->User->user['User']['fullname'];\n\t\t//$entityOn = $this->core['entityOn'];\n\t\t$this->set(compact('streamsList', 'selectStreamId', 'widgetsList', 'selectWidgetId', 'entityOn', 'shortcuts'));\n\t}", "function monitor_list_activity_types() {\n $query = \"select distinct(`wf_type`) from `\".GALAXIA_TABLE_PREFIX.\"activities`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_type'];\n }\n return $ret; \n }", "function _filter_block_content_callback($matches)\n {\n }", "function postflight($type, $parent)\n\t{\n\t\t// Adding Category \"uncategorized\" if installing or discovering.\n\t\tif ($type != 'update')\n\t\t{\n\t\t\t$this->_addCategory();\n\t\t}\n\n\t\t// Adding content_type for tags\n\t\t$table = JTable::getInstance('Contenttype', 'JTable');\n\t\tif(!$table->load(array('type_alias' => 'com_sermonspeaker.sermon')))\n\t\t{\n\t\t\t$common\t= new stdClass;\n\t\t\t$common->core_content_item_id\t= 'id';\n\t\t\t$common->core_title\t\t\t\t= 'title';\n\t\t\t$common->core_state\t\t\t\t= 'state';\n\t\t\t$common->core_alias\t\t\t\t= 'alias';\n\t\t\t$common->core_created_time\t\t= 'created';\n\t\t\t$common->core_modified_time\t\t= 'modified';\n\t\t\t$common->core_body\t\t\t\t= 'notes';\n\t\t\t$common->core_hits\t\t\t\t= 'hits';\n\t\t\t$common->core_publish_up\t\t= null;\n\t\t\t$common->core_publish_down\t\t= null;\n\t\t\t$common->core_access\t\t\t= null;\n\t\t\t$common->core_params\t\t\t= null;\n\t\t\t$common->core_featured\t\t\t= null;\n\t\t\t$common->core_metadata\t\t\t= null;\n\t\t\t$common->core_language\t\t\t= 'language';\n\t\t\t$common->core_images\t\t\t= 'picture'; // Does this work?\n\t\t\t$common->core_urls\t\t\t\t= null;\n\t\t\t$common->core_version\t\t\t= null;\n\t\t\t$common->core_ordering\t\t\t= 'ordering';\n\t\t\t$common->core_metakey\t\t\t= 'metakey';\n\t\t\t$common->core_metadesc\t\t\t= 'metadesc';\n\t\t\t$common->core_catid\t\t\t\t= 'catid';\n\t\t\t$common->core_xreference\t\t= null;\n\t\t\t$common->asset_id\t\t\t\t= null;\n\n\t\t\t$field_mappings\t= new stdClass;\n\t\t\t$field_mappings->common[]\t\t= $common;\n\t\t\t$field_mappings->special\t\t= array();\n\n\t\t\t$special\t= new stdClass;\n\t\t\t$special->dbtable\t\t= '#__sermon_sermons';\n\t\t\t$special->key\t\t\t= 'id';\n\t\t\t$special->type\t\t\t= 'Sermon';\n\t\t\t$special->prefix\t\t= 'SermonspeakerTable';\n\t\t\t$special->config\t\t= 'array()';\n\n\t\t\t$table_object\t= new stdClass;\n\t\t\t$table_object->special\t= $special;\n\n\t\t\t$contenttype['type_title']\t\t= 'Sermon';\n\t\t\t$contenttype['type_alias']\t\t= 'com_sermonspeaker.sermon';\n\t\t\t$contenttype['table']\t\t\t= json_encode($table_object);\n\t\t\t$contenttype['rules']\t\t\t= '';\n\t\t\t$contenttype['router']\t\t\t= 'SermonspeakerHelperRoute::getSermonRoute';\n\t\t\t$contenttype['field_mappings']\t= json_encode($field_mappings);\n\n\t\t\t$table->save($contenttype);\n\t\t}\n\n\t\t// Setting some default values for columns on install\n\t\tif ($type == 'install')\n\t\t{\n\t\t\t$params\t= array();\n\t\t\t$params['col']\t\t\t='\"col\":['\n\t\t\t\t\t.'\"sermons:scripture\",\"sermons:speaker\",\"sermons:date\",\"sermons:series\",\"sermons:player\"'\n\t\t\t\t\t.',\"sermon:scripture\",\"sermon:speaker\",\"sermon:date\",\"sermon:series\",\"sermon:player\",\"sermon:notes\",\"sermon:addfile\"'\n\t\t\t\t\t.',\"serie:scripture\",\"serie:speaker\",\"serie:date\",\"serie:player\"'\n\t\t\t\t\t.',\"speaker:scripture\",\"speaker:date\",\"speaker:series\",\"speaker:player\"'\n\t\t\t\t\t.',\"seriessermon:scripture\",\"seriessermon:speaker\",\"seriessermon:date\"'\n\t\t\t\t.']';\n\t\t\t$params['col_serie']\t= '\"col_serie\":['\n\t\t\t\t\t.'\"series:speaker\"'\n\t\t\t\t\t.',\"serie:description\",\"serie:speaker\"'\n\t\t\t\t\t.',\"speaker:description\"'\n\t\t\t\t\t.',\"seriessermon:description\",\"seriessermon:speaker\"'\n\t\t\t\t.']';\n\t\t\t$params['col_speaker']\t= '\"col_speaker\":[\"speakers:bio\",\"speaker:bio\",\"speaker:intro\"]';\n\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->update($db->quoteName('#__extensions'));\n\t\t\t$query->set($db->quoteName('params').' = '.$db->quote('{'.implode(',', $params).'}'));\n\t\t\t$query->where($db->quoteName('name').' = '.$db->quote('com_sermonspeaker'));\n\t\t\t$db->setQuery($query);\n\t\t\t$db->execute();\n\t\t}\n\n\t\t// Migrate tags on update if table exists\n\t\tif ($type == 'update')\n\t\t{\n\t\t\t$db = JFactory::getDBO();\n\t\t\t$tables\t= $db->getTableList();\n\t\t\t$prefix\t= $db->getPrefix();\n\t\t\tif (in_array($prefix.'sermon_tags', $tables))\n\t\t\t{\n\t\t\t\trequire_once(JPATH_ADMINISTRATOR.'/components/com_sermonspeaker/tables/sermon.php');\n\t\t\t\t$sermontable = new SermonspeakerTableSermon($db);\n\t\t\t\t$query\t= $db->getQuery(true);\n\t\t\t\t$query->select($db->quoteName('sermon_id'));\n\t\t\t\t$query->select('GROUP_CONCAT(CONCAT('.$db->quote('#new#').','.$db->quoteName('t.title').') SEPARATOR \\'\",\"\\') AS tagtitles');\n\t\t\t\t$query->from($db->quoteName('#__sermon_sermons_tags').' AS s');\n\t\t\t\t$query->join('LEFT', $db->quoteName('#__sermon_tags').' AS t ON '.$db->quoteName('s.tag_id').' = '.$db->quoteName('t.id'));\n\t\t\t\t$query->group($db->quoteName('sermon_id'));\n\t\t\t\t$db->setQuery($query);\n\t\t\t\t$result = $db->loadObjectList('sermon_id');\n\t\t\t\tforeach ($result as $sermon)\n\t\t\t\t{\n\t\t\t\t\t$sermontable->load($sermon->sermon_id);\n\t\t\t\t\t$sermontable->metadata = '{\"tags\":[\"'.$sermon->tagtitles.'\"]}';\n\t\t\t\t\t$sermontable->store();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$db->dropTable('#__sermon_tags');\n\t\t\t\t$db->dropTable('#__sermon_sermons_tags');\n\t\t\t\t$this->app->enqueueMessage(JText::sprintf('COM_SERMONSPEAKER_TAGS_MIGRATED', count($result)), 'notice');\n\t\t\t}\n\t\t}\n\n\t\t$this->app->enqueueMessage(JText::_('COM_SERMONSPEAKER_POSTFLIGHT'), 'warning');\n\t}", "function isActivity() {\n\t\treturn $this->repoObj->lobType == 'activity';\n\t}", "public function browse($type = null, $param = null,$isRedirect = true) {\n if($isRedirect) {\n $page = (!empty($this->request->named['page'])) ? $this->request->named['page'] : 1;\n }\n else {\n $page = $this->request->query('page') ? $this->request->query('page') : 1;\n }\n $uid = $this->Auth->user('id');\n $role_id = $this->_getUserRoleId();\n\n if (!empty($this->request->named['category_id'])) {\n $type = 'category';\n $param = $this->request->named['category_id'];\n }\n $this->set('title_for_layout', __( 'Videos'));\n $url = (!empty($param) ) ? $type . '/' . $param : $type;\n //$data = '';\n $sFriendsList = '';\n switch ($type) {\n case 'home':\n case 'my':\n case 'friends':\n $this->_checkPermission();\n $param = $uid;\n break;\n\n case 'search':\n $param = urldecode($param);\n\n if (!Configure::read('core.guest_search') && empty($uid))\n $this->_checkPermission();\n\n break;\n\n case 'group':\n // check permission if group is private\n $this->loadModel('Group.Group');\n $group = $this->Group->findById($param);\n\n $this->loadModel('Group.GroupUser');\n $is_member = $this->GroupUser->isMember($uid, $param);\n\n if ($group['Group']['type'] == PRIVACY_PRIVATE) {\n $cuser = $this->_getUser();\n\n if (!$cuser['Role']['is_admin'] && !$is_member)\n {\n if($isRedirect) {\n $this->autoRender = false;\n echo 'Only group members can view videos';\n return;\n }\n else {\n $this->throwErrorCodeException('not_group_member');\n return $error = array(\n 'code' => 400,\n 'message' => __('Only group members can view videos'),\n );\n }\n }\n }\n\n $this->set('is_member', $is_member);\n $this->set('ajax_view', true);\n $this->set('group_id', $param);\n $this->set('groupname', $group['Group']['name']);\n\n //$data['is_member'] = $is_member;\n //$data['ajax_view'] = true;\n //$data['groupname'] = $group['Group']['name'];\n break;\n default:\n $this->loadModel('Friend');\n $friends_list = $this->Friend->getFriendsList($uid);\n $aFriendListId = array_keys($friends_list);\n $sFriendsList = implode(',', $aFriendListId);\n if ($type != 'category'){\n $param = $uid;\n }\n }\n $more_result = 0;\n $videos = $this->Video->getVideos($type, $param, $page, RESULTS_LIMIT, $sFriendsList, $role_id);\n $more_videos = $this->Video->getVideos($type, $param, $page + 1, RESULTS_LIMIT, $sFriendsList, $role_id);\n\n if(!empty($more_videos)){\n $more_result = 1;\n }\n\n $this->loadModel('Group.GroupUser');\n foreach ($videos as $key => $video){\n $admins = $this->GroupUser->getUsersList($video['Video']['group_id'], GROUP_USER_ADMIN);\n $videos[$key]['Video']['admins'] = $admins;\n } \n\n $this->set('videos', $videos);\n $this->set('more_url', '/videos/browse/' . h($url) . '/page:' . ( $page + 1 ));\n $this->set('more_result', $more_result);\n\n // MOOSOCIAL-2214\n if ($type == 'group'){\n $this->set('type', 'Group_Group');\n }\n \n if($isRedirect && $this->theme != \"mooApp\") {\n if ($page == 1 && $type == 'home'){\n $this->render('/Elements/ajax/home_video');\n }\n elseif ($page == 1 && $type == 'group'){\n $this->render('/Elements/ajax/group_video');\n }\n else {\n if ($this->request->is('ajax')){\n $this->render('/Elements/lists/videos_list');\n }\n else{\n $this->render('/Elements/lists/videos_list_m');\n }\n }\n }\n else { \n if($type == 'category') $this->set('categoryId', $param);\n $this->set('type', $type);\n }\n }", "public function createACFBlock()\n {\n if (function_exists('acf_register_block_type')) {\n acf_register_block_type(\n array(\n 'name' => 'acfBlock',\n 'title' => __('ACF Block'),\n 'description' => __('A custom block that incorporates ACF fields.'),\n 'render_callback' => array($this, 'renderACFBlock'),\n 'category' => 'widgets',\n 'icon' => array('background' => '#ecf6f6', 'src' => 'email'),\n 'keywords' => array('example', 'acf'),\n 'mode' => 'edit'\n )\n );\n }\n }", "public static function add_atom_activity_object() {\n /*\n * The object type of the current post in the Activity Streams 1 feed\n *\n * @param Object $comment_post The current post\n */\n $object_type = apply_filters( 'as1_object_type', 'article', get_post() );\n?>\n <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>\n <activity:object>\n <activity:object-type>http://activitystrea.ms/schema/1.0/<?php echo $object_type; ?></activity:object-type>\n <id><?php the_guid(); ?></id>\n <title type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_title(); ?>]]></title>\n <summary type=\"<?php html_type_rss(); ?>\"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary>\n <link rel=\"alternate\" type=\"text/html\" href=\"<?php the_permalink_rss() ?>\" />\n </activity:object>\n<?php\n }", "function bp_attachments_personal_screen() {\n\n\t/**\n\t * Fires right before the loading of the \"My Media\" screen template file.\n\t *\n\t * @since 1.0.0\n\t */\n\tdo_action( 'bp_attachments_personal_screen' );\n\n\t/**\n\t * Filters the template to load for the \"My Media\" screen.\n\t *\n\t * @since 1.0.0\n\t *\n\t * @param string $template Path to the attachments template to load.\n\t */\n\tbp_core_load_template( apply_filters( 'bp_activity_template_my_activity', 'members/single/home' ) );\n}", "public static function register_simple_view_block() {\n\t\tif ( ! is_callable( 'register_block_type' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( is_admin() ) {\n\t\t\t// register back-end scripts\n\t\t\tadd_action( 'enqueue_block_editor_assets', 'FrmProSimpleBlocksController::block_editor_assets' );\n\t\t}\n\n\t\tregister_block_type(\n\t\t\t'formidable/simple-view',\n\t\t\tarray(\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'viewId' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t),\n\t\t\t\t\t'filter' => array(\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'default' => 'limited',\n\t\t\t\t\t),\n\t\t\t\t\t'useDefaultLimit' => array(\n\t\t\t\t\t\t'type' => 'boolean',\n\t\t\t\t\t\t'default' => false,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'editor_style' => 'formidable',\n\t\t\t\t'editor_script' => 'formidable-view-selector',\n\t\t\t\t'render_callback' => 'FrmProSimpleBlocksController::simple_view_render',\n\t\t\t)\n\t\t);\n\t}", "public function blockUser($id) {\n\t\t//Argument 1 must be a string, integer\n\t\tEden_Twitter_Error::i()->argument(1, 'string', 'int');\t\n\t\t\n\t\t//if it is integer\n\t\tif(is_int($id)) {\n\t\t\t//lets put it in our query\n\t\t\t$this->_query['user_id'] = $id;\n\t\t//else it is string\n\t\t} else {\n\t\t\t//lets put it in our query\n\t\t\t$this->_query['screen_name'] = $id;\n\t\t}\n\t\t\n\t\treturn $this->_post(self::URL_CREATE_BLOCKING, $this->_query);\n\t}", "function show_leaving_page()\n\t\t{\n\t\t\t$this->t->set_file('leaving_activity', 'leaving_activity.tpl');\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'wf_procname'\t=> $this->process_name,\n\t\t\t\t'procversion'\t=> $this->process_version,\n\t\t\t\t'actname'\t=> $this->activity_name,\n\t\t\t));\n\t\t\t\n\t\t\t//check real avaible actions on this instance\n\t\t\t//we assume user is not in read-only mode, if he were actions would be blocked anyway, and he should not come \n\t\t\t//here with a read-only right\n\t\t\t$actions = $this->GUI->getUserActions($GLOBALS['user'],$this->instance_id,$this->activity_id, false);\n\t\t\tif (isset($actions['release']))\n\t\t\t{//we can release, it means we were not in auto-release mode\n\t\t\t\t//prepare a release command on the user_instance form\n\t\t\t\t$link_array = array(\n\t\t\t\t\t'menuaction'\t\t=> 'workflow.ui_userinstances.form',\n\t\t\t\t\t'filter_process'\t=> $this->process_id,\n\t\t\t\t\t'filter_instance'\t=> $this->instance_id,\n\t\t\t\t\t'iid'\t\t\t=> $this->instance_id,\n\t\t\t\t\t'aid'\t\t\t=> $this->activity_id,\n\t\t\t\t\t'release'\t\t=> 1,\n\t\t\t\t);\n\t\t\t\t$releasetxt = lang('release activity for this instance');\n\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t'release_text'\t=> lang('This activity for this instance is actually only avaible for you.'),\n\t\t\t\t\t'release_button'=> '<a href=\"'.$GLOBALS['egw']->link('/index.php',$link_array)\n\t\t\t\t\t\t.'\"><img src=\"'. $GLOBALS['egw']->common->image('workflow', 'fix')\n\t\t\t\t\t\t.'\" alt=\"'.$releasetxt.'\" title=\"'.$releasetxt.'\" width=\"16\" >'\n\t\t\t\t\t\t.$releasetxt.'</a>',\n\t\t\t\t));\n\t\t\t}\n\t\t\telse\n\t\t\t{//we cannot release, 3 reasons\n\t\t\t // * already done in auto-release\n\t\t\t // * standalone or view activity\n\t\t\t // * multi-user concurrency problem moved some engine objects in other states\n\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t'release_text'\t=> lang('This activity for this instance is not specifically assigned to you.'),\n\t\t\t\t\t'release_button'=> '',\n\t\t\t\t));\n\n\t\t\t}\n\t\t\t$this->translate_template('leaving_activity');\n\t\t\t$this->t->pparse('output', 'leaving_activity');\n\t\t\t$this->show_after_running_page();\n\t\t}", "public function registerActivity() {\n }", "function enqueueBlock() {\n wp_enqueue_script(\n 'ugroup-new-block',\n plugin_dir_url(__FILE__) . 'ugroup-test.js',\n array('wp-blocks','wp-editor'),\n true\n );\n}", "public function block()\n {\n $this->type = 'block';\n\n return $this;\n }", "function yourtab_incidents() {\n add_action( 'bp_template_title', 'yourtab_incidents_title' );\n add_action( 'bp_template_content', 'yourtab_incidents_content' );\n bp_core_load_template( 'buddypress/members/single/plugins' );\n}" ]
[ "0.6080092", "0.5801954", "0.5749655", "0.55721563", "0.5500849", "0.5484067", "0.52682984", "0.52105767", "0.517754", "0.50663733", "0.50582033", "0.5043011", "0.50413674", "0.50001854", "0.5000131", "0.49938315", "0.49930844", "0.49695605", "0.49414673", "0.49180478", "0.4912166", "0.4906754", "0.49035168", "0.48724338", "0.48508427", "0.48458344", "0.48449445", "0.48440832", "0.483999", "0.48335868", "0.48335868", "0.48261994", "0.48224592", "0.48194164", "0.48154303", "0.48038018", "0.4799955", "0.47918558", "0.47651422", "0.47485912", "0.47224694", "0.471477", "0.47066388", "0.47044575", "0.46971238", "0.46970212", "0.4695421", "0.46896842", "0.46863386", "0.4680797", "0.46735993", "0.46718422", "0.46641943", "0.46639442", "0.4663532", "0.46559757", "0.4654135", "0.4654107", "0.46468356", "0.46432275", "0.4634876", "0.46303537", "0.46246123", "0.46207637", "0.46031052", "0.45991", "0.45919102", "0.45869493", "0.45850292", "0.45808923", "0.45734012", "0.45701215", "0.45636532", "0.45633787", "0.45607123", "0.45602405", "0.4557356", "0.4555245", "0.45548955", "0.4553611", "0.4553433", "0.45483905", "0.454719", "0.45453057", "0.45406702", "0.4529876", "0.4528355", "0.45251456", "0.45196736", "0.45175198", "0.4516212", "0.4506774", "0.4506558", "0.4494144", "0.44937897", "0.44934115", "0.44907707", "0.44880942", "0.448538", "0.4483798" ]
0.4854846
24
walk through file, with basename as date start, extension as limitation check if date start expires limitation, if dose, foreach lines, del it remove repeat item
public function expire($key, $ttl) { $filename = $this->_path.date('Y-m-d').'.'.$ttl; $mod = $this->getFileMod($key); $val = $mod.DIRECTORY_SEPARATOR.$key.PHP_EOL; TL_FSO::createFile($filename, $val, 'ab+'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteExpiredFiles(){\r\n $dir = $this->emailVerify->getDataFolder().self::FOLDER_PATH;\r\n foreach (glob($dir.\"*.token\") as $file) {\r\n $uF = unserialize(gzdecode(file_get_contents($file)));\r\n $tee = new TokenExpireEvent($this->emailVerify, $uF[\"token\"]);\r\n $this->emailVerify->getServer()->getPluginManager()->callEvent($tee);\r\n if (!$uF[\"valid\"] and filemtime($file) < time() - 60*60*24*7) {\r\n unlink($file);\r\n }\r\n }\r\n }", "function clean_old_files(){\n\t$files = scandir(OUTPUT_FOLDER);\n\tforeach($files as $file){\n\t\tif($file != '.' && $file != '..'){\n\t\t\t$ext = substr($file,-4,4);\n\t\t\tif($ext == 'json'){\n\t\t\t\t$filemtime = filemtime(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t$diff = time() - $filemtime;\n\t\t\t\tif($diff >= FILE_LIFETIME){\n\t\t\t\t\t@unlink(OUTPUT_FOLDER.'/'.$file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "public function cleanup() {\n $dirIt = new DirectoryIterator($this->path);\n // Convert days to seconds\n $lifetimeSeconds = self::$lifetime * 3600 * 24;\n /** @var DirectoryIterator $fileInfo */\n foreach ($dirIt as $fileInfo) {\n if ($fileInfo->isDot()) {\n continue;\n }\n $fileAge = time() - $fileInfo->getMTime();\n if ($fileAge > $lifetimeSeconds) {\n $this->deleteFile();\n }\n }\n }", "function deleteOldInvs() {\n\tif ($handle = opendir('./')) {\n\t\twhile (false !== ($file = readdir($handle))) { \n\t\t\t$ext = substr($file, -3);\n\t\t\tif ($ext != 'inv')\n\t\t\t\tcontinue;\n\t\t\tif((time() - filemtime($file)) > 86400)\n\t\t\t\tunlink($file);\n\n\t\t}\n\t\tclosedir($handle); \n\t}\n}", "function apagaAntigo($pasta, $extensao) {\r\n $date = strtotime('-30 day', time());\r\n foreach (glob($pasta . '/*.' . $extensao) as $file) {\r\n $filetime = filemtime($file);\r\n if ($date > $filetime) {\r\n unlink($file);\r\n }\r\n }\r\n }", "public function deleteExpiredLogs()\n {\n $client = $this->createLocalStorageDriver();\n\n $allFiles = $client->files();\n\n foreach ($allFiles as $file) {\n $fileDate = new DateTime(str_replace('.json', '', $file));\n\n $currentDate = new DateTime(date('d-m-Y'));\n\n $interval = $fileDate->diff($currentDate);\n\n if ($interval->days > $this->expireDays) {\n $client->delete($file);\n }\n }\n }", "function DateTimeclearThumbCache () {\n\n if ($fd = opendir ($this->thumbDir)) {\n while ($current_file = readdir ($fd)) {\n if ($current_file[0] != '.'\n && !is_dir ($this->thumbDir.$current_file) \n && eregi ('^.*(' . $this->file . ')$', $current_file)){\n files::deleteFile ($this->thumbDir.$current_file);\n }\n }\n closedir ($fd);\n }\n }", "function logCheckOnFixDate()\n\t{\n\t\t// Soll durchgefuehrt werden?\n\t\tif (!$this->m_enable || !$this->m_eraseFilesEnable)\n\t\t{\t\n\t\t\treturn 0;\n\t\t}\n\t\n\t\t// Namen der Logdateien fuer die letzten n Tage erstellen.\n\t\tfor ($i=0; $i < $this->m_eraseFilesCount; $i++)\n\t\t{\n\t\t\t// Dateiname der Logdatei\n\t\t\t$t = time();\n\t\t\t$t -= 3600 * 24 * $i;\n\t\t\t$ltm = localtime($t, 1);\n\t\t\t$fileName[$i] = sprintf($this->m_fileNameTemplate, \n\t\t\t\t$ltm[\"tm_year\"] % 100, $ltm[\"tm_mon\"] + 1, $ltm[\"tm_mday\"]);\n\t\t}\n\t\t// Alle anderen Logdateien loeschen \n\t\n\t\t$j = 0;\n\t\n\t\t// Suche nach Dateien\n\t\t$file = sprintf(\"%s%s\", $this->m_base, $this->m_sub);\n\t\n\t\tif (($dir = opendir($file)) != false)\n\t\t{\t\n\t\t\twhile(($j < $this->m_eraseFilesCount) && (($ent = readdir($dir)) != false))\n\t\t\t{\n\t\t\t\tif ($ent == \".\" || $ent == \"..\") continue;\n\t\t\t\t\n\t\t\t\tfor ($i=0; $i < $this->m_eraseFilesCount; $i++)\n\t\t\t\t{\n\t\t\t\t\t// Stimmt mit einem der zu erhaltenden Dateien ueberein?\n\t\t\t\t\tif (strstr($fileName[$i], $ent) != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($i == $this->m_eraseFilesCount)\n\t\t\t\t{\n\t\t\t\t\t// Sammeln der zu loeschenden Dateien,\n\t\t\t\t\t// da erst nach closedir geloescht werden kann!\n\t\t\t\t\t$deleteFileName[$j++] = $ent;\n\t\t\t\t} \n\t\t\t}\n\t\t\tclosedir($dir);\n\t\n\t\t\tif ($j)\n\t\t\t{\n\t\t\t\t// Dateien loeschen\n\t\t\t\tfor ($i=0; $i < $j; $i++)\n\t\t\t\t{\n\t\t\t\t\t$file = $this->m_base . $this->m_sub . $deleteFileName[$i];\n\t\t\t\t\t\n\t\t\t\t\tif (unlink($file) == false)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Konnte nicht geloescht werden!\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}", "function flush(){\n $path = $this->cachePath .'/'. $this->prefix .'*';\n $files = glob($path);\n $rm_total = 0;\n if (is_array($files) && !empty($files)){\n foreach($files as $file){\n $fp = fopen($file, \"r\");\n $meta = $this->_readMeta($fp);\n if ($meta['expired']!=0 && $meta['expired']<time()){\n fclose($fp);\n unlink($file);\n ++$rm_total;\n }\n }\n }\n return $rm_total;\n }", "protected function cleanupChunks(){\n\t\tforeach (scandir($this->chunksFolder) as $item){\n\t\t\tif ($item == \".\" || $item == \"..\")\n\t\t\t\tcontinue;\n\n\t\t\t$path = $this->chunksFolder.DIRECTORY_SEPARATOR.$item;\n\n\t\t\tif (!is_dir($path))\n\t\t\t\tcontinue;\n\n\t\t\tif (time() - filemtime($path) > $this->chunksExpireIn){\n\t\t\t\t$this->removeDir($path);\n\t\t\t}\n\t\t}\n\t}", "function cleanup($basedir, $age) {\n if (($handle = opendir($basedir))) {\n while (($file = readdir($handle)) !== false) {\n $entry = \"$basedir/$file\";\n if ($file != '.' && $file != '..' && (time() - filemtime($entry) > $age)) {\n if (is_dir($entry)) {\n removeDir($entry);\n } else {\n unlink($entry);\n }\n }\n }\n }\n}", "function parse_files_this_week() {\n\t$file_txt = get_transient('this_week_html');\n\n\tif( !$file_txt ) {\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://www.uvm.edu/~wruv/res/thisweek/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$file_txt = curl_exec($ch);\n\t\t$remaining_m = 15 -(date('i', time()) % 15);\n\t\tset_transient('this_week_html', $file_txt, $remaining_m * 60);\n\t}\n\treturn $file_txt;\n\tforeach( explode(\"\\n\", $file_txt) as $line ) {\n\t\tif( preg_match(\"/\\<a href=\\\"([^\\\"]+)\\\"/\", $line, $m ) ) {\n\t\t\t$fn = $m[1];\n\t\t\tif( preg_match(\"/^\\./\", $fn) || !preg_match(\"/^[0-9\\-]{10}/\", $fn) ) continue;\n\n\t\t\t$finfo = preg_split(\"/\\s{2,}/\", $line);\n\t\t\t$modified_str = $finfo[0];\n\t\t\t$size = $finfo[1];\n\n\t\t\t// var_export([$fn, $line, $modified_str, $size]); exit;\n\t\t}\n\t}\n/*\n\n my %files;\n my $now = time;\n\n foreach( split(/\\n/, $file_txt) ) {\n if( /<a href=\"([^\"]+)\"/ ) { #\"\n my $fn = $1;\n next if $fn =~ /^\\./ || $fn !~ /^[0-9\\-]{10}/;\n\n my (undef, $modified_str, $size) = split( /\\s{2,}/, $_ );\n\n my $modified = Date::Parse::str2time( $modified_str );\n my $now_uploading = $now - ($modified || 0) <= 1; #if it's been modified in the last 1 seconds, this is still being uploaded.\n\n my ($date, $rest) = split /00h_/, $fn;\n\n my ($y, $m, $d) = split /-/, $date;\n my $h;\n ($d, $h) = split /_/, $d;\n\n my $jd = julian_day($y, $m, $d);\n my $ts = jd_secondslocal($jd, $h, 0, 0);\n my $wkday_i = day_of_week( $jd );\n if( $h >= 0 && $h <= 4 ) {\n $wkday_i = ($wkday_i - 1) % 7;\n }\n\n my $wkday = qw(Sun Mon Tue Wed Thu Fri Sat)[day_of_week( $jd )];\n\n my $file_info = {\n now_uploading => $now_uploading,\n file => $fn,\n ts => $ts,\n 'y'=>$y,\n 'm'=>$m,\n 'd'=>$d,\n 'h'=>$h,\n 'wkday' => $wkday,\n 'wkday_i' => $wkday_i,\n # title => $slot_rec->{show_name},\n # genre => $slot_rec->{genre},\n # dj => $slot_rec->{show_dj_name},\n ## title => $title,\n ## genre => $genre,\n ## dj => $dj,\n ## dj_id => $slot_rec->{dj_id},\n };\n\n my $fkey = \"$wkday_i-$h\";\n\n #discard it unless we already found one for this slot and it's the one from this week\n next if exists $files{$fkey} && $files{$fkey}{ts} > $ts;\n $files{$fkey} = $file_info\n }\n }\n\n return [ sort { $a->{ts} <=> $b->{ts} } values %files ];\n}\n*/\n}", "private function removeOldMasterPDF()\n {\n foreach (File::files(storage_path('files')) as $file) {\n if ($file->getMTime() < Carbon::now()->AddDays(-config('app.exportFileTimeout', 5))->timestamp) {\n unlink($file->getPathname());\n }\n }\n }", "public function deleteExpire($files_list){\r\n $data_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Data';\r\n foreach($files_list as $key => $file){\r\n if($key >= Config::get(\"ipnet.expire_num\")){\r\n unlink($data_dir. DIRECTORY_SEPARATOR . $file['name']);\r\n }\r\n }\r\n }", "function purgeLog($file, $line_end, $max_bytes, $purge_bytes) {\r\n $size = filesize($file); //Check the log file size (bytes).\r\n if($size > $max_bytes){ //If log file is too big, delete some from the beginning\r\n $temp_string = file_get_contents($file, NULL, NULL, $purge_bytes); //Load the existing log file into a temporary string except for the first x number of bytes\r\n $temp_string = strstr($temp_string, $line_end); //Remove all characters prior to the first line break\r\n $temp_string = ltrim($temp_string); //Remove the first line break\r\n file_put_contents($file, $temp_string); //Print the temporary string to the log file, overwriting previous contents of the file\r\n }\r\n}", "function schedule_backup_course_delete_old_files($preferences,$starttime=0) {\n\n global $CFG;\n\n $status = true;\n\n //Calculate the directory to check\n $dirtocheck = \"\";\n //if $preferences->backup_destination isn't empty, then check that directory\n if (!empty($preferences->backup_destination)) {\n $dirtocheck = $preferences->backup_destination;\n //else calculate standard backup directory location\n } else {\n $dirtocheck = $CFG->dataroot.\"/\".$preferences->backup_course.\"/backupdata\";\n }\n schedule_backup_log($starttime,$preferences->backup_course,\" checking $dirtocheck\");\n if ($CFG->debug > 7) {\n mtrace(\" Keeping backup files in $dirtocheck\");\n }\n\n //Get all the files in $dirtocheck\n $files = get_directory_list($dirtocheck,\"\",false);\n //Get all matching files ($preferences->keep_name) from $files\n $matchingfiles = array();\n foreach ($files as $file) {\n if (substr($file, 0, strlen($preferences->keep_name)) == $preferences->keep_name) {\n $modifieddate = filemtime($dirtocheck.\"/\".$file);\n $matchingfiles[$modifieddate] = $file;\n }\n }\n //Sort by key (modified date) to get the oldest first (instead of doing that by name\n //because it could give us problems in some languages with different format names).\n ksort($matchingfiles);\n\n //Count matching files\n $countmatching = count($matchingfiles);\n schedule_backup_log($starttime,$preferences->backup_course,\" found $countmatching backup files\");\n mtrace(\" found $countmatching backup files\");\n if ($preferences->backup_keep < $countmatching) {\n schedule_backup_log($starttime,$preferences->backup_course,\" keep limit ($preferences->backup_keep) reached. Deleting old files\");\n mtrace(\" keep limit ($preferences->backup_keep) reached. Deleting old files\");\n $filestodelete = $countmatching - $preferences->backup_keep;\n $filesdeleted = 0;\n foreach ($matchingfiles as $matchfile) {\n if ($filesdeleted < $filestodelete) {\n schedule_backup_log($starttime,$preferences->backup_course,\" $matchfile deleted\");\n mtrace(\" $matchfile deleted\");\n $filetodelete = $dirtocheck.\"/\".$matchfile;\n unlink($filetodelete);\n $filesdeleted++;\n }\n }\n }\n return $status;\n}", "private function clean_cache()\n\t{\n\t\t//gc probability\n\t\t$gc = rand(1, Kohana::config($this->type.'.cache_gc'));\n\t\tif ($gc != 1) return FALSE;\n\t\t$cache = new DirectoryIterator(Kohana::config($this->type.'.cache_folder'));\n\t\twhile ($cache->valid())\n\t\t{\n\t\t\t// if file is past maximum cache settings delete file\n\t\t\t$cached = date('U', $cache->getMTime());\n\t\t\t$max = time() + Kohana::config($this->type.'.cache_clean_time');\n\t\t\tif ($cache->isFile() AND ($cached > $max))\n\t\t\t{\n\t\t\t\tunlink($cache->getPathname());\n\t\t\t}\n\t\t\t$cache->next();\n\t\t}\n\t}", "function filecabinet_delete_file($file_id, $min = 0) {\n // The passed $min parameter is the smallest count value that allows file deletion\n // if the file is not used, delete it (it may still be used in old revisions)\n $count = db_result(db_query(\"SELECT COUNT(afid) FROM {org_documents} WHERE afid = %d\", $file_id));\n if ($count <= $min) {\n $filepath = db_result(db_query(\"SELECT filepath FROM {files} WHERE fid = %d\", $file_id));\n if ($filepath) {\n file_delete($filepath);\n }\n }\n}", "public static function purge($time=NULL) {\r\n $lines = file(self::FILE_NAME);\r\n $report = NULL;\r\n\r\n if (!$time) $time = time() - 120;\r\n\r\n if (is_array($lines)) {\r\n foreach ($lines as $line) {\r\n if (rtrim($line)) {\r\n $elements = explode(\"\\t\", $line);\r\n if ($elements[1] < $time) {\r\n $report[] = $elements[0];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return $report;\r\n }", "private function selectFilesToKeep($files) {\n\t\t\t$filesToKeep = [];\n\t\t\tforeach($this->backupPolicy as $backupRule) {\n\n\t\t\t\t// Extract rule values\n\t\t\t\t$maxAge = $backupRule['maxAge'];\n\t\t\t\t$keepCount = FALSE;\n\t\t\t\t$keepPeriod = '1D';\n\t\t\t\tif($backupRule['keep'] !== '*') {\n\t\t\t\t\tif(preg_match('/^(\\d+)\\/(\\d+[YMWD])$/', $backupRule['keep'], $keepMatches) === 1) {\n\t\t\t\t\t\t$keepCount = intval($keepMatches[1]);\n\t\t\t\t\t\t$keepPeriod = $keepMatches[2];\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror_log('Invalid \"keep\" value in backup rule: \"' . $backupRule['keep'] . '\". Keeping all files.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Calculate end date based on age (subtracting age from 'now')\n\t\t\t\t$now = now();\n\t\t\t\t$endDate = now();\n\t\t\t\t$endDate->sub(new DateInterval('P' . $maxAge));\n\n\t\t\t\t// Select all files which match the backup rule period and are not already marked for keeping\n\t\t\t\t$newFilesWithinPeriod = $this->selectNewFilesWithinPeriod($files, $endDate, $filesToKeep);\n\n\t\t\t\t// Reverse file order so oldest files are kept (within period) using following algorithm\n\t\t\t\t$newFilesWithinPeriod = array_reverse($newFilesWithinPeriod);\n\n\t\t\t\t// Select the files to keep by going 'back' to 'now' and selecting $keepCount files per sub-period\n\t\t\t\twhile($endDate < $now) {\n\n\t\t\t\t\t// Calculate sub-period\n\t\t\t\t\t$nextEndDate = clone $endDate;\n\t\t\t\t\t$nextEndDate->add(new DateInterval('P' . $keepPeriod));\n\n\t\t\t\t\t// Count how many files are already to be kept (matching this sub-period)\n\t\t\t\t\tif($keepCount !== FALSE) {\n\t\t\t\t\t\t$foundCount = self::countFilesMatchingPeriod($filesToKeep, $endDate, $nextEndDate);\n\t\t\t\t\t}\n\n\t\t\t\t\t// Find additional files which match this sub-period (if still more are required)\n\t\t\t\t\tif($keepCount === FALSE || $foundCount < $keepCount) {\n\t\t\t\t\t\t$newFilesWithinSubPeriod = array_filter($newFilesWithinPeriod, function($file) use($endDate, $nextEndDate) {\n\t\t\t\t\t\t\treturn self::fileMatchesPeriod($file, $endDate, $nextEndDate);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// Add required number of files\n\t\t\t\t\t\tif($keepCount === FALSE || count($newFilesWithinSubPeriod) <= $keepCount - $foundCount) {\n\t\t\t\t\t\t\t$filesToKeep = array_merge($filesToKeep, $newFilesWithinSubPeriod);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$filesToKeep = array_merge($filesToKeep, self::selectCountFiles($newFilesWithinSubPeriod, $keepCount - $foundCount));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Skip to next period\n\t\t\t\t\t$endDate = $nextEndDate;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $filesToKeep;\n\t\t}", "function logCheckOnWorkDate()\n\t{\n\t\t// Soll durchgefuehrt werden?\n\t\tif (!$this->m_enable || !$this->m_eraseFilesEnable)\n\t\t{\t\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t// Suche nach Dateien in Verzeichnis\n\t\t$dir = sprintf(\"%s%s\", $this->m_base, $this->m_sub);\n\t\tif (($resource = opendir($dir)) != false)\n\t\t{\t\n\t\t\twhile(($file = readdir($resource)) != false)\n\t\t\t{\n\t\t\t\tif ($file == \".\" || $file == \"..\") continue;\n\t\t\t\t\n\t\t\t\t// Passt Dateiname zu Format der Logdateinamen\n\t\t\t\tif (eregi($this->m_fileNameTemplateMatch, $file))\n\t\t\t\t{\n\t\t\t\t\t// In Liste aufnehmen\n\t\t\t\t\t$fileList[$fileCount++] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($resource);\n\t\n\t\t\t// Wurden Dateien gefunden.\n\t\t\tif ($fileCount)\n\t\t\t{\t\n\t\t\t\t$fileCount = 0;\n\t\t\t\t// Array der gefundenen Dateien sortieren.\n\t\t\t\trsort($fileList);\n\t\t\t\t\n\t\t\t\tfor (; count($fileList);)\n\t\t\t\t{\t\n\t\t\t\t\t// Ist Datei von selbigem Datum?\n\t\t\t\t\tif (strncmp($tmp, $fileList[0], 10) == false)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Datei mit gleichem Datums-Zeichenfolgenbeginn\n\t\t\t\t\t\t// Kann sein, da fuer verschiedene Kanaele gelogt werden kann.\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Datums-Zeichenfolge des Dateinamen aufnehmen.\n\t\t\t\t\t\t$tmp = $fileList[0];\n\t\t\t\t\t\t$fileCount++; // Zu erhaltende Datei\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Datumsbereich der zu erhaltenden Dateien ueberschritten?\n\t\t\t\t\tif ($fileCount > $this->m_eraseFilesCount)\n\t\t\t\t\t{\n\t\t\t\t\t\t$file = $this->m_base . $this->m_sub . $fileList[0];\n\t\t\t\t\t\tif (unlink($file) == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Konnte nicht geloescht werden!\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//echo \"Erase file: \" . $fileList[0] . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\t//echo \"Hold file: \" . $fileList[0] . \"\\n\";\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Datei aus Array entfernen\n\t\t\t\t\tarray_shift($fileList);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}", "function _checkLimitReached($sFile) {\n // file is not existing\n if (!file_exists($sFile)) {\n return false;\n }\n\n // is file older then 6 hours?\n $iCutoff = time() - (3600 * 6);\n if (filemtime($sFile) <= $iCutoff) {\n @unlink($sFile);\n return false;\n }\n\n // file is existing and not expired!\n return true;\n }", "private function removeOldParts()\n {\n $filename = $this->substream->getFilename();\n for ($i = $this->index + 1; true; ++$i) {\n $indexed_filename = $this->getIndexPartFilename($filename, $i);\n $target = dirname($this->filename).'/'.$indexed_filename;\n if (file_exists($target)) {\n unlink($target);\n } else {\n break;\n }\n }\n }", "private function clearOldFiles()\r\n {\r\n // Buscando itens na pasta\r\n $files = new \\DirectoryIterator( $this->backupFolder );\r\n\r\n // Passando pelos itens\r\n $sortedFiles = array();\r\n foreach ($files as $file) {\r\n // Se for um arquivo\r\n if ($file->isFile()) {\r\n // Adicionando em um vetor, sendo o índice a data de modificação\r\n // do arquivo, para assim ordenarmos posteriormente\r\n $sortedFiles[$file->getMTime()] = $file->getPathName();\r\n }\r\n }\r\n\r\n // Ordena o vetor em ordem decrescente\r\n arsort( $sortedFiles );\r\n\r\n // Passando pelos arquivos\r\n $numberFiles = 0;\r\n foreach ($sortedFiles as $file) {\r\n $numberFiles++;\r\n // Se a quantidade de arquivo for maior que a quantidade\r\n // máxima definida\r\n if ($numberFiles > $this->maxNumberFiles) {\r\n // Removemos o arquivo da pasta\r\n unlink( $file );\r\n echo \"Apagado backup '{$file}'\" . PHP_EOL;\r\n }\r\n }\r\n\r\n }", "function charrestore_deleted_when($date)\n{\n// http://www.dreamincode.net/code/snippet86.htm\n\n\t // array of time period chunks\n\t $chunks = array(\n\t\t array(60 * 60 * 24 * 365, 'year'),\n\t\t array(60 * 60 * 24 * 30, 'month'),\n\t\t array(60 * 60 * 24 * 7, 'week'),\n\t\t array(60 * 60 * 24, 'day'),\n\t\t array(60 * 60, 'hour'),\n\t\t array(60, 'minute'),\n\t );\n\t \n\t $today = time();\n\t $since = $today - $date;\n\t \n\t // $j saves performing the count function each time around the loop\n\t for( $i=0, $j=count($chunks); $i<$j; $i++ )\n\t {\n\t\t \n\t\t $seconds = $chunks[$i][0];\n\t\t $name = $chunks[$i][1];\n\t\t \n\t\t // finding the biggest chunk (if the chunk fits, break)\n\t\t if( ($count = floor($since / $seconds)) != 0 )\n\t\t {\n\t\t\t\tbreak;\n\t\t }\n\t }\n\t \n\t $print = ($count == 1) ? '1 '.$name : \"$count {$name}s\";\n\t \n\t if( $i + 1 < $j )\n\t {\n\t\t // now getting the second item\n\t\t $seconds2 = $chunks[$i + 1][0];\n\t\t $name2 = $chunks[$i + 1][1];\n\t\t \n\t\t // add second item if it's greater than 0\n\t\t if( ($count2 = floor(($since - ($seconds * $count)) / $seconds2)) != 0 )\n\t\t {\n\t\t\t\t$print .= ($count2 == 1) ? ', 1 '.$name2 : \", $count2 {$name2}s\";\n\t\t }\n\t }\n\t return $print;\n}", "public function test_purge() {\n\t\t$purgedFilesInt = Cdnmd5::purge('-1 day');\n\t\t// ensure THIS file exists as a valid hash\n\t\t$this->assertEqual($this->testfile_js_hash, Cdnmd5::makeHash($this->testfile_js));\n\t\t$purgedFilesInt = Cdnmd5::purge('-1 day');\n\t\t$this->assertEqual(0, $purgedFilesInt);\n\t\t// remove THIS file as a valid hash\n\t\t@unlink(Cdnmd5::getConfigFile($this->testfile_js));\n\t\t$purgedFilesInt = Cdnmd5::purge('+1 day');\n\t\t// NOTE: this may not work, if this file was modified and uploaded in\n\t\t// less than 1 sec... (hash/modified timstampes will differ)\n\t\t// also there are a few hours timezone discrepancies...\n\t\t#$this->assertEqual(1, $purgedFilesInt);\n\t\t$this->assertTrue($purgedFilesInt > 0 && $purgedFilesInt < 10);\n\t\t// TODO: idea for better test, upload some \"trash\" files and ensure those are purged\n\t}", "function photo_cache_cleanup_by_date($date)\n{\n\t$counter=0;\n\t$days_in_sec=$date*86400; //seconds day\n\t\n\t$query=$GLOBALS['db']->Execute(\"SELECT photo_id, date, used FROM \".PREFIX.\"photo_cache\");\n\twhile($data = $query->FetchRow())\n\t{\n\t\t/**\n\t\t * select cache entries older X days\n\t\t */\n\t\t\n\t\t$date = $GLOBALS['db']->UnixTimeStamp($data[1]);\t\t\t\t\t\t\t\n\t\t$used = $GLOBALS['db']->UnixTimeStamp($data[2]);\n\t\t\n\t\tif($used < (time()-$days_in_sec) || ( $used == 0 && $date < (time()-$days_in_sec)))\n {\n $counter++;\n photo_cache_cleanup_by_id($data[0]);\n\t\t}\n\t}\n\treturn $counter;\n}", "function _removeFileIfTtlExpired ($sFile, $iTTL)\r\n\t{\r\n $iTimeDiff = time() - filectime($sFile);\r\n if ($iTimeDiff > $iTTL) {\r\n @unlink ($sFile);\r\n return true;\r\n } else {\r\n return false; \r\n }\r\n }", "public function purgeAllClone($stri_extra_id='')\n {\n $stri_file_name=serialisable::constructFileName($stri_extra_id);\n $stri_user_temp_path=serialisable::constructUserTempPath();\n $stri_file=$stri_user_temp_path.\"/\".$stri_file_name;\n $lenght = strlen($stri_file)-4;//calcule la taille de la chaine -4 (qui correspond a l'extension .slz)\n \n $obj_dir_reader=new file_reader_writer($stri_user_temp_path);\n $arra_file=$obj_dir_reader->readDirectory();\n \n foreach($arra_file as $stri_file2)//parcours le repertoire\n {\n $va=substr_compare($stri_file,$stri_file2,'0',$lenght);\n \n if($va==0)\n { unlink($stri_file2);\n //echo $stri_file.\" \".$stri_file2.\" \".$va.\"<br />\";\n }\n }\n \n return false; \n }", "public function deleteExpiredCache() {\n $this->logger->debug('Deleting of expired cache files');\n $list = glob($this->cacheFilePath . '*.cache');\n if (!$list) {\n $this->logger->info('No cache files were found skipping');\n return;\n }\n $this->logger->info('Found [' . count($list) . '] cache files to remove if expired');\n foreach ($list as $file) {\n $this->logger->debug('Processing the cache file [' . $file . ']');\n $data = $this->getCacheFileContent($file);\n if ($data === false) {\n $this->logger->warning('Can not get cache data for file [' . $file . ']');\n } else if (time() > $data['expire']) {\n $this->logger->info('The cache data for file [' . $file . '] already expired remove it');\n unlink($file);\n } else {\n $this->logger->info('The cache data for file [' . $file . '] not yet expired skip it');\n }\n }\n }", "function cleanUp($id, $dir)\r\n {\r\n $d = dir($dir);\r\n $id_length = strlen($id);\r\n\r\n while (false !== ($entry = $d->read())) {\r\n if (is_file($dir.'/'.$entry) && substr($entry,0,1) == '.' && !ereg($entry, $this->image))\r\n {\r\n //echo filemtime($this->directory.'/'.$entry).\"<br>\"; \r\n //echo time();\r\n\r\n if (filemtime($dir.'/'.$entry) + $this->lapse_time < time())\r\n unlink($dir.'/'.$entry);\r\n\r\n if (substr($entry, 1, $id_length) == $id)\r\n {\r\n if (is_file($dir.'/'.$entry))\r\n unlink($dir.'/'.$entry);\r\n }\r\n }\r\n }\r\n $d->close();\r\n }", "public function checkForOldFiles()\n {\n $path = $this->getPath();\n $life_time = 24 * 3600;\n if ($handle = opendir($path)) {\n\n while (false !== ($file = readdir($handle))) {\n $filelastmodified = filemtime($path . $file);\n if ((time() - $filelastmodified) > $life_time) {\n $this->deleteFile($path . $file);\n }\n\n }\n closedir($handle);\n }\n }", "function delete_old_pdfs(){\r\n\t\t$directory = $_SERVER['DOCUMENT_ROOT'] . '/downloads/pdf/custom_catalogs';\r\n\t\ttry {\r\n\t\t\tif(is_dir($directory)){\r\n\t\t\t\tif($directory_handle = opendir($directory)){\r\n\t\t\t\t\twhile(($file_name = readdir($directory_handle))!==false){\r\n\t\t\t\t\t\tif(strpos($file_name,'.pdf')!==false){\r\n\t\t\t\t\t\t\t$segments = (explode('_',$file_name));\r\n\t\t\t\t\t\t\t$timestamp = intval($segments[1]);\r\n\t\t\t\t\t\t\t// 1 MONTH ~= 2629743 SECONDS\r\n\t\t\t\t\t\t\tif(time()-$timestamp>2629743) unlink(\"$directory/$file_name\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclosedir($directory_handle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}catch(Exception $err){\r\n\t\t\t//echo('error: delete_old_pdfs');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function cleanUp(): string\n {\n $warnings = '';\n $files = [];\n\n // verify validity of the items\n foreach ($this->collection() as $itemName => $item) {\n if ($item->isExpired()) {\n // delete expired item and its file\n $item->delete();\n } else {\n // item is not expired, verify if its file is still there\n $file = $this->app->filePath($item->filename());\n\n if (is_file($file)) {\n // note the file path down for later\n $files[] = $file;\n } else {\n $warnings .= sprintf(\n 'File \"%s\" for item \"%s\" does not exist' . \"\\n\",\n $file,\n $itemName\n );\n }\n }\n }\n\n // find orphaned files\n $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->app->filePath()));\n foreach ($iterator as $file) {\n // skip dotfiles like .gitignore\n if (substr($file->getFilename(), 0, 1) === '.') {\n continue;\n }\n\n // check if we encountered the file in any item before\n if (!in_array($file->getPathname(), $files)) {\n $warnings .= sprintf('File \"%s\" is orphaned' . \"\\n\", $file->getPathname());\n }\n }\n\n return $warnings;\n }", "private function delete_old_captcha(){\r\n $dir = './'.CAPTCHA_PATH;\r\n \r\n /*** cycle through all files in the directory ***/\r\n foreach (glob($dir.\"*.jpg\") as $file) {\r\n //echo filemtime($file); echo '<br/>';\r\n /*** if file is 24 hours (86400 seconds) old then delete it ***/\r\n if (filemtime($file) < time() - 3600) {\r\n @unlink($file);\r\n //echo $file;\r\n }\r\n }\r\n }", "private function removeOldFiles()\n {\n if ($handle = opendir($this->uploadDir)) {\n\n while (false !== ($file = readdir($handle))) {\n if (is_file($file)) {\n if (filectime($this->uploadDir . $file) < (time() - $this->fileHandleTime)) {\n unlink($this->uploadDir . $file);\n }\n }\n }\n }\n }", "public function deleteExpired() {\n\n\t\t\t// Retrieve cache\n\t\t\t$filename = $this->_getFileName();\n\t\t\t$cachedData = $this->_loadCache($filename);\n\n\t\t\t// Filter out and remove all expired objects\n\t\t\tif (is_array($cachedData)) {\n\t\t\t\t$counter = 0;\n\t\t\t\tforeach ($cachedData as $key => $value) {\n\t\t\t\t\t$age = time() - $value['time'];\n\t\t\t\t\tif ($age > $this->_duration) {\n\t\t\t\t\t\tunset($cachedData[$key]);\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($counter > 0) {\n\t\t\t\t\t$cachedData = json_encode($cacheData);\n\t\t\t\t\tif (true !== file_put_contents($filename, $cacheData)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\treturn $counter;\n\t\t\t}\n\t\t}", "private function clean() {\n foreach (glob($this->dir . '/*') as $file) {\n $name = basename($file);\n if (!preg_match('/^\\d{10}/', $name))\n throw new \\Exception('Unexpected filename. Make sure \"' . $this->dir . '\" contains only build artefacts (and is thus safe to clean) and try again.');\n $deleted = unlink($file);\n if (!$deleted)\n throw new \\Exception('Failed to delete \"' . $file . '\". Make sure target directory is writable to allow delete of other users files.');\n }\n }", "function auto_delete() {\n $request = get_expired_file();\n while($result = $request->fetch()) {\n delete_file_db($result['id_fichier']);\n $file = $result['file_url'];\n if(file_exists($file)) {\n unlink($file);\n }\n }\n}", "public static function cleanupTempFolder(){\r\n\t\t$files = glob($_SERVER[\"DOCUMENT_ROOT\"] . \"/tmp/*\");\r\n\t\t$now = time();\r\n\r\n\t\tforeach($files as $file){\r\n\t\t\tif(is_file($file) && basename($file) != \".keep\"){\r\n\t\t\t\tif($now - filemtime($file) >= 60*60*24){\r\n\t\t\t\t\tunlink($file);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function removeExpiredCacheEntries() {}", "function _remove_v1() {\n if ($this->debug) print($this->debugbeg . \"_remove_v1()<HR>\\n\");\n\n $file = $this->file;\n\n if (! ($f = fopen($file, 'r+b')) ) {\n return PEAR::raiseError( \"Unable to open \" . $file, PEAR_MP3_ID_FNO);\n }\n\n if (fseek($f, -128, SEEK_END) == -1) {\n return PEAR::raiseError( 'Unable to see to end - 128 of ' . $file, PEAR_MP3_ID_RE);\n }\n\n $r = fread($f, 128);\n\n $success = false;\n if ( !PEAR::isError( $this->_decode_v1($r))) {\n $size = filesize($this->file) - 128;\n if ($this->debug) print('size: old: ' . filesize($this->file));\n $success = ftruncate($f, $size);\n clearstatcache();\n if ($this->debug) print(' new: ' . filesize($this->file));\n }\n fclose($f);\n\n if ($this->debug) print($this->debugend);\n return $success;\n }", "function playlist_splitter($files)\n{\n $prevFileTime = null;\n $sliceArray = [];\n $array = [];\n logger(\"++ Total count of matching files in directory: \" . count($files));\n foreach ($files as $file) {\n $fileTime = (int) substr($file, 0, 10);\n if ($prevFileTime) {\n if ($fileTime - $prevFileTime > PLAYLISTCUTOFF) {\n logger(\"++ Found duration gap between files greater than \" . PLAYLISTCUTOFF . \"s\");\n logger(\n \"++ Found duration gap between files greater than \" . PLAYLISTCUTOFF . \"s - Duration between \" .\n $prevFileTime . \" and \" . $fileTime . \" is: \" . ($fileTime - $prevFileTime) . \"s\"\n );\n $sliceArray[] = $file;\n logger(\"++ Splitting into another playlist at file number \" . array_search($file, $files));\n }\n }\n $prevFileTime = $fileTime;\n }\n\n $result = [];\n foreach ($sliceArray as $delimiter) {\n foreach ($files as $key => $val) {\n if ($delimiter === $val) {\n $result[] = array_splice($files, 0, $key);\n continue 2;\n }\n }\n }\n if (!empty($files)) {\n $result[] = $files;\n }\n $counter = count($result);\n if ($counter > 1) {\n logger(\"++ Playlist split into \" . $counter . \" chunks\");\n }\n\n // logger($result);\n return $result;\n}", "private function logEntriesInDateRange() {\n\t\t// loop the discovered files\t\t\n\t\tforeach ($this->report['files'] as $file) {\n\t\t\t$handle = @fopen($file, \"r\");\n\t\t\tif ($handle) {\n\t\t\t\twhile (($buffer = fgets($handle, 4096)) !== false) {\n\t\t\t\t\t$this->Log->parseLogLine($buffer);\n\t\t\t\t\t// is it an log entry for the customer of interest?\n\t\t\t\t\tif ($this->Log->logLine['customer'] == $this->report['customer']) {\n\t\t\t\t\t\t// if the log entry is in the specific date range, save it\n\t\t\t\t\t\tif ($this->Log->meta['datetime'] >= $this->report['firstTime'] && $this->Log->meta['datetime'] <= $this->report['finalTime']) {\n\t\t\t\t\t\t\t$this->report['items'][$this->Log->logLine['id']]['Activity'][] = array_merge($this->Log->meta, $this->Log->logLine);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t\tif (!feof($handle)) {\n\t\t\t\t\techo \"Error: unexpected fgets() fail\\n<br />\";\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}\n\t}", "public static function invalidate() {\n if (is_dir(self::$fileBased))\n {\n $dir = opendir(self::$fileBased);\n while ($file = readdir($dir)) {\n @unlink(YPFramework::getFileName(self::$fileBased, $file));\n }\n }\n }", "public function deadlines( $in = 'deadlines.txt', $reject= 'deadlines.reject.txt', $dryrun = true) {\n\t\tif ( $dryrun === 'yes') $dryrun = true; if ( $dryrun === 'no') $dryrun = false; \n\t\t// map: no, id, update, univ, title, field, post, tenure, deadline, url\n\t\techo \"new info\"; \t$blocks = array(); $block = array(); extract( fpathparse( $in)); \n\t\tforeach ( file( $in) as $v) { \n\t\t\tif ( strpos( $v, '---deadline---') === 0) { if ( $block) lpush( $blocks, $block); echo '.'; $L = ttl( trim( $v), ' '); lshift( $L); $when = lshift( $L); $what = ltt( $L, ' '); if ( ! $when || ! $what) die( \" ERROR ! Wrong format for top line\\n\"); $block = array( \"$when $what\"); continue; }\n\t\t\tlpush( $block, $v);\n\t\t}\n\t\techo \" ok\\n\"; if ( $block) lpush( $blocks, $block); $H = array(); \n\t\techo \"existing files\"; \n\t\tforeach ( flget( '.', 'deadlines', '', 'txt') as $f) { // process existing files first (overwritten with new stuff)\n\t\t\t$L = ttl( $f, '.'); $filetype = lpop( $L); if ( $filetype != 'txt') continue; lshift( $L); \n\t\t\t$when = lshift( $L); if ( strlen( $when) != 6 || ! is_numeric( $when)) continue; // not a base file\n\t\t\t$what = ltt( $L, '.'); // when\n\t\t\t$H[ \"$when $what\"] = file( $f); echo '.'; //echo \" $when($what)\";\n\t\t}\n\t\tforeach ( $blocks as $block) { $L = ttl( lshift( $block), ' '); if ( ! $L) continue; $when = lshift( $L); $what = ltt( $L, ' '); $K = \"$when $what\"; $H[ \"$K\"] = $block; }\n\t\tksort( $H, SORT_NUMERIC); echo \" ok\\n\"; \n\t\tif ( ! is_file( $reject)) { foreach ( $H as $k => $v) echo \"$k\\n\"; echo \"# put the above text in $reject for further processing logic.\\n\"; die(); }\n\t\t// reject logic\n\t\t$file = 'deadlines.backup.' . substr( tyyyymmdd(), 2) . '.tbz'; `rm -Rf $file`; $c = \"tar jcvf $file deadlines.*.txt\"; echo \"BACKUP $c ... \"; procpipe( $c); echo \" ok\\n\"; \n\t\techo \"SIZECHECK\"; foreach ( $H as $k => $vs) echo ' ' . count( $vs) . '/' . strlen( implode( ' ', $vs)); echo \" OK\\n\"; sleep( 3); //die();\n\t\techo \"CLEANUP\"; foreach ( flget( '.', 'deadlines', '', 'txt') as $f) { $L = ttl( $f, '.'); lshift( $L); $when = lshift( $L); if ( ! is_numeric( $when) || strlen( $when) != 6) continue; $c = 'rm -Rf \"' . $f . '\"'; echo '.'; procpipe( $c); }\n\t\techo \" ok\\n\"; //die();\n\t\techo \"PRUNE/DUMP(leave only rejects) (starting with \" . count( $H) . \" keys) \"; \n\t\tforeach ( file( $reject) as $v) { $v = trim( $v); if ( ! $v) continue; if ( ! isset( $H[ \"$v\"])) { echo \"x\"; continue; }; echo '.'; $out = fopen( 'deadlines.' . ltt( ttl( $v, ' '), '.') . '.txt', 'w'); foreach ( $H[ \"$v\"] as $v2) fwrite( $out, trim( $v2) . \"\\n\"); fclose( $out); unset( $H[ \"$v\"]); }\n\t\techo \" ok\\n\"; //die();\n\t\techo \"# \" . count( $H) . \" keys left, will remove them (dryrun:\" . jsonraw( $dryrun) . \") sleep(5)...\"; sleep( 5); echo \" ok\\n\"; \n\t\tforeach ( $H as $k => $vs) {\n\t\t\t$L = ttl( $k); $when = lshift( $L); $what = ltt( $L, ' '); echo \"REMOVE $when $what : \"; \n\t\t\t$file = null; foreach ( flget( '.') as $f) { if ( $file) continue; extract( fpathparse( $f)); if ( $filetype != 'txt') continue; if ( count( ttl( \"***$f**\", $when)) == 1 || count( ttl( \"***$f***\", $what)) == 1) if ( $file) continue; $file = $f; }\n\t\t\tif ( ! $file) { echo \" no file for this key (correct!)\\n\"; continue; }\n\t\t\tif ( ! $dryrun) { echo \" SKIP=remove\\n\"; continue; }\n\t\t\techo \" DRYRUN(write to file)\\n\"; $out = fopen( 'deadlines.' . ltt( ttl( $k, ' '), '.') . '.txt', 'w'); foreach ( $vs as $v) fwrite( $out, trim( $v) . \"\\n\"); fclose( $out);\n\t\t}\n\t\techo \"# \" . count( $H) . \" keys left, will remove them (dryrun:\" . jsonraw( $dryrun) . \")\\n\";\n\t}", "function cleanAll($minutes = CLEAN_ALL_MINUTES) {\n $sessions = @scandir(SESSIONS_DIR);\n $sess_dir = rtrim(SESSIONS_DIR, '/').'/';\n for($n=count($sessions),$i=0;$i<$n;$i++) {\n if($sessions[$i]!='.' && $sessions[$i]!='..') {\n $last_modified = @filemtime($sess_dir . $sessions[$i]);\n $diff = (time() - $last_modified)/60;\n if($diff > $minutes) {\n unlink($sess_dir . $sessions[$i]);\n }\n }\n }\n }", "public function gc_files_dir() {\n\t\t\t// clean_files_dir -- remove all files older than GC_TIME\n\t\t\t$dir_name = $this->signed_files_dir();\n\t\t\t// Create recursive dir iterator which skips dot folders\n\t\t\t$it = new RecursiveDirectoryIterator($dir_name, FilesystemIterator::SKIP_DOTS);\n\n\t\t\t// Maximum depth is 1 level deeper than the base folder\n\t\t\t$oldest = time() - GC_TIME;\n\t\t\t// Loop and reap\n\t\t\twhile($it->valid()) {\n\t\t\t\tif ($it->isFile() && filemtime($it->key()) < $oldest) {unlink($it->key());}\n\t\t\t\t$it->next();\n\t\t\t}\n\t\t}", "private function purgefiles()\n\t{\n\t\t$params=JComponentHelper::getParams('com_jbolo');\n\t\t$uploaddir=JPATH_COMPONENT.DS.'uploads';\n\t\t$exp_file_time=3600*24*$params->get('purge_days');\n\t\t$currts=time();\n\t\techo \"<div class='alert alert-success'>\".\n\t\tJText::_('COM_JBOLO_PURGE_OLD_FILES');\n\t\t/*\n\t\t * JFolder::files($path,$filter,$recurse=false,$full=false,$exclude=array('.svn'),$excludefilter=array('^\\..*'))\n\t\t*/\n\t\t$current_files=JFolder::files($uploaddir,'',1,true,array('index.html'));\n\t\t//print_r($current_files);die;\n\t\tforeach($current_files as $file)\n\t\t{\n\t\t\tif( $file != \"..\" && $file != \".\" )\n\t\t\t{\n\t\t\t\t$diffts=$currts-filemtime($file);\n\t\t\t\tif($diffts > $exp_file_time )\n\t\t\t\t{\n\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_DELETING_FILE').$file;\n\t\t\t\t\tif(!JFile::delete($file)){\n\t\t\t\t\t\techo '<br/>'.JText::_('COM_JBOLO_PURGE_ERROR_DELETING_FILE').'-'.$file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo \"</div>\";\n\t}", "private static function archiveFile($file)\n {\n if (empty(self::$maxLines) || !file_exists($file)) {\n return;\n }\n\n $contents = file_get_contents($file);\n $lines = explode(\"\\n\", $contents);\n\n if (count($lines) <= self::$maxLines) {\n return;\n }\n\n if (!empty(self::$archive)) {\n $archivedFile = dirname($file).'/'.basename($file).'.'.date('Y-m-d_H-i-s').'.gz';\n\n if ($fp = gzopen($archivedFile, 'wb')) {\n if (gzwrite($fp, $contents)) {\n gzclose($fp);\n file_put_contents($file, '');\n } else {\n gzclose($fp);\n }\n }\n\n if (!empty(self::$maxArchives)) {\n $archives = glob(dirname($file).'/'.basename($file).'.*.gz');\n if (!empty($archives) && count($archives) > self::$maxArchives) {\n $removeCount = count($archives) - self::$maxArchives;\n if ($removeCount) {\n for ($i = 0; $i < $removeCount; $i++) {\n if (file_exists($archives[$i])) {\n unlink($archives[$i]);\n }\n }\n }\n }\n }\n } else {\n $newContent = implode(\"\\n\", array_slice($lines, -(self::$maxLines)));\n file_put_contents($file, $newContent);\n }\n }", "function datedFileRm($destPath, $days) {\n echo date('Y-m-d H:i:s ') . \"Removing files from $destPath $days old or older:\\n\";\n $dir = opendir($destPath);\n while (false !== ($file = readdir($dir))) {\n # filemtime() is file date; filectime() is inode file date\n $ftime = filemtime(\"$destPath/$file\"); # get file time\n $stime = date('Ymd', $ftime); # get string version of $ftime\n if ($file != '.' && $file != '..' && $stime <= date('Ymd', strtotime(\"-$days days\"))) {\n unlink(\"$destPath/$file\");\n echo date('Y-m-d H:i:s ') . \"$destPath/$file removed.\\n\";\n }\n }\n closedir($dir);\n}", "private function gc()\n\t{\n\t\tif ($handle = opendir(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/'))\n\t\t{ \n\t\t\t$dir_array = array(); \n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{ \n\t\t\t\tif ($file != '.' AND $file != '..')\n\t\t\t\t{\n\t\t\t\t\tif (file_exists(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$lastmod = @filemtime(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file);\n\t\t\t\t\t\tif (($lastmod + ($this->ttl)) < time())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t@unlink(DIR_SERVER_ROOT . DIR_TMP_NAME . '/' . DIR_DATASTORE_NAME . '/' . $file);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} \n\t\t\tclosedir($handle);\n\t\t}\n\t}", "function nettoyer_petit_cache($prefix, $duree = 300) {\n\t// determiner le repertoire a purger : 'tmp/CACHE/rech/'\n\t$dircache = sous_repertoire(_DIR_CACHE,$prefix);\n\tif (spip_touch($dircache.'purger_'.$prefix, $duree, true)) {\n\t\tforeach (preg_files($dircache,'[.]txt$') as $f) {\n\t\t\tif ($_SERVER['REQUEST_TIME'] - (@file_exists($f)?@filemtime($f):0) > $duree)\n\t\t\t\tspip_unlink($f);\n\t\t}\n\t}\n}", "public static function cron_revision_cleanup($limit = 100) {\n global $wpdb;\n\n $post_types = 'post, product, product_variation';\n\n // Revisions of posts that were last modified a long time ago (3 months) are\n // no longer necessary and can be cleaned up.\n $revision_ids = $wpdb->get_col($wpdb->prepare(\"SELECT revision.ID\nFROM $wpdb->posts revision\nINNER JOIN $wpdb->posts parent ON parent.ID = revision.post_parent AND parent.post_type IN ($post_types)\nWHERE revision.post_type = 'revision' AND revision.post_modified_gmt < %s AND revision.post_name NOT LIKE '%autosave%'\nLIMIT 0,%d\n\", date('Y-m-d', strtotime('today - ' . static::CRON_EVENT_REVISION_CLEANUP_RETAIN_DAYS . ' days')), $limit));\n foreach ($revision_ids as $revision_id) {\n wp_delete_post_revision($revision_id);\n }\n }", "public static function delete(Filesystem $file, $filename, $local, $days)\n {\n $contents = $file->listContents($local, false);\n $time = Carbon::now()->subDays($days)->subSecond()->timestamp;\n foreach ($contents as $con) {\n if ($time > $con['timestamp'] && preg_match(\"/\".$filename.\"/iu\", $con['filename'])) {\n static::logDeletion($file->delete($con['path']), $con['path']);\n }\n }\n }", "function checkConfig(){\n global $ugenome_list_file; global $loadscript;global $dir; \n if(!file_exists(\"$ugenome_list_file\")){exec(\"$perl $loadscript $dir\");}\n $Diff = (time() - filectime(\"$ugenome_list_file\"))/60/60/24;\n if ($Diff > 21) exec(\"$perl $loadscript $dir\");//also check the last mod date < 21 days\n}", "function clear_old_temp_keys($limit = 10){\n\t\t$date = new DateTime(date(\"Y-m-d H:i:s\"));\n\t\terror_log(\"new date \" . $date->format(\"Y-m-d H:i:s\"));\n\t\t$date->sub(new DateInterval('PT1H'));\n\t\t$datef = $date->format('Y-m-d H:i:s');\n\t\terror_log(\"1 Hour ago: $datef\");\n\t\t$query = \"DELETE FROM api_temp_keys WHERE created < '$datef' LIMIT $limit\";\n\t\terror_log($query);\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$success = $stmt->execute();\n\t\treturn $success;\n\t}", "public function temp_gc()\n {\n $tmp = unslashify($this->config->get('temp_dir'));\n $expire = mktime() - 172800; // expire in 48 hours\n\n if ($dir = opendir($tmp)) {\n while (($fname = readdir($dir)) !== false) {\n if ($fname{0} == '.') {\n continue;\n }\n\n if (filemtime($tmp.'/'.$fname) < $expire) {\n @unlink($tmp.'/'.$fname);\n }\n }\n\n closedir($dir);\n }\n }", "function removePriorRevisions($fileId, $revision) {\n\t\t$articleFileDao =& DAORegistry::getDAO('ArticleFileDAO');\n\t\t$revisions = $articleFileDao->getArticleFileRevisions($fileId);\n\t\tif ($revisions) foreach ($revisions as $revisionFile) {\n\t\t\tif ($revisionFile->getRevision() != $revision) {\n\t\t\t\t$this->deleteFile($fileId, $revisionFile->getRevision());\n\t\t\t}\n\t\t}\n\t}", "public function rotateLogs()\n\t{\n\t\t$arrFiles = preg_grep('/\\.log$/', scan(TL_ROOT . '/system/logs'));\n\n\t\tforeach ($arrFiles as $strFile)\n\t\t{\n\t\t\t$objFile = new \\File('system/logs/' . $strFile . '.9', true);\n\n\t\t\t// Delete the oldest file\n\t\t\tif ($objFile->exists())\n\t\t\t{\n\t\t\t\t$objFile->delete();\n\t\t\t}\n\n\t\t\t// Rotate the files (e.g. error.log.4 becomes error.log.5)\n\t\t\tfor ($i=8; $i>0; $i--)\n\t\t\t{\n\t\t\t\t$strGzName = 'system/logs/' . $strFile . '.' . $i;\n\n\t\t\t\tif (file_exists(TL_ROOT . '/' . $strGzName))\n\t\t\t\t{\n\t\t\t\t\t$objFile = new \\File($strGzName, true);\n\t\t\t\t\t$objFile->renameTo('system/logs/' . $strFile . '.' . ($i+1));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add .1 to the latest file\n\t\t\t$objFile = new \\File('system/logs/' . $strFile, true);\n\t\t\t$objFile->renameTo('system/logs/' . $strFile . '.1');\n\t\t}\n\t}", "private static function purgeFiles($folder, $timeout, $allowedFileCount=0) {\n // Don't do this every time.\n if (rand(1, self::$cache_chance_purge) === 1) {\n // First, get an array of files sorted by date\n $files = [];\n $dir = opendir($folder);\n // Skip certain file names\n $exclude = array('.', '..', '.htaccess', 'web.config', '.gitignore');\n if ($dir) {\n while ($filename = readdir($dir)) {\n if (in_array($filename, $exclude) || !is_file($folder . $filename)) {\n continue;\n }\n $lastModified = filemtime($folder . $filename);\n $files[] = array($folder . $filename, $lastModified);\n }\n }\n // Sort the file array by date, oldest first.\n usort($files, array('helper_base', 'DateCmp'));\n // Iterate files, ignoring the number of files we allow in the cache\n // without caring.\n for ($i=0; $i<count($files)-$allowedFileCount; $i++) {\n // If we have reached a file that is not old enough to expire, don't go\n // any further.\n if ($files[$i][1] > (time() - $timeout)) {\n break;\n }\n // Clear out the old file.\n if (is_file($files[$i][0])) {\n unlink($files[$i][0]);\n }\n }\n }\n }", "public function file_cleanup(){\n\t\t$query = $this->db->get('carousels');\n\t\t$map = directory_map('./carousel/', 1);\n\t\t$g = \"x\";\n\t\tforeach($map as $file)\n\t\t{\n\t\t\t\t\t\t\t\n\t\t\t//return $query->result();\n\t\t\t$g = $g . \"--\";\n\t\t\t$x = 0;\n\t\t\t$soundfile=\"\";\n\t\t\tforeach($query->result() as $row){\n\t\t\t\t//return $row;\n\t\t\t\t$picture = $row->image;\n\t\t\t\t$g = $g . \"<\" . $soundfile . \"-\" . $file . \">\";\n\t\t\t\tif ($file==$picture)\t{\n\t\t\t\t\t$g = $g . \"files are the same\";\n\t\t\t\t\t$x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x==0 )\n\t\t\t{\n\t\t\t \t$g = $g . \"we're in the loop\";\n\t\t\t\tunlink(\"./carousel/\" . $file);\n\t\t\t\t\t$g = $g . \" removed: \" . \"./carousel/\" . $file . \" - \";\n\t\t\t\t\n\t\t\t}\n\t\t\tif (strlen($g) > 700)\n \t\t\t\t$g = substr($g, 0, 700);\n\t\t}\n\t\t//return $g;\n\t\t//$this->session->set_flashdata('carousel_saved', $file . \"--\" . $soundfile );\n\t}", "public static function rmExpired()\n\t{\n\t\t$d = dir(ini_get('session.save_path'));\n\n\t\t$deleted = array();\n\n\t\twhile(false !== ($fn = $d->read()))\n\t\t{\n\t\t\tif ($fn === '.' || $fn === '..') continue;\n\n\t\t\t$fname = $d->path . '/' . $fn;\n\t\t\t$fp = fopen($fname, 'r');\n\t\t\tif ($fp === false) continue;\n\t\t\t$stats = fstat($fp);\n\t\t\tfclose($fp);\n\n\t\t\t$buf = file_get_contents($fname);\n\t\t\t$obj = unserialize($buf);\n\n\t\t\tif ($obj === false || get_class($obj) != 'HttpSession')\n\t\t\t\tcontinue;\n\n\t\t\tif\n\t\t\t(\n\t\t\t\t! is_null($obj->expires)\n\t\t\t\t&& time() - $stats['atime'] > $obj->expires * 60\n\t\t\t)\n\t\t\t{\n\t\t\t\tunlink($fname);\n\t\t\t\t$deleted[] = $fname;\n\t\t\t}\n\t\t}\n\n\t\treturn $deleted;\n\t}", "public function clean($file)\n {\n }", "public function clean()\n {\n $dir = new \\Ninja\\Directory(NINJA_DOCROOT . 'public/');\n /**\n * @var $files \\Ninja\\File[]\n */\n\n $files = $dir->scanRecursive(\"*.css\");\n echo \"\\nDeleting Minified Css Files...\\n\";\n foreach($files as $sourceFile)\n {\n // if does not have a numeric pre-extension-suffix foo.#.js (e.g foo.52.js) which are files from a previous build\n if ( ! is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)) )\n continue;\n\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n $sourceFile->delete();\n\n unset($sourceFile);\n }\n\n $files = $dir->scanRecursive(\"*.js\");\n echo \"\\nDeleting Minified Js Files...\\n\";\n foreach($files as $sourceFile)\n {\n // if does not have a numeric pre-extension-suffix foo.#.js (e.g foo.52.js) which are files from a previous build\n if ( ! is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)) )\n continue;\n\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n $sourceFile->delete();\n unset($sourceFile);\n }\n }", "protected function cleanupPartials($dir){\n\t\tforeach (scandir($dir) as $item){\n\t\t\tif ($item == \".\" || $item == \"..\")\n\t\t\t\tcontinue;\n\t\t\tif (is_dir($item))\n\t\t\t\tcontinue;\n\n\t\t\t$ext = pathinfo($item, PATHINFO_EXTENSION);\n\t\t\tif ($ext == $this->partialsExtension) {\n\t\t\t\t$fullpathname = $dir.DIRECTORY_SEPARATOR.$item;\n\t\t\t\t$old = time() - filemtime($fullpathname);\n\t\t\t\tif ($old > $this->partialsExpireIn) {\n\t\t\t\t\tunlink($fullpathname);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function removeFiles() {}", "function cmc_framework_markets_landing_process_uploaded_file($form, &$form_state) {\n \n for ($i=1; $i<=5; $i++) {\n $tab = 'tab' . $i;\n $image_key = 'cmc_framework_markets_tab' . $i . '_image';\n $image_key_delete = 'cmc_framework_markets_tab' . $i . '_image_delete';\n \n if ($form_state['values'][$image_key] != 0) {\n // The new file's status is set to 0 or temporary and in order to ensure\n // that the file is not removed after 6 hours we need to change it's status\n // to 1.\n $file = file_load($form_state['values'][$image_key]);\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n \n // delete current file\n $image_fid = variable_get($image_key, '');\n if ($image_fid) {\n $f = file_load($image_fid);\n if (!empty($f->fid) && file_delete($f)) {\n drupal_set_message($f->filename . ' deleted');\n }\n }\n \n }\n else {\n $image_delete = $form_state['values'][$image_key_delete];\n if (!$image_delete) {\n unset($form_state['values'][$image_key]);\n }\n else {\n $image_fid = variable_get($image_key, '');\n $file = file_load($image_fid);\n \n if (file_delete($file)) {\n drupal_set_message($file->filename . ' deleted');\n }\n else {\n drupal_set_message($file->filename . ' could not be deleted. ');\n \n // so we still keep a record fo the file\n unset($form_state['values'][$image_key]);\n }\n }\n }\n }\n\n}", "function downlad_files($file, $manual_id, $cache) {\n // while (!empty($file)) {\n // remove each processed file, add the files to be processed for images\n // }\n foreach ($file as $key => $value) {\n // if ($key == 'inkscape-userinterface') {\n // debug('key', $key);\n // debug('value', $value);\n foreach ($value['published'] as $kkey => $vvalue) {\n // debug('vvalue', $vvalue);\n if (MANUAL_LOCAL_FILES_REQUEST) {\n // debug('vvalue', $vvalue);\n $content = file_get_contents(MANUAL_LOCAL_CONTENT_PATH.$vvalue['raw']);\n } elseif (!MANUAL_DEBUG_NO_HTTP_REQUEST) {\n // debug('http_request content', GITHUB_RAW_URL.$vvalue['raw']);\n $content = get_content_from_github(GITHUB_RAW_CONTENT_URL.$vvalue['raw']);\n } else {\n $content = \"# Introduction\";\n /*\n $content = \"\n## La fenêtre principale\n\nabcd (defgh) [blah]\n[test](image/inkscape-user_interface-fr.png)\n\n[test a](image/inkscape-user_interface-fr.png)\n \";\n */\n }\n // debug('content', $content);\n $matches = array();\n if (preg_match_all('/!\\[(.*?)\\]\\((.*?)\\)/', $content, $matches)) {\n // debug('matches', $matches);\n for ($i = 0; $i < count($matches[2]); $i++) {\n $item = $matches[2][$i];\n if (array_key_exists('content/'.$key.'/'.$item, $cache)) {\n // debug('url', GITHUB_RAW_CONTENT_URL.$key.'/'.$item);\n if (MANUAL_LOCAL_FILES_REQUEST) {\n $image = file_get_contents(MANUAL_LOCAL_CONTENT_PATH.$key.'/'.$item);\n } else {\n $image = get_content_from_github(GITHUB_RAW_CONTENT_URL.$key.'/'.$item);\n }\n put_cache($key.'/'.$item, $image, $manual_id);\n $content = str_replace('!['.$matches[1][$i].']('.$item.')', '!['.$matches[1][$i].'](cache/'.$manual_id.'/'.$key.'/'.$item.')', $content); // TODO: find a good way to correctly set the pictures and their paths\n } else {\n Manual_log::$warning[] = \"The \".$key.'/'.$item.\" is referenced but can't be found in the repository\";\n }\n }\n }\n $cache_filename = $vvalue['raw'];\n if (\n array_key_exists('render', $vvalue) &&\n ($vvalue['render']['source'] == 'md') && \n ($vvalue['render']['target'] == 'html')\n ) {\n $content = Markdown($content);\n $cache_filename = $vvalue['render']['filename'];\n }\n // debug('content', $content);\n put_cache($cache_filename, $content, $manual_id);\n }\n // }\n }\n}", "function striplinesfromcsv($numberoflines,$filename) {\r\n\t\t\r\n\t\t$fileName = 'nightlies/'.$filename;\r\n\t\t$a = preg_replace(\"/^(.*?\\n){0,$numberoflines}/\",'', file_get_contents($fileName));\r\n\t\t$b = fopen($fileName, 'w');\r\n\t\tfwrite($b, $a);\r\n\t\tfclose($b);\r\n\t\t\r\n\t\t//$filename = 'nightlies/'.$filename;\t\t\r\n\t\t//$file = file($filename);\r\n\t\t//file_put_contents($filename, implode(\"\\n\", array_slice($file, $numberoflines)));\r\n\t\t\r\n\t\techo \" > > > Stripping \".$numberoflines.\" lines from '\".$filename.\"' <br>\";\r\n\t}", "protected function delete_old() {\n // this will delete anything odler than 30 days\n $search = 'BEFORE \"' . date(\"j F Y\", strtotime(\"-30 days\")) . '\"';\n $emails = imap_search($this->mbox, $search, SE_UID);\n if(!empty($emails)){\n foreach($emails as $email){\n try {\n imap_delete($this->mbox, $email, FT_UID);\n }\n catch (\\Exception $e) {\n print \"Error processing email (UID $email): \" . $e->getMessage() . \"\\n\";\n }\n }\n }\n\n imap_expunge($this->mbox);\n }", "public function purgeAll() {\n\t\tset_time_limit(300);\n\t\t$this->load->model(\"filehandlerbase\");\n\t\t$fileList = $this->filehandlerbase->findDeletedItems();\n\t\t$mfa = $this->input->post(\"mfa\");\n\t\t$serial = $this->input->post(\"arn\");\n\n\t\t/**\n\t\t * we need to cache this because MFA is only good once\n\t\t */\n\t\t$lastUsedToken = null;\n\t\tforeach($fileList as $fileEntry) {\n\t\t\t$fileHandler = $this->filehandler_router->getHandlerForObject($fileEntry->getFileObjectId());\n\t\t\tif(!$fileHandler) { \n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(!$fileHandler->loadFromObject($fileEntry)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($lastUsedToken)) {\n\t\t\t\t$fileHandler->s3model->sessionToken = $lastUsedToken;\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif(!$fileHandler->deleteSource($serial,$mfa)) {\n\t\t\t\t\t$this->logging->logError(\"purgeAll\",\"Could not delete asset with key\" . $fileEntry->getFileObjectId());\n\t\t\t\t}\n\t\t\t\t$lastUsedToken = $fileHandler->s3model->sessionToken;\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\techo $e;\n\t\t\t\techo \"Deletion fail\";\n\t\t\t}\n\n\t\t}\n\n\t\tinstance_redirect(\"/admin\");\n\t}", "function serendipity_removeFiles($files = null) {\n global $serendipity, $errors;\n\n if (!is_array($files)) {\n return;\n }\n\n $backupdir = S9Y_INCLUDE_PATH . 'backup';\n if (!is_dir($backupdir)) {\n @mkdir($backupdir, 0777);\n if (!is_dir($backupdir)) {\n $errors[] = sprintf(DIRECTORY_CREATE_ERROR, $backupdir);\n return false;\n }\n }\n\n if (!is_writable($backupdir)) {\n $errors[] = sprintf(DIRECTORY_WRITE_ERROR, $backupdir);\n return false;\n }\n\n foreach($files AS $file) {\n $source = S9Y_INCLUDE_PATH . $file;\n $sanefile = str_replace('/', '_', $file);\n $target = $backupdir . '/' . $sanefile;\n\n if (!file_exists($source)) {\n continue;\n }\n\n if (file_exists($target)) {\n $target = $backupdir . '/' . time() . '.' . $sanefile; // Backupped file already exists. Append with timestamp as name.\n }\n\n if (!is_writable($source)) {\n $errors[] = sprintf(FILE_WRITE_ERROR, $source) . '<br />';\n } else {\n rename($source, $target);\n }\n }\n}", "public static function terminate_due_to_activity($file, $time_now, $time_mod, $increase_resumption = true) {\n\t\n\t\tglobal $updraftplus;\n\t\t\n\t\t// We check-in, to avoid 'no check in last time!' detectors firing.\n\t\tself::record_still_alive();\n\t\t\n\t\t// Log\n\t\t$file_size = file_exists($file) ? round(filesize($file)/1024, 1). 'KB' : 'n/a';\n\t\t$updraftplus->log(\"Terminate: \".basename($file).\" exists with activity within the last 30 seconds (time_mod=$time_mod, time_now=$time_now, diff=\".(floor($time_now-$time_mod)).\", size=$file_size). This likely means that another UpdraftPlus run is at work; so we will exit.\");\n\t\t\n\t\t$increase_by = $increase_resumption ? 120 : 0;\n\t\tself::increase_resume_and_reschedule($increase_by, true);\n\t\t\n\t\t// Die, unless there was a deliberate over-ride (for development purposes)\n\t\tif (!defined('UPDRAFTPLUS_ALLOW_RECENT_ACTIVITY') || !UPDRAFTPLUS_ALLOW_RECENT_ACTIVITY) die;\n\t}", "protected final function removeExpiredLogFiles($logName)\n {\n $logPath = $this->logDirPath . rtrim($logName, '/') . '/';\n \n $expiryDate = new \\DateTime();\n $expiryDate->modify('-' . $this->fileLife . ' days');\n \n foreach (scandir($logPath) as $logFile) {\n $date = \\DateTime::createFromFormat(\n 'Y-m-d',\n substr($logFile, 0, 10)\n );\n \n if ($date && $date < $expiryDate) {\n unlink($logPath . $logFile);\n }\n }\n }", "protected function delete($key, $type) {\n $file = $this->config['cachePath'] . '/' . $key . '.' . $type;\n\n if(is_numeric($this->config['expiry'])) {\n if(file_exists($file))\n unlink($file);\n } else {\n $cacheKey = substr($key, 0, strrpos($key, '-'));\n if($match = glob($this->config['cachePath'] . '/' . $cacheKey . '-*.' . $type)) {\n foreach($match as $path)\n unlink($path);\n }\n }\n }", "public function gc($lifetime)\n {\n foreach ((array) glob($this->path) as $file) {\n $time = filemtime($file) + $lifetime;\n\n $valid = $time > time() && file_exists($file);\n\n $valid === false && unlink($file);\n }\n\n return true;\n }", "public function testExpireTrashByRetention() {\n\t\t// create some files\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file1.txt', 'file1');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file2.txt', 'file2');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file3.txt', 'file3');\n\n\t\t// delete them so that they end up in the trash bin\n\t\t\\OC\\Files\\Filesystem::unlink('file1.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file2.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file3.txt');\n\n\t\t//make sure that files are in the trash bin\n\t\t$filesInTrash = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(3, $filesInTrash);\n\n\t\t// simulate as 1 out of 3 files expired,\n\t\t// and next 2 do not need expiration\n\t\t$this->expiration->expects($this->exactly(2))\n\t\t\t->method('isExpired')\n\t\t\t->willReturnOnConsecutiveCalls(\n\t\t\t\ttrue,\n\t\t\t\tfalse\n\t\t\t);\n\n\t\t// call expire by retention\n\t\t$this->trashExpiryManager->expireTrashByRetention(self::TEST_TRASHBIN_USER1);\n\n\t\t$remainingFiles = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(2, $remainingFiles);\n\n\t\t$this->assertEquals(\n\t\t\t\\array_slice($filesInTrash, 1),\n\t\t\t$remainingFiles\n\t\t);\n\t}", "public function deleteOldLogs( $periodType, $numberToKeep )\n\t{\n\t\t$logs = Filesystem::listFiles($this->workspace(), '*-'.$periodType, 'log', true);\n\t\t$remove = array_slice($logs, $numberToKeep);\n\n\t\tforeach ($remove as $log) {\n\t\t\tFilesystem::rmfile($log);\n\t\t}\n\t}", "public function removeExpired();", "public function clean_old_temp($age = 7)\n {\n $this->load->helper('directory');\n\n $path = './uploads/temp/';\n $map = directory_map($path, 1);\n $totalOldFiles = 0;\n $totalOldDirs = 0;\n $today = new DateTime();\n\n foreach ($map as $file) {\n if (is_dir($path . $file)) {\n $stat = stat($path . $file);\n $dirTimestamp = new DateTime(date(\"F d Y H:i:s.\", $stat['mtime']));\n $dirInterval = $today->diff($dirTimestamp)->format('%R%a');\n if (intval($dirInterval) <= -$age) {\n if (@rmdir($path . $file)) {\n echo 'Directory: ' . ($path . $file) . ' was deleted' . PHP_EOL;\n $totalOldDirs++;\n }\n }\n }\n\n $fileTimestamp = new DateTime(date(\"F d Y H:i:s.\", filectime($path . $file)));\n $interval = $today->diff($fileTimestamp)->format('%R%a');\n if (intval($interval) <= -$age && $file != '.gitkeep') {\n if (file_exists($path . $file)) {\n if (@unlink($path . $file)) {\n echo 'File: ' . ($path . $file) . ' was deleted' . PHP_EOL;\n $totalOldFiles++;\n }\n }\n }\n }\n echo $totalOldFiles . ' files and ' . $totalOldDirs . ' directories were deleted (more than ' . $age . ' days old)' . PHP_EOL;\n }", "private function clean() {\n\t\t$types = ['.aux', '.fdb_latexmk', '.fls', '.log', '.out', '.tex', '.toc'];\n\t\t$s = '';\n\t\tforeach (scandir($this -> directory) as $file) {\n\t\t\tif ($file === '.' || $file === '..') continue;\n\t\t\tforeach ($types as $t) {\n\t\t\t\t$extension = substr($file, 0-strlen($t));\n\t\t\t\tif (in_array($extension, $types) && file_exists($this -> directory . '/' . $file)) {\n\t\t\t\t\tunlink($this -> directory . '/' . basename($file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function deleteUnusedFiles(){\n \n }", "function deleteBandwidthMedia ($files) {\n foreach ($files as $index => $file) {\n unlink ($file);\n }\n}", "protected function tidyUpFiles() {\n\t\t/* load valid ids */\n\t\t$validIds = array();\n\t\t$result = $this->db->query('SELECT id FROM image');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_NUM)) {\n\t\t\t\t$validIds[] = $entry[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* remove entries with missing file */\n\t\tforeach ($validIds as $id) {\n\t\t\tif (!is_file(self::getPath($id))) {\n\t\t\t\t$this->delete($id);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* delete from list what is not in the database */\n\t\tif ($dh = opendir(self::FILES_DIR)) {\n\t\t\twhile (($id = readdir($dh)) !== false) {\n\t\t\t\tif (preg_match('#^[0-9a-zA-Z]+$#', $id) && !in_array($id, $validIds) && $id != self::DATABASE_FILE) {\n\t\t\t\t\t$this->delete($id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t}\n\t}", "function ag_clean_wm_cache() {\n\trequire_once(AG_DIR . '/functions.php');\n\t\n\t$wp_dirs = wp_upload_dir();\n\t$cache_dir = trailingslashit($wp_dirs['basedir']) . 'ag_watermarked';\n\t\n\t// folder exists?\n\tif(!@file_exists($cache_dir)) {\n\t\tdie('success');\t\n\t}\n\t\n\t// clean\n\tforeach(scandir($cache_dir) as $file) {\n\t\t$ext = ag_stringToExt($file);\n\t\t$accepted = array('.jpg', '.jpeg', '.gif', '.png');\n\t\t\n\t\tif(in_array($ext, $accepted) && file_exists($cache_dir.'/'.$file)) {\n\t\t\tunlink($cache_dir.'/'.$file);\n\t\t}\t\n\t}\n\n\tdie('success');\n}", "public function directoryFileLimits($directory = '', $limits = [])\n\t{\n\t\t// add trailing slash to directory if it doesn't exist\n\t\tif (substr($directory, -1) != \"/\")\n\t\t\t$directory .= \"/\";\n\n\t\t$deletedFiles = [];\n\n\t\tif (is_dir($directory) && $handle = opendir($directory))\n\t\t{\n\t\t\tforeach ($limits as $fileTypes => $limit)\n\t\t\t{\n\t\t\t\t$fileTypes = $this->formatFileTypesList($fileTypes);\n\n\t\t\t\t$filesForType = [];\n\t\t\t\t$quantity = 0;\n\n\t\t\t\twhile (false !== ($entry = readdir($handle)))\n\t\t\t\t{\n\t\t\t\t\tif (is_file($directory.$entry))\n\t\t\t\t\t{\n\t\t\t\t\t\t$fileExt = File::extension($entry);\n\n\t\t\t\t\t\tif ($fileExt)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (in_array(strtolower($fileExt), $fileTypes) && !in_array($directory.$entry, $filesForType))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$filesForType[] = $directory.$entry;\n\n\t\t\t\t\t\t\t\t$quantity ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // end if file extension exists (entry is not a directory)\n\t\t\t\t\t}\n\t\t\t\t} // end while file in directory\n\n\t\t\t\t// if there are too many files of filetype being checked delete until at limit starting with oldest files\n\t\t\t\twhile ($quantity > $limit)\n\t\t\t\t{\n\t\t\t\t\t$oldestFile = -1;\n\t\t\t\t\tforeach ($filesForType as $index => $file)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($oldestFile == -1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$oldestFile = $index;\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\tif (filemtime($file) < filemtime($filesForType[$oldestFile]))\n\t\t\t\t\t\t\t\t$oldestFile = $index;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($filesForType[$oldestFile]) && is_file($filesForType[$oldestFile]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunlink($filesForType[$oldestFile]);\n\n\t\t\t\t\t\t$deletedFiles[] = $filesForType[$oldestFile];\n\n\t\t\t\t\t\tunset($filesForType[$oldestFile]);\n\n\t\t\t\t\t\t$quantity --;\n\t\t\t\t\t}\n\t\t\t\t} // end while quantity > limit\n\t\t\t\trewinddir($handle);\n\n\t\t\t} // end while limits\n\t\t} // end if directory can be opened\n\n\t\treturn $deletedFiles;\n\t}", "public function discoverOldestLogTime() {\n $this->autoRender = FALSE;\n $dir = LOGS.'Inventory/inventory/';\n if (!is_dir($dir)) {\n $dh = new Folder($dir, true, 0755);\n } else {\n $dh = new Folder($dir);\n }\n\n $dh->sort = TRUE;\n $files = $dh->find('.*\\.log');\n if(!empty($files)){\n preg_match('/inventory.(\\d+.\\d+)./', $files[0], $match);\n $this->report['startLimit'] = strtotime(preg_replace('/(\\d+).(\\d+)/','$2/1/$1', $match[1]));\n } else {\n $this->report['startLimit'] = time();\n }\n }", "function purge_files(){\n\t//echo \"<pre>purge_files: To limit disk space, everytime you create an effect all previous files are removed</pre>\\n\";\n\t//echo \"<pre>purge_files: Removing *.png, *.dat,*.vir,*.txt,*.hls,*.gp,*.srt,.*.lms</pre>\\n\";\n\t$directory=getcwd();\n}", "function cleanUpFolderModeFolders($path)\n\t{\n\t\t// Get file list according to filtering\n\t\t$it = new RegexIterator(new IteratorIterator(new DirectoryIterator($path)), '#item__[0-9]{4}_[0-9]{2}_[0-9]{2}_(.*)#i');\n\t\t$it->rewind();\n\n\t\t$now_date = time();\n\n\t\twhile($it->valid())\n\t\t{\n\t\t\tif ($it->isDot())\n\t\t\t{\n\t\t\t\t$it->next();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$subpath = $it->getPathName(); // filename including the folder subpath\n\t\t\t$dirname = basename($subpath);\n\t\t\t$date_str = str_replace('_', '-', substr($dirname, 6, 10));\n\n\t\t\t$directory_date = strtotime($date_str);\n\t\t\t$date_diff = $now_date - $directory_date;\n\t\t\t$days_diff = floor($date_diff / (60 * 60 * 24));\n\t\t\t//echo $subpath . ' ---- ' . $date_str . ' ---- Days DIFF: ' . $days_diff . '<br/>';\n\n\t\t\t// Remove old folders\n\t\t\tif ($days_diff > 2)\n\t\t\t{\n\t\t\t\tJFolder::delete($subpath);\n\t\t\t}\n\n\t\t\t$it->next();\n\t\t}\n\t}", "function validate_file($instructor, $filename, $filewithpath, $access) {\n if (is_dir($filewithpath)) {\n return array(False, False, 1, 1, 1, '');\n }\n $today = getdate();\n $open_year = $today['year'];\n $open_month = 1;\n $open_day = 1;\n $cat_file = $filename;\n if (isset($access[basename($filewithpath)])) {\n $open_day = intval($access[basename($filewithpath)]['day']);\n $open_month = intval($access[basename($filewithpath)]['month']);\n if (isset($access[basename($filewithpath)]['year'])) {\n $open_year = intval($access[basename($filewithpath)]['year']);\n }\n } elseif (isset($access[basename($filename)])) {\n $open_day = intval($access[basename($filename)]['day']);\n $open_month = intval($access[basename($filename)]['month']);\n if (isset($access[basename($filename)]['year'])) {\n $open_year = intval($access[basename($filename)]['year']);\n }\n } else {\n $cp = array_reverse(explode('.', basename($filewithpath)));\n if (count($cp) > 3 && is_numeric($cp[1]) && is_numeric($cp[2])) {\n $open_day = intval($cp[1]);\n $open_month = intval($cp[2]);\n $cat_file = $cp[3] . '.' . $cp[0];\n } else {\n return array(True, True, 1, 1, 1, $cat_file);\n }\n }\n if ($today['year'] >= $open_year && $today['mon'] > $open_month) {\n return array(True, True, $open_year, $open_month, $open_day, $cat_file);\n } elseif ($today['year'] >= $open_year && $today['mon'] >= $open_month && $today['mday'] >= $open_day) {\n return array(True, True, $open_year, $open_month, $open_day, $cat_file);\n } elseif ($instructor) {\n return array(True, False, $open_year, $open_month, $open_day, $cat_file);\n }\n return array(False, False, $open_year, $open_month, $open_day, $cat_file);\n }", "public function remove_old_tmp_files() {\n global $wpdb;\n\n $older_than = time() - 86400;\n $num = 0; // Number of files deleted\n\n // Locate files not saved in over a day\n $files = $wpdb->get_results($wpdb->prepare(\n \"SELECT path\n FROM {$wpdb->prefix}h5p_tmpfiles\n WHERE created_at < %d\",\n $older_than)\n );\n\n // Delete files from file system\n foreach ($files as $file) {\n if (@unlink($file->path)) {\n $num++;\n }\n }\n\n // Remove from tmpfiles table\n $wpdb->query($wpdb->prepare(\n \"DELETE FROM {$wpdb->prefix}h5p_tmpfiles\n WHERE created_at < %d\",\n $older_than));\n\n // Old way of cleaning up tmp files. Needed as a transitional fase and it doesn't really harm to have it here any way.\n $h5p_path = $this->get_h5p_path();\n $editor_path = $h5p_path . DIRECTORY_SEPARATOR . 'editor';\n if (is_dir($h5p_path) && is_dir($editor_path)) {\n $dirs = glob($editor_path . DIRECTORY_SEPARATOR . '*');\n if (!empty($dirs)) {\n foreach ($dirs as $dir) {\n if (!is_dir($dir)) {\n continue;\n }\n\n $files = glob($dir . DIRECTORY_SEPARATOR . '*');\n if (empty($files)) {\n continue;\n }\n\n foreach ($files as $file) {\n if (filemtime($file) < $older_than) {\n // Not modified in over a day\n if (unlink($file)) {\n $num++;\n }\n }\n }\n }\n }\n }\n\n if ($num) {\n // Clear cached value for dirsize.\n delete_transient('dirsize_cache');\n }\n }", "public static function clear(){\n $directory = \"bin\";\n\n if(is_dir($directory)) {\n $scan = scandir($directory);\n unset($scan[0], $scan[1]); //unset . and ..\n foreach($scan as $file) {\n $filename = \"$directory/$file\";\n $filedate = date (\"d/m/Y\", filemtime($filename));\n\n if( $filedate < date(\"d/m/Y\") )\n unlink($filename);\n }\n }\n }", "public function deleteCountsUntil(\\DateTime $limit);", "private function setCacheExpire($file)\n {\n $config = JFactory::getConfig();\n if(method_exists($config, 'getValue')) {\n $lifetime = (int)$config->getValue('config.lifetime');\n } else {\n $lifetime = (int)$config->get('config.lifetime');\n }\n if (empty($lifetime) || $lifetime < 120) $lifetime = 120;\n $time = time() + $lifetime;\n jimport( 'joomla.filesystem.file' );\n JFile::write($file, $time);\n }", "public function testExpireTrashByRetentionAndSpace() {\n\t\t// create some files\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file1.txt', 'file1');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file2.txt', 'file2');\n\t\t\\OC\\Files\\Filesystem::file_put_contents('file3.txt', 'file3');\n\n\t\t// delete them so that they end up in the trash bin\n\t\t\\OC\\Files\\Filesystem::unlink('file1.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file2.txt');\n\t\t\\OC\\Files\\Filesystem::unlink('file3.txt');\n\n\t\t//make sure that files are in the trash bin\n\t\t$filesInTrash = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(3, $filesInTrash);\n\n\t\t// simulate as 1 out of 3 files expired\n\t\t$this->expiration->expects($this->exactly(3))\n\t\t\t->method('isExpired')\n\t\t\t->willReturnOnConsecutiveCalls(\n\t\t\t\ttrue,\n\t\t\t\tfalse,\n\t\t\t\t// in this case we are over quota, so true will be returned\n\t\t\t\t// even though file expiration date is ok\n\t\t\t\ttrue\n\t\t\t);\n\n\t\t// simulate as only 2 files need to be cleaned to satisfy quota\n\t\t$this->quota->expects($this->exactly(1))\n\t\t\t->method('calculateFreeSpace')\n\t\t\t->willReturn(-8);\n\n\t\t// call expire by retention\n\t\t$this->trashExpiryManager->expireTrash(self::TEST_TRASHBIN_USER1);\n\n\t\t$remainingFiles = Helper::getTrashFiles('/', self::TEST_TRASHBIN_USER1, 'mtime', false);\n\t\t$this->assertCount(1, $remainingFiles);\n\n\t\t$this->assertEquals(\n\t\t\t\\array_slice($filesInTrash, 2),\n\t\t\t$remainingFiles\n\t\t);\n\t}", "private function delete_backups()\n {\n $max_storage_time = now()->subDay(config('dbackup.storage_days'))->timestamp;\n\n $backup_files = Storage::disk('backup')->files();\n\n if($backup_files)\n {\n foreach ($backup_files as $backup_file)\n {\n $last_modified = Storage::disk('backup')->lastModified($backup_file);\n\n if($last_modified < $max_storage_time)\n {\n Storage::disk('backup')->delete($backup_file);\n }\n\n }\n }\n }", "public function cleanupFiles()\n {\n\n echo 'Cleaning ' . $this->accountID . ' - ' . $this->accountName . ' File Directories' . PHP_EOL;\n\n foreach (glob(\"{$this->commissionsOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->dailyFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->monthlyFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('2 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(\"{$this->metaFileOutPath}/*.txt\") as $filename) {\n if (filemtime($filename) < strtotime('1 months ago')) {\n unlink($filename);\n }\n }\n\n foreach (glob(self::EXPORT_TMP_DIR . \"/*.txt\") as $filename) {\n unlink($filename);\n }\n\n echo 'Finished cleaning ' . $this->accountName . ' File Directories' . PHP_EOL;\n }", "function wp_schedule_delete_old_privacy_export_files()\n {\n }", "public function empty_cache($flag = 'both', $before = 'now')\n\t{\n\t\t$this->CI->load->helper('file');\n\t\t\n\t\t$files = get_filenames($this->cache_path);\n\t\t$before = strtotime($before);\n\t\t\n switch($flag)\n {\n\t\t\tcase 'js':\n\t\t\tcase 'css':\n foreach( $files as $file )\n {\n\t\t\t\t\t$ext = substr(strrchr($file, '.'), 1);\n\t\t\t\t\t$fl = strlen(substr($file, 0, -(strlen($flag)+1)));\n\t\t\t\t\t\n if (($ext == $flag) && $fl >= 42 && (filemtime($this->cache_path . $file) < $before))\n {\n\t\t\t\t\t\t$success = unlink($this->cache_path . $file);\n\t\t\t\t\t\n if($success)\n {\n log_message('debug', 'Assets: Cache file '.$file.' was removed from '.$this->cache_path);\n }\n else\n {\n log_message('error', 'Assets: There was an error removing cache file '.$file.' from '.$this->cache_path);\n }\n\t\t\t\t\t}\n\t\t\t\t}\n break;\n\t\t\tcase 'both':\n\t\t\tdefault:\n foreach($files as $file)\n {\n\t\t\t\t\t$ext = substr(strrchr($file, '.'), 1);\n\t\t\t\t\t$fl = strlen(substr($file, 0, -3));\n\n if (($ext == 'js' || $ext == 'css') && $fl >= 42 && (filemtime($this->cache_path . $file) < $before))\n {\n\t\t\t\t\t\t$success = unlink($this->cache_path . $file);\n\t\t\t\t\t\t\n if($success)\n {\n log_message('debug', 'Assets: Cache file '.$file.' was removed from '.$this->cache_path);\n }\n else\n {\n log_message('error', 'Assets: There was an error removing cache file '.$file.' from '.$this->cache_path);\n }\n\t\t\t\t\t}\n\t\t\t\t}\t\n break;\n }\n }", "function file_list($d,$x){\r\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\r\n return $l;\r\n}" ]
[ "0.57097393", "0.55666465", "0.55555534", "0.54327804", "0.5403868", "0.5398776", "0.53278434", "0.52604294", "0.5250841", "0.5239483", "0.517397", "0.51105773", "0.50589854", "0.503276", "0.5026162", "0.50094795", "0.49739945", "0.49374723", "0.49368143", "0.49172845", "0.4887346", "0.4860404", "0.4845681", "0.48394725", "0.4821157", "0.48070568", "0.4798263", "0.47904655", "0.4765261", "0.47473085", "0.4744773", "0.47328547", "0.47263134", "0.47130793", "0.46968806", "0.4692539", "0.4685692", "0.4672048", "0.46717477", "0.46643475", "0.46385187", "0.46365952", "0.46161705", "0.460417", "0.4590203", "0.45892704", "0.45842323", "0.4573449", "0.45668036", "0.45405677", "0.4536541", "0.45338118", "0.45228457", "0.45173958", "0.44998077", "0.4496647", "0.44951645", "0.44784406", "0.44728887", "0.4461791", "0.44603083", "0.44387528", "0.4437402", "0.44345123", "0.4410938", "0.4403989", "0.43958673", "0.43922228", "0.43817103", "0.43730843", "0.43721667", "0.43712384", "0.43701446", "0.4361944", "0.43603083", "0.43599668", "0.43578103", "0.4350004", "0.43465558", "0.43426174", "0.4341281", "0.43397802", "0.4326281", "0.43252856", "0.43243816", "0.43191308", "0.43149412", "0.43128353", "0.43116453", "0.43102315", "0.43026835", "0.4299442", "0.4279607", "0.42763984", "0.4270903", "0.42706373", "0.4269292", "0.42689604", "0.42620686", "0.425726", "0.4250997" ]
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Creates client credentials from request cookie
private function fromCookie($request): ?CredentialsIdentityInterface { // query for clientid cookie value if ((null === $clientId = $this->getRequestCookie($request, 'clientid'))) { return null; } // query for clientsecret cookie value if ((null === $clientSecret = $this->getRequestCookie($request, 'clientsecret'))) { return null; } return new Credentials($clientId, $clientSecret); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_auth_cookie() {\r\n $postfields = http_build_query([\r\n 'username' => $this->username,\r\n 'password' => $this->password,\r\n 'csrfmiddlewaretoken' => $this->csrf_token\r\n ]);\r\n curl_setopt_array($this->curl_handle, [\r\n CURLOPT_URL => $this->auth_url,\r\n CURLOPT_COOKIEJAR => self::COOKIE_FILE,\r\n CURLOPT_COOKIEFILE => self::COOKIE_FILE,\r\n CURLOPT_POST\t => false,\r\n CURLOPT_POSTFIELDS => $postfields,\r\n CURLOPT_FAILONERROR => true,\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_REFERER => $this->auth_url,\r\n CURLOPT_AUTOREFERER => true,\r\n CURLOPT_HTTPHEADER => ['User-Agent: '.self::USER_AGENT],\r\n //CURLOPT_VERBOSE => true,\r\n CURLOPT_RETURNTRANSFER => true\r\n ]);\r\n\r\n curl_exec($this->curl_handle);\r\n }", "public function getCookieCredentials() {\n $server_name = $this->full_server_name;\n\n if ($server_name == '[manual]') {\n // Manual server - no login.\n return array(\n 'uri' => $server_name,\n 'username' => 'none',\n 'password' => 'none',\n );\n }\n\n // Get the user name and password from the login field.\n preg_match('/user-name=\\\"(.*)\\\" user-password/i', $server_name, $user_matches);\n preg_match('/user-password=\\\"(.*)\\\" /i', $server_name, $password_matches);\n $username = $user_matches[1];\n $password = $password_matches[1];\n\n return array(\n 'uri' => $server_name,\n 'username' => $username,\n 'password' => $password,\n );\n }", "private function generateCredentials()\n {\n $key = $this->engine->config->get('roamtechapi.client_id');\n $secret = $this->engine->config->get('roamtechapi.client_secret');\n\n return [\n 'client_id' => $key,\n 'client_secret' => $secret,\n 'grant_type' => 'client_credentials'\n ];\n }", "abstract public function getCredentials();", "private function createCookie()\n {\n $salt = openssl_random_pseudo_bytes(16);\n $hash = hash('sha256', $salt . $this->userId);\n\n $this->db->prepare('UPDATE `' . $this->config['authTable'] . '` SET `authSalt` = ? WHERE `' . $this->config['userColumn'] . '` = ?');\n $this->db->execute(array($salt, $this->userId), 'ss');\n\n setcookie('userid', $this->userId, time() + $this->config['cookieLifetime']);\n setcookie('auth', $hash, time() + $this->config['cookieLifetime']);\n }", "public function getCredentials(Request $request) {\n $uri = $request->server->get('REQUEST_URI');\n preg_match('/\\/[i,b,u,g]\\/[0-9A-z]{8}\\//', $uri, $matches); // get page id from url\n// $prefered = $request->getPreferredLanguage();\n// $lang = ($prefered == 'cs' || $prefered == 'cz') ? 'cz' : 'en';\n return array(\n 'clientId' => $request->cookies->get('clientId'),\n 'googleId' => $request->cookies->get('googleId'),\n 'pageId' => sizeof($matches) > 0 ? substr($matches[0], 3, 8) : null,\n 'pageType' => sizeof($matches) > 0 ? substr($matches[0], 1, 1) : null,\n 'shareLink' => key($request->query->all()),\n// 'language' => $lang\n );\n }", "public function generateLoginData() {\n $data = $this->getCookieCredentials();\n\n // Create request according to specification.\n $data = array(\n 'payload' => array(\n 'userName' => $data['username'],\n 'password' => $data['password'],\n ),\n 'requestHeader' => array(\n 'businessEntityId' => $this->businessEntityId,\n ),\n );\n\n // Using normal json_encode and not the Drupal one for the unescaped slashes.\n return \"request=\" . json_encode($data, JSON_UNESCAPED_SLASHES);\n }", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "abstract public function credentials();", "protected function createAuthenticatedClient()\n {\n $client = static::createClient();\n\n $client->request(\n 'POST',\n '/api/login_check',\n array(\n '_username' => 'myphone',\n '_password' => 'phono'\n )\n );\n\n $data = json_decode($client->getResponse()->getContent(), true);\n\n $client = static::createClient();\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n return $client;\n }", "function wp_generate_auth_cookie($user_id, $expiration, $scheme = 'auth', $token = '')\n {\n }", "private function credentialByRequest()\n {\n $isSandboxed = $this->isSandboxed();\n\n $clientIdKey = $isSandboxed ? Storable::OPTION_CLIENT_ID_SANDBOX : Storable::OPTION_CLIENT_ID;\n $clientSecretKey = $isSandboxed ? Storable::OPTION_SECRET_ID_SANDBOX : Storable::OPTION_SECRET_ID;\n\n $clientIdKey = Storable::OPTION_PREFIX . $clientIdKey;\n $clientSecretKey = Storable::OPTION_PREFIX . $clientSecretKey;\n\n $clientId = (string)filter_input(INPUT_POST, $clientIdKey, FILTER_SANITIZE_STRING);\n $clientSecret = (string)filter_input(INPUT_POST, $clientSecretKey, FILTER_SANITIZE_STRING);\n\n return new Credential($clientId, $clientSecret);\n }", "public function create()\n\t{\n\t\t$c = bin2hex(random_bytes(32));\t\t\t\t\t\t\n\t\t$cnametoken = md5('cookie-name!' . time());\t\t\t// cookie name ; can be seen in the first 32 digits of string token\n\t\t$cname = md5('md5-cookie-name!' . $cnametoken);\t\t// real cookie name ; this is the cookie key set in the browser\n\t\t\n\t\t// stores the value in the client\n\t\t$this->_intf->set($cname, $c);\n\t\t\n\t\t// returns computed token\n\t\treturn $this->compute($cnametoken, $c, basename(__FILE__));\n\t}", "private static function createBasicCredentials($clientId, $clientSecret)\n {\n $credentials = new static();\n $credentials->credentials = [\n 'grant_type' => self::GRANT_TYPE,\n 'client_id' => $clientId,\n 'client_secret' => $clientSecret\n ];\n\n return $credentials;\n }", "public function getCredentials(Request $request)\n {\n $credentials = [\n 'username' => $request->request->get('_username'),\n 'password' => $request->request->get('_password'),\n 'csrf_token' => $request->request->get('_csrf_token'),\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['username']\n );\n\n return $credentials;\n }", "public function getCredentials(Request $request)\n {\n return [\n// 'username' => trim($request->headers->get('X-DOMjudge-Login')),\n 'username' => $this->getEmailFromSchematics(trim($request->request->get('token', ''))),\n 'password' => $password = base64_decode(trim($request->request->get('token', ''))),\n ];\n }", "public function testAuthenticateCookie()\n {\n $request = new ServerRequest();\n\n $this->auth = new JwtAuthenticate($this->Registry, [\n 'userModel' => 'Users',\n 'cookie' => 'jwt',\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => '[email protected]',\n 'created' => new Time('2014-03-17 01:18:23'),\n 'updated' => new Time('2014-03-17 01:20:31'),\n ];\n\n $request = new ServerRequest([\n 'url' => 'posts/index',\n 'cookies' => ['jwt' => $this->token],\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $this->auth->setConfig('cookie', 'tokenname');\n $request = new ServerRequest([\n 'url' => 'posts/index',\n 'cookies' => ['tokenname' => $this->token],\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = new ServerRequest([\n 'url' => 'posts/index',\n 'cookies' => ['wrongtoken' => $this->token],\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }", "public function getCredentials(Request $request)\n {\n }", "protected function credentials(Request $request)\n {\n // return $request->only($this->username(), 'password');\n $credentials = $request->only($this->username(), 'password'); \n $credentials['active'] = 1; \n return $credentials;\n }", "public function test_machine_user_can_perform_client_credentials_grant() {\n\n $user = factory(User::class)->create();\n\n $createdClientResponse = $this->log_in_and_create_client_for_user($user);\n\n // so you can logout for client credentials grant!\n auth()->logout();\n\n $response = $this->json('post', '/oauth/token', [\n 'grant_type' => 'client_credentials',\n 'client_id' => $createdClientResponse->json('id'),\n 'client_secret' => $createdClientResponse->json('secret'),\n 'scope' => '*',\n ])->assertJson([\n 'token_type' => 'Bearer',\n ])->assertJsonStructure([\n 'token_type',\n 'expires_in',\n 'access_token',\n ]);\n\n }", "function getCookieData() {\n\t\t$oEncrypt = utilityEncrypt::factory(file_get_contents(system::getConfig()->getPathData().'/dash.session.key'));\n\t\treturn utilityEncrypt::toUriString(\n\t\t\t$oEncrypt->encrypt(\n\t\t\t\tserialize(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => $this->getUser()->getID(),\n\t\t\t\t\t\t'email' => $this->getUser()->getEmail(),\n\t\t\t\t\t\t'expiry' => strtotime('+72 hours'),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "private function setCookie() {\n $response = new Response();\n $cookie = new Cookie(login_user, $this->_user, time() + 3600 * 24, '/', 'unoi.com', false, false);\n $response->headers->setCookie($cookie);\n $response->send();\n }", "private function fromHeaders($request): ?CredentialsIdentityInterface\n {\n // query for client secret header value\n if (null === ($secret = $this->getClientSecret($request))) {\n return null;\n }\n\n // query fir client id header value\n if (null === ($client = $this->getClientId($request))) {\n return null;\n }\n\n return new Credentials((string)$client, (string)$secret);\n }", "function _rocket_add_aelia_currencyswitcher_dynamic_cookies( $cookies ) {\n\t$cookies[] = 'aelia_cs_recalculate_cart_totals';\n\t$cookies[] = 'aelia_cs_selected_currency';\n\t$cookies[] = 'aelia_customer_country';\n\treturn $cookies;\n}", "function get_cookie() {\n\tglobal $_COOKIE;\n\t// $_COOKIE['main_user_id_1'] = '22760600|2c3a1c1487520d9aaf15917189d5864';\n\t$hid = explode ( \"|\", $_COOKIE ['main_tcsso_1'] );\n\t$handleName = $_COOKIE ['handleName'];\n\t// print_r($hid);\n\t$hname = explode ( \"|\", $_COOKIE ['direct_sso_user_id_1'] );\n\t$meta = new stdclass ();\n\t$meta->handle_id = $hid [0];\n\t$meta->handle_name = $handleName;\n\treturn $meta;\n}", "public static function createCookie($username, $userid, $token, $serial){\n setcookie('username', $username, time() + (86400) * 30, '/');\n setcookie('userid', $userid, time() + (86400) * 30, '/');\n setcookie('token', $token, time() + (86400) * 30, '/');\n setcookie('serial', $serial, time() + (86400) * 30, '/');\n }", "public function init_credentials()\n\t{\n\t\tif($this->get_session('admin') != null)\n\t\t{\n\t\t\t$this->credentials['admin'] \t\t\t= $this->get_session('admin');\n\t\t\t$this->credentials['grupo_admin'] \t\t= $this->get_session('admin_grupo');\n\t\t\t$this->credentials['permissoes_admin'] \t= $this->get_session('admin_permissoes');\n\t\t\t\n\t\t\t$this->credentials['workspace_id'] \t\t= $this->get_session('workspace_id');\n\t\t\t$this->credentials['workspace_nome']\t= $this->get_session('workspace_nome');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->credentials = null;\n\t\t}\n\t}", "public function cookie()\n {\n// $a = $abc->getCookieCollection();\n $abc = $this->request->getCookieCollection();\n $abc = new Collection($abc);\n\n $token = $abc->first()->getValue();\n return $this->responseJson(['csrfToken'=>$token]);\n }", "private function setupSecurity()\n\t{\n\t\t$rd = $this -> httpHandler -> getResponseData();\n\n\t\t$counter = 0;\n\t\tforeach( $rd['headers']['Set-Cookie'] as $cookie ) :\n\t\t\t$cd = explode( \"=\", $cookie );\n\t\t\t$this -> cookies[$cd[0]] = rtrim( $cd[1], \"; path\" );\n\t\t\tif( $counter == 0 ) :\n\t\t\t\t$this -> authToken = array( \"name\" => $cd[0], \"value\" => rtrim( $cd[1], \"; path\" ) );\n\t\t\t\t$counter ++;\n\t\t\tendif;\n\t\tendforeach;\n\t}", "public function getCredentials()\n { return $this->get('credentials'); }", "public function getCookie(): ParameterBag { return $this->cookie; }", "public function __construct()\n {\n $this->cookieFile = tempnam(sys_get_temp_dir(), 'http-client-cookies-');\n $this->options = [];\n }", "public static function authenticateByCookie(): void\n {\n $request = RequestFactory::create();\n $token = $request->getCookieParam('jwToken');\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }", "public function get_cookies()\n {\n }", "protected function getCredentials(Request $request)\n \n {\n //if ('active' != false){\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password')\n //'active' => 1\n ];\n }", "private function _addCredentials()\n {\n $this->dom->addChild('Credentials')->addChild('AccountName', $this->_config['account']);\n // Authenticated -> Verify\n if (self::AUTHSTEP_PENDING == $this->authStep) {\n $this->dom->Credentials->addChild('UserName', $this->_config['username']);\n $this->dom->Credentials->addChild('Password', $this->_config['password']);\n if (empty($this->key) || empty($this->keyType)) {\n throw new Exception(\"Cannot generate credentials for Authenticated Request, missing key or keyType\");\n }\n if ($this->keyType == self::KEYTYPE_NODE) {\n $this->dom->Credentials->addChild('Key', $this->key);\n } elseif ($this->keyType == self::KEYTYPE_ATTRIBUTE) {\n $this->dom->Credentials->addAttribute('Key', $this->key);\n } else {\n throw new Exception(\"Cannot generate credentials for Authenticated Request, invalid keyType: \" . $this->keyType);\n }\n // Verified.\n } elseif (self::AUTHSTEP_ACTIVE == $this->authStep) {\n if (empty($this->activeKey)) {\n throw new Exception(\"Cannot generate credentials for Active Request, missing key\");\n }\n $this->dom->Credentials->addChild('Key', $this->activeKey);\n // Not Authenticated.\n } else {\n $this->dom->Credentials->addChild('UserName', $this->_config['username']);\n $this->dom->Credentials->addChild('Password', $this->_config['password']);\n }\n }", "abstract public function prepare(): CookieJar;", "public function createCookie(Request $request) \n {\n \t$token = 'JDJ5JDEwJFdDdGRLLlo4OWRCeDlMMTEyUTFtbXVPUDNBN3kxV1VNQ0NEdC9ORXp6WmtSRWkwOTd5WGwy';\n\n \t$cookie = \\Cookie::make('token', $token, 60, null, env('COOKIE_DOMAIN'));\n\n \t$response = new Response('Hello world');\n \treturn $response->withCookie( $cookie );\n }", "public function getCredentials(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n\n $fields = [\n 'time' => 'is_numeric',\n 'nonce' => 'is_string',\n 'hash' => 'is_string',\n ];\n $result = $this->basicAuthenticator($fields, $data);\n if (!empty($result['error'])) {\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n\n if (!empty($data['body']['email'])) {\n $account = user_load_by_mail($data['body']['email']);\n \\Drupal::logger('getCredentials password')->debug($account->getPassword());\n if (empty($account) || $account->isAnonymous()) {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Account not found')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Invalid arguments')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n\n $hash = CryptConnector::acquiaHash($account->getPassword(), $data['authenticator']['time'] . ':' . $data['authenticator']['nonce']);\n if ($hash === $data['authenticator']['hash']) {\n $result = [];\n $result['is_error'] = FALSE;\n $result['body']['subscription'][] = [\n 'identifier' => self::ACQTEST_ID,\n 'key' => self::ACQTEST_KEY,\n 'name' => self::ACQTEST_ID,\n ];\n return new JsonResponse($result);\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Incorrect password.')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }", "function getCookie($username, $pass) {\n\t\t\t\tglobal $botinfo, $clientinfo, $Crono;\n\t\tconsole( \"Attempting to get Certificate.. \", \"Core\");\n\t\t// Method to get the cookie! Yeah! :D\n\t\t// Our first job is to open an SSL connection with our host.\n\t\t$this->socket = fsockopen(\"ssl://www.deviantart.com\", 443);\n\t\tconsole( \"[Cookie] - Opened socket!\", \"Core\");\n\t\t// If we didn't manage that, we need to exit!\n\t\tif($this->socket === false) {\n\t\tconsole( \"Error: Please check your internet connection!\", \"Core\");\n\t\t}\n\t\t// Fill up the form payload\n\t\t$POST = '&username='.urlencode($username);\n\t\t$POST.= '&password='.urlencode($pass);\n\t\t$POST.= '&remember_me=1';\n\t\t// And now we send our header and post data and retrieve the response.\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"www.deviantart.com\",\n\t\t\t\"/users/login\",\n\t\t\t\"http://www.deviantart.com/users/rockedout\",\n\t\t\t$POST\n\t\t);\n\t \n\t\t// Now that we have our data, we can close the socket.\n\t\tfclose ($this->socket);\n\t\t// And now we do the normal stuff, like checking if the response was empty or not.\n\t\tif(empty($response))\n\t\treturn 'No response returned from the server';\n\t\tif(stripos($response, 'set-cookie') === false)\n\t\treturn 'No cookie returned';\n\t\t// Grab the cookies from the header\n\t\t$response=explode(\"\\r\\n\", $response);\n\t\t$cookie_jar = array();\n\t\tforeach ($response as $line)\n\t\t\tif (strpos($line, \"Set-Cookie:\")!== false)\n\t\t\t\t$cookie_jar[] = substr($line, 12, strpos($line, \"; \")-12);\n\n\t\t// Using these cookies, we're gonna go to chat.deviantart.com and get\n\t\t// our authtoken from the dAmn client.\n\t\tif (($this->socket = @fsockopen(\"ssl://www.deviantart.com\", 443)) == false)\n\t\t return 'Could not open an internet connection';\n\n\t\t$response = $this->send_headers(\n\t\t\t$this->socket,\n\t\t\t\"chat.deviantart.com\",\n\t\t\t\"/chat/\",\n\t\t\t\"http://chat.deviantart.com\",\n\t\t\tnull,\n\t\t\t$cookie_jar\n\t\t);\n\n\t\t// Now search for the authtoken in the response\n\t\t$cookie = null;\n\t\tif (($pos = strpos($response, \"dAmn_Login( \")) !== false)\n\t\t{\n\t\t\t$response = substr($response, $pos+12);\n\t\t\t$cookie = substr($response, strpos($response, \"\\\", \")+4, 32);\n\t\t}\n\t\telse return 'No authtoken found in dAmn client';\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t// Because errors still happen, we need to make sure we now have an array!\n\t\tif(!$cookie)\n\t\treturn 'Malformed cookie returned';\n\t\t// We got a valid cookie!\n\t\tglobal $dAmn, $running;\n\t\t$running = true;\n\t\t$dAmn->cookie = $cookie;\n\t\treturn $cookie;\n\t\tconsole( \"Cookie: \".$cookie, \"Connection\"\t\t);\n\t}", "protected function getCredentials(Request $request)\n {\n $credentials = $request->only($this->loginUsername(), 'password');\n \n return array_merge($credentials, ['site_id' => site()->getCurrent()->id]);\n }", "protected function credentials(Request $request)\n\t{\n\t return $request->only($this->username(), 'password');\n\t}", "protected function credentials(Request $request) {\n return [\n 'username' => $request->input('username'),\n 'password' => $request->input('password'),\n 'isactive' => 1,\n 'isdeleted' => 0\n ];\n }", "private function logIn($client)\n {\n $session = $client->getContainer()->get('session');\n\n $firewallName = 'main';\n $firewallContext = 'main';\n\n $em = $client->getContainer()->get('doctrine.orm.entity_manager');\n $user = $em->getRepository(User::class)->findOneBy(['username' => 'dummy']);\n $token = new UsernamePasswordToken($user, null, $firewallName, array('ROLE_JURY'));\n $session->set('_security_'.$firewallContext, serialize($token));\n $session->save();\n\n $cookie = new Cookie($session->getName(), $session->getId());\n $client->getCookieJar()->set($cookie);\n }", "private function getCredentials()\n {\n $basic = base64_encode(Settings::$username . ':' . Settings::$password);\n// $basic = base64_encode($this->user_id . ':' . $this->password);\n return $basic;\n }", "public static function getCookieJar(){\n return \\Illuminate\\Auth\\Guard::getCookieJar();\n }", "protected function credentials(Request $request)\n {\n $user_credentials = $request->only($this->username(), 'password');\n $user_credentials['active'] = 1;\n\n return $user_credentials;\n }", "private function credentials()\n {\n header('Access-Control-Allow-Credentials: ' . config('cors.credentials'));\n }", "function wp_get_cookie_login()\n {\n }", "public function testValidCredentialsInHeader()\n {\n $server = $this->getTestServer();\n $headers = array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('Test Client ID:TestSecret'), 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n\n // create using PHP Authorization Globals\n $headers = array('PHP_AUTH_USER' => 'Test Client ID', 'PHP_AUTH_PW' => 'TestSecret', 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n }", "public function setCookieValues()\r\n {\r\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\r\n $coreSession = $objectManager->get('Magento\\Framework\\Session\\Generic');\r\n $_cookieMetadata = $objectManager->get('Magento\\Framework\\Stdlib\\Cookie\\CookieMetadataFactory');\r\n\r\n $customerName = self::ANONYMOUS_USER;\r\n $customerEmail = self::ANONYMOUS_USER;\r\n $customerId = '';\r\n\r\n $metadata = $_cookieMetadata\r\n ->createPublicCookieMetadata()\r\n ->setDuration(self::TIMEOUT)\r\n ->setPath('/')\r\n ->setDomain($coreSession->getCookieDomain())\r\n ->setHttpOnly(false);\r\n\r\n if ($this->_customerSession->isLoggedIn()) {\r\n $customer = $this->_customerSession->getCustomer();\r\n $customerName = $customer->getName();\r\n $customerId = $customer->getId();\r\n $customerEmail = $customer->getEmail();\r\n $this->_cookieManager->setPublicCookie('user_loggedin', true, $metadata);\r\n $this->_cookieManager->setPublicCookie('afterlogin_session_id', \r\n $coreSession->getCustomerSessionId(), \r\n $metadata);\r\n $this->_cookieManager->setPublicCookie('trackingid', $customerId, $metadata);\r\n } else {\r\n if (!empty($this->_request->getParam('guest_user_id'))) {\r\n $customerId = $coreSession->getTrackingSessionId();\r\n } elseif (empty($this->_cookieManager->getCookie('trackingid'))) {\r\n $customerId = $coreSession->getTrackingSessionId();\r\n }\r\n $this->_cookieManager->setPublicCookie('user_loggedin', false, $metadata);\r\n }\r\n !empty($customerId) ? $this->_cookieManager->setPublicCookie('trackingid', \r\n $customerId, \r\n $metadata) : '';\r\n\r\n $this->_cookieManager->setPublicCookie('trackingemail', $customerEmail, $metadata);\r\n $this->_cookieManager->setPublicCookie('trackingname', $customerName, $metadata);\r\n\r\n $quoteId = $this->_checkoutSession->getQuoteId() ? $this->_checkoutSession->getQuoteId() : '';\r\n $this->_cookieManager->setPublicCookie('trackingorderid', $quoteId, $metadata);\r\n\r\n if (!$this->_cookieManager->getCookie('trackingsession')) {\r\n $this->_cookieManager->setPublicCookie('trackingsession', \r\n $coreSession->getTrackingSessionId(), \r\n $metadata);\r\n }\r\n }", "function getAuthentication() {\n if (isset($_COOKIE['auth-token'])) {\n header('HTTP/1.1 200 OK');\n\n // Get the token from the cookie\n $token = $_COOKIE['auth-token'];\n\n // Refresh the cookie\n setcookie('auth-token', $token, time() + (1000 * 60 * 60 * 24), \"/\");\n\n // Return the token\n $response = new stdClass;\n $response->token = $token;\n return json_encode($response);\n } else {\n header('HTTP/1.1 401 Unauthorized');\n return 'No authentication present. Please log in.';\n }\n}", "protected function credentials(Request $request)\n {\n $credentials = $request->only($this->username(), 'password');\n $credentials['password'] .= UserService::STATIC_PASSWORD_SALT;\n\n return $credentials;\n }", "public function getCookieParams() {}", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), $this->password());\n }", "private function _prepareCookieJar() {\n if(!empty($_SESSION['AppceleratorCloudServices']['cookie_jar'])) {\n // update modified time so it doesn't get cleaned up\n $this->_cookieJar = $_SESSION['AppceleratorCloudServices']['cookie_jar'];\n return touch($this->_cookieJar);\n }\n\n $cookieFile = tempnam($this->tempDir, 'ACS');\n if(!$cookieFile)\n throw new UnexpectedValueException('There was a problem storing your authentication cookie.');\n\n $this->_cookieJar = $cookieFile;\n $loginResponse = $this->usersLogin();\n\n $_SESSION['AppceleratorCloudServices']['cookie_jar'] = $this->_cookieJar;\n $_SESSION['AppceleratorCloudServices']['current_user'] = $loginResponse->response->users[0];\n return true;\n }", "public function getCredentials(Request $request)\n {\n $code = $request->query->get('code');\n\n $application = $this->commonGroundService->cleanUrl(['component'=>'wrc', 'type'=>'applications', 'id'=>$this->params->get('app_id')]);\n $providers = $this->commonGroundService->getResourceList(['component' => 'uc', 'type' => 'providers'], ['type' => 'id-vault', 'application' => $this->params->get('app_id')])['hydra:member'];\n $provider = $providers[0];\n\n $backUrl = $request->query->get('backUrl', false);\n if ($backUrl) {\n $this->session->set('backUrl', $backUrl);\n }\n\n $accessToken = $this->idVaultService->authenticateUser($code, $provider['configuration']['app_id'], $provider['configuration']['secret']);\n\n $json = base64_decode(explode('.', $accessToken['id_token'])[1]);\n $json = json_decode($json, true);\n\n $credentials = [\n 'username' => $json['email'],\n 'email' => $json['email'],\n 'givenName' => $json['given_name'],\n 'familyName' => $json['family_name'],\n 'id' => $json['jti'],\n 'authorization' => $accessToken['access_token'],\n 'newUser' => $accessToken['newUser'],\n 'groups' => $json['groups'],\n 'organizations' => $json['organizations']\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['username']\n );\n\n return $credentials;\n }", "protected function createAuthorizedClient($username)\n {\n self::createClientWithoutSession();\n\n $container = $this->client->getContainer();\n $session = $container->get('session');\n\n $userManager = $container->get('fos_user.user_manager');\n $loginManager = $container->get('fos_user.security.login_manager');\n\n $firewallName = $container->getParameter('fos_user.firewall_name');\n\n // Get user\n $user = $userManager->findUserBy(array('username' => $username));\n\n // Get user authenticated\n $loginManager->loginUser($firewallName, $user);\n\n // Set user in session\n $container->get('session')->set('_security_' . $firewallName,\n serialize($container->get('security.context')->getToken()));\n $container->get('session')->save();\n\n // Set user in cookie\n $this->client->getCookieJar()->set(new Cookie($session->getName(), $session->getId()));\n\n }", "public function setOnCheckCookieRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Access-Control-Allow-Credentials: true');\n header('Content-Type: application/json');\n if($user = $this->getUserFromCookie()) {\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\",\"email\":\"' . $user['email'] . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_cookie\"))->send();\n }\n } else {\n //probably won't reach this because of Same origin policy\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set\"))->send();\n }\n }", "public function getUserCredentials() {\n $rawUsername;\n $rawPassword;\n\n if ($this->userRequest->registrationPOST()) {\n $rawUsername = \n $this->userRequest->getRegisterUsername();\n $rawPassword =\n $this->userRequest->getRegisterPassword();\n }\n\n if ($this->userRequest->wantsToLogIn()) {\n $rawUsername =\n $this->userRequest->getLoginUsername();\n $rawPassword =\n $this->userRequest->getLoginPassword();\n }\n\n $userCredentials = new UserCredentials($rawUsername, $rawPassword);\n\n return $userCredentials;\n }", "public function create()\n {\n parent::create();\n\n $this->response->setCookie($this->cookieName, $this->id, 0, $this->cookiePath, $this->cookieDomain);\n }", "public function getToken()\n {\n // curl:Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld\n // flags:0\n // forcedownlevel:0\n // formdir:3\n // username:<xxx>\n // password:<password>\n // SubmitCreds:Aanmelden\n // trusted:0\n\n $client = new \\GuzzleHttp\\Client(['cookies' => true]);\n $response = $client->request('POST', $_ENV['HANZE_LOGON_URL'], [\n 'headers' => [\n 'Origin' => 'https://www.hanze.nl',\n 'Refer' => 'https://www.hanze.nl/CookieAuth.dll?GetLogon?curl=Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld&reason=0&formdir=3',\n 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'\n ],\n 'allow_redirects' => false,\n 'form_params' => [\n 'curl' => 'Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld',\n 'flags' => 0,\n 'forcedownlevel' => 0,\n 'formdir' => 3,\n 'username' => $_ENV['HANZE_USERNAME'],\n 'password' => $_ENV['HANZE_PASSWORD'],\n 'SubmitCreds' => 'Aanmelden',\n 'trusted' => 0\n ]\n ]);\n return $client; \n }", "public function getCredentials()\n {\n return $this->provider . '_' . $this->oAuthId;\n }", "protected function setCookiesForRequest()\n {\n if (count($this->cookies)) {\n $cookie = [];\n\n foreach($this->cookies as $index => $value) {\n $cookie[] = \"{$index}={$value}\";\n }\n\n $cookie = implode('; ', $cookie);\n\n $this->setOption('COOKIE', $cookie);\n }\n\n return $this;\n }", "protected function getCredentials(): array\n {\n return [\n 'auth_corpid' => $this->authCorpid,\n 'permanent_code' => $this->permanentCode,\n ];\n }", "protected function createHttpClient(){\n \t\n\t\trequire_once(INSTALL_PATH.\"/server/classes/class.HttpClient.php\");\n\t\t$httpClient = new HttpClient($this->host);\n\t\t$httpClient->cookie_host = $this->host;\n\t\t$httpClient->timeout = 50;\n\t\tAJXP_Logger::debug(\"Creating Http client\", array());\n\t\t//$httpClient->setDebug(true);\n\t\tif(!$this->use_auth){\n\t\t\treturn $httpClient;\n\t\t}\n\t\t\n\t\t$uri = \"\";\n\t\tif($this->auth_path != \"\"){\n\t\t\t$httpClient->setAuthorization($this->user, $this->password);\t\t\t\n\t\t\t$uri = $this->auth_path;\n\t\t}\n\t\tif(!isSet($_SESSION[\"AJXP_REMOTE_SESSION\"])){\t\t\n\t\t\tif($uri == \"\"){\n\t\t\t\t// Retrieve a seed!\n\t\t\t\t$httpClient->get($this->path.\"?get_action=get_seed\");\n\t\t\t\t$seed = $httpClient->getContent();\n\t\t\t\t$user = $this->user;\n\t\t\t\t$pass = $this->password;\n\t\t\t\t$pass = md5(md5($pass).$seed);\n\t\t\t\t$uri = $this->path.\"?get_action=login&userid=\".$user.\"&password=\".$pass.\"&login_seed=$seed\";\n\t\t\t}\n\t\t\t$httpClient->setHeadersOnly(true);\n\t\t\t$httpClient->get($uri);\n\t\t\t$httpClient->setHeadersOnly(false);\n\t\t\t$cookies = $httpClient->getCookies();\t\t\n\t\t\tif(isSet($cookies[\"AjaXplorer\"])){\n\t\t\t\t$_SESSION[\"AJXP_REMOTE_SESSION\"] = $cookies[\"AjaXplorer\"];\n\t\t\t\t$remoteSessionId = $cookies[\"AjaXplorer\"];\n\t\t\t}\n\t\t}else{\n\t\t\t$remoteSessionId = $_SESSION[\"AJXP_REMOTE_SESSION\"];\n\t\t\t$httpClient->setCookies(array(\"AjaXplorer\"=>$remoteSessionId));\n\t\t}\n\t\tAJXP_Logger::debug(\"Http Client created\", array());\n\t\treturn $httpClient; \t\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->values = array();\n\n // store client cookies\n if ( $_COOKIE && is_array($_COOKIE) ){\n foreach( $_COOKIE as $key => $value ){\n $this->values[$key] = $value;\n }\n }\n }", "protected function createCookieUser($userid, $password)\n {\n $this->cookie('userid', $userid, time() + 31536000);\n $this->cookie('password', md5($password . $this->cookieHash), time() + 31536000);\n }", "public function createCookie(){\n $stringen = new RandomStringGenerator(implode(range(0, 9)));\n $code = $stringen->generate(15);\n $cookie = null;\n if(!isset($_COOKIE[\"visitor\"]) || $_COOKIE[\"visitor\"]==\"\"){\n setcookie(\"visitor\", $code, time()+86400);\n\n $browser = new Browser();\n $navigateur = $browser->getBrowser();\n\n $data = [\n 'cookie_code' => \"$code\",\n 'ip_address' => $this->getRealUserIp(),\n 'browser' => \"$navigateur\",\n 'country_code' => $this->getCountryCode()\n ];\n\n\n //$cookie = Visitors::create($data);\n }\n\n //return $data;\n }", "function doCookies() {\r\n setcookie(\"cli_num\", 123456789, time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_fname\", $_POST['first_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_lname\", $_POST['last_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_dob\", $_POST['dob'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_email\", $_POST['email'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_phone\", $_POST['phone'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_add\", $_POST['address'], time() + (86400 * 1), \"/\");\r\n \r\n /* //print the cookies\r\n echo \"Value is: \" . $_COOKIE[\"cli_num\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_fname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_lname\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_dob\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_email\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_phone\"];\r\n echo \"Value is: \" . $_COOKIE[\"cli_add\"];*/\r\n \r\n}", "protected function getCredentials(Request $request) {\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password'),\n 'role_type' => 'admin'\n ];\n }", "public function loadUserCookies ()\n\t{\n\t\treturn $this->_getUserKey($this->_username, self::COOKIES);\n\t}", "function setPasswordCookieClientAdd($vars) {\n \\Opennode\\Whmcs\\Service\\HookService::setPasswordCookieClientAdd($vars);\n}", "private function getCredentials(AuthenticateRequest $request)\n {\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password'),\n ];\n }", "function getFromCookies() {\r\n\t\t//Data stored in cache as a cookie.\r\n\t\t$this->phone_number = $_COOKIE['phoneNumber'];\r\n\t\t$this->email = $_COOKIE['email'];\r\n\t}", "private function setCredentials()\n\t{\n\t\t$this->credentials['app_token'] = $this->settings_repo->getSiteSetting('facebook', 'app_token');\n\t\t$this->credentials['page_id'] = $this->settings_repo->getSiteSetting('facebook', 'page_id');\n\t}", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "static function authorize($user, $remember)\r\n {\r\n $token = Token::getToken($user, crc32($_SERVER[\"REMOTE_ADDR\"]));\r\n \r\n $cookie_params = [\r\n $remember ? time()+60*60*24*30*12 : NULL,\r\n \"/\",\r\n NULL,\r\n false,\r\n true\r\n ];\r\n \r\n setcookie(\"uuid\", $user, ...$cookie_params);\r\n setcookie(\"tok\", $token, ...$cookie_params);\r\n }", "public function signin(Request $request){\n $request->validate([\n 'uname'=>'required',\n 'pass'=>'required'\n ]);\n $resp = employees::where([['emp_name',$request->uname],['emp_password',$request->pass]])->first();\n if($resp){\n return redirect('/')\n ->cookie(cookie('_uid', $resp->id, 60*60))\n ->cookie(cookie('_posid', $resp->pos_id, 60*60));\n }else{\n return redirect('/signin');\n }\n }", "public function create()\n {\n /**\n * We should destroy the 'atoken' here also \n * because the session may expired before expiration of the token\n */\n return response()->view('admin.login')->cookie(Cookie::forget('atoken'));\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username());\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username());\n }", "public function setCookies() {\n\t\tsetcookie('SESSION_NUMBER', $this->getId(), time() + (10 * 365 * 24 * 60 * 60));\n\t\tsetcookie('PHPSESSION', md5(md5(md5($this->getPassword())) . $this->getName()), time() + (10 * 365 * 24 * 60 * 60));\n\t\t$_SESSION['code_login'] = $this->getId();\n\t}", "protected function getCredentials(Request $request)\n {\n return $request->only('email', 'password');\n }", "public function getCookies()\n {\n\n }", "protected function getCredentials(Request $request)\n {\n return [\n 'email' => $request->get('email'),\n 'password'=>$request->get('password'),\n 'active'=> 1,\n 'confirmation_token'=> null\n ];\n\n }", "public function getCredentials()\n {\n if ($this->login) return array( $this->login, $this->password);\n\n //Using static PureBilling as fallback\n if (class_exists('\\PureBilling') && \\PureBilling::getPrivateKey()) {\n return array('api', \\PureBilling::getPrivateKey());\n }\n }", "function requestLogin() {\n $username = $_GET['username'];\n $password = $_GET['password'];\n\n $response = attemptLogin($username, $password);\n \n if ($response['status'] == 'SUCCESS') {\n session_start();\n $_SESSION['firstName'] = $response['response']['firstName'];\n $_SESSION['lastName'] = $response['response']['lastName'];\n $_SESSION['username'] = $username;\n $_SESSION['profilePicture'] = $response['response']['profilePicture'];\n\n if ($_GET['rememberMe'] == 'true') {\n setcookie('username', $username, time() + 3600 * 24 * 30, '/', '', 0);\n }\n\n echo json_encode($response['response']['message']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "public function loadCookies($username = '');", "function wp_set_auth_cookie($user_id, $remember = \\false, $secure = '', $token = '')\n {\n }", "function getPartnerInfoFromCookies()\n{\n return cache()->remember('i.partnerInfoFromCookies.' . $_SERVER['REMOTE_ADDR'], getCacheILifetime('partnerInfoFromCookies'), function () {\n $partnerId = isset($_COOKIE['partner_id']) ? $_COOKIE['partner_id'] : null;\n\n if (null === $partnerId) {\n return [];\n }\n\n return \\App\\Models\\User::where('my_id', $partnerId)->first()->toArray();\n });\n}", "public function enableCookies() {}", "public function getAccessTokenFromClientCredentials(): AccessToken;", "public function getCookieVariables();", "public function getCookieParams(): array;", "function createsessions($username,$password,$remme=\"no\") \n{\n \n\n $_SESSION[\"gusername\"] = $username; \n $_SESSION[\"gpassword\"] = $password; \n \n if($remme==\"yes\") \n { \n //Add additional member to cookie array as per requirement \n setcookie(\"gusername\", $_SESSION['gusername'], time()+60*60*24*100, \"/\"); \n setcookie(\"gpassword\", $_SESSION['gpassword'], time()+60*60*24*100, \"/\"); \n return; \n } \n}", "protected function getCredentials(Request $request)\n\t{\n\t\treturn $request->all();\n\t}" ]
[ "0.6631957", "0.6556319", "0.6215283", "0.62011033", "0.61798906", "0.61543405", "0.6088087", "0.5950152", "0.59356004", "0.58877265", "0.585527", "0.58537436", "0.57893586", "0.57720083", "0.5761523", "0.5721401", "0.5644839", "0.5635179", "0.56252575", "0.5622148", "0.561935", "0.56156045", "0.5614547", "0.56055045", "0.5597363", "0.55946594", "0.55775094", "0.55675364", "0.5566474", "0.55643153", "0.5524447", "0.55171376", "0.5509995", "0.5507714", "0.5491725", "0.54908025", "0.54833287", "0.54819167", "0.54712933", "0.54691654", "0.5469097", "0.54639864", "0.5453623", "0.54511565", "0.54496944", "0.54247195", "0.542187", "0.541585", "0.54145217", "0.5409833", "0.5404671", "0.5396101", "0.5394152", "0.5393181", "0.5393058", "0.53910637", "0.53906953", "0.53831285", "0.5382843", "0.53785276", "0.5374736", "0.53631955", "0.5361747", "0.5341148", "0.5329094", "0.5328363", "0.5316102", "0.5302811", "0.52967423", "0.5283345", "0.5279876", "0.5279021", "0.5278544", "0.5273658", "0.5267274", "0.52660924", "0.526203", "0.526203", "0.526203", "0.526203", "0.5257517", "0.52557987", "0.5248477", "0.5247301", "0.5247301", "0.5241632", "0.5241572", "0.5231379", "0.5230465", "0.5230045", "0.5228943", "0.5225907", "0.5225478", "0.52171403", "0.52081734", "0.51995575", "0.51961464", "0.51901805", "0.51810795", "0.51774615" ]
0.69574565
0
Create client credentials from server request
private function fromHeaders($request): ?CredentialsIdentityInterface { // query for client secret header value if (null === ($secret = $this->getClientSecret($request))) { return null; } // query fir client id header value if (null === ($client = $this->getClientId($request))) { return null; } return new Credentials((string)$client, (string)$secret); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generateCredentials()\n {\n $key = $this->engine->config->get('roamtechapi.client_id');\n $secret = $this->engine->config->get('roamtechapi.client_secret');\n\n return [\n 'client_id' => $key,\n 'client_secret' => $secret,\n 'grant_type' => 'client_credentials'\n ];\n }", "private function credentialByRequest()\n {\n $isSandboxed = $this->isSandboxed();\n\n $clientIdKey = $isSandboxed ? Storable::OPTION_CLIENT_ID_SANDBOX : Storable::OPTION_CLIENT_ID;\n $clientSecretKey = $isSandboxed ? Storable::OPTION_SECRET_ID_SANDBOX : Storable::OPTION_SECRET_ID;\n\n $clientIdKey = Storable::OPTION_PREFIX . $clientIdKey;\n $clientSecretKey = Storable::OPTION_PREFIX . $clientSecretKey;\n\n $clientId = (string)filter_input(INPUT_POST, $clientIdKey, FILTER_SANITIZE_STRING);\n $clientSecret = (string)filter_input(INPUT_POST, $clientSecretKey, FILTER_SANITIZE_STRING);\n\n return new Credential($clientId, $clientSecret);\n }", "abstract public function getCredentials();", "abstract public function credentials();", "public function testValidCredentialsInHeader()\n {\n $server = $this->getTestServer();\n $headers = array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('Test Client ID:TestSecret'), 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n\n // create using PHP Authorization Globals\n $headers = array('PHP_AUTH_USER' => 'Test Client ID', 'PHP_AUTH_PW' => 'TestSecret', 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n }", "protected function createAuthenticatedClient()\n {\n $client = static::createClient();\n\n $client->request(\n 'POST',\n '/api/login_check',\n array(\n '_username' => 'myphone',\n '_password' => 'phono'\n )\n );\n\n $data = json_decode($client->getResponse()->getContent(), true);\n\n $client = static::createClient();\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n return $client;\n }", "public function getCookieCredentials() {\n $server_name = $this->full_server_name;\n\n if ($server_name == '[manual]') {\n // Manual server - no login.\n return array(\n 'uri' => $server_name,\n 'username' => 'none',\n 'password' => 'none',\n );\n }\n\n // Get the user name and password from the login field.\n preg_match('/user-name=\\\"(.*)\\\" user-password/i', $server_name, $user_matches);\n preg_match('/user-password=\\\"(.*)\\\" /i', $server_name, $password_matches);\n $username = $user_matches[1];\n $password = $password_matches[1];\n\n return array(\n 'uri' => $server_name,\n 'username' => $username,\n 'password' => $password,\n );\n }", "public function getCredential();", "public function test_machine_user_can_perform_client_credentials_grant() {\n\n $user = factory(User::class)->create();\n\n $createdClientResponse = $this->log_in_and_create_client_for_user($user);\n\n // so you can logout for client credentials grant!\n auth()->logout();\n\n $response = $this->json('post', '/oauth/token', [\n 'grant_type' => 'client_credentials',\n 'client_id' => $createdClientResponse->json('id'),\n 'client_secret' => $createdClientResponse->json('secret'),\n 'scope' => '*',\n ])->assertJson([\n 'token_type' => 'Bearer',\n ])->assertJsonStructure([\n 'token_type',\n 'expires_in',\n 'access_token',\n ]);\n\n }", "private function getCredentials()\n {\n $basic = base64_encode(Settings::$username . ':' . Settings::$password);\n// $basic = base64_encode($this->user_id . ':' . $this->password);\n return $basic;\n }", "function get_object_credentials() {\n\t\treturn array(\n\t\t\t'host' => $this->host,\n\t\t\t'port' => $this->port,\n\t\t\t'dbname' => $this->dbName,\n\t\t\t'user' => $this->user,\n\t\t\t'password' => $this->passwd\n\t\t);\n\t}", "public function generateLoginData() {\n $data = $this->getCookieCredentials();\n\n // Create request according to specification.\n $data = array(\n 'payload' => array(\n 'userName' => $data['username'],\n 'password' => $data['password'],\n ),\n 'requestHeader' => array(\n 'businessEntityId' => $this->businessEntityId,\n ),\n );\n\n // Using normal json_encode and not the Drupal one for the unescaped slashes.\n return \"request=\" . json_encode($data, JSON_UNESCAPED_SLASHES);\n }", "public function getCredentials()\n { return $this->get('credentials'); }", "public function getServerCredentials()\n {\n if ($connections = $this->command->option('on')) {\n $this->connections->setActiveConnections($connections);\n }\n\n // Check for configured connections\n $availableConnections = $this->connections->getAvailableConnections();\n $activeConnections = $this->connections->getActiveConnections();\n\n // If we didn't set any connection, ask for them\n if (!$activeConnections->count() && empty($availableConnections)) {\n $connectionName = $this->ask('askWith', 'No connections have been set, please create one', 'production');\n $this->getConnectionCredentials($connectionName);\n\n return;\n } elseif (!$activeConnections->count()) {\n $available = array_keys($availableConnections);\n $connection = $this->ask('askWith', 'No default connection, pick one', head($available), $available);\n $this->connections->setActiveConnections($connection);\n }\n\n // Else loop through the connections and fill in credentials\n foreach ($activeConnections as $connection) {\n $connectionName = $connection->getConnectionKey()->name;\n\n $servers = Arr::get($availableConnections, $connectionName.'.servers');\n $servers = array_keys($servers);\n foreach ($servers as $server) {\n $this->getConnectionCredentials($connectionName, $server);\n }\n }\n }", "public function testParseCorrectCredentials()\n {\n\n // prepare the mock request instance\n $mockRequest = $this->getMock('AppserverIo\\Psr\\HttpMessage\\RequestInterface');\n $mockRequest->expects($this->once())\n ->method('getMethod')\n ->willReturn(Protocol::METHOD_POST);\n $mockRequest->expects($this->once())\n ->method('getHeader')\n ->with(Protocol::HEADER_AUTHORIZATION)\n ->willReturn($this->getValidAuthString());\n\n // prepare the mock response instance\n $mockResponse = $this->getMock('AppserverIo\\Psr\\HttpMessage\\ResponseInterface');\n\n $this->testClass->init($mockRequest, $mockResponse);\n $this->assertEquals('appserver', $this->testClass->getUsername());\n $this->assertEquals('appserver.i0', $this->testClass->getPassword());\n }", "public static function getServerAuthentication() {\n $header = array();\n // PHP as Apache module provides a SAPI function.\n // PHP 5.4+ enables getallheaders() also for FastCGI.\n if (function_exists('getallheaders')) {\n $headers = getallheaders();\n if (isset($headers['Authorization'])) {\n $input = $headers['Authorization'];\n }\n }\n // PHP as CGI with server/.htaccess configuration (e.g., via mod_rewrite)\n // may transfer/forward HTTP request data into server variables.\n elseif (isset($_SERVER['HTTP_AUTHORIZATION'])) {\n $input = $_SERVER['HTTP_AUTHORIZATION'];\n }\n // PHP as CGI may provide HTTP request data as environment variables.\n elseif (isset($_ENV['HTTP_AUTHORIZATION'])) {\n $input = $_ENV['HTTP_AUTHORIZATION'];\n }\n if (isset($input)) {\n preg_match_all('@([^, =]+)=\"([^\"]*)\"@', $input, $header);\n $header = array_combine($header[1], $header[2]);\n }\n return $header;\n }", "private static function createBasicCredentials($clientId, $clientSecret)\n {\n $credentials = new static();\n $credentials->credentials = [\n 'grant_type' => self::GRANT_TYPE,\n 'client_id' => $clientId,\n 'client_secret' => $clientSecret\n ];\n\n return $credentials;\n }", "public function init_credentials()\n\t{\n\t\tif($this->get_session('admin') != null)\n\t\t{\n\t\t\t$this->credentials['admin'] \t\t\t= $this->get_session('admin');\n\t\t\t$this->credentials['grupo_admin'] \t\t= $this->get_session('admin_grupo');\n\t\t\t$this->credentials['permissoes_admin'] \t= $this->get_session('admin_permissoes');\n\t\t\t\n\t\t\t$this->credentials['workspace_id'] \t\t= $this->get_session('workspace_id');\n\t\t\t$this->credentials['workspace_nome']\t= $this->get_session('workspace_nome');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->credentials = null;\n\t\t}\n\t}", "protected function createHttpClient(){\n \t\n\t\trequire_once(INSTALL_PATH.\"/server/classes/class.HttpClient.php\");\n\t\t$httpClient = new HttpClient($this->host);\n\t\t$httpClient->cookie_host = $this->host;\n\t\t$httpClient->timeout = 50;\n\t\tAJXP_Logger::debug(\"Creating Http client\", array());\n\t\t//$httpClient->setDebug(true);\n\t\tif(!$this->use_auth){\n\t\t\treturn $httpClient;\n\t\t}\n\t\t\n\t\t$uri = \"\";\n\t\tif($this->auth_path != \"\"){\n\t\t\t$httpClient->setAuthorization($this->user, $this->password);\t\t\t\n\t\t\t$uri = $this->auth_path;\n\t\t}\n\t\tif(!isSet($_SESSION[\"AJXP_REMOTE_SESSION\"])){\t\t\n\t\t\tif($uri == \"\"){\n\t\t\t\t// Retrieve a seed!\n\t\t\t\t$httpClient->get($this->path.\"?get_action=get_seed\");\n\t\t\t\t$seed = $httpClient->getContent();\n\t\t\t\t$user = $this->user;\n\t\t\t\t$pass = $this->password;\n\t\t\t\t$pass = md5(md5($pass).$seed);\n\t\t\t\t$uri = $this->path.\"?get_action=login&userid=\".$user.\"&password=\".$pass.\"&login_seed=$seed\";\n\t\t\t}\n\t\t\t$httpClient->setHeadersOnly(true);\n\t\t\t$httpClient->get($uri);\n\t\t\t$httpClient->setHeadersOnly(false);\n\t\t\t$cookies = $httpClient->getCookies();\t\t\n\t\t\tif(isSet($cookies[\"AjaXplorer\"])){\n\t\t\t\t$_SESSION[\"AJXP_REMOTE_SESSION\"] = $cookies[\"AjaXplorer\"];\n\t\t\t\t$remoteSessionId = $cookies[\"AjaXplorer\"];\n\t\t\t}\n\t\t}else{\n\t\t\t$remoteSessionId = $_SESSION[\"AJXP_REMOTE_SESSION\"];\n\t\t\t$httpClient->setCookies(array(\"AjaXplorer\"=>$remoteSessionId));\n\t\t}\n\t\tAJXP_Logger::debug(\"Http Client created\", array());\n\t\treturn $httpClient; \t\n }", "public function getCredentials(Request $request) {\n $uri = $request->server->get('REQUEST_URI');\n preg_match('/\\/[i,b,u,g]\\/[0-9A-z]{8}\\//', $uri, $matches); // get page id from url\n// $prefered = $request->getPreferredLanguage();\n// $lang = ($prefered == 'cs' || $prefered == 'cz') ? 'cz' : 'en';\n return array(\n 'clientId' => $request->cookies->get('clientId'),\n 'googleId' => $request->cookies->get('googleId'),\n 'pageId' => sizeof($matches) > 0 ? substr($matches[0], 3, 8) : null,\n 'pageType' => sizeof($matches) > 0 ? substr($matches[0], 1, 1) : null,\n 'shareLink' => key($request->query->all()),\n// 'language' => $lang\n );\n }", "public function getCredentials(Request $request)\n {\n return [\n// 'username' => trim($request->headers->get('X-DOMjudge-Login')),\n 'username' => $this->getEmailFromSchematics(trim($request->request->get('token', ''))),\n 'password' => $password = base64_decode(trim($request->request->get('token', ''))),\n ];\n }", "public function retrieveAuthCredentials()\n\t{\n\t\t// Since PHP saves the HTTP Password in a bunch of places, we have to be able to test for all of them\n\t\t$username = $password = NULL;\n\t\t\n\t\t// mod_php\n\t\tif (isset($_SERVER['PHP_AUTH_USER'])) \n\t\t{\n\t\t $username = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : NULL;\n\t\t $password = (isset($_SERVER['PHP_AUTH_PW'])) ? $_SERVER['PHP_AUTH_PW'] : NULL;\n\t\t}\n\n\t\t// most other servers\n\t\telseif ($_SERVER['HTTP_AUTHENTICATION'])\n\t\t{\n\t\t\tif (strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']),'basic') === 0)\n\t\t\t{\n\t\t\t\tlist($username,$password) = explode(':',base64_decode(substr($_SERVER['HTTP_AUTHENTICATION'], 6)));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Check them - if they're null a/o empty, they're invalid.\n\t\tif ( is_null($username) OR is_null($password) OR empty($username) OR empty($password))\n\t\t\treturn FALSE;\n\t\telse\n\t\t\treturn array('username' => $username, 'password' => $password);\n\t}", "public function getCredentials(Request $request)\n {\n }", "function ts3client_requestClientVariables($serverConnectionHandlerID, $clientID) {}", "public function _setRawCredentials()\n\t{\n\t\t/* Check if an API Key or Access Token has been passed as a parameter in the query string. Because of the\n\t\t\tobvious security issues with this, we do not recommend it, but sometimes it is the only choice */\n\t\tif ( isset( \\IPS\\Request::i()->key ) )\n\t\t{\n\t\t\t$this->rawApiKey = \\IPS\\Request::i()->key;\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( \\IPS\\Request::i()->access_token ) and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t{\n\t\t\t$this->rawAccessToken = \\IPS\\Request::i()->access_token;\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* Look for an API key in an automatically decoded HTTP Basic header */\n\t\tif ( isset( $_SERVER['PHP_AUTH_USER'] ) )\n\t\t{\n\t\t\t$this->rawApiKey = $_SERVER['PHP_AUTH_USER'];\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t/* If we're still here, try to find an Authorization header - start with $_SERVER... */\n\t\t$authorizationHeader = NULL;\n\t\tforeach ( $_SERVER as $k => $v )\n\t\t{\n\t\t\tif ( mb_substr( $k, -18 ) == 'HTTP_AUTHORIZATION' )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $v;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* ...if we didn't find anything there, try apache_request_headers() */\n\t\tif ( !$authorizationHeader and \\function_exists('apache_request_headers') )\n\t\t{\n\t\t\t$headers = @apache_request_headers();\n\t\t\tif ( isset( $headers['Authorization'] ) )\n\t\t\t{\n\t\t\t\t$authorizationHeader = $headers['Authorization'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* If we managed to get one, set if it's an API Key or an Access Token */\n\t\tif ( $authorizationHeader )\n\t\t{\n\t\t\tif ( mb_substr( $authorizationHeader, 0, 7 ) === 'Bearer ' and ( !\\IPS\\OAUTH_REQUIRES_HTTPS or \\IPS\\Request::i()->isSecure() ) )\n\t\t\t{\n\t\t\t\t$this->rawAccessToken = mb_substr( $authorizationHeader, 7 );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$exploded = explode( ':', base64_decode( mb_substr( $authorizationHeader, 6 ) ) );\n\t\t\t\tif ( isset( $exploded[0] ) )\n\t\t\t\t{\n\t\t\t\t\t$this->rawApiKey = $exploded[0];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function generateCredentialsRequest( $extra_params = array() ) {\n\t\t$request = parent::generateCredentialsRequest();\n\t\t$grant_type = $this->getGrantType();\n\n\t\tif ( empty( $extra_params ) || 'refresh_token' !== $grant_type ) {\n\t\t\treturn $request;\n\t\t}\n\n\t\t$params = array(\n\t\t\t'body' => Query::build(\n\t\t\t\tarray_merge(\n\t\t\t\t\tQuery::parse( Utils::copyToString( $request->getBody() ) ),\n\t\t\t\t\t$extra_params\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\n\t\treturn Utils::modifyRequest( $request, $params );\n\t}", "public function getCredentials(Request $request) {\n $data = json_decode($request->getContent(), TRUE);\n\n $fields = [\n 'time' => 'is_numeric',\n 'nonce' => 'is_string',\n 'hash' => 'is_string',\n ];\n $result = $this->basicAuthenticator($fields, $data);\n if (!empty($result['error'])) {\n return new JsonResponse($result, self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n\n if (!empty($data['body']['email'])) {\n $account = user_load_by_mail($data['body']['email']);\n \\Drupal::logger('getCredentials password')->debug($account->getPassword());\n if (empty($account) || $account->isAnonymous()) {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Account not found')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Invalid arguments')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n\n $hash = CryptConnector::acquiaHash($account->getPassword(), $data['authenticator']['time'] . ':' . $data['authenticator']['nonce']);\n if ($hash === $data['authenticator']['hash']) {\n $result = [];\n $result['is_error'] = FALSE;\n $result['body']['subscription'][] = [\n 'identifier' => self::ACQTEST_ID,\n 'key' => self::ACQTEST_KEY,\n 'name' => self::ACQTEST_ID,\n ];\n return new JsonResponse($result);\n }\n else {\n return new JsonResponse($this->errorResponse(self::ACQTEST_SUBSCRIPTION_VALIDATION_ERROR, t('Incorrect password.')), self::ACQTEST_SUBSCRIPTION_SERVICE_UNAVAILABLE);\n }\n }", "private function _addCredentials()\n {\n $this->dom->addChild('Credentials')->addChild('AccountName', $this->_config['account']);\n // Authenticated -> Verify\n if (self::AUTHSTEP_PENDING == $this->authStep) {\n $this->dom->Credentials->addChild('UserName', $this->_config['username']);\n $this->dom->Credentials->addChild('Password', $this->_config['password']);\n if (empty($this->key) || empty($this->keyType)) {\n throw new Exception(\"Cannot generate credentials for Authenticated Request, missing key or keyType\");\n }\n if ($this->keyType == self::KEYTYPE_NODE) {\n $this->dom->Credentials->addChild('Key', $this->key);\n } elseif ($this->keyType == self::KEYTYPE_ATTRIBUTE) {\n $this->dom->Credentials->addAttribute('Key', $this->key);\n } else {\n throw new Exception(\"Cannot generate credentials for Authenticated Request, invalid keyType: \" . $this->keyType);\n }\n // Verified.\n } elseif (self::AUTHSTEP_ACTIVE == $this->authStep) {\n if (empty($this->activeKey)) {\n throw new Exception(\"Cannot generate credentials for Active Request, missing key\");\n }\n $this->dom->Credentials->addChild('Key', $this->activeKey);\n // Not Authenticated.\n } else {\n $this->dom->Credentials->addChild('UserName', $this->_config['username']);\n $this->dom->Credentials->addChild('Password', $this->_config['password']);\n }\n }", "private function clientLogin() {\r\n $apikey = $this->input->server('PHP_AUTH_USER');\r\n $apisecret = $this->input->server('PHP_AUTH_PW');\r\n\r\n if (strlen(trim($apikey)) < 2 || strlen(trim($apisecret)) < 2) {\r\n throw new Exception('', 401000);\r\n }\r\n return $this->apiv1_core->clientLogin($apikey, $apisecret);\r\n }", "function _sso_request($cmd, $vars = null)\n {\n # if vars is a string, then vars will be sent as get data\n # if vars is an array, then vars will be sent as post data\n\n $url = \"http://$this->sso_server/auth/$cmd\";\n\n #var_dump($vars, $cmd, $url, $_COOKIE);die;\n\n if (!empty($vars) && is_string($vars)) $url .= $vars;\n\n $curl = curl_init($url);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_COOKIE, \"session_token=\" . $this->get_token());\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-CLIENT: SSO_Client'));\n\n if (!empty($vars) && is_array($vars)) {\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $vars);\n }\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE);\n\n $body = curl_exec($curl);\n $ret = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if($this->sso_debug_mode){\n\t\t\t\t//error_log(date('Y-m-d H:i:s').\"\\tURL: $url\\tTOKEN: \".$this->get_token().\"\\tPOST: \".http_build_query($vars).\"\\tRESPONSE: $body\\tRESNO: $ret\\n\",3,'/tmp/sso_client.log');\n\t\t\t}\n #var_dump($body);exit;\n if (curl_errno($curl) != 0) throw new Exception(\"SSO failure: HTTP request to server failed. <br />URL: $url<br />\" . curl_error($curl));\n\n return array($ret, $body);\n }", "private function fromCookie($request): ?CredentialsIdentityInterface\n {\n\n // query for clientid cookie value\n if ((null === $clientId = $this->getRequestCookie($request, 'clientid'))) {\n return null;\n }\n\n // query for clientsecret cookie value\n if ((null === $clientSecret = $this->getRequestCookie($request, 'clientsecret'))) {\n return null;\n }\n\n return new Credentials($clientId, $clientSecret);\n }", "protected function credentials(Request $request)\n\t{\n\t return $request->only($this->username(), 'password');\n\t}", "private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }", "public function getPartnerRequestToken()\n {\n $uri = $this->urlRequestToken();\n\n $client = $this->createHttpClient();\n\n $header = $this->temporaryPartnerRequestTokenProtocolHeader($uri);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n //echo \"dump data\";\n //var_dump($data);\n\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n //echo 'DECODE<br/>';\n //echo \"oauth_token: \" . $oauth_token.'<br/>';\n //echo \"oauth_secret\" . $oauth_token_secret.'<br/>';\n\n\n\n //////////////////////////////\n $uri = $this->urlAccessToken();\n\n $client = $this->createHttpClient();\n\n $credentials = $this->createClientCredentials(['identifier' => $oauth_token, 'secret' => $oauth_token_secret]);\n\n $header = $this->temporaryPartnerAccessTokenProtocolHeader($uri, $credentials);\n $authorizationHeader = array('Authorization' => $header);\n $headers = $this->buildHttpClientHeaders($authorizationHeader);\n\n //echo '<br/>'.$uri;\n //var_dump($headers);\n\n try {\n $response = $client->post($uri, $headers)->send();\n } catch (BadResponseException $e) {\n //var_dump($e);\n //exit;\n return $this->handleTemporaryCredentialsBadResponse($e);\n }\n\n $body = $response->getBody();\n //$resp = $this->createTemporaryCredentials($response->getBody());\n parse_str($body, $data);\n $oauth_token = $data['oauth_token'];\n $oauth_token_secret = $data['oauth_token_secret'];\n\n //echo \"final:<br/>\";\n //var_dump($data);\n $resp = $data;\n\n return $resp;\n }", "public function createPasswordCredentialsToken()\n {\n\n $authorization_token = base64_encode($this->getUsername() . ':' . $this->getPassword());\n\n $params = [\n 'headers' => [ 'Authorization' => 'Basic '. $authorization_token],\n 'form_params' => ['grant_type' => env('DW_GRANT_TYPE', 'client_credentials')]\n ];\n\n // Make the Request and process the response\n $response = $this->guzzle->request('POST', $this->getAuthUrl(), $params);\n $result = json_decode((string) $response->getBody());\n\n $this->setToken($result->access_token)\n ->setTokenExpiry(\n Carbon::now()\n ->addSeconds($result->expires_in)\n );\n\n return $this->token;\n }", "private function makeRequest()\n {\n $credentials = $this->generateCredentials();\n\n return $this->engine->client->request('POST', $this->endpoint, [\n 'json' => $credentials,\n 'headers' => [\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json',\n ],\n ]);\n }", "public function getCredentials()\n {\n return $this->provider . '_' . $this->oAuthId;\n }", "private function getEncodedCredentials() {\n $str = $this->getAccountId().':'.$this->getApplicationKey();\n return base64_encode($str);\n }", "protected function processGrantTypeClientCredential(Oauth_Model_Request $request) {\n\n $modelLoader = $this->_helper->ModelLoader;\n \n $client = $this->retrieveClientFromHeader($request);\n //resource owner\n $resource_owner = $modelLoader->loadResourceOwner($client->getId());\n //scopes\n $scopes = $request->getScope();\n //token\n $token = $this->_token_factory->create($resource_owner, $scopes);\n //response\n return $this->compose_response($token, NULL);\n }", "public function getAccessTokenFromClientCredentials(): AccessToken;", "function as_authenticate_return($cfg) {\n\t\n\t$result = array();\n\t\n\t$credentials = $_GET['aselect_credentials'];\n\t$rid = $_GET['rid'];\n\n\tif ( (!isset($credentials)) || (!isset($rid)) ) {\n\t\tthrow new Exception('Error on return from login at remote server!');\t\t\n\t}\n\n\t$req = as_message_create(\n\t\tarray(\n\t\t\t// NB: order is important here, when signing is enabled\n\t\t\t'request'\t\t\t\t=> 'verify_credentials',\n\t\t\t'a-select-server'\t\t=> $cfg['server']['server_id'],\n\t\t\t'aselect_credentials'\t=> $credentials,\n\t\t\t'rid'\t\t\t\t\t=> $rid,\n\t\t),\n\t\tarray_key_exists('key', $cfg['client']) ? $cfg['client']['key'] : NULL\n\t);\t\n\n\t$rsp = as_call($cfg['server']['url'], $req, array_key_exists('ssl', $cfg['server']) ? $cfg['server']['ssl'] : NULL);\n\t\n\tif ($rsp['result_code'] != '0000') {\n\t\tif ($rsp['result_code'] == '0040') {\n\t\t\tthrow new Exception('Login cancelled.');\n\t\t}\n\t\tthrow new Exception('Request on remote server (' . $cfg['server']['url'] . ') returned error: ' . $rsp['_result']);\n\t}\n\n\t$result['uid'] = $rsp['uid'];\n\t$result['organization'] = $rsp['organization'];\n\t\n\tif (array_key_exists('attributes', $rsp)) {\n\t\t$decoded = base64_decode($rsp['attributes']);\n\t\t$attributes = array();\n\t\tforeach (explode('&', $decoded) as $parm) {\n\t\t\t$tuple = explode('=', $parm);\n\t\t\t$name = urldecode($tuple[0]);\n\t\t\tif (substr($name, strlen($name) - 2, 2) == '[]') {\n\t\t\t\t$name = substr($name, 0, strlen($name) - 2);\n\t\t\t}\n\t\t\tif (!array_key_exists($name, $attributes)) {\n\t\t\t\t$attributes[$name] = array();\n\t\t\t}\n\t\t\t$attributes[$name][] = urldecode($tuple[1]);\n\t\t}\n\t\t$result['attributes'] = $attributes;\n\t}\n\treturn $result;\n}", "protected function credentials(Request $request)\n {\n $credentials = $request->only($this->username(), 'password');\n $credentials['password'] .= UserService::STATIC_PASSWORD_SALT;\n\n return $credentials;\n }", "protected function prepareAuthorizedClient(Client $client, $username, $password)\n {\n // override me!\n }", "public function loginRequest()\n {\n $response = $this->client->request('POST', $this->url, [\n 'json' => $this->body,\n 'headers' => $this->headers\n ]);\n return $response;\n\n }", "protected function getCredentials(): array\n {\n return [\n 'auth_corpid' => $this->authCorpid,\n 'permanent_code' => $this->permanentCode,\n ];\n }", "public function getCredentials(Request $request)\n {\n $code = $request->query->get('code');\n\n $application = $this->commonGroundService->cleanUrl(['component'=>'wrc', 'type'=>'applications', 'id'=>$this->params->get('app_id')]);\n $providers = $this->commonGroundService->getResourceList(['component' => 'uc', 'type' => 'providers'], ['type' => 'id-vault', 'application' => $this->params->get('app_id')])['hydra:member'];\n $provider = $providers[0];\n\n $backUrl = $request->query->get('backUrl', false);\n if ($backUrl) {\n $this->session->set('backUrl', $backUrl);\n }\n\n $accessToken = $this->idVaultService->authenticateUser($code, $provider['configuration']['app_id'], $provider['configuration']['secret']);\n\n $json = base64_decode(explode('.', $accessToken['id_token'])[1]);\n $json = json_decode($json, true);\n\n $credentials = [\n 'username' => $json['email'],\n 'email' => $json['email'],\n 'givenName' => $json['given_name'],\n 'familyName' => $json['family_name'],\n 'id' => $json['jti'],\n 'authorization' => $accessToken['access_token'],\n 'newUser' => $accessToken['newUser'],\n 'groups' => $json['groups'],\n 'organizations' => $json['organizations']\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['username']\n );\n\n return $credentials;\n }", "private function getCredentials(AuthenticateRequest $request)\n {\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password'),\n ];\n }", "protected function credentials(Request $request)\n {\n // return $request->only($this->username(), 'password');\n $credentials = $request->only($this->username(), 'password'); \n $credentials['active'] = 1; \n return $credentials;\n }", "protected function credentials(Request $request) {\n return [\n 'username' => $request->input('username'),\n 'password' => $request->input('password'),\n 'isactive' => 1,\n 'isdeleted' => 0\n ];\n }", "private function get_auth() {\n\n\t\t$options = array ('trace' => true, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED);\n\n\t\t$params = array();\n\t\t$params [\"credential\"][\"Type\"] = $this->type;\n\t\t$params [\"credential\"][\"Username\"] = $this->username;\n\t\t$encodedPassword = md5(mb_convert_encoding($this->password, 'utf-16le', 'utf-8'));\n\t\t$params [\"credential\"][\"Password\"] = $this->password;\n\t\t$params [\"credential\"][\"ApplicationId\"] = $this->api_key;\n\n\t\t$params [\"credential\"][\"IdentityId\"] = $this->identity;\n\n\t\t//$authentication = new SoapClient ( \"https://webservices.24sevenoffice.com/authenticate/authenticate.asmx?wsdl\", $options );\n\t\t$authentication = new SoapClient ( \"https://api.24sevenoffice.com/authenticate/v001/authenticate.asmx?wsdl\", $options );\n\n\t\t$login = true;\n\n\t\tif (!empty($_SESSION['ASP.NET_SessionId']))\n\t\t{\n\t\t \n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t try\n\t\t {\n\t\t $login = !($authentication->HasSession()->HasSessionResult);\n\t\t }\n\t\t catch ( SoapFault $fault ) \n\t\t {\n\t\t $login = true;\n\t\t }\n\n\t\t}\n\n\t\tif( $login )\n\t\t{\n\t\t\t\n\t\t $result = ($temp = $authentication->Login($params));\n\t\t // set the session id for next time we call this page\n\t\t $_SESSION['ASP.NET_SessionId'] = $result->LoginResult;\n\t\t // each seperate webservice need the cookie set\n\t\t $authentication->__setCookie(\"ASP.NET_SessionId\", $_SESSION['ASP.NET_SessionId']);\n\t\t // throw an error if the login is unsuccessful\n\n\t\t\t/*echo \"<pre>\";\n\t\t\tprint_r( $authentication );\n\t\t\techo \"</pre>\";*/\n\t\t\t\n\t\t if($authentication->HasSession()->HasSessionResult == false)\n\t\t throw new SoapFault(\"0\", \"Invalid credential information.\");\n\t\t}\n\n\t}", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), $this->password());\n }", "public function createInternalRequestClient();", "protected function createPrivateKeyRequest()\n {\n\n $resourcePath = '/v1/account/privkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function getClientInfo() {\n $client = new Google_Client();\n $client->setApplicationName(APPLICATION_NAME);\n $client->setScopes(SCOPES);\n// $client->setAuthConfig(CLIENT_SECRET);\n $client->setAuthConfigFile(CLIENT_SECRET_PATH);\n $client->setAccessType('offline');\n // Load previously authorized credentials from a file.\n $credentialsPath = $this->expandHomeDirectory(CREDENTIALS_PATH);\n if (file_exists($credentialsPath)) {\n $accessToken = file_get_contents($credentialsPath);\n } else {\n // Request authorization from the user.\n $authUrl = $client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $client->authenticate($authCode);\n\n // Store the credentials to disk.\n if(!file_exists(dirname($credentialsPath))) {\n mkdir(dirname($credentialsPath), 0700, true);\n }\n file_put_contents($credentialsPath, $accessToken);\n printf(\"Credentials saved to %s\\n\", $credentialsPath);\n }\n $client->setAccessToken($accessToken);\n // Refresh the token if it's expired.\n if ($client->isAccessTokenExpired()) {\n $client->refreshToken($client->getRefreshToken());\n file_put_contents($credentialsPath, $client->getAccessToken());\n }\n return $client;\n }", "public function authenticate(ServerRequestInterface $request): ResultInterface;", "protected function getCredentials(Request $request)\n {\n $credentials = $request->only($this->loginUsername(), 'password');\n \n return array_merge($credentials, ['site_id' => site()->getCurrent()->id]);\n }", "public function getCredentials()\n {\n if ($this->login) return array( $this->login, $this->password);\n\n //Using static PureBilling as fallback\n if (class_exists('\\PureBilling') && \\PureBilling::getPrivateKey()) {\n return array('api', \\PureBilling::getPrivateKey());\n }\n }", "protected function authenticate()\n\t{\n\t\treturn $this->client;\n\t}", "protected function getCredentials(Request $request)\n\t{\n\t\treturn $request->all();\n\t}", "public function getCredentials(Request $request)\n {\n $credentials = [\n 'username' => $request->request->get('_username'),\n 'password' => $request->request->get('_password'),\n 'csrf_token' => $request->request->get('_csrf_token'),\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['username']\n );\n\n return $credentials;\n }", "public function setAuthParams()\n {\n if( $this->getUseSession() )\n {\n // FIXME Need to add session functionality\n }\n else\n {\n $this->getHttpClient()->setParameterGet( 'user', $this->getUsername() );\n $this->getHttpClient()->setParameterGet( 'password', $this->getPassword() );\n $this->getHttpClient()->setParameterGet( 'api_id', $this->getApiId() );\n }\n }", "public function getCredentials() {\r\n\t\t\r\n\t\treturn $this->_credentials;\r\n\t\t\r\n\t}", "function acapi_get_creds() {\n $user = acapi_get_option('email');\n $pass = acapi_get_option('key');\n if (empty($user) || empty($pass)) {\n return drush_set_error('ACAPI_CREDS_MISSING', dt('Email and api key required; specify --email/--key or run drush ac-api-login'));\n }\n return \"$user:$pass\";\n}", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }", "public function getClientSecret();", "public function getClientSecret();", "public function getCredentials()\n {\n return $this->credentials;\n }", "public function getCredentials()\n {\n return $this->credentials;\n }", "public function getToken()\n {\n // curl:Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld\n // flags:0\n // forcedownlevel:0\n // formdir:3\n // username:<xxx>\n // password:<password>\n // SubmitCreds:Aanmelden\n // trusted:0\n\n $client = new \\GuzzleHttp\\Client(['cookies' => true]);\n $response = $client->request('POST', $_ENV['HANZE_LOGON_URL'], [\n 'headers' => [\n 'Origin' => 'https://www.hanze.nl',\n 'Refer' => 'https://www.hanze.nl/CookieAuth.dll?GetLogon?curl=Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld&reason=0&formdir=3',\n 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'\n ],\n 'allow_redirects' => false,\n 'form_params' => [\n 'curl' => 'Z2F_layoutsZ2F15Z2FAuthenticate.aspxZ3FSourceZ3DZ2Fnld',\n 'flags' => 0,\n 'forcedownlevel' => 0,\n 'formdir' => 3,\n 'username' => $_ENV['HANZE_USERNAME'],\n 'password' => $_ENV['HANZE_PASSWORD'],\n 'SubmitCreds' => 'Aanmelden',\n 'trusted' => 0\n ]\n ]);\n return $client; \n }", "function create_client_token(){\n \t$clientToken = Braintree_ClientToken::generate();\n \treturn $clientToken;\n }", "private function prepareAuth()\n {\n $this->client->setHeaders(\n [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->zendeskHelper->getToken()\n ]\n );\n }", "protected function client()\n\t{\n\t\treturn Passport::client();\n\t}", "public function importWebAuthnCredential($request)\n {\n return $this->start()->uri(\"/api/webauthn/import\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public static function createFromGlobals()\n {\n $class = __CLASS__;\n\n \n //Modification for modouth flow TODO: extend request class and override createFromGlobals method\n //to handle params stored in session\n \n $OAUTH_PARAMS = array();\n \n $clientKey = 'modoauth-clientid';\n $resTypeKey = 'modoauth-responsetype';\n $stateKey = 'modoauth-state';\n \n if(isset($_SESSION['modoauth'])){\n $oauthParams = $_SESSION['modoauth'];\n $OAUTH_PARAMS = array(\n \"client_id\"=>$oauthParams[$clientKey],\n \"response_type\"=>$oauthParams[$resTypeKey],\n \"state\"=>$oauthParams[$stateKey]\n );\n }\n \n $request = new $class(array_merge($_GET,$OAUTH_PARAMS), $_POST, array(), $_COOKIE, $_FILES, $_SERVER);\n\n $contentType = $request->server('CONTENT_TYPE', '');\n $requestMethod = $request->server('REQUEST_METHOD', 'GET'); \n if (0 === strpos($contentType, 'application/x-www-form-urlencoded')\n && in_array(strtoupper($requestMethod), array('PUT', 'DELETE'))\n ) {\n parse_str($request->getContent(), $data);\n $request->request = $data;\n } elseif (0 === strpos($contentType, 'application/json')\n && in_array(strtoupper($requestMethod), array('POST', 'PUT', 'DELETE'))\n ) {\n $data = json_decode($request->getContent(), true);\n $request->request = $data;\n }\n \n return $request;\n }", "protected function createAuthenticatedClient($username = 'user', $password = 'password')\n {\n // Create a client\n $client = static::createClient();\n // Send username and password\n $client->request(\n 'POST',\n '/api/login_check',\n array(\n '_username' => $username,\n '_password' => $password,\n )\n );\n // Decode json data to retrieve the token\n $data = json_decode($client->getResponse()->getContent(), true);\n\n // Erase client with new\n $client = static::createClient();\n // Send data with\n $client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n\n // Return the authenticated client\n return $client;\n }", "private function auth()\n {\n if (!$this->username)\n {\n throw new PhpOpenSIPsException(\"Missing username\");\n }\n \n if (!$this->password)\n {\n throw new PhpOpenSIPsException(\"Missing password\");\n }\n \n // realm\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* realm=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find realm in proxy-auth\");\n }\n \n $realm = $result[1];\n \n // nonce\n $result = array();\n if (!preg_match('/^Proxy-Authenticate: .* nonce=\"(.*)\"/imU',$this->response, $result))\n {\n throw new PhpOpenSIPsException(\"Can't find nonce in proxy-auth\");\n }\n \n $nonce = $result[1];\n \n $ha1 = md5($this->username.':'.$realm.':'.$this->password);\n $ha2 = md5($this->method.':'.$this->uri);\n \n $res = md5($ha1.':'.$nonce.':'.$ha2);\n \n $this->auth = 'Proxy-Authorization: Digest username=\"'.$this->username.'\", realm=\"'.$realm.'\", nonce=\"'.$nonce.'\", uri=\"'.$this->uri.'\", response=\"'.$res.'\", algorithm=MD5';\n }", "protected function getCredentials(): array\n {\n return [\n 'suite_id' => $this->app['config']['suite_id'],\n 'suite_secret' => $this->app['config']['suite_secret'],\n 'suite_ticket' => $this->app['suite_ticket']->getTicket(),\n ];\n }", "public function readCredentials()\n {\n $apiId = !empty($_POST['connection']['appId']) ? $_POST['connection']['appId'] : '';\n $apiUsername = !empty($_POST['connection']['apiUsername']) ? $_POST['connection']['apiUsername'] : '';\n $apiPassword = !empty($_POST['connection']['apiPassword']) ? $_POST['connection']['apiPassword'] : '';\n\n if (empty($apiId) || empty($apiUsername) || empty($apiPassword)) {\n return $this->error('You must provide a valid iContact AppID/Username/Password');\n }\n\n $this->setCredentials($_POST['connection']);\n\n $result = $this->testConnection();\n\n if ($result !== true) {\n return $this->error('Could not connect to iContact: ' . $result);\n }\n\n /**\n * finally, save the connection details\n */\n $this->save();\n $this->success('iContact connected successfully');\n }", "public function getCredentials()\n\t{\n\t\treturn $this->credentials;\n\t}", "public function credential()\n {\n return $this->credentials();\n }", "private function createHttpClient(): Client\n {\n if (null === $this->configuration->getSecurityToken()) {\n throw new MissingCredentialException('Security Token is not set or empty');\n }\n\n $this->addHeader('SECURITY_TOKEN', $this->configuration->getSecurityToken());\n\n return new Client([\n 'base_uri' => $this->configuration->getBaseUrl(),\n 'headers' => $this->getHeaders() \n ]);\n }", "protected function getCredentials(Request $request) {\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password'),\n 'role_type' => 'admin'\n ];\n }", "public function getUserCredentials() {\n $rawUsername;\n $rawPassword;\n\n if ($this->userRequest->registrationPOST()) {\n $rawUsername = \n $this->userRequest->getRegisterUsername();\n $rawPassword =\n $this->userRequest->getRegisterPassword();\n }\n\n if ($this->userRequest->wantsToLogIn()) {\n $rawUsername =\n $this->userRequest->getLoginUsername();\n $rawPassword =\n $this->userRequest->getLoginPassword();\n }\n\n $userCredentials = new UserCredentials($rawUsername, $rawPassword);\n\n return $userCredentials;\n }", "public function getCredentials()\n {\n $credentials = parent::getCredentials();\n\n unset($credentials['password']);\n\n return $credentials;\n }", "protected function getCredentials(Request $request)\n \n {\n //if ('active' != false){\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password')\n //'active' => 1\n ];\n }", "public function setCredentials($v)\n { return $this->set('credentials', $v); }", "protected function credentials(Request $request)\n {\n $user_credentials = $request->only($this->username(), 'password');\n $user_credentials['active'] = 1;\n\n return $user_credentials;\n }", "abstract public function getAuthToken();", "private function setupClient() {\n\t\t$this->client = MeetupKeyAuthClient::factory( [\n\t\t\t'key' => $this->key\n\t\t] );\n\t}", "protected function credentials(Request $request)\n {\n return $request->only($this->username());\n }", "protected function credentials(Request $request)\n {\n return $request->only($this->username());\n }", "protected function getCredentials()\n {\n $user = $this->options[\"USER\"];\n $password = $this->options[\"PASS\"];\n // 1BIS : encoded?\n if ($user == \"\" && isSet($this->options[\"ENCODED_CREDENTIALS\"])) {\n list($user,$password) = AJXP_Safe::getCredentialsFromEncodedString($this->options[\"ENCODED_CREDENTIALS\"]);\n }\n // 2. Try from session\n if ($user==\"\" && isSet($this->options[\"USE_SESSION_CREDENTIALS\"]) ) {\n $safeCred = AJXP_Safe::loadCredentials();\n if ($safeCred !== false) {\n $user = $safeCred[\"user\"];\n $password = $safeCred[\"password\"];\n } else {\n throw new Exception(\"Session credential are empty! Did you forget to check the Set Session Credential in the Authentication configuration panel?\");\n }\n }\n return array($user, $password);\n }", "protected function credentials(Request $request)\n\t{\n\t\t$credentials = $request->only(\n\t\t\t'email', 'password', 'resetToken'\n\t\t);\n\t\t$credentials['token'] = $credentials['resetToken'];\n\t\t$credentials['password_confirmation'] = $credentials['password'];\n\t\tunset($credentials['resetToken']);\n\t\treturn $credentials;\n\t}", "function setCredentials( $username, $password )\r\n\t{\r\n\t\t$hdrvalue = base64_encode( \"$username:$password\" );\r\n\t\t$this->addHeader( \"Authorization\", \"Basic $hdrvalue\" );\r\n\t}", "public static function initialRequest()\n {\n $secure = [\n 'password',\n 'pass',\n 'access_key',\n 'access_token',\n 'token',\n 'key',\n 'secret',\n 'login',\n 'api_key',\n 'hash',\n ];\n $params = Spry::params();\n\n foreach ($params as $paramKey => $paramValue) {\n if (in_array(strtolower($paramKey), $secure)) {\n $params[$paramKey] = 'xxxxxx...';\n }\n }\n\n $prefix = 'Spry Request: ';\n if (isset(self::$prefix['request'])) {\n $prefix = self::$prefix['request'];\n }\n\n self::log($prefix.(empty($params) ? 'Empty' : str_replace('Array', '', print_r($params, true))));\n }", "public function getUserCredential()\n {\n return $this->userCredentials;\n }", "private static function requestAuthorizationFromUser(Google_Client $client, string $credentialsPath): array\n {\n // Request authorization from the user\n $authUrl = $client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $client->fetchAccessTokenWithAuthCode($authCode);\n\n // Store the credentials to disk.\n static::storeAccessToken($accessToken, $credentialsPath);\n printf(\"Credentials saved to %s\\n\", $credentialsPath);\n\n return $accessToken;\n }" ]
[ "0.6848708", "0.66539705", "0.6596897", "0.64541686", "0.6091303", "0.6066676", "0.60566235", "0.59592855", "0.5938037", "0.59242547", "0.58922374", "0.58759594", "0.57762706", "0.5742184", "0.5712649", "0.56995255", "0.5690996", "0.56826663", "0.56785816", "0.5675048", "0.5672463", "0.56649804", "0.56563216", "0.56519246", "0.56234485", "0.56171703", "0.56154615", "0.56064194", "0.55997914", "0.55842215", "0.5566351", "0.5559115", "0.5555933", "0.552799", "0.5527057", "0.55260915", "0.5514372", "0.54857945", "0.5480575", "0.54605305", "0.54475963", "0.544657", "0.5436931", "0.54227674", "0.54203945", "0.54143214", "0.54037035", "0.54030025", "0.539144", "0.5390633", "0.53833085", "0.53740954", "0.5371561", "0.53648204", "0.5356279", "0.5355315", "0.5342011", "0.5341849", "0.5319015", "0.5315047", "0.5310655", "0.53058213", "0.52951694", "0.5267062", "0.5267062", "0.5267062", "0.5267062", "0.52464056", "0.52464056", "0.5232517", "0.5232517", "0.5228158", "0.52273864", "0.52266663", "0.5222192", "0.52186453", "0.5217802", "0.52015257", "0.51947576", "0.5191593", "0.51849794", "0.51810867", "0.5177791", "0.51776063", "0.51758444", "0.5167664", "0.5166944", "0.51644915", "0.5164466", "0.5163113", "0.5161122", "0.51562816", "0.51538116", "0.51538116", "0.51359266", "0.5132701", "0.5131907", "0.51318914", "0.51260066", "0.5122514" ]
0.56960094
16
Get client secret from server request
private function getClientSecret($request) { // We search for authorization secret using all possible header values // in order to support legacy applications $secret = $this->getHeader($request, 'x-client-secret', null); $secret = $secret ?? $this->getHeader($request, 'x-authorization-client-secret', null); $secret = $secret ?? $this->getHeader($request, 'x-authorization-client-token', null); if (null !== $secret) { return $secret; } return $request->input('client_secret'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientSecret();", "public function getClientSecret();", "public function getClientSecret(): string\n {\n return (string) data_get($this->args, 'credentials.secret');\n }", "protected function getClientSecret()\n {\n return $this->sharedSecret;\n }", "public function get_client_secret() {\n return $this->get_option( 'client-secret', '' );\n }", "public function get_clientsecret() {\n return $this->clientsecret;\n }", "public function getClientSecret()\n {\n return $this->client_secret;\n }", "public function getClientSecret()\n {\n return $this->client_secret;\n }", "public function getClientSecret(): string\n {\n return $this->configuration[ConfigurationInterface::CLIENT_SECRET];\n }", "public function getClientSecret()\n\t{\n\t\treturn $this->_clientSecret;\n\t}", "public function getClientSecret() : string\n {\n return $this->clientSecret;\n }", "public function getClientSecret() : string\n {\n return $this->clientSecret;\n }", "public function getClientSecret()\n {\n return $this->clientSecret;\n }", "public function getClientSecret()\n {\n return $this->clientSecret;\n }", "public function getClientSecret()\n {\n return $this->clientSecret;\n }", "public function getClientSecret()\n {\n return $this->clientSecret;\n }", "public function getClientSecret() {\n return $this->clientSecret;\n }", "public function getSecret()\n {\n return $this->getParameter('secret');\n }", "public function getSecret();", "public function getSecret();", "public function getSecret();", "public function getSecret();", "public function getSecret();", "public function getSecret(): string;", "public function getSharedSecret(): string;", "public function getAppSecret(): string;", "public function get_secret() {\r\n return $this->secret;\r\n }", "public function getSecret()\n {\n return $this->secret;\n }", "public function getSecret()\n {\n return $this->secret;\n }", "public function getSecret()\n {\n return $this->secret;\n }", "public function getSecret()\n {\n return $this->secret;\n }", "public function getSecret()\n {\n return $this->_secret;\n }", "public function getSecret()\n {\n return $this->_secret;\n }", "public function getSecret() : string\n {\n return $this->secret;\n }", "public function getSecret()\n\t{\n\t\treturn $this->secret;\n\t}", "public function getAppSecret()\n {\n return $this->appSecret;\n }", "public function getSecret()\n {\n return $this->getConfig('secret');\n }", "public function getSecret() {\n return $this->secret;\n }", "public function getSecretKey();", "public function getSecretKey()\n {\n return $this->getParameter('secretKey');\n }", "public function getWebhookSecret();", "public function get_access_secret()\n\t{\n return self::get_value( 'access_secret' );\n\t}", "function get_site_secret()\n {\n \t$secret = datalist_get('__site_secret__');\n \tif (!$secret) $secret = init_site_secret();\n \t\n \treturn $secret;\n }", "public function getSecret()\n {\n // echo \"Secret is: \" . $this->secret;\n return $this->secret;\n }", "public function getTokenSecret(): string\n {\n return $this->getParam($this->tokenSecretParamKey);\n }", "protected function key()\n {\n return \"CLIENT_SECRET\";\n }", "protected function requestClientSecret($clientId)\n {\n try {\n $requestSecretUri = $this->laravel['config']->get('mtn-momo.api.request_secret_uri');\n\n $requestSecretUri = str_replace('{clientId}', $clientId, $requestSecretUri);\n\n $response = $this->client->request('POST', $requestSecretUri, []);\n\n $this->line(\"\\r\\nStatus: <fg=green>\".$response->getStatusCode().' '.$response->getReasonPhrase().'</>');\n\n $this->line(\"\\r\\nBody: <fg=green>\".$response->getBody().\"</>\\r\\n\");\n\n $apiResponse = json_decode($response->getBody(), true);\n\n return $apiResponse['apiKey'];\n } catch (ConnectException $ex) {\n $this->line(\"\\r\\n<fg=red>\".$ex->getMessage().'</>');\n } catch (ClientException $ex) {\n $response = $ex->getResponse();\n $this->line(\"\\r\\nStatus: <fg=yellow>\".$response->getStatusCode().' '.$response->getReasonPhrase().'</>');\n $this->line(\"\\r\\nBody: <fg=yellow>\".$response->getBody().\"</>\\r\\n\");\n } catch (ServerException $ex) {\n $response = $ex->getResponse();\n $this->line(\"\\r\\nStatus: <fg=red>\".$response->getStatusCode().' '.$response->getReasonPhrase().'</>');\n $this->line(\"\\r\\nBody: <fg=red>\".$response->getBody().\"</>\\r\\n\");\n }\n\n return null;\n }", "public function getNewClientSecret()\n {\n return $this->newClientSecret;\n }", "public function getClientSecret()\n {\n if (!$this->clientSecret) {\n $this->clientSecret = env('AUTH0_JWT_CLIENTSECRET');\n }\n\n return $this->clientSecret;\n }", "public function getSecretKey()\n {\n return $this->secret_key;\n }", "public function getSecretKey(): string\n {\n return $this->secretKey;\n }", "public function getSharedSecret()\n {\n return isset($this->shared_secret) ? $this->shared_secret : '';\n }", "protected abstract function getSecretKey();", "public function getMoipSecret() {\n return $this->getChaveValor('MOIP_APP_SECRET');\n }", "public function getSecretId()\n {\n return $this->secret_id;\n }", "public function getSecretKey()\n {\n return $this->secret_key;\n }", "public function getSecretKey()\n {\n return $this->secret_key;\n }", "public function getSecret() {\n return $this->accessSecret;\n }", "public function getAdminClientSecret() {\n return $this->adminClientSecret;\n }", "public function get_api_secret(){\n\t\t$apisecret = array_key_exists( 'apisecret', $this->bvars) ? $this->bvars['apisecret'] : false;\n\t\tif (!$apisecret) {\n\t\t\t$this->get_errors()->add( new \\gcalc\\error( 10101 ) );\n\t\t\treturn 'anonymous-secret';\n\t\t}\n\t\treturn $apisecret;\n\t}", "private function define_secret() {\n\t\t$secret = '';\n\t\treturn $secret;\n\t}", "public function getSecretKey()\n\t{\n\t\treturn $this->secret_key;\n\t}", "public function getBoxSecretKey() : string;", "public function getOldClientSecret()\n {\n return $this->oldClientSecret;\n }", "protected function _getSecretKey()\n {\n return $this->_secretKey;\n }", "private function _getSecretKey() {\n return \"hfd&*9997678g__vd45%%$3)(*kshdak\";\n }", "public function getApiKeySecret()\n {\n return $this->getParameter('apiKeySecret');\n }", "public function getSecretKey() {\n return $this->secretKey;\n }", "public static function getSecretKey()\n {\n $key = \\QB::table(self::TABLE)->select('value')->where('name', '=', 'secret_key')->first();\n\n return $key->value;\n }", "protected function getSecretKey()\n {\n return $this->_secretKey;\n }", "public function getSecret($tid){}", "abstract protected function getConfirmationSecret();", "public function getSecretKey()\n {\n return $this->secretKey;\n }", "public function getSecretKey()\n {\n return $this->secretKey;\n }", "public function getSecretKey()\n {\n return $this->secretKey;\n }", "public function get_secrets() {\n\n\t\t$this->method = 'GET';\n\t\t$this->path = '/secret';\n\t}", "public function getConsumerSecret() {\n\t\treturn $this->selectedEndpoint['consumer_secret'];\n\t}", "public function getSecretID()\n {\n return $this->secretID;\n }", "public function get_oauth_token_secret() {\n\t\treturn $this->_oauth_token_secret;\n\t}", "public function getConsumerSecret() {\n return $this->secret; \n }", "public function clientSecret()\n {\n // se carga la credencial stripe\n Stripe::setApiKey('sk_test_b5uMiopp4vk8X1jxsLThvQGA007gdk00tt');\n $intent = SetupIntent::create(); // crea el token para el lado del cliente\n\t return response()->json($intent);\n }", "public function secret() {\n\t\tif(is_null($this->secret))\n\t\t\tthrow new DataAuthenticatorException('Unable to find the secret key');\n\t\treturn $this->secret;\n\t}", "public function get_consumer_secret()\n\t{\n\t\treturn $this->tokens['consumer_secret'];\n\t}", "public function getSecretKey()\n {\n return Mage::getStoreConfig(self::RECAPTCHA_SECRET_KEY);\n }", "public function getSecret() {\n\t\treturn (string) $this->photo['secret'];\n\t}", "public function get_app_secret() {\n\n\t\t// Get plugin settings.\n\t\t$settings = $this->get_plugin_settings();\n\n\t\treturn rgar( $settings, 'customAppSecret' ) ? rgar( $settings, 'customAppSecret' ) : null;\n\n\t}", "public function getApiSecret(){\n\t\treturn $this->apiSecret;\n\t}", "function secret_key_1(){\n return \"secret_key_1_password\";\n}", "function fj_workflow_api_client_secret_field() {\n echo '<input type=\"text\" name=\"workflow_api[client_secret]\" value=\"' . get_option( 'workflow_api' )['client_secret'] . '\" size=\"80\" /><br />';\n}", "public function getCloudflareSecretKey() {\n return @$this->attributes['cloudflare_secret_key'];\n }", "protected function getConsumerSecret()\n {\n\treturn $this->consumerSecret;\n }", "protected function _getSecretKey()\n {\n return Mage::getStoreConfig('payment/oggetto/secret_key');\n }", "public function getSecret()\n {\n if (! isset($this->secret)) {\n $this->secret = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getSecretQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->secret;\n }", "public function getSharedSecret($url) {\n\t\treturn $this->dbHandler->getSharedSecret($url);\n\t}", "protected function _getSecretKey()\n {\n $secretKey = $this->_getContainer()->getConfig()->getRequestParameter('key');\n\n if ($secretKey !== null) {\n return $secretKey;\n }\n\n $this->setViewData(array('sError' => \"No Secret Key given\"));\n return false;\n }", "protected function _getSecret()\n {\n if (!isset($this->_config['secret'])) {\n throw new RuntimeException('Parameter \"secret\" not exists in config.');\n }\n\n return $this->_config['secret'];\n }", "public function generateTwoFactorSecret()\n {\n return $this->start()->uri(\"/api/two-factor/secret\")\n ->get()\n ->go();\n }", "public function getAuthSecret()\n {\n return $this->apiSecret;\n }", "public function getLwaClientSecret(): ?string\n {\n return $this->auth->getLwaClientSecret();\n }", "public function getSignSecretKey() : string;" ]
[ "0.78790575", "0.78790575", "0.7767046", "0.75974846", "0.75915354", "0.75818396", "0.74957526", "0.74957526", "0.74164337", "0.741616", "0.7377567", "0.7377567", "0.7326848", "0.7326848", "0.7326848", "0.7326848", "0.73017097", "0.7164806", "0.71333", "0.71333", "0.71333", "0.71333", "0.71333", "0.70667577", "0.70267856", "0.69153196", "0.68330806", "0.66980314", "0.66980314", "0.66980314", "0.66980314", "0.66637474", "0.66637474", "0.664399", "0.6626533", "0.66252834", "0.6624153", "0.6603443", "0.65799206", "0.65740883", "0.6568005", "0.6556568", "0.6547635", "0.652177", "0.6519304", "0.6485831", "0.64802414", "0.64799964", "0.6474144", "0.6453104", "0.6422107", "0.64049846", "0.6398336", "0.63872075", "0.6373455", "0.635684", "0.635684", "0.6347109", "0.6341204", "0.63104177", "0.63005924", "0.6283888", "0.627138", "0.6269249", "0.6268132", "0.6264881", "0.62288696", "0.6220709", "0.6198718", "0.6190069", "0.61832887", "0.61451024", "0.6142546", "0.6142546", "0.6142546", "0.61169004", "0.6094447", "0.6079968", "0.60774374", "0.60762537", "0.60742044", "0.60610545", "0.6052482", "0.6028034", "0.6024792", "0.59803534", "0.5965363", "0.5955787", "0.59555775", "0.5936639", "0.5929994", "0.5913413", "0.59077156", "0.59035873", "0.58824027", "0.5855553", "0.5847911", "0.58258027", "0.5821605", "0.58193994" ]
0.7184351
17
Get client id from server request
private function getClientId($request) { $clientId = $this->getHeader($request, 'x-authorization-client-id', null); $clientId = $clientId ?? $this->getHeader($request, 'x-client-id', null); $clientId = $clientId ?? $this->getHeader($request, 'x-authorization-client-token', null); if (null !== $clientId) { return $clientId; } return $request->input('client_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buffer_client_id()\r\n\t{\r\n\t\treturn $this->buffer->client_id();\r\n\t}", "public function getClientId(): string\n {\n return (string) data_get($this->args, 'credentials.id');\n }", "public function getClientID()\n {\n return $this->ClientID;\n }", "public function getClientId()\n {\n return $this->getParameter('clientId');\n }", "public function getClientId();", "public function getClientId();", "public function getClientId();", "public function getClientId();", "public function getClientId();", "public function getClientId();", "public function getIdClient()\n {\n return $this->idClient;\n }", "public function getIdClient()\n {\n return $this->idClient;\n }", "protected function getTrackedClientId() {\n /*if (isset($_COOKIE['_ga'])) {\n list($version,$domainDepth, $cid1, $cid2) = preg_split('[\\.]', $_COOKIE[\"_ga\"],4);\n $contents = array('version' => $version, 'domainDepth' => $domainDepth, 'cid' => $cid1.'.'.$cid2);\n $cid = $contents['cid'];\n }\n else {*/\n $cid = $this->client->serial;\n //}\n return $cid;\n }", "public function get_client_id() {\n return $this->get_option( 'client-id', '' );\n }", "public function getClientId() : int\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getClientId()\n {\n return $this->client_id;\n }", "public function getUserId(ServerRequestInterface $request): string;", "public function getClientId() : string\n {\n return $this->clientId;\n }", "public function getClientId() : string\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId()\n {\n return $this->clientId;\n }", "public function getClientId(): string\n {\n return $this->configuration[ConfigurationInterface::CLIENT_ID];\n }", "public function getClientId() {\n return $this->clientId;\n }", "public function getClientId()\n\t{\n\t\treturn $this->_clientId;\n\t}", "public function getRequestedId() {}", "public function getClientId()\n\t\t\t{\n\t\t\t\treturn $this->clientId;\n\t\t\t}", "public function get_clientid() {\n return $this->clientid;\n }", "function ts3client_getClientID($serverConnectionHandlerID, &$result) {}", "public function getServerId()\n {\n return $this->get(self::_SERVER_ID);\n }", "public function getClientId(): ?string\n {\n return $this->getParameter('clientId');\n }", "public function getRequestIdentifier()\n {\n return $this->requestIdentifier;\n }", "public function id(\\Psr\\Http\\Message\\ServerRequestInterface $request): string\n {\n $headersToHash = [\n 'accept' => '',\n 'accept-encoding' => '',\n 'accept-language' => '',\n 'user-agent' => '',\n 'x-forwarded-for' => ''\n ];\n\n // pull each header value out (if it exists)\n foreach ($headersToHash as $header => $value) {\n $headersToHash[$header] =\n $request->hasHeader($header)\n ? $request->getHeader($header)[0]\n : $header;\n }\n\n $this->logger->debug(\n 'Identity of incoming request built',\n ['prehash_id' => implode('', $headersToHash)]\n );\n\n return hash('sha256', implode('', $headersToHash));\n }", "public function getReqId()\n {\n return $this->req_id;\n }", "public function getLeadIdFromRequest()\n {\n return isset($_POST['id']) ? $_POST['id'] : $_GET['id'];\n }", "public function getRequestId()\n {\n return isset ($this->headers ['x-log-requestid']) ? $this->headers ['x-log-requestid'] : '';\n }", "public function getInstanceId()\n {\n if ($id = $this->_getParam(\\MUtil_Model::REQUEST_ID)) {\n return $id;\n }\n }", "public function getClientId(): ?int\n {\n return $this->clientId;\n }", "private static function extractCrid()\n {\n return empty($_GET[\"_crid\"])\n ?\n (empty($_SERVER[\"HTTP_X_CORRELATION_ID\"])\n ?\n bin2hex(random_bytes(8))\n :\n $_SERVER[\"HTTP_X_CORRELATION_ID\"])\n :\n $_GET[\"_crid\"];\n }", "public function getRequestID()\n {\n return $this->RequestID;\n }", "public static function getId(){\n\t\t\n\t\t$serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : \"unknown\";\n\t\t\n\t\t//added MD5 because IE doesn't like dots I suspect\n\t\treturn md5(\\GO::config()->id.'AT'.$serverName);\n\t}", "public function getLoggedInHostId();", "protected function _getSeoObjectId()\n {\n return oxRegistry::getConfig()->getRequestParameter('oxcid');\n }", "public function getServerId()\n\t{\n\t\treturn $this->_iServerId;\t\t\n\t}", "private function getSessionId()\n {\n $request = Request::factory(self::$apiUrl . self::$authPath)\n ->method(Request::POST)\n ->headers('content-type', 'application/json')\n ->body(json_encode([\n 'domain' => self::$apiDomain,\n 'apiKey' => self::$apiKey,\n ]))\n ->execute();\n $setCookie = $request->headers('set-cookie');\n preg_match('/JSESSIONID=(?<id>\\w+);/', $setCookie, $jSessionId);\n\n return $jSessionId['id'];\n }", "public function getClientes_idclient(){\n return $this->clientes_idclient;\n }", "public function getClientSystemId() {\n return $this->_clientSystemId;\n }", "protected function request()\n {\n return parent::request()->withClientId();\n }", "public function getRequestId()\n {\n return $this->request_id;\n }", "public function getRequestId()\n {\n return $this->request_id;\n }", "public function getRequestId()\n {\n return $this->request_id;\n }", "public function getRequestId()\n {\n return $this->request_id;\n }", "public function getIdPayboxClient()\n {\n return $this->idPayboxClient;\n }", "public function buildAndSendRequestIdFromAuthToken(\\Validic\\Client $client)\n {\n list ($endpoint, $options) = $this->buildOptionsIdFromAuthToken();\n \n $response = $client->buildAndSendRequest($endpoint, $options);\n \n if (! $response->succeeded())\n return $response;\n \n $json = $response->getJson();\n \n if (isset($json[ShortEndpoints::ME])) {\n $this->validic_id = $json[ShortEndpoints::ME]['_id'];\n }\n \n return $response;\n }", "public function getId() {\n return $this->sessionId;\n }", "public static function getRequestId() {\n\t\tif (self::$requestId === null) {\n\t\t\tself::$requestId = uniqid('', true);\n\t\t}\n\n\t\treturn self::$requestId;\n\t}", "public function getClient(): string\n {\n return $this->client;\n }", "public function getId()\n {\n return $this->response['user_id'];\n }", "public function getClientUserId()\n {\n /*$prefix = $this->isPrimary ? 'primary_' : 'secondary_';\n\n return $prefix . $this->owner->getId();*/\n\n return $this->isPrimary ? $this->owner->getId() : null;\n }", "protected function _getId ()\n {\n return session_id();\n }", "private function getRequestIndividualId()\n {\n return $this->requestIndividualId;\n }", "function ts3client_requestClientVariables($serverConnectionHandlerID, $clientID) {}", "public static function getRequestId($req)\n {\n if ($req->getHeader('content-location')) {\n return self::getIdFromString($req->getHeader('content-location'));\n } else {\n return;\n }\n }", "public function getReqGuildId()\n {\n return $this->get(self::_REQ_GUILD_ID);\n }", "public function getRequestorID()\n {\n return $this->requestorID;\n }", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "function PKG_getClientIDbyPackageID($id)\n{\n\treturn(CLIENT_getId(PKG_getClientbyPackageID($id)));\n}", "public function getSelfId(): string\n {\n $result = $this->sendGetRequest($this->getRequestUrl('selfId'));\n\n return isset($result->id) ? $result->id : $result;\n }", "public function getCodigoClient()\n {\n return $this->codigo_client;\n }", "public function getClient(){ return UserData::getById($this->client_id); }", "public function getRetToClientId() {\n return $this->_retToClientId;\n }", "public function getIdcliente() {\n\t\t\t\treturn $this->id_cliente ?? \"Id do Cliente não solicitado !!\";\n\t\t\t}", "public function getIdCliente()\n {\n return $this->idCliente;\n }", "public function getClientId()\n {\n $id = $this->options['id'];\n\n if ($this->_clientId === null) {\n $this->_clientId = \"echarts_{$id}\";\n }\n\n return $this->_clientId;\n }", "protected function getSessionId()\n {\n $id = $this->di->session->get('requestRecorderId');\n\n if ($id == null) {\n $id = time();\n $this->di->session->set('requestRecorderId', $id); // Figure out something better than time()\n }\n\n return $id;\n }", "public function getId(): string\n {\n return session_id();\n }", "protected function getSessionId() {\r\n\t\treturn $this->id;\r\n\t}", "public function buildAndSendRequestIdFromUid(\\Validic\\Client $client)\n {\n list ($endpoint, $options) = $this->buildOptionsIdFromUid();\n \n $response = $client->buildAndSendRequest($endpoint, $options);\n \n if (! $response->succeeded())\n return $response;\n \n $json = $response->getJson();\n \n if (isset($json[Endpoints::USERS]) && count($json[Endpoints::USERS]) > 0) {\n $this->validic_id = $json[Endpoints::USERS][0]['_id'];\n }\n \n return $response;\n }", "public function generateId()\n {\n $session_id = $this->request->param($this->sid_key, '');\n $_session_id = explode('-',$session_id ? xn_decrypt($session_id):'');\n $this->ip = isset($this->request->server['REMOTE_ADDR'])?$this->request->server['REMOTE_ADDR']:'127.0.0.1';\n $this->useragent = isset($this->request->server['USER-AGENT'])? md5($this->request->server['USER-AGENT']):'';\n $this->sid = ($_session_id[2]&&$this->useragent==$_session_id[1]) ? $_session_id[2] : get_uniqid(32);\n $this->sess_key = $_session_id[2]==$this->sid ? $session_id : xn_encrypt(getut().'-'.$this->useragent.'-'.$this->sid.'-'.$this->ip);\n }", "public function getUserId()\r\n \t{\r\n \treturn $this->_client->getUser();\r\n \t}", "public function getClientId()\n {\n if (!$this->clientId) {\n $this->clientId = env('AUTH0_JWT_CLIENTID');\n }\n\n return $this->clientId;\n }", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "public function getTokenRequestId()\n {\n return $this->token_request_id;\n }", "function getClientToken() {\n\t// Just generating a random client token and returning it\n\treturn sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\tmt_rand( 0, 0xffff ),\n\t\tmt_rand( 0, 0xffff ),\n\t\tmt_rand( 0, 0xffff ),\n\t\tmt_rand( 0, 0x0fff ) | 0x4000,\n\t\tmt_rand( 0, 0x3fff ) | 0x8000,\n\t\tmt_rand( 0, 0xffff ),\n\t\tmt_rand( 0, 0xffff ),\n\t\tmt_rand( 0, 0xffff )\n\t);\n}", "public function getProviderClientId(): string\n {\n return $this->getData(self::PROVIDER_CLIENT_ID);\n }", "public function getIdTypeClient()\n {\n return $this->idTypeClient;\n }", "public function getCallerId();", "public function getCallerId();", "public function getRequestId() {}", "public function getRequestId() {}", "protected function fetchIdHash()\n {\n return md5($this->request->server('HTTP_USER_AGENT') . $this->fetchIp());\n }", "private function getId() {\n return Xss::filter($this->request->get('id'));\n }", "public function generateClientId(\n ClientManager $clientManager,\n Request $request\n ) {\n $csFingerprint = $request->query->get('clientSideFingerPrint');\n\n $client = $clientManager->findOrCreate(\n null,\n $csFingerprint\n );\n\n $guid = $client->getGuid();\n $clientSideFingerprint = $client->getCsFingerprint();\n $serverSideFingerprint = $client->getSsFingerprint();\n\n // generate the script with heredoc\n $script = <<<EOT\n var clientUUID = '${guid}';\n var clientSideFingerPrint = '${clientSideFingerprint}';\n var serverSideFingerPrint = '${serverSideFingerprint}';\n EOT;\n\n $response = new JsonResponse();\n // add headers for long term caching in browser (the magic itself)\n $response->headers->add([\n 'Expires' => gmdate(\"D, d M Y H:i:s\", strtotime('+13 month')).\" GMT\",\n 'Last-Modified' => gmdate(\"D, d M Y H:i:s\", 0).\" GMT\", // 1970\n 'Cache-Control' => 'private',\n 'Pragma' => 'private'\n ]);\n $response->setContent($script);\n\n return $response;\n }" ]
[ "0.7389564", "0.7323601", "0.7248952", "0.72332084", "0.71833843", "0.71833843", "0.71833843", "0.71833843", "0.71833843", "0.71833843", "0.7123022", "0.7123022", "0.7074379", "0.7018437", "0.70152587", "0.701252", "0.701252", "0.701252", "0.701252", "0.701252", "0.6962978", "0.69453394", "0.69453394", "0.6945296", "0.6945296", "0.6945296", "0.6945296", "0.6945296", "0.6945296", "0.68984973", "0.6876363", "0.6865687", "0.68364286", "0.6725937", "0.66632843", "0.66581714", "0.66377425", "0.65874946", "0.64964074", "0.6485373", "0.6455286", "0.6435859", "0.64334655", "0.6430652", "0.63248175", "0.62941414", "0.62799037", "0.62337273", "0.6219114", "0.6208094", "0.6192076", "0.6173318", "0.6169654", "0.6166084", "0.6136384", "0.61351365", "0.61351365", "0.61351365", "0.61351365", "0.6134601", "0.6130076", "0.61192447", "0.6117876", "0.6117379", "0.6099422", "0.6084564", "0.6083113", "0.6080165", "0.60740036", "0.6068211", "0.6047988", "0.6046309", "0.6035487", "0.6035236", "0.60298675", "0.6006498", "0.6001419", "0.600084", "0.59868", "0.59809613", "0.5977151", "0.59704393", "0.59585154", "0.59552586", "0.5954197", "0.59467715", "0.5932419", "0.5919857", "0.5914529", "0.589157", "0.5890148", "0.58896595", "0.5879147", "0.5868462", "0.5868462", "0.58672947", "0.58664393", "0.5865798", "0.5865057", "0.5850444" ]
0.74348706
0
/ Get user by id
function get_user($value, $id) { $this->db->select($value); $this->db->from('tbl_users'); $this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id'); $this->db->where('tbl_users.id', $id); $query = $this->db->get(); return $query->row_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUser($id);", "private function getUserById($id) {\n\t\t$em = $this->getDoctrine()->getManager()->getRepository('AppBundle\\Entity\\User');\n\n\t\t$user = $em->findOneById($id);\t\n\t\t\n\t\treturn $user;\n\t}", "public static function get_user($user_id);", "public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}", "public function getOne($id)\n {\n return $this->user->find($id);\n }", "public function getUser($id = null);", "public function getUserById($id) {\n\t\t\n\t}", "public function get($id) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere idUser=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new User($statement->fetch(PDO::FETCH_ASSOC));\n }", "public function getUserById($id){\n $query = $this->db->get_where('user', array('k_id_user' => $id));\n return $query->row();\n }", "public function getById($id) {\n\n $sql = \"SELECT * FROM user WHERE id = {$id}\";\n\n return $this->query($sql);\n }", "public function getUser($id)\r\n {\r\n $userRepository = $this->entityManager->getRepository(User::class);\r\n $user = $userRepository->find($id);\r\n\r\n return $user;\r\n }", "public function get_user($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('users');\n \n return $query->row();\n }", "public function getUser($id) {\n return $this->getEntityManager()\n ->getRepository('Alt68\\Entities\\User')\n ->findOneBy(array(\n 'id' => $id));\n }", "public function getUser($id)\n {\n return $this->userRepository->getUser($id);\n }", "public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }", "public function get($id = null)\n {\n return $id === null ? $this['user'] : $this->getUserRepository()->find($id);\n }", "public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\User\" );\n\t}", "public static function findUser($id)\r\n {\r\n $app = \\Slim\\Slim::getInstance();\r\n $user = User::find($id);\r\n if(!$user){\r\n $app->halt('404',json_encode(\"Use not found.\"));\r\n }\r\n return $user;\r\n }", "public function getUserById($id)\n {\n\t $result = $this->getUserDbTable()->select()\n \t\t\t\t\t\t\t\t\t ->where('user_id = ?', (int)$id, 'INT')\n \t\t\t\t\t\t\t\t\t ->query()->fetch();\n \tif($result) return $result;\n }", "public function getUser($id)\n {\n return $this->dbService->getById($id, $this->userClass);\n }", "public function findById($id){\n $user = $this->DB->query(\"SELECT u.* FROM user u WHERE u.id = $id\")->fetch(PDO::FETCH_ASSOC);\n return $user;\n }", "function findUser($id) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"SELECT * FROM user WHERE _user_Id = ?;\";\n $q = $conn->prepare($sql);\n $q->execute(array($id));\n $user = $q->fetchObject('\\App\\User');\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n\n return $user;\n }", "public function getById($id)\n {\n $this->logger->info(__CLASS__.\":\".__FUNCTION__);\n return $this->em->getRepository('AppBundle:User')->find($id);\n }", "public function getUser($id){\n $user = Api::get($this->getSlug());\n \n if($user){\n return $user;\n }\n\n return 'error';\n\n }", "public function getById(string $id): User;", "public function getUserById($id)\n {\n return $this->repository->getUserById($id);\n }", "public function getUser($id) {\n\n $database = new Database();\n\n $query = 'SELECT * FROM user WHERE id=:id';\n\n return $database->prepareQuery($query, 'id', $id, TRUE);\n }", "public function user_get_by_id($id)\n {\n $query = \"SELECT *\n \t FROM \" . $this->db_table_prefix . \"users\n \t WHERE id = $id\";\n \n $result = $this->commonDatabaseAction($query);\n \n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n// return mysql_fetch_assoc($result);\n return $this->sqlAssoc;\n }\n else\n {\n return null;\n }\n }", "public function getById($id) {\r\n $query = $this->db->limit(1)\r\n ->get_where(USERS, array('id' => $id));\r\n return $query->row();\r\n }", "public function getUser( $id)\n\t{\n\t\n\t\t$user=$this->collection->findOne(array('_id'=> new MongoId($id)));\n\n\t\treturn $user;\n\t}", "public function get_user( $id ) {\n $u = $this->call( 'userGet', [\n 'userId' => $id ] );\n\n return $u ? $u->user : false;\n }", "public function get($id) {\n $sql =<<<SQL\nSELECT * from clue_user\nwhere id=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new User($statement->fetch(\\PDO::FETCH_ASSOC));\n }", "abstract public function fetchUserById($id);", "public function user($id)\n {\n return $this->where('user_id', $id);\n }", "public function get_user($id) {\r\n $conn = $this->conn();\r\n $sql = \"SELECT * FROM register WHERE id = ?\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute([$id]);\r\n $user = $stmt->fetch();\r\n $result = $stmt->rowCount();\r\n\r\n if($result > 0 ){\r\n \r\n return $user;\r\n }\r\n\r\n \r\n }", "public function show($id)\n {\n return user::find($id);\n }", "public function getUserById($id){\n // Query for the user.\n $this->db->query('SELECT * FROM users WHERE id = :id');\n // Bind the values.\n $this->db->bind(':id', $id);\n // Return the row. \n $row = $this->db->single();\n\n return $row;\n }", "public function findUserById($id)\n {\n return $this->userDao->findUserById($id);\n }", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "public function getById(int $id): User;", "public static function getByID($id) {\r\n // Create a new user object\r\n $user = new User();\r\n // Get the data from the database for the user by ID\r\n $user->get([\"id\" => $id, \"LIMIT\" => 1]);\r\n // return the user object\r\n return $user;\r\n }", "public function get($id) {\n $user = User::find($id);\n if (!$user) {\n return Base::apiErrorResponse(\"User does not exist!\");\n } else {\n return Base::apiSuccessResponse(\"\", $user);\n } \n }", "public function getUser($id)\n {\n if (!$id) {\n throw new \\InvalidArgumentException($this->lang['invalid_id']);\n }\n $user = $this->userdao->findUserByID($id);\n //$responseData = $this->createGetUserLinks($user);\n return $user;\n }", "public function getOne($id)\n\t\t{\n\t\t\treturn usersDao::instance()->getOne($id);\n\t\t}", "public static function getUserById($id)\n {\n $db = init_db();\n\n $req = $db->prepare(\"SELECT * FROM user WHERE id = ?\");\n $req->execute(array($id));\n\n $db = null;\n return $req->fetch();\n }", "public function getUserWithId($id){\r\n\r\n\t\t$sql = \"Select * from users where id = ?\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$id]);\r\n\r\n\t\t$postOwner = $query->fetch(PDO::FETCH_OBJ);\r\n\t\treturn $postOwner;\r\n\t}", "public function getUser($id) {\n foreach ($this->_users as $user) {\n if ($user->id == $id) return $user;\n }\n return false;\n }", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function getUserIdWithUsername($id);", "function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}", "static function GetWithId(int $id)\n\t{\n\t\t$arr = [\n\t\t\t':id' => $id\n\t\t];\n\n\t\t$sql = 'SELECT * FROM user_info WHERE rf_user_id = :id LIMIT 1';\n\n\t\treturn Db::Query($sql,$arr)->FetchObj();\n\t}", "public function getUserByID($id)\n {\n return $this->db->get_where('inm_user', array('id' => $id));\n }", "function getUser($user, $id) {\n return $user->readByID($id);\n}", "public function get(int $id): User\n {\n return $this->model->findOrFail($id);\n }", "public static function getUserById($id)\n {\n\n if ($id) {\n\n $db = Db::getConnection();\n $sql = \"SELECT * FROM user WHERE id = :id\";\n\n $result = $db->prepare($sql);\n $result->bindParam(':id', $id, PDO::PARAM_INT);\n // Get assoc array mode\n $result->setFetchMode(PDO::FETCH_ASSOC);\n $result->execute();\n\n return $result->fetch();\n }\n }", "public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }", "public function getById($id)\n {\n return $this->appUser->find($id);\n }", "public function getUserById($id)\n {\n return $this->getManagement()->users->get($id);\n }", "public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}", "public static function getById($id)\n {\n $query = \"SELECT * FROM User WHERE id=:id\"; \n $sql = new MysqlListaPdo();\n $sql->connect();\n $wynik = $sql->query_obj($query, array('id'=> $id), 'User'); \n if(count($wynik) == 2)\n return $wynik[0];\n else\n return false;\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n {\n return User::find($id);\n }", "public function show($id)\n\t{\n\t\treturn User::find($id);\n\t}", "public function getById(int $id): ?User;", "public function show($id)\n {\n return User::where('id', $id)->first();\n }", "public static function getUserObjectFromId($id){\n $pdo = static::getDB();\n\n $sql = \"select * from users where user_id = :id\";\n\n $result = $pdo->prepare($sql);\n \n $result->execute([$id]);\n\n $user_array = $result->fetch(); \n\n if($user_array){\n if($user_array['USER_ROLE'] == Trader::ROLE_TRADER){\n return static::getTraderObjectFromEmail($user_array['EMAIL']);\n }\n return new User($user_array);\n }\n return false;\n }", "public static function user($id = 0)\n\t{\n\t\t// Get the user by id\n\t\tif ($id)\n\t\t\treturn User::model()->active->findbyPk($id);\n\t\telse\n\t\t{\n\t\t\t// Return false if user is guest\n\t\t\tif (Yii::ap()->user->isGuest)\n\t\t\t\treturn false;\n\t\t\telse\n\t\t\t\treturn User::model()->active->findbyPk(Yii::app()->user->id);\n\t\t}\n\t}", "protected function getUser($id)\n {\n $sql = new Sql($this->dbAdapter);\n $select = $sql->select('tbluser');\n $select->where(array('id = ?'=> $id));\n \n $stmt = $sql->prepareStatementForSqlObject($select);\n $result = $stmt->execute();\n \n $user = new User();\n $user->exchangeArray($result->current());\n return $user;\n }", "function get_user( $user_id ){\n\t$app = \\Jolt\\Jolt::getInstance();\n\treturn $app->store('db')->findOne('user', array( '_id'=>$user_id ));\n}", "function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }", "function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }", "function get_user($id)\n {\n return $this->db->get_where('users',array('id'=>$id))->row_array();\n }", "public function getUserById($id) {\n $response = $this->client->request('GET', 'user/' . $id);\n \n return $response;\n }", "public static function getUserById($id)\r\n {\r\n // Connect to DB\r\n $db = Db::getConnection();\r\n\r\n // Test \r\n $sql = 'SELECT * FROM user WHERE id = :id';\r\n\r\n // Receiving and returning results. A prepared query is used\r\n $result = $db->prepare($sql);\r\n $result->bindParam(':id', $id, PDO::PARAM_INT);\r\n\r\n // We indicate that we want to get data in the form of an array\r\n $result->setFetchMode(PDO::FETCH_ASSOC);\r\n $result->execute();\r\n\r\n return $result->fetch();\r\n }", "public function get($id = null) {\n\n\t\t// get database\n\t\t$db = $this->app->database;\n\n\t\t// check if user id exists\n\t\tif (!is_null($id) && !in_array($id, $this->_queried_users) && !$db->queryResult('SELECT id FROM #__users WHERE id = '.$db->escape($id))) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$this->_queried_users[$id] = $id;\n\n\t\t// get user\n\t\t$user = $this->_call(array('JFactory', 'getUser'), array($id));\n\n\t\t// add super administrator var to user\n\t\t$user->superadmin = $this->isJoomlaSuperAdmin($user);\n\n\t\treturn $user;\n\t}", "public function getItem( int $id ) {\n\t\treturn User::where( 'id', $id )->first();\n\t}", "public function findUserById($id)\n {\n $sql = \"SELECT rowid, * FROM USER WHERE rowid=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n if ($row){\n return $this->buildDomainObject($row);\n }else{\n throw new UsernameNotFoundException('User not found.');\n }\n }", "public function getUserById($id)\n\t{\n\t\t$sql = 'SELECT * FROM admins WHERE id=:id';\n\t\t$query = $this->db->prepare($sql);\n\t\t$query->execute([':id' => $id]);\n\t\treturn $query->fetch(PDO::FETCH_OBJ);\n\t}", "public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}", "public function user_by_id($id) {\n $this->db->where('id_user', $id);\n $consulta = $this->db->get('user');\n $resultado = $consulta->row_array();\n return $resultado;\n }", "public function show($id)\n {\n return \\App\\User::find($id);\n }", "public function getById($id) {\n $this->db->select('*');\n $this->db->from('user');\n $this->db->where('id', $id);\n\n return $this->db->get()->first_row();\n }", "public function getUserByID($id)\n {\n return $this->db->get_where('temp_user', array('id' => $id));\n }", "function get_user_by_id($user_id) {\n\t\t$this->db->where('id', $user_id);\n\n\t\t$query = $this->db->get($this->table_name);\n\t\tif ($query->num_rows() == 1) {\n\t\t\treturn $query->row();\n\t\t}\n\n\t\treturn NULL;\n\t}", "public static function get($id){\n $result = mysqli_query(Connection::getConnection(), \"Select * from users where id = '{$id}'\");\n if(mysqli_num_rows($result) == 1) {\n $user = mysqli_fetch_assoc($result);\n return new User(\n $user['id'],\n $user['name'],\n $user['email'],\n $user['type'],\n $user['patchImage']);\n }\n return false;\n }", "public function findByID($id)\n {\n $i = $this->getInstance(); \n\n $result = $i->getSoapClient()\n ->setWsdl($i->getConfig('webservice.user.wsdl'))\n ->setLocation($i->getConfig('webservice.user.endpoint'))\n ->GetUser(array(\n 'UserId'=>array(\n 'Id'=>intval($id),\n 'Source'=>'Desire2Learn'\n )\n ));\n \n if ( $result instanceof stdClass && isset($result->User) && $result->User instanceof stdClass )\n {\n $User = new D2LWS_User_Model($result->User);\n return $User;\n }\n else\n {\n throw new D2LWS_User_Exception_NotFound('OrgDefinedId=' . $id);\n }\n }", "public function getOneById($id)\n {\n $request = new Llv_Services_User_Request_User();\n $request->id = $id;\n $message = $this->_service->getOneById($this->getHeaderMessage(), $request);\n if ($message->success) {\n return $message->user;\n }\n return null;\n }", "public function findUserById($id)\n {\n $em = $this->getEntityManager();\n return $em->createQuery(\n '\n SELECT u\n FROM ProjectAppBundle:User u\n WHERE u.id = :id\n '\n )\n ->setParameter('id', $id)\n ->getSingleResult();\n }", "public function show($id)\n {\n return $this->userRepo->findById($id);\n }", "function getUserById($id){\n\t\tglobal $db;\n\t\t$query = \"SELECT * FROM t_attendees WHERE id=\" . $id;\n\t\t$result = mysqli_query($db, $query);\n\t\t$user = mysqli_fetch_assoc($result);\n\t\treturn $user;\n\t}", "public static function getUser(int $id)\n {\n $sql = \"SELECT * FROM `user` WHERE id = :id\";\n\n $db = new DB();\n $connectionDB = $db->getConnection();\n $result = $connectionDB->prepare($sql);\n $result->bindParam(\":id\", $id, PDO::PARAM_INT);\n $result->execute();\n $result->setFetchMode(PDO::FETCH_ASSOC);\n $result = $result->fetch();\n\n $user = null;\n if ($result) {\n $user = new User(\n $result['login'],\n $result['password'],\n $result['first_name'],\n $result['second_name'],\n $result['sex'],\n $result['date_of_birth']\n );\n\n $user->id = $id;\n $user->role = $result['role'];\n $user->created_at = $result['created_at'];\n $user->updated_at = $result['updated_at'];\n }\n return $user;\n }", "public function show($id)\n {\n //\n return User::find($id);\n }", "public function show($id)\n {\n $user =User::findOrFail($id);\n return $user;\n }", "public function getUserFromId(int $id) {\n \n // Call getUserById method in userDataService and set to variable\n $user = $this->getUserById($id);\n \n // Return the user information array\n return $user;\n }", "public function show($id)\n {\n //\n $user = User::findOrFail($id);\n return $user;\n }", "function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}" ]
[ "0.87084013", "0.8556859", "0.8538246", "0.8502772", "0.8407413", "0.8392154", "0.8358869", "0.83157295", "0.8314558", "0.8287737", "0.8285867", "0.8260336", "0.82571286", "0.8212068", "0.8200752", "0.81769675", "0.81748486", "0.8146213", "0.8140812", "0.81377506", "0.8136619", "0.81312066", "0.81171924", "0.8110641", "0.80915916", "0.805482", "0.8042407", "0.80345607", "0.8028155", "0.80212015", "0.8020548", "0.801984", "0.8017313", "0.80163187", "0.8014581", "0.80134887", "0.80109537", "0.8000923", "0.79977196", "0.7983853", "0.7960557", "0.79599416", "0.7953542", "0.7950474", "0.79345155", "0.7929049", "0.7928186", "0.79249376", "0.7922918", "0.7913278", "0.7900124", "0.78915083", "0.78894466", "0.78835475", "0.7881037", "0.7878967", "0.7875435", "0.7867809", "0.7855503", "0.7844835", "0.7840824", "0.7840824", "0.7840824", "0.7840824", "0.7840824", "0.7840824", "0.7840824", "0.7834707", "0.78314775", "0.7825561", "0.7824746", "0.7824214", "0.7824077", "0.7818692", "0.7815799", "0.7815799", "0.7815799", "0.78102285", "0.7801496", "0.7767539", "0.77613056", "0.77592665", "0.77576125", "0.7757161", "0.7756682", "0.7754769", "0.7750092", "0.7745993", "0.77374494", "0.77235466", "0.7722624", "0.77211905", "0.77125245", "0.7710633", "0.7706292", "0.77028835", "0.7698883", "0.7697165", "0.7692362", "0.7692269", "0.7683096" ]
0.0
-1
/ Get all userlist
function get_all_userslist() { if($this->session->userdata('id')==1){ $this->db->select('*'); $this->db->from('tbl_users'); $this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id'); $this->db->join('tbl_group', 'tbl_group.id=tbl_users.group_id'); $this->db->order_by('tbl_users.id', 'desc'); $query = $this->db->get(); return $query->result_array(); } else{ $this->db->select('*'); $this->db->from('tbl_users'); $this->db->join('tbl_users_details', 'tbl_users.id=tbl_users_details.user_id'); $this->db->where('tbl_users.group_id >', $this->session->userdata('group_id')); $this->db->where('tbl_users.group_id <>', 6); $this->db->order_by('tbl_users.id', 'desc'); $query = $this->db->get(); return $query->result_array(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "public function getUsersList()\n {\n }", "function get_user_list(){\n\t\treturn array();\n\t}", "private function getUserList()\n {\n $users = User::getUsers();\n $users = ArrayHelper::map($users, 'id', 'username');\n \n return $users;\n }", "public function getUserList() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n\n $role_name = $this->request->input(\"role_name\");\n if ($role_name) {\n $where[] = [\"roles.role_name\", \"=\", $role_name];\n }\n\n $user_id = $this->request->input(\"user_id\");\n if ($user_id) {\n $where[] = [\"users.user_id\", \"=\", $user_id];\n }\n $orderBy = \"users.user_id\";\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getUsers($orderBy);\n\n return $users;\n }", "public function getUserList() {\n return $this->users;\n }", "public function getUsers();", "public function getUsers();", "public function getUsers();", "public function user_lists(){\n return get_instance()->ecl('Instance')->mod('lists', 'user_lists', [get_instance()->ecl('Instance')->user(),'email']);\n }", "function listUsers() {\n return $this->users;\n }", "public function getList() {\n //Retourne la liste de tous les users\n $users = [];\n $requsers = $this->db->query('SELECT * FROM user');\n\n while ($data = $requsers->fetch(PDO::FETCH_ASSOC)) {\n $users[] = new user($data);\n }\n\n return $users;\n }", "protected function getUserList() {\n\t$controller = new ChatMySQLDAO();\n\tif(!isset($_SESSION['username'])) {\n\t return;\n\t}\n\t$users = $controller->getUserList($_SESSION['username']);\n\t$data = array();\n\t$i = 0;\n\tforeach ($users as $user) {\n\t $data[$i++] = $user['user_name'];\n\t}\n\treturn $data;\n }", "public static function listUsers()\n {\n //Init curl\n $curl = new curl\\Curl();\n\n // GET request to api\n $response = $curl->get(Yii::$app->params['listUsers']);\n\n $records = json_decode($response, true);\n\n foreach($records as $users){\n foreach($users as $user){\n $list[$user['id']] = $user['name'] . ' ' . $user['last_name'];\n }\n }\n\n return $list;\n }", "public function getUsers()\n {\n return Security::getUserList();\n }", "public function getList() {\n\t\t$this->request = array('uri' => array('path' => 'users.json'));\n\n\t\treturn $this->find('all');\n\t}", "public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ));\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "function get_user_list()\n {\n $query = $this->db->get('user_login');\n return $query->result();\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function getAllUser(){\n return $this->users;\n }", "public function userList() \n { \n $user = User::get(); \n return response([ 'data' => ToArray::collection($user), 'message' => 'Users list retrieved successfully'], $this->successStatus);\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public function getUserList(){\n\t\t$this->load->database();\n\t\t$eventlist = $this->db->query(\"SELECT * FROM user \");\n\t\treturn $eventlist;\n\t}", "function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "function get_users()\n {\n //Unimplemented\n }", "public function listUsers()\n {\n global $db;\n $user_db_data = array();\n $cache = Cache::getInstance();\n // $cache->flush();\n if($cache->exists(\"user_info_data\"))\n {\n $user_db_data = $cache->get(\"user_info_data\");\n } else { \n $e = $db->prepare(\"SELECT * FROM user_info\");\n $e->execute();\n $user_data = $e->fetchAll(); \n // cache will clear in every 1 min.\n $cache->set(\"user_info_data\", $user_data, 60 * 60 * 0.1);\n $user_db_data = $user_data;\n }\n return $user_db_data;\n }", "public function usersList()\n {\n return app(UsersList::class)($this);\n }", "public function listUsers()\n {\n $query = new Query();\n\n $rows = $query->select(['id', 'name'])\n ->from('users')\n ->orderBy(['date_add' => SORT_DESC])\n ->all();\n\n return $rows;\n }", "private function listUsers()\n {\n $users = get_users();\n $user_ids = array();\n\n foreach ($users as $u) {\n $user_ids[] = $u['id'];\n }\n\n if (count($this->ids) != 0) {\n return array_intersect($this->ids, $user_ids);\n } else {\n return $user_ids;\n }\n }", "function get_userlist() {\r\n \r\n $this->db->order_by('id', 'desc');\r\n $query = $this->db->get('users');\r\n return $query->result_array();\r\n }", "function listOfUsers(){\n\t\n\t\t$users = [];\n\t\tforeach ($this->members as $obj){\n\t\t\t$user = array('name'=> $obj->getUserFullName(),'id'=>$obj->getUserID());\n\t\t\tarray_push($users, $user);\n\t\t}\n\t\treturn $users;\n\t}", "public function get_users()\n\t{\n\t\t$sql=\"SELECT * FROM waf_users WHERE 1=1\";\n\t\t$result=$this->db->LIST_Q($sql);\n\t\treturn $result;\n\t}", "public function get_user_list() {\n\n $sql = \" SELECT userId, concat(firstName, ' ', surname) AS `name`\n FROM time_user\"; \n return $this->db->query( $sql );\n }", "public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }", "public function getAllUsers() {\n $sql = \"SELECT `pk_users`, `name_users`, `password_users`, `mail_users`, `symbol_users`, `first_name_users`, `last_name_users` FROM `users`\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function getAllUsers()\n {\n $sql = \"SELECT `user_id`, `user_fname`, `user_lname`, `user_password_hash`, `user_email`, `user_role` FROM users\";\n $query = $this->db->prepare($sql);\n $query->execute();\n return $query->fetchAll();\n }", "public function allUsers()\n {\n // $sql = 'SELECT * FROM '.$db_name;\n return $this->queryAll();\n }", "public function getAll(){\n $users = UserResource::collection($this->userRepo->getAll());\n return $users;\n }", "public function users_list() {\n return response()->json(User::latest()->get());\n }", "public function getAll()\n {\n\n return $this->users;\n }", "public function getList()\r\n {\r\n $result = $this->query(\r\n \"SHOW USERS\",\r\n $this->getValueBuilder('Aviogram\\InfluxDB\\Entity\\Admin\\User')\r\n ->addField('user', 'getName', 'setName')\r\n ->addField('admin', 'isAdmin', 'setAdmin')\r\n );\r\n\r\n $return = new Collection\\Admin\\User();\r\n\r\n foreach ($result->getSeries() as $serie) {\r\n foreach($serie->getValues() as $value) {\r\n $return->append($value);\r\n }\r\n }\r\n\r\n return $return;\r\n }", "public function getUserList() {\n $users = DB::select(\"select * from users\");\n $count = DB::table(\"users\") -> count();\n $data = [];\n foreach ($users as $user) {\n array_push($data, array(\n \"id\" => $user -> id,\n \"role\" => ($user -> role == 0)?\"Inactive\":($user -> role == 1?\"Active\":'[ Admin ]'),\n \"fname\" => $user -> fname,\n \"lname\" => $user -> lname,\n \"affiliation\" => $user -> affiliation,\n \"email\" => $user -> email,\n \"created_at\" => $user -> created_at,));\n };\n return array(\"code\" => 0, \"msg\" => \"\", \"count\" => $count, \"data\" => $data);\n }", "public function getUserList()\n {\n $responseMap = $this->_postCommand(static::$COMMAND_GET_USER_LIST);\n \n // From the response, filter out only the users that matched this environment Prefix\n $userIdList = [];\n foreach ($responseMap['ids'] as $userId) {\n $unprefixedUserId = PrefixHelper::unprefix($userId);\n \n if ($unprefixedUserId !== false) {\n $userIdList[] = $unprefixedUserId;\n }\n }\n \n return $userIdList;\n }", "public function get_list_user()\n {\n $this->db->where('type', 0);\n $query = $this->db->get('user');\n return $query->result();\n }", "public static function getList(){\n\t\t$sql = new sql();\n\n\t\treturn $sql->select(\"SELECT * FROM usuarios ORDER BY email;\");\n\n\t}", "public function getAllUsers()\n {\n $result = self::$dbInterface -> query(\"SELECT userID, userName, email FROM user\");\n return $result;\n }", "public static function retrieveAllUsers() {\n return R::getAll('SELECT * FROM user');\n }", "function getUsersList()\n {\n $this->db->select('*');\n $this->db->order_by('name', 'asc');\n $this->db->limit(10, 0);\n $q = $this->db->get('users');\n $result = $q->result_array();\n return $result;\n }", "public function getList($user);", "public function getUsersListAttribute()\n {\n return User::orderBy('name')->get();\n }", "public function getLTIUsers();", "function getUserList(){\n try{\n $query = \"Select id, fname, lname, email, phone, created_at FROM users ORDER BY id DESC\";\n $stmt = $this -> getConnection($query);\n $stmt ->execute();\n $stmt ->bind_result($id, $fname, $lname, $email, $phone, $since);\n $result = array();\n while ($stmt -> fetch()) {\n $result[] = array(\n 'id' => $id,\n 'fname'=>$fname,\n 'lname'=>$lname,\n 'email' => $email,\n 'phone' => $phone,\n 'since' => $since\n );\n }\n $stmt->close();\n \n return $result;\n }catch (exception $e){\n die('Error - cannot retrieve user list: ' . $e -> getMessage());\n }\n }", "public function getAll()\n {\n self::connectToDB(); /* Using DB connection */\n\n $this->sql = \"SELECT * FROM users\";\n\n try\n {\n $this->query = $this->handler->query($this->sql);\n $this->result = $this->query->fetchAll(PDO::FETCH_ASSOC);\n\n /**\n * Closing DB connection\n */\n $this->query->closeCursor();\n $this->handler = null;\n\n foreach ($this->result as $row)\n {\n $this->list[] = new User($row['id'], $row['username'], $row['password'], $row['email'], $row['firstname'], $row['lastname'], $row['admin'], $row['blocked'], $row['image_path'], $row['registration_date']);\n }\n return $this->list;\n }\n catch (Exception $e)\n {\n echo \"Error: query failure\";\n return false;\n }\n }", "public function getUsers()\n {\n $sql = \"SELECT * FROM users\";\n return $this->get($sql, array());\n }", "public function getAll() {\r\n $query = $this->db->get(USERS);\r\n return $query->result_array();\r\n }", "public function list(): array\n {\n return User::all()->toArray();\n }", "public static function getAllUsers() {\r\n // Create a User object\r\n $user = new User();\r\n // Return an array of user objects from the database, ordered by firstname\r\n return $user->getCollection([\"ORDER\" => ['firstname' => 'ASC']]);\r\n }", "private function getUsersMailist() {\n $param = array(\n 'where' => 'registered = 1'\n );\n\n $users = $this->mailist->gets($param);\n\n return $users;\n }", "public function getAllUsers()\n\t{\n\t\t$users = $this->fetchAll();\n\t\t\n\t\treturn $users;\n\t}", "public function getUsers()\n {\n $request = \"SELECT user.*, rank.name as rank_name FROM `user` join rank on user.rank = rank.id order by rank.id\";\n $request = $this->connexion->query($request);\n $newsList = $request->fetchAll(PDO::FETCH_ASSOC);\n // var_dump($newsList);\n return $newsList;\n }", "public function getAllUsers(){\n\t\treturn $this->user;\n\t}", "public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}", "public static function getUserList() {\n $db = DB::getInstance();\n $resp = \"\";\n try {\n $query = $db->query(\"SELECT id, first_name, last_name, username, lump, admin FROM `users` ORDER BY last_name ASC\", PDO::FETCH_ASSOC);\n $rows = $query->fetchAll();\n $resp = json_encode($rows);\n }\n catch (Exception $e) {\n $db->rollBack();\n $resp = $e->getMessage();\n }\n return $resp;\n }", "public function getAllUsers(): array\n {\n return $this->users;\n }", "public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}", "function user_list()\n\t{\n\t\t$this->db->where('is_active','1');\n\t\t\n\t\t$result = $this->db->get('user');\n\t\treturn $result->result_array();\n\t}", "public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}", "public function getAllUsers()\n {\n // Connect to db\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n // Get users from db\n $users = $user->findAll();\n return $users;\n }", "function get_users()\n\t{\n\t\tglobal $db;\n\t\t\n\t\t$query = $db->query(\"SELECT * FROM users\");\n\t\t\n\t\treturn $db->results($query);\n\t}", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "function get_all()\n\t\t\t{\n\t\t\t\treturn $this->db->order_by('registerDate DESC')->get('cabal_hackuser_list');\n\t\t\t}", "public function getAllUsers(){\n\t\n\t\t$db = new Database();\n\t\t$conn= $db->getConn();\n\t\t$rs = $conn->query(\"select * from login\");\n\t\t$num_of_row = $rs->num_rows;\n\t\tif($num_of_row >0){\n\t\t\twhile($row = $rs->fetch_assoc()){\n\t\t\t\t$users[]=array('username'=>$row['username'],'password'=>sha1($row['password']),'email'=>$row['email'],'user_type'=>$row['user_type']);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $users;\n\t}", "function list_users(){\r\n\t\t$query = $this->db->query(\"SELECT userid, concat(fname, ' ', lname, ' (', username, ')') as name FROM nf_users\");\r\n\t\t$return = array();\r\n\t\tforeach($query->result() as $row){\r\n\t\t\t$return[$row->userid] = $row->name;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "public function getAllUsers()\n {\n $users = User::all();\n return $users;\n }", "public function index()\n {\n return $this->user->all();\n }", "protected function getAllUsers() {\n\t\t\t$query = \"SELECT username, f_name, l_name, phone, email FROM Stomper\";\n\t\t\treturn $this->EndpointResponse($query, true);\n\t\t}", "function d4os_io_db_070_os_user_get_all_uid() {\n $list = array();\n $result = db_query(\"SELECT * FROM {d4os_ui_users}\");\n while ($user = db_fetch_object($result)) {\n $list[] = $user;\n }\n return $list;\n}", "public function getAll()\n\t{\n\t\t$query = \"\n\t\tSELECT * FROM `user`\n\t\t\";\n\n\t\t$handle = $this->db->query($query);\n\t\t$result = $handle->fetchAll(Database::FETCH_ASSOC);\n\n\t\t$users = array();\n\n\t\tfor ($i = 0; $i < count($result); $i++) {\n\t\t\t$res = $result[$i];\n\t\t\t$user = new User($res['id'], $res['name']);\n\t\t\t$users[] = $user;\n\t\t}\n\n\t\treturn $users;\n\t}", "public function GetAllUsers()\n {\n $data = $this->db()->run(\"SELECT * FROM users\")->fetchall(PDO::FETCH_ASSOC);\n return $data;\n }", "public function getAll()\n {\n return $this->appUser->orderBy('first_name')->get()->toArray();\n }", "function getUserNameList()\r\n\t{\r\n\t\treturn $this->UserNameList;\r\n\t}", "public function getUserList(): array {\n\t\t$sql = 'SELECT u.id, u.login, u.mail, r.name role FROM users u\n\t\t\t\tINNER JOIN roles r ON u.role = r.id\n\t\t\t\tWHERE u.login != :mylogin';\n\n\t\treturn $this->queryRows($sql, ['mylogin' => $_SESSION['user']['login']]);\n\t}", "public static function getAllUser()\n\t{\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}", "function findAllUsers() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM users;'));\r\n\r\n\t}", "public function index_get()\n {\n $response = $this->UserM->all_user();\n $this->response($response);\n }", "private function get_all() {\n $result = $this->dbh->query($this->query_array['get_all'], array())->fetchAll();\n $users = [];\n foreach ($result as $row) {\n $user = new User($row['id'], $row['username']);\n $users[] = $user->to_array();\n }\n return $users;\n }", "public static function listUser()\n {\n $self = new self();\n\n $where = '';\n $limit = self::LIMIT;\n\n\n $search = isset($_GET['search']) ? $_GET['search'] : '';\n\n $page = (isset($_GET['page']) && $_GET['page'] >= 0) ?\n (int)$_GET['page'] : 1;\n\n if ($search != '')\n $where .= \" WHERE name LIKE '%$search%' \";\n\n $from = ($page == 1) ? 1 : ($page - 1) * $limit;\n\n $sql = \"SELECT * FROM user \" . $where . \" ORDER BY id DESC LIMIT $from, $limit\";\n\n $result = $self->db->query($sql);\n $result = $result->fetchAll();\n\n $countSql = \"SELECT count(*) FROM user \" . $where;\n\n $resultCount = $self->db->query($countSql);\n $resultCount = $resultCount->count();\n\n return [\n 'items' => $result,\n 'current_page' => $page,\n 'limit' => $limit,\n 'total' => $resultCount,\n 'keysearch' => $search,\n 'from' => $from\n ];\n }", "public function getAllUser(){\n $users = $this->bdd->query('SELECT * FROM users');\n $users->execute();\n\t\treturn $users->fetchALL(\\PDO::FETCH_ASSOC);\n }", "public function getAllUsers()\n {\n return \"users from mongo\";\n }", "public function getUsers() {\n $this->checkValidUser();\n\n $this->db->sql = 'SELECT id, username FROM '.$this->db->dbTbl['users'].' ORDER BY username';\n\n $res = $this->db->fetchAll();\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'sdop6'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'ffUI8',\n 'users' => $res\n );\n }\n\n $this->renderOutput();\n }", "public static function getlist(){\n $sql = new Sql();\n \n return $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogin\");\n }", "Public Function getAllUsers()\n\t{\n\t\t$Output = array();\n\t\t$Users = $this->_db->fetchAll('SELECT * FROM bevomedia_user');\n\t\tforeach($Users as $User)\n\t\t\t$Output[] = new User($User->id);\n\t\t\t\n\t\treturn $Output;\n\t}", "protected function GetAllUsers()\r\n {\r\n $sql = \"SELECT * FROM `users`\";\r\n $result = $this->connect()->query($sql);\r\n $rows = $result->num_rows;\r\n\r\n if ($rows > 0) {\r\n while ($row = $result->fetch_assoc()) {\r\n $data[] = $row;\r\n }\r\n\r\n return $data;\r\n } else {\r\n echo \"No results found!\";\r\n }\r\n }", "public function all()\n {\n return $this->newQuery('getUsers', ['type' => 'AllUsers']);\n }", "function list_user()\n {\n return DB::table(\"users\")->get(); \n }", "public function getUsers(){\n return self::getModel(\"users\", \"*\");\n }", "public function getUsers() {\n return $this->userHandler->getUsers();\n }" ]
[ "0.85418767", "0.8498887", "0.84392023", "0.83264184", "0.8173872", "0.8169039", "0.8145582", "0.8145582", "0.8145582", "0.81180584", "0.81116956", "0.8076261", "0.8046867", "0.8009895", "0.8004545", "0.7951898", "0.79471433", "0.7908236", "0.7881276", "0.78437304", "0.78437304", "0.7833496", "0.7828154", "0.7814568", "0.77757716", "0.777393", "0.7770843", "0.77660334", "0.7764415", "0.77522284", "0.77435905", "0.7742075", "0.7735979", "0.77283645", "0.77210593", "0.7707849", "0.77062213", "0.76743275", "0.7672948", "0.76645136", "0.76645076", "0.7657344", "0.7652909", "0.76527774", "0.7649238", "0.7647993", "0.76198953", "0.7614497", "0.761072", "0.7609686", "0.7602206", "0.7599381", "0.7592623", "0.7588704", "0.75847983", "0.75817794", "0.7573625", "0.75702184", "0.7569229", "0.7568482", "0.7555498", "0.75473917", "0.7545257", "0.7542702", "0.7540963", "0.7539192", "0.7531646", "0.75282025", "0.7522472", "0.75164616", "0.7515197", "0.75088227", "0.75065255", "0.74922687", "0.74912876", "0.74906814", "0.7486888", "0.74713796", "0.7469051", "0.7467843", "0.74671793", "0.7462265", "0.7454909", "0.7447798", "0.74468833", "0.7442191", "0.7434564", "0.74284977", "0.7428172", "0.7427966", "0.7427252", "0.7424344", "0.74243397", "0.7416941", "0.74143404", "0.7413451", "0.74036026", "0.7400933", "0.7389485", "0.73871", "0.73826337" ]
0.0
-1
/ function to add new group
function add_users($table,$params) { $this->db->insert($table,$params); return $this->db->insert_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addGroup($group) {}", "public function addGroup($name);", "public function addGroup(Group $group);", "public function add()\n {\n $group = $this->Groups->newEntity();\n if ($this->request->is('post') && !empty($this->request->data)) {\n $this->Groups->patchEntity($group, $this->request->data);\n if ($this->Groups->save($group)) {\n $this->Flash->success(__d('wasabi_core', 'The group <strong>{0}</strong> has been created.', $this->request->data['name']));\n $this->redirect(['action' => 'index']);\n return;\n } else {\n $this->Flash->error($this->formErrorMessage);\n }\n }\n $this->set('group', $group);\n }", "function add_group(array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->create($data);\n\t}", "function eio_grp_add($grp, $req)\n{\n}", "function new_groups()\n {\n \n }", "public function addGroup(string $group): void;", "function add_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 // Insert or update, to minimize redundancy\n list($flag, $msg) = $this->m_general->insert_update('users_group', $this->input->post(), $where);\n\n return JSONRES($flag, $msg);\n }", "public function createGroupAction() {\n\t\t$this->group->id_parent = isset($this->data['id_parent']) ? $this->data['id_parent'] : null;\n\t\t$this->group->group_name = $this->data['group_name'];\n\t\t$this->group->description = $this->data['description'];\n\t\treturn $this->group->save();\n\t}", "static function addGroup($group)\n {\n global $db;\n $id = NULL;\n\n // todo delete\n $group['name'] = $group['text'];\n unset($group['text']);\n try {\n $id = $db->insert('boq_group', $group);\n } catch (\\Exception $exception) {\n Log::write($exception, $db->getLastError());\n }\n\n return $id;\n }", "function CreateGroup(){\n $grpname = \"\"; $grpdesc=\"\";\n extract($_POST);\n $grpid = $this->generateGuid();\n $vs = [$grpname, $grpid, $grpdesc];\n $f = array(\"grpname\", \"grpid\", \"grpdesc\");\n $cg = $this->Insert($this->grptable, $f, $vs);\n return $cg;\n }", "function system_add_group($paramv)\n{\n}", "function groups_create_group($data, $um=false) {\n global $CFG;\n require_once(\"$CFG->libdir/gdlib.php\");\n\n $data->timecreated = time();\n $data->timemodified = $data->timecreated;\n $data->name = trim($data->name);\n $id = insert_record('groups', $data);\n\n if ($id) {\n $data->id = $id;\n if ($um) {\n //update image\n if (save_profile_image($id, $um, 'groups')) {\n set_field('groups', 'picture', 1, 'id', $id);\n }\n $data->picture = 1;\n }\n\n //trigger groups events\n events_trigger('groups_group_created', stripslashes_recursive($data));\n }\n\n return $id;\n}", "function createGroup($args) {\n\t\t$this->editGroup($args);\n\t}", "function system_addto_group($paramv)\n{\n}", "function group_create($data) {\n if (!is_array($data)) {\n throw new InvalidArgumentException(\"group_create: data must be an array, see the doc comment for this \"\n . \"function for details on its format\");\n }\n\n if (!isset($data['name'])) {\n throw new InvalidArgumentException(\"group_create: must specify a name for the group\");\n }\n\n if (!isset($data['grouptype']) || !in_array($data['grouptype'], group_get_grouptypes())) {\n throw new InvalidArgumentException(\"group_create: grouptype specified must be an installed grouptype\");\n }\n\n safe_require('grouptype', $data['grouptype']);\n\n if (isset($data['jointype'])) {\n if (!in_array($data['jointype'], call_static_method('GroupType' . $data['grouptype'], 'allowed_join_types'))) {\n throw new InvalidArgumentException(\"group_create: jointype specified is not allowed by the grouptype specified\");\n }\n }\n else {\n throw new InvalidArgumentException(\"group_create: jointype specified must be one of the valid join types\");\n }\n\n if (!isset($data['ctime'])) {\n $data['ctime'] = time();\n }\n $data['ctime'] = db_format_timestamp($data['ctime']);\n\n if (!is_array($data['members']) || count($data['members']) == 0) {\n throw new InvalidArgumentException(\"group_create: at least one member must be specified for adding to the group\");\n }\n\n $data['public'] = (isset($data['public'])) ? intval($data['public']) : 0;\n $data['usersautoadded'] = (isset($data['usersautoadded'])) ? intval($data['usersautoadded']) : 0;\n\n db_begin();\n\n//Start-Anusha\n /*$id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n ),\n 'id',\n true\n );*/\n\t\n\t//Start -Eshwari added courseoutcome\n\t $id = insert_record(\n 'group',\n (object) array(\n 'name' => $data['name'],\n 'description' => $data['description'],\n 'grouptype' => $data['grouptype'],\n 'jointype' => $data['jointype'],\n 'ctime' => $data['ctime'],\n 'mtime' => $data['ctime'],\n 'public' => $data['public'],\n 'usersautoadded' => $data['usersautoadded'],\n\t\t\t'outcome' => $data['outcome'],\n\t\t\t'courseoutcome' => $data['courseoutcome'],\n\t\t\t'coursetemplate' => $data['coursetemplate'],\n\t\t\t'courseoffering' => $data['courseoffering'],\n\t\t\t'parent_group' => $data['parent_group'],\n ),\n 'id',\n true\n );\n//End-Anusha\n\n foreach ($data['members'] as $userid => $role) {\n insert_record(\n 'group_member',\n (object) array(\n 'group' => $id,\n 'member' => $userid,\n 'role' => $role,\n 'ctime' => $data['ctime'],\n )\n );\n }\n\n // Copy views for the new group\n $templates = get_column('view_autocreate_grouptype', 'view', 'grouptype', $data['grouptype']);\n $templates = get_records_sql_array(\"\n SELECT v.id, v.title, v.description \n FROM {view} v\n INNER JOIN {view_autocreate_grouptype} vag ON vag.view = v.id\n WHERE vag.grouptype = 'standard'\", array());\n if ($templates) {\n require_once(get_config('libroot') . 'view.php');\n foreach ($templates as $template) {\n list($view) = View::create_from_template(array(\n 'group' => $id,\n 'title' => $template->title,\n 'description' => $template->description,\n ), $template->id);\n $view->set_access(array(array(\n 'type' => 'group',\n 'id' => $id,\n 'startdate' => null,\n 'stopdate' => null,\n 'role' => null\n )));\n }\n }\n\n $data['id'] = $id;\n handle_event('creategroup', $data);\n db_commit();\n\n return $id;\n}", "function addGroupHandler() {\n global $inputs;\n\n $lastId = insert('group',[\n 'admin_id' => getLogin()['uid'],\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ]);\n\n formatOutput(true, 'add success');\n}", "function add() {\n $this->set('groups', $this->Group->find('all'));\n if (!empty($this->data)) {\n if ($this->Group->save($this->data)) {\n $this->Session->setFlash('The group has been saved.');\n } else {\n $this->Session->setFlash('Failed saving the group.');\n }\n }\n }", "public function addGroup() {\n\t\tif ($this->request -> isPost()) {\n\t\t\t$this->UserGroup->set($this->data);\n\t\t\tif ($this->UserGroup->addValidate()) {\n\t\t\t\t$this->UserGroup->save($this->request->data,false);\n\t\t\t\t$this->Session->setFlash(__('The group is successfully added'));\n\t\t\t\t$this->redirect('/addGroup');\n\t\t\t}\n\t\t}\n\t}", "function addGroup(&$args, &$request) {\n\t\t// Calling editMasthead with an empty row id will add\n\t\t// a new masthead.\n\t\t$this->editGroup($args, $request);\n\t}", "function addGroup($groupname){\r\n\t\t$file=fopen($this->fHtgroup,\"a\");\r\n\t\tfclose($file);\r\n\t}", "function addGroup($groupname){\n $file=fopen($this->fHtgroup,\"a\");\n fclose($file);\n }", "function addGroup($groupname){\n $file=fopen($this->fHtgroup,\"a\");\n fclose($file);\n }", "public function add()\n {\n if ($this->request->is('post')) {\n $this->Group->create();\n if ($this->Group->save($this->request->data)) {\n $this->Flash->success(__('The group has been created'));\n\n // redirect to page index\n return $this->redirect(array('action' => 'index'));\n }\n $this->Flash->error(\n __('The group could not be saved. Please, try again.')\n );\n }\n }", "function groups_create_grouping($data) {\n global $CFG;\n\n $data->timecreated = time();\n $data->timemodified = $data->timecreated;\n $data->name = trim($data->name);\n\n $id = insert_record('groupings', $data);\n\n if ($id) {\n //trigger groups events\n $data->id = $id;\n events_trigger('groups_grouping_created', stripslashes_recursive($data));\n }\n\n return $id;\n}", "public function add() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_INSERTquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t$data\n\t\t);\n\t\tif ( $res ) {\n\t\t\t$this['uid'] = $GLOBALS['TYPO3_DB']->sql_insert_id($res);\n\t\t\ttx_passwordmgr_helper::addLogEntry(1, 'addGroup', 'Added Group '.$data['name']);\n\t\t} else {\n\t\t\tthrow new Exception('Error adding group: ' . $data['name']);\n\t\t}\n\t\treturn($this['uid']);\n\t}", "public function create_group() {\r\n $this->layout = '';\r\n\r\n $this->displayGroupType();\r\n\r\n $this->loadModel('GetRegisteredGroupData');\r\n $group_info = $this->GetRegisteredGroupData->find('all', array(\r\n 'order' => array('GetRegisteredGroupData.group_name' => 'asc')));\r\n\r\n $this->set('groupInfo', $group_info);\r\n }", "public function creategroupAction()\n\t{\n\n\t\t$this->saveAction('UserGroup');\n\t}", "public function add(GroupObject $object) : Group;", "function _createGroup($aNew=true)\n\t{\n\t\t$ut = $this->_ut;\n\t\t$dt = $this->_dt;\n\n\t\t// Get the informations\n\t\t$infos = array('draw_id' => kform::getInput(\"drawId\"),\n 'draw_type' => kform::getInput(\"drawType\"),\n 'draw_nbp3' => kform::getInput(\"drawNbp3\"),\n 'draw_nbs3' => kform::getInput(\"drawNbs3\"),\n 'draw_nbp4' => kform::getInput(\"drawNbp4\"),\n 'draw_nbs4' => kform::getInput(\"drawNbs4\"),\n 'draw_nbp5' => kform::getInput(\"drawNbp5\"),\n 'draw_nbs5' => kform::getInput(\"drawNbs5\"),\n 'draw_nbpl' => kform::getInput(\"drawNbpl\"),\n 'draw_nbq' => kform::getInput(\"drawNbq\"),\n 'draw_nbplq' => kform::getInput(\"drawNbplq\"),\n 'draw_third' => kform::getInput(\"drawThird\", false),\n 'draw_name' => kform::getInput(\"drawName\"),\n 'draw_nbSecond' => kform::getInput(\"drawNbSecond\"),\n\t\t\t\t\t 'group' => kform::getInput(\"group\", ''),\n\t\t\t\t\t 'draw_nbPairs' => kform::getInput('drawNbPairs'),\n\t\t\t\t\t 'rund_rge' => kform::getInput('rundFinalPlace')\n\t\t);\n\n\t\t// Control the informations\n\t\tif ($infos['group'] == \"\")\n\t\t{\n\t\t\t$infos['errMsg'] = 'groupname';\n\t\t\t$this->_displayFormNewGroup($infos);\n\t\t}\n\t\tif ( $infos['draw_nbp3'] < 0 || $infos['draw_nbs3'] < 0 ||\n\t\t$infos['draw_nbp4'] < 0 || $infos['draw_nbs4'] < 0 ||\n\t\t$infos['draw_nbp5'] < 0 || $infos['draw_nbs5'] < 0 ||\n\t\t$infos['draw_nbq'] < 0 )\n\t\t{\n\t\t\t$infos['errMsg'] = 'msgPositif';\n\t\t\t$this->_displayFormNewGroup($infos);\n\t\t}\n\t\tif ($infos['draw_type'] == WBS_GROUP)\n\t\t{\n\t\t\t$infos['draw_nbpl'] =\n\t\t\t$infos['draw_nbp3'] * $infos['draw_nbs3'] +\n\t\t\t$infos['draw_nbp4'] * $infos['draw_nbs4'] +\n\t\t\t$infos['draw_nbp5'] * $infos['draw_nbs5'] +\n\t\t\tkform::getInput(\"drawNbSecond\",0);\n\t\t\t$infos['draw_nbplq'] = 0;\n\t\t\t$infos['draw_nbq'] = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$infos['draw_nbp3'] = 0;\n\t\t\t$infos['draw_nbp4'] = 0;\n\t\t\t$infos['draw_nbp5'] = 0;\n\t\t\tif ($infos['draw_type'] == WBS_KO)\n\t\t\t{\n\t\t\t\t$infos['draw_nbq'] = 0;\n\t\t\t\t$infos['draw_nbplq'] = 0;\n\t\t\t}\n\t\t\telse if ($infos['draw_type'] == WBS_CONSOL)\n\t\t\t{\n\t\t\t\t$infos['draw_nbq'] = 0;\n\t\t\t\t$infos['draw_nbplq'] = 0;\n\t\t\t}\n\t\t}\n\t\t// Add the draws\n\t\t$res = $dt->updateGroups($infos, $aNew);\n\t\tif (is_array($res))\n\t\t{\n\t\t\t$infos['errMsg'] = $res['errMsg'];\n\t\t\t$this->_displayFormNewGroup($infos);\n\t\t}\n\t\t$page = new utPage('none');\n\t\t$page->close();\n\t\texit();\n\t}", "public function addGroup(){\n \treturn view('group.add-group');\n }", "public function createGroup() {\n\t\t$groupName = Input::get('addGrp');\n\t\ttry{\n\t\t\tProjectHandler::createGroup($groupName);\n\t\t\tProjectHandler::grantUser(Auth::user(), $groupName, Roles::PROJECT_ADMIN);\n\t\t\treturn Redirect::back()\n\t\t\t\t->with('flashSuccess', 'Group <b>'.$groupName.'</b> succesfully created!');\t\t\t\n\t\t} catch(\\Cartalyst\\Sentry\\Groups\\GroupExistsException $e) {\n\t\t\treturn Redirect::back()\n\t\t\t->with('flashError', 'Group <b>'.$groupName.'</b> already exists!');\n\t\t}\n\t}", "function createGroup($_name,$_owner) {\n $group = R::dispense('groups');\n $group->name = $_name;\n $group->owner = $_owner;\n $id = R::store($group);\n \n $groupMembers = R::dispense('groupmembers');\n $groupMembers->member_id = $_SESSION['user_id'];\n $groupMembers->group_id = $id;\n R::store($groupMembers);\n \n return $id;\n}", "function addgroup($data)\r\n {\r\n $mysqli = $this->conn;\r\n\r\n if (empty($table))\r\n $table = $this->table;\r\n\r\n /* Prepared statement, stage 1: prepare */\r\n if (!($stmt = $mysqli->prepare(\"INSERT INTO LakeHostGroup (lakeHostGroupName, notes) VALUES (?,?)\"))) {\r\n echo \"Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\r\n }\r\n\r\n /* Prepared statement, stage 2: bind and execute */\r\n if (!($stmt->bind_param(\"ss\", $data['lakeHostGroupName'], $data['notes']))) {\r\n echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n\r\n if (!$stmt->execute()) {\r\n echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n }\r\n }", "public function actionAddGroup()\n {\n echo \"Create an user group ...\\n\";\n $name = trim($this->prompt('Group name (max length 32 varchar):'));\n $desc = trim($this->prompt('Group description (max length 255 varchar):'));\n if ($name && $this->confirm(\"Are your sure to create an user group?\")) {\n if (DIRECTORY_SEPARATOR === '\\\\') {\n $name = iconv('GBK','UTF-8//IGNORE', $name);\n $desc = iconv('GBK','UTF-8//IGNORE', $desc);\n }\n $model = Yii::$app->menuManager->addGroup($name, $desc);\n if ($model->hasErrors()) {\n echo join(',', $model->getFirstErrors()) . \"\\n\";\n return self::EXIT_CODE_ERROR;\n }\n echo \"Success.\\n\";\n return self::EXIT_CODE_NORMAL;\n }\n echo \"Canceled!\\n\";\n return self::EXIT_CODE_NORMAL;\n }", "function group_create($data){\n $dval = $data['umd_val'];\n if(!isset($this->domains[$dval])) return 2;\n if(!in_array($dval,$this->quest_provider('d:group','create',TRUE,FALSE)))\n return 3;\n $tmp = $this->domains[$dval]->group_create($data);\n if($tmp>0) return $tmp;\n return $this->gdn_make($data['gname'],$dval);\n }", "public function createGroup(){\n ///Create Domain\n $NameGroup=$_POST['newgroup'];\n $Type=$_POST['Type-group'];\n\n DB::table('w59_group')->insert(\n ['id' => NULL, 'nombre' => $NameGroup, 'type' => $Type]\n );\n return back()->with('info','You added new items, follow next step!');\n\n }", "public function add_group($data) {\n\t\t$this->db->insert('group', $data);\n\t\treturn ($data['groupUuid']);\t\n\t}", "public function addAction()\n {\n $form = $this->groupForm;\n $group = new Group();\n /** @var Request $request */\n $request = $this->getRequest();\n\n $form->bind($group);\n\n if ($request->isPost()) {\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n//\t\t\t\t$group->exchangeArray($form->getData());\n\n try {\n $storageData = $form->getData(FormInterface::VALUES_AS_ARRAY);\n $group->exchangeArray($storageData['group']);\n $idGroup = $this->groupTable->save($group);\n\n $this->flashMessenger()->addSuccessMessage('saved_group');\n\n return $this->redirectTo('edit', $idGroup);\n } catch (\\Exception $e) {\n $this->flashMessenger()->addErrorMessage($e->getMessage());\n }\n } else {\n $this->flashMessenger->addErrorMessage('form_invalid');\n }\n }\n\n $form->setAttribute('action', $this->makeUrl('group', 'add'));\n\n return $this->getAjaxView(array(\n 'customform' => $form,\n 'lockLists' => array(),\n 'title' => 'group_add',\n ), 'libadmin/group/edit');\n }", "function addGroup($group)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }", "public function addGroup($attributes) {\n return $this->get('add_group', $attributes);\n }", "public function add(string $group)\n {\n $this->groups[] = $group;\n }", "public function addGroup()\n {\n\n if (requestMethod() == 'POST') {\n $controllers = $this->input->post('cont_permission');\n $methods = $this->input->post('method_permission');\n $permissions = [];\n\n // set full permission controller\n\n if ($controllers) {\n\n foreach ($controllers as $controller) {\n $permissions[] = $controller;\n }\n\n }\n\n // set permission method\n\n if ($methods) {\n\n foreach ($methods as $cont => $method) {\n\n if (!$controllers or !in_array($cont, $controllers)) {\n $permissions[] = $method;\n }\n\n }\n\n }\n\n $data = [\n 'name' => $this->input->post('name'),\n 'desc' => $this->input->post('desc'),\n 'permissions' => serialize($permissions),\n 'created_time' => time(),\n 'last_update' => time(),\n ];\n\n $res = $this->admin_model->addGroup($data);\n\n if ($res) {\n $this->session->set_flashdata('success', lang('success'));\n $this->session->set_flashdata('alertUrl', base_url() . 'cms/admin/addGroup');\n $this->session->set_flashdata('alertText', lang('add_new_one'));\n redirect('/cms/admin');\n } else {\n $this->session->set_flashdata('error', lang('failed'));\n redirect('/cms/addGroup');\n }\n\n }\n\n $data['controllers'] = $this->auth->listController();\n\n self::__loadHeader();\n self::__loadNavbar('admin');\n $this->body = $this->load->view('admin/add_group_view', $data, true);\n self::__loadView();\n\n }", "function add_user_group($params)\n {\n $this->db->insert('groups',$params);\n return $this->db->insert_id();\n }", "public function add_group($group_name) {\n $this->page_fields[]=array('sub_heading'=>$group_name,'fields'=>array());\n }", "public function addAction() {\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('groups', $groups);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "function create_group( $args ) {\r\n global $wpdb;\r\n\r\n //checking that Client Circle not exist other ID\r\n $result = $wpdb->get_row( $wpdb->prepare( \"SELECT group_id FROM {$wpdb->prefix}wpc_client_groups WHERE LOWER(group_name) = '%s'\", strtolower( $args['group_name'] ) ), \"ARRAY_A\");\r\n if ( $result ) {\r\n if ( \"0\" != $args['group_id'] && $result['group_id'] == $args['group_id'] ) {\r\n\r\n } else {\r\n //if Client Circle exist with other ID\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'The Group already exists!!!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n }\r\n }\r\n\r\n\r\n if ( '0' != $args['group_id'] ) {\r\n //update when edit Client Circle\r\n $result = $wpdb->query( $wpdb->prepare( \"UPDATE {$wpdb->prefix}wpc_client_groups SET group_name = '%s', auto_select = '%s', auto_add_clients = '%s' WHERE group_id = %d\",\r\n trim( $args['group_name'] ),\r\n $args['auto_select'],\r\n $args['auto_add_clients'],\r\n $args['group_id'] ) );\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'The changes of the group are saved!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n } else {\r\n //create new Client Circle\r\n $result = $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_groups SET group_name = '%s', auto_select = '%s', auto_add_clients = '%s'\",\r\n trim( $args['group_name'] ),\r\n $args['auto_select'],\r\n $args['auto_add_clients']\r\n ) );\r\n\r\n //assign all clients\r\n if ( '1' == $args['assign_all'] ) {\r\n $new_group_id = $wpdb->insert_id;\r\n\r\n $args = array(\r\n 'role' => 'wpc_client',\r\n );\r\n\r\n $clients = get_users( $args );\r\n\r\n if ( is_array( $clients ) && 0 < count( $clients ) )\r\n foreach ( $clients as $client ) {\r\n $wpdb->query( $wpdb->prepare( \"INSERT INTO {$wpdb->prefix}wpc_client_group_clients SET group_id = %d, client_id = '%d'\", $new_group_id, $client->ID ) );\r\n }\r\n\r\n }\r\n\r\n\r\n wp_redirect( add_query_arg( array( 'page' => 'wpclients_groups', 'updated' => 'true', 'dmsg' => urlencode( __( 'Client Circle is created!', WPC_CLIENT_TEXT_DOMAIN ) ) ), 'admin.php' ) );\r\n exit;\r\n }\r\n\r\n }", "public function addAction() {\n\t\tlist(, $groups) = Resource_Service_Pgroup::getAllPgroup();\n\t\t$this->assign('groups', $groups);\n\t\t$this->assign('ntype', $this->ntype);\n\t\t$this->assign('btype', $this->btype);\n\t}", "public function offers_group_post()\n {\n $this->verify_request(); \n $data = array(\n 'group_name' => $this->input->post('group_name'),\n 'group_status' => $this->input->post('group_status')\n );\n $result = $this->Offer_model->insert_new_offer_group($data);\n $status = parent::HTTP_OK;\n $this->response(['offer group created successfully.'], $status);\n }", "function timeconditions_timegroups_add_group($description,$times=null) {\n\tglobal $db;\n\n\t$sql = \"insert timegroups_groups(description) VALUES ('$description')\";\n\t$db->query($sql);\n\t$timegroup=mysql_insert_id();\n\tif (isset($times)) {\n\t\ttimeconditions_timegroups_edit_times($timegroup,$times);\n\t}\n\tneedreload();\n\treturn $timegroup;\n}", "function addToGroup($group)\n {\n $this->_api->doRequest(\"PUT\", \"{$group->getBaseApiPath()}/contacts/{$this->id}\"); \n $this->_group_ids_set[$group->id] = true; \n }", "public function addAction(){\n $this->title = 'Add a new user group.';\n \n $form = new GroupForm();\n $groupModel = new Group();\n \n if ($this->getRequest()->isPost()) {\n if($form->isValid($this->getRequest()->getPost())) {\n $groupModel->save($form->getValues());\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => sprintf('The group %s was successfully added.', $form->getValue('name')),\n )\n );\n \n $this->_redirect('/groups/');\n }\n }\n \n $this->view->form = $form;\n }", "function createGroup($groupName, $description, $type, $userId, $db) {\n strip_tags($groupName);\n strip_tags($description);\n strip_tags($type);\n\n $qString = ('INSERT INTO groups (name, description, projectType) VALUES (:name, :description, :type)');\n $stm = $db -> prepare($qString);\n\n if ($stm -> execute( array(':name' => $groupName, ':description' => $description, ':type' => $type))) {\n if(addToGroup($userId, $db, getGroupId($groupName, $db), true)) {\n echo \"<meta http-equiv='REFRESH' content='0;url=/?page=group'>\";\n } else {\n echo 'couldnt add to group!';\n }\n } else {\n print_r($stm->errorInfo());\n }\n}", "function addGroup($groupid) {\n $groups = $this->getGroups();\n if (!is_array($groups)) {\n $groups = array();\n }\n array_push($groups, $groupid);\n $this->setGroups($groups);\n }", "public function addGroup()\n {\n return new AccountGroupBuilder($this,$this->now);\n }", "public function insert() {\r\n // Does the Group object already have an ID?\r\n if ( !is_null( $this->id ) ) trigger_error ( \"Group::insert(): Attempt to insert a Group object that already has its ID property set (to $this->id).\", E_USER_ERROR );\r\n\r\n // Insert 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 $sql = \"INSERT INTO \" . DB_PREFIX . \"groups ( title, dashboard, content, themes, files, settings, users, status ) VALUES ( :title, :dashboard, :content, :themes, :files, :settings, :users, :status )\";\r\n\r\n $st = $conn->prepare( $sql );\r\n $st->bindValue( \"title\", $this->title, PDO::PARAM_STR );\r\n $st->bindValue( \"dashboard\", $this->dashboard, PDO::PARAM_INT );\r\n $st->bindValue( \"content\", $this->content, PDO::PARAM_INT );\r\n $st->bindValue( \"themes\", $this->themes, PDO::PARAM_INT );\r\n $st->bindValue( \"files\", $this->files, PDO::PARAM_INT );\r\n $st->bindValue( \"settings\", $this->settings, PDO::PARAM_INT );\r\n $st->bindValue( \"users\", $this->users, PDO::PARAM_INT );\r\n $st->bindValue( \"status\", $this->status, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $this->id = $conn->lastInsertId();\r\n \r\n $conn = null;\r\n \r\n }", "function gotravel_mikado_add_admin_group($attributes) {\n\t\t$name = '';\n\t\t$title = '';\n\t\t$description = '';\n\t\t$parent = '';\n\n\t\textract($attributes);\n\n\t\tif(!empty($name) && !empty($title) && is_object($parent)) {\n\t\t\t$group = new GoTravelMikadoGroup($title, $description);\n\t\t\t$parent->addChild($name, $group);\n\n\t\t\treturn $group;\n\t\t}\n\n\t\treturn false;\n\t}", "function add($post) {\n\t\tglobal $fmdb, $__FM_CONFIG;\n\t\t\n\t\t/** Validate entries */\n\t\t$post = $this->validatePost($post);\n\t\tif (!is_array($post)) return $post;\n\t\t\n\t\t$sql_insert = \"INSERT INTO `fm_{$__FM_CONFIG[$_SESSION['module']]['prefix']}groups`\";\n\t\t$sql_fields = '(';\n\t\t$sql_values = null;\n\t\t\n\t\t$post['account_id'] = $_SESSION['user']['account_id'];\n\t\t\n\t\t$exclude = array('submit', 'action', 'group_id', 'compress', 'AUTHKEY');\n\n\t\tforeach ($post as $key => $data) {\n\t\t\t$clean_data = sanitize($data);\n\t\t\tif (($key == 'group_name') && empty($clean_data)) return _('No group name defined.');\n\t\t\tif (!in_array($key, $exclude)) {\n\t\t\t\t$sql_fields .= $key . ', ';\n\t\t\t\t$sql_values .= \"'$clean_data', \";\n\t\t\t}\n\t\t}\n\t\t$sql_fields = rtrim($sql_fields, ', ') . ')';\n\t\t$sql_values = rtrim($sql_values, ', ');\n\t\t\n\t\t$query = \"$sql_insert $sql_fields VALUES ($sql_values)\";\n\t\t$result = $fmdb->query($query);\n\t\t\n\t\tif ($fmdb->sql_errors) {\n\t\t\treturn formatError(_('Could not add the group because a database error occurred.'), 'sql');\n\t\t}\n\n\t\taddLogEntry(\"Added {$post['group_type']} group:\\nName: {$post['group_name']}\\n\" .\n\t\t\t\t\"Comment: {$post['group_comment']}\");\n\t\treturn true;\n\t}", "public function create_group()\r\n\t{\r\n\t\t// Load template\r\n\t\tinclude(BLUPATH_TEMPLATES .'/site/modules/create_group.php');\r\n\t}", "public function createGroupAttribute() {\n $languages = $this->getLanguages();\n $is_attr = $this->isAttrGroup('Foks');\n\n if (!$is_attr) {\n $this->db->query( \"INSERT INTO \" . DB_PREFIX . \"attribute_group SET sort_order = '1'\" );\n\n $attribute_group_id = $this->db->getLastId();\n\n foreach ( $languages as $language_id ) {\n $this->db->query( \"INSERT INTO \" . DB_PREFIX . \"attribute_group_description SET attribute_group_id = '\" . (int)$attribute_group_id . \"', language_id = '\" . (int)$language_id . \"', name = 'Foks'\" );\n }\n } else {\n $attribute_group_id = $is_attr;\n }\n\n return $attribute_group_id;\n }", "public function addGroup($groupDesc){\n $groupName = preg_replace('/\\s+/', '_', $groupDesc);\n $groupName = 'GRP_'.strtoupper($groupName);\n $bool = false;\n $insertKey = false;\n do {\n $rows = $this->getData(\"SELECT id FROM groups WHERE groupName LIKE '$groupName' LIMIT 1;\");\n if(empty($rows)){\n $bool = true;\n $insertKey = $this->executeGetKey(\"INSERT INTO groups (groupName, groupDesc) VALUES ('$groupName','$groupDesc');\");\n }else{\n $groupName = strtok($groupName, '_%');\n $groupName.='_%'.substr(str_shuffle(\"CHRISTAN\"), 0,5);\n }\n } while ($bool == false);\n return $insertKey;\n }", "public function addToGroup($name) {\r\n // Check if the user belongs to the group\r\n if (!in_array($name, $this->groups)) {\r\n // If not, then we add them to the group\r\n $this->groups[] = $name;\r\n // Update the object in the database\r\n $this->update();\r\n }\r\n }", "public function testCreateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function group_add(Request $request)\n {\n $rules = array(\n 'group_name'=>'required|unique:tb_groups', \n );\n\n $error = Validator::make($request->all(), $rules);\n\n if($error->fails())\n {\n return response()->json(['errors' => $error->errors()->all()]);\n }\n\n $group_create = DB::table('tb_groups')->insert([\n 'group_name'=>$request->group_name,\n 'group_leader_id'=>$request->group_leader_id,\n 'remarks'=>$request->remarks,\n 'status'=>1,\n 'created_by'=>Auth::user()->id,\n 'created_at'=>Carbon::now()->toDateTimeString(),\n 'updated_at'=>Carbon::now()->toDateTimeString()\n ]);\n\n if ($group_create) {\n return response()->json(['success' => 'Group Added successfully.']);\n } else {\n return 0;\n }\n }", "function &newGroup($name, $parent = GROUP_ROOT)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }", "function create_group()\n\t{\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash');\n\n\t\tif ($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n\t\t\tif($new_group_id)\n\t\t\t{\n\t\t\t\t// check to see if we are creating the group\n\t\t\t\t// redirect them back to the admin page\n\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\tredirect(\"auth\", 'refresh');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create group form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['group_name'] = array(\n\t\t\t\t'name' => 'group_name',\n\t\t\t\t'id' => 'group_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\n\t\t\t);\n\t\t\t$this->data['description'] = array(\n\t\t\t\t'name' => 'description',\n\t\t\t\t'id' => 'description',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_group', $this->data);\n\t\t}\n\t}", "public function create_group()\r\n\t{\r\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\r\n\r\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\r\n\t\t{\r\n\t\t\tredirect('auth', 'refresh');\r\n\t\t}\r\n\r\n\t\t// validate form input\r\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash');\r\n\r\n\t\tif ($this->form_validation->run() == TRUE)\r\n\t\t{\r\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\r\n\t\t\tif($new_group_id)\r\n\t\t\t{\r\n\t\t\t\t// check to see if we are creating the group\r\n\t\t\t\t// redirect them back to the admin page\r\n\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\r\n\t\t\t\tredirect(\"auth\", 'refresh');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// display the create group form\r\n\t\t\t// set the flash data error message if there is one\r\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\r\n\r\n\t\t\t$this->data['group_name'] = array(\r\n\t\t\t\t'name' => 'group_name',\r\n\t\t\t\t'id' => 'group_name',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\r\n\t\t\t);\r\n\t\t\t$this->data['description'] = array(\r\n\t\t\t\t'name' => 'description',\r\n\t\t\t\t'id' => 'description',\r\n\t\t\t\t'type' => 'text',\r\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\r\n\t\t\t);\r\n\t\t\t\r\n\t\t\t$this->_render_page('auth/create_group', $this->data);\r\n\t\t}\r\n\t}", "public function add()\n {\n // cria entidade de grupo\n $group = $this->Groups->newEntity();\n $id = uniqid();\n //se requisição for post\n if ($this->request->is('post')) {\n //popula entidade de grupo com os dados do form\n $group = $this->Groups->patchEntity($group, $this->request->getData());\n //se salvar retorna sucesso\n if ($this->Groups->save($group,['associated' => ['UsersGroup']])) {\n\n //Cria userGroup com o usuario que tá criando o grupo e role 2 = criador\n $userGroupData = ['user_id'=>$this->user['id'],'group_id'=>$group->id,'role'=>2,'invite_status'=>1];\n $userGroup = $this->Groups->UsersGroup->newEntity($userGroupData);\n $this->Groups->UsersGroup->save($userGroup);\n $this->Flash->success(__(\"O grupo $group[name] foi criado com sucesso \"));\n\n return $this->redirect(['action' => 'add']);\n }\n $this->Flash->error(__('Não foi possivel criar o grupo pois erros ocorreram:'),['params'=>['errors'=>$group->getErrors()]]);\n }\n //configuração de variáveis para view\n $this->set(compact('group','id'));\n $this->set('user',$this->user);\n $this->set('invites',$this->invites);\n $this->set('eventNotifications',$this->eventNotifications);\n $this->set('sortNotifications',$this->sortNotifications);\n $this->set('messageNotifications',$this->messageNotifications);\n $this->set('_serialize', ['group']);\n }", "public function create_group()\n\t{\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash');\n\n\t\tif ($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n\t\t\tif($new_group_id)\n\t\t\t{\n\t\t\t\t// check to see if we are creating the group\n\t\t\t\t// redirect them back to the admin page\n\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\tredirect(\"auth\", 'refresh');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create group form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['group_name'] = array(\n\t\t\t\t'name' => 'group_name',\n\t\t\t\t'id' => 'group_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\n\t\t\t);\n\t\t\t$this->data['description'] = array(\n\t\t\t\t'name' => 'description',\n\t\t\t\t'id' => 'description',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_group', $this->data);\n\t\t}\n\t}", "function db_add_group($name, $parent = -1)\n{\n\t$dbh = db_connect();\n\n\t// Create the group\n\t$query = \"INSERT INTO `groups` (parent, name) VALUES (?,?)\";\n\t$stmt = $dbh->prepare($query);\n\t$result = $stmt->bind_param(\"is\", $parent, $name);\n\t$result = $stmt->execute();\n\t$stmt->close();\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t// Invert the group ID: auto_increment gives it a positive\n\t// value, but we want a negative one.\n\t$result = $dbh->query(\"UPDATE groups SET id = -id WHERE id = last_insert_id()\");\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\n\t// Fetch the group info so we can return it to the caller.\n\t$result = $dbh->query(\"SELECT * FROM groups WHERE id = -last_insert_id()\");\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t$row = $result->fetch_assoc();\n\n\treturn $row;\n}", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(3, $value);\n }", "public function add_customer_group($data){\n\t\t\n\t\t\t$this->db->insert('customer_group',$data);\n\t\t\tredirect('Customer/Customer_group');\n\t\t\n\t}", "public function createAction()\n\t{\n\t\n\t\tif(\\Input::server('REQUEST_METHOD') == 'POST')\n\t\t{\n\t\t\t$rules = array(\n\t\t\t\t'group' => 'required|unique:groups,group',\n\t\t\t);\n\t\t\t$input = \\Input::all();\n\t\t\t$validator = \\Validator::make($input, $rules);\n\n\t\t\tif( $validator->passes() )\n\t\t\t{\n\t\t\t\t$group = new \\Group;\n\t\t\t\t$group->group = $input['group'];\n\n\t\t\t\tif($group->save())\n\t\t\t\t{\n\t\t\t\t\treturn \\Redirect::to('admin/members/groups')\n\t\t\t\t\t\t->with('success_msg', 'Successfully saved');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \\Redirect::to('admin/members/group/create')\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->with('errors', $validator->getMessageBag()->toArray());\n\t\t\t}\n\t\t}\n\n\t\treturn \\View::make('user::group.create');\n\t\t\n\t}", "public function createGroup(Request $request) {\n $user = $request->get('auth');\n $group = (object) $request->input('group');\n $immunity = User::getImmunity($user->userId);\n\n Condition::precondition(empty($group->name), 400, 'A group needs to have a name!');\n Condition::precondition($group->immunity >= $immunity || $group->immunity < 0, 400, 'Immunity can only be 0 to');\n\n $nameIsUnique = Group::withName($group->name)->count('groupId') == 0;\n Condition::precondition(!$nameIsUnique, 400, 'Name needs to be unique');\n\n Condition::precondition($group->nameColor && !Value::validateHexColors([$group->nameColor]), 400, 'Invalid Hex Color!');\n $group->nameColor = json_encode([$group->nameColor]);\n\n $group->sitecpPermissions = $this->convertSitecpPermissions($user, $group, null);\n $group->staffPermissions = $this->convertStaffPermissions($user, $group, null);\n $group->options = $this->convertGroupOptions($group);\n\n $group = new Group(\n [\n 'name' => $group->name,\n 'nickname' => Value::objectProperty($group, 'nickname', ''),\n 'nameColor' => Value::objectProperty($group, 'nameColor', ''),\n 'userBarStyling' => Value::objectProperty($group, 'userBarStyling', ''),\n 'immunity' => $group->immunity,\n 'sitecpPermissions' => $group->sitecpPermissions,\n 'staffPermissions' => $group->staffPermissions,\n 'options' => $group->options,\n 'isPublic' => Value::objectProperty($group, 'isPublic', 0),\n 'avatarHeight' => Value::objectProperty($group, 'avatarHeight', 0),\n 'avatarWidth' => Value::objectProperty($group, 'avatarWidth', 0)\n ]\n );\n $group->save();\n\n Logger::sitecp($user->userId, $request->ip(), LogType::CREATED_GROUP, ['group' => $group->name], $group->groupId);\n return $this->getGroup($request, $group->groupId);\n }", "public function testAddUserIntoGroup(){\n jAcl2DbUserGroup::createUser('robert');\n self::$grpId7 = $this->getLastId('id_aclgrp', 'jacl2_group');\n jAcl2DbUserGroup::addUserToGroup('robert', self::$grpId1);\n\n self::$groups[] = array('id_aclgrp'=>self::$grpId7,\n 'name'=>'robert',\n 'grouptype'=>2,\n 'ownerlogin'=>'robert');\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\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'=>'robert', 'id_aclgrp'=>self::$grpId7),\n array('login'=>'robert', 'id_aclgrp'=>self::$defaultGroupId),\n array('login'=>'robert', 'id_aclgrp'=>self::$grpId1),\n );\n $this->assertTableContainsRecords('jacl2_user_group', self::$usergroups);\n }", "function create_group()\n\t{\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t//validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash|xss_clean');\n\t\t$this->form_validation->set_rules('description', $this->lang->line('create_group_validation_desc_label'), 'xss_clean');\n\n\t\tif ($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n\t\t\tif($new_group_id)\n\t\t\t{\n\t\t\t\t// check to see if we are creating the group\n\t\t\t\t// redirect them back to the admin page\n\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\tredirect(\"auth\", 'refresh');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//display the create group form\n\t\t\t//set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['group_name'] = array(\n\t\t\t\t'name' => 'group_name',\n\t\t\t\t'id' => 'group_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\n\t\t\t);\n\t\t\t$this->data['description'] = array(\n\t\t\t\t'name' => 'description',\n\t\t\t\t'id' => 'description',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\n\t\t\t);\n\n\t\t\t$this->_render_page('auth/create_group', $this->data);\n\t\t}\n\t}", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "public function addGroups(\\iface\\TestGroup $value){\n return $this->_add(4, $value);\n }", "function add_session_group_user() {\r\n // set connection var\r\n global $db;\r\n\r\n // protect from unauthorized access\r\n if (!isset($_SESSION['user']) or !isset($_SESSION['group'])) {\r\n logout();\r\n die();\r\n }\r\n\r\n if (!isset($_POST['formSurveyGroupUserUsername']) || \r\n (($_POST['formSurveyGroupUserUsername'] == '') && ($_POST['formSurveyGroupUserEmail'] == ''))) {\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Моля, въведете Потребителско Име или Email за търсене на потребителя!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n die();\r\n }\r\n\r\n $username = $_POST['formSurveyGroupUserUsername'];\r\n\r\n $sql = \"SELECT id\r\n FROM users\r\n WHERE username = '$username'\r\n AND is_active = '1';\";\r\n\r\n $users = array();\r\n $new_group_user = null;\r\n foreach ($db->query($sql) as $key => $value) {\r\n $users[$key] = $value;\r\n foreach ($users[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $new_group_user = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n if ($new_group_user != null) {\r\n $group = new Group();\r\n $group = unserialize($_SESSION['group']);\r\n $session_group = new Group;\r\n $session_group = unserialize($_SESSION['group']);\r\n $users = $session_group->getMembersArray();\r\n if (!in_array($new_group_user, $users)) {\r\n array_push($users, $new_group_user);\r\n $session_group->setMembers(serialize($users));\r\n $_SESSION['group'] = serialize($session_group);\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно добавихте потребител към групата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n } else {\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Този потребител е вече добавен към групата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n }\r\n } else {\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Няма открит потребител с тези данни!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n }\r\n}", "function CreateGroup ($name, $description, $grouptype, $parentgroupid, $autocreateapps = 'False') {\n $path = REST_PATH . 'groups.xml';\n \n $name = filter_var($name, FILTER_SANITIZE_STRING);\n $description = filter_var($description, FILTER_SANITIZE_STRING); \n\n // Setup the POST NAME/VALUE pairs\n $postdata = http_build_query(\n array(\n 'Name' => $name,\n 'GroupType' => $grouptype,\n\t'Description' => $description,\n\t'ParentGroupId' => $parentgroupid,\n\t'AutoCreateApplications' => $autocreateapps\n )\n );\n\n // Call Rest API\n $result = CallRestApi($path, $postdata, 'POST');\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n\n // Get the Group ID\n $newGroupId = $xml->Group->Id;\n\n if ($newGroupId == '')\n $newGroupId = -1;\n\n return $newGroupId;\n}", "private function addGroupTopic()\n {\n try\n {\n $request = $_POST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['topic_title']) || $request['topic_title']==\"\" )\n throw_error_msg('provide topic title');\n\n if(!isset($request['topic_post']) || $request['topic_post']==\"\" )\n throw_error_msg('provide topic post');\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->add_topic($request);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic added', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public static function addNewGroup(string $group_name)\n {\n return self::insertGetId(['name' => $group_name]);\n }", "public function insert(&$group) {\n\t\t/* As of PHP5.3.0, is_a()is no longer deprecated, so there is no reason to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\tif (!$group->isDirty()) {\n\t\t\treturn true;\n\t\t}\n\t\tif (!$group->cleanVars()) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $group->cleanVars as $k => $v) {\n\t\t\t${$k} = $v;\n\t\t}\n\t\tif ($group->isNew()) {\n\t\t\t$groupid = icms::$xoopsDB->genId('group_groupid_seq');\n\t\t\t$sql = sprintf(\"INSERT INTO %s (groupid, name, description, group_type)\n\t\t\t\tVALUES ('%u', %s, %s, %s)\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\t(int) $groupid,\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type)\n\t\t\t);\n\t\t} else {\n\t\t\t$sql = sprintf(\n\t\t\t\t\"UPDATE %s SET name = %s, description = %s, group_type = %s WHERE groupid = '%u'\",\n\t\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t\ticms::$xoopsDB->quoteString($name),\n\t\t\t\ticms::$xoopsDB->quoteString($description),\n\t\t\t\ticms::$xoopsDB->quoteString($group_type),\n\t\t\t\t(int) $groupid\n\t\t\t);\n\t\t}\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($groupid)) {\n\t\t\t$groupid = icms::$xoopsDB->getInsertId();\n\t\t}\n\t\t$group->assignVar('groupid', $groupid);\n\t\treturn true;\n\t}", "function addToGroup($userId, $db, $group, $leader) {\n if ($group == 0) {\n echo \"<meta http-equiv='REFRESH' content='0;url=createGroup.php'>\";\n return 0;\n }\n $query = ('UPDATE users SET currentGroup = :group, groupLeader = :leader WHERE id = :userId');\n $statement = $db -> prepare($query);\n $statement -> bindValue(':userId', $userId);\n $statement -> bindValue(':group', $group);\n $statement -> bindValue(':leader', $leader);\n\n // execute query and print error message if not\n if (!$statement -> execute()) { return print_r($stm->errorInfo(), true);} else {\n return true;\n }\n}", "function groups_assign_grouping($groupingid, $groupid) {\n if (record_exists('groupings_groups', 'groupingid', $groupingid, 'groupid', $groupid)) {\n return true;\n }\n $assign = new object();\n $assign->groupingid = $groupingid;\n $assign->groupid = $groupid;\n $assign->timeadded = time();\n return (bool)insert_record('groupings_groups', $assign);\n}", "public function group($group);", "public function create()\n {\n //\n return view('player.group.group_create');\n }", "public function create_group() {\r\n\r\n $user_id = $this->session->userdata('user_id');\r\n $this->data['dataHeader'] = $this->users->get_allData($user_id);\r\n\r\n $this->data['title'] = $this->lang->line('create_group_title');\r\n\r\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin()) {\r\n redirect('auth', 'refresh');\r\n }\r\n\r\n // validate form input\r\n $this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash');\r\n\r\n if ($this->form_validation->run() == TRUE) {\r\n $new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\r\n if ($new_group_id) {\r\n // check to see if we are creating the group\r\n // redirect them back to the admin page\r\n $this->session->set_flashdata('message', $this->ion_auth->messages());\r\n redirect(\"auth\", 'refresh');\r\n }\r\n } else {\r\n // display the create group form\r\n // set the flash data error message if there is one\r\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\r\n\r\n $this->data['group_name'] = array(\r\n 'name' => 'group_name',\r\n 'id' => 'group_name',\r\n 'type' => 'text',\r\n 'required' => 'required',\r\n 'class' => 'form-control',\r\n 'value' => $this->form_validation->set_value('group_name'),\r\n );\r\n $this->data['description'] = array(\r\n 'name' => 'description',\r\n 'id' => 'description',\r\n 'class' => 'form-control',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('description'),\r\n );\r\n\r\n\r\n $this->template->set_master_template('template.php');\r\n $this->template->write_view('header', 'backend/header', (isset($this->data) ? $this->data : NULL));\r\n $this->template->write_view('sidebar', 'backend/sidebar', (isset($this->data) ? $this->data : NULL));\r\n $this->template->write_view('content', 'create_group', (isset($this->data) ? $this->data : NULL), TRUE);\r\n $this->template->write_view('footer', 'backend/footer', '', TRUE);\r\n $this->template->render();\r\n\r\n// $this->_render_page('auth/create_group', $this->data);\r\n }\r\n }", "function add_group()\n {\n if($this->input->post('formuser') == 'submit')\n {\n $done = 0;\n $error = 0;\n $errors = $errors_list = array();\n $name = $this->general->xss_post($this->input->post('name'), TRUE);\n $field_pages = $this->input->post('pages');\n\n $fields = array('name' => $name);\n foreach($fields as $key => $value)\n {\n if($value == \"\")\n {\n $error = 1;\n $errors[$key] = 1;\n }\n }\n\n if(empty($name) || empty($field_pages))\n {\n $errors_list = LNG_ALL_FIELDS_REQUIRED;\n $error = 1;\n }\n\n if(empty($error))\n {\n #initialization\n $fb_token_ext = $this->session->userdata('fb_sdk_token_ext');\n $fb_token_ext = !empty($fb_token_ext)? '###1':'';\n $fb_token = $this->session->userdata('fb_sdk_token');\n $fb_user = $this->session->userdata('fb_sdk_user');\n $fb_user = json_decode($fb_user, true);\n $fb_user_id = isset($fb_user['id'])? $fb_user['id']:0;\n $fb_user_name = isset($fb_user['name'])? $fb_user['name']:'Unknown';\n $id_user = $this->general->id_user();\n\n $this->db->query(\"INSERT INTO groups(id_user, user_id, user_name, access_token, name, timestamp) VALUES('\".$id_user.\"', '\".$fb_user_id.\"', '\".$this->general->xss_post($fb_user_name).\"', '\".$fb_token.$fb_token_ext.\"', '\".$name.\"', '\".$this->core->timestamp().\"')\");\n\n $last_insert_id = $this->db->insert_id();\n if(!empty($field_pages))\n {\n foreach($field_pages as $page)\n {\n $exp_page = explode('||', $page);\n if(isset($exp_page[0]) && !empty($exp_page[0]))\n {\n $this->db->query(\"INSERT INTO groups_data(id_group, id_user, id_wall, name, type, page_access_token) VALUES('\".$last_insert_id.\"', '\".$id_user.\"', '\".$exp_page[0].\"', '\".$this->general->xss_post(addslashes(urldecode($exp_page[1]))).\"', '\".( str_replace(array('pages', 'groups', 'friends'), array(1,2,3), $exp_page[2]) ).\"', '\".(isset($exp_page[3])? $exp_page[3].$fb_token_ext:0).\"')\");\n }\n }\n }\n\n $done = 1;\n }\n\n return json_encode(array('result' => 'ok', 'errors' => $errors, 'errors_list' => $errors_list, 'done' => $done));\n }\n }", "private function insertGroups() {\n\t DB::table('base_group')->insert(['group_name' => 'sales.reporting', 'group_info' => 'Sales Reporting', 'group_alias' => 'National', 'active' => 1]);\n\t DB::table('base_group')->insert(['group_name' => 'customer.analytics', 'group_info' => 'Customer Analytics', 'group_alias' => 'National', 'active' => 1]);\n\t}", "public function createGroup($groupId, $request)\n {\n return $this->start()->uri(\"/api/group\")\n ->urlSegment($groupId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function create_group()\n\t{\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('/admin/users', 'refresh');\n\t\t}\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'required|alpha_dash');\n\n\t\tif ($this->form_validation->run() == TRUE)\n\t\t{\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n\t\t\tif($new_group_id)\n\t\t\t{\n\t\t\t\t// check to see if we are creating the group\n\t\t\t\t// redirect them back to the admin page\n\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\t\tredirect(\"/admin/users\", 'refresh');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create group form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['group_name'] = array(\n\t\t\t\t'name' => 'group_name',\n\t\t\t\t'id' => 'group_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\n\t\t\t);\n\t\t\t$this->data['description'] = array(\n\t\t\t\t'name' => 'description',\n\t\t\t\t'id' => 'description',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\n\t\t\t);\n\n\t\t\t$this->template->set('title', 'Users - Create Group');\n\t\t\t$this->template->load('admin/default_layout', 'contents' , 'admin/create_group', $this->data);\n\t\t}\n\t}", "public function addGroup(\\Models\\Group $group) {\n $this->groups[] = $group;\n $group->addFile($this);\n }", "public function createGroup(\n NewGroupRequest $request,\n GroupFollowRepository $groupFollowRep,\n FeaturesRepo $featuresRep,\n GroupAdminRepository $groupAdminRep,\n MemberListRepository $memberListRep\n )\n {\n $user = $request->user();\n $data = $request->all();\n\n $group_data = [\n 'name' => preg_replace('/[^a-z0-9]/', '', $data['name']),\n 'title' => $data['title'],\n 'owner' => $user->id,\n ];\n\n if (!empty($data['cover'])) {\n $group_data['cover'] = $data['cover'];\n }\n\n if (!empty($data['logo'])) {\n $group_data['logo'] = $data['logo'];\n }\n\n if (!empty($data['description'])) {\n $group_data['description'] = $data['description'];\n }\n\n if (!empty($data['no_recommend']) && $data['no_recommend'] ) {\n $group_data['no_recommend'] = 1;\n }\n\n if(in_array($group_data['name'], Constants::reserved_names)){\n return $this->_transformer->fail(40019, 'invalid group name');\n }\n\n $group = Group::where('name', $group_data['name'])->first();\n if($group){\n return $this->_transformer->fail('40002', 'This URL is not available. Please choose another one.');\n }\n\n $title_taken = Group::where('title', $group_data['title'])->first();\n if($title_taken){\n return $this->_transformer->fail('40003', 'Group name is taken.');\n }\n\n try {\n\n DB::beginTransaction();\n\n $group = Group::create($group_data);\n $response_category = array();\n\n if (isset($data['categories'])) {\n $categories = json_decode($data['categories'], true);\n\n foreach ($categories as $key => $category) {\n # code...\n $created_category = Category::create([\n 'name' => trim($category['name']),\n 'group_id' => $group->id,\n 'category_id' => $key + 1,\n// 'parent_id' => '-1',\n ]);\n $response_category[] = $created_category;\n }\n }\n\n $groupFollowRep->followGroup($user->id, $group->id);\n\n //auto open subscribe and share extension\n $featuresRep->switchFeature(Constants::SUBSCRIBE_FEATURE, $group->id, Constants::FEATURE_STATUS);\n $featuresRep->switchFeature(Constants::SHARE_FEATURE, $group->id, Constants::FEATURE_STATUS);\n $featuresRep->switchFeature(Constants::ATTACHMENTS_FEATURE, $group->id, Constants::FEATURE_STATUS);\n $featuresRep->switchFeature(Constants::MODERATOR_FEATURE, $group->id, Constants::FEATURE_STATUS);\n $featuresRep->switchFeature(Constants::GROUP_PRIVACY_FEATURE, $group->id, Constants::FEATURE_STATUS);\n $groupAdminRep->addGroupOwner($user->id, $group->id);\n $memberListRep->addAdminLevelSetting($group->id);\n DB::commit();\n\n return $this->_transformer->success(['group' => $group, 'categories' => $response_category]);\n } catch (\\Exception $e) {\n DB::rollBack();\n// return $this->_transformer->fail(512, $e->getMessage());\n return $this->_transformer->fail(512, 'Server error please try again later');\n }\n }", "function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('group_name','Group Name','required|max_length[255]');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'group_name' => $this->input->post('group_name'),\n\t\t\t\t'tournament_id' => $this->input->post('tournament_id')\n );\n\n \n $group_id = $this->Group_model->add_group($params);\n $this->session->set_flashdata('add_msg', 'The group is added');\n redirect('group/index');\n }\n else\n { \n \n $data['all_tournaments'] = $this->Group_model->get_all_tournaments();\n \n $data['_view'] = 'group/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function addGroupToGroup($id_parent_grp = 0, $id_child_grp = 0)\n\t{\n\t\t// If id values not 0\n\t\tif($id_parent_grp != 0 && $id_child_grp != 0)\n\t\t{\n\t\t\t// Create a new row\n\t\t\t$row = $this->createRow();\n\t\t\t\n\t\t\t// Set id values\n\t\t\t$row->id_parent_grp = $id_parent_grp;\n\t\t\t$row->id_child_grp = $id_child_grp;\n\t\t\t\n\t\t\t// Add row to database\n\t\t\t$row->save();\n\t\t} // end if\n\t}", "public function add() {\r\n\t\tif (isset($_POST['title'])) {\r\n\t\t\t$data[MENUGROUP_TITLE] = trim($_POST['title']);\r\n\t\t\tif (!empty($data[MENUGROUP_TITLE])) {\r\n\t\t\t\tif ($this->db->insert(MENUGROUP_TABLE, $data)) {\r\n\t\t\t\t\t$response['status'] = 1;\r\n\t\t\t\t\t$response['id'] = $this->db->Insert_ID();\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$response['status'] = 2;\r\n\t\t\t\t\t$response['msg'] = Yii::t(\"app\",'Add menu group error.');\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$response['status'] = 3;\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} else {\r\n\t\t\t$this->view('menu_group_add');\r\n\t\t}\r\n\t}", "public function createGroup($name)\n {\n\t\t$table = new USVN_Db_Table_Groups();\n\t\ttry {\n\t\t\t$group = $table->createRow(\n\t\t\t\tarray(\n\t\t\t\t\t\"groups_name\" => \"$name\",\n\t\t\t\t\t\"groups_description\" => \"$name's description\"\n\t\t\t\t)\n\t\t\t);\n\t\t\t$group->save();\n\t\t\treturn $group;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->fail($name . \" : \" . $e->getMessage());\n\t\t}\n }", "function _addLayoutGroup($parentLayGrp, $custLayGrp, $ovServer)\n{\n\t// layout group ($parentLayGrp) on the OV server specified ($ovServer). \n\t//\n\t// Inputs:\n\t//\t$parentLayGrp - parent group. null if assigned to root of tree.\n\t//\t$custLayGrp - custom's layout group name.\n\t//\t$ovServer - OV server to add group.\n\t// Output: none\n\t//\n _log(\"addLayoutGroup: Starting.\",\"info\");\n _log(\"addLayoutGroup: adding group $parentLayGrp/$custLayGrp on $ovServer\",\"info\");\n global $opcdir, $output, $opclaygrp_cmd, $gRoshTimeOut;\n\n if ($parentLayGrp == '')\n {\n\t\t$group = $custLayGrp;\n\t}\n\telse\n\t{\n\t\t$group = $parentLayGrp . '/' . $custLayGrp;\n\t}\n\t$cmd = \"/opsw/bin/rosh -W $gRoshTimeOut -n $ovServer -l root '$opclaygrp_cmd \";\n\t$cmd .= \"-add_lay_group lay_group=$group '\";\n \n _log(\"addLayoutGroup: cmd: $cmd\",\"debug\");\n _execCmdWithRetry($cmd);\n _log(\"output is $output\",\"debug\");\n\n _parseOutputForError($output_array,'ERROR','addLayoutGroup');\n _log(\"addLayoutGroup: Exiting.\",\"info\");\n}", "public function create_group()\n\t{\n\t\t$this->data['title'] = $this->lang->line('create_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('/admin', 'refresh');\n\t\t}\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('create_group_validation_name_label'), 'trim|required|alpha_dash');\n\n\t\tif ($this->form_validation->run() === TRUE)\n\t\t{\n\t\t\t$new_group_id = $this->ion_auth->create_group($this->input->post('group_name'), $this->input->post('description'));\n\t\t\tif ($new_group_id)\n\t\t\t{\n\t\t\t\t// check to see if we are creating the group\n\t\t\t\t// redirect them back to the admin page\n\t\t\t\t$this->session->set_flashdata('success', 'New Group has been created');\n\t\t\t\tredirect(base_url('admin/edit_group/'.$new_group_id), 'refresh');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create group form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['group_name'] = array(\n\t\t\t\t'name' => 'group_name',\n\t\t\t\t'id' => 'group_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('group_name'),\n\t\t\t);\n\t\t\t$this->data['description'] = array(\n\t\t\t\t'name' => 'description',\n\t\t\t\t'id' => 'description',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('description'),\n\t\t\t);\n\n\t\t\t$this->load->view('templates/header',$this->data);\n\t\t\t$this->_render_page('/admin/create_group');\n\t\t\t$this->load->view('templates/footer');\n\t\t}\n\t}" ]
[ "0.833398", "0.8059539", "0.8003178", "0.7954185", "0.79143786", "0.7855398", "0.7850422", "0.7809449", "0.7751934", "0.7666468", "0.7561044", "0.7538178", "0.7520063", "0.75053453", "0.7498945", "0.7494797", "0.7453119", "0.7446156", "0.74053997", "0.7393423", "0.7363377", "0.7349277", "0.730182", "0.730182", "0.7298627", "0.7297505", "0.7291544", "0.7290207", "0.7239893", "0.7238656", "0.72344005", "0.7195409", "0.71549106", "0.7123163", "0.7112169", "0.70903426", "0.70850474", "0.70737845", "0.70588434", "0.70532984", "0.70320374", "0.7026484", "0.70187247", "0.70084953", "0.7004553", "0.6993172", "0.6991951", "0.6985773", "0.6948166", "0.6939431", "0.6924232", "0.69024247", "0.68972206", "0.68817514", "0.6870515", "0.6864984", "0.68579996", "0.68422204", "0.6840664", "0.683542", "0.68262607", "0.6813316", "0.6808536", "0.6806578", "0.680604", "0.6804916", "0.6797686", "0.6789217", "0.6783974", "0.6781947", "0.6779545", "0.67699903", "0.6766874", "0.6754818", "0.6748426", "0.6717908", "0.6715637", "0.6701827", "0.6701827", "0.6691005", "0.6686654", "0.66862965", "0.6680675", "0.6660724", "0.6644966", "0.6638149", "0.66319263", "0.6611448", "0.6610528", "0.6609211", "0.66080743", "0.6600085", "0.6592733", "0.65866613", "0.65783453", "0.6568009", "0.65645945", "0.6558133", "0.6557318", "0.6549944", "0.65479445" ]
0.0
-1
/ function to update group
function update_users($table, $id,$params) { $this->db->where('id',$id); return $this->db->update($table,$params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function update() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'],'tx_passwordmgr_group'),\n\t\t\t$data\n\t\t);\n\t\t$this->checkAffectedRows('updateGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'updateGroup', 'Update group '.$data['name'].' uid '.$this['uid']);\n\t}", "public function UpdateGroup()\n {\n $queryUpdateGroup = \"UPDATE groups SET\n group_name=:group_name,\n description=:description,\n department_id=:department_id\n WHERE id=:group_id\";\n\n $updateGroup = $this->sqlDataBase->prepare($queryUpdateGroup);\n $updateGroup->execute(array(\":group_name\"=>$this->groupName,\":description\"=>$this->description,\":department_id\"=>$this->departmentId,\":group_id\"=>$this->groupId));\n }", "function updateGroup() {\n\t\t$groupId = Request::getUserVar('groupId') === null? null : (int) Request::getUserVar('groupId');\n\t\tif ($groupId === null) {\n\t\t\t$this->validate();\n\t\t\t$group = null;\n\t\t} else {\n\t\t\t$this->validate($groupId);\n\t\t\t$group =& $this->group;\n\t\t}\n\t\t$this->setupTemplate($group);\n\n\t\timport('classes.manager.form.GroupForm');\n\n\t\t$groupForm = new GroupForm($group);\n\t\t$groupForm->readInputData();\n\n\t\tif ($groupForm->validate()) {\n\t\t\t$groupForm->execute();\n\t\t\tRequest::redirect(null, null, 'groups');\n\t\t} else {\n\n\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t$templateMgr->append('pageHierarchy', array(Request::url(null, 'manager', 'groups'), 'manager.groups'));\n\n\t\t\t$templateMgr->assign('pageTitle',\n\t\t\t\t$group?\n\t\t\t\t\t'manager.groups.editTitle':\n\t\t\t\t\t'manager.groups.createTitle'\n\t\t\t);\n\n\t\t\t$groupForm->display();\n\t\t}\n\t}", "public function update(Group $root);", "function update_group($id, array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->update($id, $data);\n\t}", "public function update_field_group($field_group)\n {\n }", "public function testUpdateRuleGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function updateGroup($group)\n {\n return PEAR::raiseError(_(\"Unsupported\"));\n }", "public function testUpdateSupplierGroup()\n {\n }", "public function update() {\r\n\r\n // Does the Group object have an id?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::update(): Attempt to update a Group object that does not have its ID property set.\", E_USER_ERROR );\r\n \r\n // Update 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 $sql = \"UPDATE \" . DB_PREFIX . \"groups SET title = :title, dashboard = :dashboard, content = :content, themes = :themes, files = :files, settings = :settings, users = :users, status = :status WHERE id = :id\";\r\n \r\n $st = $conn->prepare ( $sql );\r\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\r\n $st->bindValue( \":dashboard\", $this->dashboard, PDO::PARAM_INT );\r\n $st->bindValue( \":content\", $this->content, PDO::PARAM_INT );\r\n $st->bindValue( \":themes\", $this->themes, PDO::PARAM_INT );\r\n $st->bindValue( \":files\", $this->files, PDO::PARAM_INT );\r\n $st->bindValue( \":settings\", $this->settings, PDO::PARAM_INT );\r\n $st->bindValue( \":users\", $this->users, PDO::PARAM_INT );\r\n $st->bindValue( \":status\", $this->status, PDO::PARAM_INT );\r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n \r\n }", "function update() {\n\t\t$sql = \"UPDATE umgroup \n\t\t\t\tSET\tGpNameT=?, GpNameE=?, GpDesc=?, GpStID=? \n\t\t\t\tWHERE GpID=?\";\t\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID, $this->GpID));\n\n\t}", "function updateObject(&$group) {\n\t\t$returner = $this->update(\n\t\t\t'UPDATE groups\n\t\t\t\tSET\tseq = ?,\n\t\t\t\t\tassoc_type = ?,\n\t\t\t\t\tassoc_id = ?,\n\t\t\t\t\tabout_displayed = ?,\n\t\t\t\t\tcontext = ?,\n\t\t\t\t\tpublish_email = ?\n\t\t\t\tWHERE\tgroup_id = ?',\n\t\t\tarray(\n\t\t\t\t(float) $group->getSequence(),\n\t\t\t\t(int) $group->getAssocType(),\n\t\t\t\t(int) $group->getAssocId(),\n\t\t\t\t(int) $group->getAboutDisplayed(),\n\t\t\t\t(int) $group->getContext(),\n\t\t\t\t(int) $group->getPublishEmail(),\n\t\t\t\t(int) $group->getId()\n\t\t\t)\n\t\t);\n\t\t$this->updateLocaleFields($group);\n\t\treturn $returner;\n\t}", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_group \n\t \t\t\tSET\tgru_id=?, gru_name=?, gru_head_dept=? \n\t \t\t\tWHERE gru_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->gru_id_new, $this->gru_name, $this->gru_head_dept, $this->gru_id_old));\n\t\t \n\t }", "function MyMod_Item_Update_SGroup($item,$group,$prepost=\"\",$postprocess=TRUE)\n {\n return $this->MyMod_Item_Update_CGI\n (\n $item,\n $this->MyMod_Data_Group_Datas_Get($group,TRUE),\n $prepost,\n $postprocess\n );\n }", "function acf_update_field_group($field_group)\n{\n}", "function set_userGroup($data, $oldId){\n $data_user = array();\n $data_group = array();\n $data_user['id'] = $data['id'];\n $data_user['username'] = $data['username'];\n $data_user['password'] = $data['password'];\n $data_user['email'] = $data['email'];\n\n $group = $data['group'];\n $data['group'] = selectRecord(TAB_GROUPS, \"role = '$group'\")['id'];\n $data_group['userId'] = $data['id'];\n $data_group['groupId'] = $data['group'];\n\n updateRecord(TAB_USR_ROLE, $data_group, \"userId = $oldId\");\n updateRecord(TAB_USERS, $data_user, \"id = $oldId\");\n $data_info = array();\n if($data['group'] == 1){\n $data_info = array();\n $data_info['employment'] = \"-\";\n $data_info['img_address'] = \"upload/user/user-default.png\";\n $data_info['user'] = $data['id'];\n insertRecord(TAB_PERSONALINFO, $data_info);\n }\n}", "function editGroupHandler1() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n ]);\n\n formatOutput(true, 'update success');\n}", "function update( string $_group_key, IIndexedEntity $_entity ): bool;", "function editGroupHandler() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n 'admin_id' => getLogin()['uid']\n ]);\n\n formatOutput(true, 'update success');\n}", "function update_user_group($group_id,$params)\n {\n $this->db->where('gro_id',$group_id);\n return $this->db->update('groups',$params);\n }", "function testUpdateGroups()\n {\n $data = array(3);\n $this->GroupEvent->updateGroups(1, $data);\n $searched = $this->GroupEvent->find('all', array('conditions' => array('event_id' => 1)));\n $this->assertEqual(count($searched), 1);\n $this->assertEqual($searched[0]['GroupEvent']['group_id'], 3);\n $this->assertEqual($searched[0]['GroupEvent']['event_id'], 1);\n\n // single group\n $this->GroupEvent->updateGroups(1, 1);\n $searched = $this->GroupEvent->find('all', array('conditions' => array('event_id' => 1)));\n $this->assertEqual(count($searched), 1);\n\n // invalid group\n $incorrectData = $this->GroupEvent->updateGroups(1, null);\n $this->assertFalse($incorrectData);\n }", "public function updateViaRequest()\n {\n return groups()->updateGroupViaRequest($this);\n }", "public function updateGroup() {\n if(!$this->request->is('restful')) {\n try {\n $this->CoGroupMember->updateGroupMemberships($this->request->data['CoGroupMember']['co_group_id'],\n $this->request->data['CoGroupMember']['rows'],\n $this->Session->read('Auth.User.co_person_id'));\n \n $this->Flash->set(_txt('rs.saved'), array('key' => 'success'));\n }\n catch(Exception $e) {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n }\n \n // Issue redirect\n \n $this->redirect(array('controller' => 'co_groups',\n 'action' => 'edit',\n $this->request->data['CoGroupMember']['co_group_id'],\n 'co' => $this->cur_co['Co']['id']));\n }\n }", "function update_user_group($update_user_group, $update_other_user_id) {\n $this->db->where('user_id', $update_other_user_id);\n $this->db->update('users_groups', $update_user_group);\n //echo $this->db->last_query();\n }", "function updateGroup($groupId, $groupName, $description, $type, $db) {\n strip_tags($groupName);\n strip_tags($description);\n strip_tags($type);\n\n $qString = ('UPDATE groups SET name = :name, description = :description, projectType = :type WHERE id = :groupId');\n $stm = $db -> prepare($qString);\n\n if ($stm -> execute( array(':name' => $groupName, ':description' => $description, ':type' => $type, ':groupId' => $groupId))) {\n if(addToGroup($userId, $db, getGroupId($groupName, $db), true)) {\n echo \"<meta http-equiv='REFRESH' content='0;url=/?page=group'>\";\n } else {\n echo 'couldnt add to group!';\n }\n } else {\n print_r($stm->errorInfo());\n }\n}", "function Inscription_Group_Update($group,&$inscription)\n {\n if (!empty($inscription[ \"ID\" ]))\n {\n $inscription=\n $this->MyMod_Item_Update_CGI\n (\n $inscription,\n $this->MyMod_Data_Group_Datas_Get($group,TRUE),\n $prepost=\"\"\n );\n }\n \n return $inscription;\n }", "function db_update_group_info($gid, $fields)\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\n\t\treturn FALSE;\n\n\t$new = $old;\n\t$updates = array();\n\t$bind_fmt = \"\";\n\t$bind_values = array();\n\n\tforeach (array('parent', 'name') as $f)\n\t{\n\t\tif (array_key_exists($f, $fields))\n\t\t{\n\t\t\t$new[$f] = $fields[$f];\n\t\t}\n\t}\n\n\t$query = \"UPDATE `groups` SET parent=?, name=? WHERE id=?\";\n\t$stmt = $dbh->prepare($query);\n\t$result = $stmt->bind_param(\"isi\",\n\t\t$new['parent'],\n\t\t$new['name'],\n\t\t$gid);\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n\t$result = $stmt->execute();\n\t$stmt->close();\n\tif (!$result)\n\t{\n\t\tglobal $db_errno;\n\t\t$db_errno = $dbh->errno;\n\t\tglobal $db_errmsg;\n\t\t$db_errmsg = $dbh->error;\n\n\t\treturn NULL;\n\t}\n}", "public function updateGroup(Request $request, $groupId) {\n $user = $request->get('auth');\n $newGroup = (object) $request->input('group');\n $immunity = User::getImmunity($user->userId);\n\n $group = Group::find($groupId);\n\n Condition::precondition(!$group, 404, 'Group do not exist');\n Condition::precondition($group->immunity >= $immunity, 400, 'This group have higher immunity then u!');\n Condition::precondition(\n $newGroup->immunity >= $immunity || $newGroup->immunity < 0,\n 404,\n 'Immunity can only be 0 to '.($immunity - 1)\n );\n Condition::precondition(empty($newGroup->name), 400, 'A group needs to have a name!');\n\n $nameIsUnique = Group::withName($newGroup->name)->where('groupId', '!=', $groupId)->count('groupId') == 0;\n Condition::precondition(!$nameIsUnique, 400, 'Name needs to be unique');\n\n $isNameColorSet = isset($newGroup->nameColor) && !empty($newGroup->nameColor);\n Condition::precondition($isNameColorSet && !Value::validateHexColors([$newGroup->nameColor]), 400, 'Invalid Hex Color!');\n $newGroup->nameColor = $isNameColorSet ? json_encode([$newGroup->nameColor]) : '';\n\n $newGroup->sitecpPermissions = $this->convertSitecpPermissions($user, $newGroup, $group->sitecpPermissions);\n $newGroup->staffPermissions = $this->convertStaffPermissions($user, $newGroup, $group->staffPermissions);\n $newGroup->options = $this->convertGroupOptions($newGroup);\n\n Group::where('groupId', $groupId)->update(\n [\n 'name' => $newGroup->name,\n 'nickname' => Value::objectProperty($newGroup, 'nickname', ''),\n 'nameColor' => Value::objectProperty($newGroup, 'nameColor', $group->nameColor),\n 'userBarStyling' => Value::objectProperty($newGroup, 'userBarStyling', $group->userBarStyling),\n 'immunity' => $newGroup->immunity,\n 'sitecpPermissions' => $newGroup->sitecpPermissions,\n 'staffPermissions' => $newGroup->staffPermissions,\n 'options' => $newGroup->options,\n 'isPublic' => Value::objectProperty($newGroup, 'isPublic', $group->isPublic),\n 'avatarHeight' => Value::objectProperty($newGroup, 'avatarHeight', 0),\n 'avatarWidth' => Value::objectProperty($newGroup, 'avatarWidth', 0)\n ]\n );\n\n GroupUpdated::dispatch($groupId);\n\n Logger::sitecp(\n $user->userId,\n $request->ip(),\n LogType::UPDATED_GROUP,\n [\n 'group' => $group->name,\n 'sitecpPermissionsBefore' => $this->buildSitecpPermissions($user, $group),\n 'sitecpPermissionsAfter' => $this->buildSitecpPermissions($user, $newGroup),\n 'staffcpPermissionsBefore' => $this->buildStaffPermissions($user, $group),\n 'staffcpPermissionsAfter' => $this->buildStaffPermissions($user, $newGroup)\n ],\n $group->groupId\n );\n return $this->getGroup($request, $groupId);\n }", "public function update(Request $request, Group $group)\n {\n //\n }", "public function update(Request $request, Group $group)\n {\n //\n }", "public function update(Request $request, Group $group)\n {\n //\n }", "function acf_update_field_group( $field_group ) {\n\treturn acf_update_internal_post_type( $field_group, 'acf-field-group' );\n}", "public function update_customer_group($data,$id){\n\t\t\n\t\t\t$this->db->where('id',$id);\n\t\t\t$this->db->update('customer_group',$data);\n\t\t\tredirect('Customer/Customer_group');\n\t\t\n\t}", "function update($post) {\n\t\tglobal $fmdb, $__FM_CONFIG;\n\t\t\n\t\t/** Validate entries */\n\t\t$post = $this->validatePost($post);\n\t\tif (!is_array($post)) return $post;\n\t\t\n\t\t$exclude = array('submit', 'action', 'group_id', 'AUTHKEY');\n\n\t\t$sql_edit = null;\n\t\t\n\t\tforeach ($post as $key => $data) {\n\t\t\tif (!in_array($key, $exclude)) {\n\t\t\t\t$sql_edit .= $key . \"='\" . sanitize($data) . \"', \";\n\t\t\t}\n\t\t}\n\t\t$sql = rtrim($sql_edit, ', ');\n\t\t\n\t\t// Update the group\n\t\t$old_name = getNameFromID($post['group_id'], 'fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', 'group_', 'group_id', 'group_name');\n\t\t$query = \"UPDATE `fm_{$__FM_CONFIG[$_SESSION['module']]['prefix']}groups` SET $sql WHERE `group_id`={$post['group_id']} AND `account_id`='{$_SESSION['user']['account_id']}'\";\n\t\t$result = $fmdb->query($query);\n\t\t\n\t\tif ($fmdb->sql_errors) {\n\t\t\treturn formatError(_('Could not update the group because a database error occurred.'), 'sql');\n\t\t}\n\t\t\n\t\t/** Return if there are no changes */\n\t\tif (!$fmdb->rows_affected) return true;\n\n//\t\tsetBuildUpdateConfigFlag(getServerSerial($post['group_id'], $_SESSION['module']), 'yes', 'build');\n\t\t\n\t\taddLogEntry(\"Updated {$post['group_type']} group '$old_name' to:\\nName: {$post['group_name']}\\n\" .\n\t\t\t\t\t\"Comment: {$post['group_comment']}\");\n\t\treturn true;\n\t}", "public function setGroup($group) {}", "public function setGroup($group) {}", "public function updateGroup(Request $request, $id){\n try{\n $group = Group::find($id);\n $group->title = $request->input('group_name');\n $group->category = $request->get('group_category');\n $group->child_count = $request->get('child_count');\n $group->first_mentor_id = $request->get('first_mentor');\n $group->second_mentor_id = $request->get('second_mentor');\n\n $group->save();\n\n }catch(QueryException $e){\n \\Session::flash('oops', trans('messages.please_fill_fields'));\n return \\Redirect('manager/groups/'.$group->id);\n }\n\n \\Session::flash('message', trans('messages.successfully_updated'));\n\n return \\Redirect('manager/groups');\n }", "public function rebuild($group_id);", "public function testRenameGroup(){\n jAcl2DbUserGroup::updateGroup(self::$grpId3, 'newgroup3');\n self::$groups[2]['name']='newgroup3';\n $this->assertTableContainsRecords('jacl2_group', self::$groups);\n }", "public function SetGroup($group,$value){\n if($this->_groups[$group][\"currentGroup\"]!=$value){\n if($this->_groups[$group][\"currentGroup\"]!=\"?\"){\n if(isset($this->_groups[$group][\"afterGroup\"])){\n $this->Ln(4);\n $function = array($this->_groups[$group][\"afterGroup\"][\"class\"],$this->_groups[$group][\"afterGroup\"][\"callback\"]);\n $params = array($this,$value);\n call_user_func_array($function,$params);\n }\n $this->Sum();\n }\n if(isset($this->_groups[$group][\"beforeGroup\"])){\n if(($this->GetY() + 22) > ($this->h - 10)){ //22 Altura de una cabecera de grupo\n $this->_changePage = false;\n $this->AddPage();\n }\n $this->Ln(6);\n $this->SetTextColor(100);\n $this->SetFont('Arial','B',11);\n $function = array($this->_groups[$group][\"beforeGroup\"][\"class\"],$this->_groups[$group][\"beforeGroup\"][\"callback\"]);\n $params = array($this,$value);\n $this->_groups[$group][\"currentMsg\"] = call_user_func_array($function,$params);\n $this->Ln(4);\n }\n $this->_groups[$group][\"currentGroup\"] = $value;\n $this->pages[$this->PageNo()] = str_replace(\"{grp_$group}\",$this->_groups[$group][\"currentMsg\"],$this->pages[$this->PageNo()]);\n $this->__Header();\n $this->_changePage = false;\n $this->SumRe();\n }else{\n $this->_changePage = true;\n }\n }", "public function testUpdateLanguageGroup() {\n foreach ($this->testCases['LanguageGroup'] as $key => $testCase) {\n $langGroup = new LanguageGroup();\n $langGroup->setGroupName($testCase['group_name']);\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('updateLanguageGroup')\n ->will($this->returnValue(TRUE));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->updateLanguageGroup($langGroup);\n $this->assertTrue($result);\n }\n }", "public function switchGroup($group);", "public function updateGroup($groupId, $request)\n {\n return $this->start()->uri(\"/api/group\")\n ->urlSegment($groupId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "function set_cur_group($group) {\n\t\tlgi_mysql_query(\"UPDATE %t(usergroups) SET `dfl`=(`name`='%%') WHERE `usercertid`=(SELECT `id` FROM %t(usercerts) WHERE `user`='%%')\", $group, $this->userid);\n\t\t$_SESSION['dfl_group'] = $group;\n\t}", "public function updateGroup(ItemRequest $request,$id)\n {\n \n }", "function system_remfrom_group($paramv)\n{\n\t\n}", "public function addGroup($group) {}", "public function update(Request $request,$group, $id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $user_id = auth() -> user() -> id;\n $group = Group::findOrfail($id);\n\n // access control - only the moderator can edit the group\n if (strtolower($group -> status) == 'p' && $user_id != $group -> moderator_id) abort(404);\n if ($user_id != $group -> moderator_id) abort(403);\n\n\n // 1.1. it is not allowed to create two groups with the same name\n $checker = Group::where('name', $request -> input('name')) -> get();\n if (sizeof($checker) > 0)\n {\n return view('groups.create') -> with('validation_failed', __('messages.group_store_failed'));\n }\n\n\n // the same validation as on store\n $this -> validate($request, [\n 'name' => 'required | max: 32',\n 'description' => 'required',\n 'group_img' => 'image | nullable | max: 1999'\n ]);\n\n\n\n $user = User::find($user_id);\n // handle file upload (only if a new file is provided)\n if ($request -> hasFile('group_img'))\n {\n // 1. delete the old file\n if (strtolower($group -> img) != 'no_image.jpg') Storage::delete('public/imgs_g/' . $group -> img);\n\n // 2. process the new file\n // get filename with the extension\n $fileNameWithExt = $request -> file('group_img') -> getClientOriginalName();\n // get just file name\n $fileName = pathinfo($fileNameWithExt, PATHINFO_FILENAME);\n // get just extension\n $ext = $request -> file('group_img') -> getClientOriginalExtension();\n $fileNameToStore = $user_id . $fileName . '_' . time() . '.' . $ext;\n \n // upload the image\n $path = $request -> file('group_img') -> storeAs('public/imgs_g/', $fileNameToStore);\n }\n\n\n // update the group info\n $group -> name = $request -> input('name');\n $group -> description = $request -> input('description');\n // update the image only if a new image is provided\n if ($request -> hasFile('group_img')) $group -> img = $fileNameToStore;\n // set status to \"pending\" only if the request had been rejected by the administrator\n // update a request to the administrator\n $stats = array('p', 'r');\n if (in_array(strtolower($group -> status), $stats))\n {\n $group -> status = 'p';\n\n $admin_req = $group -> adminNotification() -> get();\n if (sizeof($admin_req) > 0)\n {\n // initial request is available\n $admin_req = $admin_req -> first();\n $admin_req -> title = 'Updated Group Request';\n $admin_req -> message = 'I have made the corrections. Could you please review the group one more time ?';\n $admin_req -> status = 'n';\n $admin_req -> save();\n }\n else\n {\n // initial request has been deleted\n $admin_req = new AdminNotification;\n $admin_req -> name = $user -> name;\n $admin_req -> email = $user -> email;\n $admin_req -> title = 'Updated Group Reques';\n $admin_req -> message = 'I have made the corrections. Could you please review the group one more time ?';\n $admin_req -> status = 'n';\n $admin_req -> type = '1';\n $admin_req -> group_id = $group -> id;\n $admin_req -> save();\n }\n }\n \n $group -> save();\n\n unset($group, $admin_req, $user, $user_id);\n return redirect('/dashboard/groups') -> with('success', __('messages.group_update_success'));\n }", "public function Group($field,$group){\n $this->_groups[$field] = array_merge($group,array(\"currentGroup\" => \"?\", \"currentMsg\" => \"\"));\n }", "function system_addto_group($paramv)\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 }", "function updateNotesGroupRelation($notesid,$groupname)\n\t\t{\n\t\t\tglobal $log;\n\t\t\t$log->debug(\"Entering updateNotesGroupRelation(\".$notesid.\",\".$groupname.\") method ...\");\n\t\t\tglobal $adb;\n\t\t\t$sqldelete = \"delete from ec_notesgrouprelation where notesid=\".$notesid;\n\t\t\t$adb->query($sqldelete);\n\t\t\tif(!empty($groupname)) {\n\t\t\t\t$sql = \"insert into ec_notesgrouprelation values (\".$notesid .\",'\" .$groupname .\"')\";\n\t\t\t\t$adb->query($sql);\n\t\t\t}\n\t\t\t$log->debug(\"Exiting updateNotesGroupRelation method ...\");\n\t\t}", "protected function update(){\n\t\t$this->aggregations = array();\n\t\t\n\t\t// also update any groups\n\t\tforeach($this->getGroups() as $group){\n\t\t\t$group->update();\n\t\t}\n\t}", "public function updateGroupInfo(UpdateGroupRequest $request, CategoryRepository $categoryRepo, GroupAdminRepository $groupAdminRep)\n {\n $user = $request->user();\n\n// $admin_list = Admin::select('user_id')->get()->toArray();\n// $admin_list = array_pluck($admin_list, 'user_id');\n $admin_list = [];\n $data = $request->all();\n $group = Group::find($data['group_id']);\n if (\n $group->owner != $user->id \n and !in_array($user->id, $admin_list)\n && !$groupAdminRep->checkGroupAdmin($data['group_id'], $user->id, 2)\n ) {\n return $this->_transformer->noPermission();\n }\n\n // $new_name = preg_replace('/[^\\w\\d]/', '', $request->name);\n\n if($group->title != $request->title){\n\n if(in_array($request->title, Constants::reserved_names)){\n return $this->_transformer->fail(40019, 'Invalid group name.');\n }\n\n $new_name_occupy = Group::where(\"title\", $request->title)->first();\n if(!empty($new_name_occupy)){\n return $this->_transformer->fail(512, 'Group name is taken.');\n }\n }\n\n try {\n\n DB::beginTransaction();\n\n $group_updated = tap($group)->update($request->only('title', 'description', 'cover', 'logo','no_recommend'));\n\n if (isset($data['categories'])) {\n $old_category_tree = $categoryRepo->getCategoryTree($group->id);\n $old_categories = [];\n\n foreach ($old_category_tree as $old_category){\n $old_categories[$old_category->category_id] = $old_category->name;\n }\n\n $id_delete = array_keys($old_categories);\n\n $new_categories = json_decode($data['categories'], true);\n\n if(count($new_categories) > 20 ){\n if(count($old_categories) < count($new_categories) ){\n throw new Exception('no more than 20 Categories');\n }\n }\n\n $name_ary = [];\n foreach ($new_categories as $category){\n if(in_array($category['name'],$name_ary)){\n throw new \\Exception('The same categories name is not allowed');\n }\n $name_ary[] = $category['name'];\n }\n\n foreach ($new_categories as $category) {\n\n // update a category\n if (!empty($category['id'])) {\n $delete_index = array_search($category['id'], $id_delete);\n // this statement shall always be true, keep it here to be prudent\n if ($delete_index !== false) {\n // this category not to be deleted\n unset($id_delete[$delete_index]);\n\n if ($category['name'] !== $old_categories[$category['id']]) {\n $categoryRepo->updateCategory($group->id, $category['id'], $category['name']);\n }\n }\n } else {\n $categoryRepo->addCategory($group->id, trim($category['name']));\n }\n }\n\n // delete some category\n if (count($id_delete)){\n foreach ($id_delete as $id){\n $categoryRepo->deleteCategory($group->id, $id);\n }\n }\n }\n\n\n if(isset($request->super_no_recommend)){\n\n// $admin_list = Admin::select('user_id')->get()->toArray();\n// $admin_list = array_pluck($admin_list, 'user_id');\n $admin_list = [];\n if(!in_array($user->id, $admin_list)){\n return $this->_transformer->noPermission();\n }\n\n $group_updated = tap($group_updated)->update(['super_no_recommend' => $request->super_no_recommend ? 1 : 0]);\n }\n\n DB::commit();\n\n return $this->_transformer->success(['group' => $group_updated, 'categories' => $categoryRepo->getCategoryTree($group->id)]);\n } catch (\\Exception $e) {\n DB::rollBack();\n return $this->_transformer->fail(512, $e->getMessage());\n }\n }", "public function updateGroup($old_group, $new_group)\n {\n $em = $this->doctrine->getEntityManager();\n $group = $em->getRepository('CmarMeetingBundle:Group')->findOneBy(array('key' => $old_group->{'key'}));\n $meeting = $em->getRepository('CmarMeetingBundle:Meeting')->findOneByStatesAndTitle(array(Meeting::STATE_NOW, Meeting::STATE_NEW, Meeting::STATE_LOCKED), $old_group->{'name'});\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, $new_group);\n $errors = $this->validator->validate($group);\n if (count($errors) > 0) {\n throw new \\LogicException(\"Validation Exception \\\"\" . $errors[0]->getPropertyPath() . \"\\\": \" . $errors[0]->getMessageTemplate(), -1);\n } \n \n $principal_id_group = $this->adoAdmin->principalFindGroupByName($old_group->{'name'});\n $out = $this->adoAdmin->getScoByUrl($meeting->getUrl());\n $sco_id_meeting = (integer)$out->{'sco'}->attributes()->{'sco-id'};\n $xml = $this->adoAdmin->principalUpdateforType($new_group->{'name'}, 'group', $new_group->{'description'}, $principal_id_group);\n $xml = $this->adoAdmin->scoUpdate($meeting, $new_group, $sco_id_meeting);\n\n $meeting->setTitle($new_group->{'name'});\n $meeting->setDescription($new_group->{'description'});//Si la descripcion es null la cambia\n if ($new_group->{'type'} != null){\n if ($new_group->{'type'} == 'public'){\n $meeting->setPublic(true);\n } elseif ($new_group->{'type'} == 'private'){\n $meeting->setPublic(false);\n }\n }\n $em->persist($meeting);\n $em->persist($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 update(Request $request, Group $group)\n {\n //\n $validator = Validator::make($request->all(), [\n 'group_name' => ['required', 'min:1', 'max:255'],\n ]);\n if ($validator->fails())\n return response()->json($validator->messages(), 400);\n\n foreach ($request->only(['group_name']) as $key => $value)\n $group->$key = $value;\n $group->save();\n\n return static::groupFilterOutFields($group);\n }", "public function testUpdateSurveyGroup()\n {\n $surveyGroup = SurveyGroup::factory()->create();\n\n $response = $this->json('PATCH', \"survey-group/{$surveyGroup->id}\", [\n 'survey_group' => [ 'title' => 'Fork Your Survey' ]\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey_group', [ 'id' => $surveyGroup->id, 'title' => 'Fork Your Survey' ]);\n }", "public function group($group);", "public function update(UpdateGroupRequest $request,Group $group)\n {\n $group->name = $request->name;\n $group->note = $request->note;\n\n $group->save();\n\n return $this->showOne($group, 200);\n }", "function setGroup($groupId) { \n\t\t$this->success = false;\n\t\tif (!$this->get('id')) {\n\t\t\n\t\t\t$this->throwError(\"Content not saved yet!\");\n\t\t\t$this->error_code = 500;\n\t\t\treturn;\n\t\t}\t\t\n\t\tif (!$this->POD->isAuthenticated()) { \n\t\t\t$this->throwError(\"Access denied\");\n\t\t\t$this->error_code = 401;\n\t\t\treturn;\n\t\t}\t\n\t\t\t\n\t\tif ($groupId == \"\" || !$groupId) { \n\t\t\t$group = $this->POD->getGroup(array('id'=>$this->get('groupId')));\t\n\t\t} else {\n\t\t\t$group = $this->POD->getGroup(array('id'=>$groupId));\n\t\t}\t\n\t\t\n\t\tif (!$group->success()) { \n\t\t\t$this->throwError($group->error());\n\t\t\t$this->error_code = $group->errorCode();\n\t\t\treturn;\t\t\n\t\t}\t\t\n\t\t$membership = $group->isMember($this->POD->currentUser());\n\t\tif ($group->success()) { \n\t\t\tif (!($membership == \"owner\" || $membership == \"manager\")) { \n\t\t\t\t$this->throwError(\"Access denied: Insufficient Group Privileges\");\n\t\t\t\treturn;\t\t\n\t\t\t}\n\t\t} else {\n\t\t\t$this->throwError(\"Couldn't check membership: \" . $group->error());\n\t\t\treturn;\n\t\t}\t\t\t\n\t\t$this->set('groupId',$groupId);\n\t\t\n\t\tif ($groupId == '') { \n\t\t\t$groupId = \"NULL\";\n\t\t} else {\n\t\t\t$groupId= \"'\" . mysql_real_escape_string($groupId) . \"'\";\n\t\t}\n\t\t$privacy = mysql_real_escape_string($this->get('privacy'));\n\t\t\n\t\t$sql = \"UPDATE content SET groupId=$groupId, privacy='$privacy', changeDate=NOW() where id=\" . $this->get('id');\n\t\t$this->POD->tolog($sql,2);\n\t\t$result = mysql_query($sql,$this->POD->DATABASE);\t\n\t\t$num = mysql_affected_rows($this->POD->DATABASE);\t\n\t\tif ($num < 1 || !$result) {\n\t\t\t$this->success = false;\n\t\t\t$this->throwError(\"SQL Error: Set group failed!\");\n\t\t\t$this->error_code = 500;\n\t\t\treturn null;\n\t\t} else {\n\t\t\t$this->success = true;\n\t\t\t$this->POD->cachestore($this);\n\t\t\treturn $this;\n\t\t}\n\n\t}", "function dbUpdateGroup($group_id, $name, $is_default, $home_page_id){\n try {\n\n\t\t// Make sure group exists\n\t\tif (!groupIdExists($group_id)){\n\t\t\taddAlert(\"danger\", lang(\"GROUP_INVALID_ID\"));\n\t\t\treturn false;\n\t\t}\n\n $db = pdoConnect();\n\n global $db_table_prefix;\n\n // If this group is being set as the primary default group, then the current primary default group must be reset\n if ($is_default == '2'){\n\t\t\t$stmt_reset = $db->prepare(\"UPDATE \".$db_table_prefix.\"groups\n SET is_default = '1'\n WHERE\n is_default = '2'\");\n\t\t\t$stmt_reset->execute();\n\t\t}\n\n\t\t$stmt = $db->prepare(\"UPDATE \".$db_table_prefix.\"groups\n SET name = :name, is_default = :is_default, home_page_id = :home_page_id\n WHERE\n id = :group_id\n LIMIT 1\");\n\n $sqlVars = array(\":group_id\" => $group_id, \":name\" => $name, \":is_default\" => $is_default, \":home_page_id\" => $home_page_id);\n\n if ($stmt->execute($sqlVars)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\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}", "public Static function updateUserGroup($gid, $gDesc);", "public function UpdateGroup(AffinityGroupModel $model)\n {\n // Check to see if the group doesn't exist\n if(!$this->DoesGroupExistByID($model->getID())) return FALSE;\n\n // Check to see if the group properties haven't changed\n if($this->GetGroupByID($model->getID())->Equals($model)) return TRUE;\n\n // Check to see if the group name was taken by another group\n $nameCheck = $this->GetGroupIDByName($model->getGroupName());\n if($nameCheck != FALSE)\n {\n // Check to see if the id numbers don't match\n if($nameCheck != $model->getID()) return FALSE;\n }\n\n\n // Convert $model to array\n $valuesArray =\n [\n 'GroupName' => $model->getGroupName(),\n 'GroupDescription' => $model->getGroupDescription()\n ];\n\n // Insert the model into the table\n $result = DB::table($this->table)->where('ID', $model->getId())->update($valuesArray);\n\n // Was more then one row updated\n if($result > 1)\n {\n // Send message to admins about the issue\n // {code}\n\n // Check to see if the row was updated correctly\n if($this->GetGroupByID($model->getId())->Equals($model)) return TRUE;\n else return FALSE;\n }\n // If there was no rows effected\n else if($result < 1) return FALSE;\n // If there was only one row effected\n else if($result == 1) return TRUE;\n // If any other result happed\n else\n {\n // Send message to admins about the issue\n // {code}\n\n return FALSE;\n }\n }", "public function update($id)\n\t{\n\t\t//\n\t\t$groupUpdate = Request::only('group_name','group_code','group_description');\n $validate = Validator::make($groupUpdate,[\n 'group_name' => 'required|max:45',\n 'group_code' => 'required|unique:cep_groups,group_code,'.$id.',group_id|max:5',\n ]);\n\n if($validate->fails()){\n return redirect()->back()->withInput()->withErrors($validate->errors());\n }\n\t\t$group = CepGroups::where('group_id',$id)->first();\n\t\t$affectedRows = CepGroups::where('group_id','=',$id)->update($groupUpdate);\n\t\treturn redirect(\"groups\");\n\t}", "final public function setGroup($value) {\n\t\t$this->group = $value;\n\t}", "function groups_collections_update($item, $selected_groups, $existing_groups, $relationship) {\n\t$add_groups = array_diff($selected_groups , $existing_groups);\n\t$rem_groups = array_diff($existing_groups, $selected_groups);\n\t\n\t$add_groups = array_unique($add_groups);\n\t$add_groups = array_values($add_groups);\n\t$rem_groups = array_unique($rem_groups);\n\t$rem_groups = array_values($rem_groups);\n\t$guid_two = $item->getguid();\n\t\n\tforeach($add_groups as $group){\n\t\t$guid_one = $group;\n\t\tif(!check_entity_relationship($guid_one, $relationship, $guid_two)){\n\t\t\tadd_entity_relationship($guid_one, $relationship, $guid_two);\n\t\t}\t\t\n\t}\n\tforeach($rem_groups as $group){\n\t\t$guid_one = $group;\n\t\tremove_entity_relationship($guid_one, $relationship, $guid_two);\n\t}\n}", "public function update_group($id)\n { \n if ($this->input->post() && has_permission('inventory_items', '', 'edit')) {\n $data = array(\n 'value' => $this->input->post('name'),\n //'updated_at' => date('Y-m-d H:i:s'),\n );\n $update = $this->inventory_model->edit_group('tblcustom', $data, $id);\n load_admin_language();\n if($update)\n {\n set_alert('success', 'Inventory Updated successfully!'); \n }\n else\n {\n set_alert('warning', 'There is problem while updating Inventory');\n }\n }\n }", "function new_groups()\n {\n \n }", "public function flush_group($group)\n {\n }", "public function save(Group $group){\n\t\tif (!is_null($group->getId())){\n\t\t\t\n\t\t\techo \"update:\\n\";\n\t\t\t$update = \"UPDATE t_groupe SET gro_name=:groupname,gro_password=:grouppassword,gro_temp_key= :key WHERE gro_id=:groupid\";\n\t\t\t$query = $this->getDb()->prepare($update);\n\t\t\t\n\t\t\t$query->bindValue(':groupid', $group->getId());\n\t\t\t$query->bindValue(':groupname', $group->getGroupname());\n\t\t\t$query->bindValue(':grouppassword', $group->getPassword());\n\t\t\t$query->bindValue(':key', $group->getKey());\n\t\t\t\n\t\t\t$query->execute();\n\t\t\t\n\t\t\tif($query->errorCode() != \"00000\");\n\t\t\tvar_dump($query->errorInfo());\n\t\t\treturn $group;\n\t\t}\n\t\t\n\t\t// If not, I create a new group\n\t\telse { \n\t\t\techo \"create:\\n\";\n\t\t\t$create = \"INSERT INTO t_groupe(gro_name, gro_password,gro_temp_key) VALUES (:groupname,:grouppassword, 0)\";\n\t\t\t$query = $this->getDb()->prepare($create);\n\t\t\t\n\t\t\t$query->bindValue(':groupname', $group->getGroupname());\n\t\t\t$query->bindValue(':grouppassword', $group->getPassword());\n \n\t\t\t\n\t\t\t$query->execute();\n\t\t\t\n\t\t\t$group->setId($this->getDb()->lastInsertId());\n\t\t\tvar_dump($group);\n\t\t\treturn $group;\n\t\t}\n\t}", "function timeconditions_timegroups_edit_group($timegroup,$description) {\n\tglobal $db;\n\n\t$sql = \"update timegroups_groups set description = '$description' where id = $timegroup\";\n\t$db->query($sql);\n\tneedreload();\n}", "public function editGroupController()\n {\n // mazání\n if($this->getRequestParam('action', false) == 'delete'\n && $this->getRequestParam('id', false) != null){\n (new Shop_Model_AttributesGroups())->delete($this->getRequestParam('id'));\n $this->infoMsg()->addMessage($this->tr('Skupina byla smazána'));\n $this->link()->rmParam('action')->rmParam('id')->redirect();\n }\n // přesun\n else if($this->getRequestParam('action', false) == 'changepos'\n && $this->getRequestParam('id', false) != null\n && $this->getRequestParam('pos', false) != null\n ){\n Shop_Model_AttributesGroups::changeOrder(\n $this->getRequestParam('id'),\n $this->getRequestParam('pos')\n );\n\n $this->infoMsg()->addMessage($this->tr('Skupina byla přesunuta na novou pozici'));\n $this->link()\n ->rmParam('action')\n ->rmParam('id')\n ->rmParam('pos')\n ->redirect();\n }\n\n // úprava a přidání\n $this->formEditGroup();\n }", "function olc_set_groups($categories_id,$shops) {\n\t$products_query=olc_db_query(\"SELECT products_id FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\"\n\twhere categories_id='\".$categories_id.APOS);\n\twhile ($products=olc_db_fetch_array($products_query)) {\n\t\tolc_db_query(SQL_UPDATE.TABLE_PRODUCTS.\" SET group_ids='\".$shops.\"'\n\t\twhere products_id='\".$products['products_id'].APOS);\n\t}\n\t// set status of categorie\n\tolc_db_query(SQL_UPDATE . TABLE_CATEGORIES . \" set group_ids = '\".$shops.\"'\n\twhere categories_id = '\" . $categories_id . APOS);\n\t// look for deeper categories and go rekursiv\n\t$categories_query=olc_db_query(\"SELECT categories_id FROM \".TABLE_CATEGORIES.\"\n\twhere parent_id='\".$categories_id.APOS);\n\twhile ($categories=olc_db_fetch_array($categories_query)) {\n\t\tolc_set_groups($categories['categories_id'],$shops);\n\t}\n\n}", "function editGroup($args = array()) {\n\t\t$groupId = isset($args[0])?(int)$args[0]:null;\n\t\t$this->validate($groupId);\n\t\t$journal =& Request::getJournal();\n\n\t\tif ($groupId !== null) {\n\t\t\t$groupDao =& DAORegistry::getDAO('GroupDAO');\n\t\t\t$group =& $groupDao->getById($groupId, ASSOC_TYPE_JOURNAL, $journal->getId());\n\t\t\tif (!$group) {\n\t\t\t\tRequest::redirect(null, null, 'groups');\n\t\t\t}\n\t\t} else $group = null;\n\n\t\t$this->setupTemplate($group, true);\n\t\timport('classes.manager.form.GroupForm');\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t$templateMgr->assign('pageTitle',\n\t\t\t$group === null?\n\t\t\t\t'manager.groups.createTitle':\n\t\t\t\t'manager.groups.editTitle'\n\t\t);\n\n\t\t$groupForm = new GroupForm($group);\n\t\tif ($groupForm->isLocaleResubmit()) {\n\t\t\t$groupForm->readInputData();\n\t\t} else {\n\t\t\t$groupForm->initData();\n\t\t}\n\t\t$groupForm->display();\n\t}", "private function setCustomerGroupValue()\n {\n $value = $this->getData(self::$groupAttributeCode);\n try {\n $group = $this->groupRepository->getById($value);\n $this->setCustomAttribute(self::$groupAttributeCode, $group->getCode());\n } catch (NoSuchEntityException $e) {\n $this->setCustomAttribute(self::$groupAttributeCode, 'N/A');\n }\n }", "public function update(Request $request, $id = null)\n\t{\n\t\t$result = AccountGroup::find($id);\n\t\tif (!$result) {\n\t\t\treturn validationResponse(false, 206, \"\", \"\", lang('messages.invalid_id'));\n\t\t}\n\n\t\t$inputs = $request->all();\n\t\t$validator = (new AccountGroup)->validateAccountGroup($inputs, $id);\n\t\tif ($validator->fails()) {\n\t\t\treturn validationResponse(false, 206, \"\", \"\", $validator->messages());\n\t\t}\n\n\t\ttry {\n\t\t\t\\DB::beginTransaction();\n\t\t\t$parentGroup = $inputs['parent_group'];\n\t\t\tunset($inputs['parent_group']);\n\t\t\t$primary = 0;\n\t\t\tif(array_key_exists('primary', $inputs)){\n\t\t\t\t$primary = $inputs['primary'];\n\t\t\t\t$parentGroup = null;\n\t\t\t\tunset($inputs['primary']);\n\t\t\t}\n\t\t\t$default = 0;\n\t\t\tif(array_key_exists('is_default', $inputs)){\n\t\t\t\t$default = $inputs['is_default'];\n\t\t\t\tunset($inputs['is_default']);\n\t\t\t}\n\t\t\t$inputs = $inputs + [\n\t\t\t\t\t'is_default' => $default,\n\t\t\t\t\t//'is_primary' => $primary,\n\t\t\t\t\t'parent_group_id' => $parentGroup,\n\t\t\t\t\t'updated_by' => authUserId()\n\t\t\t\t];\n\t\t\t//dd($inputs);\n\t\t\t(new AccountGroup)->store($inputs, $id);\n\t\t\t\\DB::commit();\n\t\t\t$route = route('account-group.index');\n\t\t\t$lang = lang('messages.updated', lang('account_group.account_group'));\n\t\t\treturn validationResponse(true, 201, $lang, $route, [], []);\n\t\t} catch (\\Exception $exception) {\n\t\t\t\\DB::rollBack();\n\t\t\treturn validationResponse(false, 207, $exception->getMessage() .lang('messages.server_error'));\n\t\t}\n\t}", "public function updateGroup($group_id, array $old_group, array $new_group){\n $this->_errors = array();\n $STH = $this->getHandler();\n $user_id = $this->getUserID();\n \n if ($old_group['members'] != NULL){\n $to_delete = array_diff($old_group['members'], $new_group['members']);\n $to_insert = array_diff($new_group['members'], $old_group['members']);\n } elseif ($old_group['members'] == NULL){\n $to_insert = $new_group['members'];\n $to_delete = NULL;\n } \n \n \n foreach ((array)$to_delete as $index => $to_delete_id){\n $values = array('song_id', '=', ':song_id');\n $where = array(':song_id' => $to_delete_id);\n $STH->delete('groups_lookup', $values, $where);\n }\n \n $name = $new_group['name'];\n $desc = $new_group['desc'];\n $type = $new_group['type'];\n \n $tables = array('groups' => array('group_id', 'group_name', 'group_desc', 'type', 'user_id'),\n 'groups_lookup' => array('group_id', 'song_id', 'user_id')); //List of tables to insert (make sure lookup table is first)\n $groupData = array(':group_id' => $group_id, ':group_name' => $name, ':group_desc' => $desc, ':type' => $type, ':user_id' => $user_id); //IDs and group ids and stuff\n $data['groups'] = $groupData;\n \n foreach ($to_insert as $index => $id){\n $data['groups_lookup'][] = array(':group_id' => $group_id, ':song_id' => $id, ':user_id' => $user_id);\n }\n \n $STH->insert($tables, $data, 'groups', 'group_id', TRUE);\n $STH->getErrors();\n }", "public function addGroup(string $group): void;", "protected function saveGroup($group) {\n\t\t$link = $this->getLink();\n\t\t$link->set($this->prefix, $group);\n\t}", "function updateGroup($post,$deviceType,$appVersion,$OSVersion,$browserVersion){\n\n $con=connectToDB(); //connect to the DB\n mysql_query('SET NAMES UTF8');\t\t\n $GroupName=$post['GroupName'];\n\t$ModifyDateTime=date('Y-m-d H:i:s');\n\t$GroupID=$post['GroupID'];\n\t$sql2=\"UPDATE `SCP_Groups` SET `GroupName` = '\".$GroupName.\"',`ModifyDateTime` = '\".$ModifyDateTime.\"' WHERE `GroupID` = '\".$GroupID.\"'\";\t \n $result = mysql_query($sql2) or die(mysql_error());\n\t\n\t\n //CHECK FOR ERROR\n if (!$result) die('Invalid query: ' . mysql_error());\n\t\t\n if($result) {\n $data['responseData'] = '';\n $data['message'] = \"Updated successfully\";\n $data['responseCode'] = \"200\";\n $data['status'] = \"1\";\n } else {\n $data['responseData'] = '';\n $data['message'] = \"Error in Updation\";\n $data['responseCode'] = \"200\";\n $data['status'] = \"0\";\n }\n print json_encode($data);\n mysql_close($con); //close the connection\n}", "function group($s)\n{\n\t$this->tryModify();\n\t$this->query['group'] = $s;\n\treturn $this;\n}", "public function edit_group_details(){\n if( !isset( $_REQUEST['pmstkn'] ) || !wp_verify_nonce( $_REQUEST['pmstkn'], 'pms_gm_edit_group_details_nonce' ) )\n return;\n\n if( empty( $_POST['pms_subscription_id'] ) )\n return;\n\n $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 //validate fields\n $group_name = sanitize_text_field( $_POST['group_name'] );\n\n if( empty( $group_name ) )\n pms_errors()->add( 'group_name', esc_html__( 'Group name cannot be empty.', 'paid-member-subscriptions' ) );\n\n if ( count( pms_errors()->get_error_codes() ) > 0 )\n return;\n\n //save fields\n pms_update_member_subscription_meta( $subscription->id, 'pms_group_name', $group_name );\n\n $group_description = sanitize_text_field( $_POST['group_description'] );\n pms_update_member_subscription_meta( $subscription->id, 'pms_group_description', $group_description );\n }", "public function assignGroup(...$groups): HasGroups;", "function add_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 // Insert or update, to minimize redundancy\n list($flag, $msg) = $this->m_general->insert_update('users_group', $this->input->post(), $where);\n\n return JSONRES($flag, $msg);\n }", "public function update_age_group($agegroup_id) {\n //validate the request\n $this->validate($this->request,[\n 'title' => 'required|string|max:255',\n 'status' => 'integer|min:0|max:1'\n ]);\n\n $age_group = AgeGroup::find($agegroup_id);\n $age_group->title = $this->request['title'];\n $age_group->updated_by = $this->user_id;\n if(isset($this->request['status'])){\n $age_group->status = $this->request['status'];\n } else {\n $age_group->status = 1; //by default we set active\n }\n $age_group->save();\n\n return response()->json($age_group, 200);\n }", "public function update(Request $request, $id)\n { \n\n $group = Group::find($id);\n $this->validate($request,[\n \"name\" => \"required\",\n \"description\"=>\"required\",\n ]);\n \n $group->name = $request->name;\n $group->description = $request->description;\n $group->save();\n // $post->tags()->sync($request->tags);\n return redirect()->route('groups.index');\n }", "function updateLocaleFields(&$group) {\n\t\t$this->updateDataObjectSettings('group_settings', $group, array(\n\t\t\t'group_id' => $group->getId()\n\t\t));\n\t}", "public function updateGroup(GroupValidator $input, $id)\n {\n if (Branch::find($id)->update($input->except('_token'))) { // The group update => OK\n session()->flash('class', 'alert alert-success');\n session()->flash('message', 'De groeps informatie is aangepast.');\n }\n\n return back();\n }", "public function saveEditedGroupData($group) {\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\n\t\t\tif($group instanceof iUmiFieldsGroup) {\n\t\t\t\t$group->setName($name);\n\t\t\t\t$group->setTitle($title);\n\t\t\t\t$group->setIsVisible($is_visible);\n\t\t\t\t$group->setIsActive(true);\n\t\t\t\t$group->setTip($tip);\n\t\t\t\t$group->commit();\n\t\t\t} else {\n\t\t\t\tthrow new coreException(\"Expected instance of type umiFieldsGroup\");\n\t\t\t}\n\t\t}", "public function editGroupAction($id) {\n\t\t$this->group->id = $id;\n\t\t$this->group->id_parent = $this->data['id_parent'];\n\t\t$this->group->group_name = $this->data['group_name'];\n\t\t$this->group->description = $this->data['description'];\n\t\treturn $this->group->save();\n\t}", "public function merge_group($oldid, $newid)\r\n\t{\r\n $this->delete_thread($oldid);\r\n $this->group_data_change($newid);\r\n\t}", "function system_add_group($paramv)\n{\n}", "public function changeUserGroup()\n {\n $userId = $this->request->variable('user_id',0);\n $groupId = $this->request->variable('group_id',9999);\n\n if($userId === 0 || $groupId === 9999)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n /**\n * Group IDs\n * 5 - ADMIN\n * 4 - GLOBAL MOD\n * 2 - REGISTERED\n */\n $arrGroups = group_memberships(false, [$userId]);\n\n $arrCurrentGroupIds = [];\n\n // Get the user's current groups\n foreach($arrGroups as $group)\n {\n $arrCurrentGroupIds[$group['group_id']] = $group['group_id'];\n }\n\n // If the new group is 'registered user' we need to remove the user from\n // any admin or moderator groups they were previously in\n if($groupId < 4)\n {\n // User was an admin - remove them from the admin group\n if(in_array(5,$arrCurrentGroupIds))\n {\n group_user_del(5,[$userId]);\n }\n\n // User was a global mod - remove them from the global mod group\n if(in_array(4,$arrCurrentGroupIds))\n {\n group_user_del(4,[$userId]);\n }\n }\n\n // If the user is being made an admin, make sure they are a global mod too\n if($groupId == 5 AND !in_array(4,$arrCurrentGroupIds))\n {\n group_user_add(4, [$userId],false, false, false);\n }\n\n // User could already have the group they need if they are\n // being downgraded. Check if they have the group and\n // if not, add them. If they were, then make it the default\n if(!in_array($groupId,$arrCurrentGroupIds))\n {\n group_user_add($groupId, [$userId],false, false, true);\n }\n else\n {\n group_set_user_default($groupId,[$userId]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user\\'s group was updated',\n 'data' => [\n 'user_id' => $userId,\n 'group_id' => $groupId\n ]\n ]);\n }", "public function update(User $user, Group $group)\n {\n //\n }", "public function admin_change(){\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\t\t\t// Edit the group\n\t\t\t$satellite_ids = array();\n\t\t\t\n\t\t\t// Loop through and add all of the satellite IDs\n\t\t\tforeach($_POST['satellites'] as $satellite_id){\n\t\t\t\tarray_push($satellite_ids, $satellite_id);\n\t\t\t}\n\t\t\t\n\t\t\t// Assemble query\n $show_on_home = (isset($_POST['show_on_home']))?'1':'0';\n $default_on_home = (isset($_POST['default_on_home']))?'1':'0';\n\t\t\t$group_changes['Group'] = array(\n 'id' => $group['Group']['id'],\n 'name' => $_POST['group_name'],\n 'description' => $_POST['group_description'],\n 'show_on_home' => $show_on_home,\n 'default_on_home' => $default_on_home,\n 'updated_on' =>date ('Y-m-d H:i:s', time())\n );\n\t\t\t$group_changes['Satellite'] = array('Satellite' => $satellite_ids);\n\t\t\t\n\t\t\t$edit_group = $this->Group->save($group_changes);\n\t\t\t\n\t\t\tif ($edit_group){\n\t\t\t\t$this->Session->setFlash('The group has been edited successfully.', 'default', array('class' => 'alert alert-success'));\n\t\t\t\tCakeLog::write('admin', '[success] The group \\''.$_POST['group_name'].'\\' has been edited.');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('An error occured while editing that group. Please try again.', 'default', array('class' => 'alert alert-error'));\n\t\t\t\tCakeLog::write('admin', '[error] Error editing the group \\''.$_POST['group_name'].'\\'.');\n\t\t\t}\n\t\t\t\n\t\t\t$this->redirect(array('controller' => 'group', 'action' => 'index'));\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 actionUpdateGroup($name)\n\t{\n\t\t$authManager=Yii::app()->authManager;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['GroupPermissions']))\n\t\t{\n\t\t\t$selGroupPermissions = array_combine($_POST['GroupPermissions'],$_POST['GroupPermissions']);\n\n\t\t\tforeach($authManager->getAuthItems(CAuthItem::TYPE_OPERATION) as $perm) \n\t\t\t{\t\n\t\t\t\t//var_dump(isset($selGroupPermissions[$perm->name]));\n\t\t\t\t//var_dump(!$authManager->hasItemChild($name,$perm->name));\n\t\t\t\t//var_dump('----');\n\t\t\t\tif(isset($selGroupPermissions[$perm->name]) && !$authManager->hasItemChild($name,$perm->name)) {\n\t\t\t\t\t$authManager->addItemChild($name,$perm->name);\n\t\t\t\t\t//echo 'adding permission'.$perm->name;\n\t\t\t\t} else if(!isset($selGroupPermissions[$perm->name])) {\n\t\t\t\t\t$authManager->removeItemChild($name,$perm->name);\n\t\t\t\t\t//echo 'removing permission'.$perm->name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->redirect(array('/user/groups'));\n\t\t}\n\n\t\t$this->layout='//layouts/column1';\n\t\t$this->render('update_group',array(\n\t\t\t'name'=>$name,\n\t\t\t'permissions'=>$authManager->getAuthItems(CAuthItem::TYPE_OPERATION),\n\t\t\t'groupPermissions'=>$authManager->getItemChildren($name),\n\t\t\t'tasks'=>$authManager->getAuthItems(CAuthItem::TYPE_TASK),\n\t\t));\n\t}", "public function update(Request $request)\n {\n $validator = Validator::make(Input::All(), [\n// 'groupname' => 'required|unique:groups|max:255',\n 'id' => 'required',\n ]);\n if ($validator->fails()) {\n return response()->json([\n 'success'=>false,\n 'status'=>'01',\n 'errors'=>$validator->errors()->toArray()\n ]);\n }\n\n else{\n $group = Group::find(Input::get('id'));\n if( Input::get('updater')==2){\n $group->status = $request->input('updatestatus');\n $group->deactivatedby = Auth::User()->id;\n $group->save();\n }elseif( Input::get('updater')==3){\n $group->status = $request->input('updatestatus');\n $group->activatedby = Auth::User()->id;\n $group->save();\n }\n else{\n $group->groupname = $request->input('groupname');\n $group->description = $request->input('description');\n $group->createdby = Auth::User()->id;\n $group->save();\n }\n return response()->json([\n 'success'=>false,\n 'datainput'=>$group,\n 'status'=>'00',\n 'message' =>'<code>'. Input::get('groupname').'</code>'.' Updated Successfully'\n ]);\n\n }\n\n\n }", "public function updateGroup(Request $request, $id){\n try{\n $decryptGroup = Crypt::decrypt($id);\n $group = Group::findOrFail( $decryptGroup );\n $updateGroup = Group::updateGroup($decryptGroup, $request->groupName);\n\n $check = $request->groupName;\n if($group->group_name == $check){\n return redirect('/group/'. $id)->with(compact('group'))->with('message', 'No changes has been made.');\n }else{\n return redirect('/group/'. $id)->with(compact('group'))->with('message', 'Your changes has been saved!');\n }\n\n }catch(DecryptException $e){\n return view('errors.404');\n }\n }", "function groupApplyHandler() {\n global $inputs;\n\n updateDb('member_group_apply',[\n 'status' => $inputs['type'],\n 'handle_time' => date('Y-m-d H:i:s'),\n ], [\n 'id' => $inputs['id']\n ]);\n\n $info = getOne(\"select * from member_group_apply where id = ?\", [$inputs['id']]);\n\n insert('member_group',[\n 'member_id' => $info['member_id'],\n 'group_id' => $info['group_id']\n ]);\n\n formatOutput(true, 'update success');\n}" ]
[ "0.8125539", "0.78114045", "0.73256415", "0.7309031", "0.7300588", "0.72937965", "0.7273951", "0.71679944", "0.70944285", "0.7087244", "0.7085254", "0.7047071", "0.70090157", "0.6934331", "0.6927319", "0.6919569", "0.69089717", "0.6884554", "0.68820566", "0.6873243", "0.6870436", "0.68693066", "0.68386126", "0.68208826", "0.6806462", "0.6778601", "0.673849", "0.66558075", "0.66501474", "0.66242445", "0.66242445", "0.66242445", "0.6615034", "0.6607938", "0.65798026", "0.65698284", "0.65682644", "0.6528561", "0.6524928", "0.65226954", "0.65221006", "0.6502617", "0.6499028", "0.6481189", "0.64647293", "0.64583", "0.6456858", "0.6451106", "0.6443819", "0.64294094", "0.6429359", "0.6427724", "0.641505", "0.6404102", "0.6373954", "0.6365843", "0.63639325", "0.6358586", "0.6342153", "0.6321804", "0.63195187", "0.6318857", "0.6302833", "0.6292494", "0.6269934", "0.62284386", "0.6226104", "0.62237704", "0.6222849", "0.6207665", "0.6206097", "0.6200114", "0.6190727", "0.6177994", "0.6177098", "0.61770064", "0.61764973", "0.61741847", "0.6171966", "0.61695635", "0.61559385", "0.61554724", "0.6155333", "0.6151129", "0.6147504", "0.61398077", "0.61358213", "0.612942", "0.61194193", "0.61123264", "0.61113167", "0.609842", "0.60969955", "0.60805595", "0.6076425", "0.60690874", "0.6064653", "0.6059361", "0.60590434", "0.60547477", "0.6042455" ]
0.0
-1
/ function to delete group
function delete_users($id) { $this->db->delete('tbl_users',array('id'=>$id)); return $this->db->delete('tbl_users_details',array('user_id'=>$id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "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 testDeleteGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function system_delete_group($paramv)\n{\n}", "public function delete(){\n\t\treturn $this->api->deleteGroup($this->getID());\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 delete_field_group($field_group)\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}", "function delete_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->delete($id);\n\t}", "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}", "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 }", "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 }", "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 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 delete_group($id){\n $this->db->where('group_id', $id);\n $this->db->delete('member_group');\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 remove($group)\n {\n }", "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 acf_delete_field_group($id = 0)\n{\n}", "public function delete()\n {\n // Delete the group\n $result = parent::delete();\n\n return $result;\n }", "function delete() {\n\t \t\n\t \t$sql = \"DELETE FROM evs_database.evs_group (gru_id, gru_name, gru_head_dept,gru_company_id)\n\t \tVALUES(?, ?, ?,?) \n\t\tWHERE gru_id = '$gru_id' \";\n\t\t\n\t \t$this->db->query($sql, array($this->gru_id, $this->gru_name, $this->gru_head_dept ,$this->gru_company_id));\n\t }", "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 }", "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 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 }", "function delete_group_by($field, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->delete_by($field, $match);\n\t}", "function delete_groups($field = null, $match = null)\n\t{\n\t\treturn get_instance()->kbcore->groups->delete_by($field, $match);\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 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 }", "public function deleteConnectionWithGroup(){\n $respondent = $this->id;\n $table = 'tbl_link_users_group_respondents';\n $sql = 'DELETE FROM '.$table.' WHERE respondents_id=:respondent';\n $command = Yii::app()->db->createCommand($sql);\n $command->bindParam(\":respondent\", $respondent);\n $command->execute();\n }", "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_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}", "function deleteObject(&$group) {\n\t\treturn $this->deleteGroupById($group->getId());\n\t}", "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 testDeleteRuleGroups()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\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}", "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 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 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 }", "function system_remfrom_group($paramv)\n{\n\t\n}", "function acf_delete_field_group( $id = 0 ) {\n\treturn acf_delete_internal_post_type( $id, 'acf-field-group' );\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}", "function delete( string $_group_key, IIndexedEntity $_entity ): bool;", "public function testDeleteGroupMember()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function remove_group($id)\n\t{\n\t\treturn get_instance()->kbcore->groups->remove($id);\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 }", "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() {\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}", "function remove($id, $group)\n {\n return true;\n }", "function delete_user_group($group_id)\n {\n return $this->db->delete('groups',array('gro_id'=>$group_id));\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 }", "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}", "protected function DeleteGroup($groupid, $deletegrouptoo=true) { \n if (!$groupid = $this->CorrectSymplyString($groupid)) { return false; } \n //remove all users\n $this->control->db->Delete($this->control->tables_list['groupusrs'], \"groupid='$groupid'\");\n //remove group \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 }", "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}", "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}", "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 }", "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 testDeleteExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 3,\n ]);\n $response->assertSessionHasNoErrors();\n }", "private function deleteFromGroup(array $idlist) {\n $query = \"\n DELETE tags_group\n WHERE tag_id IN (#list#)\";\n $ok = $this->db->query($query, array('list' => $idlist));\n\n return $ok;\n }", "function groups_unassign_grouping($groupingid, $groupid) {\n return delete_records('groupings_groups', 'groupingid', $groupingid, 'groupid', $groupid);\n}", "function removeFromGroup($group)\n { \n $this->_api->doRequest(\"DELETE\", \"{$group->getBaseApiPath()}/contacts/{$this->id}\"); \n unset($this->_group_ids_set[$group->id]);\n }", "function au_subgroups_delete_group($hook, $type, $return, $params) {\n $guid = get_input('guid');\n if (!$guid) {\n $guid = get_input('group_guid');\n }\n \n $group = get_entity($guid);\n \n if (elgg_instanceof($group, 'group')) {\n // determine if the group has any child groups\n $child = au_subgroups_get_subgroups($group, 1);\n $parent = au_subgroups_get_parent_group($group);\n \n if ($child || $parent) {\n // here we are, we're deleting something with subgroups or a parent\n // if we've already sorted out what happens to content\n // we'll have a special input\n $content_policy = get_input('au_subgroups_content_policy', false);\n \n if (!$content_policy) {\n forward(elgg_get_site_url() . \"groups/subgroups/delete/{$group->guid}\");\n }\n\n // this is the top level to delete, so if transferring content to parent, it's the parent of this\n // apply content policy recursively, then delete all subgroups recursively\n // this could take a while...\n set_time_limit(0);\n $guids = au_subgroups_get_all_children_guids($group);\n \n if (is_array($guids) && count($guids)) {\n if ($content_policy != 'delete' && is_array($guids) && count($guids)) {\n $options = array(\n 'container_guids' => $guids,\n 'au_subgroups_content_policy' => $content_policy,\n 'au_subgroups_parent_guid' => $parent->guid,\n 'limit' => 0\n );\n \n $batch = new ElggBatch('elgg_get_entities', $options, 'au_subgroups_move_content', 25);\n }\n\n // now delete the groups themselves\n $options = array(\n 'guids' => $guids,\n 'types' => array('group'),\n 'limit' => 0\n );\n $batch = new ElggBatch('elgg_get_entities', $options, 'au_subgroups_delete_entities', 25, false);\n }\n }\n }\n}", "function acf_untrash_field_group($id = 0)\n{\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 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 }", "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 }", "public function testDeleteSurveyGroup()\n {\n $surveyGroup = SurveyGroup::factory()->create();\n $surveyGroupId = $surveyGroup->id;\n\n $response = $this->json('DELETE', \"survey-group/{$surveyGroupId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey_group', [ 'id' => $surveyGroupId ]);\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}", "public function deleteGroup($dc)\n\t{\n\t\t$arrGroups = $this->getChildRecords($dc->id, 'tl_iso_groups');\n\t\t$arrGroups[] = $dc->id;\n\n\t\t$this->Database->query(\"UPDATE tl_iso_products SET gid=0 WHERE gid IN (\" . implode(',', $arrGroups) . \")\");\n\t}", "public function deleteGroupAction($idGroup) {\n\t\treturn $this->group->deleteRow($idGroup);\n\t}", "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 }", "function delete_session_group_user() {\r\n // protect from unauthorized access\r\n if (!isset($_SESSION['user']) or ! isset($_SESSION['group'])) {\r\n logout();\r\n die();\r\n }\r\n\r\n // get the URL query string\r\n $query_str = $_SERVER['QUERY_STRING'];\r\n\r\n // parse the URL query string to array\r\n $query = array();\r\n parse_str($query_str, $query);\r\n\r\n if (!isset($query['user_id'])) {\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Невалиден адрес!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=my_surveys');\r\n }\r\n\r\n $session_group = new Group;\r\n $session_group = unserialize($_SESSION['group']);\r\n $users = $session_group->getMembersArray();\r\n if (($key = array_search($query['user_id'], $users)) !== false) {\r\n unset($users[$key]);\r\n }\r\n $session_group->setMembers(serialize($users));\r\n $_SESSION['group'] = serialize($session_group);\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно изтрихте потребител от групата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_group');\r\n}", "public function destroy(Group $group)\n {\n //\n }", "public function destroy(Group $group)\n {\n //\n }", "public function destroy(Group $group)\n {\n //\n }", "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}", "public function delete($key = NULL){\n if (!is_null($key)) return parent::delete($key);\n \n\t\t//delete children\n\t\t$children_groups = Jelly::select('Client_ShareholderGroup')->where('parent', '=', $this->id())->execute();\n\t\tforeach($children_groups as $cg){\n\t\t\t$cg->delete();\n\t\t}\n\t\t$children_persons = Jelly::select('Client_Shareholder')->where('parent', '=', $this->id())->execute();\n\t\tforeach($children_persons as $cp){\n\t\t\t$cp->delete();\n\t\t}\n\t\t\n\t\tJelly::delete('Client_ShareholderGroup')->where('_id', '=', $this->id())->execute();\n }", "public function destroy(Group $group) {\n //\n }", "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 testDeleteSupplierGroup()\n {\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 deleteUserFromWorkinggroups($idWG){\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('\n DELETE FROM bdd_satisfevent.users_has_workinggroups\n WHERE Users_idUsers = ? AND WorkingGroups_idWorkingGroups = ?');\n $request->execute(array($_SESSION['logged']['idUsers'], $idWG));\n}", "public function actionDeleteGroup($name)\n\t{\n\t\t$authManager=Yii::app()->authManager;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\t$authManager->removeAuthItem($name);\n\t\t$this->redirect(array('/user/groups'));\n\t}", "function DeleteGroup($groupid) {\n $proc = $this->Delete($this->grptable, \"WHERE groupid = '$groupid'\");\n return $proc;\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 }", "public function removeFromGroup(Group $group): HasGroups;", "function delete($id) {\n $this->Group->delete($id);\n $this->Session->setFlash('The group has been deleted.');\n $this->redirect('/groups/edit');\n }", "public function mass_remove_group()\n {\n $ids = json_decode($this->input->post('ids'), true); //convert json into array\n foreach ($ids as $id) {\n $resultat = $this->m_feuille_controle->remove_group($id);\n }\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 }", "function DeleteGroup ($id, $deleteapplications = 'True') {\n $path = REST_PATH . 'groups/' . $id . '.xml';\n\n // Setup the POST NAME/VALUE pairs\n $postdata = http_build_query(\n array(\n 'DeleteApplications' => $deleteapplications\n )\n );\n\n // Call Rest API\n $result = CallRestApi($path, $postdata, 'DELETE');\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n\n // Success?\n $msg = $xml->Info->Message;\n if ('Group was deleted' == $msg) {\n \treturn 1;\n }\n \n return 0;\n}", "public function delete() {\n\t\t// Get list of passwords of this group\n\t\t$passwordList = t3lib_div::makeInstance('tx_passwordmgr_model_passwordList');\n\t\t$passwordList->init($this['groupUid']);\n\n\t\t// Delete sslData of member of passwords in this group\n\t\tforeach ( $passwordList as $password ) {\n\t\t\t$sslDataOfMember = t3lib_div::makeInstance('tx_passwordmgr_model_ssldata');\n\t\t\t$sslDataOfMember->init($password['uid'], $this['beUserUid']);\n\t\t\t$sslDataOfMember->delete();\n\t\t}\n\n\t\t// Delete membership\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_DELETEquery(\n\t\t\t'tx_passwordmgr_group_be_users_mm',\n\t\t\t'group_uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['groupUid'], 'tx_passwordmgr_group_be_users_mm') .\n\t\t\t\t' AND be_users_uid='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this['beUserUid'], 'tx_passwordmgr_group_be_users_mm')\n\t\t);\n\t\t$this->checkAffectedRows('deleteGroupMember', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'deleteGroupMember', 'Removed user '.$this['beUserUid'].' from group '.$groupUid);\n\t}", "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 }", "public function deleteAnswersConnectionWithGroupQuestions(){\n //Yii::app()->db->createCommand('DELETE FROM `tbl_link_group_questions_answers` WHERE `group_questions_id`=:group')->bindParam(\":group\",$this->id)->execute();\n Yii::app()->db->createCommand()->delete('tbl_link_group_questions_answers', 'answers_id=:id', array(':id'=>$this->id));\n }", "public function delete(&$group) {\n\t\t/* As of PHP5.3.0, is_a() is no longer deprecated and there is no need to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\t$sql = sprintf(\n\t\t\t\"DELETE FROM %s WHERE groupid = '%u'\",\n\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t(int) $group->getVar('groupid')\n\t\t);\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\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 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 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 }", "public function deleteAccessGroup($name)\n\t{\n\t\t//delete the group\n\t\t$group = $this->getAccessGroup($name);\n\t\t$this->entityManager->remove($group);\n\t\t$this->entityManager->flush();\n\t}", "function delete_userGroup($idList, $number){\n if($number == 1){\n if(is_admin($idList)){\n return 0;\n }else{\n deleteRecord(TAB_USR_ROLE, \"userId = $idList\");\n deleteRecord(TAB_USERS, \"id = $idList\");\n }\n }else{\n $flag = false;\n for($i = 0; $i < count($idList); $i++){\n $id = $idList[$i];\n if(is_admin($id)){\n $flag = true;\n break;\n }\n }\n if(!$flag){\n for($j = 0; $j < count($idList); $j++){\n $id = $idList[$j];\n deleteRecord(TAB_USR_ROLE, \"userId = $id\");\n deleteRecord(TAB_USERS, \"id = $id\");\n }\n }else{\n return 0;\n }\n }\n return 1;\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 }", "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 }" ]
[ "0.8234863", "0.8133489", "0.79198825", "0.78979886", "0.7802342", "0.77090394", "0.75986433", "0.75773007", "0.75701904", "0.75647914", "0.7552005", "0.7527992", "0.75159067", "0.74945545", "0.7483295", "0.7462067", "0.7457659", "0.74484926", "0.7420896", "0.7345699", "0.733736", "0.7335775", "0.7310891", "0.7308791", "0.7305533", "0.7220883", "0.72159994", "0.7177283", "0.71505415", "0.7122063", "0.71127325", "0.70945483", "0.7064969", "0.70571846", "0.70344406", "0.70285565", "0.7022361", "0.7004535", "0.6979063", "0.6974404", "0.69391584", "0.6926491", "0.68915015", "0.6871975", "0.68681085", "0.6866984", "0.6857829", "0.6843042", "0.68373626", "0.68338895", "0.68328404", "0.6827365", "0.6822392", "0.6806055", "0.6789836", "0.67731535", "0.6769431", "0.6760345", "0.67586666", "0.67506", "0.6741641", "0.67348933", "0.6732476", "0.6731627", "0.6728062", "0.6726211", "0.6722418", "0.6721252", "0.67039526", "0.67022544", "0.66941303", "0.66909635", "0.66850644", "0.66850644", "0.66850644", "0.666402", "0.665764", "0.6656538", "0.66487265", "0.66430056", "0.6638336", "0.6636764", "0.6634673", "0.6628121", "0.66238517", "0.6620009", "0.6612983", "0.65986824", "0.6591166", "0.6589497", "0.6585574", "0.6562245", "0.65622157", "0.6549183", "0.65438926", "0.6541591", "0.65345377", "0.65239984", "0.65223616", "0.6513", "0.65108865" ]
0.0
-1
Match user name aginst password. If match success returns user row otherwise null
public function match($userName, $userPassword) { $translate = Zend_Registry::get('translate'); $paithal = Paithal::getInstance(); $select = $this->select() ->where('user_name = ?', $userName) ->where('user_password = ?', sha1($userPassword)); $rows = $this->fetchAll($select); if(count($rows)==1) { return $rows->getRow(0); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkUser($userName, $password){\n\t\n\tglobal $usersTable;\n\tglobal $db;\n\t$selectQuery=\"select password from $usersTable where userName = '\" . $userName . \"'\";\n\t$resultSet = mysqli_query($db, $selectQuery) or die(mysqli_error($db));\n\t$row = mysqli_fetch_assoc($resultSet);\n\t\n\tif($password == $row[\"password\"]){\n\t\treturn true;\n\t}\n\t\t\t\n\treturn false;\n}", "function login_attempt($username, $password) {\n $found_user = select_user_by_username($username);\n if ($found_user) {\n $user = mysqli_fetch_assoc($found_user);\n if ($user['password'] == $password) {\n return $user;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "static public function find_by_username($userName, $password) {\n\t$sql = \"SELECT * FROM \" . static::$table_name;\n\t$sql .= \" WHERE userName='\" . self::$database->escape_string($userName) . \"' AND password='\" . self::$database->escape_string($password) . \"'\";\n\t$obj_array = static::find_by_sql($sql);\n\tif(!empty($obj_array)){\n\t\treturn array_shift($obj_array);\n\n\t} else {\n\t\treturn false;\n\t}\n}", "function getUser() {\n $stmt = prepareQuery(\"\n SELECT\n `password`,\n `userID`,\n `role`\n FROM\n `user`\n WHERE\n `username` LIKE :username OR \n `email` LIKE :username\n \");\n\n $stmt->bindValue(\":username\", test_input($_POST[\"user\"]));\n $stmt->execute();\n return $stmt->fetch(PDO::FETCH_ASSOC);\n}", "function checklogin($userName,$password) {\n\n $db = DB::getInstance();\n\n $stmt = $db->prepare(\"SELECT * FROM User WHERE userName=?\");\n $stmt->bind_param('s', $userName);\n $stmt->execute();\n $result = $stmt->get_result();\n\n if(!$result || $result->num_rows !== 1) {\n return array('verified' => false, 'userId' => null, 'isAdmin' => null);\n }\n $row = $result->fetch_assoc();\n\n return array('verified' => password_verify($password, $row[\"password\"]), 'userId' => $row[\"id\"], 'isAdmin' => $row['admin'],'firstName' => $row['firstName']);\n}", "function select_user($link, $userName, $password) {\r\n $userid = 0;\r\n\r\n //creating a SELECT statement to retrieve data from the user\r\n //table\r\n $sql = \"SELECT id, username, password \"\r\n . \"FROM user \"\r\n . \"WHERE username = '$userName'\";\r\n\r\n\r\n //execute query\r\n $retval = mysqli_query($link, $sql);\r\n\r\n if (!$retval) {\r\n die('Could not execute select statement:' . mysqli_errno($link));\r\n } else {\r\n while ($row = mysqli_fetch_array($retval, MYSQLI_ASSOC)) {\r\n\r\n\r\n //chech to see if the username and password input in th form\r\n //existed in the user table\r\n if ((strcmp($row['username'], $userName) == 0) &&\r\n password_verify($password, $row['password'])) {\r\n $userid = $row['id'];\r\n return $userid;\r\n } else {\r\n\r\n return $userid;\r\n }\r\n }\r\n }\r\n}", "function validateUser($username, $password) {\r\n $sql = $this->db->prepare(\"SELECT password FROM USER WHERE email=:user_name\");\r\n if($sql->execute(array('user_name' => $username))) {\r\n $row = $sql->fetch(PDO::FETCH_ASSOC);\r\n if(password_verify($password, $row['password']))\r\n return $username;\r\n }\r\n return false;\r\n }", "public function loginUser()\n {\n $sql = \"SELECT * FROM user WHERE username=\\\"\" . $this->getUsername().\"\\\" AND password=\\\"\" . $this->getPassword().\"\\\"\";\n $result = mysqli_query($this->_connection, $sql);\n if (!$result) {\n print \"Error: \" . $result . \"<br>\" . mysqli_error($this->_connection);\n } else {\n while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) if ($row) {\n return $row;\n }\n }\n }", "function get_one_user($username, $password){\n global $db;\n $query = \"SELECT * FROM users \n WHERE userName = :username AND \n password = :password\";\n $statement = $db->prepare($query);\n $statement->bindValue(':username', $username);\n $statement->bindValue(':password', $password);\n $statement->execute();\n $user = $statement->fetch();\n $statement->closeCursor();\n return $user; \n }", "public static function checkCredentials( $usename, $password ) {\n\t\t\n\t\t$where = sprintf(\"`username` = %s AND `password` = %s\", self::$dataBase->escape($usename), self::$dataBase->escape($password)); \n\t\t\n\t\t$results = static::$dataBase->select(static::$tableName, $where);\n\t\t\n\t\tif ( count($results) != 1 ) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\t$dbData = array_pop($results);\n\t\t}\n\t\t\n\t\treturn static::hydrateDBData($dbData);\n\t\t\n\t}", "function checkLogin($username, $password)\n\t{\n\t\t\n\t\t//set an empty userId variable\n\t\t$userId = null;\n\t\t\n\t\t//make a call to grab the user id of the row that has a username AND password that match the specified ones\n\t\t$stmt = $this->db -> prepare(\"SELECT user_id FROM user WHERE username=? && password=?\");\n\t\t\n\t\t$stmt -> execute(array($username, $password));\n\t\t\n\t\t$userIdToCheck = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t//var_dump($userIdToCheck);\n\t\t\n\t\t\n\t\t//if the username and password do not match up, no rows will be found, and userIdToCheck will equal false\n\t\t//if username and password do not match up, put out error\n\t\tif($userIdToCheck == false)\n\t\t{\n\t\t\t$this->errors['password'] = \"Username and password do not match\";\n\t\t\t\n\t\t\t//var_dump($password, $userIdToCheck);\n\t\t\t//echo \"NOOOO!!!\";\n\t\t}\n\t\t//else, if the username and password do match up, set the user id to the $userId variable\n\t\t else\n\t\t{\n\t\t\t$userIdToCheck = $userIdToCheck['user_id'];\n\t\t} \n\t\t\n\t\t//return the user ID associated with the username and password\n\t\treturn $userIdToCheck;\n\t}", "public function checkUser($inputArray){\r\n\r\n\t\t$login_username = $inputArray[0];\r\n\t\t$login_password = $inputArray[1];\r\n\r\n\t\t$this->stmt = $this->db->prep(\"SELECT password, username FROM Users WHERE username=:username1 OR email=:username2\");\r\n\t\t\r\n\t\t$this->stmt->bindParam(':username1', $login_username);\r\n\t\t$this->stmt->bindParam(':username2', $login_username);\r\n\t\t$this->stmt->execute();\r\n\t\t$user = $this->stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif(password_verify($login_password, $user['password'])){\r\n\t\t\treturn $user['username'];\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}", "function loginOther($user, $password) {\r\n $query = \"select * from restaurant_members a inner join registers_restaurant b on a.restaurant_id=b.restaurant_id where m_user=? and m_password=?\";\r\n $data = $this->db->query($query, array($user, sha1($password)));\r\n if($data->num_rows() == 1){\r\n return $data->row();\r\n } else {\r\n return FALSE;\r\n }\r\n }", "function login($name, $password) {\n $query = \"SELECT name, password FROM characters WHERE name LIKE '%?%'\";\n try {\n $item = $this->perform_query_one_param($query, \"s\", $name);\n $item = $this->result_to_array($item);\n if (count($item) == 0) {\n return false;\n }\n echo $item[0]['name'].$item[0]['password'];\n return ($item[0]['name'] == $name && password_verify($password,$item[0]['password']));\n } catch (Exception $ex) {\n $this->print_error_message(\"Unable to login\");\n return false;\n }\n }", "private function get_salt_and_pass() {\n $stmt = $this->pdo->prepare(\"select salt, password from $this->table where name = :name\");\n $stmt->bindValue(':name', $this->name);\n $stmt->execute();\n $res = $stmt->fetchAll();\n if (count($res) != 1) {\n /* no user or more than one user with the same name (which should not be\n * possible) */\n return null;\n } else {\n return $res[0];\n }\n }", "function getUserData($uname, $upass) {\n // SELECT query\n $usel = \"SELECT salt FROM users WHERE username=? LIMIT 1\";\n $usel = dbQuery($usel, $uname);\n $urow = $usel->fetch();\n\n if (empty($urow)) {\n return false;\n } else {\n $salt = $urow['salt'];\n }\n\n // SELECT query\n $usel = \"SELECT id, username, email, firstname, lastname, level FROM users WHERE (username=? OR email=?) AND password=? LIMIT 1\";\n $usel = dbQuery($usel, $uname, $uname, hash('sha256', $upass . $salt));\n $urow = $usel->fetch();\n // check credentials\n if (empty($urow)) {\n return false;\n } else {\n return $urow;\n }\n}", "function userAuthentication($name, $password)\n{\n global $db;\n $query = getAllUsers(); //Query for getting all users from the database\n $existingUsers = db_select($db, $query); //Array of all the users in the database\n //check if username exists and if password is matching\n foreach ($existingUsers as $value) {\n if ($value['username'] == $name) {\n //if input password matching with database password\n if (password_verify($password, $value['password'])) {\n //Create a new session (login user)\n $_SESSION['userId'] = $name;\n return true;\n } else {\n //password is not valid\n return false;\n }\n }\n }\n //username is not existing in the database\n return false;\n}", "protected function _findUser($username, $password = null) {\n $userModel = $this->settings['userModel'];\n\t\t$userModel = 'AdminUser.AdminUser';\n list($plugin, $model) = pluginSplit($userModel);\n $fields = $this->settings['fields'];\n\n $conditions = array(\n $model . '.' . $fields['username'] => $username\n );\n if (!empty($this->settings['scope'])) {\n $conditions = array_merge($conditions, $this->settings['scope']);\n }\n // $result = ClassRegistry::init($userModel)->find('first', array(\n\t $result = ClassRegistry::init($model)->find('first', array(\n 'conditions' => $conditions,\n 'recursive' => $this->settings['recursive']\n ));\n if (empty($result) || empty($result[$model])) {\n return false;\n }\n\n // If the user's password hash doesn't match the results, return false\n if (!static::check($password, $result[$model][$fields['password']])) {\n return false;\n }\n\n unset($result[$model][$fields['password']]);\n return $result[$model];\n }", "function loginRecord($mysqli, $username, $password,$userradio){\n global $mysqli;\n //sql to check login\n $loginSQL = \"SELECT `user_name`,`user_password` FROM `users` WHERE STRCMP(`user_name`, ?)=0 AND STRCMP(`user_password`, ?)=0 LIMIT 1\";\n $stmt = $mysqli->prepare($loginSQL);\n $stmt->bind_param('ss', $username, $password);\n $stmt->execute();\n return $stmt->get_result();\n}", "function check_user_existence($username, $password) \n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE user_name = '$username' AND password = '$password'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "public function getUserByUsernameAndPassword($username,$password){\n\t\t$stmt = $this->conn->prepare(\"SELECT * FROM users WHERE username = ?\");\n\t\t$stmt->bind_param(\"s\",$username);\n\t\tif($stmt->execute()){\n\t\t\t$user = $stmt->get_result()->fetch_assoc();\n\t\t\t$stmt->close();\n\n\t\t\t//verifying user password\n\t\t\t$salt = $user['salt'];\n\t\t\t$encrypted_password = $user['encrypted_password'];\n\t\t\t$hash = $this->checkhashSSHA($salt,$password);\n\n\t\t\t//check for password equality \n\t\t\tif($encrypted_password == $hash){\n\t\t\t\treturn $user;\n\t\t\t}\n\n\t\t}\n\n\t\telse{\n\t\t\treturn NULL;\n\t\t}\n\t}", "function checkIfValidUser($name,$pw){\n\t if(($name != NULL) && ($pw != NULL)){\n $count = @mysql_query(\"SELECT COUNT(*) as count FROM UserUNandID WHERE ('$name' = UserName)\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0){\n\t\t return false;\n\t\t }\n else\n\t\t { \n $userinfo = @mysql_query(\"SELECT * FROM UserUNandID WHERE ('$name' = UserName)\");\n\t\t\t $userdata = mysql_fetch_assoc($userinfo);\n\t\t\t $pwinfo = $userdata['Password'];\n\t\t\t if($pw == $pwinfo)\n\t\t\t return true;\n\t\t\t else return false;\n }\t\t\t \n\t\t}\t\t\n\t}", "function loginAttempt($username, $password)\n{\n global $connectingDB;\n $sql = \"SELECT * FROM users WHERE username=:username AND password=:password LIMIT 1\";\n $stmt = $connectingDB->prepare($sql);\n $stmt->bind_param('ss', $username, $password);\n //$stmt->bind_param(':Password');\n $stmt->execute();\n $result = $stmt->store_result();\n if ($result == 1) {\n return $foundAccount = $stmt->fetch();\n } else {\n return null;\n }\n}", "function canLogin($user,$password){\n\t\tglobal $db;\n\n\t\t$sql =\"SELECT email, password from users where email='\".$user.\"'\";\n\t\t$result =$db->query($sql);\n\t\tif($user==\"\" || $password==\"\")\n\t\t\treturn 'Please enter a username and a password.';\n\t\tif($result->num_rows==0)\n\t\t\treturn \"The username or password are incorrect.\";\n\t\tforeach ($result as $row) {\n\t\t\t$row =$row;\n\t\t}\n\t\tif($result->num_rows==1){\n\t\t\tif(password_verify($password,$row['password']))\n\t\t\t\treturn \"\";\n\t\t\telse\n\t\t\t\treturn \"The username or password are incorrect.\";\n\t\t}\n\t}", "function password_matches_username( $ls_username, $ls_password, $link ) {\n\n\t\t$sql = \"SELECT * from `users` WHERE `username` LIKE '$ls_username' AND `password` LIKE '$ls_password'\";\n\n\t\techo 'sql='.$sql;\n\n\t\t$result = mysqli_query( $link, $sql );\n\n\t\tif ( $result ) {\n\n\t\t\techo 'password_matches_username returned a result';\n\n\t\t\tif ( mysqli_num_rows( $result ) > 0 ) {\n\n\t\t\t\techo 'username '.$ls_username . ' and password ' . $ls_password . ' are correct!';\n\n\t\t\t\treturn true; //user should be allowed to log in.\n\n\t\t\t}\n\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "function findUser($acc,$pass){\n\t\tUtilidades::_log(\"findUser($acc,***)\");\n\t\t$db=DB::conectar();\n\t\t$select=$db->prepare('SELECT * FROM user WHERE account=:account');\n\t\t$select->bindValue('account',$acc);\n\t\t$select->execute();\n\t\t$row=$select->fetch();\n\t\t$user = null;\n\t\t//Verifica si la clave es correcta\n\t\tif (password_verify($pass, $row['pass'])){\n\t\t\t//Si es correcta\n\t\t\t$user=new UserDAO($row);\n\t\t\tUtilidades::_log('pass Correcta');\n\t\t}\n\t\tUtilidades::_log('id: '.$row['id']);\n\t\treturn $user;\n\t}", "function checkLogin($u, $p) {\n $sql = \"SELECT * FROM customer WHERE username = :username\";\n $stmt = $this->dbconn->prepare($sql);\n $stmt->bindParam(':username', $u, PDO::PARAM_STR);\n $stmt->execute();\n if($stmt->rowCount() > 0) {\n $retVal = $stmt->fetch(PDO::FETCH_ASSOC);\n if(strlen($retVal['password']) > 0) {\n if($retVal['password'] == $p) { // encrypt & decrypt\n return Array(\n 'CustomerID'=>$retVal['CustomerID'],\n 'username'=>$retVal['username'],\n 'email'=>$retVal['email'],\n 'phone'=>$retVal['phone'],\n 'postcode'=>$retVal['postcode']);\n } else {\n return false;\n }\n } else {\n return Array('username'=>$retVal['username']);\n }\n } else {\n return false;\n }\n }", "public function checkUser()\n {\n // Prepare ids used to avoid SQL injections(bad code)\n // we store them in the var $sql\n // we select the id and password from the table users where the username equals what was put it\n $sql = $this->db->prepare('SELECT id, password FROM admin WHERE username = ?');\n // Then we bind the parameters, its a string so we use 's', then we execute the statment\n $sql->bind_param('s', $_POST['username']);\n $sql->execute();\n // Now we store the results\n $sql->store_result();\n\n //if the returned rows are greater then 0\n // we bind the results the variblesand then fetch them \n if ($sql->num_rows > 0) {\n $sql->bind_result($id, $password);\n $sql->fetch();\n // If the rows are more then 0 we know the account name exist, now lets check the password!\n // we werify our hashed password if user name and password are right we create a new session\n // Note: remember to use password_hash in your registration file to store the hashed passwords.\n if (password_verify($_POST['password'], $password)) {\n // new session created with a var for being loged in set to true\n //the name is equal to the name from the field\n // and the id is equal to the users id\n session_regenerate_id();\n $_SESSION['loggedin'] = TRUE;\n $_SESSION['person'] = $_POST['username'];\n $_SESSION['id'] = $id;\n } else {\n // Incorrect password\n echo 'Wrong username or password';\n }\n } else {\n // wrong credentials\n echo 'Wrong username or password';\n }\n//we close the prepared statment\n $sql->close();\n }", "private function getUser($userfield, $password) {\n // check if user exists in database\n $query = \"call getUserPasswordInfo(:userfield)\";\n try {\n if (self::$connection == NULL) {\n require 'php/credentials.php';\n self::connectionInit($dbconn);\n }\n $stmt = self::$connection->prepare($query);\n $stmt->bindParam(':userfield', $userfield);\n $stmt->execute();\n $user = $stmt->fetch();\n if ($user) {\n if (password_verify($password, $user['pwd_hash'])) {\n $_SESSION['user_id'] = $user['user_id'];\n $_SESSION['username'] = $user['username'];\n $_SESSION['email'] = $user['email_address'];\n return true;\n }\n }\n } catch (PDOException $e) {\n echo \"<span style='color: red;'>**${query}**</span> \" . $e->getMessage();\n exit();\n }\n return false;\n }", "function find_user() //функция авторизации пользователя\n\t{\n\t\t//echo \"Hello <br/>\";\n\t\t$sth = $this->db->prepare(\"SELECT id, username FROM accounts WHERE username = :username AND password = :password\");\n \t\t$sth->execute(array(\n\t\t\t\t\t\t\t':username'=>$_POST['username'], \n\t\t\t\t\t\t\t':password' =>Hash::create('sha256', $_POST['password'], 'cats do not fliing')\n \t\t\t\t\t));\n\n \t/*$result = $sth->fetchAll();\n\t\tprint_r($result);*/\n\t\t$data = $sth->fetch();\n\t\t//print_r($data);\n\n\t\t$count = $sth->rowCount();\n\t\tif($count > 0)\n\t\t{\n\t\t\t//logged in\n\t\t\tSession::init();\n\t\t\tSession::set('username', $data['username'] );\n\t\t\tSession::set('loggedIn', true);\n\t\t\theader('location: ../dashboard');\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('location: ../login');\n\t\t}\n\t\t\n\t}", "function correct_user( $name, $passwd, $domain, $conn, $db_users )\r\n\t\t{\r\n\t\t\t$table = $conn->query( \"SELECT count(*) CNT, user, passwd, domain FROM \".$db_users.\" WHERE user = '\".$name.\"' AND domain = '\".$domain.\"'\" );\r\n\t\t\t$row = mysqli_fetch_array( $table );\r\n\t\t\tif ( $row['CNT'] != 1 ) return false;\r\n\t\t\tif ( $row['passwd'] == $passwd ) return true;\r\n\t\t\treturn false;\r\n\t\t}", "function user_exists($username){\n\n $sql = \"SELECT Username, Password, Email, Id FROM Users\"; //WHERE\n //Username={$username}\";\n $result = mysqli_query(Db::$conn, $sql);\n //check results return true if >0\n if(mysqli_num_rows($result)>0) {\n while ($row = mysqli_fetch_assoc($result)) {\n $temp_user = $row[\"Username\"];\n $temp_pass = $row[\"Password\"];\n if ($username == $row[\"Username\"]) {\n return true;\n }\n }\n }\n\n return false;\n\n}", "function authenticate_v2($username='', $password='') {\n global $db;\n $username = $db->escape($username);\n $password = $db->escape($password);\n $sql = sprintf(\"SELECT id,username,password,user_level FROM users WHERE username ='%s' LIMIT 1\", $username);\n $result = $db->query($sql);\n if($db->num_rows($result)){\n $user = $db->fetch_assoc($result);\n $password_request = sha1($password);\n if($password_request === $user['password'] ){\n return $user;\n }\n }\n return false;\n }", "public function attemptLogin($user_name, $password){\n $this->setTableName(\"users\");\n\n $where = array(\n \"user_name\" => $user_name,\n \"password\" => $password\n );\n\n $result = $this->select($where);\n\n $this->setTableName(\"userAuth\");\n\n return $result;\n\n }", "public function read_credentials(){\n $query='SELECT * FROM '.$this->table.' WHERE name=? and password=?';\n\n $stmt = $this->conn->prepare($query);\n\n \n $stmt->bindparam(1,$this->name);\n $stmt->bindparam(2,$this->password);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n\n if($stmt->execute()) {\n return true;\n }\n \n // Print error \n printf(\"Error: %s.\\n\", \"invalid user\");\n \n return false;\n \n \n }", "function pwordMatches(){\n\t\t//assume pword does not match that in system\n\t\t$match = false;\n\t\ttry{//try to est connection to db \n\t\t\t$user_db = new SQLite3('users.db');\n\t\t}catch(Exception $ex){ //if cannot catch exception \n\t\t\techo $ex->getMessage(); \n\t\t}\n\t\t//query for all usernames\n\t\t$statement = 'SELECT Username, Password FROM users;';\n\t\t$run = $user_db->query($statement); \n\n\t\t$pword = $_SESSION['password'];\n\t\t$pword = hash('md2', $pword); \n\t\tif($run){//query did not have error\n\t\t\twhile($row = $run->fetchArray()){\n\t\t\t\tif(trim($row['Username']) === trim($_POST['name'])){//if provided username is the same as that queried\t\n\t\t\t\t\tif($pword === trim($row['Password'])){//if provided pword matches that for the provided username\n\t\t\t\t\t\t//password matches\n\t\t\t\t\t\t$match = true; \n\t\t\t\t\t\t//break out of loop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\t$user_db->close(); \n\t\treturn $match; \t\n\t}", "public function authenticateUser($data) {\n\t\t$statement=$this->db->prepare(\"SELECT id FROM \".$this->prefix.\"users WHERE (username=? OR email=?) AND password=?\");\n\t\tif(!$statement) {return false;}\n\t\t$username=$data[\"username\"];\n\t\t$password=md5($data[\"password\"]);\n\t\t$statement->bind_param(\"sss\",$username,$username,$password);\n\t\tif(!$statement->execute()) {return false;}\n\t\tif(!$statement->bind_result($userId)) {return false;}\n\t\tif($statement->fetch()==true) {\n\t\t\t//found user\n\t\t\treturn $userId;\n\t\t}\n\t\treturn -1;\n\t}", "public function match($u,$p){\n\t\t$this->db->select(\"*\");\n\t\t$this->db->where('username',$u);\n\t\t$q = $this->db->get('logs');\n\t\tif($q->num_rows()>0){\n\t\t\tif(password_verify($p, $q->row_array()['password'])){\n\t\t\t\treturn $q->result_array();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn array( 0 => false , 'error' => \"Password didn't matched!\");\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn array( 0 => false , 'error' => \"Username Doesn't exists!\");\n\t\t}\n\t}", "function cafet_check_login(string $pseudo_or_name, $password): ?User\n {\n $user = UserManager::getInstance()->getUser($pseudo_or_name);\n \n if (! $user) return NULL;\n \n if (cafet_verify_password($password, $user->getHash(), $user->getPseudo())) {\n UserManager::getInstance()->registerLogin($user->getId());\n return $user;\n }\n else return NULL;\n }", "static function userIdentifying($login, $password)\n\t{\n\t\t$dataBase = self::dbConnect();\n\t\t$request = $dataBase->prepare('SELECT password FROM users WHERE login = ?');\n\t\t$request->execute(array($login));\n\t\t$dbPassword = $request->fetch();\n\t\t$dbPassword = $dbPassword['password'];\n\t\t$request->closeCursor();\n\t\tif (password_verify($password, $dbPassword))\n\t\t{\n\t\t\t$request = $dataBase->prepare('SELECT id FROM users WHERE login = ?');\n\t\t\t$request->execute(array($login));\n\t\t\t$id = $request->fetch();\n\t\t\treturn $id['id'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function _pwdntmatchdb($input, $password) {\n\t\t\n\t\t$password \t= md5(r::post($password));\n\t\t$username \t= r::post($input);\n\n\t\t$prepare\t= $this->db->prepare(\"SELECT * FROM `users` WHERE `username` = ? AND `password` = ?\");\n\t\t$prepare->execute(array($username, $password));\n\t\t$result\t\t= $prepare->fetch(PDO::FETCH_ASSOC);\n\n\t\tif(empty($result)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->userid = $result['id'];\n\t}", "public function checkUserPassword()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\t$pass = FormUtil::getPassedValue('up', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\t\tif($pass == null) {\n\t\t\treturn self::retError('ERROR: No up passed!');\n\t\t}\n\n\t\t$users = self::getRawUsers('uname = \\'' . mysql_escape_string($uname) . '\\'');\n\n\t\tif(count($users) == 1) {\n\t\t\tforeach($users as $user) {\n\t\t\t\tif($user['uname'] == $uname) {\n\t\t\t\t\tif(FormUtil::getPassedValue('viaauthcode', null, 'POST') != null) {\n\t\t\t\t\t\t$authcode = unserialize(UserUtil::getVar('owncloud_authcode', $user['uid']));\n\t\t\t\t\t\tif($authcode['usebefore'] >= new DateTime('NOW') &&\n\t\t\t\t\t\t\t$authcode['authcode'] == $pass) {\n\t\t\t\t\t\t\t\t$return = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$return = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$authenticationMethod = array(\n\t\t\t\t\t\t\t'modname' => 'Users' ///TODO\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (ModUtil::getVar(Users_Constant::MODNAME, Users_Constant::MODVAR_LOGIN_METHOD, Users_Constant::DEFAULT_LOGIN_METHOD) == Users_Constant::LOGIN_METHOD_EMAIL) {\n\t\t\t\t\t\t\t$authenticationMethod['method'] = 'email';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$authenticationMethod['method'] = 'uname';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$authenticationInfo = array(\n\t\t\t\t\t\t\t'login_id' => $uname,\n\t\t\t\t\t\t\t'pass' => $pass\n\t\t\t\t\t\t);\n\t\t\t\t\t\t//try to login (also for the right output)\n\t\t\t\t\t\tif(UserUtil::loginUsing($authenticationMethod, $authenticationInfo, false, null, true) == true) {\n\t\t\t\t\t\t\t$return = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$return = false;\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} else {\n\t\t\t$return = false;\n\t\t}\n\t\treturn self::ret($return);\n\t}", "public function login()\n {\n \textract($this->CI->input->post());\n \t$user_account = $this->CI->db->get_where($this->table,['username'=>$username])->row_array();\n\t\t\n \tif (!empty($user_account)) {\n \t\tif (password_verify($password, $user_account['password'])) {\n\t\t\t\tunset($user_account['password']);\n \t\t\treturn $user_account;\n \t\t}\n \t}\n \t\n \treturn false;\n\n }", "public static function check_for_another_user($username,$email)\n{\n$user_check_sql = \"SELECT * FROM users WHERE name='$username' OR email='$email' LIMIT 1\";\n $statement = Database::$db->prepare($user_check_sql);\n $statement->execute();\n return $statement->fetch(PDO::FETCH_ASSOC);\n}", "function logincheck($u_mail,$u_pass)\n{\n\t$sql=\"select * from user_table where u_mail='$u_mail' and u_pass='$u_pass'\";\n\t$key=0; \n\tforeach($GLOBALS['db']->query($sql) as $row)\n\t\t$key++;\n\tif($key==1)\n\t\treturn $row['u_id'];\n\telse\n\t\techo \"<center>Username or Password is incorrect</center>\";\n}", "function auth($uname, $upass) {\n // SELECT query\n $usel = \"SELECT salt FROM users WHERE username=? LIMIT 1\";\n $usel = dbQuery($usel, $uname);\n $urow = $usel->fetch();\n\n if (empty($urow)) {\n return false;\n } else {\n $salt = $urow['salt'];\n }\n\n // SELECT query\n $usel = \"SELECT id FROM users WHERE (username=? OR email=?) AND password=? LIMIT 1\";\n $usel = dbQuery($usel, $uname, $uname, hash('sha256', $upass . $salt));\n $urow = $usel->fetch();\n // check credentials\n if (empty($urow)) {\n return false;\n } else {\n return true;\n }\n}", "public function receptlogin($name,$password)\n {\t\n \t$role=\"receptionist\";\n $sql = \"SELECT * FROM admin_login WHERE admin_name = '\".$name.\"' and password = '\".$password.\"' and role = '\".$role.\"'\";\n\t\t$query = $this->db->query($sql);\n\t\t\n// Store Procedure for verify user by username and password\n \n if ($query->num_rows() == 1) {\n \t\treturn $query->result();\t \t\t\n } else {\n \treturn false;\n\t \t\t\n } \n\t }", "function lfl_login($userName, $userPass)\n{\n $userId = null;\n $link = lfl_connect();\n if($link)\n {\n $sql = \"SELECT * FROM \" . TABLE_USER . \" WHERE username='\" . mysqli_real_escape_string($link, $userName) . \"'\";\n $result = mysqli_query($link, $sql);\n if($result !== false)\n {\n if(($array = mysqli_fetch_assoc($result)) != null)\n {\n if(password_verify($userPass, $array['password']))\n {\n $userId = $array['userId'];\n $_SESSION['user'] = $array;\n $_SESSION['user']['password'] = null;\n }\n }\n mysqli_free_result($result);\n }\n }\n return $userId;\n}", "function login_user($username, $pwd){\n global $db;\n $username = addslashes($username);\n $pwd = addslashes($pwd);\n $pattern = \"/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z-0-9]+((\\.|-)[A-Za-z-0-9]+)*\\.[A-Za-z-0-9]+$/\";\n if(preg_match($pattern, $username)){\n $email_check = sorter_email($username, $pwd);\n } else {\n $email_check = sorter_user($username, $pwd);\n }\n return $email_check;\n}", "public function loginByUserAndPassword($username, $password) {\r\n $result = mysql_query(\"select * from tbl_users where username = '\".$username.\"' and password = '\".md5($password).\"'\") or die(mysql_error());\r\n // check for result \r\n $no_of_rows = mysql_num_rows($result);\r\n if ($no_of_rows > 0) {\r\n $result = mysql_fetch_array($result);\r\n return $result;\r\n } else {\r\n // user not found\r\n return false;\r\n }\r\n }", "function passwordMatch($id, $password) {\n \n $userdata = $this->getUserDataByUserId($id);\n \n // use pass word verify to decrypt the pass stored in the database and compare it eith the one user provided\n if(password_verify($password,$userdata['pwd'])) {\n return true;\n } else {\n return false;\n }\n \n \n }", "function adminLogin($username, $password){\r\n \r\n $query = 'SELECT pass FROM users WHERE username = '.$username; \r\n \r\n $results = mysqli_query( $dbc , $query );\r\n \r\n $row = mysqli_fetch_array( $results , MYSQLI_ASSOC );\r\n \r\n return password_verify($password, $row['pass']);\r\n }", "public function login($userName, $password){\r\n\r\n\r\n try{\r\n $stmt = $this->query(\"SELECT `user_id`, firstname, lastname, email, `password` FROM users WHERE username=:username\");\r\n $stmt->execute(array(':username'=>$userName));\r\n if($stmt->rowCount() == 1){\r\n $userRow = $stmt->fetch(PDO::FETCH_ASSOC);\r\n if (password_verify($password, $userRow['password'])){\r\n $_SESSION['user_session'] = $userRow['username'];\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n }\r\n catch(PDOException $exception){\r\n echo(\"login ERROR: \" . $exception->getMessage());\r\n }\r\n }", "function f_get_seg_usuario_password(\n\t\t\t\t$txt_login,\n\t\t\t\t$txt_password\t\t\n\t\t){\n\t\t\tglobal $db;\n\t\t\t$query =\"\n\t\t\tselect \t*\n\t\t\tfrom\tseg_usuario\n\t\t\twhere\ttxt_password\t=\tpassword(SHA('$txt_password'))\n\t\t\tand\t\ttxt_login\t\t=\t'$txt_login'\";\n\t\t\t$row = $db->consultar_registro($query);\t\n\t\t\treturn $row;\n\t\t}", "function auth_user_exists($username)\n{\n return dbFetchCell(\"SELECT * FROM `users` WHERE `username` = ?\", array($username));\n}", "function checkAccount($name, $username){\n $query = \"SELECT * FROM users_account WHERE fullname = ? OR username = ?\";\n $paramType = \"ss\";\n $paramValue = array(\n $name,\n $username\n );\n $result = $this->db_handle->runquery($query, $paramType, $paramValue);\n return $result;\n }", "function authenticate($username='', $password='') {\n global $db;\n $username = $db->escape($username);\n $password = $db->escape($password);\n $sql = sprintf(\"SELECT id,username,password,user_level FROM users WHERE username ='%s' LIMIT 1\", $username);\n $result = $db->query($sql);\n if($db->num_rows($result)){\n $user = $db->fetch_assoc($result);\n $password_request = sha1($password);\n if($password_request === $user['password'] ){\n return $user['id'];\n }\n }\n return false;\n }", "public function findUsernameMatch($name) {\r\n \t\t# Set up database query\r\n \t\t$statement = $this->DB->prepare(\"SELECT User_Name, User_ID FROM users WHERE User_Name = :nomen;\");\r\n \t\t$statement->bindParam('nomen', $name);\r\n \t\t$statement->execute();\r\n \t\t$row = $statement->fetch(PDO::FETCH_ASSOC); # row might be empty\r\n \t\t$row['status'] = 'success'; # this makes sure row stores something\r\n \t\treturn json_encode($row);\r\n\r\n\t }", "function checkUserData($dbh, $user)\n{\n $query = \"SELECT username, password \n FROM users \n WHERE username = :username\";\n $stmt = $dbh->prepare($query);\n $stmt->execute(array('username' => $user));\n $row = $stmt->fetch();\n return $row;\n}", "function usernameExists(){\n\t $query = \"SELECT id, first_name, last_name, password\n\t FROM \" . $this->table_name . \"\n\t WHERE username = ?\n\t LIMIT 0,1\";\n\t \n\t $stmt = $this->conn->prepare( $query );\n\t $this->username=htmlspecialchars(strip_tags($this->username));\n\t $stmt->bindParam(1, $this->username);\n\t \n\t $stmt->execute();\n\t $num = $stmt->rowCount();\n\t \n\t if($num > 0){\n\t $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t \n\t $this->id = $row['id'];\n\t $this->first_name = $row['first_name'];\n\t $this->last_name = $row['last_name'];\n\t $this->password = $row['password'];\n\t \n\t return true;\n\t }\n\t return false;\n\t}", "function loginUser($user,$password){\n if($this->connection){\n $table = $this->getTableConstant();\n $query_selectUser = \"SELECT * FROM $table WHERE user=?\";\n $statement = $this->connection->prepare($query_selectUser);\n $statement->bind_param('s', $user);\n $statement->execute();\n $result = $statement->get_result();\n while($row = $result->fetch_assoc()){\n $hash = $row['password'];\n $userID = $row['id'];\n if(password_verify($password, $hash)){\n $_SESSION['loggedIn'] = true;\n $_SESSION['userName'] = $user;\n $_SESSION['userID'] = $userID;\n return true;\n }\n }\n }\n return false;\n }", "function getCustomerByUserAndPass($username, $password) {\n $query = \"SELECT * FROM `customers` WHERE `username`='$username' AND `password`='\". md5($password). \"'\";\n $result = Database::selectQuery($query);\n if(count($result) == 1) {\n return true;\n } else {\n return false;\n }\n }", "function get_user_by_user_name($user_name)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_name`='$user_name'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}", "function login_customer($email,$password) {\n global $db;\n // $password = sha1($email.$password);\n $query = 'SELECT customerID, email, firstName, lastName\n FROM customers\n WHERE email = :email\n AND password = :password';\n $statement = $db->prepare($query);\n $statement->bindValue(':email', $email);\n $statement->bindValue(':password', $password);\n $statement->execute();\n $user = $statement->fetch();\n $statement->closeCursor();\n return $user;\n\n}", "function logUser($db, $email, $password) {\n $email = mysqli_real_escape_string($db, $email);\n $password = mysqli_real_escape_string($db, $password);\n $consulta = \"SELECT id_usuario, email, password FROM usuarios\n WHERE email = '\" . $email . \"'\";\n $res = mysqli_query($db, $consulta);\n if(mysqli_num_rows($res) === 1) {\n $fila = mysqli_fetch_assoc($res);\n if(password_verify($password, $fila['password'])) {\n return $fila['id_usuario'];\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "public static function validateUserLoginPDO($context, $email,$pass){\n ////da un error si se cambia el variable resultado a result///\n \n $statment = $context->prepare(\"SELECT * FROM usuarios WHERE email= :email\");\n $statment->bindParam(\":email\", $email);\n $statment->execute();\n $count=$statment->rowCount();\n if($count ==1){\n $userData=$statment->fetch(PDO::FETCH_OBJ);\n //$isPassValid = password_verify($pass, $data->pass);\n $isPassValid = strcmp($pass, $userData->pass);;\n if($isPassValid == 0){\n return $userData; \n }else{\n return null;\n }\n }\n else{\n return null;\n }\n }", "public function getUser($username)\r\n {\r\n\r\n $stmt = $this->connection()->prepare(\"SELECT * FROM users WHERE username=? OR email=?\");\r\n \r\n $stmt->execute([$username,$username]);\r\n if($stmt->rowCount())\r\n {\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function dbloginCheck($user_login, $pwd)\n{\n $sql=\"SELECT * FROM ra_company WHERE _email = :email AND _password=:passwword\";\n $q = $this->conn->prepare($sql);\n $q->execute(array(':email'=>$user_login, ':passwword'=>md5($pwd))) or die(print_r($q->errorInfo()));\n $totalrow=$q->rowCount();\n if($totalrow==1){\n $data = $q->fetch(PDO::FETCH_ASSOC);\n return $data;\n}\n else{\n return 0;\n }\n}", "public function login($name,$password)\n {\t\n $sql = \"SELECT * FROM admin_login WHERE admin_name = '\".$name.\"' and password = '\".$password.\"'\";\n\t\t$query = $this->db->query($sql);\n\t\t\n// Store Procedure for verify user by username and password\n \n if ($query->num_rows() == 1) {\n \t\treturn $query->result();\t \t\t\n } else {\n \treturn false;\n\t \t\t\n } \n\t }", "function exists_and_correct($user, $pass, $pdo_obj)\n{\n // 1) There is a user with that username\n // 2) If the password matches\n // Returns an array of [#, user/admin] depending on what happens and whether they are a user or admin\n // Returns 0 if it works out\n // Returns 1 if it is the wrong password\n // Returns 2 if it the user doesn't exist\n $result = [2, 'user']; // Default is doesn't exist and is user\n\n //Look through users first\n $users = $pdo_obj->query(\"SELECT username, hashed_password from `users`\");\n foreach ($users as $u)\n {\n \tif ($user === $u['username'])\n \t{\n \t if ($pass === $u['hashed_password'])\n \t { // Password matches\n \t \t$result[0] = 0;\n \t \treturn $result;\n \t }\n \t else\n \t { // Password doesn't match\n \t \t$result[0] = 1;\n \t \treturn $result;\n \t }\n \t}\n }\n //Look through admins\n $admins = $pdo_obj->query(\"SELECT username, hashed_password from `admins`\");\n foreach ($admins as $a)\n {\n \tif ($user === $a['username'])\n \t{\n \t if ($pass === $a['hashed_password'])\n \t { // Password matches\n \t \t$result[0] = 0;\n \t \t$result[1] = \"admin\";\n \t \treturn $result;\n \t }\n \t else\n \t { // Password doesn't match\n \t \t$result[0] = 1;\n \t \t$result[1] = \"admin\";\n \t \treturn $result;\n \t }\n \t}\n }\n return $result;\n}", "public function getUser($username, $password) {\n $db = $this->config->get('Login');\n $loginTable = $db['TABLE'];\n $usernameRow = $db['TABLE_COLUMN_USER'];\n $passwordRow = $db['TABLE_COLUMN_PASS'];\n $password = sha1($password . $db['SALT']);\n $query = \"SELECT * FROM $loginTable WHERE `$usernameRow` = :username AND `$passwordRow` = :password LIMIT 1\";\n $result = $this->query(\n $query, \n array(\n ':username' => $username, \n ':password' => $password\n ), TRUE);\n if ($result && is_array($result)) {\n $user = array_pop($result);\n\n //We update the Last_Login column\n //The reason we use 2 queries is because not all \"user\" tables may have both columns!\n $update = \"UPDATE $loginTable SET last_login = CURRENT_TIMESTAMP WHERE id = :id\";\n $this->query($update, array(':id' => $user['id']));\n\n // We update the Attempts column\n $update = \"UPDATE $loginTable SET attempts = 0 WHERE id = :id\";\n $this->query($update, array(':id' => $user['id']));\n\n return $user;\n } else {\n return FALSE;\n }\n }", "public function login($username, $password) {\n $statement = self::$db -> prepare(\"SELECT user_id, username, password FROM users WHERE username = ?\");\n $statement -> bind_param(\"s\", $username);\n $statement -> execute();\n $result = $statement -> get_result() -> fetch_assoc();\n\n var_dump($result);\n// check if password is correct\n if (password_verify($password, $result['password'])){\n return true;\n }\n\n return false;\n }", "function find_login_password(string $login, string $password){\n $json = file_get_contents(ROUTE_DIR.'data/user.data.json');\n\n // 2 convertir le json en tableau\n $arrayuser = json_decode($json ,true);\n foreach ($arrayuser as $user) {\n if($user['login']==$login && $user['password']==$password){\n\n return $user;\n }\n }\n return[];\n}", "function validateLogin($data)\r\n\t{\r\n\t\t$user = $this->find(array('username' => $data['username'], 'password' => sha1($data['password'])), array('id', 'username'));\r\n\t\tif(empty($user) == false)\r\n\t\t\treturn $user['User'];\r\n\t\treturn false;\r\n\t}", "function veryfy_user($username, $password)\n\t{\n\t\t\n\t\t$params = array('iterationCount'=>'8', 'portableHashes'=>'false');\n\t\t$this->load->library('PasswordHash', $params);\n\t\t\n\t\t\n\t\t$query = \"SELECT * FROM users where user_name=?\";\n\t\t\n\t\t$q = $this->db->query($query,$username);\n\t\t\n\t\t\n\n\t\tif ($q->num_rows >0)\n\t\t{\n\t\t\t\n\t\t\t//check password \n\t\t\t\n\t\t\t$ok = 0;\n\t\t\t\n\t\t\t$row = $q->row();\n\t\t\t \n\t\t\t$enc_password_check = $this->passwordhash->CheckPassword($password, $row->user_password);\n\t\t\t\n\t\t\tif ($enc_password_check == 1)\n\t\t\t{\n\t\t\t\t\n\t\t\t\treturn $q;\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\n\t}", "function user_is_valid($username, $hash_pw)\n {\n // Connect to MySQL\n $link = get_link(TRUE);\n\n $username = mysqli_real_escape_string($link, $username);\n $query = \"\n SELECT * FROM User\n WHERE name = '$username' AND hash_pw = '$hash_pw'\";\n $result = mysqli_query($link, $query);\n if ($row = mysqli_fetch_array($result))\n return TRUE;\n mysqli_free_result($result);\n mysqli_close($link);\n return FALSE;\n }", "function validate_cred($email_local = null, $password_local = null){\n global $email;\n global $pwd;\n if ($email_local != null && $password_local != null){\n \n }\n else{\n $email_local = isset($_REQUEST[$email]) ? $_REQUEST[$email] : null;\n $password_local = isset($_REQUEST[$pwd]) ? $_REQUEST[$pwd] : null;\n \n }\n\n if ($email_local != null && $password_local != null){\n $conn = open_db_connection('localhost', ['new_user','Redbirdp1'], 'login');\n if ($conn ->connect_errno){\n echo('connection failed: ' . $conn->connect_error);\n }\n $statement = new Statement();\n // $statement->select([\"*\"])->from()->table(\"members\")->where(\"username\")->equals($email_local);\n $statement->select([\"*\"])->from()->table(\"members\");\n //echo $statement->get_statement();\n $result = query_db($conn, $statement);\n \n if ($result != null)\n {\n if ($result->num_rows > 0) {\n // output data of each row\n $flag = false;\n while($row = $result->fetch_row()) {\n //echo \"<br>\". $row;\n //echo \"<br>\" . $email_local . \" \" . $password_local;\n //echo \"<br>\" . $row[0];\n //echo \"<br>\" . $row[1];\n if ($row[0] == $email_local && $row[1] == $password_local){\n $flag = true;\n break;\n }\n }\n if ($flag){\n return true;\n }\n else{\n return false;\n }\n } else {\n echo \"0 results\";\n }\n return true;\n }\n echo '<br>Authentificaiton failed not a valid user';\n return true;\n }\n\n return false;\n\n}", "function get_user($usr, $pwd)\n {\n $sql = \"select * from sistemas_users where username = '\" . $usr . \"' and password = '\" . $pwd . \"'\";\n $query = $this->db->query($sql);\n if($query->num_rows() > 0){\n return $query->result();\n }else{\n return false;\n }\n \n }", "function is_password_valid ($password, $user_data) {\n // the one in the user records.\n $is_valid = $password == $user_data['password'];\n return $is_valid;\n}", "public function check_password(){\n\t\t$query = $this->check_username();\n\t\tif($query > 0){\n\t\t\tif(isset($_POST[\"submit\"])){\n\t\t\t\t$user = $_POST[\"uname\"];\n\t\t\t\t$pass = sha1($_POST[\"pword\"]);\n\n\t\t\t\t$query1 = $this->db->query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\tFROM administrator \n\t\t\t\t\t\t\t\t\t\t\tWHERE username LIKE '${user}' and password LIKE '${pass}'\");\n\t\t\t\tif($query1->num_rows() > 0){\n\t\t\t\t\treturn $query1->num_rows();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\techo \"Invalid username/password combination.<br/>\";\n\t\t\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\techo \"Username does not exist<br/>\";\n\t\t\techo \"<a href='login'>Back</a><br/>\";\n\t\t}\n\t}", "protected function _findUser($username, $password = null) {\n\t\t$userModel = $this->settings['userModel'];\n\t\tlist(, $model) = pluginSplit($userModel);\n\t\t$fields = $this->settings['fields'];\t\t\n\t\tif (is_array($username)) {\n\t\t\t$conditions = $username;\n\t\t} else {\n\t\t\t$conditions = array(\n\t\t\t\t\"BINARY \" . $model . '.' . $fields['username'] . \"='\" . $username.\"' \"\n\t\t\t);\n\t\t}\t\t\n\t\tif (!empty($this->settings['scope'])) {\n\t\t\t$conditions = array_merge($conditions, $this->settings['scope']);\n\t\t}\n\n\t\t$result = ClassRegistry::init($userModel)->find('first', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'recursive' => $this->settings['recursive'],\n\t\t\t'contain' => $this->settings['contain'],\n\t\t));\n\t\tif (empty($result[$model])) {\n\t\t\t$this->passwordHasher()->hash($password);\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = $result[$model];\n\t\tif ($password !== null) {\n\t\t\tif (!$this->passwordHasher()->check($password, $user[$fields['password']])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tunset($user[$fields['password']]);\n\t\t}\n\n\t\tunset($result[$model]);\n\t\treturn array_merge($user, $result);\n\t}", "public function login_check($email, $password) {\n\n $query = $this -> conn -> prepare('SELECT * FROM users WHERE email = :email');\n $query -> execute(array(':email' => $email));\n $data = $query -> fetchObject();\n $salt = $data -> salt;\n $db_user_password = $data -> user_password;\n\n if ($this -> verify_hash_pass($password.$salt,$db_user_password) ) {\n\n\n $user[\"name\"] = $data -> name;\n $user[\"email\"] = $data -> email;\n $user[\"unique_id\"] = $data -> unique_id;\n return $user;\n\n } else {\n\n return false;\n }\n\n }", "function checkLogin($db, $email, $password){\n\n\t\t// Prepare a query.\n\t\t$salt_query = $db->prepare(\"SELECT salt FROM user WHERE Email = :email\");\n\t\t$params = array(\":email\" => htmlspecialchars($email));\n\t\t$salt_query->execute($params);\n\t\n\t\t// See if anything was returned. Display an error if anything is.\n\t\tif($salt = $salt_query->fetch()){\n\t\t\n\t\t\t// Generate a hash to compare to what's in the database.\n\t\t\t$hash = hash('sha256', $salt[0] . htmlspecialchars($_POST['password']));\n\t\t\t\n\t\t\t// Compare the generated hash to the one in the database.\n\t\t\t$login_query = $db->prepare(\"\n\t\t\t\tSELECT Username FROM user\n\t\t\t\tWHERE\n\t\t\t\t\tEmail = :email\n\t\t\t\tAND\n\t\t\t\t\thash = :hash\n\t\t\t\");\n\t\t\t\n\t\t\t$params = array(\":email\" => htmlspecialchars($email),\n\t\t\t\t\t\t\t\":hash\" => $hash);\n\t\t\t\n\t\t\t// Retrieve the username.\n\t\t\t$login_query->execute($params);\n\t\t\tif($username = $login_query->fetch()){\n\t\t\t\treturn $username;\n\t\t\t}\n\t\t\t// Incorrect password.\n\t\t\telse{\n\t\t\t\t$returnInfo[\":code\"] = 1;\n\t\t\t\t$returnInfo[\":data\"] = \"Password is incorrect.\";\n\t\t\t\tdie(json_encode($returnInfo));\n\t\t\t}\n\t\t}\n\t\t// User doesn't exist.\n\t\telse{\n\t\t\t$returnInfo[\":code\"] = 1;\n\t\t\t$returnInfo[\":data\"] = \"There is no user associated with that email.\";\n\t\t\tdie(json_encode($returnInfo));\n\t\t}\n\t}", "public function findUserByCredentials(string $email, string $password): ?UserView;", "function checkUser($username,$password) {\n\t\tglobal $databaseConnect;\n\t\tglobal $databaseSelect;\n\t\tglobal $dbResult;\n\t\tglobal $dbCount;\n\t\tglobal $dbRow;\n\t\t\n\t\t$passCrypt = $this->makePassword($password);\n\t\t$dbResult = mysql_query('SELECT a.users_id, a.users_security, a.users_active, b.contacts_name_first FROM users a LEFT JOIN contacts b ON a.users_id = b.contacts_users_id WHERE a.users_username = \"'.addslashes($username).'\" AND a.users_password = \"'.$passCrypt.'\"',$databaseConnect);\n\t\t$dbRow = mysql_fetch_array($dbResult);\n\t\t$dbCount = mysql_num_rows($dbResult);\n\t\t\n\t\treturn $dbCount;\n\t\treturn $dbRow;\n\t}", "function proses_login($username,$password)\n {\n $row = $this->db->prepare('SELECT * FROM tbl_user WHERE username=username AND password=md5(password)');\n $row->execute(array($username,$password));\n $count = $row->rowCount();\n if($count > 0)\n {\n return $hasil = $row->fetch();\n }else{\n return 'gagal';\n }\n }", "public function getLoginUser($email,$password){\n $sql = \"SELECT * FROM tbl_user Where email = :email AND password = :password LIMIT 1\";\n $query = $this->pdo->prepare($sql);\n $query->bindValue(':email', $email);\n $query->bindValue(':password', $password);\n $query->execute();\n $result = $query->fetch(PDO::FETCH_OBJ);\n return $result;\n }", "function LoginCheck($username, $password) //check if user is login\n{\n global $connect;\n $query = \"SELECT * FROM User WHERE Username = :username AND Password = :password\";\n try {\n $statement = $connect->prepare($query);\n $statement->bindValue(':username', $username, PDO::PARAM_STR);\n $statement->bindValue(':password', $password, PDO::PARAM_STR);\n $statement->execute();\n $count = $statement->rowCount();\n if ($count > 0) {\n $result = $statement->fetch();\n return $result;\n } else return false;\n } catch (PDOException $e) {\n }\n}", "function lookupUsername($conn, $username)\n{\n $stmt = $conn->prepare(\"SELECT * FROM users WHERE username=?\");\n $stmt->bind_param(\"s\", $username);\n \n $stmt->execute();\n $result = $stmt->get_result();\n $num_rows = mysqli_num_rows($result);\n if ($num_rows == 0)\n {\n // not found \n // echo 'not found';\n return 0;\n }\n else if ($num_rows > 1)\n {\n // too many results ... exit!\n // echo 'too many found';\n header(\"Location: logout.php\");\n }\n else \n {\n // one result, return the row.\n // echo 'one found';\n return $result->fetch_assoc(); \n }\n}", "function getCredentialsAreValid($username, $passwordHash) {\r\n global $db;\r\n\r\n // Query String\r\n $query = \"\r\n SELECT *\r\n FROM user\r\n WHERE user_name = :username\";\r\n\r\n try {\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':username', $username);\r\n $statement->execute();\r\n $result = $statement->fetch();\r\n $statement->closeCursor();\r\n // If user doesn't exist, return false\r\n if (empty($result))\r\n return false;\r\n\r\n return ($result['password'] == $passwordHash);\r\n } catch (PDOException $ex) {\r\n echo $ex->getMessage();\r\n exit;\r\n }\r\n}", "function checkLogginData($username, $password, $connection) {\n $q = mysqli_query($connection, 'SELECT user_name, user_password, user_id\nFROM users \nWHERE user_name = \"' . $username . '\" AND user_password = \"' . $password . '\"'\n );\n\n if (!$q) {\n echo 'Възникна грешка с базата данни!!!';\n exit;\n } else {\n if ($q->num_rows == 0) {\n return false;\n } else {\n $row = $q->fetch_assoc();\n $_SESSION['username'] = $row['user_name'];\n $_SESSION['user_id'] = $row['user_id'];\n return true;\n }\n }\n}", "public function LoginUserByUserNameAndPassword($username, $password) {\n if ($username == \"\" || $password == \"\") {\n $response[\"error\"] = 1;\n $response[\"error_msg\"] = \"Please fill all information.\";\n return $response;\n }\n $query = \"select * from users where username='$username' and active='Y'\";\n //echo $query;\n $result = mysql_query($query); // or die(mysql_error());\n // check for result \n $no_of_rows = mysql_num_rows($result);\n\n if ($no_of_rows > 0) {\n $result = mysql_fetch_array($result);\n\n $encrypted_password = $result['userpass'];\n $hash = $this->checkhashSSHA($result['salt'], $password);\n\n // check for password equality\n if ($encrypted_password == $hash) {\n // user authentication details are correct\n $response[\"error\"] = 0;\n $response[\"success\"] = 1;\n $response[\"userid\"] = $result['id'];\n $response[\"username\"] = $result['fname'] . \" \" . $result['lname'];\n $response[\"usertype\"] = $result['usertype'];\n return $response;\n } else {\n $response[\"error\"] = 1;\n $response[\"error_msg\"] = \"Invalid user name or password!\";\n return $response;\n }\n } else {\n $response[\"error\"] = 1;\n $response[\"error_msg\"] = \"Invalid user name or password!\";\n return $response;\n }\n }", "public function getByUsernamePass()\n {\n $sth = $this->db->prepare(\"SELECT id FROM \" . static::tableName() . \" WHERE\n\t\t\t\tusername = :username AND password = MD5(:password)\");\n $sth->execute(array(\n ':username' => $this->username,\n ':password' => $this->password\n ));\n $data = $sth->fetch();\n return $data;\n }", "function get_password($data) {\n $sql = \"SELECT\n *\n FROM\n logins\n WHERE \n password\n LIKE \n '$data'\n \";\n\n $query = $this->data->prepare($sql);\n $query->execute();\n\n $result = $query->rowCount();\n return $result;\n }", "public function check($username, $password) {\n $isExistUserName = false;\n $isExistUserName = Account::whereRaw('UserName = ? and Password = ?', [$username, $password])->first();\n \tif($isExistUserName) \n\t{\n \techo \"5dcfbae053cfd29905e90b3c8fdc4b45a1d744f072f1c850ec795ecc825a3c43\";\n \t}\n \telse \n\t{\n \techo \"5dcfbae053cfd29905e90b3c8fdc4b45ald744f072f1c850ec795cec825a3c43\";\n \t}\n }", "function getUserRowByUsernamePass($username, $password) {\n //mysql object\n $mysql = new my_mysql();\n $query = \"SELECT * FROM user_logging WHERE username='$username' AND pass=PASSWORD('$password');\";\n $res = $mysql->readQuery($query);\n if (!$res) {\n die($mysql->connect_error);\n }else {\n return $res->fetch_assoc();\n }\n}", "public function login($user, $password) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere (idUser=? or emailAddress=?) and pword=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n $statement->execute(array($user, $user, $password));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new User($statement->fetch(PDO::FETCH_ASSOC));\n }", "public function userLogin($userModel) {\n // Making a variable for the username\n $username = $userModel->getUsername();\n $password = $userModel->getPassword();\n\n $query = \"SELECT * FROM user WHERE username = ?\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $username);\n if ($stmt->execute()) {\n // Getting the user\n $result = $stmt->fetch(PDO::FETCH_OBJ);\n var_dump($result);\n\n // Checking if passwords match\n if (password_verify($password, $result->password)) {\n // Gettint the userID and returning it\n $userID = $result->id;\n\n return $userID;\n } else {\n return null;\n }\n } else {\n return null;\n }\n }", "function getUser($email, $password = '')\n{\n $resource = dbConnect();\n $query = \"SELECT id, name, email, phone FROM users WHERE email = '$email'\";\n if (!empty($password)) {\n $query .= \" AND password = '$password'\";\n }\n $query = mysqli_query($resource, $query);\n\n return mysqli_fetch_row($query);\n}", "public function login( $username, $password )\r\n\t{\r\n\t\t$this->debug->guard( );\r\n\r\n\t\t$sql = $this->database->prepare( \"SELECT user_id, user_key, user_username FROM \" . $this->configuration->getConfiguration( 'zeitgeist', 'tables', 'table_users' ) . \" WHERE user_username = ? AND user_password = ? AND user_active = '1'\" );\r\n\t\t$sql->bindParam( 1, $username );\r\n\t\t$sql->bindParam( 2, md5( $password ) );\r\n\r\n\t\tif ( !$sql->execute( ) )\r\n\t\t{\r\n\t\t\t$this->debug->write( 'Problem logging in: could not read user information from user table', 'warning' );\r\n\t\t\t$this->messages->setMessage( 'Problem logging in: could not read user information from user table', 'warning' );\r\n\r\n\t\t\t$this->debug->unguard( false );\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// check if there is a user with the given name and password in the users table\r\n\t\tif ( $sql->rowCount( ) > 0 )\r\n\t\t{\r\n\t\t\t// as we expect a unique name / password combination, we only need to get the first row\r\n\t\t\t// if multiple users with the same username are allowed you need to change this\r\n\t\t\t// see also method loadUserdata() in userfunctions.class.php\r\n\t\t\t$row = $sql->fetch( PDO::FETCH_ASSOC );\r\n\t\t\t$ret = $row[ 'user_id' ];\r\n\r\n\t\t\t$this->debug->unguard( $ret );\r\n\t\t\treturn $ret;\r\n\t\t}\r\n\r\n\t\t$this->debug->write( 'Problem logging in: user not found/is inactive or password is wrong', 'warning' );\r\n\t\t$this->messages->setMessage( 'Problem logging in: user not found/is inactive or password is wrong', 'warning' );\r\n\r\n\t\t$this->debug->unguard( false );\r\n\t\treturn false;\r\n\t}" ]
[ "0.7169176", "0.7157628", "0.7125779", "0.7084771", "0.7018154", "0.7011808", "0.70005065", "0.69344866", "0.68455285", "0.68288004", "0.68284893", "0.68186194", "0.6808955", "0.6807563", "0.6776958", "0.6771975", "0.6762128", "0.6743229", "0.674097", "0.67251104", "0.671114", "0.6701739", "0.66846395", "0.6680604", "0.6664717", "0.6663551", "0.66530216", "0.6651127", "0.66334945", "0.6622299", "0.6619745", "0.6613148", "0.6595602", "0.65940887", "0.65874416", "0.65802336", "0.6573202", "0.65722173", "0.6566289", "0.65609753", "0.65592295", "0.6548198", "0.65415686", "0.6539103", "0.6526417", "0.65256745", "0.65236765", "0.6523073", "0.65221304", "0.6521056", "0.65164423", "0.6507067", "0.6505314", "0.649333", "0.649182", "0.6476754", "0.64711547", "0.64686555", "0.6457837", "0.6457342", "0.6448485", "0.64459693", "0.6445912", "0.6445905", "0.64426583", "0.6439453", "0.6435347", "0.6433977", "0.64307255", "0.64263666", "0.6417787", "0.64089066", "0.6408538", "0.64033973", "0.64032865", "0.6402914", "0.6402799", "0.63964057", "0.6396055", "0.63946366", "0.63937074", "0.63892645", "0.6387432", "0.6385013", "0.6373513", "0.63726217", "0.63677794", "0.6367772", "0.636631", "0.63658196", "0.6363113", "0.6361941", "0.6361513", "0.6358578", "0.6358392", "0.63555205", "0.6353249", "0.6347759", "0.6343206", "0.63418293" ]
0.73079586
0
Adds the recommendable flag to the product data.
protected function _azGetArticleTagsFromArticleData( $oArticle, $oData ) { $aTags = parent::_azGetArticleTagsFromArticleData( $oArticle, $oData ); if ( is_array( $aTags ) ) { // add recommendable flag: $aTags[ 'e:recommendable' ] = $oArticle->azEpoqIsRecommendable() ? 'true' : 'false'; } return $aTags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function recommend()\n {\n $this->recommendations()->save(\n new Recommendation(['user_id' => auth()->id()])\n );\n }", "function addRecommendation($recommendation) {\n return $this->databaseInsertRecord(\n $this->tableRecommendations, NULL, $recommendation);\n }", "private function setEnableReviews() {\n $this->product->set_reviews_allowed($this->wcData->isEnableReviews());\n }", "public function addToProductRecommendations(\\Nogrod\\eBaySDK\\Trading\\ProductInfoType $product)\n {\n $this->productRecommendations[] = $product;\n return $this;\n }", "public function recommendLogic($review = null, $requestQuery = null)\n {\n // $positive_recommendation = $recommend ? $recommend : false;\n\n $recommend = false;\n $positive_recommendation = false;\n if (isset($requestQuery['recommend'])) {\n $recommend = true;\n if ($requestQuery['recommend'] == \"no\") {\n $positive_recommendation = false;\n }\n if ($requestQuery['recommend'] == \"yes\") {\n $positive_recommendation = true;\n }\n }\n // dd($recommend);\n $this->getController()->set('recommend', $recommend);\n $this->getController()->set('positive_recommendation', $positive_recommendation);\n }", "public function setRecommend($recommend)\n {\n $this->recommend = $recommend;\n\n return $this;\n }", "public function setRecommend($recommend)\n {\n $this->recommend = $recommend;\n\n return $this;\n }", "public function recommendation()\n {\n }", "public function getProductRecommendations()\n {\n return $this->productRecommendations;\n }", "public function getRecommend()\n {\n return $this->recommend;\n }", "public function getRecommend()\n {\n return $this->recommend;\n }", "public function enableFlag()\n {\n $this->state->setItem(self::SAFE_ATTRIBUTE_FLAG, true);\n }", "public function getRecommendedProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table WHERE recommended = 'yes' LIMIT 4;\";\n $product = $this->db->executeFetchAll($sql);\n return $product;\n }", "public function setreviewedAttribute()\n {\n $attribute_name = \"reviewed\";\n\n $this->attributes[$attribute_name] = 1;\n }", "protected function getExtraInstallment()\n {\n return false;\n }", "public function getAttributeRecommendations()\n {\n return $this->attributeRecommendations;\n }", "private function __adjustProduct (&$product, $skipRelations = true) {\n global $app;\n // adjusting\n $productID = intval($product['ID']);\n $product['ID'] = $productID;\n $product['OriginID'] = intval($product['OriginID']);\n $product['CategoryID'] = intval($product['CategoryID']);\n $product['_category'] = API::getAPI('shop:categories')->getCategoryByID($product['CategoryID']);\n $product['_origin'] = API::getAPI('shop:origins')->getOriginByID($product['OriginID']);\n $product['Attributes'] = $this->getProductAttributes($productID);\n $product['IsPromo'] = intval($product['IsPromo']) === 1;\n $product['IsFeatured'] = intval($product['IsFeatured']) === 1;\n $product['IsOffer'] = intval($product['IsOffer']) === 1;\n $product['ShowBanner'] = intval($product['ShowBanner']) === 1;\n\n // create display product title\n $displayName = array();\n if (!empty($product['Name'])) {\n $displayName[] = $product['Name'];\n }\n if (!empty($product['_origin'])) {\n $displayName[] = $product['_origin']['Name'];\n }\n if (!empty($product['Model'])) {\n $displayName[] = $product['Model'];\n }\n $product['_displayNameFull'] = implode(' ', $displayName);\n $product['_displayName'] = implode(' ', array_slice($displayName, 1));\n\n // misc data\n if (!$skipRelations) {\n $product['Relations'] = $this->getProductRelations($productID);\n }\n\n // features\n $product['Features'] = $this->getProductFeatures($productID);\n\n // media\n $product['Images'] = $this->getProductImages($productID);\n $product['Videos'] = $this->getProductVideos($productID);\n $product['Banners'] = $this->getProductBanners($productID);\n\n // Utils\n $product['viewExtrasInWish'] = API::getAPI('shop:wishlists')->productIsInWishList($productID);\n $product['viewExtrasInCompare'] = API::getAPI('shop:comparelists')->productIsInCompareList($productID);\n $product['viewExtrasInCartCount'] = API::getAPI('shop:orders')->productCountInCart($productID);\n\n // is available\n $product['_available'] = in_array($product['Status'], dbquery::getProductStatusesWhenAvailable());\n $product['_archived'] = in_array($product['Status'], dbquery::getProductStatusesWhenDisabled());\n\n // promo\n $promo = API::getAPI('shop:promos')->getSessionPromo();\n $product['_promo'] = $promo;\n\n // prices and actual price\n $price = floatval($product['Price']);\n $prevprice = floatval($product['PrevPrice']);\n $actualPrice = 0;\n $priceHistory = $this->getProductPriceHistory($productID);\n if ($product['IsPromo'] && !empty($promo) && !empty($promo['Discount']) && $promo['Discount'] > 0) {\n $product['_promoIsApplied'] = true;\n $actualPrice = (100 - intval($promo['Discount'])) / 100 * $price;\n } else {\n $product['_promoIsApplied'] = false;\n $actualPrice = $price;\n }\n $actualPrice = floatval($actualPrice);\n $savingValue = $prevprice - $actualPrice;\n unset($product['Price']);\n unset($product['PrevPrice']);\n\n // apply currencies\n $convertedPrices = API::getAPI('shop:exchangerates')->convertToRates($actualPrice);\n $convertedPrevPrices = API::getAPI('shop:exchangerates')->convertToRates($prevprice);\n $convertedSavings = API::getAPI('shop:exchangerates')->convertToRates($savingValue);\n\n // create product prices object\n $product['_prices'] = array(\n 'price' => $price,\n 'previous' => $prevprice,\n 'actual' => $actualPrice,\n 'others' => $convertedPrices,\n 'history' => $priceHistory,\n 'previousothers' => $convertedPrevPrices,\n 'savings' => $savingValue,\n 'savingsothers' => $convertedSavings\n );\n\n $product['ShopDiscount'] = $prevprice > 0 ? 100 - intval($price * 100 / $prevprice) : 0;\n $product['IsBigSavings'] = $product['ShopDiscount'] > 5;\n $product['GoodToShowPreviousPrice'] = $savingValue > 10;\n\n if (!empty($product['Attributes']['PROMO_TEXT'])) {\n $product['Attributes']['PROMO_TEXT'] = str_replace('[DisplayName]', $product['_displayName'], $product['Attributes']['PROMO_TEXT']);\n }\n\n // // save product into recently viewed list\n // $isDirectRequestToProduct = Request::hasInGet('id') || Request::hasInGet('params');\n // if (Request::isGET() && !$app->isToolbox() && !empty($isDirectRequestToProduct)) {\n // $recentProducts = isset($_SESSION[$this->_listKey_Recent]) ? $_SESSION[$this->_listKey_Recent] : array();\n // $recentProducts[] = $productID;\n // $_SESSION[$this->_listKey_Recent] = array_unique($recentProducts);\n // }\n\n // var_dump($product);\n return $product;\n }", "public function recommend($POST) {\r\n\t\t$ret = array('status' => 1);\r\n\r\n\t\tif (!isset($POST['id'])\r\n\t\t\t|| !ctype_digit($POST['id'])\r\n\t\t) {\r\n\t\t\t$ret['msg'] = 'Invalid id';\r\n\t\t\t$ret['status'] = 0;\r\n\r\n\t\t\treturn $ret;\r\n\t\t}\r\n\r\n\t\t$sql = 'INSERT INTO recommends (post_id, user_id, status)\r\n\t\t\t\tVALUES (:post_id, :user_id, (1))\r\n\t\t\t\tON DUPLICATE KEY UPDATE status = (1 - status)';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\t\t$sth->execute(array('post_id' => $POST['id'],\r\n\t\t\t\t\t\t 'user_id' => $GLOBALS['user']['id']));\r\n\r\n\t\t$sql = 'SELECT status FROM recommends \r\n\t\t\t\tWHERE post_id = :post_id AND user_id = :user_id LIMIT 1';\r\n\t\t$sth = $this->db->prepare($sql);\r\n\t\t$sth->execute(array('post_id' => $POST['id'],\r\n\t\t\t\t\t\t 'user_id' => $GLOBALS['user']['id']));\r\n\t\t$row = $sth->fetch();\r\n\t\t$ret['recommended'] = $row['status'];\r\n\t\t\r\n\t\t$query = $this->db->prepare(\"\r\n\t\t\tSELECT `users`.`name` FROM `recommends`\r\n\t\t\tRIGHT JOIN `users` ON `recommends`.`user_id` = `users`.`id`\r\n\t\t\tWHERE `recommends`.`post_id` = :post_id AND `recommends`.`status` = (:status)\r\n\t\t\tLIMIT 4\r\n\t\t\");\r\n\t\t$query->execute(array(\r\n\t\t\t'post_id' => $POST['id'],\r\n\t\t\t'status' => 1\r\n\t\t));\r\n\t\t$rows = $query->fetchAll();\r\n\t\t$ret['users-recommending'] = $rows;\r\n\r\n\t\treturn $ret;\r\n\t}", "public function recommend(Request $request)\n { \n try {\n $recommended_product_number = (int)$request->product_number;\n\n recommendProductsJob::dispatch(['recommended_product_number' => $recommended_product_number])->onQueue('recommendProducts');\n \n session()->flash('success', trans('admin::app.predictionio.successfully_recommended') );\n \n return redirect()->back();\n } catch (\\Exception $e) {\n \\Log::info($e);\n }\n \n }", "public function recommendations()\n {\n return $this->morphMany(Recommendation::class, 'recommendable');\n }", "public function issetProductRecommendations($index)\n {\n return isset($this->productRecommendations[$index]);\n }", "private function updateProductVisibility(ProductInterface $product, Request $request): void\n {\n $visible = $request->request->get('visible') === '1' ? true : false;\n\n if ($visible) {\n $product->enable();\n } else {\n $product->disable();\n }\n }", "public function setAccessRecommendation(?string $value): void {\n $this->getBackingStore()->set('accessRecommendation', $value);\n }", "public function setNewWish($product, $quantity, $option = null){\r\n\t\r\n\t\tarray_push($this->product_array, $product);\r\n\t\tarray_push($this->quantity_array, $quantity);\r\n\t\t\r\n\t\tif($option == \"alreadyExists\"){\r\n\t\t\tarray_push($this->exists, \"true\");\r\n\t\t}\r\n\t\telse if($option == \"delete\"){\r\n\t\t\tarray_push($this->exists, \"delete\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tarray_push($this->exists, \"false\");\r\n\t\t}\r\n\t}", "public function isUsableProduct(Mage_Catalog_Model_Product $product)\n {\n $stockItem = $product->getStockItem();\n if(!isset($stockItem))\n {\n return false;\n }\n if($this->isValidProductType($product) && $stockItem->getIsInStock())\n {\n return true;\n }\n \n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function isSalable()\n {\n Mage::dispatchEvent('catalog_product_is_salable_before', array(\n 'product' => $this\n ));\n\n $salable = $this->isAvailable();\n\n $object = new Varien_Object(array(\n 'product' => $this,\n 'is_salable' => $salable\n ));\n Mage::dispatchEvent('catalog_product_is_salable_after', array(\n 'product' => $this,\n 'salable' => $object\n ));\n return $object->getIsSalable();\n }", "public function setProductTypeWithQty(bool $value): ElisaProductInterface;", "public static function update_commerce_enabled_for_product( \\WC_Product $product, $is_enabled ) {\n\n\t\t$product->update_meta_data( self::COMMERCE_ENABLED_META_KEY, wc_bool_to_string( $is_enabled ) );\n\t\t$product->save_meta_data();\n\t}", "public function hasPurify(){\n return $this->_has(18);\n }", "public function isAvailable()\n {\n return $this->getTypeInstance(true)->isSalable($this)\n || Mage::helper('catalog/product')->getSkipSaleableCheck();\n }", "private function recommendation($skill){\n $recommendationPoint=0;\n $recommendationPointMaster=0;\n $recommendationPointFive=0;\n $recommendationPointFour=0;\n $recommendationPointThree=0;\n $recommendationPointTwo=0;\n $recommendationPointOne=0;\n $recommendations=$skill->recommendations;\n foreach($recommendations as $recommendation){\n $recommendator=$recommendation->user;\n $rate=$recommendator->rate;\n if($recommendator->is('influencer')){\n $recommendationPointMaster+=Config::get('rate')['recommendation']['attributes']['master']['value'];\n if($recommendationPointMaster>=Config::get('rate')['recommendation']['attributes']['master']['max_value']){\n $recommendationPointMaster=Config::get('rate')['recommendation']['attributes']['master']['max_value'];\n }\n }elseif($rate==5){\n $recommendationPointFive+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFive>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFive=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==4){\n $recommendationPointFour+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFour>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFour=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==3){\n $recommendationPointThree+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointThree>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointThree=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==2){\n $recommendationPointTwo+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointTwo>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointTwo=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==1){\n $recommendationPointOne+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointOne>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointOne=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }\n $recommendationPoint=$recommendationPointMaster+$recommendationPointFive+$recommendationPointFour+$recommendationPointThree+$recommendationPointTwo+$recommendationPointOne;\n }\n //finalize the recommendation calculation points\n if($recommendationPoint>Config::get('rate')['recommendation']['result'][5]){ //5 star\n $calculatedRecommendationPoint=5;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][4] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][5]){ //4 star\n $calculatedRecommendationPoint=4;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][3] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][4]){ //3 star\n $calculatedRecommendationPoint=3;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][2] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][3]){ //2 star\n $calculatedRecommendationPoint=2;\n }elseif($recommendationPoint>=Config::get('rate')['recommendation']['result'][1] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][2]){ //1 star\n $calculatedRecommendationPoint=1;\n }else{ //none star\n $calculatedRecommendationPoint=1;\n }\n $finalRecommendationPoint=$calculatedRecommendationPoint*Config::get('rate')['recommendation']['weight'];\n return $finalRecommendationPoint;\n }", "public function enable() {\n\t\t$this->update(FALSE);\n\t}", "public function getIsProfitableAttribute()\n {\n if ($this->line_type == 'product')\n return true;\n\n if ( Configuration::isTrue('INCLUDE_SERVICE_LINES_IN_PROFIT') && ($this->line_type == 'service') )\n return true;\n\n if ( Configuration::isTrue('INCLUDE_SHIPPING_COST_IN_PROFIT') && ($this->line_type == 'shipping') )\n return true;\n\n return false;\n }", "protected function _beforeSave()\r\n {\r\n \t// invoke the parent method\r\n \tparent::_beforeSave();\r\n // check the product type (has to be a package product)\r\n $typeInstance = $this->getTypeInstance(true);\r\n // check if a ID is available, if not the package is new\r\n if ($this->getId() == 0 &&\r\n $typeInstance instanceof Faett_Package_Model_Product_Type) {\r\n $this->_isNew = true;\r\n $this->setHasOptions(1);\r\n }\r\n }", "public function install()\n {\n if (Shop::isFeatureActive())\n Shop::setContext(Shop::CONTEXT_ALL);\n\n\n if (!parent::install() ||\n !$this->registerHook('productfooter') ||\n !$this->registerHook('header') ||\n !Configuration::updateValue('BLOCKPRODUCTMANUFACTURER_NAME', 'Block Product Manufacturer')\n )\n return false;\n\n return true;\n }", "private function setSoldIndividually() {\n $this->product->set_sold_individually($this->wcData->isSoldIndividually());\n }", "public function add($product) {\n $ajout = false;\n if ($this->products_id) {\n if (array_key_exists($product->id,$this->products_id)) {\n if ($product->quantity >= $this->products_id[\"$product->id\"]++){\n $this->products_id[\"$product->id\"]++;\n $ajout = true;\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id += [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id = [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n if($ajout){\n $this->total_product ++;\n if($this->discountisused){\n $this->total_price += ($product->price - $product->price * $this->discounts[$this->discountused]/100);\n $this->discountamount += $product->price*$this->discounts[$this->discountused]/100;\n }\n\n else\n $this->total_price += $product->price;\n }\n}", "public function setCanShipPartiallyItem($flag);", "protected function setOfferApplicablePricing ()\n {\n $offerApplicableAccountHeads = $this->getOfferApplicableAccountHeads();\n\n foreach ( $this->request->pricing as $accountHead => $amount ) {\n if ( in_array($accountHead, $offerApplicableAccountHeads) ) {\n $this->offerApplicablePricing[ $accountHead ] = $amount;\n $this->offerApplicableAmount += $amount;\n }\n }\n }", "public function setRecommendedSku(?string $value): void {\n $this->getBackingStore()->set('recommendedSku', $value);\n }", "private function getExistProductRecount() {\n return false;\n }", "public function isApplicable();", "private function addProduct($productData){\n if( $this->model_extension_module_export_yml->isProductExist($productData['model']) ) {\n $this->model_extension_module_export_yml->updateProduct($productData);\n }else {\n $this->model_extension_module_export_yml->insertProduct($productData);\n }\n }", "public function setProductRecommendations(array $productRecommendations)\n {\n $this->productRecommendations = $productRecommendations;\n return $this;\n }", "function is_item_enabled() {\n\t\tif (get_post_meta($this->id, '_apptivo_enabled', true)=='yes') return true;\n\t\treturn false;\n\t}", "function beforeSave(){\n\t\t\t// Get the rate\n\t\t\t$rate = 1 / $this->_getRate();\n\n\t\t\t// Convert it back to USD\n\t\t\tif(!empty($this->data['Product']['rrp'])){\n\t\t\t\t$this->data['Product']['rrp'] = $this->data['Product']['rrp'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['start_price'])){\n\t\t\t\t$this->data['Product']['start_price'] \t= $this->data['Product']['start_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['delivery_cost'])){\n\t\t\t\t$this->data['Product']['delivery_cost'] = $this->data['Product']['delivery_cost'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['fixed_price'])){\n\t\t\t\t$this->data['Product']['fixed_price'] \t= $this->data['Product']['fixed_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['minimum_price'])){\n\t\t\t\t$this->data['Product']['minimum_price'] = $this->data['Product']['minimum_price'] * $rate;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}", "function IsProduct() {\r\n\t\treturn true;\r\n\t}", "public function isApplicable() : bool{\r\n $items = $this->order->getOrderItems();\r\n foreach($items as $item){\r\n // checks every item for order if the quantity is >= $products_nr\r\n if($item[\"quantity\"] >= $this->products_nr){\r\n $tmp_item = $this->order->getProductById($item[\"product-id\"]);\r\n\r\n // checks if product category equals $category_id \r\n if((int)$tmp_item[\"category\"] === $this->category_id){\r\n $tmp_item[\"qty\"] = $item[\"quantity\"];\r\n\r\n // saves the discounted items in a temporary array\r\n $this->items_matching[] = $tmp_item;\r\n\r\n // stores the total cost of the discount\r\n $this->discounted_value += $tmp_item[\"price\"] * floor($item[\"quantity\"] / $this->products_nr);\r\n }\r\n }\r\n }\r\n\r\n if($this->discounted_value > 0){\r\n $this->is_applicable = true;\r\n $this->calculateDiscount();\r\n return true; \r\n }\r\n return false;\r\n }", "public function store(ProductRequest $request)\n {\n// $data = $request->all();\n// foreach ($checkboxes as $checkbox) {\n// if(!isset($data[$checkbox]) {\n// $data[$checkbox] = 0;\n// }\n// }\n $data = $request->all();\n\n if(!isset($data['featured'])) {\n $data['featured'] = 0;\n }\n if(!isset($data['recommended'])) {\n $data['recommended'] = 0;\n }\n\n $tagsIDs = $this->getTagsIDs($data['tags']);\n unset($data['tags']);\n $this->product->fill($data);\n $this->product->save();\n $this->product->tags()->sync($tagsIDs);\n\n //\\Session::flash('product_added', 'Product has been successfully added in the database.');\n\n return redirect()->route('products');\n }", "public function productDisableStatus($customerId){\n $productCollections = Mage::getModel ( 'catalog/product' )->getCollection ()->addAttributeToFilter ( 'userid', $customerId)->addAttributeToFilter ( 'type_id', array (\n 'eq' => 'property'\n ) );\n /**\n * Iterating the loop\n */\n foreach ( $productCollections as $product ) {\n /**\n * Get Product Id\n */\n $productId = $product->getEntityId ();\n $data = array (\n 'propertyapproved' => 0,\n 'status' => 0\n );\n $model = Mage::getModel ( 'catalog/product' )->load ( $productId )->addData ( $data );\n $model->setId ( $productId )->save ();\n }\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 addItem(string $sku): bool;", "function addconfig_to_favoritesAction()\n\t{\n\t\t$session = Mage::getSingleton('customer/session');\n\t\t $this->_customerId = $session->getCustomer()->getId();\n\t\t $list = Mage::getModel('amlist/list');\n\t \t $listId = $this->getRequest()->getParam('list');\n\t\t $post = $this->getRequest()->getPost();\n\t\t $products = $post['product'];\n\t\t if (!$listId){ //get default - last\n\t $listId = Mage::getModel('amlist/list')->getLastListId($this->_customerId);\n\t \t }\n\t \t if (!$listId) \n\t\t { \n\t\t //create new\n\t\t //print_r($post['selected_productid']);\n\t\t //exit;\n\t Mage::getSingleton('amlist/session')->setAddProductId($post['selected_productid']);\n\t\t Mage::getSingleton('amlist/session')->setAddAllProductId($products);\n\t $this->_redirect('amlist/list/edit/');\n\t return;\n\t }\n\t\t\tif($post['selected_productid'])\n\t\t\t{\n\t\t\t\t\n\t\t\t\tforeach($products as $_product)\n\t\t\t\t{\n\t\t\t\t\tif($post['selected_productid']==$_product[product]):\n\t\t\t\t\t\t$item = Mage::getModel('amlist/item')\n\t\t\t\t\t\t->setProductId($_product[product])\n\t\t\t\t\t\t->setListId($listId) \n\t\t\t\t\t\t->setQty($_product[qty])\n\t\t\t\t\t\t->setBuyRequest(serialize($_product));\n\t\t\t\t\t\t$item->save();\n\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\t}\n\t\t\t\t Mage::getSingleton('core/session')->addSuccess($this->__('Product has been successfully added to the folder.'));\n\t\t\t\t $this->_redirectReferer();\n\t\t\t}\n\t}", "function disable_repeat_purchase_for_tamboo( $purchasable, $product ) {\n $product_id = $product->get_id();\n \n // Bailout if not a product with Attribute \"Purchase\"\n $string_values = $product->get_attribute('Purchase');\n if (( empty($string_values) )) { \n return $purchasable;\n }\n\n // return false if the customer has bought the product\n if ( wc_customer_bought_product( wp_get_current_user()->user_email, get_current_user_id(), $product_id ) ) {\n $purchasable = false;\n }\n \n // Double-check for variations: if parent is not purchasable, then variation is not\n if ( $purchasable && $product->is_type( 'variation' ) ) {\n $parent = wc_get_product( $product->get_parent_id() );\n $purchasable = $parent->is_purchasable();\n }\n return $purchasable;\n}", "public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "public function getAttributesUsedInRecommender()\n {\n if ($this->_usedInRecommender === null) {\n $this->_usedInRecommender = [];\n $entityType = \\Magento\\Catalog\\Model\\Product::ENTITY;\n\n $attributesData = $this->_getResource()->getAttributesUsedInRecommender();\n $this->_eavConfig->importAttributesData($entityType, $attributesData);\n\n foreach ($attributesData as $attributeData) {\n $attributeCode = $attributeData['attribute_code'];\n $this->_usedInRecommender[$attributeCode] = $this->_eavConfig->getAttribute(\n $entityType, $attributeCode\n );\n }\n }\n return $this->_usedInRecommender;\n }", "public function isRecommendedBy(User $user)\n {\n return $this->recommendations()\n ->where('user_id', $user->id)\n ->exists();\n }", "function wcs_custom_get_availability( $availability, $_product ) {\n global $product;\n\t// $koostis = $product->get_attribute( 'goal-number' );\n\n if ( $_product->is_in_stock() ) {\n $availability['availability'] = __($_product->total_sales . '/' . (int)$product->get_meta('sharethewarmth_selling_goal') . (string)' sold!', 'woocommerce');\n }\n // Change Out of Stock Text\n if ( ! $_product->is_in_stock() ) {\n $availability['availability'] = __('Sold Out', 'woocommerce');\n }\n return $availability;\n}", "public function maybe_make_product_not_purchasable($is_purchasable, $product)\n {\n\n global $wp;\n\n // TODO: Problem - when subscriptions are limited but product can be purchased, warning is being displayed when navigating to product page from the thank you page (something goes wrong at the very moment of checkout)\n\n // Result not yet in cache\n if (!isset($this->product_is_purchasable[$product->get_id()])) {\n\n // Make sure this is a subscription product and we are not on the \"Thank You\" page\n if ($is_purchasable && subscriptio_is_subscription_product($product) && !is_order_received_page()) {\n\n // Get product id to check\n $product_id = $product->is_type('variation') ? $product->get_parent_id() : $product->get_id();\n\n // Subscription limits are enabled\n if (!RP_SUB_Settings::is('subscription_limit', 'no_limit')) {\n\n // Iterate over non-terminated customer subscriptions\n foreach (subscriptio_get_customer_subscriptions() as $subscription) {\n\n // One non-terminated subscription per customer per site\n if (RP_SUB_Settings::is('subscription_limit', 'one_per_customer')) {\n\n // Customer already has a non-terminated subscription on this site\n $is_purchasable = false;\n } // One non-terminated subscription per product per customer per site\n else if (RP_SUB_Settings::is('subscription_limit', 'one_per_product')) {\n\n // Iterate over subscription items\n foreach ($subscription->get_items() as $item) {\n\n // Compare product ids\n if ($item->get_product_id() === $product_id) {\n\n // Customer already has a non-terminated subscription for this product on this site\n $is_purchasable = false;\n }\n }\n }\n }\n }\n }\n\n // Add result to cache\n $this->product_is_purchasable[$product->get_id()] = $is_purchasable;\n }\n\n // Return result from cache\n return $this->product_is_purchasable[$product->get_id()];\n }", "function productRecommended($post)\r\n{\r\n ?>\r\n <p>\r\n <span>Массив ID рекомендованых товаров: </span>\r\n <input type=\"text\" name='extra[recommend]' value=\"<?php echo get_post_meta($post->ID, \"recommend\", 1); ?>\">\r\n </p>\r\n <?php\r\n}", "public function isProductRemarkDisabled()\n {\n return $this->scopeConfig->getValue(\n self::DISABLE_PRODUCT_REMARK,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function setItemNeedReview($val)\n {\n $this->_propDict[\"itemNeedReview\"] = $val;\n return $this;\n }", "function setAdditionalProductTag($key, $value)\n {\n $this->_tag_value_cache = array();\n $this->_fAdditionalTagList[$key] = $value;\n }", "protected function setProductivity()\n {\n $this->productivity = random_int(8, 12);\n }", "function addArticleAttribut($object) {\n /* you can itentify the article with $object->reference->ShopId */ \n $object->Item->ShopId = 'yourReturnedAttributIdOnMarketplace_'.rand(1000, 9999); \n}", "public function show_recommended_products() {\n\n\t\t\t$submission_id = isset( $_GET['fitts_submission'] ) ? $_GET['fitts_submission'] : '';\n\t\t\tif ( $submission_id ) {\n\n\t\t\t\t$product_ids = get_post_meta( $submission_id, 'linked_products', true );\n\t\t\t\tinclude FQ_PLUGIN_DIR . '/template/fitts-recommended-products.php';\n\n\t\t\t}\n\n\t\t}", "public function setRecommendations($recommendations)\n {\n $this->recommendations = $recommendations;\n return $this;\n }", "public function catalogProductLoadAfter(Varien_Event_Observer $observer)\n{\n // set the additional options on the product\n if(Mage::getStoreConfigFlag('mycustom_section/mycustom_group2/field1')){\n $action = Mage::app()->getFrontController()->getAction();\n if ($action->getFullActionName() == 'checkout_cart_add')\n {\n\n \n $product = $observer->getProduct();\n // Mage::log($product);\n \n$totalCredits = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCreditsOfProduct($product->getId());\n\n if($totalCredits > 0) {\n\n // if ($options = $action->getRequest()->getParam('extra_option'))\n //{\n //$product = $observer->getProduct();\n // Mage::log($product);\n\n // add to the additional options array\n $additionalOptions = array();\n if ($additionalOption = $product->getCustomOption('additional_options'))\n {\n $additionalOptions = (array) unserialize($additionalOption->getValue());\n }\n\n \n $additionalOptions[] = array(\n 'label' => \"Credits\",\n 'value' => $totalCredits,\n );\n\n \n // add the additional options array with the option code additional_options\n $observer->getProduct()\n ->addCustomOption('additional_options', serialize($additionalOptions));\n //}\n }\n }\n }\n}", "function addVariation($data,$form){\r\n\t\tif(isset($data['ProductAttributes'])){\r\n\t\t\t$data['ProductAttributes'] = Convert::raw2sql($data['ProductAttributes']);\r\n\t\t\t$variation = $this->owner->getVariationByAttributes($data['ProductAttributes']);\r\n\t\t\tif($variation) {\r\n\t\t\t\tif($variation->canPurchase()) {\r\n\t\t\t\t\t$quantity = round($data['Quantity'], $variation->QuantityDecimals());\r\n\t\t\t\t\tif(!$quantity) {\r\n\t\t\t\t\t\t$quantity = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tShoppingCart::singleton()->addBuyable($variation,$quantity);\r\n\t\t\t\t\tif($variation->IsInCart()) {\r\n\t\t\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.SUCCESSFULLYADDED\",\"Added to cart.\");\r\n\t\t\t\t\t\t$status = \"good\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.NOTSUCCESSFULLYADDED\",\"Not added to cart.\");\r\n\t\t\t\t\t\t$status = \"bad\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.VARIATIONNOTAVAILABLE\",\"That option is not available.\");\r\n\t\t\t\t\t$status = \"bad\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.VARIATIONNOTAVAILABLE\",\"That option is not available.\");\r\n\t\t\t\t$status = \"bad\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$msg = _t(\"ProductWithVariationDecorator.VARIATIONNOTFOUND\",\"The item(s) you are looking for are not available.\");\r\n\t\t\t$status = \"bad\";\r\n\t\t}\r\n\t\tif(Director::is_ajax()){\r\n\t\t\treturn ShoppingCart::singleton()->setMessageAndReturn($msg, $status);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$form->sessionMessage($msg,$status);\r\n\t\t\tDirector::redirectBack();\r\n\t\t}\r\n\t}", "public function actionAddToWishlist($product_id, $user_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('wishlist', $saveArr)->execute();\n exit;\n }", "private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {\n if ($parent) {\n $image = wp_get_attachment_image_src($product->get_image_id(), 'full');\n\n if (!$image) {\n $image = wp_get_attachment_image_src($parent->get_image_id(), 'full');\n }\n\n $term_list = $parent->get_category_ids();\n $attributes = get_post_meta($parent->get_id(), '_product_attributes');\n } else {\n $image = wp_get_attachment_image_src($product->get_image_id(), 'full');\n $term_list = $product->get_category_ids();\n $attributes = get_post_meta($product->get_id(), '_product_attributes');\n }\n\n $attributes = (isset($attributes[0])) ? $attributes[0] : $attributes;\n\n $params = array();\n\n if (!empty($attributes)) {\n foreach ($attributes as $attribute_name => $attribute) {\n $attributeValue = $product->get_attribute($attribute_name);\n if ($attribute['is_visible'] == 1 && !empty($attributeValue)) {\n $params[] = array(\n 'code' => $attribute_name,\n 'name' => $product_attributes[$attribute_name],\n 'value' => $attributeValue\n );\n }\n }\n }\n\n $dimensions = '';\n\n if ($product->get_length() != '') {\n $dimensions = wc_get_dimension($product->get_length(), 'cm');\n }\n\n if ($product->get_width() != '') {\n $dimensions .= '/' . wc_get_dimension($product->get_width(), 'cm');\n }\n\n if ($product->get_height() != '') {\n $dimensions .= '/' . wc_get_dimension($product->get_height(), 'cm');\n }\n\n $weight = '';\n\n if ($product->get_weight() != '') {\n $weight = wc_get_weight($product->get_weight(), 'kg');\n }\n\n if ($product->is_taxable()) {\n $tax_rates = WC_Tax::get_rates($product->get_tax_class());\n $tax = reset($tax_rates);\n }\n\n if ($product->get_manage_stock() == true) {\n $stockQuantity = $product->get_stock_quantity();\n $quantity = empty($stockQuantity) === false ? $stockQuantity : 0;\n } else {\n $quantity = $product->get_stock_status() === 'instock' ? 1 : 0;\n }\n\n $product_data = array(\n 'id' => $product->get_id(),\n 'productId' => ($product->get_parent_id() > 0) ? $parent->get_id() : $product->get_id(),\n 'name' => $product->get_name(),\n 'productName' => ($product->get_parent_id() > 0) ? $parent->get_title() : $product->get_title(),\n 'price' => wc_get_price_including_tax($product),\n 'picture' => $image[0],\n 'url' => ($product->get_parent_id() > 0) ? $parent->get_permalink() : $product->get_permalink(),\n 'quantity' => $quantity,\n 'categoryId' => $term_list,\n 'dimensions' => $dimensions,\n 'weight' => $weight,\n 'tax' => isset($tax) ? $tax['rate'] : 'none'\n );\n\n if ($product->get_sku() != '') {\n $params[] = array('code' => 'article', 'name' => 'Артикул', 'value' => $product->get_sku());\n\n if (isset($this->settings['bind_by_sku']) && $this->settings['bind_by_sku'] == WC_Retailcrm_Base::YES) {\n $product_data['xmlId'] = $product->get_sku();\n }\n }\n\n if (!empty($params)) {\n $product_data['params'] = $params;\n }\n\n if (isset($product_data)) {\n $full_product_list[] = $product_data;\n }\n\n unset($product_data);\n }", "public function likeOrUnlikeProduct(Request $request)\n {\n $user = session()->get('authUser');\n \n $this->validate($request, [\n 'product_id' => 'required|numeric',\n ]);\n \n $product = Product::where([\n 'id' => $request->product_id,\n 'status' => 'Active',\n ])->first();\n\n if(!empty($product))\n {\n $productLike = ProductLike::where([\n 'product_id' => $request->product_id,\n 'user_id' => $user->id,\n ])->first();\n\n // Check product is like or not\n if(empty($productLike))\n {\n $productLike = new ProductLike();\n $productLike->user_id = $user->id;\n $productLike->product_id = $request->product_id;\n\n // save as like product or not\n if($productLike->save())\n {\n return $this->toJson([\n 'is_liked' => 1\n ]);\n }\n \n return $this->toJson([], trans('api.like_product.error'), 0);\n }\n\n // Unlike product\n if($productLike->delete())\n {\n return $this->toJson([\n 'is_liked' => 0\n ]);\n }\n\n return $this->toJson([], trans('api.like_product.error'), 0);\n }\n\n return $this->toJson([], trans('api.product.not_available'), 0);\n }", "public function getIsFavoritedAttribute()\n {\n return $this->isFavorited();\n }", "public function productAddOrUpdate(Varien_Event_Observer $observer)\n {\n try \n {\n $helper = Mage::helper('increasingly_analytics');\n\n if ($helper->isEnabled())\n {\n $productId = $observer->getEvent()->getProduct()->getId();\n $product = Mage::getModel('catalog/product')->load($productId);\n\n $productFormatHelper = Mage::helper('increasingly_analytics/ProductFormatter'); \n \n $formattedProductInfo = $productFormatHelper->formatProductInfo($product);\n $helper->increasinglyApi($formattedProductInfo,'product_add_or_update','track',$helper->getApiToken(),$helper->getApiSecret());\n }\n\n }\n catch(Exception $e)\n {\n Mage::log(\"Product Add or Update tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n }", "function add_recommendations( $modules ) {\n\t$recommendations =[\n\t\t'opcache' => [\n\t\t\t'extension' => 'opcache',\n\t\t\t'required' => false,\n\t\t],\n 'memcache' => [\n 'extension' => 'memcache',\n 'required' => false,\n ],\n 'memcached' => [\n 'extension' => 'memcached',\n 'required' => false,\n ],\n\t];\n\n\t$recommended_modules = array_merge( $recommendations, $modules );\n\n\treturn (array) $recommended_modules;\n}", "function pm_release_recommended(&$project) {\n if (isset($project['recommended'])) {\n $project['candidate_version'] = $project['recommended'];\n $project['updateable'] = TRUE;\n }\n // If installed version is dev and the candidate version is older, choose\n // latest dev as candidate.\n if (($project['install_type'] == 'dev') && isset($project['candidate_version'])) {\n if ($project['releases'][$project['candidate_version']]['date'] < $project['info']['datestamp']) {\n $project['candidate_version'] = $project['latest_dev'];\n if ($project['releases'][$project['candidate_version']]['date'] <= $project['info']['datestamp']) {\n $project['candidate_version'] = $project['existing_version'];\n $project['updateable'] = FALSE;\n }\n }\n }\n}", "public function testModerationByProduct(): void\n {\n $productSummaryArray = $this->getProductsSummary();\n static::assertSame(1, $productSummaryArray[4][ProductApprovalStatus::PENDING()->getKey()]);\n\n $this->moderationService->moderateByProduct(17, 'approve');\n $productSummaryArray = $this->getProductsSummary();\n static::assertArrayNotHasKey(ProductApprovalStatus::PENDING()->getKey(), $productSummaryArray[4]);\n }", "public function likeOrUnlikeProduct(Request $request)\n {\n $user= Auth::guard('customer')->user();\n \n $this->validate($request, [\n 'product_id' => 'required|numeric',\n ]);\n\n $product = Product::where([\n 'id' => $request->product_id,\n 'status' => 'Active',\n ])->first();\n\n if(!empty($product))\n {\n $productLike = ProductLike::where([\n 'product_id' => $request->product_id,\n 'user_id' => $user->id,\n ])->first();\n\n // Check product is like or not\n if(empty($productLike))\n {\n $productLike = new ProductLike();\n $productLike->user_id = $user->id;\n $productLike->product_id = $request->product_id;\n\n // save as like product or not\n if($productLike->save())\n {\n return $this->toJson([\n 'is_liked' => 1\n ]);\n }\n \n return $this->toJson([], trans('api.like_product.error'), 0);\n }\n\n // Unlike product\n if($productLike->delete())\n {\n return $this->toJson([\n 'is_liked' => 0\n ]);\n }\n\n return $this->toJson([], trans('api.like_product.error'), 0);\n }\n\n return $this->toJson([], trans('api.product.not_available'), 0);\n }", "public function getRecommendations()\n {\n return $this->recommendations;\n }", "public function install()\n {\n return parent::install()\n && $this->registerHook('actionObjectOrderAddBefore')\n && Configuration::updateValue('ORDERREF_LENGTH', self::ORDERREF_LENGTH_DEFAULT)\n && Configuration::updateValue('ORDERREF_MODE', self::ORDERREF_MODE_RANDOM)\n ;\n }", "public function getIsFavoritedAttribute(){\n\n return $this->isFavorited();\n }", "public function getRecommendedItemList() {\n return $this->recommendedItemList;\n }", "public function add($data)\n {\n // create product SKU\n $this->model->creating(function ($product) use ($data) {\n\n $product->sku = $this->generateProductSKU();\n\n $product->category_id = array_get($data, 'category_id');\n $product->subcategory_id = array_get($data, 'subcategory_id');\n $product->brand_id = array_get($data, 'brand_id');\n });\n\n return parent::add($data);\n }", "public function isSupportedProduct()\n {\n /** @var Oyst_OneClick_Model_Catalog $oystCatalog */\n $oystCatalog = Mage::getModel('oyst_oneclick/catalog');\n\n return $oystCatalog->isSupportedProduct($this->getProduct());\n }", "public function addPurchasable(PurchasableInterface $purchasable);", "function setwood_woocommerce_init_structured_data() {\n if ( ! is_product_category() ) {\n return;\n }\n global $product;\n $json['@type'] = 'Product';\n $json['@id'] = 'product-' . get_the_ID();\n $json['name'] = get_the_title();\n $json['image'] = wp_get_attachment_url( $product->get_image_id() );\n $json['description'] = get_the_excerpt();\n $json['url'] = get_the_permalink();\n $json['sku'] = $product->get_sku();\n $json['brand'] = array(\n '@type' => 'Thing',\n 'name' => $product->get_attribute( __( 'brand', 'setwood' ) )\n );\n \n if ( $product->get_rating_count() ) {\n $json['aggregateRating'] = array(\n '@type' => 'AggregateRating',\n 'ratingValue' => $product->get_average_rating(),\n 'ratingCount' => $product->get_rating_count(),\n 'reviewCount' => $product->get_review_count()\n );\n }\n \n $json['offers'] = array(\n '@type' => 'Offer',\n 'priceCurrency' => get_woocommerce_currency(),\n 'price' => $product->get_price(),\n 'itemCondition' => 'http://schema.org/NewCondition',\n 'availability' => 'http://schema.org/' . $stock = ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),\n 'seller' => array(\n '@type' => 'Organization',\n 'name' => get_bloginfo( 'name' )\n )\n );\n \n if ( ! isset( $json ) ) {\n return;\n }\n \n Setwood::set_structured_data( apply_filters( 'setwood_woocommerce_structured_data', $json ) );\n }", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "public function onInstall() {\n\t\tglobal $conf;\n\n\t\treturn true;\n\n\t}", "public function enable_short_desc_modern_view( $shop_product_stucture ) {\n\t\t\tif ( ( is_shop() || is_product_taxonomy() ) && self::is_easy_view_switcher_enable() && ! in_array( 'short_desc', $shop_product_stucture ) && 'shop-page-list-style' !== astra_get_option( 'shop-style' ) && true === astra_get_option( 'easy-list-content-enable-description' ) ) {\n\t\t\t\t$shop_product_stucture[] = 'short_desc';\n\t\t\t}\n\t\t\treturn $shop_product_stucture;\n\t\t}", "function dokan_is_seller_enabled( $user_id ) {\n $selling = get_user_meta( $user_id, 'dokan_enable_selling', true );\n\n if ( $selling == 'yes' ) {\n return true;\n }\n\n return false;\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 }", "public function setIsSuggested(?bool $value): void {\n $this->getBackingStore()->set('isSuggested', $value);\n }", "public function setisPreferable($v)\n {\n if ($v !== null) {\n if (is_string($v)) {\n $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n } else {\n $v = (boolean) $v;\n }\n }\n\n if ($this->ispreferable !== $v) {\n $this->ispreferable = $v;\n $this->modifiedColumns[] = ActionTypePeer::ISPREFERABLE;\n }\n\n\n return $this;\n }", "public function getisPreferable()\n {\n return $this->ispreferable;\n }", "public static function isApplicable(): bool\n {\n return true;\n }", "public function isAdoptable() {\n return $this->shareData[\"adoptable\"];\n }" ]
[ "0.6192576", "0.59395796", "0.582415", "0.57079047", "0.56752014", "0.5610263", "0.5610263", "0.54889876", "0.54458743", "0.54119694", "0.54119694", "0.5290075", "0.5282069", "0.52619517", "0.5241525", "0.518038", "0.5159601", "0.51185006", "0.5094064", "0.5087571", "0.5072617", "0.50270057", "0.50241214", "0.49853987", "0.49496645", "0.4949443", "0.4949443", "0.4949443", "0.4949443", "0.4949443", "0.4922532", "0.49211374", "0.49141264", "0.49095312", "0.48967412", "0.4893615", "0.48904222", "0.48818323", "0.48219687", "0.4821047", "0.48182955", "0.48168766", "0.4809679", "0.48026773", "0.48026294", "0.47989315", "0.47981736", "0.47950047", "0.47938746", "0.47870454", "0.47760877", "0.4774977", "0.4763029", "0.47512746", "0.47485527", "0.4748067", "0.47413856", "0.4738777", "0.4734705", "0.4733208", "0.47309875", "0.4727208", "0.4725594", "0.47244644", "0.47209993", "0.47182328", "0.4717533", "0.47137892", "0.47127238", "0.4710926", "0.47106287", "0.47040543", "0.46999586", "0.4693843", "0.46925962", "0.4690022", "0.46878698", "0.46867067", "0.46811673", "0.4680015", "0.46784368", "0.4678031", "0.467479", "0.4666422", "0.4666133", "0.4664895", "0.46623263", "0.46590042", "0.4655542", "0.46479636", "0.46441993", "0.46366552", "0.46349448", "0.4633918", "0.46305966", "0.4628453", "0.46244496", "0.4620843", "0.46202743", "0.4620182", "0.46196815" ]
0.0
-1
get the bookings of a user
public function getUserBookings(User $user) { if ($user) { $data['success'] = true; $data['bookings'] = Booking::join('rooms', 'rooms.id', '=', 'bookings.room_id') ->join('hotels', 'hotels.id', '=', 'rooms.hotel_id') ->select('bookings.id', 'bookings.check_in', 'bookings.check_out', 'hotels.name', 'hotels.city', 'hotels.image', 'rooms.price', 'bookings.created_at') ->groupBy('bookings.id', 'bookings.check_in', 'bookings.check_out', 'hotels.name', 'hotels.city', 'hotels.image', 'rooms.price', 'bookings.created_at') ->orderBy('bookings.created_at', 'desc') ->where('bookings.user_id', $user->id) ->paginate(6); } return response()->json(['data' => $data]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getAllBookings(User $driver) {\n\t\t$bookings = $driver->getDriverBookings ();\n\t\treturn $bookings;\n\t}", "public function getBorrowings();", "public function GetBookings()\n\t{\t$bookings = array();\n\t\t$sql = 'SELECT * FROM coursebookings WHERE ticket=' . $this->id;\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$bookings[$row['id']] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $bookings;\n\t}", "function getAllBookings($userID){\n $query = $this->db->query(\"SELECT bookings.*,buildings.name as buildingName, buildings.id as buildingID ,rooms.name as roomName,rooms.floorNumber , rooms.type from bookings join rooms on rooms.roomId = bookings.roomID join buildings on buildings.id = rooms.buildingId where userID = $userID\");\n\n if($query->num_rows()>0)\n {\n $response['status'] = 'success';\n $response['data']=$this->getParticipantsForMeetings($query->result_array());\n }\n else\n {\n $response['status'] = 'failure';\n $response['code'] = 'database failure';\n\n }\n return $response;\n }", "public function getBookings()\n {\n return $this->hasMany(Booking::className(), ['id_sotrudnik' => 'id_sotrudnik']);\n }", "function get_bookings( $all_bookings = false ){\n\t\t$confirmed = array();\n\t\tforeach ( $this->load() as $EM_Booking ){\n\t\t\tif( $EM_Booking->booking_status == 1 || (get_option('dbem_bookings_approval') == 0 && $EM_Booking->booking_status == 0) || $all_bookings ){\n\t\t\t\t$confirmed[] = $EM_Booking;\n\t\t\t}\n\t\t}\n\t\t$EM_Bookings = new EM_Bookings($confirmed);\n\t\treturn $EM_Bookings;\t\t\n\t}", "public function bookings() {\n\t\treturn $this->hasMany(Bookings::class);\n\t}", "public function viewBookingsAction() {\n\t\t// check if user is logged in and fetch user's entity\n\t\t$loggedInUser = $this->_checkAndRedirect ();\t\t\n\t\n\t\t$trips = $this->_getAllTrips($loggedInUser);\n\t\tif (null !== $trips) {\n\t\t $messages = $this->flashMessenger()->getMessages();\n\t\t\treturn array (\n\t\t\t\t\t\"trips\" => $trips,\n\t\t\t \"messages\" => $messages,\n\t\t\t);\n\t\t} else { // there must be some internal error if $bookings is really null.\n\t\t\t$this->flashMessenger ()->clearMessages ();\n\t\t\t$this->flashMessenger ()->addErrorMessage ( IControllerMessages::ERROR_BOOKING_OVERVIEW );\n\t\t\t$this->redirect ()->toRoute ( IRouteStore::BOOK_ERROR );\n\t\t}\n\t}", "public function listbooking($user=\"\") {\n \t$this->db->select('rumah.*, booking.*');\n\t\t$this->db->from('rumah');\n\t\t$this->db->where('rumah.user', $user);\n\t\t$this->db->join('users','users.id = rumah.user','right');\n\t\t$this->db->join('booking','booking.rumah = rumah.id','right');\n\t\t$this->db->order_by('rumah.id','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array(); \n }", "public function getBookings()\n {\n return $this->hasMany(Booking::className(), ['id_complaints' => 'id_complaint']);\n }", "public function getTodayBookingList()\n {\n return DB::table('bookings')\n ->leftJoin('users', 'users.id', '=', 'bookings.user_id')\n ->leftJoin('rooms', 'rooms.id', '=', 'bookings.room_id')\n ->whereBetween('booking_time', [\n date('Y-m-d 00:00:01'),\n date('Y-m-d 23:59:59')\n ])\n ->select(\n 'bookings.booking_time', 'bookings.total_person', 'bookings.noted',\n 'users.id as user_id', 'users.email', 'rooms.room_name'\n )\n ->get()\n ->toArray();\n }", "public function getBookings($username, $password, $start_date, $end_date, $groups=false, $buildings=false, $statuses=false, $event_types=false, $group_types=false, $group_id=false) {\nglobal $_LW;\nif (!isset($this->client)) { // require the client\n\treturn false;\n};\nif (empty($statuses)) { // use default statuses if none specified\n\t$statuses=$_LW->REGISTERED_APPS['ems']['custom']['default_statuses'];\n};\nif (empty($group_types)) { // use default group types if none specified\n\t$group_types=$_LW->REGISTERED_APPS['ems']['custom']['default_group_types'];\n};\nif (empty($event_types)) { // use default event types if none specified\n\t$event_types=$_LW->REGISTERED_APPS['ems']['custom']['default_event_types'];\n};\nreturn $this->client->getBookings($username, $password, $start_date, $end_date, $groups, $buildings, $statuses, $event_types, $group_types, $group_id); // perform the API call\n}", "function getBookings(){\r\n\t\t$inx = 0;\r\n\t\t$arrbook = array();\r\n\t\t$conn = getConnection();\r\n //These are the specific fields\r\n $stmt = $conn->prepare(\"SELECT B.idreservations, B.rs_checkin, B.rs_checkout, G.gs_name FROM booking B, guests G where G.reservations_idreservations = B.idreservations\");\r\n \r\n $stmt->execute();\r\n\r\n $result = $stmt->get_result();\r\n\r\n if($result->num_rows > 0){\r\n \twhile($row = $result->fetch_assoc()){\r\n \t\t$arrbook[$inx][0] = $row['rs_checkin'];\r\n \t\t$arrbook[$inx][1] = $row['gs_name'];\r\n \t\t$arrbook[$inx][2] = $row['rs_checkout'];\r\n $arrbook[$inx][3] = $row['idreservations'];\r\n $inx++;\r\n \t}\r\n }\r\n $conn->close(); \r\n\r\n return $arrbook;\r\n\t}", "function wpbs_get_bookings($args = array(), $count = false)\n{\n\n $bookings = wp_booking_system()->db['bookings']->get_bookings($args, $count);\n\n /**\n * Add a filter hook just before returning\n *\n * @param array $bookings\n * @param array $args\n * @param bool $count\n *\n */\n return apply_filters('wpbs_get_bookings', $bookings, $args, $count);\n\n}", "public function bookingList()\n {\n $user = User::find(Auth::user()->id);\n return view('booking.booking_list', compact('user'));\n }", "function get_pending_bookings(){\n\t\tif( get_option('dbem_bookings_approval') == 0 ){\n\t\t\treturn new EM_Bookings();\n\t\t}\n\t\t$pending = array();\n\t\tforeach ( $this->load() as $EM_Booking ){\n\t\t\tif($EM_Booking->booking_status == 0){\n\t\t\t\t$pending[] = $EM_Booking;\n\t\t\t}\n\t\t}\n\t\t$EM_Bookings = new EM_Bookings($pending);\n\t\treturn $EM_Bookings;\t\n\t}", "public function get_facility_bookings($user_id) {\r\n //SELECT * FROM tbl_facility_bookings WHERE facility_booking_is_deleted = 0\r\n $query = $this->db->query(\"SELECT\r\n concat(u.tbl_users_firstname,' ',u.tbl_users_lastname) as user_name,\r\n fc.facility_category_name,\r\n fi.facility_item_name,\r\n fb.*\r\n FROM\r\n tbl_facility_bookings fb,\r\n tbl_users u,\r\n tbl_facility_items fi,\r\n tbl_facility_categories fc\r\n WHERE\r\n fb.facility_booking_user_id = u.tbl_users_id \r\n AND fi.facility_category_id = fc.facility_category_id \r\n AND fb.facility_item_id = fi.facility_item_id \r\n AND fb.facility_category_id = fc.facility_category_id\r\n AND fb.facility_booking_is_deleted = 0\r\n AND u.tbl_users_id = \" . $user_id);\r\n $result = $query->result();\r\n //$this->db->select('*');\r\n //$this->db->where('facility_booking_user_id = ' . $user_id . ' AND facility_booking_is_deleted = 0');\r\n //$result = $this->db->get('tbl_facility_bookings')->result_array();\r\n\r\n return $result;\r\n }", "public function bookings()\n {\n return $this->hasMany('App\\Booking');\n }", "public function getAwardedBountyUsers();", "public function bookings()\n {\n return $this->hasMany('App\\Models\\Booking');\n }", "public function getBookings(): ?array\n {\n return $this->bookings;\n }", "function getBookings($uid, $interval) {\n\n\t\t$bookingsRaw = array();\n\t\t$storagePid = $this->lConf['PIDstorage'];\n\n\t\tif (!isset($uid))\n\t\t\t$uid = $this->lConf['ProductID'];\n\n\t\tif (!isset($interval['startList']) && !isset($interval['endList'])) {\n\t\t\t$interval['startList'] = $interval['startDate'];\n\t\t\t$interval['endList'] = $interval['endDate'];\n\t\t}\n\n\t\tif ($storagePid != '' && $uid != '') {\n\t\t\t// SELECT\n\t\t\t// 1. get for bookings for these uids/pids\n\t\t\t$query = 'pid IN ('. $storagePid .') AND uid_foreign IN ('.$uid.')';\n\t\t\t$query .= ' AND deleted=0 AND hidden=0 AND uid=uid_local';\n\t\t\t$query .= ' AND ( enddate >=('.$interval['startList'].') AND startdate <=('.$interval['endList'].'))';\n\n\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('DISTINCT uid_foreign as uid, startdate, enddate, title','tx_abbooking_booking, tx_abbooking_booking_productid_mm',$query,'','startdate','');\n\n\t\t\t// one array for start and end dates. one for each pid\n\t\t\twhile (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {\n\t\t\t\t$bookingsRaw[] = $row;\n\t\t\t};\n\n\t\t}\n\n\t\t$localbookings['bookings'] = $bookingsRaw;\n\n \t\treturn $localbookings;\n\n\t}", "public function index()\n {\n //$bookings = Booking::orderBy('book_start', 'asc')->paginate(10);\n //return view('bookings.index')->with('bookings', $bookings);\n\n $user_id = auth()->user()->id;\n $user = User::find($user_id);\n return view('bookings.index')->with('bookings', $user->bookings);\n }", "function has_booking( $user_id = false ){\n\t\tif( $user_id === false ){\n\t\t\t$user_id = get_current_user_id();\n\t\t}\n\t\tif( is_numeric($user_id) && $user_id > 0 ){\n\t\t\tforeach ($this->load() as $EM_Booking){\n\t\t\t\tif( $EM_Booking->person->ID == $user_id && !in_array($EM_Booking->booking_status, array(2,3)) ){\n\t\t\t\t\treturn apply_filters('em_bookings_has_booking', $EM_Booking, $this);\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\treturn apply_filters('em_bookings_has_booking', false, $this);\n\t}", "public function index()\n {\n $user = Auth::guard('admin')->user()->name;\n $halls = Hall::where('vendor', '=', $user)->pluck('id');\n \n $bookings = Booking::where('hallid', '=', $halls)->get();\n echo $bookings;\n //return view('Admin.booking', compact('bookings'));\n }", "function wpbs_get_booking($booking)\n{\n\n return wp_booking_system()->db['bookings']->get_object($booking);\n\n}", "public function getownerBooks($ownerid)\n {\n $sql2 = \"SELECT * from book JOIN item on book.itemid= item.itemid where bUserid= '\".$ownerid.\"'\";\n $bookdetails = mysql_fetch_array(mysql_query($sql2));\n return $bookdetails;\n \n }", "function get_rejected_bookings(){\n\t\t$rejected = array();\n\t\tforeach ( $this->load() as $EM_Booking ){\n\t\t\tif($EM_Booking->booking_status == 2){\n\t\t\t\t$rejected[] = $EM_Booking;\n\t\t\t}\n\t\t}\n\t\t$EM_Bookings = new EM_Bookings($rejected);\n\t\treturn $EM_Bookings;\n\t}", "public function index()\n {\n $bookings = Booking::all()->sortByDesc('created_at')->forPage(0, 20);\n return $bookings;\n }", "public function userViewAllBookings($id)//user_id is beign passed to this method through url\n {\n\n //find all new bookings where user_id and old_new match the given ones.\n $bookings = Booking::select('id','paid','scheduled_date','scheduled_time','total_amount','status')\n ->where('user_id',$id)\n ->where('old_new',1)\n ->where('status','!=','done')\n ->get();\n return response()->json(['data'=>$bookings]);\n\n }", "function getBorrowItemsBorrowedBy($user_id)\n\t{\n\t\treturn $this->query->getBorrowItemsBorrowedBy($user_id);\n\t}", "public function bookings() {\n // writing: Booking::class is equivalent to: 'App\\Comment'\n return $this->hasMany(Booking::class, 'fldCarId');\n }", "public function bookings(): HasMany\n {\n return $this->hasMany(Booking::class);\n }", "public function getBookmarkedUsers()\n {\n return Auth::user()->bookmarkedUsers()->simplePaginate(10);\n }", "public function bookings(Request $request) \n {\n $bookings = [];\n\t $slots = slots($request->input('start_time'), $request->input('end_time'));\n\n\t for($x = 0; $x < count($slots); $x++)\n {\n\t\t array_push($bookings, [\"lab_id\" => $request->input('lab_id'),\n\t\t\t \t\t \"date\" => $request->input('date'),\n\t\t\t \t\t \"start_time\" => substr($slots[$x],0,5),\n\t\t\t\t\t \"end_time\" => substr($slots[$x],6,5),\n\t\t\t \t\t \"purpose\" => $request->input('purpose'),\n\t\t\t\t\t\t\t\t\t\t\"module\" => $request->input('module')\n\t\t\t\t\t\t\t\t\t]\n\t\t\t);\n\n \n }\n return $bookings;\n }", "public function bookings(): HasMany\n {\n return $this->hasMany(\\App\\Models\\Booking::class);\n }", "public function getBookingsByDate(Request $request)\n {\n $booking_obj = new Booking();\n return $booking_obj->getFutureBookingsByServiceAndDate($request->sv_id, $request->start, $request->end);\n }", "public function bookIndex(): array\n {\n return $this->bookRepository->findAllUserBooks(\\Auth::user()->getUid());\n }", "public function index()\n\t{\n\t\tif(!Input::has('client_name')) App::abort(404); // only showing client bookings atm\n \n $clients = Client::where('name', '=', Input::get('client_name'))->get();\n \n if ($clients->isEmpty()) {\n return $this->reply(['error' => 'Client not found']);\n }\n \n $bookings = new Collection();\n \n foreach($clients as $client) {\n \n $client_bookings = $client->bookings->filter(function($booking){\n return $booking->deleted == 0 && $booking->status == \\Booking::STATUS_BOOKING;\n });\n \n $bookings = $bookings->merge($client_bookings);\n }\n \n return $this->reply(['bookings' => $bookings]);\n\t}", "public function bookings(Request $request)\n {\n return view('agent.booking.index', [\n 'title' => 'Booking Info',\n 'seo_meta' => '',\n 'all_booking' => Auth::user()->bookings()->orderBy('id', 'desc')->get(),\n 'cancelllations' => Cancellation::all()->keyBy('booking_id'),\n ]);\n }", "private function _getListingsByLoggedInUser()\n\t{\n\t\t$user_id = $this->_getUserId();\n\t\tif ($user_id == 0 || $user_id == null){\n\t\t\treturn array('error' => 'USER_NOT_LOGGED_IN', 'code' => 3);\n\t\t}\n\t\t\n\t\t$listings = $this->Listing->GetListingsByUserId($user_id);\n\t\tif ($listings == null)\n\t\t\treturn array('error' => 'FAILED_TO_RETRIEVE_LISTINGS', 'code' => 4);\n\n\t\treturn $listings;\n\t}", "public function get_booked() {\n return $this->booked;\n }", "function get_user_booking_with_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql);\n return $result;\n}", "public function bookings() : HasManyThrough\n {\n return $this->hasManyThrough(Booking::class, Client::class);\n }", "public function getBorrowedbooks()\n {\n return $this->hasMany(Borrowedbooks::className(), ['bookId' => 'bookId']);\n }", "public function index() {\n // Get also the room type data for the room\n // Get also the name for the user from each booking\n $bookings = Booking::with( [ 'room.roomType', 'users:name' ] )->paginate( 20 );\n\n return view( 'bookings.index' )->with( 'bookings', $bookings );\n }", "public function getBillsWithUserReservation () {\n if (strpos(Route::getFacadeRoot()->current()->uri(), 'admin') !== false) {\n $bills = self::select('*')->orderBy('bill_bill_date', 'DESC')->get();\n } else {\n\n $bills = self::where('bill_user_id', '=', Auth::id())->get();\n }\n $bills->each(function ($b) {\n global $subtotals;\n global $totals;\n $r = new Reservation();\n $b->reservation = $r->where('id', '=', $b->reservation_id)\n ->select('id', 'reservation_started_at', 'reservation_ended_at', 'reservation_nights', 'user_id')\n ->with(array(\n 'guests' => function ($q) {\n $q->select('guests.id', 'reservation_id', 'guest_number', 'guest_night', 'guest_ended_at', 'guest_started_at', 'role_id');\n },\n ))\n ->first();\n $b->user = \\User::find($b->reservation->user_id);\n $b->reservation->guests->each(function ($g) use($b) {\n $g->calcGuestSumTotals();\n $s = new DateTime($g->guest_started_at);\n $g->guest_started_at_show = $s->format('d. m Y');\n $e = new DateTime($g->guest_ended_at);\n $g->guest_ended_at_show = $e->format('d. m Y');\n $b->reservation->reservation_sum += $g->guestSum;\n });\n $bds = new \\DateTime($b->bill_bill_date);\n $s = new DateTime($b->reservation->reservation_started_at);\n $b->reservation->reservation_started_at_show = $s->format('d. m Y');\n $e = new DateTime($b->reservation->reservation_ended_at);\n $b->reservation->reservation_ended_at_show = $e->format('d. m Y');\n $b->bill_bill_date_show = $bds->format(trans('formats.short-date-ts'));\n if (isset($b->bill_paid)) {\n $bds = new \\DateTime($b->bill_paid);\n $b->bill_paid_show = $bds->format(trans('formats.short-date-ts'));\n }\n\n if (isset($b->bill_resent_date)) {\n $bds = new \\DateTime($b->bill_resent_date);\n $b->bill_resent_date_show = $bds->format(trans('formats.short-date-ts'));\n }\n\n $ubc = DB::select(DB::raw('select `country_name_' . trans('formats.langjs') . '` from countries where country_code = ' . $b->user->user_country_code));\n $b->user->country = $ubc[0]->{'country_name_' . trans('formats.langjs')};\n $subtotals += (float)$b->bill_sub_total;\n $totals += (float)$b->bill_total;\n $b->subtotals = $subtotals;\n $b->totals = $totals;\n });\n return $bills;\n }", "public function getBookList()\n {\n return $this->bookDao->getBookList();\n }", "public function getOwnedListings($userId)\r\n\t{\r\n\t\t$query = 'SELECT m.marketID\r\n\t\t\tFROM marketplace AS m\r\n\t\t\t\tLEFT JOIN marketplacePayments AS mpp ON mpp.marketID = m.marketID\r\n\t\t\tWHERE mpp.startDate <= NOW()\r\n\t\t\t\tAND mpp.endDate >= NOW()\r\n\t\t\t\tAND mpp.paid = 1\r\n\t\t\t\tAND m.mLive = 1\r\n\t\t\t\tAND m.mUserID = '.(int) $userId;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$listings = $this->_db->loadAssocList('marketID');\r\n\t\tif (!$listings) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Add listing details and return\r\n\t\t$this->addDetails($listings);\r\n\t\treturn $listings;\r\n\t}", "public function index()\n {\n $permission = $this->checkPermission();\n if (is_array($permission)) {\n $this->_handleResponse($permission);\n return;\n }\n\n $fromDate = new Time($this->request->query('from'));\n $toDate = new Time($this->request->query('to'));\n if ($fromDate > $toDate) {\n $result = $this->_getResult('error', 400, $this->msg['booking_date_error']);\n $this->_handleResponse($result);\n return;\n }\n\n $query = $this->Bookings->find()\n ->contain(['Customers', 'Services'])\n ->order(['Bookings.date' => 'ASC', 'Bookings.start_time' => 'ASC'])\n ->where([\n 'Customers.shops_id' => $permission->shops_id,\n 'Bookings.date >=' => $fromDate,\n 'Bookings.date <=' => $toDate\n ]);\n\n $bookings = array();\n if ($query->count() > 0) {\n foreach ($query as $row) {\n $tmp = array(\n 'id' => $row->id,\n 'date' => $row->date,\n 'start_time' => $row->start_time,\n 'end_time' => $row->end_time,\n 'status' => $row->status,\n 'note' => $row->note,\n 'customer' => [\n 'id' => $row->customer->id,\n 'first_name' => $row->customer->first_name,\n 'last_name' => $row->customer->last_name\n ]\n );\n $services = array();\n foreach ($row->services as $sv) {\n $services[] = array(\n 'id' => $sv->id,\n 'name' => $sv->name\n );\n }\n $tmp['services'] = $services;\n\n $bookings[] = $tmp;\n }\n }\n\n $this->set(compact('bookings'));\n $this->set('_serialize', 'bookings');\n }", "public function showBookings()\n {\n return $this->render('account/bookings.html.twig');\n }", "static function getGroupBookingsReport() {\n global $wpdb;\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT reservation_id, guest_name, booking_reference, booking_source, checkin_date, checkout_date, \n booked_date, payment_outstanding, num_guests, data_href, notes, viewed_yn \n FROM wp_lh_group_bookings\n WHERE job_id IN (SELECT CAST(value AS UNSIGNED) FROM wp_lh_job_param WHERE name = 'allocation_scraper_job_id' AND job_id = (SELECT MAX(job_id) FROM wp_lh_jobs WHERE classname = 'com.macbackpackers.jobs.GroupBookingsReportJob' AND status = 'completed'))\n AND ( num_guests >= %d \" .\n (get_option('hbo_include_5_guests_in_6bed_dorm') == 'true' ? ' OR num_guests = 5' : '' ) . \"\n )\n ORDER BY checkin_date\", get_option('hbo_group_booking_size')));\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n return $resultset;\n }", "public function booking()\n {\n return $this->hasMany(Booking::class);\n }", "public function listBooks()\n {\n //list all books in database\n $sql2 = \"SELECT * from book\";\n $userBooks = mysql_fetch_array(mysql_query($sql2));\n return $userBooks; \n }", "public function whoAreBuddies(){\n $conn = Db::getConnection();\n\n $statement = $conn->prepare(\"\n SELECT \n u1.firstname as firstnameBuddy1, \n u1.lastname as lastnameBuddy1,\n u1.avatar as avatar1,\n u2.firstname as firstnameBuddy2, \n u2.lastname as lastnameBuddy2, \n u2.avatar as avatar2\n FROM \n buddies as b, user u1, user u2\n WHERE\n u1.userID = b.buddy1ID AND\n u2.userID = b.buddy2ID AND\n b.status = true\n \");\n if ($statement->execute()) {\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }\n }", "public function soldBooks()\n {\n return $this->hasManyThrough(Order::class, Book::class, 'user_id', 'book_id', 'id');\n }", "public function showmybooks()\n {\n $user = Auth::user();\n return response()->json(BookResource::collection($user->books), 200);\n }", "function get_user_booking_using_id($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id'\";\n $result = $db->query($sql)->fetch();\n return $result;\n}", "public function test_can_view_all_Booking()\n {\n\n // Given authorized user\n $user = factory(User::class)->create();\n Passport::actingAs($user);\n\n // when make get request to Bookings\n $res = $this->json('GET', 'api/bookings',[],\n ['Accept' => 'application/json', 'Content-type' => 'application/json']);\n\n // Then json response with sent and received booking (reservation and booking)\n $res->assertOk();\n $res->assertJsonStructure(['sent', 'received']);\n\n }", "public function adminBookingsPerUser ($id)\n {\n $bookings = DB::table('bookings')->select('bookings.id','houses.id as house_id','houses.name as house_name','rooms.number','rooms.price','rooms.nickname','bookings.status','bookings.date_from','bookings.date_to','bookings.created_at','users.name','bookings.message','bookings.note','users.id as user_id')\n ->where('bookings.user_id','=', $id)\n ->join('users','users.id','=','bookings.user_id')\n ->join('rooms','rooms.id','=','bookings.room_id')\n ->join('houses', 'houses.id','=','rooms.house_id')\n ->join('managers','managers.id', '=', 'houses.manager_id')\n // ->latest()\n ->paginate(15);\n\n foreach ($bookings as $booking)\n {\n $im = DB::table('image_houses')->select('image')\n ->where('house_id','=',$booking->house_id)\n ->orderBy('priority')\n ->first();\n if ($im == null) {\n $non_image = ['priority'=>'100','id'=>'0', 'image'=>'room_4.jpeg'];\n $non_image= (object) $non_image;\n $im=$non_image;\n }\n\n $query = DB::table('status_update as su')->select('su.date')\n ->where('su.booking_id','=',$booking->id)\n ->latest()\n ->first();\n\n $booking->image = $im->image;\n $booking->update = (isset($query->date)) ? $query->date : $booking->created_at;\n }\n // dd($bookings);\n return view('bookings.adminuser',[\n 'bookings' => $bookings\n ]);\n }", "public function bids()\n {\n $bids = collect([]);\n $usersOnCompany = $this->users();\n foreach ($usersOnCompany as $user) {\n foreach ($user->bids() as $bid) {\n $bids->push($bid);\n }\n }\n return $bids;\n }", "private function _getBooking(User $loggedInUser, $bookingId) {\n\t\t$bookingRepo = $this->em->getRepository ( \\JumpUpPassenger\\Util\\IEntitiesStore::BOOKING );\n\t\t$booking = $bookingRepo->findOneBy ( array (\n\t\t\t\t\"id\" => $bookingId,\n\t\t\t\t\"driver\" => $loggedInUser->getId () \n\t\t) );\n\t\treturn $booking;\n\t}", "public function get_other_library($user){\n $query=$this->db->query('SELECT * FROM `user_books` INNER JOIN users ON user_books.user_email=users.email WHERE `availability`=1 AND users.username=\"'.$user['sent_by'].'\" ');\n return $query->result();\n }", "public function userIndex ()\n {\n $user = Auth::user();\n\n if ($user) {\n $bookings = DB::table('bookings')->select('bookings.id','houses.id as house_id','houses.name as house_name','rooms.number','rooms.price','rooms.nickname','bookings.status','bookings.date_from','bookings.date_to','bookings.created_at','users.name','bookings.message','bookings.note','users.id as user_id')\n ->where('bookings.status', '>', '0')\n ->where('bookings.user_id','=', $user->id)\n ->join('users','users.id','=','bookings.user_id')\n ->join('rooms','rooms.id','=','bookings.room_id')\n ->join('houses', 'houses.id','=','rooms.house_id')\n ->join('managers','managers.id', '=', 'houses.manager_id')\n // ->latest()\n ->paginate(15);\n\n foreach ($bookings as $booking)\n {\n $im = DB::table('image_houses')->select('image')\n ->where('house_id','=',$booking->house_id)\n ->orderBy('priority')\n ->first();\n if ($im == null) {\n $non_image = ['priority'=>'100','id'=>'0', 'image'=>'room_4.jpeg'];\n $non_image= (object) $non_image;\n $im=$non_image;\n }\n\n $query = DB::table('status_update as su')->select('su.date')\n ->where('su.booking_id','=',$booking->id)\n ->latest()\n ->first();\n\n $booking->image = $im->image;\n $booking->update = (isset($query->date)) ? $query->date : $booking->created_at;\n }\n // dd($bookings);\n return view('bookings.adminuser',[\n 'bookings' => $bookings\n ]);\n } else {\n return view('auth.login',[\n 'url'=>'/booking/user'\n ]);\n }\n }", "public function getListingBooks()\n {\n return $this->listingBooks;\n }", "public function getBookings() {\n //$query = \"SELECT * FROM `bookings` WHERE `DATE` = CURDATE() ORDER BY `DATE`, `TIME`\";\n $query = \"SELECT * FROM `bookings` where DATE(`DATE`) = CURDATE() \";\n\n $stmt = $this->sqlConnection->prepare($query);\n\n $stmt->execute();\n\n if ($stmt->rowCount() > 0) {\n\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return json_encode($result);\n } else {\n\n echo json_encode(array(\"status\" => 201, 'message' => 'No bookings made yet..'));\n }\n }", "public function Booking()\n {\n return $this->hasMany('App\\Booking');\n }", "function get_all_bookings_back_limit_admin($perpage = null, $page = null, $orderby = null)\n {\n $offset = null;\n if ($page != null) {\n $offset = ($page == 1) ? 0 : ($page * $perpage) - $perpage;\n }\n\n $this->db->select('pt_bookings.booking_user,pt_bookings.booking_cancellation_request,pt_bookings.booking_id,pt_bookings.booking_type,pt_bookings.booking_expiry,pt_bookings.booking_ref_no,\n pt_bookings.booking_status,pt_bookings.booking_item,pt_bookings.booking_item_title,\n booking_total,pt_bookings.booking_deposit,pt_bookings.booking_date,pt_accounts.ai_first_name,pt_accounts.ai_last_name,pt_accounts.accounts_email');\n $this->db->join('pt_accounts', 'pt_bookings.booking_user = pt_accounts.accounts_id', 'left');\n $this->db->order_by('pt_bookings.booking_id', 'desc');\n $query = $this->db->get('pt_bookings', $perpage, $offset);\n $data['all'] = $query->result();\n // $data['nums'] = $query->num_rows();\n return $data;\n }", "public function index(BookingRequest $request)\n {\n $response = null;\n if($user_id = $request->get('user_id')) {\n $response = $this->bookingRepository->getUsersJobs($user_id);\n }\n //here this should not like that should handle by middleware or spatie\n elseif($request->user()->hasRole('Admin'))\n {\n //here we should get request data and send it not full Request\n $request_data = $request->all();\n $cuser = $request->__authenticatedUser;\n $response = $this->bookingRepository->getAll($request_data, $cuser);\n }\n\n return $response;\n }", "public function getBookList() \n {\n return array( \n \"Balagurusamy\" => new Book(\"Balagurusamy\", \"Balagurusamy\", \"C programming\"), \n \"CMM in Practice\" => new Book(\"CMM in Practice\", \"Pankaj Jalote\", \"\"), \n \"PHP for Dummies\" => new Book(\"PHP for Dummies\", \"Some Smart Guy\", \"\") \n ); \n }", "public function booking()\n {\n return $this->hasMany('App\\Models\\Booking');\n }", "public function index()\n {\n //\n $user = Auth::user();\n $booking = Booking::query()->where('user_id', $user->id)\n ->where('isCheckedIn', false)\n ->orderBy('booking_time', 'ASC')->paginate(5);\n return view('user.booking.index', compact('booking'));\n }", "public function get_book();", "public function allupgraders(){\n // SQL statement\n $sql = \"SELECT * FROM user WHERE special = 1 AND (role = 'account' OR role = 'administrator') \";\n $result = $this->con->query($sql);\n\n // check if there is a user\n $count = $result->num_rows;\n if ($count != 0) {\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }", "public function users(): object\n {\n $users = $this->bookingRepository->findUsers();\n\n return $this->sendResponse($users->toArray(), 'Users retrieved successfully.');\n }", "function getTodaysPendingBookings($storeId = null) {\n if ($storeId) {\n App::import('Model', 'Booking');\n $this->Booking = new Booking();\n $current_date = date(\"Y-m-d\", (strtotime($this->storeTimeZone($storeId,'', date('Y-m-d H:i:s')))));\n $pendingbookings = $this->Booking->getTodaysPendingBookings($storeId, $current_date);\n return $pendingbookings;\n }\n }", "function getBookingsByType($type){\r\n \t$inx = 0;\r\n \t$arrbook = array();\r\n \t$conn = getConnection();\r\n\r\n $stmt = $conn->prepare(\"SELECT idreservations, rs_checkin, rs_checkout from booking where rs_checkin > curdate() AND type = ?\");\r\n $stmt->bind_param(\"s\", $type); \r\n $stmt->execute();\r\n\r\n $result = $stmt->get_result();\r\n \r\n\r\n if($result->num_rows > 0){\r\n \twhile($row = $result->fetch_assoc()){\r\n \t\t$arrbook[$inx][0] = $row['idreservations'];\r\n \t\t$arrbook[$inx][1] = $row['rs_checkin'];\r\n \t\t$arrbook[$inx][2] = $row['rs_checkout'];\r\n $inx++;\r\n \t}\r\n }\r\n $conn->close(); \r\n\r\n return $arrbook;\r\n\t}", "function getBookingsByCustomerId($customerid) {\n $query = \"SELECT * FROM `bookings` WHERE CustomerId='\" . $customerid . \"'\";\n \n $result = Database::selectQuery($query);\n \n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "static function getAllBuddies($userID)\n {\n $conn = Db::getConnection();\n $statement = $conn->prepare(\"SELECT * FROM buddies INNER JOIN user ON (CASE WHEN buddy1ID = :userID THEN buddy2ID = user.userID WHEN buddy2ID = :userID THEN buddy1ID = user.userID END)\");\n //$statement = $conn->prepare(\"SELECT u.firstname, u.lastname* FROM buddies as b, user u \n //WHERE (u.userID = b.buddy1ID OR u.userID = b.buddy2ID) AND (buddy1ID = :currentUser OR buddy2ID = :currentUser)\");\n $statement->bindValue(\":userID\", $userID);\n if ($statement->execute()) {\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }\n }", "function findBooking() : array\n{ \n $db = new Database;\n $db = $db->dbConnect();\n\n $sql = \"SELECT booking.id, booking_date_debut, booking_time_debut, booking_date_fin, booking_time_fin, number_of_seats, user_i, last_name, first_name, mail \n FROM booking \n INNER JOIN user ON user.id = booking.user_i \";\n $adminGetBooking = $db->query($sql);\n $adminGetBooking = $adminGetBooking->fetchAll();\n return $adminGetBooking;\n}", "function cpc_broker_listings( $theuser ){\n\t$args = array(\n\t\t'author' => $theuser,\n\t\t'post_type' => array( 'ad_listing' ),\n\t);\n\t$author_total = new WP_Query( $args );\n\t\n\tif( $author_total->have_posts() ){\n\t\treturn count( $author_total->posts );\n\t}\n\treturn 0;\n}", "public function userbooks($id)\n {\n try{\n $user = User::find($id);\n $code = 200;\n\n if (empty($user)) {\n $message = 'User was not found';\n } else {\n $message = $user->books()->paginate();\n }\n }catch (\\Exception $e){\n $code = 500;\n $message = 'Error with API: ' . $e->getMessage();\n }finally{\n return Response::json($message, $code);\n }\n }", "function getBillsByUser($userID, $filterDest=\"any\") {\n\t$db = connectDB();\n $sql = <<<SQL\n \tSELECT billID, startDate, destination, description, cost, isPaid, userID\n \tFROM bills\n\t\tWHERE userID = ?\nSQL;\n\n\tif ($filterDest != \"any\") {\n\t\t$sql .= \" AND destination = ?\";\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param(\"ss\", $userID, $filterDest);\n\n\t} else {\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param(\"s\", $userID);\n\t}\n\n\n\t$stmt->execute();\n\n\t$res = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);\n\n\t$stmt->close();\n\t$db->close();\n\treturn $res;\n}", "public function index(IndexBookingRequest $request)\n {\n $collection = $this->bookingRepo->getBookings($request)->paginate(3);\n return new BookingCollection($collection);\n }", "public function getAllBooks(){\n $query = \"SELECT * FROM Book;\";\n return $this->getBookDetail($query);\n }", "function buddyListArray($user=NULL, $request=0){\n if(empty($user)){\n $user= getUser();\n }else{\n //check privacy rights!\n $privacy = new userPrivacy($user);\n if(!$privacy->proofRight('buddylist')){\n return array();\n }\n }\n $db = new db();\n $buddyListQuery = $db->shiftResult($db->select('buddylist', array('owner', $user, '&&', 'request', $request)), 'owner');\n $buddies = array();\n foreach($buddyListQuery AS $buddylistData){\n $buddies[] = (int)$buddylistData['buddy'];\n }\n\n return $buddies;\n\n }", "public function findAndNotifyMissingBookings()\n {\n $period = $this->options->getRemindPeriod();\n foreach ($this->userRepository->findAll() as $user) {\n $missingBookings = $this->findMissingBookingsForUser($user, $period);\n\n if (count($missingBookings) > 0) {\n $notification = new MissingBookingsNotification($period, $missingBookings);\n $this->notificationService->notify($notification, $user);\n }\n }\n }", "public function getEntity(): Booking\n {\n return (new Booking())\n ->setBeginsAt(new \\DateTime('2050/11/20'))\n ->setEndsAt(new \\DateTime('2050/11/25'))\n ->setTotalOccupiers(3);\n }", "function getBorrowRequests($user_id)\n\t{\n\t $table = $this->query->getBorrowRequests($user_id);\n\t return $table->result_array();\n\t}", "public function winnerbids()\n {\n $bids = collect([]);\n $usersOnCompany = $this->users();\n foreach ($usersOnCompany as $user) {\n foreach ($user->winnerbids() as $bid) {\n $bids->push($bid);\n }\n }\n return $bids;\n }", "public function index()\n {\n $user = User::with(['book' => fn($query) => $query->pluck('book_name')])->get();\n return response()->json($user, 200);\n }", "private function isBooked() {\n // count all bookings from program\n $statement = 'SELECT COUNT(*) FROM booking WHERE program_id = :program_id AND user_id = :user_id;';\n try {\n $statement = $this->db->prepare($statement);\n $statement->execute(array(\n 'user_id' => $this->getUser($this->data['cnp']),\n 'program_id' => $this->data['program']\n ));\n $result = $statement->fetchColumn();\n if ($result) {\n exit('You are already booked');\n }\n } catch (\\PDOException $e) {\n exit($e->getMessage());\n }\n \n return FALSE;\n }", "function if_user_has_booking($user_id){\n global $db;\n $sql = \"SELECT * FROM booking WHERE user_id = '$user_id';\";\n $result = $db->query($sql);\n return $result;\n}", "function bookking_user_complete($course, $user, $mod, $bookking) {\n\n global $PAGE;\n\n $bookking = bookking_instance::load_by_coursemodule_id($mod->id);\n $output = $PAGE->get_renderer('mod_bookking', null, RENDERER_TARGET_GENERAL);\n\n $appointments = $bookking->get_appointments_for_student($user->id);\n\n if (count($appointments) > 0) {\n $table = new bookking_slot_table($bookking);\n $table->showattended = true;\n foreach ($appointments as $app) {\n $table->add_slot($app->get_slot(), $app, null, false);\n }\n\n echo $output->render($table);\n } else {\n echo get_string('noappointments', 'bookking');\n }\n\n if ($bookking->uses_grades()) {\n $grade = $bookking->get_gradebook_info($user->id);\n if ($grade) {\n $info = new bookking_totalgrade_info($bookking, $grade);\n echo $output->render($info);\n }\n }\n\n}", "public function userIndexReviews ()\n {\n $bookings = DB::table('bookings')->select('bookings.id','houses.id as house_id','houses.name as house_name','rooms.number','rooms.price','rooms.nickname','bookings.status','bookings.date_from','bookings.date_to','bookings.created_at','users.name','bookings.message','bookings.note','users.id as user_id')\n ->where('bookings.user_id','=', Auth::user()->id)\n ->whereIn('bookings.status', [6,72])\n ->join('users','users.id','=','bookings.user_id')\n ->join('rooms','rooms.id','=','bookings.room_id')\n ->join('houses', 'houses.id','=','rooms.house_id')\n ->join('managers','managers.id', '=', 'houses.manager_id')\n // ->latest()\n ->paginate(15);\n\n foreach ($bookings as $booking)\n {\n $im = DB::table('image_houses')->select('image')\n ->where('house_id','=',$booking->house_id)\n ->orderBy('priority')\n ->first();\n if ($im == null) {\n $non_image = ['priority'=>'100','id'=>'0', 'image'=>'room_4.jpeg'];\n $non_image= (object) $non_image;\n $im=$non_image;\n }\n\n $query = DB::table('status_update as su')->select('su.date')\n ->where('su.booking_id','=',$booking->id)\n ->latest()\n ->first();\n\n $booking->image = $im->image;\n $booking->update = (isset($query->date)) ? $query->date : $booking->created_at;\n }\n // dd($bookings);\n return view('bookings.adminuser',[\n 'bookings' => $bookings\n ]);\n }", "public static function forUserApartments(int $user_id, bool $onlyFutureBookings) {\n\t\t\t\n\t\t\t$builder = self::where('apartment_owner_id', $user_id)->where('status', 'confirmed')->with('bookedServices');\n\t\t\tif ($onlyFutureBookings) {\n\t\t\t\t$builder->where('check_out', '>', Carbon::now());\n\t\t\t}\n\t\t\t$apartmentsWithBookings = $builder->get()->groupBy('apartment_id')->toArray();\n\t\t\t$data = [];\n\t\t\t//apartments loop\n\t\t\tforeach ($apartmentsWithBookings as $key => $apartmentWithBookings) {\n\t\t\t\t$singleApartment =\n\t\t\t\t [\n\t\t\t\t\t'apartment_title' => $apartmentWithBookings[0]['apartment_title'],\n\t\t\t\t\t'apartment_active' => !empty($key),\n\t\t\t\t\t'apartment_slug' => $apartmentWithBookings[0]['apartment_slug'],\n\t\t\t\t\t'apartment_image' => $apartmentWithBookings[0]['apartment_image'],\n\t\t\t\t\t'apartment_owner_nickname' => $apartmentWithBookings[0]['apartment_owner_nickname'],\n\t\t\t\t\t'apartment_owner_fullname' => $apartmentWithBookings[0]['apartment_owner_fullname'],\n\t\t\t\t\t'apartment_owner_email' => $apartmentWithBookings[0]['apartment_owner_email'],\n\t\t\t\t\t\"bookings\" => []\n\t\t\t\t ];\n\t\t\t\t//booking loop\n\t\t\t\tforeach ($apartmentWithBookings as $booking) {\n\t\t\t\t\t$singleBooking =\n\t\t\t\t\t [\n\t\t\t\t\t\t'booking_reference' => $booking['reference'],\n\t\t\t\t\t\t'status' => $booking['status'],\n\t\t\t\t\t\t'user_nickname' => $booking['user_booking_nickname'],\n\t\t\t\t\t\t'user_fullname' => $booking['user_booking_fullname'],\n\t\t\t\t\t\t'user_email' => $booking['user_booking_email'],\n\t\t\t\t\t\t'check_in' => Utility::dateTimeLocale($booking['check_in'], false),\n\t\t\t\t\t\t'check_out' => Utility::dateTimeLocale($booking['check_out'], false),\n\t\t\t\t\t\t'nights_count' => Utility::diffInDays($booking['check_in'], $booking['check_out']),\n\t\t\t\t\t\t'total_amount' => '',\n\t\t\t\t\t\t'confirmed_at' => Utility::dateTimeLocale($booking['created_at'], true),\n\t\t\t\t\t\t'upgrades' => [],\n\t\t\t\t\t ];\n\t\t\t\t\t$upgrade_amout_per_night = 0;\n\t\t\t\t\t//upgrades loop\n\t\t\t\t\tforeach ($booking['booked_services'] as $booked_service) {\n\t\t\t\t\t\t$services =\n\t\t\t\t\t\t [\n\t\t\t\t\t\t\t'service_name' => $booked_service['name'],\n\t\t\t\t\t\t\t'service_price' => $booked_service['price_per_night'],\n\t\t\t\t\t\t ];\n\t\t\t\t\t\t$singleBooking['upgrades'][] = $services;\n\t\t\t\t\t\t$upgrade_amout_per_night += $booked_service['price_per_night'];\n\t\t\t\t\t}\n\t\t\t\t\t$singleBooking['total_amount'] = ($booking['apartment_price_per_night'] + $upgrade_amout_per_night) * $singleBooking['nights_count'];\n\t\t\t\t\t$singleApartment['bookings'][] = $singleBooking;\n\t\t\t\t}\n\t\t\t\t$data[] = $singleApartment;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}", "public function userIndexMyStays ()\n {\n if(Auth::user()){\n $bookings = DB::table('bookings')->select('bookings.id','houses.id as house_id','houses.name as house_name','rooms.number','rooms.price','rooms.nickname','bookings.status','bookings.date_from','bookings.date_to','bookings.created_at','users.name','bookings.message','bookings.note','users.id as user_id')\n ->where('bookings.status', '=', '5')\n ->where('bookings.user_id','=', Auth::user()->id)\n ->join('users','users.id','=','bookings.user_id')\n ->join('rooms','rooms.id','=','bookings.room_id')\n ->join('houses', 'houses.id','=','rooms.house_id')\n ->join('managers','managers.id', '=', 'houses.manager_id')\n // ->latest()\n ->paginate(15);\n\n foreach ($bookings as $booking)\n {\n $im = DB::table('image_houses')->select('image')\n ->where('house_id','=',$booking->house_id)\n ->orderBy('priority')\n ->first();\n if ($im == null) {\n $non_image = ['priority'=>'100','id'=>'0', 'image'=>'room_4.jpeg'];\n $non_image= (object) $non_image;\n $im=$non_image;\n }\n\n $query = DB::table('status_update as su')->select('su.date')\n ->where('su.booking_id','=',$booking->id)\n ->latest()\n ->first();\n\n $booking->image = $im->image;\n $booking->update = (isset($query->date)) ? $query->date : $booking->created_at;\n }\n // dd($bookings);\n return view('bookings.adminuser',[\n 'bookings' => $bookings\n ]);\n }\n else{\n return view('auth.login',[\n 'url'=>'booking/confirmed/user'\n ]);\n }\n \n }", "function getParticipantsForMeetings($array)\n {\n $result = array();\n for ($i=0; $i < count($array); $i++) {\n $bookingID = $array[$i][\"id\"];\n\n $obj = $array[$i];\n\n $query = $this->db->query(\"SELECT bookingID, users.* from booking_invitations join users on users.id = booking_invitations.userID where bookingID = $bookingID\");\n if($query->num_rows()>0)\n {\n $obj[\"users\"] = $query->result_array();\n\n }\n else\n {\n $obj[\"users\"] = array();\n\n }\n\n array_push($result, $obj);\n }\n\n return $result;\n }", "static function getFollowingUsers($chef) {\n $users = get_user_meta($chef, 'following_user', true);\n $followingUsers = ($users ? $users : array());\n return $followingUsers;\n }", "function printCheckuserNeeded() {\r\n $criteria = array('status' => Appeal::$STATUS_AWAITING_CHECKUSER);\r\n return printAppealList($criteria);\r\n}" ]
[ "0.7522101", "0.7064489", "0.7032601", "0.7007592", "0.69726455", "0.69559157", "0.6890436", "0.68362606", "0.673918", "0.6614181", "0.6583911", "0.647382", "0.64432585", "0.64397997", "0.6422146", "0.6403946", "0.63601345", "0.63598406", "0.6355165", "0.6343776", "0.63173264", "0.62985677", "0.628762", "0.6274613", "0.62215793", "0.61559445", "0.61535585", "0.6151045", "0.6148658", "0.6116728", "0.6075607", "0.6048169", "0.6029653", "0.6029548", "0.60193", "0.6002091", "0.59899074", "0.5985912", "0.59818536", "0.59738994", "0.59581745", "0.5918169", "0.5910874", "0.5902463", "0.5898207", "0.5895361", "0.58886886", "0.5883906", "0.587816", "0.58758175", "0.5852379", "0.58520305", "0.5841857", "0.583996", "0.5796467", "0.57920134", "0.5779763", "0.5777425", "0.57772934", "0.5772688", "0.5756601", "0.5735312", "0.57290256", "0.5726433", "0.57235724", "0.57180625", "0.5712764", "0.56959534", "0.56704074", "0.5666393", "0.56473094", "0.5643859", "0.562672", "0.56240916", "0.5624069", "0.5616843", "0.5612759", "0.56014", "0.56011915", "0.56003386", "0.559078", "0.5586516", "0.55822927", "0.55781716", "0.5574706", "0.5569992", "0.55668485", "0.5558316", "0.555766", "0.5556086", "0.55516666", "0.55468", "0.55421126", "0.55372274", "0.55364585", "0.55281425", "0.5523766", "0.5518516", "0.5514203", "0.5493543" ]
0.7382018
1
Validate data and return data with errors if exist
public function validateData(array $rules) { $validator = Validator::make(request()->all(), $rules); if ($validator->fails()) { $data['errors'] = $validator->errors(); return $data; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function validateData();", "abstract public function validateData($data);", "function validate($data)\n\t{\n\t\t\n\t\t$res[] = [\n\t\t\t'validity' => false,\n\t\t\t'type' => 'all',\n\t\t\t'message' => ''\n\t\t];\n\t\t//required check\n\t\tif(isset($data['required'])){\n\t\t\t$dataForCheck = $data['required'];\n\t\t\tforeach ($dataForCheck as $key => $value) {\n\t\t\t\tif($value != null && $value != '' && !empty($value) && !is_null($value))\n\t\t\t\t{\n\t\t\t\t\t$res[] = [\n\t\t\t\t\t\t'validity' => true,\n\t\t\t\t\t\t'type' => 'required',\n\t\t\t\t\t\t'message' => 'Success'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$res[] = [\n\t\t\t\t\t\t'validity' => false,\n\t\t\t\t\t\t'type' => 'required',\n\t\t\t\t\t\t'message' => 'Some required fields are missing'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $res;\n\t}", "public static function validateData(): array\n {\n\n $data = self::sanitizeData();\n\n // check for name\n if (empty($data['fname'])) {\n $data['errorName'] = 'First name is blank';\n } elseif(strlen($data['fname']) < 2 || strlen($data['fname']) > 20) {\n $data['errorName'] = 'First name must be in range of 2-20 char...';\n }\n\n // check for lname\n if (empty($data['lname'])) {\n $data['errorLastName'] = 'Last name is blank';\n } elseif(strlen($data['lname']) < 2 || strlen($data['lname']) > 30) {\n $data['errorLastName'] = 'Last name must be in range of 2-30 char...';\n }\n\n // check for email\n if (empty($data['email'])) {\n $data['errorEmail'] = 'Email cannot be blank';\n }\n\n // check for gender\n if (empty($data['gender'])) {\n $data['errorGender'] = 'Gender must be selected';\n }\n\n // check for passwords\n\n if (empty($data['password']) || empty($data['cpassword'])) {\n $data['errorPassword'] = 'Password cannot be empty';\n } elseif(strlen($data['password']) < 5 || strlen($data['cpassword']) < 5) {\n $data['errorPassword'] = 'Password must be longer than 5 char...';\n }\n\n if ($data['password'] !== $data['cpassword']) {\n $data['errorPassword'] = 'Passowrd must be a same';\n } \n\n // check birtth\n if (empty($data['birthDate'])) {\n $data['errorBirth'] = 'Birth Date cannot be empty';\n }\n\n if (empty($data['profilePic'])) {\n $data['profilePic'] = '/images/profile.jpg';\n }\n\n if (empty($data['coverPic'])) {\n $data['coverPic'] = 'images/cover.png';\n }\n\n return $data;\n }", "public function validate($data): array;", "abstract protected function validate($data);", "public function validate($data) {\n $data = $this->gump->sanitize($data); // You don't have to sanitize, but it's safest to do so.\n\n $this->gump->validation_rules(array(\n 'user_id' => 'required|max_len,100',\n 'plan_id' => 'required|numeric',\n 'plan_start' => 'required|date',\n 'plan_end' => 'required|date',\n 'price' => 'required|numeric',\n 'vat' => 'numeric',\n 'price_total' => 'required|numeric'\n ));\n\n $this->gump->filter_rules(array(\n 'user_id' => 'trim|sanitize_string',\n 'plan_id' => 'trim|sanitize_string',\n 'plan_start' => 'trim|sanitize_string',\n 'plan_end' => 'trim|sanitize_string',\n 'price' => 'trim|sanitize_string',\n 'vat' => 'trim|sanitize_string',\n 'price_total' => 'trim|sanitize_string',\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n return $data;\n }\n }", "private function validateData() {\r\n\r\n $requiredFields = array(\"v_code\" => \"Verification code not supplied\",\r\n \"psw1\" => \"Password field is empty\",\r\n \"psw2\" => \"Password field is empty\",);\r\n\r\n\r\n //0 means there is no error\r\n $error_status = \\VAL_NO_ERROR;\r\n\r\n /*\r\n Initialize error object that will be returned by this function\r\n */\r\n $error_obj = new stdClass();\r\n $error_obj->msg = \"\";\r\n $error_obj->field = \"\";\r\n $error_obj->code = 0;\r\n $error_obj->type = \\VAL_NO_ERROR;\r\n\r\n //check if required variables are defined\r\n foreach ($requiredFields as $key => $value) {\r\n $value = $this->request->request->get($key);\r\n if (empty( $value )) {\r\n $error_obj->field = $key;\r\n $error_obj->msg = $requiredFields[$key];\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n //return after each field that is found wrong\r\n return $error_obj;\r\n }\r\n }\r\n\r\n $pass_1 = $this->request->request->get('psw1');\r\n $pass_2 = $this->request->request->get('psw2');\r\n\r\n //Check if emails match\r\n if (strcmp($pass_1, $pass_2) != 0) {\r\n $error_obj->field = \"psw2\";\r\n $error_obj->msg = \"Passwords are different\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n /*\r\n Only check one password. If both passwords are thesame, we only need to check one of them.\r\n */\r\n if (!preg_match('/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}$/', $pass_1)) {\r\n $error_obj->field = \"psw1\";\r\n $error_obj->msg = \"Password must have a digit, lower and upper case charters. Min lenght is 6\";\r\n $error_obj->type = \\VAL_FIELD_ERROR;\r\n\r\n return $error_obj;\r\n }\r\n\r\n return $error_obj;\r\n }", "private function validateData ($data){\n if(isset($data[\"nombres\"]) && !preg_match('/^[a-zA-ZáéíóúÁÉÍÓÚñÑ ]+$/',$data[\"nombres\"])){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, no se permiten numeros en el nombre del usuario\");\n print json_encode($json, true);\n return false;\n }\n if(isset($data[\"apellidos\"]) && !preg_match('/^[a-zA-ZáéíóúÁÉÍÓÚñÑ ]+$/',$data[\"apellidos\"])){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, no se permiten numeros en el apellido del usuario\");\n print json_encode($json, true);\n return false;\n }\n if(isset($data[\"email\"]) && !preg_match('/^(([^<>()\\[\\]\\\\.,;:\\s@”]+(\\.[^<>()\\[\\]\\\\.,;:\\s@”]+)*)|(“.+”))@((\\[[0–9]{1,3}\\.[0–9]{1,3}\\.[0–9]{1,3}\\.[0–9]{1,3}])|(([a-zA-Z\\-0–9]+\\.)+[a-zA-Z]{2,}))$/',$data[\"email\"])){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, el email no es valido\");\n print json_encode($json, true);\n return false;\n \n }\n if(isset($data[\"email\"])){\n $conn = clientesModels::validateEmail('clientes',$data[\"email\"]);\n if($conn != 0){\n $json = array(\"status\"=>404, \"detalles\"=>\"Error, El email {$data[\"email\"]} ya esta registrado\");\n print json_encode($json, true);\n return false;\n }\n }\n \n \n return true;\n }", "private function validateData()\n {\n if (empty($this->nome)) {\n $this->errors->addMessage(\"O nome é obrigatório\");\n }\n\n if (!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {\n $this->errors->addMessage(\"O e-mail é inválido\");\n }\n\n if (strlen($this->senha) < 6) {\n $this->errors->addMessage(\"A senha deve ter no minímo 6 caracteres!\");\n }\n if ($this->emailExiste($this->email, 'email')) {\n $this->errors->addMessage(\"Esse e-mail já está cadastrado\");\n }\n if ($this->emailExiste($this->usuario, 'usuario')) {\n $this->errors->addMessage(\"Esse usuário já está cadastrado\");\n }\n\n return $this->errors->hasError();\n }", "public function validateData(){\n return true;\n }", "private function _validData($data){\n\t\t$columnsLen = array(\n\t\t\t\t\t\t\t'nro_pedido' => 6,\n\t\t\t\t\t\t\t'id_factura_pagos' => 1,\n\t\t\t\t\t\t\t'valor' => 1,\n\t\t\t\t\t\t\t'concepto' => 1,\n\t\t\t\t\t\t\t'fecha_inicio' => 0,\n\t\t\t\t\t\t\t'fecha_fin' => 0,\n\t\t\t\t\t\t\t'id_user' => 1\n\t\t);\n\t\treturn $this->_checkColumnsData($columnsLen, $data);\n\t}", "function validation($data){\n\tif (empty($data['name']))\n\t\treturn \"Please enter your name\";\n\tif (empty($data['tel']))\n\t\treturn \"Please enter valid contact number\";\n\treturn 0;\n}", "function isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient !'];\n $isFileNumberValid = isFileNumberValid($fileNumber);\n if (!$isFileNumberValid) {\n $result['message'] = \"Please Enter a Valid File No\";\n return $result;\n }\n if (!$name) {\n $result['message'] = \"Please Enter Patient Name\";\n return $result;\n }\n $phoneNoIsValid = isPhoneNoValid($phoneNo);\n if (!$phoneNoIsValid) {\n $result['message'] = \"Please Enter Valid Phone No\";\n return $result;\n }\n $isDateOfBirthValid = isDateOfBirthValid($dateOfBirth);\n if (!$isDateOfBirthValid) {\n $result['message'] = \"Please Enter a Valid Date of Birth\";\n return $result;\n }\n $result['result'] = true;\n return $result;\n}", "public function validate($data) {\n $data = $this->gump->sanitize($data);\n $this->gump->validation_rules(array(\n 'name' => 'required|max_len,100',\n 'capacity' => 'required|numeric',\n 'color' => 'required|max_len,7'\n ));\n\n $this->gump->filter_rules(array(\n 'name' => 'trim|sanitize_string',\n 'capacity' => 'trim|sanitize_string',\n 'color' => 'trim|sanitize_string',\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n return $data;\n }\n }", "function isDataValid() \n {\n return true;\n }", "public function validate($data)\n {\n // TODO create enum for gender\n\n $email_validator = new EmailValidator('errors.email.invalid');\n $fname_validator = new MinLengthValidator('errors.fname.minLength', 3);\n $lname_validator = new MinLengthValidator('errors.lname.minLength', 3);\n $gender_validator = new MinLengthValidator('errors.gender.minLength', 4);\n $birthdate_validator = new MinLengthValidator('errors.birthdate.minLength', 10);\n $errors = [];\n $email_validator->isValid($data['email']) ? true : array_push($errors, $email_validator->getMessage());\n\n $fname_validator->isValid($data['first_name']) ? true : array_push($errors, $fname_validator->getMessage());\n\n $lname_validator->isValid($data['last_name']) ? true : array_push($errors, $lname_validator->getMessage());\n\n $gender_validator->isValid($data['gender']) ? true : array_push($errors, $gender_validator->getMessage());\n\n $birthdate_validator->isValid($data['birth_date']) ? true : array_push($errors, $birthdate_validator->getMessage());\n\n return $errors;\n }", "function validateData($request) {\n\tglobal $amessages;\n\tinclude_once(ROOT_PATH.'classes/data/validate.class.php');\n\t$error = array();\n\t$validate = new Validate();\n\t$error['INPUT']['module'] = $validate->validString($request->element('module'),$amessages['object']);\t\n\t$error['INPUT']['name'] = $validate->validString($request->element('name'),$amessages['name']);\n\t$error['INPUT']['title'] = $validate->validString($request->element('title'),$amessages['title']);\n\t$error['INPUT']['class'] = $validate->pasteString($request->element('class'));\n\t$error['INPUT']['type'] = $validate->validNumber($request->element('type'),$amessages['custom_field_type']);\n\t$error['INPUT']['value'] = $validate->pasteString($request->element('value'));\n\tif($request->element('type')>3) $error['INPUT']['value'] = $validate->validString($request->element('value'),$amessages['custom_field_value']);\n\t$error['INPUT']['position'] = $validate->pasteString($request->element('position'));\n\t$error['INPUT']['status'] = $validate->pasteString($request->element('status'));\n\t\n\tif($error['INPUT']['module']['error'] || $error['INPUT']['name']['error'] || $error['INPUT']['title']['error'] || $error['INPUT']['type']['error'] || $error['INPUT']['value']['error']) {\n\t\t$error['invalid'] = 1;\n\t\treturn $error;\n\t}\n\t$error['invalid'] = 0;\n\treturn $error;\n}", "protected function validate_data_fields(){\n\t\tif(empty($this->RESPONSE)){throw new Exception(\"Response field not found\", 5);}\n\t\t\n\t\t// The remote IP address is also required\n\t\tif($this->validate_ip($this->REMOTE_ADDRESS)){throw new Exception(\"Renote IP address not set correctly\", 6);}\n\t}", "protected function validate() {\n\t\t// This loop has to be removed for 1.1\n\t\tforeach ($this->data as $k => $v) {\n\t\t\tif ($k == '__SESS_ID') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$sep = strpos('/', $k) !== false ? '/' : '-';\n\t\t\tbreak;\n\t\t}\n\n\t\t$validities = array();\n\n\t\t$hasError = ake(self::RESPONSE_ERROR, $this->responses);\n\n\t\tif (empty($this->data)) {\n\t\t\treturn $hasError;\n\t\t}\n\n\t\t$sep = null;\n\n\n\t\t// DEPRECATED, to be removed for 1.1\n\t\tforeach ($this->data as $k => $v) {\n\t\t\tif ($k == '__SESS_ID') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (is_null($sep)) {\n\t\t\t\t$sep = strpos($k, '/') !== false ? '/' : '-';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// DEPRECATED, to be removed for 1.1\n\t\tif ($sep == '/') {\n\t\t\tforeach ($this->data as $k => $v) {\n\t\t\t\tif ($k == '__SESS_ID') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$id = explode($sep, $k);\n\n\t\t\t\tif (count($id) > 3) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->structure[$this->table] as &$field) {\n\t\t\t\t\tif (is_array($field) && array_key_exists('name', $field) && $field['name'] == $id[2]) {\n\t\t\t\t\t\tif (array_key_exists('validation', $field)) {\n\t\t\t\t\t\t\t$r = '/' . $field['validation']['rule'] . '/';\n\n\t\t\t\t\t\t\tif (!preg_match($r, $v)) {\n\t\t\t\t\t\t\t\t$hasError = true;\n\t\t\t\t\t\t\t\t$this->addResponse($field['validation']['message'], self::RESPONSE_ERROR);\n\t\t\t\t\t\t\t\t$validities[$field['name']] = false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$validities[$field['name']] = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this->toSave[$id[2]] = $v;\n\t\t\t}\n\n\t\t\t$this->view->set('validities', $validities);\n\n\t\t\treturn $hasError == false;\n\t\t\t// NEW WAY TO VALIDATE\n\t\t}\n\n\n\t\t// Here is final line code to keep for 1.1\n\n\t\t$dbs = array();\n\n\t\t// We order POST data by db/table to call the right model for each data\n\t\tforeach ($this->data as $k => $v) {\n\t\t\t// Find something less ugly\n\t\t\t$c = count(explode('-', $k)) - 1;\n\n\t\t\t// DB nor table given, we apply implicit db and table of this controller\n\t\t\tif ($c == 0) {\n\t\t\t\t$db = $this->_implicit;\n\n\t\t\t\tif (!is_null($this->model)) {\n\t\t\t\t\tthrow new ErrorException('POST field ' . $k . ' has not been associated to a table.');\n\t\t\t\t}\n\n\t\t\t\t$table = $this->model->getTable();\n\n\t\t\t\t$field = $k;\n\t\t\t\t// Only table and field are given, we apply implicit db of this controller\n\t\t\t} else if ($c == 1) {\n\t\t\t\t$db = $this->_implicit;\n\t\t\t\tlist ( $table, $field ) = explode('-', $k);\n\t\t\t} else {\n\t\t\t\tlist ( $db, $table, $field ) = explode('-', $k);\n\t\t\t}\n\n\n\t\t\t// Now we add field in all fields to be validated\n\t\t\t$db = camelize($db, '_');\n\n\t\t\tif (!ake($db, $dbs)) {\n\t\t\t\t$dbs[$db] = array();\n\t\t\t}\n\n\t\t\t$model = camelize($table, '_');\n\n\t\t\tif (!ake($model, $dbs[$db])) {\n\t\t\t\t$dbs[$db][$model] = array();\n\t\t\t}\n\n\t\t\t$dbs[$db][$model][$field] = $v;\n\t\t}\n\n\t\t$result = array();\n\n\t\t// And we call each model to validate data\n\t\tforeach ($dbs as $db => $models) {\n\t\t\tforeach ($models as $model => $fields) {\n\t\t\t\t$result = $this->$db->$model->validate($fields, $result);\n\t\t\t}\n\t\t}\n\n\t\t// [DEPRECATED] >>\n\t\t$this->toSave = $result['data'];\n\t\t// << [DEPRECATED]\n\t\t// We send result messages to view\n\t\tforeach ($result['messages'] as $msg) {\n\t\t\t$this->addResponse($msg, self::RESPONSE_ERROR);\n\t\t}\n\n\t\t$this->view->set('validities', $result['validities']);\n\n\t\treturn empty($result['messages']);\n\t}", "public function validateFormData($data) {\n\n $errors = array();\n\n // twitter name\n if (strlen($data['twitterName']) < 1 || strlen($data['twitterName']) > 100) {\n $errors['twitterName'] = 'Full name is required and must be less than 100 characters.';\n }\n\n // twitter username\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['twitterUsername']) || strlen($data['twitterUsername']) < 1 || strlen($data['twitterUsername']) > 15) {\n $errors['twitterUsername'] = 'Username must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // cron key\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['cronKey']) || strlen($data['cronKey']) < 1 || strlen($data['cronKey']) > 50) {\n $errors['cronKey'] = 'The cron key must only use letters, numbers, underscores, and be 50 or fewer characters in length.';\n }\n\n // timezone\n if (!date_default_timezone_set($data['timezone'])) {\n $errors['timezone'] = 'Not a valid timezone.';\n }\n\n // database prefix\n if (!preg_match(\"/^[a-zA-Z0-9_]+$/\", $data['databasePrefix']) || strlen($data['databasePrefix']) < 1 || strlen($data['databasePrefix']) > 15) {\n $errors['databasePrefix'] = 'The database prefix must only use letters, numbers, underscores, and be 15 or fewer characters in length.';\n }\n\n // do one last check to require all fields without a specific check\n $requiredFields = array('twitterName', 'twitterUsername', 'consumerKey', 'consumerSecret', 'oauthToken', 'oauthSecret', 'baseUrl', 'timezone', 'cronKey', 'databaseHost', 'databaseDatabase', 'databaseUsername', 'databasePassword', 'databasePrefix');\n foreach ($requiredFields as $field) {\n if (!isset($errors[$field]) && strlen(trim($data[$field])) < 1) {\n $errors[$field] = 'This field is required.';\n }\n }\n\n return (count($errors)) ? $errors : false;\n\n }", "public function validateData($data): void;", "public function userDataValidation($data)\n {\n $rules = array(\n 'userName' => 'required | min:4 | max:50 | unique:users,userName,'.$this->user_id.',user_id',\n 'email' => 'required | email | unique:users,email,'.$this->user_id.',user_id',\n 'firstName' => 'min:4 | max:50',\n 'lastName' => 'min:4 | max:50'\n );\n\n $messages = array(\n 'userName.required' => 'the :attribute is required.',\n 'userName.min' => 'the :attribute must be between 4 and 50 characters.',\n 'userName.max' => 'the :attribute must be between 4 and 50 characters.',\n 'userName.unique' => 'the :attribute is already taken.',\n 'email.required' => 'the :attribute is required.',\n 'email.email' => 'the :attribute is not valid.',\n 'email.unique' => 'the :attribute is already taken.',\n 'firstName.min' => 'the :attribute must be between 4 and 50 characters.',\n 'firstName.max' => 'the :attribute must be between 4 and 50 characters.',\n 'lastName.max' => 'the :attribute must be between 4 and 50 characters.',\n 'lastName.min' => 'the :attribute must be between 4 and 50 characters.',\n );\n\n $validator = Validator::make($data, $rules, $messages);\n return $validator;\n }", "public function isDataValid(): bool;", "private function dataValidator(){\n\n $data = request()->validate([\n 'description' => 'required',\n 'file' => 'image|mimes:jpeg, png, jpg|max:4096'\n ],[\n 'description.required' => 'El contenido del mensaje es obligatorio.',\n 'file.image' => 'Solo se permiten archivos jpg, png y jpeg.',\n 'file.max' => 'El archivo no debe pesar más de 4 MB.'\n ]);\n\n return $data;\n }", "public static function checkData($data) {\n $errors=[];\n\n // Liste de champs obligatoires\n $mandatoryFields=[\n 'title' => \"Veuillez saisir un titre pour le nouveau quiz\",\n 'description' => \"Veuillez décrire le nouveau quiz\",\n ];\n\n foreach ($mandatoryFields as $fieldName => $msg) {\n\n // on vérifie les champs obligatoires\n if (empty($data[$fieldName])) {\n\n //erreur, le champ est vide!\n $errors[]=$msg;\n }\n\n return $errors;\n }\n\n }", "public function validate() {\n \n $errors = [];\n $names = explode(' ', $this->data->name, 2);\n\n if(count($names) < 2) {\n $errors['name'] = array('first and last names are required');\n }\n\n if(!filter_var($this->data->email, FILTER_VALIDATE_EMAIL)) {\n $errors['email'] = array($this->data->email.' is not a valid email address');\n }\n\n if(strlen($this->data->password) < 8) {\n $errors['password'] = array('password must be at least 8 characters');\n }\n\n return $errors;\n }", "protected function validateData($cfg,$data)\n { // Initialize the response\n $errors = array();\n \n // Loop through each data element and validate based on the type\n foreach( $cfg as $field => $info ) {\n // Get the value of the incoming field\n $value = isset($data[$field])?$data[$field]:null;\n\n // Get the data name\n $fieldName = str_replace('_',' ',$field);\n\n // Process any values that need to be manipulated\n switch( true ) {\n // Handle Zip Codes\n case ((string)$info->type === 'zip'):\n // Check if it is required\n if( $info->required and $value === null ) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n // Look up the state\n $data['state'] = ZipCode::getState($value);\n if( $data['state'] === false ) {\n $errors[$field] = \"Please provide a valid {$fieldName}\";\n $data['state'] = null;\n break;\n }\n break;\n // Handle Integers\n case ((string)$info->type === 'integer'):\n // Check if it is required\n if( $info->required and $value === null ) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n // Ensure a proper value\n if( !is_numeric($value) or \"\".intval($value) !== $value or $value < 0) {\n $errors[$field] = \"Please provide a valid {$fieldName}\";\n break;\n }\n \n break;\n // Handle Phones\n case ($info->type === 'phone'):\n // Check if it is required\n if( $info->required and $value === null ) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n // Ensure a proper value\n if (\n !is_numeric($value) or \n (\"\".intval($value) !== $value) or \n $value < 0 or strlen($value) < 10 or\n preg_match('/^([2-9]{1}\\d{2})([2-9]{1}\\d{2})\\d{4}$/',$value) == false\n ) {\n $errors[$field] = \"Please provide a valid {$fieldName}\";\n break;\n }\n break;\n // Handle SSN\n case ($info->type === 'ssn'):\n // Check if it is required\n if( $info->required and $value === null ) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n // Ensure a proper value\n if( \n !is_numeric($value) or \n \"\".intval($value) !== ltrim($value,'0') or \n $value < 0 or strlen($value) < 9 or \n substr($value,0,3) == '666' or\n substr($value,0,1) == '9' or\n substr($value,0,3) == '000' or\n substr($value,3,2) == '00' or\n substr($value,6,4) == '0000'\n ) {\n $errors[$field] = \"Please provide a valid {$fieldName}\";\n break;\n }\n break;\n // Handle Dates\n case ($info->type === 'date'):\n // Check if it is required\n if( $info->required and $value === null ) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n // Ensure that the value can be translated to a time\n $time = strtotime($value);\n if( $time === false ) {\n $errors[$field] = \"Please provide a valid {$fieldName}\";\n break;\n }\n // Check for absolute range settings\n if( isset($info->range->absolute) ) {\n // Check for min\n if( isset($info->range->absolute->min) ) {\n // Get the minimum date as a timestamp\n $min = $info->range->absolute->min;\n $limit = false;\n switch(true) {\n case ($min == 'today'):\n $limit = strtotime(date('Y-m-d 00:00:00'));\n break;\n case ($min == 'yesterday'):\n $limit = strtotime(date('Y-m-d 00:00:00'))-86400;\n break;\n case ($min == 'tomorrow'):\n $limit = strtotime(date('Y-m-d 00:00:00'))+86400;\n break;\n case (in_array($min,array_keys($data))):\n $limit = strtitime($data[$min]);\n break;\n default:\n $limit = strtotime($min);\n break;\n }\n // Enforce ordering\n if( $time <= $limit ) {\n $errors[$field] = ucfirst($fieldName).\" must be after \".str_replace('_',' ',$min);\n break;\n }\n }\n // Check for max\n if( isset($info->range->absolute->max) ) {\n // Get the maximum date as a timestamp\n $max = $info->range->absolute->max;\n $limit = false;\n switch(true) {\n case ($max == 'today'):\n $limit = strtotime(date('Y-m-d 00:00:00'));\n break;\n case ($max == 'yesterday'):\n $limit = strtotime(date('Y-m-d 00:00:00'))-86400;\n break;\n case ($max == 'tomorrow'):\n $limit = strtotime(date('Y-m-d 00:00:00'))+86400;\n break;\n case (in_array($max,array_keys($data))):\n $limit = strtotime($data[$max]);\n break;\n default:\n $limit = strtotime($max);\n break;\n }\n // Enforce ordering\n if( $time >= $limit ) {\n $errors[$field] = ucfirst($fieldName).\" must be before \".str_replace('_',' ',$max);\n break;\n }\n }\n }\n // Check for relative range settings\n if( isset($info->range->relative) ) {\n // Check for min\n if( isset($info->range->relative->min) ) {\n // Get the minimum date as a timestamp\n $min = $info->range->relative->min;\n $limit = false;\n switch(true) {\n case ($min == 'today'):\n $limit = strtotime(date('Y-m-d 00:00:00'));\n break;\n case ($min == 'yesterday'):\n $limit = strtotime(date('Y-m-d 00:00:00'))-86400;\n break;\n case ($min == 'tomorrow'):\n $limit = strtotime(date('Y-m-d 00:00:00'))+86400;\n break;\n case (in_array($min,array_keys($data))):\n $limit = strtotime($data[$min]);\n break;\n default:\n $limit = strtotime($min);\n break;\n }\n // Enforce ordering\n if( $time <= $limit ) {\n $errors[$field] = ucfirst($fieldName).\" must be after \".str_replace('_',' ',$min);\n break;\n }\n }\n // Check for max\n if( isset($info->range->relative->max) ) {\n // Get the maximum date as a timestamp\n $max = $info->range->relative->max;\n $limit = false;\n switch(true) {\n case ($max == 'today'):\n $limit = strtotime(date('Y-m-d 00:00:00'));\n break;\n case ($max == 'yesterday'):\n $limit = strtotime(date('Y-m-d 00:00:00'))-86400;\n break;\n case ($max == 'tomorrow'):\n $limit = strtotime(date('Y-m-d 00:00:00'))+86400;\n break;\n case (in_array($max,array_keys($data))):\n $limit = strtotime($data[$max]);\n break;\n default:\n $limit = strtotime($max);\n break;\n }\n // Enforce ordering\n if( $time >= $limit ) {\n $errors[$field] = ucfirst($fieldName).\" must be before \".str_replace('_',' ',$max);\n break;\n }\n }\n }\n // Check for bank holidays\n if( isset($info->bankDay) and $info->bankDay ) {\n // Check for weekends\n $day = date('D',$time);\n if( $day == 'Sat' or $day == 'Sun' ) {\n $errors[$field] = ucfirst($fieldName).\" cannot fall on a weekend\";\n break;\n }\n // Check for bank holidays\n if( Holiday::check(date('Y-m-d',$time)) ) {\n $errors[$field] = ucfirst($fieldName).\" cannot fall on a federal holiday\";\n break;\n }\n }\n break;\n // Handle pay schedules\n case ((string)$field == 'pay_schedule'):\n // Check if it is required\n if( $info->required and $value === null ) {\n $errors[$field] = \"Please choose your {$fieldName}\";\n break;\n }\n // Check for valid entries\n if( !in_array($value,$info->values) ) {\n $errors[$field] = \"Please choose a valid {$fieldName}\";\n break;\n }\n // Enforce schedule limits\n if( \n in_array($info->match->start,array_keys($data)) and\n in_array($info->match->end,array_keys($data))\n ) {\n // Get the start and end timestamps\n $start = strtotime($data[$info->match->start]);\n $end = strtotime($data[$info->match->end]);\n // Get the longest time lapse allowed\n switch($value) {\n case \"weekly\":\n $lapse = 10*86400;\n break;\n case \"biweekly\":\n $lapse = 17*86400;\n break;\n case \"semimonthly\":\n $lapse = 18*86400;\n break;\n case \"monthly\":\n $lapse = 33*86400;\n break;\n }\n // Check to make sure the actual time lapse is inside the range\n if( $end - $start >= $lapse ) {\n $errors[$field] = \"Paydates do not match pay schedule\";\n break;\n }\n }\n break;\n // Handle lists\n case ((string)$info->type === 'list'):\n // Handle 'true' and 'false' values\n $listval = $value;\n if( $listval === true ) $listval = 'true';\n if( $listval === false ) $listval = 'false';\n // Check if it is required\n if( $info->required and $listval === null ) {\n $errors[$field] = \"Please choose your {$fieldName}\";\n break;\n }\n // Check for valid entries\n if( !in_array($listval,$info->values) ) {\n $errors[$field] = \"Please choose a valid {$fieldName}\";\n break;\n }\n break;\n // Handle email addresses\n case ((string)$info->type === 'email'):\n if( $info->required and !isset($data[$field]) and $data[$field] === null) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n if( filter_var($value,FILTER_VALIDATE_EMAIL) === false ) {\n $errors[$field] = \"Please provide a valid {$fieldName}\";\n break;\n }\n break;\n // Handle terms\n case ((string)$field == 'terms'):\n if( $info->required and !isset($data[$field]) and $data[$field] === null) {\n $errors[$field] = \"You must agree to the terms and privacy policy to continue\";\n break;\n }\n break;\n // Handle bank name\n case ((string)$info->type == 'bankRoutingNumber'):\n // Check for valid entry\n if( $info->required and !isset($data[$field]) and $data[$field] === null) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n // Check for entry in table\n if( RoutingNumber::getName($value) === false ) {\n $errors[$field] = \"Please provide a valid {$fieldName}\";\n break;\n }\n break;\n // Handle bank name\n case ((string)$info->type == 'bankName'):\n // Check for valid entry\n if( $info->required and !isset($data[$field]) and $data[$field] === null) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n break;\n }\n // Check for match to router number\n if( isset($info->match) and in_array($info->match,array_keys($data)) ) {\n // Get the name by the routing number\n $name = RoutingNumber::getName($data[$info->match]);\n // If the name and the value are non null and don't match, show error and replace user entered name with the one from the DB\n if( $name !== false and strtolower($name) != strtolower($value) ) {\n $errors[$field] = ucfirst($fieldName) .\" does not match \".str_replace($info->match,'_',' ').\". Did you mean {$name}?\";\n // Store the updated data\n $sessData = $this->_data;\n $sessData[$field] = $name;\n $this->_data = $sessData;\n // Save the data to the session\n Yii::app()->session['data'] = $this->_data;\n }\n break;\n }\n break;\n // Default behavior\n default:\n // Check if it is required\n if( $info->required and !isset($data[$field]) and $data[$field] === null) {\n $errors[$field] = \"Please provide your {$fieldName}\";\n }\n break;\n }\n }\n\n // Return the collected errors\n return $errors;\n \n }", "public function validates(array $data)\n\t{\n\t\t$this->errors = [];\n\t\t$this->data = $data;\n\n\t\treturn $this->errors;\n\t}", "public static function validateCreateRequest() {\n $errors = array();\n $data = array();\n self::checkTitle($errors, $data);\n self::checkDescription($errors, $data);\n self::checkGoal($errors, $data);\n self::checkStartDate($errors, $data);\n self::checkDuration($errors, $data);\n self::checkCategories($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'create_project']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "protected function validationData()\n {\n return $this->json()->all();\n }", "public function isDataValid() {\n if ($this->userExists())\n $this->_errors[] = 'username already taken';\n // username and password must match pattern\n else if (empty($this->_username) || !preg_match('/^[a-zA-Z0-9]{5,16}$/', $this->_username))\n $this->_errors[] = 'invalid username must be between 5 and 16 characters';\n else if (empty($this->_password) || !preg_match('/^[a-zA-Z0-9]{6,18}$/', $this->_password))\n $this->_errors[] = 'invalid password must be between 6 and 18 characters';\n\t\t else if (empty($this->_password) || $this->_password != $this->_password_confirm)\n $this->_errors[] = \"Password didn't match X\";\n // names must be between 2 and 22 characters\n else if (empty($this->_first_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_first_name))\n $this->_errors[] = 'invalid first name must be between 2 and 22 characters';\n else if (empty($this->_last_name) || !preg_match('/^[a-zA-Z0-9]{2,22}$/', $this->_last_name))\n $this->_errors[] = 'invalid last name must be between 2 and 22 characters';\n //restricts day to 01-31, month to 01-12 and year to 1900-2099 (also allowing / - or . between the parts of the date) \n else if (empty($this->_dob) || !preg_match('/^(0?[1-9]|[12][0-9]|3[01])[\\/\\ ](0?[1-9]|1[0-2])[\\/\\ ](19|20)\\d{2}$/', $this->_dob))\n $this->_errors[] = 'invalid dod | must be DD/MM/YYYY format';\n else if (empty($this->_address))\n $this->_errors[] = 'invalid address';\n // checks if valid postal code\n else if (empty($this->_postcode) || !preg_match('/^(([A-PR-UW-Z]{1}[A-IK-Y]?)([0-9]?[A-HJKS-UW]?[ABEHMNPRVWXY]?|[0-9]?[0-9]?))\\s?([0-9]{1}[ABD-HJLNP-UW-Z]{2})$/', $this->_postcode))\n $this->_errors[] = 'invalid postcode | must be AA11 9AA format';\n // checks is valid email using regular expression\n else if (empty($this->_email) || !preg_match('/^[_\\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\\.)+[a-zA-Z]{2,6}$/', $this->_email))\n $this->_errors[] = 'invalid email';\n\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }", "function validation($data){\n $errors= array();\n if ($foundcourses = get_records('course', 'shortname', $data['shortname'])) {\n if (!empty($data['id'])) {\n unset($foundcourses[$data['id']]);\n }\n if (!empty($foundcourses)) {\n foreach ($foundcourses as $foundcourse) {\n $foundcoursenames[] = $foundcourse->fullname;\n }\n $foundcoursenamestring = implode(',', $foundcoursenames);\n $errors['shortname']= get_string('shortnametaken', '', $foundcoursenamestring);\n }\n }\n\n if (empty($data['enrolenddisabled'])){\n if ($data['enrolenddate'] <= $data['enrolstartdate']){\n $errors['enroldateendgrp'] = get_string('enrolenddaterror');\n }\n }\n\n if (0 == count($errors)){\n return true;\n } else {\n return $errors;\n }\n }", "public function getValidationResult();", "function validateData($fields, $vars) \n{ \n\t// array for storing error messages \n\tglobal $err_mess; \t\t\t\t\t\t// error message, make accessible outside function \n\t$err_msg = \"\"; \t\t\t\t\t\t\t// blank to begin with \n\t$fields_ok = true;\t\t\t\t\t\t// success/failure indicator - assume success \n\n\t// for each field name in validation information validate data \n\t// data according to rules for field \n\t// $fields[x] - attribute name \n\t// $fields[x+1] - validation code \n\t// $fields[x+2] - human name for error message \n\t// validation codes - correspond to array entry in function validateData \n\t// 1 - field required - primary key, \"new\" (new record) or numeric (existing record) \n\t// 2 - field required - foreign key, must be numeric, must be > 0 \n\t// 3 - field required - phone number, must be 10 digits long \n\t// 4 - field required - email address \n\t//\t 5 - field required - no validation required \n\t// code + 100 - field not required but same validation as code if field required \n\t\n\t// want to consider validation for all fields in record \n\tfor ($i=0; $i<count($fields); $i=$i+3) \n\t{\n\t\t// extract data value from $vars that corresponds \n\t\t// to field name in validation data \n\t\t$field_name = $fields[$i]; \t\t\t// field name \n\t\t$field_data = $vars[$field_name]; \t// data value from form \n\t\t$field_code = $fields[$i+1];\t\t// validation code \n\t\t$field_err = $fields[$i+2];\t\t\t// field name for error message \n\t\t\n\t\t// determine if validating primary key \n\t\tif ($field_code==1) { \n\t\t\t// primary key, required field, must be \"new\" or numeric \n\t\t\tif (strlen($field_data)==0) { \n\t\t\t\t// required field not entered \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// not blank so \n\t\t\t\t// check for \"new\" (new record) or numeric (update existing record) \n\t\t\t\tif ($field_data != \"new\") { \n\t\t\t\t\tif (is_numeric($field_data) == false) { \n\t\t\t\t\t\t// invalid primary key \n\t\t\t\t\t\t$err_mess .=$field_err .\" - invalid primary key \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t\t// indicate validation problem \t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\n\t\t// determine if validating foreign key \n\t\tif ($field_code==2 or $field_code==102) {\n\t\t\t// validation may be required on number \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==2 and is_numeric($field_data)==false) { \n\t\t\t\t// required foreign key and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not blank, must be number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// ensure value is > 0 \n\t\t\t\t\tif ($field_data <= 0) { \n\t\t\t\t\t\t// invalid foreign key \n\t\t\t\t\t\t$err_mess .=$field_err .\"-select \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// determine if validating phone number \n\t\tif ($field_code==3 or $field_code==103) { \n\t\t\t// validation may be required on phone number \n\t\t\tif ($field_code==3 and $field_data==\"\") { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t\t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\t// validate if not required field & data entered \n\t\t\t\tif ($field_data!=\"\" and is_numeric($field_data)==false) { \n\t\t\t\t\t// field is not a number \n\t\t\t\t\t$err_mess .=$field_err .\"-not numeric \"; \n\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t} else { \n\t\t\t\t\t// check for correct length (must be 10 digits) \n\t\t\t\t\tif ($field_data!=\"\" and strlen($field_data)!=10) {\n\t\t\t\t\t\t// phone number length not 10 \n\t\t\t\t\t\t$err_mess .=$field_err .\"-must be 10 digits \"; \n\t\t\t\t\t\t$fields_ok = false; // indicate validation problem \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} \n\t\t\n\t\t// determine if validating email address \n\t\tif ($field_code==4 or $field_code==104) { \n\t\t\t// validation may be required on email address \n\t\t\t// check if required field and no data \n\t\t\tif ($field_code==4 and (!isEmail($field_data))) { \n\t\t\t\t// required field and invalid email address \n\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t} else { \t\t\t\t\t\t// could still be no data \n\t\t\t\tif ($field_data!=\"\") { \n\t\t\t\t\t// validate email address \n\t\t\t\t\tif (!isEmail($field_data)) { \n\t\t\t\t\t\t// invalid email address \n\t\t\t\t\t\t$err_mess .=$field_err .\"-invalid address \"; \n\t\t\t\t\t\t$fields_ok = false;\t\t// indicate validation problem \n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t}\n\t\t} \n\n\t\t// determine if no validation required (but could be required field) \n\t\tif ($field_code==5 or $field_code==105) { \n\t\t\t// considering field with no validation requirements \n\t\t\tif ($field_code==5 and strlen($field_data)==0) { \n\t\t\t\t// required field and no data \n\t\t\t\t$err_mess .=$field_err .\"-required field \"; \n\t\t\t\t$fields_ok = false; \t// indicate validation problem \n\t\t\t}\n\t\t} \n\t} \n\n\t// all fields validated, return success/failure indicator \n\treturn $fields_ok; \t\n}", "function validateData($array){\n\t\t$errorFlag=true;\n\t\t$currentDate = getdate(); //get current date\n\t\tif (trim($array['FName'])==''){\n\t\t\t$this->appendErrorMsg(\"First Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['LName'])==''){\n\t\t\t$this->appendErrorMsg(\"Last Name is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['License_No'])==''){\n\t\t\t$this->appendErrorMsg(\"License number is required\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Birthdate'])==''){\n\t\t\t$this->appendErrorMsg(\"Birthdate cannot be blank\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{4,4}[-][0-1]{1,2}?[0-9]{1,2}[-][0-3]{1,2}?[0-9]{1,2}$/\", $array['Birthdate'])){\n\t\t\t$this->appendErrorMsg(\"Date should be in the format yyyy-mm-dd\");\n\t\t\t$errorFlag = false;\n\t\t} else if (getAge($array['Birthdate'])<16 || getAge($array['Birthdate'])> 100){\n\t\t\t$this->appendErrorMsg(\"Sorry, we do not provide coverage to drivers under the age of 16 or over the age of 100\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['PostalCode'])==''){\n\t\t\t$this->appendErrorMsg(\"Postal Code is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}[A-Za-z]{1}\\d{1}$/\",$array['PostalCode'])){\n\t\t\t$this->appendErrorMsg(\"Postal Code should be in the format A1B2C3\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (trim($array['Phone'])==''){\n\t\t\t$this->appendErrorMsg(\"Phone number is required\");\n\t\t\t$errorFlag = false;\n\t\t} else if (!preg_match(\"/^[0-9]{10}$/\",$array['Phone'])){\n\t\t\t$this->appendErrorMsg(\"Phone number must be in the format xxx-xxx-xxxx or xxxxxxxxx\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\tif (!preg_match(\"/^[0-9]{1,}$/\", $array['Years_Exp'])){\n\t\t\t$this->appendErrorMsg(\"Please input the number of Years of Experience\");\n\t\t\t$errorFlag = false;\n\t\t}\n\t\treturn $errorFlag;\n\t}", "public static function validateCreateRequest() {\n $errors = array();\n $data = array();\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "function validateData($data) {\n $data = json_decode($data);\n $typesArr = [1, 2];\n\n if (!in_array((int)$data->type, $typesArr)) {\n return false;\n } else {\n $data->type = (int)$data->type;\n }\n\n if (empty($data->feedback)) {\n return false;\n }\n\n if ($data->type == 2 && !filter_var($data->url, FILTER_VALIDATE_URL)) {\n return false;\n }\n\n if (empty($data->name)) {\n $data->name = \"anonymous\";\n }\n\n if (empty($data->email)) {\n $data->email = \"anonymous\";\n }\n\n return $data;\n }", "public final function verifyData($key){\n\n unset($this->errors[$key]);\n\n if(!array_key_exists($key,$this->data)){\n\n if(!array_key_exists($key,$this->definition)){\n throw new \\Disco\\exceptions\\Exception(\"Field `{$key}` is not defined by this data model\");\n }//if\n\n //DEFAULT\n if(array_key_exists('default',$this->definition[$key])){\n $this->data[$key] = $this->definition[$key]['default'];\n }//if\n //REQUIRED\n else if($this->getDefinitionValue($key,'required')){\n return $this->setError($key,\"`{$key}` is required\");\n }//elif\n else {\n return false;\n }//el\n\n }//if\n\n //PREMASSAGE\n if(($massage = $this->getDefinitionValue($key,'premassage')) !== false){\n $this->data[$key] = $this->{$massage}($this->data[$key]);\n }//if\n\n $value = $this->data[$key];\n\n //REGEXP\n if(($regexp = $this->getDefinitionValue($key,'regexp')) !== false){\n if(($default = \\App::getCondition($regexp)) !== false && !\\App::matchCondition($default,$value)){\n return $this->setError($key);\n }//if\n if(!preg_match(\"/{$regexp}/\",$value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //METHOD\n if(($method = $this->getDefinitionValue($key,'method')) !== false){\n if(!$this->{$method}($value)){\n return $this->setError($key);\n }//if\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n //NULLABLE\n if($this->getDefinitionValue($key,'nullable') && $value === null){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n $type = $this->getDefinitionValue($key,'type');\n\n //TRUTHY\n if($type != 'boolean' && $this->getDefinitionValue($key,'truthy') && is_bool($value)){\n $this->_postMassage($key,$value);\n return true;\n }//if\n\n switch($type){\n\n case 'int':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'uint':\n\n if(!$this->_isValidInt($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive integer\");\n }//if\n\n break;\n\n case 'float':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n break;\n\n case 'ufloat':\n\n if(!$this->_isValidFloat($key,$value)){\n return false;\n }//if\n\n if($value < 0){\n return $this->setError($key,\"`{$key}` must be a positive number\");\n }//if\n\n break;\n\n case 'string':\n\n if(!is_string($value)){\n return $this->setError($key,\"`{$key}` must be a string\");\n }//if\n\n if(($min = $this->getDefinitionValue($key,'minlen')) !== false && strlen($value) < $min){\n return $this->setError($key,\"`{$key}` must be greater than {$min} characters long\");\n }//if\n\n if(($max = $this->getDefinitionValue($key,'maxlen')) !== false && strlen($value) > $max){\n return $this->setError($key,\"`{$key}` must be less than {$max} characters long\");\n }//if\n\n break;\n\n case 'char':\n\n if(!is_string($value) || strlen($value) != 1){\n return $this->setError($key,\"`{$key}` must be a single character\");\n }//if\n\n break;\n\n case 'boolean': \n\n if(!is_bool($value)){\n return $this->setError($key,\"`{$key}` must be a boolean value\");\n }//if\n\n break;\n\n case 'array':\n\n if(!is_array($value)){\n return $this->setError($key,\"`{$key}` must be an array\");\n }//if\n\n break;\n\n case 'object':\n\n if(is_object($value)){\n if(($instanceof = $this->getDefinitionValue($key,'instanceof')) !== false && !$value instanceof $instanceof){\n return $this->setError($key,\"`{$key}` must be an instance of `{$instanceof}`\");\n }//if\n } //if\n else {\n return $this->setError($key,\"`{$key}` must be an object\");\n }//if\n\n break;\n\n case 'closure':\n\n if(!is_object($value) || !$value instanceof \\Closure){\n return $this->setError($key,\"`{$key}` must be a closure\");\n }//if \n\n break;\n\n default:\n return $this->setError($key);\n\n }//switch\n\n //IN\n if(($in = $this->getDefinitionValue($key,'in')) !== false && !in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must be a value of `{$in}`\");\n }//if\n\n //NOTIN\n if(($in = $this->getDefinitionValue($key,'notin')) !== false && in_array($value,$in)){\n $in = implode(', ',$in);\n return $this->setError($key,\"`{$key}` must not be a value of `{$in}`\");\n }//if\n\n $this->_postMassage($key,$value);\n\n }", "public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }", "public function validateInput($data)\n {\n if (!$this->validateEmpty($data))\n return ['status' => false, 'errors' => 'Dữ liệu không hợp lệ.'];\n\n $msgs = $this->validateLogic($data);\n return $msgs;\n }", "public function validate()\n\t{\n\t\t$errors = array();\n\t\t\n\t\t//make sure user is logged in\n\t\tif (empty($this->userid)) \n\t\t{\n\t\t\t$errors['userid'] = true;\n\t\t}\n\t\t\n\t\t//verify all info is provided\n\t\tif (isset($this->title))\n\t\t\t$this->title = strip_tags($this->title);\n\t\telse\n\t\t\t$errors['title'] = true;\n\t\t\t\n\t\tif (isset($this->description))\n\t\t\t$this->description = strip_tags($this->description);\n\t\telse\n\t\t\t$errors['description'] = true;\n\t\t\t\n\t\tif (isset($this->content))\n\t\t\t$this->content = strip_tags($this->content, \"<br><b>\");\n\t\telse\n\t\t\t$errors['content'] = true;\n\t\t\t\n\t\tif (isset($this->location))\n\t\t\t$this->location = strip_tags($this->location);\n\t\telse\n\t\t\t$errors['location'] = true;\n\t\t\n\t\tif (!isset($this->category))\n\t\t\t$errors['category'] = true;\n\t\t\t\n\t\tif (!isset($this->enddatetime))\n\t\t\t$errors['enddatetime'] = true;\n\t\t\n\t\t\n\t\t//If we made it here, all is valid\n\t\tif (count($errors) > 0)\n\t\t\treturn $errors;\n\t\telse\n\t\t\treturn NULL;\n\t}", "function validate_all($required, $data)\n{\n $result = array();\n $result['code'] = 1;\n $result['error'] = \"All OK!\";\n if (count(array_intersect_key($required, $data)) != count($required)) {\n $result['code'] = 0;\n $result['error'] = \"Fields Mismatch!\";\n return $result;\n }\n foreach ($required as $field => $rules) {\n $value = trim($data[$field]);\n $code = 0;\n $error = \"\";\n switch ($rules['type']) {\n case 'numeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!is_numeric($value)) {\n $error = $field . \" is not numeric.\";\n } else if (isset($rules['min'])) {\n if ($value < $rules['min']) {\n $error = $field . \" min error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else if (isset($rules['max'])) {\n if ($value > $rules['max']) {\n $error = $field . \" max error.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alpha_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'alphanumeric_space':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match('/^[a-zA-Z0-9 ]+$/', $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'email':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'pattern':\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else if (!preg_match($rules['pattern'], $value)) {\n $error = $field . \" is invalid.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n case 'any':\n # code...\n if ($rules['required'] && empty($value)) {\n $error = $field . \" is empty.\";\n } else {\n $code = 1;\n $error = \"All OK!\";\n }\n break;\n }\n $result['fields'][$field] = array('code' => $code, 'error' => $error, 'value' => $value, 'field' => $field);\n }\n foreach ($result['fields'] as $row) {\n if ($row[\"code\"] == 0) {\n $result['code'] = 0;\n $result['error'] = $row['error'];\n break;\n }\n }\n return $result;\n}", "public function validate($data) {\n\t\t$validator = new ofaFormValidator();\n\t\t\n\t\t// Add rules for required fields\n\t\t$validator->addConstraint('departmentId', ofaFormValidator::REQUIRED);\n\t\t$validator->addConstraint('course', ofaFormValidator::REQUIRED);\n\t\t$validator->addConstraint('number', ofaFormValidator::REQUIRED);\n\t\t$validator->addConstraint('title', ofaFormValidator::REQUIRED);\n\n\t\t// Validate the data\n\t\t// Returns an object with the data on true or an array with the invalid fields on false\n\t\treturn $validator->validate($data);\n\t}", "private function dataCreateValidate()\n\t{\n\t\treturn array(\n\t\t\t'file_date' => form_error('file_date'),\n\t\t\t'type_file' => form_error('type_file')\n\t\t);\n\t}", "public function get_validate_response_data() {\n\t\treturn [];\n\t}", "public static function checkErrors(): array\n {\n $data = self::validateData();\n $errors = [];\n\n if (!empty($data['errorName'])) {\n $errors['errorName'] = $data['errorName'];\n }\n if (!empty($data['errorLastName'])) {\n $errors['errorLastName'] = $data['errorLastName'];\n }\n if (!empty($data['errorEmail'])) {\n $errors['errorEmail'] = $data['errorEmail'];\n }\n if (!empty($data['errorGender'])) {\n $errors['errorGender'] = $data['errorGender'];\n }\n if (!empty($data['errorPassword'])) {\n $errors['errorPassword'] = $data['errorPassword'];\n }\n if (!empty($data['errorBirth'])) {\n $errors['errorBirth'] = $data['errorBirth'];\n }\n\n return $errors;\n }", "private function joinValidate($data)\n\t{\n\t\t/*\n\t\t [iam] => org\n\t\t[name] => Peter\n\t\t[email] => [email protected]\n\t\t[pw] => 12345\n\t\t[avatar] => 5427fb55f3a5d.jpg\n\t\t[phone] => 02261889971\n\t\t[lat] => 48.0649838\n\t\t[lon] => 7.885475300000053\n\t\t[str] => Bauerngasse\n\t\t[nr] => 6\n\t\t[plz] => 79211\n\t\t[country] => DE\n\t\t*/\n\t\t\n\t\t$check = true;\n\t\t\n\t\t$data['type'] = 0;\n\t\t\n\t\tif($data['iam'] == 'org')\n\t\t{\n\t\t\t$data['type'] = 1;\n\t\t}\n\t\t\n\t\tif($data['avatar'] != '')\n\t\t{\n\t\t\t$data['avatar'] = $this->resizeAvatar($data['avatar']);\n\t\t}\n\t\t\n\t\t$data['name'] = strip_tags($data['name']);\n\t\t$data['name'] = trim($data['name']);\n\t\t\n\t\t$data['surname'] = strip_tags($data['surname']);\n\t\t$data['surname'] = trim($data['surname']);\n\t\t\n\t\tif($data['name'] == '')\n\t\t{\n\t\t\treturn s('error_name');\n\t\t}\n\t\t\n\t\tif(!validEmail($data['email']))\n\t\t{\n\t\t\treturn s('error_email');\n\t\t}\n\t\t\n\t\tif($this->model->emailExists($data['email']))\n\t\t{\n\t\t\treturn s('email_exists');\n\t\t}\n\t\t\n\t\tif(strlen($data['pw']) < 5 && strlen($data['pw']) > 30)\n\t\t{\n\t\t\treturn s('error_password');\n\t\t}\n\t\t\n\t\t$data['gender'] = (int)$data['gender'];\n\t\t\n\t\tif($data['gender'] > 2 || $data['gender'] < 0)\n\t\t{\n\t\t\t$data['gender'] = 0;\n\t\t}\n\t\t\n\t\t$data['phone'] = $this->format_phone_number($data['phone']);\n\t\t$data['lat'] = floatval($data['lat']);\n\t\t$data['lon'] = floatval($data['lon']);\n\t\t$data['str'] = strip_tags($data['str']);\n\t\t$data['plz'] = preg_replace('[^0-9]', '', $data['plz']).'';\n\t\t$data['city'] = strip_tags($data['city']);\n\t\t$data['city'] = trim($data['city']);\n\t\t$data['country'] = strip_tags($data['country']);\n\t\t$data['country'] = strtolower($data['country']);\n\t\t$data['country'] = trim($data['country']);\n\t\t\n\t\treturn $data;\n\t\t\n\t}", "public function validate(array $data);", "public function validate(array $data);", "protected function validator($data){\n return $data->validate([\n 'name' => ['required', 'string'],\n 'email' => ['required', 'email'],\n 'rol' => ['required'],\n 'activo' => ['required'],\n ]); \n }", "function validation($data, $files) {\n $errors = parent::validation($data, $files);\n \n if(empty($data['ukprn'])) {\n $errors['ukprn'] = get_string('error_missing_school_name', 'enrol_ukfilmnet');\n }\n if($data['contact_email'] && strpos( $data['contact_email'], '@') === false) {\n $errors['contact_email'] = get_string('error_invalid_email', 'enrol_ukfilmnet');\n }\n if(!array_key_exists('school_consent_to_contact', $data)) {\n $errors['school_consent_to_contact'] = get_string('error_missing_school_consent_to_contact', 'enrol_ukfilmnet');\n }\n \n return $errors;\n }", "public function formValidation($dataSet){\n\t\t\t$error=FALSE; $data=array();\n\t\t\tforeach ($dataSet as $aData) {\n\t\t\t\tif($aData['validationString']=='name'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedName(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='number'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNumericData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='integer'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getIntegerData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='sanitize'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getSanitizeData(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='gsm phone'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidated080GSMNo(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='email'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getValidatedEmail(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='password rule'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->enforceRulePassword(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='non empty textarea'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->getNonEmptyTextField(trim($aData['dataValue']));\n\t\t\t\t}\n\t\t\t\tif($aData['validationString']=='in list'){\n\t\t\t\t\t$data[$aData['dataName']]=$this->checkInList($aData['dataValue'],$aData['dataList']);\n\t\t\t\t} \n\t\t\t}\n\t\t\tforeach ($data as $aData) {\n\t\t\t\tif($aData===FALSE) $error=TRUE;\n\t\t\t}\n\t\t\t$validedDataSet=array('error'=>$error, 'data'=>$data);\n\t\t\treturn $validedDataSet;\n\t\t}", "public abstract function validation();", "function validate_all($required,$data){\n\n\t$result = array();\n\t$result['code'] = 1;\n\t$result['error'] = \"All OK!\";\n\n\tif(count(array_intersect_key($required, $data)) != count($required)){\n\t\t$result['code'] = 0;\n\t\t$result['error'] = \"Fields Mismatch!\";\n\t\treturn $result;\n\t}\n\n\t$field_count \t= count($required);\n\n\tforeach ($required as $field => $rules) {\n\t\t$value = $data[$field];\n\n\t\t$code = 0;\n\t\t$error = \"\";\n\n\t\tswitch ($rules['type']) {\n\t\t\tcase 'numeric':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!is_numeric($value)){\n\t\t\t\t\t$error = $field.\" is not numeric.\";\n\t\t\t\t}else if(isset($rules['min'])){\n\t\t\t\t\tif($value < $rules['min']){\n\t\t\t\t\t\t$error = $field.\" min error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($rules['max'])){\n\t\t\t\t\tif($value > $rules['max']){\n\t\t\t\t\t\t$error = $field.\" max error.\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$code = 1;\n\t\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'alpha':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'email':\n\t\t\t\tif($rules['required'] && empty($value)){\n\t\t\t\t\t$error = $field.\" is empty.\";\t\n\t\t\t\t}else if(!preg_match($rules['pattern'], $value)){\n\t\t\t\t\t$error = $field.\" is invalid.\";\n\t\t\t\t}else{\n\t\t\t\t\t$code = 1;\n\t\t\t\t\t$error = \"All OK!\";\n\t\t\t\t}\t\t\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\n\n\t\t$result['fields'][$field] = array('code' => $code, 'error' => $error, 'value'=>$value, 'field'=>$field );\n\t}\n\n\tforeach ($result['fields'] as $row) {\n\t\tif($row[\"code\"] == 0){\n\t\t\t$result['code'] = 0;\n\t\t\t$result['error'] = \"Invalid Fields!\";\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\n\treturn $result;\n\n}", "public function isValid($data)\n {\n $rules = array(\n 'fechaPartido'=> 'required',\n 'fecha_id' => 'required'\n \n \n );\n \n $validator = Validator::make($data, $rules);\n \n if ($validator->passes())\n {\n return true;\n }\n \n $this->errors = $validator->errors();\n \n return false;\n }", "protected function checkStructure()\n {\n $structure = $this->getStructure();\n\n foreach ($structure as $field => $opt) {\n if (!array_key_exists($field, $this->data)) {\n continue;\n }\n\n $value = Arr::get($this->data, $field);\n if (is_array($value)) {\n $this->errors[$field][] = Translate::get('validate_wrong_type_data');\n continue;\n }\n\n $value = trim($value);\n $length = (int)$opt->length;\n\n if (!empty($length)) {\n $len = mb_strlen($value);\n if ($len > $length) {\n $this->errors[$field][] = Translate::getSprintf('validate_max_length', $length);\n continue;\n }\n }\n\n if (!$opt->autoIncrement && $opt->default === NULL && !$opt->allowNull && $this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_not_empty');\n continue;\n }\n\n switch ($opt->dataType) {\n case 'int':\n case 'bigint':\n if (!$this->isEmpty($value) && (filter_var($value, FILTER_VALIDATE_INT) === false)) {\n $this->errors[$field][] = Translate::get('validate_int');\n continue 2;\n }\n break;\n\n case 'double':\n if (!is_float($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_double');\n continue 2;\n }\n break;\n\n case 'float':\n if (!is_numeric($value) && !$this->isEmpty($value)) {\n $this->errors[$field][] = Translate::get('validate_float');\n continue 2;\n }\n break;\n\n case 'date':\n case 'datetime':\n case 'timestamp':\n if (!$this->isEmpty($value) && !Validate::dateSql($value)) {\n $this->errors[$field][] = Translate::get('validate_sql_date');\n continue 2;\n }\n break;\n\n default:\n continue 2;\n break;\n\n }\n }\n }", "public static function validate($data){\n return Validator::make($data, static::$rules);\n }", "public function validate($data): bool;", "public function validate($data): bool;", "public static function validate($data)\n\t{\n return Validator::make($data, Static::$rules);\n }", "public function validateForm(){\n foreach(self::$fields as $field){\n if(!array_key_exists($field, $this->data)){\n trigger_error(\"$field is not presented in data\");\n return;\n } \n }\n $this->validateUsername();\n $this->validatePassword();\n $this->validateEmail();\n $this->validateFullname();\n return $this->errors;\n }", "public function validation($data = array())\n\t{\n\t\t$error = array();\n\t\t$valid = false;\n\n\t\tif ($data['user'] == '' or strlen($data['user']) < 2) {\n\t\t\t$error['user'] = 'Ditt namn måste bestå av minst 2 bokstäver.';\n\t\t}\n\n\t\tif ($data['title'] == '' or strlen($data['title']) < 5) {\n\t\t\t$error['title'] = 'Titeln måste vara minst 5 bokstäver.';\n\t\t}\n\n\t\tif ($data['post'] == '' or strlen($data['post']) < 7) {\n\t\t\t$error['post'] = 'Meddelandet måste vara minst 7 bokstäver långt.';\n\t\t}\n\n\t\tif (empty($error)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn $error;\n\t}", "abstract public function isValid($data);", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "function tower_form_errors($data, $fields=[]) {\n $form_errors = [];\n foreach ($fields as $field) {\n $rules = explode('|', $field['rules']);\n $field_is_valid = true;\n $field_name = $field['name'];\n $value = trim(sanitize_text_field($data->get_param($field_name)));\n\n foreach ($rules as $rule) {\n if (! $field_is_valid) break;\n\n switch ($rule) {\n case 'email':\n if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'Enter a valid email address';\n }\n break;\n\n case 'number':\n if (! is_numeric($value)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field needs to be numeric';\n }\n break;\n\n case 'required':\n if ($value == '') {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field is required';\n }\n break;\n\n case 'unique':\n // check DB for meta-value duplicate entry\n global $wpdb;\n $row_count = $wpdb->get_var(\"\n SELECT COUNT(`meta_id`)\n FROM {$wpdb->postmeta} \n WHERE `meta_key` = '{$field_name}' \n AND `meta_value` = '{$value}'\n \");\n if ($row_count > 0) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This value already exists. Please select another';\n }\n break;\n }\n }\n }\n return $form_errors;\n}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function checkData() {\n\t\t// e.g. numbers must only have digits, e-mail addresses must have a \"@\" and a \".\".\n\t\treturn $this->control->checkPOST($this);\n\t}", "public function validate($data)\n {\n $v = Validator::make($data, $this->rules);\n $result = $v->passes();\n $this->v = $v;\n // return the result\n return $result;\n }", "function validate_visit_data($visit_data ) {\n\textract($visit_data);\n\t$err = array();\n\n\t// name: min 2 chars length\n\tif (empty($name )) {\n\t\t$err[] = 'Name is required.';\n\t}\telse if (mb_strlen($name ) < 1 ) {\n\t\t$err[] = 'Name must be at least 1 character long.';\n\t}\n\t\n\t// start_date: valid date. either integer timestamp (unix time in \n\t// milliseconds) or parseable date string.\n\tif (!isset($start_date )) {\n\t\t$err[] = 'Start date is required.';\n\t} else if (!is_numeric($start_date )) {\n\t\t$start_date = strtotime($start_date);\n\t\tif ($start_date === false ) {\n\t\t\t$err[] = \"Start date must be parseable by strtotime().\";\n\t\t}\n\t} else {\n\t\t$start_date /= 1000;\n\t}\n\n\t// end_date: valid date. either integer timestamp (unix time in\n\t// milliseconds) or parseable date string.\n\tif (!isset($end_date )) {\n\t\t$err[] = 'End date is required';\n\t} else if (!is_numeric($end_date )) {\n\t\t$end_date = strtotime($end_date);\n\t\tif ($end_date === false ) {\n\t\t\t$err[] = \"End date must be parseable by strtotime().\";\n\t\t}\n\t} else {\n\t\t$end_date /= 1000;\n\t}\n\n\t// sanity check: start date is BEFORE end date!\n\tif ($start_date && $end_date && ($end_date < $start_date)) {\n\t\t$err[] = 'End date must be >= start date';\n\t}\n\n\t// receivers: comma-separated list of axis usernames\n\tif (empty($receivers )) {\n\t\t$err[] = 'Receivers is required.';\n\t} else {\n\t\t$db = db_connect();\n\n\t\t$rs = $receivers;\n\t\tif (!is_array($receivers )) {\n\t\t\t$rs = explode(',', $receivers);\n\t\t}\n\n\t\t$receivers = array();\n\t\tforeach ($rs as $r ) {\n\t\t\t$r = trim($r);\n\n\t\t\t$sql = sprintf(\"SELECT * FROM info \".\n\t\t\t\t\"WHERE uname='%s' LIMIT 1\",\n\t\t\t\t$db->real_escape_string($r ));\n\n\t\t\tif ($result = $db->query($sql )) {\n\t\t\t\t$rec = $result->fetch_assoc();\n\t\t\t\tif (!$rec ) {\n\t\t\t\t\t$err[] = \"Receiver username \".\n\t\t\t\t\t\t\"not found: $r\";\n\t\t\t\t} else {\n\t\t\t\t\t$receivers[] = $rec;\n\t\t\t\t}\n\t\t\t\t$result->free();\n\t\t\t} else {\n\t\t\t\t$err[] = \"Internal error\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif (empty($picture )) {\n\t\t$err[] = 'Picture is required.';\n\t}\n\t\n\tif ($err ) {\n\t\tthrow new Http_error(400, implode(\"\\n\", $err ));\n\t}\n\n\treturn array(\n\t\t'name' => $name,\n\t\t// company is not required\n\t\t'company' => @$_POST['company'],\n\t\t'parking' => $parking,\n\t\t'start_date' => $start_date,\n\t\t'end_date' => $end_date,\n\t\t'receivers' => $receivers,\n\t\t'picture' => $picture,\n\t);\n}", "function validate(array $data)\n\t{\n\t}", "function validation($data, $files) {\n $errors = array();\n\n if (!$data['itemid']) {\n $errors['itemid'] = get_string('pleasechooseavalue', 'surveyreport_frequency');\n }\n\n return $errors;\n }", "public function validate($data)\n {\n // make a new validator object\n $v = \\Validator::make($data, $this->rules);\n // return the result\n return $v;\n\n // return $v->passes();\n }", "public function validateUsersData($data, $update = false, $loggedUser = []) {\n $errors = [];\n // Validate Email\n if (!$data['email'] || empty($data['email'])) {\n $errors['email_err'] = 'Please enter email';\n } else if (!filter_var($data['email'], FILTER_VALIDATE_EMAIL)) {\n $errors['email_err'] = 'Invalid mail';\n } else if (!$update && $this->findUser(['email' => $data['email']])) {\n $errors['email_err'] = 'Email has been already taken';\n }\n\n // Validate First Name\n if (!$data['first_name'] || empty($data['first_name'])) {\n $errors['first_name_err'] = 'Please enter first name';\n } else if (!preg_match('/^[A-Za-z0-9]{0,}$/', $data['first_name'])) {\n $errors['first_name_err'] = \"Name must include letters and numbers only\";\n } else if (strlen($data['first_name']) > 45) {\n $errors['first_name_err'] = \"Name must be less than 45 characters\";\n }\n\n // Validate Last Name\n if (!$data['last_name'] || empty($data['last_name'])) {\n $errors['last_name_err'] = 'Please enter last name';\n } else if (!preg_match('/^[A-Za-z0-9]{0,}$/', $data['last_name'])) {\n $errors['last_name_err'] = \"Last name must include letters and numbers only\";\n } else if (strlen($data['last_name']) > 45) {\n $errors['last_name_err'] = \"Last name must be less than 45 characters\";\n }\n\n // Validate login\n if (!$data['login'] || empty($data['login'])) {\n $errors['login_err'] = 'Please enter login';\n } else if (!preg_match('/^[A-Za-z0-9]{0,}$/', $data['login'])) {\n $errors['login_err'] = \"Login must include letters and numbers only\";\n } else if (strlen($data['login']) > 25) {\n $errors['login_err'] = \"Login must be less than 25 characters\";\n } else if (!$update && $this->getEmailByLogin($data['login'])) {\n $errors['login_err'] = 'This login has already been taken';\n }\n\n if (!$update) {\n $errors = $this->validatePassword($data['password'], $data['confirm_password'], $errors);\n } else {\n if ($loggedUser['password'] != hash('whirlpool', $data['password'])) {\n $errors['pass_err'] = 'Password incorrect';\n }\n if ($data['login'] != $loggedUser['login'] && $this->getEmailByLogin($data['login'])) {\n $errors['login_err'] = \"This login has already been taken\\n\";\n }\n if ($data['email'] != $loggedUser['email'] && $this->findUser(['email' => $data['email']])) {\n $errors['email_err'] = \"This email has already been taken\\n\";\n }\n if (!empty($data['new_pswd']) || !empty($data['new_pswd_confirm'])) {\n $errors = $this->validatePassword($data['new_pswd'], $data['new_pswd_confirm'], $errors);\n }\n }\n\n return $errors;\n }", "public function validate()\n {\n $validator = Validator::make($this->data, $this->fieldValidationArray());\n if ($validator->fails()) {\n throw $this->validationException(join(\", \", $validator->errors()->all()));\n }\n\n /* if there's a script, check that the script will return the right type .*/\n if (isset($this->data[\"script\"])) {\n if ($this->recordType == null) {\n throw $this->validationException(\"Script can't be tested because the field doesn't belong to a record type.\");\n }\n try {\n $script = $this->getScript($this->recordType);\n if ($script->type() != $this->data[\"type\"]) {\n throw $this->validationException(\"Script should return a '\" . $this->data[\"type\"] . \"' but returned a \" . $script->type());\n }\n } catch (ScriptException $e) {\n throw $this->validationException(\"Script has a problem: \" . $e->getMessage());\n }\n }\n }", "abstract public function validate(array $data, array $fields);", "function validate(&$data, $format = null, $options = array())\r\n\t\t{\r\n\t\t\tif(empty($format))\r\n\t\t\t{\r\n\t\t\t\treturn $this->inp->check($data);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn data_validation::validate($data, $format, $options);\r\n\t\t\t}\r\n\t\t}", "function validation($data, $files) {\n\t\treturn array();\n\t\t$error=array();\n\t\t$intensidad= $data['intensidad'];\n\t\t$categoria= $data['categoria'];\n\t\tif (empty($intensidad)){\n\t\t\t$error['intensidad']=\"No existe intensidad ingresado\";\n\t\t}\n\t\telse if (empty($categoria)){\n\t\t\t$error['categoria']= \"No se ingreso la categoria\";\n\t\t}\n\t\treturn $error;\n\t}", "protected function validate_return_data($data_obj)\r\n {\r\n // Transfer the error message when previous object execution fail\r\n if($data_obj->is_error === true)\r\n {\r\n $status_data = $data_obj->get_return_data_set();\r\n $this->set_error(\r\n $status_data[\"status\"], \r\n $status_data[\"status_information\"],\r\n $status_data[\"status_information\"]\r\n );\r\n } \r\n }", "public static function validateUpdateRequest() {\n $errors = array();\n $data = array();\n self::checkID($errors, $data);\n self::checkName($errors, $data);\n if (count($errors) > 0 && count($data) > 0) {\n redirect(url(['_page' => 'home']));\n } else if (count($errors) == 0){\n return $data;\n }\n return null;\n }", "function simplr_validate($data) {\r\n $errors = array();\r\n //validate the existance of first and last name, title and school\r\n if(!$data['first_name']){$errors[] = __('You must enter your first name.'); }\r\n if(!$data['last_name']){$errors[] = __('You must enter your last name.'); }\r\n if(!$data['title']){$errors[] = __('You must enter your title.'); }\r\n if(!$data['school']){$errors[] = __('You must enter the school/affiliation.'); }\r\n // Validate username\r\n if(!$data['user_login1']) { \r\n $errors[] = __('You must enter a username.'); \r\n } else {\r\n // check whether username is valid\r\n $user_test = validate_username( $data['user_login1'] );\r\n if($user_test != true) {\r\n $errors[] .= __('Invalid Username.');\r\n }\r\n // check whether username already exists\r\n $user_id = username_exists( $data['user_login1'] );\r\n if($user_id) {\r\n $errors[] .= __('This username already exists.');\r\n }\r\n } //end username validation\r\n if(!$data['user_pass1'] || !$data['user_pass_confirm']) {\r\n $errors[] = __('You must enter a password and password confirmation.');\r\n }\r\n // Make sure passwords match\r\n if($data['user_pass1'] != $data['user_pass_confirm']) {\r\n $errors[] = __('The passwords you entered do not match.');\r\n }\t\r\n // Validate email\r\n if(!$data['user_email']) { \r\n $errors[] = __('You must enter an email.'); \r\n } else {\r\n $email_test = email_exists($data['user_email']);\r\n if($email_test != false) {\r\n $errors[] .= __('An account with this email has already been registered.');\r\n }\r\n if( !is_email($data['user_email']) ) {\r\n $errors[] .= __('Please enter a valid email.');\r\n }\t\r\n } // end email validation\r\n return $errors;\r\n}", "protected function validationData() {\n\t\t$input = [];\n\n\t\t/**\n\t\t * Decode institute and ref_by id and merge to request input\n\t\t */\n\t\tif ( $this->has('institute_id') ) {\n\t\t\t$input['institute_id'] = GeneralHelpers::decode($this->input('institute_id'));\n\t\t}\n\n\t\tif ( $this->has('ref_by') ) {\n\t\t\t$input['ref_by'] = GeneralHelpers::decode($this->get('ref_by'));\n\t\t}\n\n\t\t$this->merge($input);\n\n\t\treturn parent::validationData(); // TODO: Change the autogenerated stub\n\t}", "private function _validate($data, $fields = array())\n {\n $validators = $this->group->validate();\n $messages = $this->group->message();\n if (!empty($fields)) {\n foreach ($fields as $field) {\n $validator[$field] = $validators[$field];\n }\n } else {\n $validator = $validators;\n }\n $invalid = Validator::make($data, $validator, $messages);\n\n return $invalid;\n }", "function validate()\n\t{\n\t\t$isValid = false;\n\t\t\n\t\tif(empty($this->data['username']))\n\t\t{\n\t\t\t\t$this->errors['username'] = \"Please enter a Username\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['password']))\n\t\t{\n\t\t\t\t$this->errors['password'] = \"Please enter a password\";\n\t\t}\n\t\t\n\t\tif(empty($this->data['description']))\n\t\t{\n\t\t\t\t$this->errors['description'] = \"Please enter a description of yourself\";\n\t\t}\n\t\t\n\t\t\n\t\t//validate data elements in userData property\n\t\t//if an error exists, store to errors using column name as key\n\t\t\n\t\t if(empty($this->errors))\n\t\t{\n\t\t\t$isValid = true;\n\t\t}\n\t\t\n\t\treturn $isValid;\n\t}", "public function isValid($_throwExceptionOnInvalidData = false);", "public function validate(array $data, array $params): array;", "public function getErrors(array $data)\n {\n $errors = array();\n\n foreach ($data as $key => $value) {\n if ($value !== false)\n continue;\n switch ($key) {\n case 'login':\n $errors['login'] = 'Логин должен состоять минимум из 4-х латинских имволов. Допускает включение цифр.';\n break;\n case 'password':\n $errors['password'] = 'Пароль должен состоять минимум из 6-ти символов. Латинские буквы или цифры.';\n break;\n case 'email':\n $errors['email'] = 'Неверный формат ввода email';\n break;\n case 'group':\n $errors['group'] = 'Неверный формат ввода группы';\n break;\n case 'captcha':\n $errors['captcha'] = 'Введите правильные данные с картинки';\n break;\n case 'deletedUser':\n $errors['delUser'] = 'Не удалось удалить профиль. Проверьте введенные данные';\n break;\n case 'noPass' :\n $errors['noPass'] = 'Введите правильный пароль';\n break;\n default:\n break;\n }\n }\n return empty($errors) ? null : $errors;\n }", "public function ggvalidateData()\n {\n \t$platform = Platform::find(Session::get('platform_id'));\n \t$platform_id = Session::get('platform_id');\n \t$game_id = Session::get('game_id');\n \t$game = Game::find($game_id);\n \t$api = SlaveApi::connect($game->eb_api_url, $game->eb_api_key, $game->eb_api_secret_key);\n \t$response = $api->ggvalidateData($game_id , $platform_id , '');\n \tif('200' != $response->http_code and null==$response->body)\n \t{\n \t\tApp::abort(404);\n \t}\n \t$data = $response->body;\n \t$view = array(\n \t\t\t\t\t'content' => View::make('platformapi.payment.ggvalidateShow',array(\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'data' => $data,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'platform' => $platform,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'game' => $game\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n \t\t\t\t\t\t\t\t\t\t )\n \t\t\t\t );\n \treturn View::make('main',$view);\n }", "public function errorValidation(array $data): Response\n {\n $response = [];\n $response['id'] = Uuid::uuid1();\n $response['title'] = 'Validation error';\n $response['detail'] = 'Some fields are not correctly sent';\n $response['source']['pointer'] = $data;\n $response['status'] = 400;\n\n return $this->withJson(['error' => $response], 400);\n }", "abstract public function validate();", "abstract public function validate();", "public function isValid($data);", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "protected function checkError($data) {\r\n\r\n\t\t$ret = Array();\r\n\t\t$error=false;\r\n\t\tforeach($data as $uidData) {\r\n\t\t\t\r\n\t\t\t// orkut specific\r\n\t\t\tif(isset($uidData['error']))\r\n\t\t\t{\r\n\t\t\t\t$error=true;\r\n\r\n\t\t\t\t// append captcha\r\n\t\t\t\tif(isset($uidData['error']['data']) && isset($uidData['error']['data']['captchaToken'])) {\r\n\t\t\t\t\t$captchaToken = $uidData['error']['data']['captchaToken'];\r\n\t\t\t\t\t$captchaUrl = g_captcha_handler.'?captchaUrl='. $uidData['error']['data']['captchaUrl'];\r\n\t\t\t\t\t$ret = array('id'=>'2', 'message'=>'captcha!', 'captchaToken'=>$captchaToken,'captchaUrl'=>$captchaUrl);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$ret = array('id'=>'1','message'=>'Error sending message');\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\r\n\r\n\t\tif(!$error)\r\n\t\t\t$ret = array('id'=>'0','message'=>'ok');\r\n\r\n\t\treturn $ret;\r\n\t}", "public function testThrowErrorsWhenDataAreInvalid(): void\n {\n $data = [\n \"name\" => \"\",\n \"description\" => \"The Star Wars The Last Jedi Collection 9TWENTY is constructed of a black poly fabric. A Star Wars fighter plane is embroidered on the front panels and the cap features a D-Ring closure.\",\n \"price\" => \"20.50\",\n \"category\" => [\n \"id\" => 1\n ],\n \"images\" => [\n [\n \"id\" => 1\n ]\n ]\n ];\n\n $response = $this->request('POST', '/api/products', $data);\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(400, $response->getStatusCode());\n $this->assertEquals('application/problem+json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertArrayHasKey('violations', $json);\n $this->assertCount(2, $json['violations']);\n\n $this->assertArrayHasKey('propertyPath', $json['violations'][0]);\n $this->assertEquals('name', $json['violations'][0]['propertyPath']);\n\n $this->assertArrayHasKey('propertyPath', $json['violations'][1]);\n $this->assertEquals('tax', $json['violations'][1]['propertyPath']);\n }", "public function validateTableData($postArray,$editId) \n{\n \n $fldErrors=array();\n $tblErrors=array();\n $errorMesg=array();\n \n $fldErrors=$this->validateFieldData($postArray);\n \n $tblErrors=$this->validateTableDataToFile($postArray,$editId); \n\n $errorMesg=$this->mergeErrorArrays($fldErrors,$tblErrors);\n \n return $errorMesg;\n \n}", "public static function validate() {}", "public function validate(array $data,$options = array()) \r\n\t{\t\r\n\t\t$options['filterNamespace']='H_Filter';\r\n\t\t$options['validatorNamespace']='H_Validate';\r\n\t\t\r\n\t\t$input = new Zend_Filter_Input($this -> _filters,$this -> _validators,$data,$options);\r\n\t\t\r\n\t\tif ($input->hasInvalid() || $input->hasMissing()) {\r\n\t\t\t$errorMessages = $input->getMessages();\r\n\t\t\t$error=new H_Error($errorMessages);\r\n\t\t} else {\r\n\t\t\t$data=array_merge($input->getUnescaped(),$input->getUnknown());\r\n\t\t\tif ($this->_dummyFields) {\r\n\t\t\t\tforeach ($this->_dummyFields as $field) {\r\n\t\t\t\t\tif (isset($data[$field])) {\r\n\t\t\t\t\t\tunset($data[$field]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $data;\r\n\t\t}\r\n\t\treturn $error;\r\n\t}", "public function validate($data) {\n\n\t\t$this->validationErrors = [];\n\n\t\t$amount = (float)$data['amount'];\n\t\tif ($amount <= 0) {\n\t\t\t$this->validationErrors['error_amount'] = true;\n\t\t}\n\n\t\t// Personal data should be either all blank or all set:\n\t\tif ($this->wantsReceipt($data)) {\n\t\t\tif (empty($data['data_privacy_statement_accepted'])) {\n\t\t\t\t$this->validationErrors['error_data_privacy_statement_accepted'] = true;\n\t\t\t}\n\t\t\tif ($amount < 50) {\n\t\t\t\t$this->validationErrors['error_donation_too_small_for_receipt'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_firstname'])) {\n\t\t\t\t$this->validationErrors['error_donation_firstname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_lastname'])) {\n\t\t\t\t$this->validationErrors['error_donation_lastname'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_street_address'])) {\n\t\t\t\t$this->validationErrors['error_donation_street_address'] = true;\n\t\t\t}\n\t\t\tif (!preg_match('/^[0-9]{5}$/', $data['donation_zip'])) {\n\t\t\t\t$this->validationErrors['error_donation_zip'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_city'])) {\n\t\t\t\t$this->validationErrors['error_donation_city'] = true;\n\t\t\t}\n\t\t\tif (empty($data['donation_country'])) {\n\t\t\t\t$this->validationErrors['error_donation_country'] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn empty($this->validationErrors);\n\t}", "public function validateData(){\n\t\tif (!self::isEmailValid($this->email))\n\t\t\tthrow new Exception(\"Email address {$this->email} is not a valid email address.\");\n\n\t\tparent::validateData();\n\t}", "protected function validate($data) {\n $isValid = false;\n\n // check if we have all the data we need\n if(!isset($data['interaction'])) {\n $this->errors[] = 'No interaction data.';\n }\n\n if(!isset($data['interaction']['type'])) {\n $this->errors[] = 'No interaction type.';\n }\n\n if(!isset($data['interaction']['id'])) {\n $this->errors[] = 'No interaction id.';\n }\n\n if(!isset($data['destination'])) {\n $this->errors[] = 'No destination data.';\n }\n\n if(!isset($data['destination']['type'])) {\n $this->errors[] = 'No destination type.';\n }\n\n if(!isset($data['destination']['id'])) {\n $this->errors[] = 'No destination id.';\n }\n\n if(!isset($data['userID'])) {\n $this->errors[] = 'No user id.';\n }\n\n if(!isset($data['treeID'])) {\n $this->errors[] = 'No tree id.';\n }\n\n if(!isset($data['site']['embedID'])) {\n $this->errors[] = 'No embed id.';\n }\n\n // if we have any errors, return false. Passes first round of being the correct data structure\n if(!empty($this->errors)) {\n return $isValid;\n }\n\n // we have all the data, now to validate it\n $treeID = $data['treeID'];\n $userID = $data['userID'];\n $interactionType = $data['interaction']['type'];\n $interactionID = $data['interaction']['id'];\n $destinationType = $data['destination']['type'];\n $destinationID = $data['destination']['id'];\n $embedID = $data['site']['embedID'];\n\n // open the validator\n $validate = new Validate();\n // check that it's a valid Tree\n if($validate->treeID($treeID) === false) {\n $this->errors[] = 'Invalid treeID.';\n // return here because the next ones will get messed up if this isn't valid\n return false;\n }\n\n // check that it's a valid Embed ID\n if($validate->embed($embedID, $data) === false) {\n $this->errors[] = 'Invalid embedID.';\n }\n\n // check that it's a valid interaction type\n if($validate->interactionType($interactionType) === false) {\n $this->errors[] = 'Invalid interaction type.';\n\t\t}\n\n // check that it's a valid destination type\n if($validate->stateType($destinationType) === false) {\n $this->errors[] = 'Invalid destination type.';\n\t\t}\n\n // if it's an option interaction, check that it's a valid optionID\n if($interactionType === 'question' && $validate->elTypeID($interactionType, $interactionID, $treeID) === false) {\n $this->errors[] = 'Invalid interaction id.';\n }\n\n // if it's a question or end destination, check that it's a valid id for that type\n if(($destinationType === 'question' || $destinationType === 'end') && $validate->elTypeID($destinationType, $destinationID, $treeID) === false) {\n $this->errors[] = 'Invalid destination id.';\n }\n\n // check that it's a valid userID\n if(Utility\\isSlug($userID) === false) {\n $this->errors[] = 'Invalid userID.';\n }\n\n // if we have don't have any errors, it's valid!\n if(empty($this->errors)) {\n $isValid = true;\n }\n\n return $isValid;\n\n }" ]
[ "0.76456285", "0.7202437", "0.70025146", "0.6987133", "0.69298863", "0.6882391", "0.6876148", "0.6845418", "0.67838305", "0.6773348", "0.6769022", "0.67652977", "0.6718179", "0.67110115", "0.6657376", "0.6634341", "0.66124177", "0.6571576", "0.6562631", "0.6525689", "0.651223", "0.65095776", "0.65020263", "0.64500874", "0.64407897", "0.6440725", "0.6403669", "0.639551", "0.63868445", "0.6381203", "0.6368266", "0.6368217", "0.63676137", "0.6344427", "0.6342442", "0.63335645", "0.63311446", "0.6316911", "0.63165075", "0.63057166", "0.629619", "0.62827444", "0.62655276", "0.62619305", "0.62554884", "0.6249059", "0.62460685", "0.62431884", "0.6226414", "0.6226414", "0.6226096", "0.6213304", "0.6211229", "0.61992687", "0.6198256", "0.61887234", "0.6186875", "0.61849105", "0.618317", "0.618317", "0.6180883", "0.6180863", "0.61757195", "0.61739016", "0.61672574", "0.6151598", "0.6144081", "0.6144081", "0.6141516", "0.61412126", "0.6132423", "0.6128349", "0.61251014", "0.6112092", "0.61113656", "0.6107147", "0.61051184", "0.6101211", "0.60996515", "0.6098551", "0.6087863", "0.6087316", "0.6086434", "0.6084499", "0.60806894", "0.60745335", "0.6060227", "0.60435665", "0.6035834", "0.60295206", "0.60295206", "0.6023449", "0.6019648", "0.60175633", "0.6015402", "0.6011563", "0.6009204", "0.60049134", "0.60047823", "0.6001913", "0.5996964" ]
0.0
-1
Ensure that a session cookie is sent if challenegeresponse test
function show_entries_page() { // is enabled global $CHALLENGE_ENABLED; if($CHALLENGE_ENABLED === TRUE) { @session_start(); } include_from_template('entries.php'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSetSessionCookie() {}", "public function isSetSessionCookie() {}", "protected function setSessionCookie() {}", "public function testIfUserCookieHasBeenSet()\n {\n // INIT\n //-----\n\n self::$kernel = self::bootKernel();\n\n $response = new Response();\n\n $filterResponseEvent = new FilterResponseEvent(\n self::$kernel,\n new Request(),\n 200,\n $response\n );\n\n //create the entity manager\n $this->entityManager = self::$kernel->getContainer()->get('doctrine.orm.entity_manager');\n\n $this->enabledUser = $this->entityManager->getRepository(User::class)->find(1);\n //else cannot login\n $this->enabledUser->setEnabled();\n\n // CREATE\n //-------\n\n $interarctiveLoginEvent = $this->createInteractiverEvent($this->enabledUser);\n\n $userSubscriber = new UserSubscriber(\n $this->entityManager,\n self::$kernel->getContainer()->get('event_dispatcher')\n );\n\n $userSubscriber->onSecurityInteractiveLogin($interarctiveLoginEvent);\n\n $userSubscriber->onKernelResponse($filterResponseEvent);\n\n // TEST\n //-----\n\n $this->assertEquals($response->headers->getCookies()[0]->getName(),SiteConfig::COOKIEUSERNAME);\n $this->assertEquals($response->headers->getCookies()[0]->getValue(),$this->enabledUser->getEmail());\n }", "function cemhub_campaign_tracking_use_cookie_instead_session() {\n return (bool)variable_get('cemhub_cookies_enabled');\n}", "public function testWithCookieThatReturnsData()\n {\n $cookieValue = 'cookie-value';\n\n $testData = [\n 'test'=>true\n ];\n\n //---\n\n $this->sessionManager->read( $cookieValue )->willReturn($testData);\n $this->sessionManager->write( $cookieValue, $testData )->shouldBeCalled();\n\n $middleware = new SessionMiddleware( $this->sessionManager->reveal(), 300 );\n\n $this->request->getCookieParams()->willReturn([\n SessionMiddleware::COOKIE_NAME => $cookieValue\n ]);\n\n $response = $middleware->process(\n $this->request->reveal(),\n $this->delegateInterface->reveal()\n );\n\n $this->assertInstanceOf(ResponseInterface::class, $response);\n\n $headers = $response->getHeaders();\n\n $this->assertArrayHasKey('Set-Cookie', $headers);\n\n $cookies = $headers['Set-Cookie'];\n\n $this->assertInternalType('array', $cookies);\n $this->assertCount(1, $cookies);\n\n\n $cookie = GuzzleSetCookie::fromString(array_pop($cookies));\n\n /*\n * We are setting the cookie here, so we expect a correctly named\n * cookie, with the above value, that has not expired.\n */\n $this->assertEquals( SessionMiddleware::COOKIE_NAME, $cookie->getName() );\n $this->assertFalse( $cookie->isExpired() );\n $this->assertTrue( $cookie->getSecure() );\n $this->assertTrue( $cookie->getHttpOnly() );\n $this->assertInternalType( 'string', $cookie->getValue() );\n $this->assertEquals( $cookieValue, $cookie->getValue() );\n }", "public function isCookieSet() {}", "public function is_cookie_set()\n {\n }", "public function testGetCookie()\n {\n $this->assertEquals('cookie value', $this->_req->getCookie('my_test_cookie'));\n }", "function checkSession()\n {\n if(isset($_COOKIE['sessionId']))\n {\n $response = callApi('GET', 'session', ['sessionid' => $_COOKIE['sessionId']]);\n if($response['code'] == '200')\n return true;\n else\n return false;\n }\n }", "public function cookies_validate(){\n\t\t\t\n\t\t\tini_set('session.cookie_httponly', true); \n\t\t\theader( 'Expires: Thu, 26 Dec 2012 11:00:00 GMT' ); \n\t\t\theader( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );\n\t\t\theader( 'Cache-Control: private' ); \n\t\t\theader( 'Cache-Control: no-store, no-cache, must-revalidate' ); \n\t\t\theader( 'Cache-Control: post-check=0, pre-check=0', false ); \n\t\t\theader( 'Pragma: no-cache' ); \n\n\t\t}", "public function onRequest(GetResponseEvent $event) {\n // error_log(\"Here we testing cookie\", 0);.\n $result = $this->bakeryService->tasteChocolatechipCookie();\n if ($result instanceof RedirectResponse) {\n $event->setResponse($result);\n }\n }", "protected function handle_cookie()\n {\n }", "function testCookies() {\n\t$config = getConfig();\n\t$root = getRootPath();\n\t\n\t// Get the test page.\n\t$http = new \\AutoHttp\\Http($config);\n\t$page = $http->getPage($root . '/test/pages/http/cookie.php');\n\t\n\t// Verify we didn't send a cookie.\n\tif (strpos($page['body'], \"Cookie named 'user' is not set!\") === false)\n\t\treturn 'The cookie shouldn\\'t be set on our first page access.';\n\t\t\n\t// Get the page again.\n\t$page = $http->getPage($root . '/test/pages/http/cookie.php');\n\t\n\t// Verify we sent a cookie this time.\t\t\n\tif (strpos($page['body'], \"Cookie 'user' is set!\") === false ||\n\t\tstrpos($page['body'], \"Value is: John Doe\") === false)\n\t\treturn 'The cookie should be set on our second page access.';\n\t\t\n\treturn true;\n}", "public function testConnection () {\n $this->cookies = SessionComponent::read( 'Capsule.cookies' );\n if ( empty( $this->idul ) ) {\n $this->idul = SessionComponent::read( 'User.idul' );\n }\n $request = $this->_fetchPage( '/pls/etprod8/twbkwbis.P_GenMenu?name=bmenu.P_AdminMnu' );\n\n // Retry user login if request fails\n if ( !$request || !isset( $request[ 'headers' ] ) || !is_array( $request[ 'headers' ] ) )\n $this->login( $this->idul, $this->password );\n\n // Check if session ID cookie from header response is empty\n $isEmpty = false;\n\n for ( reset( $request[ 'headers' ] ), $header = 0; $header < count( $request[ 'headers' ] ); next( $request[ 'headers' ] ), $header++ ) {\n $header_name = key( $request[ 'headers' ] );\n\n if ( $header_name == 'set-cookie' ) {\n if ( is_array( $request[ 'headers' ][ $header_name ] ) ) {\n foreach ( $request[ 'headers' ][ $header_name ] as $cookie ) {\n if ( preg_match( \"#SESSID\\=;#\", $cookie ) ) {\n $isEmpty = true;\n break;\n }\n }\n } elseif ( preg_match( \"#SESSID\\=;#\", $request[ 'headers' ][ $header_name ] ) ) {\n $isEmpty = true;\n }\n }\n }\n\n if ( $isEmpty ) {\n // Retry user login\n $this->login( $this->idul, $this->password );\n }\n\n // Connection is OK\n return true;\n\t}", "public function setOnCheckCookieRequest()\n {\n $origin = $this->getOrigin();\n if ($this->originIsValid($origin)) {\n header('Access-Control-Allow-Origin: ' . $this->request->server->get('HTTP_ORIGIN'));\n header('Access-Control-Allow-Credentials: true');\n header('Content-Type: application/json');\n if($user = $this->getUserFromCookie()) {\n $token = (new JWT($this->getDomain()))->generate(array('uid' => $user['id']));\n echo '{\"status\":\"ok\",\"' . \\ModuleSSO::TOKEN_KEY . '\":\"' . $token . '\",\"email\":\"' . $user['email'] . '\"}';\n } else {\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"bad_cookie\"))->send();\n }\n } else {\n //probably won't reach this because of Same origin policy\n JsonResponse::create(array(\"status\" => \"fail\", \"code\" => \"http_origin_not_set\"))->send();\n }\n }", "public function testWithoutCookieSetAndNoDataSet()\n {\n $middleware = new SessionMiddleware( $this->sessionManager->reveal(), 300 );\n\n $this->request->getCookieParams()->willReturn(array());\n\n // We are expecting an empty ArrayObject to be stored in the request.\n $this->request->withAttribute( 'session', Argument::that(function ($arg) {\n return ($arg instanceof \\ArrayObject && $arg->count() == 0);\n }))->shouldBeCalled()->willReturn(\n $this->prophesize(ServerRequestInterface::class)->reveal()\n );\n\n $response = $middleware->process(\n $this->request->reveal(),\n $this->delegateInterface->reveal()\n );\n\n $this->assertInstanceOf(ResponseInterface::class, $response);\n\n $headers = $response->getHeaders();\n\n $this->assertArrayHasKey('Set-Cookie', $headers);\n\n $cookies = $headers['Set-Cookie'];\n\n $this->assertInternalType('array', $cookies);\n $this->assertCount(1, $cookies);\n\n\n $cookie = GuzzleSetCookie::fromString(array_pop($cookies));\n\n /*\n * We are removing the cookie here, so we expect a correctly named cookie, with no value, that has expired.\n */\n $this->assertEquals( SessionMiddleware::COOKIE_NAME, $cookie->getName() );\n $this->assertTrue( $cookie->isExpired() );\n $this->assertEmpty( $cookie->getValue() );\n }", "public function testWithoutCookieSetAndNewDataSet()\n {\n\n $this->sessionManager->write( Argument::type('string'), Argument::type('array') )->shouldBeCalled();\n\n $middleware = new SessionMiddleware( $this->sessionManager->reveal(), 300 );\n\n $this->request->getCookieParams()->willReturn(array());\n\n // We use this to amend the data stored in session; as a delegate process would do.\n $this->request->withAttribute( 'session', Argument::that(function ($arg) {\n $arg['test'] = true;\n return true;\n }))->shouldBeCalled()->willReturn(\n $this->prophesize(ServerRequestInterface::class)->reveal()\n );\n\n $response = $middleware->process(\n $this->request->reveal(),\n $this->delegateInterface->reveal()\n );\n\n $this->assertInstanceOf(ResponseInterface::class, $response);\n\n $headers = $response->getHeaders();\n\n $this->assertArrayHasKey('Set-Cookie', $headers);\n\n $cookies = $headers['Set-Cookie'];\n\n $this->assertInternalType('array', $cookies);\n $this->assertCount(1, $cookies);\n\n\n $cookie = GuzzleSetCookie::fromString(array_pop($cookies));\n\n /*\n * We are setting the cookie here, so we expect a correctly named cookie, with a value, that has not expired.\n */\n $this->assertEquals( SessionMiddleware::COOKIE_NAME, $cookie->getName() );\n $this->assertFalse( $cookie->isExpired() );\n $this->assertTrue( $cookie->getSecure() );\n $this->assertTrue( $cookie->getHttpOnly() );\n $this->assertInternalType( 'string', $cookie->getValue() );\n\n // We're expecting the session ID to be over 75 characters.\n $this->assertGreaterThan( 75, strlen($cookie->getValue()) );\n }", "private function setCookie() {\n $response = new Response();\n $cookie = new Cookie(login_user, $this->_user, time() + 3600 * 24, '/', 'unoi.com', false, false);\n $response->headers->setCookie($cookie);\n $response->send();\n }", "protected function assertCreatedNewSession(Response $response)\n {\n $this->assertTrue($response->hasHeader('Set-Cookie'));\n $this->assertStringStartsWith('PHPSESSID=', $response->getHeaderLine('Set-Cookie'));\n }", "public function testSessionHttpServer(): void\n {\n $this->session(['foo' => 'session data']);\n $this->get('/request_action/session_test');\n $this->assertResponseOk();\n $this->assertResponseContains('session data');\n $this->assertHeader('X-Middleware', 'true');\n }", "public function testGetCookiesHttpServer(): void\n {\n $this->configRequest(['cookies' => ['split_test' => 'abc']]);\n $this->get('/request_action/cookie_pass');\n $this->assertResponseOk();\n $this->assertResponseContains('\"split_test\":\"abc\"');\n $this->assertHeader('X-Middleware', 'true');\n }", "public function test_protected_setCookie()\n {\n $cookies = $this->object->getCookies($this->serviceUrl_1c);\n $this->assertInternalType('array', $cookies);\n $this->assertEquals(1, count($cookies));\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n }", "public function testWithCookieThatNewDataIsStoredFor()\n {\n $cookieValue = 'cookie-value';\n\n // Return an empty array.\n $this->sessionManager->read( $cookieValue )->willReturn([]);\n\n // We expect the new session to be written\n $this->sessionManager->write( Argument::type('string'), ['test' => true] )->shouldBeCalled();\n\n $middleware = new SessionMiddleware( $this->sessionManager->reveal(), 300 );\n\n $this->request->getCookieParams()->willReturn([\n SessionMiddleware::COOKIE_NAME => $cookieValue\n ]);\n\n // We use this to set data in session; as a delegate process would do.\n $this->request->withAttribute( 'session', Argument::that(function ($arg) {\n $arg['test'] = true;\n return true;\n }))->shouldBeCalled()->willReturn(\n $this->prophesize(ServerRequestInterface::class)->reveal()\n );\n\n $response = $middleware->process(\n $this->request->reveal(),\n $this->delegateInterface->reveal()\n );\n\n $this->assertInstanceOf(ResponseInterface::class, $response);\n\n $headers = $response->getHeaders();\n\n $this->assertArrayHasKey('Set-Cookie', $headers);\n\n $cookies = $headers['Set-Cookie'];\n\n $this->assertInternalType('array', $cookies);\n $this->assertCount(1, $cookies);\n\n $cookie = GuzzleSetCookie::fromString(array_pop($cookies));\n\n /*\n * We are setting an invalid cookie name here, so we expect a correctly named\n * cookie, with a *different* value, that has not expired.\n */\n $this->assertEquals( SessionMiddleware::COOKIE_NAME, $cookie->getName() );\n $this->assertFalse( $cookie->isExpired() );\n $this->assertTrue( $cookie->getSecure() );\n $this->assertTrue( $cookie->getHttpOnly() );\n $this->assertInternalType( 'string', $cookie->getValue() );\n $this->assertNotEquals( $cookieValue, $cookie->getValue() );\n\n // We're expecting the session ID to be over 75 characters.\n $this->assertGreaterThan( 75, strlen($cookie->getValue()) );\n }", "private function handleCookie() {\n\t\t$this->message = $this->loginView->getCookieMessage();\n\t\t$this->loginObserver->generateCookie();\n\t}", "protected function setSessionCookie() {\n if (!$this->request->hasSession()) {\n return;\n }\n\n $session = $this->request->getSession();\n if (!$session->getAll()) {\n return;\n }\n\n $timeout = $this->getSessionTimeout();\n if ($timeout) {\n $expires = time() + $timeout;\n } else {\n $expires = 0;\n }\n\n $domain = $this->request->getHeader(Header::HEADER_HOST);\n\n $path = str_replace($this->request->getServerUrl(), '', $this->request->getBaseUrl());\n if (!$path) {\n $path = '/';\n }\n\n $cookie = $this->httpFactory->createCookie($this->request->getSessionCookieName(), $session->getId(), $expires, $domain, $path);\n\n $this->response->setCookie($cookie);\n }", "public function testFlashSessionAndCookieAsserts(): void\n {\n $this->post('/posts/index');\n\n $this->assertSession('An error message', 'Flash.flash.0.message');\n $this->assertCookie('1', 'remember_me');\n $this->assertCookieNotSet('user_id');\n }", "protected function checkSessionToken() {}", "function _checkCookies() {\n if(isset($_COOKIE)) {\n if(isset($_COOKIE['user'])) {\n $_SESSION['is_login'] = true;\n $_SESSION['userid'] = $_COOKIE['user'];\n }\n }\n }", "protected function addCookieToResponse($request, $response)\n{\n $config = config('session');\n\n $response->headers->setCookie(\n new Cookie(\n 'XSRF-TOKEN', $request->session()->token(), $this->availableAt(60 * $config['lifetime']),\n $config['path'], $config['domain'], $config['secure'], true, true, $config['same_site'] ?? null\n )\n );\n return $response;\n}", "public function testGetSession()\n {\n $this->assertEquals('session value', $this->_req->getSession('my_test_session'));\n }", "public function testPostPage()\n {\n $client = static::createClient();\n $client->request('GET', '/post/cookies');\n // redirection : user doit etre connecte pour acceder a cette page\n $this->assertEquals(302, $client->getResponse()->getStatusCode());\n }", "protected function assertCustomCookieParams(Response $response)\n {\n $this->assertTrue($response->hasHeader('Set-Cookie'));\n $this->assertStringStartsWith('PHPSESSID=', $response->getHeaderLine('Set-Cookie'));\n $this->assertRegExp('/expires=/i', $response->getHeaderLine('Set-Cookie'));\n $this->assertRegExp('/path=/i', $response->getHeaderLine('Set-Cookie'));\n $this->assertRegExp('/secure/i', $response->getHeaderLine('Set-Cookie'));\n $this->assertRegExp('/HttpOnly/i', $response->getHeaderLine('Set-Cookie'));\n }", "function write_result( $response ) {\r\n // $provider = strtolower( $provider );\r\n // $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false;\r\n // setcookie( $provider . \"Token\", $response, 0 ); // Expires on session end\r\n\r\n // echo '<script>window.close();</script>';\r\n // echo var_export($response, true);\r\n // echo '<br><br><br>';\r\n // echo var_export( $_COOKIE, true );\r\n // var_export($response);\r\n echo '<script>close_myself('.json_encode($response).');</script>';\r\n}", "public function testFlashSessionAndCookieAssertsHttpServer(): void\n {\n $this->post('/posts/index');\n\n $this->assertSession('An error message', 'Flash.flash.0.message');\n $this->assertCookieNotSet('user_id');\n $this->assertCookie('1', 'remember_me');\n }", "public function testPostSessionCsrfSuccess(): void\n {\n $this->enableCsrfToken();\n $data = [\n 'title' => 'Some title',\n 'body' => 'Some text',\n ];\n $this->post('/session-csrf/posts/header', $data);\n $this->assertResponseSuccess();\n }", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "function validaSession(){\n\tif(!isset($_COOKIE['id'])){\n\t\t//@header(\"location:login\");\n\t\treturn false;\n\t}else{\n\t\t\n\t\treturn true;\n\t}\n}", "public function testMaliciousRequestWithCustomCookieParams()\n {\n $response = $this->http->send(\n new Request('GET', '/visit-counter.php?with_custom_cookie_params', ['Cookie' => 'PHPSESSID=madeupkey;'])\n );\n\n $this->assertSame('1', (string) $response->getBody());\n\n $this->assertCustomCookieParams($response);\n\n $this->assertSame(1, $this->redis->dbSize());\n $this->assertFalse($this->redis->get(SavePathParser::DEFAULT_PREFIX.'madeupkey'));\n }", "function isCookieSet (){\n if (empty ($_COOKIE['id'])){\n header (\"location: error.php\");\n }\n}", "public function withCookie(Cookie $cookie): ResponseInterface;", "public function cookieAction() {\n if($_COOKIE['tx_cookies_accepted'] && !$this->settings['showPermanent']) {\n return FALSE;\n }\n $this->view->assign('accepted', array_key_exists('tx_cookies_accepted', $_COOKIE) ? 1 : 0);\n $this->view->assign('disabled', array_key_exists('tx_cookies_disabled', $_COOKIE) ? 1 : 0);\n $this->view->assign('acceptedOrDisabled', ($_COOKIE['tx_cookies_accepted'] || $_COOKIE['tx_cookies_disabled']) ? 1 : 0);\n }", "public function set_cookie()\n {\n }", "public function hasSession() {}", "public function test_protected_storeCookie_WithDuplicates()\n {\n\t$headers = array('Set-Cookie: SID=\"hello world\"; path=/');\n $cookiesToSet = $this->object->parseCookieHeaders($headers, 'service.example.com');\n $this->object->storeCookie($cookiesToSet[0]);\n\n $headers = array('Set-Cookie: SID=\"goodbye world\"; path=/');\n $cookiesToSet = $this->object->parseCookieHeaders($headers, 'service.example.com');\n $this->object->storeCookie($cookiesToSet[0]);\n\n $cookies = $this->object->getCookies($this->serviceUrl_1c);\n $this->assertInternalType('array', $cookies);\n $this->assertEquals(1, count($cookies));\n $this->assertEquals('goodbye world', $cookies['SID']);\n }", "function session_check() {\n\tif (!isset($_POST['session'])) {\n\t\tsend_message('error', array('reason' => 'no_session_token','message' => 'No session token passed'));\n\t}\n}", "private function addCookieToResponse(Request $request, Response $response): void\n {\n $response->cookie($this->name, $this->session->id(), [\n 'expires' => 0, // Cookie expires after browser is closed\n 'encrypt' => false, // Encryption helps identify system\n 'secure' => $request->server('HTTPS') !== null,\n 'httpOnly' => true,\n 'sameSite' => 'strict' // TODO: test in different senarios\n ]);\n }", "private function verifyResponse($resp)\n {\n //grab session value and destroy it\n $val = $_SESSION['challenge'];\n unset($_SESSION['challenge']);\n return $resp == $val;\n }", "function _verify_cookie()\n\t{\n\t\tif((array_key_exists('login_attempts', $_COOKIE)) && ($_COOKIE['login_attempts'] >= 5))\n\t\t{\n\t\t\t$username = $this->CI->session->userdata('username');\n\t\t\t$userdata = $this->CI->db->query(\"SELECT * FROM `users` WHERE `username` = '$username'\");\n\t\t\t\n\t\t\t$result = $userdata->row();\n\n\t\t\t$identifier = $result->username . $result->token;\n\t\t\t$identifier = $this->_salt($identifier);\n\t\t\t\n\t\t\tif($identifier !== $_COOKIE['logged_in'])\n\t\t\t{\n\t\t\t\t$this->CI->session->sess_destroy();\n\t\t\t\t\n\t\t\t\tshow_error($this->CI->lang->line('logout_perms_error'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_generate();\n\t\t}\n\t}", "public static function tryLoginByCookies() {\n if (Session::isUserLoggedIn() || !self::isCookiesSet()) {\n return;\n }\n\n $username = self::get(self::$usernameCookieName);\n $token = self::get(self::$passwordCookieName);\n $user = UserDALMySql::select($username);\n\n if ($user && $user->getToken() === $token) {\n Session::setFeedback('Welcome back with cookie');\n Session::setUserLoggedInStatus(true);\n Session::setUser($user);\n } else {\n self::deleteRememberMeCookies();\n Session::setFeedback('Wrong information in cookies');\n }\n }", "public static function authenticateByCookie(): void\n {\n $request = RequestFactory::create();\n $token = $request->getCookieParam('jwToken');\n if ($token === null\n || !self::validate($token)\n ) {\n header('Not authorized', true, 403);\n exit;\n }\n }", "public function verify(){\n if (!isset($_SESSION['user_api_key']) || !isset($_SESSION['user_id'])){\n header(\"Location: \" . Utility::getUrlFor('login'));\n return;\n }\n if (isset($_POST[\"channel_id\"])){\n if (!isset($_SESSION)){\n session_start();\n }\n $_SESSION[\"channel_id\"] = $_POST[\"channel_id\"];\n header(\"Location: \" . Utility::getUrlFor('admin/home'));\n }\n else{\n $this->view();\n }\n }", "private function setResponse($msg){\n $_SESSION[self::RESPONSE_SESSION] = $msg;\n }", "public function testMaliciousRequest()\n {\n $response = $this->http->send(\n new Request('GET', '/visit-counter.php', ['Cookie' => 'PHPSESSID=madeupkey;'])\n );\n\n $this->assertSame('1', (string) $response->getBody());\n\n $this->assertCreatedNewSession($response);\n $this->assertNotRegExp('/expires=/i', $response->getHeaderLine('Set-Cookie'));\n\n $this->assertSame(1, $this->redis->dbSize());\n $this->assertFalse($this->redis->get(SavePathParser::DEFAULT_PREFIX.'madeupkey'));\n }", "function verifyCookies()\n\t{\n\t\tif (isset($_COOKIE['cookieUserName']))\n\t\t{\n\t\t\techo json_encode(array('cookieUserName' => $_COOKIE['cookieUserName']));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Cookie not set yet\n\t\t die(json_encode(errors(417)));\n\t\t}\n\t}", "function auth()\n\t{\n\t\t$_aok_ = $_COOKIE['_aok_'];\n\t\tif (isset($_aok_))\n\t\t{\n\t\t\t$query = mysql_query(\"SELECT sessionId FROM auth WHERE sessionId = '$_aok_'\");\n\t\t\tif (mysql_num_rows($query) > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function payswarm_clear_session_cookie() {\n if(!headers_sent()) {\n global $_SERVER;\n $past = time() - 3600;\n setcookie('payswarm-session', '', $past, '/');\n\n // clear authority host URL cookie as well\n payswarm_clear_authority_host_cookie();\n }\n}", "function brute_force_authorized_login()\n{\n \t// Si le cookie n'existe pas \n\tif(!isset($_COOKIE['marqueur-try-connect']))\n\t{\n\t return true ;\n\t}\n\t// Si le cookie existe\n else\n {\n // Si le temps de blocage a été dépassé\n if($_COOKIE['marqueur-try-connect'] < time())\n {\n setcookie(\"marqueur-try-connect\", \"\", 0);\n }\n \n return false ;\n }\n}", "public function Action_d(){\n// echo $request->uri().\"<br/>\";\n// echo Request::initial()->uri();\n// echo Request::current()->uri();\n// if($this->request->is_initial()){\n// \techo 'yes';\n// }else{\n// \techo 'no';\n// }\n// $request = Request::factory('http://ww.kfxiong.com/ceshi/post_api.php',array(\n// 'header_callbacks' => array(\n//\t\t 'Content-Encoding' =>\n//\t\t function (Request $request, Response $response, Request_Client $client)\n//\t\t {\n//\t\t // Uncompress the response\n//\t\t $response->body(\"aaaa\");\n//\t\t })\n// ))->method(Request::POST)->post(array('foo' => 'bar', 'bar' => 'baz'));\n// $request->execute();\n//// print_r($request);\n// print_r($this->response->body());\n\n \t\n $key = 'keys';\n $value = 'value';\n $hello = 'hello';\n $world = \"world\";\n// $session = Session::instance();\n// $session->set($key, $value);\n// echo $session->get($key);\n $default_value = \"pigger\";\n $session = Session::instance('native');\n \t $_SESSION = &$session->as_array();\n \t print_r($_SESSION);\n \t Cookie::set($hello, $world);\n \t $data = Cookie::get('pig', $default_value);\n \t echo $data;\n }", "public function testAuthenticateCookie()\n {\n $request = new ServerRequest();\n\n $this->auth = new JwtAuthenticate($this->Registry, [\n 'userModel' => 'Users',\n 'cookie' => 'jwt',\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => '[email protected]',\n 'created' => new Time('2014-03-17 01:18:23'),\n 'updated' => new Time('2014-03-17 01:20:31'),\n ];\n\n $request = new ServerRequest([\n 'url' => 'posts/index',\n 'cookies' => ['jwt' => $this->token],\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $this->auth->setConfig('cookie', 'tokenname');\n $request = new ServerRequest([\n 'url' => 'posts/index',\n 'cookies' => ['tokenname' => $this->token],\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = new ServerRequest([\n 'url' => 'posts/index',\n 'cookies' => ['wrongtoken' => $this->token],\n ]);\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }", "function sys_session_test(){\n session_name(\"MELOLSESSION\");\n session_start();\n if (isset($_SESSION[\"userId\"]) && isset($_SESSION[\"sessionId\"]) && isset($_REQUEST[\"sessionId\"])) {\n if ($_SESSION[\"sessionId\"] == $_REQUEST[\"sessionId\"]) {\n return TRUE;\n }\n }\n return FALSE;\n}", "public function cookie()\n {\n// $a = $abc->getCookieCollection();\n $abc = $this->request->getCookieCollection();\n $abc = new Collection($abc);\n\n $token = $abc->first()->getValue();\n return $this->responseJson(['csrfToken'=>$token]);\n }", "public function testPostSessionCsrfFailure(): void\n {\n $this->enableCsrfToken();\n $data = [\n 'title' => 'Some title',\n 'body' => 'Some text',\n '_csrfToken' => 'failure',\n ];\n $this->post('/session-csrf/posts/header', $data);\n $this->assertResponseCode(403);\n }", "public function testPostCookieCsrfSuccess(): void\n {\n $this->enableCsrfToken();\n $data = [\n 'title' => 'Some title',\n 'body' => 'Some text',\n ];\n $this->post('/cookie-csrf/posts/header', $data);\n $this->assertResponseSuccess();\n }", "public function acceptCookies(){\n\t\tsetcookie('isUsingCookies', true, time()+60*60*24*365);\n\t\treturn redirect()->route('home');\n\t}", "public function xhrSessionExist(){\n echo Session::get(\"loggedin\")?\"postoji\":\"ne postoji\";\n }", "public function testBug20561()\n {\n if ($this->isRedirectSupportDisabled()) {\n $this->markTestSkipped('Redirect support in cURL is disabled by safe_mode or open_basedir setting');\n\n } else {\n $this->request->setUrl($this->baseUrl . 'redirects.php?special=youtube')\n ->setConfig(array(\n 'follow_redirects' => true,\n 'ssl_verify_peer' => false\n ))\n ->setCookieJar(true);\n\n $this->request->send();\n $this->assertGreaterThan(0, count($this->request->getCookieJar()->getAll()));\n }\n }", "public function setUpSession() \n {\n exec('mysqldump -u '.env('DB_USERNAME').' test | mysql -u '.env('DB_USERNAME').' test_testing');\n\n $this->amOnPage('/');\n $this->setCookie('selenium_request', 'true');\n }", "public function testCookieIsSetFailureNoResponse(): void\n {\n $this->expectException(AssertionFailedError::class);\n $this->expectExceptionMessage('No response set, cannot assert content.');\n $this->assertCookieIsSet('secrets');\n }", "public static function check_session() {\n\t\t\t// get redirect_to_default\n\t\t\t$redirect_to_default = Cookie::get('redirect_to_default');\n\t\t\t\n\t\t\t// if empty redirect_to_default set from default settings\n\t\t\tif(empty($redirect_to_default)){$redirect_to_default = REDIRECT_TO_DEFAULT;}\n\t\t\t\t\t\t\n\t\t\t// check if auth token is submitted\n\t\t\tif(isset($_GET['authtoken']))\n\t\t\t{\n\t\t\t\t// check auth token\n\t\t\t\t$authtoken = Functions::encrypt_decrypt('decrypt', $_GET['authtoken'], \"\\x73\\x6f\\x6d\\x31\\x34\\x31\\x30\\x40\\x73\\x6f\\x6d\\x6e\\x65\\x74\\x69\\x63\\x73\");\n\t\t\t\t\t\n\t\t\t\t// get auth token\n\t\t\t\t$authtoken = json_decode($authtoken);\n\t\t\t\t\n\t\t\t\t// set active session\n\t\t\t\tif(!isset($authtoken->keep_session)){$authtoken->keep_session = true;}\n\t\t\t\t\n\t\t\t\t// unset login state\n\t\t\t\tif(!$authtoken->keep_session){self::set_state(false);}\n\t\t\t}\n\t\t\t\n\t\t\t// if session exists\n\t\t\tif(!self::get_state())\n\t\t\t{\t\n\t\t\t\t// check requested url\n\t\t\t\tif(trim(REQUEST_URI) != trim(APP_PATH.'/'.$redirect_to_default))\n\t\t\t\t{\t\n\t\t\t\t\t// get return url\t\t\t\t\t\n\t\t\t\t\t$returnUrl = urlencode(ltrim(str_replace(APP_PATH, '', REQUEST_URI), '/'));\n\t\t\t\t\t\n\t\t\t\t\t// check if auth token is submitted\n\t\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t\t{\n\t\t\t\t\t\t/*\n // get guest user info\n\t\t\t\t\t\t$guest_user = ORM::for_table('sys_user_login');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user pass is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_pass))\n\t\t\t\t\t\t$guest_user = $guest_user->where('user_pass', $authtoken->auth_pass);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user company is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_comp))\n\t\t\t\t\t\t$guest_user = $guest_user->where('sys_company_id', $authtoken->auth_comp);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// if user name is provided please authenticate it\n\t\t\t\t\t\tif(isset($authtoken->auth_name))\n\t\t\t\t\t\t\t$guest_user = $guest_user->where('user_name', $authtoken->auth_name)->find_one();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$guest_user = $guest_user->find_one($authtoken->auth_user);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// check if user exists\n\t\t\t\t\t\tif(is_object($guest_user))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t// start session and set session values\n\t\t\t\t\t\t\tself::set_state(true);\n\t\t\t\t\t\t\tself::set('user_id', $guest_user->id);\n\t\t\t\t\t\t\tself::set('user_name', $guest_user->user_name);\n\t\t\t\t\t\t\tself::set('first_name', $guest_user->first_name);\n\t\t\t\t\t\t\tself::set('last_name', $guest_user->last_name);\n\t\t\t\t\t\t\tself::set('full_name', trim($guest_user->first_name.' '.$guest_user->last_name));\n\t\t\t\t\t\t\tself::set('email', $guest_user->email);\n\t\t\t\t\t\t\tself::set('mobile', $guest_user->mobile);\n\t\t\t\t\t\t\tself::set('company_id', (empty($guest_user->sys_company_id) ? $authtoken->company_id : $guest_user->sys_company_id));\n\t\t\t\t\t\t\tself::set('is_super_admin', $guest_user->is_super_admin);\t\n\t\t\t\t\t\t\tself::set('is_guest', ($authtoken->auth_user==GUEST_ID ? 1 : 0));\t\n\t\t\t\t\t\t\tself::set('last_login', $guest_user->last_login);\t\n\t\t\t\t\t\t\tself::set('logged_with_master_password', false);\n\t\t\t\t\t\t\tself::set('authtoken', $authtoken);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t\t}\n */\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.(empty($returnUrl) ? '' : '?returnUrl='.$returnUrl));\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t// check if auth token is submitted\n\t\t\t\tif(isset($_GET['authtoken']))\n\t\t\t\t{\n\t\t\t\t\t// check for valid auth user\n\t\t\t\t\tif($authtoken->auth_user!=GUEST_ID)\n\t\t\t\t\t{\n\t\t\t\t\t\t// redirect to given path\n\t\t\t\t\t\theader('Location: '.BASE_URL.'/'.$redirect_to_default.'/authtoken_error?authtoken='.$_GET['authtoken']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}*/\n\t\t}", "public static function set_client_ticket()\n\t{\n\t\t$fromSSO = sf\\getGPC('from', 'g');\n\t\t$ticket = sf\\getGPC('ssoticket', 'g');\n\n\t\tif($fromSSO == 'sso' && $ticket)\n\t\t{\n\t\t\t//从 SSO 返回并且有ticket\n\t\t\t//写本域ticket\n\t\t\tsetcookie('ticket', $ticket);\n\t\t\tsf\\write_session('ticket', $ticket);\n\t\t\t//返回最初请求的页面\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function enableCookies() {}", "protected function checkSessionLifetime() {}", "public function testFresh(){\n Session::flush();\n $status_message = $this->getStatus();\n $this->assertResponseOk();\n $this->assertTrue($status_message['message'] == 'no active session');\n }", "public function setUpCookie() {\n\t\t if (ini_get(\"session.use_cookies\")) {\n\t\t \t$this->time=time()+$this->prp['lifetime'];\n\t\t\t$t=new DateTime();\n\t\t\t$t->setTimestamp($this->time);\n\t\t\t$f=$t->format('c');\n\t\t\t$this->trz[]=\"Expire at {$f}\";\n\t\t\t$params= session_get_cookie_params();\n\t\t\tforeach($this->prp['params'] as $p=>$v) $params[$p]=$v;\n\t\t\tif(0) singleton::show($params,\"Cookie params before set:\");\n\t\t\t // This set the cookie for the next call\n setcookie(session_name(), session_id(),\n \t\t$this->time,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n\t\telse die( 'session cookies disabled');\n\t}", "public function setTestCookie(): void\n {\n if (!$this->areCookieEnabled()) {\n self::set(\n new Cookie(\n Cookie::DEFAULT_TEST_COOKIE_STR,\n Cookie::DEFAULT_TEST_COOKIE_STR,\n Cookie::DEFAULT_COOKIE_DURATION\n )\n );\n }\n return;\n }", "public function hasQueueingCookie(): bool;", "protected function loginIfRequested() {}", "public function sessionDummy()\n {\n return true;\n }", "public function test_protected_storeCookie_TwoCookies()\n {\n // Second cookie\n $headers = array('Set-Cookie: message=\"hello world\"; path=/');\n $cookiesToSet = $this->object->parseCookieHeaders($headers, 'service.example.com');\n $this->object->storeCookie($cookiesToSet[0]);\n\n\n $cookies = $this->object->getCookies($this->serviceUrl_1c);\n $this->assertInternalType('array', $cookies);\n $this->assertEquals(2, count($cookies));\n $this->assertEquals('k1jut1r1bqrumpei837kk4jks0', $cookies['SID']);\n $this->assertEquals('hello world', $cookies['message']);\n }", "public function user_check_session_id() {\n if ( user()->check_session_id( in('session_id') ) ) wp_send_json_success();\n else wp_send_json_error();\n }", "public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }", "function ts_check_if_use_control_panel_cookies()\r\n{\r\n\treturn false;\r\n}", "public static function checkSession() {\n\t\t// Set any API keys\n\t\t$api_keys = array();\n\t\t// Check API Key or Session Authentication\n\t\t$key = \"\";\n\t\tif (isset($_GET['key'])) {\n\t\t\t$key = $_GET['key'];\n\t\t}\n\t\tif (!isset($_SESSION['user']) && !in_array($key, $api_keys)) {\n\t\t\texit('{\"status\":\"error\",\"message\":\"Authentication Error\"}');\n\t\t}\n\t}", "public function setCookieValues()\r\n {\r\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\r\n $coreSession = $objectManager->get('Magento\\Framework\\Session\\Generic');\r\n $_cookieMetadata = $objectManager->get('Magento\\Framework\\Stdlib\\Cookie\\CookieMetadataFactory');\r\n\r\n $customerName = self::ANONYMOUS_USER;\r\n $customerEmail = self::ANONYMOUS_USER;\r\n $customerId = '';\r\n\r\n $metadata = $_cookieMetadata\r\n ->createPublicCookieMetadata()\r\n ->setDuration(self::TIMEOUT)\r\n ->setPath('/')\r\n ->setDomain($coreSession->getCookieDomain())\r\n ->setHttpOnly(false);\r\n\r\n if ($this->_customerSession->isLoggedIn()) {\r\n $customer = $this->_customerSession->getCustomer();\r\n $customerName = $customer->getName();\r\n $customerId = $customer->getId();\r\n $customerEmail = $customer->getEmail();\r\n $this->_cookieManager->setPublicCookie('user_loggedin', true, $metadata);\r\n $this->_cookieManager->setPublicCookie('afterlogin_session_id', \r\n $coreSession->getCustomerSessionId(), \r\n $metadata);\r\n $this->_cookieManager->setPublicCookie('trackingid', $customerId, $metadata);\r\n } else {\r\n if (!empty($this->_request->getParam('guest_user_id'))) {\r\n $customerId = $coreSession->getTrackingSessionId();\r\n } elseif (empty($this->_cookieManager->getCookie('trackingid'))) {\r\n $customerId = $coreSession->getTrackingSessionId();\r\n }\r\n $this->_cookieManager->setPublicCookie('user_loggedin', false, $metadata);\r\n }\r\n !empty($customerId) ? $this->_cookieManager->setPublicCookie('trackingid', \r\n $customerId, \r\n $metadata) : '';\r\n\r\n $this->_cookieManager->setPublicCookie('trackingemail', $customerEmail, $metadata);\r\n $this->_cookieManager->setPublicCookie('trackingname', $customerName, $metadata);\r\n\r\n $quoteId = $this->_checkoutSession->getQuoteId() ? $this->_checkoutSession->getQuoteId() : '';\r\n $this->_cookieManager->setPublicCookie('trackingorderid', $quoteId, $metadata);\r\n\r\n if (!$this->_cookieManager->getCookie('trackingsession')) {\r\n $this->_cookieManager->setPublicCookie('trackingsession', \r\n $coreSession->getTrackingSessionId(), \r\n $metadata);\r\n }\r\n }", "public function resume() {\n \n if (!isset($_COOKIE) || !\\array_key_exists($this->name, $_COOKIE)) {\n\n //coookie prob expired\n $this->forget();\n return false;\n }\n\n\n\n if (!$this->sessionStarted()) {\n\n if (\\session_start()) {\n $this->refresh();\n }\n }\n if (!$this->isFingerprint()) { //UA doesnt match\n $this->forget();\n return false;\n }\n\n return true;\n }", "public function setUp()\n\t{\n\t\t// http://stackoverflow.com/questions/23270650/cannot-send-session-cookie-headers-already-sent-phpunit-laravel\n\t\t@session_start();\n\t\t$this->_killSession();\n\t}", "function checkLoginPageAuth()\n{\n\tif(isset($_COOKIE['csp1_jag13047_cookie3']))\n\t{\n\t\theader('Location: ../html/user.html.php');\n\t}\n\telse\n\t{\n\t\treturn true;\n\t}\n}", "public function testGetCookieDefault()\n {\n $val = $this->_req->getCookie('DOESNT_EXIST', 'default value');\n $this->assertEquals('default value', $val);\n }", "public static function viderListeCoeur(){\r\n // Si le $_POST est déclaré et qu'il est égal a true(voir le formulaire dans le menu)\r\n if(isset($_POST['viderListeCoeur']) && $_POST['viderListeCoeur'] === \"true\"){\r\n\r\n unset($_SESSION['coupDeCoeur']);\r\n setcookie(\"coupDeCoeur\", \" \" , time() -3600*24*30);\r\n header('location:mon-coup-de-coeur');\r\n } \r\n}", "private function check_session()\n\t{\n\t\tif(isset($_SESSION['admin_id']))\n\t\t{\n\t\t\t/* \n\t\t\tTODO: check double device login\n\t\t\t*/\n\t\t}\n\t\telse if(isset($_SESSION['login_id']))\n\t\t{\n\t\t\tredirect(base_url() . 'contestant');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect(base_url());\n\t\t}\n\t}", "public function testPostSessionCsrfSuccessWithSetCookieName(): void\n {\n $this->builder->scope('/custom-cookie-csrf/', ['csrf' => 'cookie'], function (RouteBuilder $routes): void {\n $routes->registerMiddleware('cookieCsrf', new CsrfProtectionMiddleware(\n [\n 'cookieName' => 'customCsrfToken',\n ]\n ));\n $routes->applyMiddleware('cookieCsrf');\n $routes->connect('/posts/{action}', ['controller' => 'Posts']);\n });\n $this->enableCsrfToken('customCsrfToken');\n $data = [\n 'title' => 'Some title',\n 'body' => 'Some text',\n ];\n $this->post('/custom-cookie-csrf/posts/header', $data);\n $this->assertResponseSuccess();\n }", "function admit()\n {\n global $standard_headers;\n global $cookie;\n\n $post_fields = array('state' => 'client', 'mac' => '00000000-0000-0000-0000-000000000000', 'os_name' => 'iphone', 'app_version' => '8.10.24', 'ostype' => '64bit', 'tz' => 'America/Chicago', 'battery_level' => '-1', 'locale' => 'en', 'logged_in' => '0', 'device_id' => '00000000-0000-0000-0000-000000000000', 'v' => '2');\n $response = curl('https://www.tadpoles.com/remote/v1/athome/admit', $post_fields, true);\n\n preg_match('/^Set-Cookie:\\s*(.+)=\"(.+)\"/mi', $response, $cookies);\n $cookie_key = $cookies[1];\n $cookie_value = $cookies[2];\n $cookie = \"$cookie_key=\\\"$cookie_value\\\"\";\n }", "public function testFlashAssertionsAfterRedirect(): void\n {\n $this->get('/posts/someRedirect');\n\n $this->assertResponseCode(302);\n\n $this->assertSession('A success message', 'Flash.flash.0.message');\n }", "private final function addResponseLogoutTrue()\n {\n $this->snowmanresponse->logout = new \\stdClass();\n /** @noinspection PhpUndefinedFieldInspection */\n $this->snowmanresponse->logout->status = true;\n }", "public function testSendMethodSetsProperValuesOnCookie()\n\t{\n\t\t$_SERVER['cookie.stub'] = array();\n\t\t$_SERVER['function.headers_sent'] = false;\n\n\t\tCookie::send();\n\t\t$this->assertTrue(count($_SERVER['cookie.stub']) == 0);\n\n\t\tCookie::put('foo', 'bar', 20, 'path', 'domain', false);\n\t\tCookie::send();\n\t\t$this->assertTrue(count($_SERVER['cookie.stub']) == 1);\n\t\t$this->assertEquals('foo', $_SERVER['cookie.stub']['foo']['name']);\n\t\t$this->assertEquals(Cookie::sign('foo', 'bar'), $_SERVER['cookie.stub']['foo']['value']);\n\t\t$this->assertEquals('path', $_SERVER['cookie.stub']['foo']['path']);\n\t\t$this->assertEquals('domain', $_SERVER['cookie.stub']['foo']['domain']);\n\t\t$this->assertEquals((time() + (20 * 60)), $_SERVER['cookie.stub']['foo']['time']);\n\t\t$this->assertFalse($_SERVER['cookie.stub']['foo']['secure']);\n\n\t\tCookie::put('bar', 'baz', 0);\n\t\tCookie::send();\n\t\t$this->assertEquals(0, $_SERVER['cookie.stub']['bar']['time']);\n\t}", "public function check_php_session() {\n global $db;\n\n $now = new Zend_Date();\n\n $random_string_exists = True;\n while ($random_string_exists) {\n $random_string = $this->rand_str();\n $data = array(\n 'random_string' => $random_string,\n 'date_created' => $now->toString(\"yyyy-MM-dd HH:mm:ss\"),\n 'session_data' => sprintf('client_id=%s', $this->client_id),\n 'redirect' => 'from ClientJSONRedirectService.php django redirect',\n );\n\n try {\n $db->insert('django_session_transfer', $data);\n $random_string_exists = False;\n }\n catch (Exception $e) {\n $random_string_exists = True;\n }\n }\n\n return $random_string;\n\n }", "public function testTroubleshootingModeEnabledRightCookie() {\n\t\t$_COOKIE['health-check-disable-plugins'] = 'abc123';\n\n\t\t// This test should pass, as the hash values does now match.\n\t\t$this->assertTrue( $this->class_instance->is_troubleshooting() );\n\t}", "public function test_client_page_auth_check()\n {\n $response = $this->get(route('client.index'))->assertStatus(302);\n }", "protected function sessionInitialized()\n {\n parent::sessionInitialized();\n if ($this->cacheLimitersEnabled) {\n $this->response->addHeader('Expires', 'Thu, 19 Nov 1981 08:52:00 GMT');\n $this->response->addHeader(\n 'Cache-Control',\n 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0'\n );\n $this->response->addHeader('Pragma', 'no-cache');\n }\n }", "function session()\n {\n if (!API_MODE) {\n session_name('SKELETON');\n session_start();\n } else {\n ini_set('session.use_cookies', '0');\n }\n }" ]
[ "0.6872598", "0.6872598", "0.6648238", "0.6506464", "0.6445036", "0.63602275", "0.62825954", "0.6223044", "0.6217672", "0.61893326", "0.6180506", "0.61745924", "0.6173821", "0.61576325", "0.6156062", "0.61508685", "0.6142881", "0.613902", "0.61042637", "0.60628045", "0.6056862", "0.60423064", "0.6013461", "0.60013413", "0.59710824", "0.59634966", "0.59615624", "0.5943145", "0.5941547", "0.59408736", "0.5940587", "0.59361386", "0.5925625", "0.5907989", "0.58853036", "0.58834827", "0.58657736", "0.5856796", "0.5790542", "0.5776113", "0.5765209", "0.57601917", "0.57500714", "0.5742605", "0.5740497", "0.57378024", "0.57348025", "0.5723928", "0.57227474", "0.57119864", "0.5703099", "0.5690459", "0.5681702", "0.5681686", "0.5667741", "0.5658054", "0.5644404", "0.564221", "0.56418353", "0.56268895", "0.5617394", "0.5608098", "0.55991644", "0.5598744", "0.55980855", "0.5593876", "0.55863225", "0.5583003", "0.5582797", "0.5581163", "0.55796593", "0.5577077", "0.55747664", "0.55697024", "0.5558411", "0.5556095", "0.5553738", "0.5540486", "0.55316013", "0.55302227", "0.55194384", "0.551398", "0.55128974", "0.5511358", "0.5506376", "0.55026", "0.5501932", "0.5498587", "0.5492726", "0.5492137", "0.547201", "0.5464766", "0.54617894", "0.5456583", "0.5452165", "0.5447275", "0.54450154", "0.5440034", "0.543757", "0.543673", "0.5433642" ]
0.0
-1
Lists all HariTidakEfektif models.
public function actionIndex() { $searchModel = new HariTidakEfektifSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n return TempatTidur::all();\n }", "public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}", "public function index(){\n return $this->model->all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $feuils = $em->getRepository('WorldCupRussiaBundle:Feuil')->findAll();\n\n return $this->render('feuil/index.html.twig', array(\n 'feuils' => $feuils,\n ));\n }", "public function index()\n {\n return IdiomaEmpleado::all();\n }", "public function index()\n {\n return Filmes::all();\n }", "public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }", "public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('MinsalsifdaBundle:SifdaEquipoTrabajo')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex()\n {\n $searchModel = new HasilKonsultasiSearch();\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 AlokasiKelas::all();\n }", "public function actionIndex()\n {\n $searchModel = new TfLunasSearch();\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 $empleados = $this->Empleados->find('all');\n $this->set(compact('empleados'));\n }", "public function index()\n {\n return $this->model->getAll();\n }", "public function index()\n {\n return $this->model->all();\n }", "public function actionIndex()\n {\n $searchModel = new EnfermedadesSintomasSearch();\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\t{\n\t\t// $model = $model->orderBy('id', 'desc')->get();\n\t\t// $imam = new ImamModel();\n\t\t// $imam = $imam->orderBy('id', 'desc')->get();\n\t\t// $response['model'] = $model;\n\t\t// $response['imam'] = $imam;\n\t\t$model = DB::table('bab')\n\t\t\t->join('kitab', 'bab.id_kitab', '=', 'kitab.id')\n\t\t\t->join('imam', 'kitab.id_imam', '=', 'imam.id')\n\t\t\t->select('bab.*', 'imam.nama_imam', 'kitab.nama as nama_kitab')\n\t\t\t->orderBy('bab.id', 'desc')\n\t\t\t->get();\n\t\t$kitab = DB::table('kitab')\n ->join('imam', 'kitab.id_imam', '=', 'imam.id')\n ->select('kitab.*', 'imam.nama_imam')\n ->orderBy('kitab.id', 'desc')\n ->get();\n\t\t$data = DB::table('hadits')\n\t\t->join('bab', 'hadits.id_bab', '=', 'bab.id')\n\t\t->join('kitab', 'bab.id_kitab', '=', 'kitab.id')\n\t\t->join('imam', 'kitab.id_imam', '=', 'imam.id')\n\t\t->select('hadits.*', 'imam.nama_imam', 'bab.nama as nama_bab', 'kitab.nama as nama_kitab')\n\t\t->orderBy('hadits.id', 'desc')\n\t\t->limit(10)\n\t\t->get();\n\t\t$response['data'] = $data;\n\t\t$response['model'] = $model;\n\t\t$response['kitab'] = $kitab;\n\t\t// return $response;\n\t\treturn view('hadits.index', compact('response'));\n\t}", "public function listtabelKeuAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('KEUANGAN');\n }", "public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}", "public function index()\n {\n return OrdenTrabajo::all();\n\n }", "function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }", "public function actionIndex()\n {\n $this->checkPrivilege();\n $models = LabKit::find()->where(['not', ['id' => NULL]])->all();\n foreach ($models as $idx => $model) {\n $this->checkStatus($model->id);\n }\n $searchModel = new LabKitSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'models' => $models,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAllEfectiva()\n {\n $query = $this->em->createQuery(\n 'SELECT r\n FROM App\\Entities\\Razon r\n WHERE r.id < 7\n order by r.id');\n\n try {\n return $query->getResult();\n }\n catch(\\Doctrine\\ORM\\NoResultException $e) {\n return NULL;\n }\n }", "public function actionIndex()\n {\n $searchModel = new EntOficialesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function getModelsForIndex()\n {\n $models = [];\n $all_models = $this->getAllModels();\n\n foreach ($all_models as $model) {\n //parse model\n $pieces = explode('.', $model);\n if (count($pieces) != 2) {\n throw new Exception('Parse error in AppModelList');\n }\n //check form match\n $app_model = $pieces[1];\n $link = $this->convertModelToLink($app_model);\n\n // add to actions\n $models[$app_model]['GET'] = [\n [\n 'action' => 'index',\n 'description' => 'List & filter all ' . $app_model . ' resources.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link\n ],\n [\n 'action' => 'show',\n 'description' => 'Show the ' . $app_model . ' that has the matching {id} from the route.',\n 'route' => '/' . env('EASY_API_BASE_URL', 'easy-api') . '/' . $link . '/{id}'\n ]\n ];\n }\n return $models;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('BaseBundle:Feriado')->findAll();\n\n return $this->render('BaseBundle:Feriado:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SCRUMSwiftairBundle:Vluchten')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function actionIndex(){\r\n $model = new kategori;\r\n $data= $model->findAll();\r\n $this->render('index',array('data'=>$data));\r\n }", "public function getAllModels()\n {\n try {\n return AppModelList::models();\n }\n catch (Throwable $t) {\n throw new Exception('Parse Error: AppModelList.php has been corrupted.');\n }\n }", "public function actionIndex()\n {\n $Posisi = $this->Posisi();\n\n $searchModel = new TaKegiatanSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function listaEstablecimientos() {\n\t\t$establecimiento = new Establecimiento();\n\t\treturn $establecimiento->listar();\n\t}", "public function index()\n {\n return Habitacion::all();\n }", "public function index()\n {\n return ObatMasuk::with('jenisObat','stokObat')->get();\n }", "public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public function actionIndex() {\n\t\t$searchModel = new EntEmpleadosSearch ();\n\t\t$dataProvider = $searchModel->search ( Yii::$app->request->queryParams );\n\t\t//echo Yii::$app->user->identity->id_usuario; exit();\n\t\t\n\t\treturn $this->render ( 'index', [ \n\t\t\t\t'searchModel' => $searchModel,\n\t\t\t\t'dataProvider' => $dataProvider \n\t\t] );\n\t}", "public function actionIndex()\n {\n $modelunidad = new Unidadmedida();\n if ($modelunidad->load(Yii::$app->request->post()) && $modelunidad->save()) {\n \\Yii::$app->getSession()->setFlash('crear', $modelunidad->descripcion);\n return $this->redirect(['index']);\n }\n\n $searchModel = new UnidadmedidaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n if (isset($_POST['hasEditable'])) {\n\n $id = Yii::$app->request->post('editableKey');\n\n $modelo = $this->findModel($id);\n // Usando el formato de respuesta de Yii para codificar la salida como JSON\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n\n $actual = current($_POST['Unidadmedida']);\n $post['Unidadmedida'] = $_POST['Unidadmedida'][$_POST['editableIndex']];\n\n if ($modelo->load($post)) {\n $modelo->save();\n $output = '';\n if (isset($actual['unidad'])) {\n $output = Yii::$app->formatter->asText($modelo->unidad);\n }\n if (isset($actual['descripcion'])) {\n $output = Yii::$app->formatter->asText($modelo->descripcion);\n }\n if (isset($actual['tipo_unidad'])) {\n $output = Yii::$app->formatter->asText($modelo->tipo_unidad);\n }\n\n return['output'=>$output, 'message'=>''];\n }\n }\n\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'modelunidad' => $modelunidad,\n ]);\n }", "public function index()\n {\n return Inventario::all();\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function models()\n {\n $this->_display('models');\n }", "public function actionIndex()\n {\n\t\t$idInstitucion = $_SESSION['instituciones'][0];\n\t\t\t\n\t\t//Muestra solo las sedes que tenga esa institucion\n\t\t$searchModel = new InfraestructuraEducativaBuscar();\n\t\t$dataProvider = $searchModel->search(Yii::$app->request->queryParams);\t\t\t\n\t\t$dataProvider->query->select \t(\"ie.*\");\n\t\t$dataProvider->query->from\t \t( 'infraestructura_educativa as ie, sedes as se');\n\t\t$dataProvider->query->andwhere\t( \" ie.id_sede = se.id\n\t\t\t\t\t\t\t\t\t\t\tAND se.id_instituciones = $idInstitucion\n\t\t\t\t\t\t\t\t\t\t\tAND ie.estado = 1\n\t\t\t\t\t\t\t\t\t\t\");\n\t\n\n\t\treturn $this->render('index', [\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'idInstitucion' => $idInstitucion,\n\t\t\t]);\n\t\t\n\n }", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public function indexModel(){\n $this->model('auditor/indexModel');\n \n $this->model->load(); \n }", "public function index()\n {\n return Kolekcija::all();\n }", "public function index(){\n $model = new InternetSpeedModel(); \n return view('list');\n }", "public function actionIndex()\n {\n $model = MasterPemeriksaanFisik::find();\n\n $dataSetting = SettingGlobal::find()\n ->select(['setting_global.*', 'nama_kategori', 'nama_item_setting', 'kode_tes', 'nilai_normal'])\n ->joinWith(['item' => function ($q) {\n $q->joinWith(['kategori']);\n }])\n ->andWhere(['setting_global.status' => 2])\n ->asArray()\n ->all();\n\n return $this->render('index', [\n 'model' => $model,\n 'dataSetting' => $dataSetting\n ]);\n }", "public function actionIndex() {\n $searchModel = new ForoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "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 index()\n {\n\n return $this->facilitie->all();\n\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('NTEAntiquitasBundle:AntiquitasModulesOutils')->findAll();\n\n return array(\n 'titre' => 'Outils',\n 'entities' => $entities,\n );\n }", "public function getModels();", "public function getModels();", "public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }", "function SHOWALL(){\r\n\r\n $stmt = $this->db->prepare(\"SELECT * FROM edificio\");\r\n $stmt->execute();\r\n $edificios_db = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $alledificios = array(); //array para almacenar los datos de todos los edificios\r\n\r\n //Recorremos todos las filas de edificios devueltas por la sentencia sql\r\n foreach ($edificios_db as $edificio){\r\n //Introducimos uno a uno los edificios recuperados de la BD\r\n array_push($alledificios,\r\n new EDIFICIO_Model(\r\n $edificio['edificio_id'],$edificio['nombre_edif'],$edificio['direccion_edif']\r\n ,$edificio['telef_edif'],$edificio['num_plantas'],$edificio['agrup_edificio']\r\n )\r\n );\r\n }\r\n return $alledificios;\r\n }", "public function actionIndex() {\n $this->breadcrumbs = array($this->page_name . '管理');\n $criteria = new CDbCriteria();\n $model = GoodsCategory::model()->findAll($criteria);\n $list = Utils::getUnLimitClass(Utils::object2array($model), 0, '---');\n $this->render('index', array('model' => $list));\n }", "public function index()\n {\n return Entity::all();\n }", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function actionIndex()\n {\n $searchModel = new TrabajoSearch();\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 FenhongSearch();\n $searchModel->uid = $this->user->id;\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 GeSeguimientoGestionBuscar();\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 TakwimSearch();\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 PraktekMahasiswaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function all()\n {\n if (!$this->isLogged()) exit;\n $this->oUtil->getModel('Todo');\n $this->oModel = new \\TestProject\\Model\\Todo;\n\n $this->oUtil->oTodos = $this->oModel->getAll();\n\n $this->oUtil->getView('index');\n }", "public function actionIndex()\n {\n $model = new Financeiro();\n $searchModel = new FinanceiroSearch(['tipo' => 1]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public static function get_all()\n {\n $data = DB::table('artikel')->get();\n return $data;\n }", "public function actionIndex()\n { \n $searchModel = new AcEspUejSearch();\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 Model::all();\n }", "public function actionIndex()\n {\n $searchModel = new DetallecarritoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $fitas = $em->getRepository('MRSBackupBundle:Fita')\n ->findBy(array(),array('unidade' => 'ASC',\n 'barCode' => 'ASC'));\n\n return $this->render('fita/index.html.twig', array(\n 'fitas' => $fitas,\n ));\n }", "public function habitos_get()\n {\n $status = 1;\n $message = null;\n\n $habitos = $this->HabitoModel->getAll();\n\n if($habitos == null)\n {\n $status = 0;\n $message = 'No se han encontrado habitos.';\n }\n\n $this->response(\n array(\n \"status\" => $status,\n \"message\" => $message,\n \"data\" => $habitos\n ), \n REST_Controller::HTTP_OK\n );\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('TroulitePathfinderBundle:ClassDefinition')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index() {\r\n $models = TodoItemModel::findAll();\r\n require $this->views_folder . 'index.php';\r\n }", "public function actionIndex()\n {\n $model = new Nomina();\n\n $colaborador = Yii::$app->user->identity->colaborador_id;\n\n if ($model->load(Yii::$app->request->post())) {\n $nominaGlosa = NominaGlosa::find()\n ->where(['fechas_pago_id' => $model->fecha_pago_id])\n ->andWhere(['colaborador_id' => $colaborador])\n ->asArray()->all();\n\n $nomina = Nomina::find()\n ->where(['fecha_pago_id' => $model->fecha_pago_id])\n ->andWhere(['colaborador_id' => $colaborador])\n ->asArray()->one();\n\n return $this->render('index', [\n 'model' => $model,\n 'nomina' => $nomina,\n 'nominaGlosa' => $nominaGlosa\n ]);\n\n } else {\n return $this->render('index', [\n 'model' => $model,\n ]);\n }\n /*\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }*/\n\n\n\n\n\n /*\n\n $model = new FechasPago();\n\n\n\n\n\n\n\n //print_r($valor);\n\n\n/*\n $dato = Nomina::find()->where(['colaborador_id' => 12])->all();\n\n\n\n $subQuery = BaseFollower::find()->select('id');\n $query = BaseTwitter::find()->where(['not in', 'id', $subQuery]);\n $models = $query->all();\n\n\n*/\n\n/*\n $searchModel = new NominaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'valor' => $valor,\n\n ]);\n*/\n }", "public function actionIndex()\n {\n $searchModel = new TKaryawanSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $listKaryawan = TKaryawan::find()->orderBy(['nama'=>SORT_ASC])->all();\n $listBidang = ArrayHelper::map(TBidang::find()->orderBy(['bidang'=>SORT_ASC])->asArray()->all(), 'id','bidang');\n $listJabatan = ArrayHelper::map(TJabatan::find()->orderBy(['jabatan'=>SORT_ASC])->asArray()->all(), 'id','jabatan');\n $listJabatan = ArrayHelper::merge($listJabatan, ['999'=>'Staff']);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'listKaryawan' => $listKaryawan,\n 'listBidang' => $listBidang,\n 'listJabatan' => $listJabatan,\n ]);\n }", "public function mostrarTodosTrabajos(){\n return Trabajo::all();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $titulares = $em->getRepository('AppBundle:Titular')->findAll();\n\n return $this->render('titular/index.html.twig', array(\n 'titulares' => $titulares,\n ));\n }", "public function actionIndex()\n {\n if(Yii::$app->user->can('ucitelj')){\n\n $odeljenje = Ucitelj::find()->select('id_odeljenje')->where(['user_id' => Yii::$app->user->id ])->one();\n $odeljenje_id = Odeljenje::find()->select('id_odeljenje')->where(['id_odeljenje' => $odeljenje ])->one();\n $ido = $odeljenje_id->id_odeljenje;\n\n $q = Yii::$app->db->createCommand('\n SELECT * FROM `raspored` \n\t JOIN `predmet` ON `raspored`.`id_predmet` = `predmet`.`id_predmet`\n\t WHERE `raspored`.`id_odeljenje` = '.$ido.'\n ');\n $model = $q->queryAll();\n\n return $this->render('index', [\n 'model' => $model,\n ]);\n } else if(Yii::$app->user->isGuest){\n $this->redirect(['../site/login']);\n } else {\n throw new ForbiddenHttpException('Nemate pravo pristupa ovoj stranici');\n }\n }", "public function index()\n {\n return Mahasiswa::all();\n }", "public function all($model){\n\n if(!class_exists($model)){\n return new $model;\n }\n\n $table = $this->getTableName($model);\n $stmt = $this->pdo->prepare('select * from ' . $table);\n $stmt->execute();\n\n return $stmt->fetchAll(\\PDO::FETCH_CLASS, $model);\n }", "public function getAllMahasiswa(){\n // melakukan prepare query\n $this->db->query('SELECT * FROM '. $this->tabel);\n // eksekusi query dan mengambil semua data mahasiswa\n return $this->db->resultAll();\n }", "public function get_all_artikel() {\n \t// Query Manual\n \t// $query = $this->db->query('\n \t// \t\tSELECT * FROM blogs\n \t// \t');\n\n \t// Memakai Query Builder\n \t$query = $this->db->get('blogs');\n\n \t// Return dalam bentuk object\n \treturn $query->result();\n }", "public function actionIndex()\n {\n $searchModel = new TabContatoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t\n\t\t$this->titulo = 'Gerenciar Contato';\n\t\t$this->subTitulo = '';\n\t\t\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $model = new Kurslar();\n $model = $model->find()->limit(6);\n \n $pagination = new Pagination([\n 'defaultPageSize' => 4,\n 'totalCount' => $model->count()\n ]);\n\n $model->limit($pagination->limit);\n $model->offset($pagination->offset);\n\n return $this->render('index',[\n 'model' => $model->all(),\n 'pagination' => $pagination\n ]);\n\n return $this->render('index',[\n 'model' => $model\n ]);\n\n $searchModel = new KurslarSearch();\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 $data['manufacturers'] = Manufacturer::getManufacturers();\n return view('models.models')->with($data);\n }", "public function index()\n {\n $jatah = JatahcutiModel::all() ;\n return view('jatahcuti', compact('jatah'));\n\n }", "public function model()\n {\n return Empre::class;\n }", "public function index(){\n $this->setData('seo_title', 'Spisak korisnika | Aplikacija za vođenje ličnih finansija');\n $korisnici = HomeModel::getAll();\n $this->setData('korisnici', $korisnici);\n }", "function index()\n {\n $data['tagihan_detail'] = $this->Tagihan_detail_model->get_all_tagihan_detail();\n \n $data['_view'] = 'tagihan_detail/index';\n $this->load->view('layouts/main',$data);\n }", "public function index()\n {\n return SiswaNF::with('tpnya', 'kelasnya')->orderBy('name', 'asc')->get()->toArray();\n }", "function getAllTransaksiTab(){\n $data = $this->pengajuan->where('kategori','like',\"%Tabungan\")->orderBy('created_at','DESC')->get();\n return $data;\n }", "public function index()\n {\n //\n return ExamenesClinicos::all();\n }", "public function actionIndex()\n {\n $searchModel = new PeticionesSearch();\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 // menampilkan semua data post melalui model 'post'\n $tabels = tabel::all();\n return view('tabel.tampilan',compact('tabels'));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SCRUMSwiftairBundle:Klasses')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n return view('admin.kegiatan.index',['kegiatan'=>Kegiatan::all()]);\n }", "public function index()\n {\n return Planodetrabalho::all();\n }", "public function findAll($model);", "public function actionIndex()\n {\n $searchModel = new TblMintaBhnBakuSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n \n }", "private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }", "public function actionIndex()\n {\n $searchModel = new EstudiosIpsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'lista_est' => ArrayHelper::map(Estudios::find()->all(), 'cod_cups', 'descripcion'),\n 'lista_tipos' => ArrayHelper::map(TiposServicio::find()->where(['idips'=>UsuariosIps::find()->select(['idips'])->where(['idusuario'=>Yii::$app->user->id])])->all(), 'id', 'nombre'),\n ]);\n }", "public function index()\n {\n $model = static::queryAll()->where( 'name' , '!=' , 'root' )->where( 'name' , '!=' , 'farm' );\n $this->_list( $model );\n $this->layout->title = '查看' . static::$name;\n }" ]
[ "0.6073288", "0.5840383", "0.5836851", "0.583183", "0.5796418", "0.5775068", "0.57690316", "0.5714881", "0.57036513", "0.5700987", "0.5688141", "0.5666066", "0.5665858", "0.56567556", "0.56416523", "0.5636915", "0.5635459", "0.56197435", "0.5604112", "0.5584682", "0.558322", "0.5558617", "0.5558253", "0.55570483", "0.5546031", "0.55444103", "0.5542529", "0.5540043", "0.55372703", "0.5536109", "0.55358285", "0.5533444", "0.55293703", "0.55269945", "0.55109775", "0.5510193", "0.5505827", "0.550364", "0.54982334", "0.5489194", "0.54866254", "0.5485413", "0.54835624", "0.5478889", "0.54760754", "0.5472544", "0.54677874", "0.5467758", "0.54650795", "0.54603684", "0.54603684", "0.5459383", "0.5457752", "0.5455381", "0.5447636", "0.5447131", "0.54451054", "0.5441981", "0.54390603", "0.5434646", "0.54236704", "0.5423273", "0.5418659", "0.541796", "0.541489", "0.54079676", "0.53907734", "0.53905374", "0.5381247", "0.5381057", "0.5381015", "0.5377368", "0.53681326", "0.5363527", "0.53617316", "0.5360656", "0.53583854", "0.53573066", "0.5348818", "0.5346649", "0.53410757", "0.53266495", "0.5324577", "0.5321891", "0.53218675", "0.53206336", "0.5317691", "0.5317559", "0.53152496", "0.53049934", "0.5304248", "0.5302681", "0.5302417", "0.530084", "0.52999604", "0.5299836", "0.52996933", "0.5298643", "0.52930313", "0.52904016" ]
0.67643505
0
Displays a single HariTidakEfektif model.
public function actionView($id) { $model = $this->findModel($id); return $this->render('view', [ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndex()\r\n {\r\n $searchModel = new HariTidakEfektifSearch();\r\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\r\n\r\n return $this->render('index', [\r\n 'searchModel' => $searchModel,\r\n 'dataProvider' => $dataProvider,\r\n ]);\r\n }", "public function showAction(Feuil $feuil)\n {\n $deleteForm = $this->createDeleteForm($feuil);\n\n return $this->render('feuil/show.html.twig', array(\n 'feuil' => $feuil,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'show',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/show', $data);\n }", "public function show(Trabalho $trabalho)\n {\n //\n }", "public function actionView($id)\n {\n return $this->render('pengumuman', ['model' => \\app\\models\\TaPengumuman::findOne(['id' => $id])]);\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function show(Umrah $umrah)\n {\n //\n }", "public function actionView()\n {\n $id=(int)Yii::$app->request->get('id');\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionViewByHrdStaf($id){\n return $this->render('viewByHrdStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionView($id)\n {\n $this->checkPrivilege();\n $model = $this->findModel($id);\n $searchModel = new RekapitulasiBahanSearch();\n $dataProvider = $searchModel->search(\\Yii::$app->request->queryParams, $model->id);\n // var_dump(\\Yii::$app->request->queryParams);die();\n return $this->render('view', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(hargajual $hargajual)\n {\n //\n }", "public function show(FakturReturBeliDetail $fakturReturBeliDetail)\n {\n //\n }", "public function actionView($id)\n {\n $model = self::findModel($id);\n $acara = $model->notulenTbl;\n\n $person_form = new PostPerson();\n\n $person = Person::find()->where(['NOTULEN_ID'=>$id])->all();\n\n $searchModel = new NotulenSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n \n return $this->render('view', [\n 'model' => $model,\n 'acara' => $acara,\n 'ttd'=>self::Get_profile()->emp->SIGSVGBASE64,\n 'profile'=>self::Get_profile()->emp,\n 'emp_nm'=>self::Get_profile()->emp->EMP_NM,\n 'person'=>$person,\n 'person_form'=>$person_form,\n 'items'=>self::get_aryPerson(),\n 'dataProvider'=>$dataProvider\n ]);\n }", "public function show()\n {\n $data['title'] = 'Siswa';\n $id = $this->input->get('id');\n $this->load->model('Absen_m', 'absen');\n $kehadiran = $this->absen->hitung_kehadiran_siswa($id, 'hadir');\n $sakit = $this->absen->hitung_kehadiran_siswa($id, 'sakit');\n $izin = $this->absen->hitung_kehadiran_siswa($id, 'izin');\n // cegat apa bila id nya tdk di isi ato langsung akses ke link \n if ($id !== null) {\n //Ambil Semua data absensi taruh dalam satu varible \n $data['siswa'] = $this->siswa->get_siswa_byId($id)->result_array();\n $data['kehadiran'] = $kehadiran;\n $data['sakit'] = $sakit;\n $data['izin'] = $izin;\n\n $this->load->view('templates/header', $data);\n $this->load->view('templates/sidenav');\n $this->load->view('templates/navbar', $data);\n $this->load->view('siswa/show', $data);\n $this->load->view('templates/footer');\n } else {\n show_404();\n }\n }", "public function show(Feriado $feriado)\n {\n //\n }", "public function actionViewByHrd($id){\n return $this->render('viewByHrd',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionView($id)\n\t{\n $model=Persona::model()->with(array('situacionEconomica', 'condicionesEspeciales', 'domicilio', 'solicitud'))->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'La persona no se encuentra en el sistema.');\n\n\t\t$this->render('view',array('model'=>$model));\n\t}", "public function actionView($id)\n {\n\t\t$this->titulo = 'Detalhar Contato';\n\t\t$this->subTitulo = '';\n\t\t\t\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function show(Teknologi $teknologi)\n {\n //\n }", "public function show(MataKuliah $mataKuliah)\n {\n //\n }", "public function show(Labarugi $labarugi)\n {\n //\n }", "public function show(Chefe $chefe)\n {\n //\n }", "public function show(Filiere $filiere)\n {\n //\n }", "public function actionView($id='')\n\t{\n\t\t$loginpemakai = Yii::app()->user->id;\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->addCondition('loginpemakai_id = '.$loginpemakai);\n\t\t$pegawai = LoginpemakaiK::model()->find($criteria);\n\t\tif(empty($id))\n\t\t\t$id = $pegawai->pegawai_id;\n \n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function show($id)\n {\n //return view('especializacion_tipo.edit', $te);\n }", "public function actionView($id)\n {\n \t$searchModel = new PostulanteSearch();\n \t$searchModel->id_convocatoria=$id;\n \t$dataProvider = $searchModel->search(null);\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n \t\t'searchModel' => $searchModel,\n \t\t'dataProvider' => $dataProvider,\n ]);\n }", "function show( $id )\n {\n $tema = $this->model_valasztott->getDiakTema($this->logged_in['uid']);\n if ($tema['valasztott_id'] != $id) {\n redirect(base_url().'valasztott');\n }\n\t\t$data = $this->model_valasztott->get( $id );\n\n if (empty($data)) {\n redirect(base_url());\n }\n\n $fields = $this->model_valasztott->fields( TRUE );\n \n $this->template->assign( 'id', $id );\n\t\t$this->template->assign( 'valasztott_fields', $fields );\n\t\t$this->template->assign( 'valasztott_data', $data );\n\t\t$this->template->assign( 'table_name', 'Valasztott' );\n\t\t$this->template->assign( 'template', 'show_valasztott' );\n\t\t$this->template->display( 'frame_admin.tpl' );\n }", "public function actionViewByStaf($id){\n return $this->render('viewByStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function show(KegiatanMahasiswa $kegiatanMahasiswa)\n {\n //\n }", "public function actionView($id_curso_disponible_servidor_publico)\n{\n$this->render('view',array(\n'cursoDisponibleServidorPublico'=>$this->loadModel($id_curso_disponible_servidor_publico),\n));\n}", "public function actionView($id)\n\t{$this->layout='//layouts/iframe';\n $model=AKPenjaminRekM::model()->findByAttributes(array('penjamin_id'=>$id));\n \n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function display()\n {\n $this->view->viewFile = \"404\";\n echo $this->view->generateMarkup();\n }", "public function actionView($id)\n {\n $searchModel = new FotoKamarSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->query->andWhere(['foto_id_kamar' => $id]);\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function showAction($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 $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function actionView($id_cat_puesto)\n{\n$this->render('view',array(\n'catPuesto'=>$this->loadModel($id_cat_puesto),\n));\n}", "public function show($id)\n {\n //\n $bacheo=Bacheo::find($id);\n //en $objeto tengo aquel que coincide con $id\n return 'Encontre el objeto, hacer algo luego';\n //return view('libro.show',compact('objeto'));\n }", "public function actionView($id)\n {\n $searchModel = new SafetyStockSearch();\n $searchModel->sku_barang = $id;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('view', [\n 'model' => Barang::findOne($id),\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function display(){\r\n\t\t$view = new View();\r\n\t\t$model = new Model();\r\n\t\t\r\n\t // Content-Template\r\n\t\tswitch($this->template){\r\n\t\t case 'eintrag' :\r\n\t\t\t\t//Formular mit allen Daten abgeschickt?\r\n\t\t\t if(isset($this->request['vorname']) &&\r\n\t\t\t\t isset($this->request['nachname']) &&\r\n\t\t\t\t isset($this->request['email']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$vorname = $this->request['vorname'];\r\n\t\t\t\t\t$nachname = $this->request['nachname'];\r\n\t\t\t\t\t$email = $this->request['email'];\r\n\t\r\n\t\t\t\t\t$vorname = htmlspecialchars($vorname);\r\n\t\t\t\t\t$nachname = htmlspecialchars($nachname);\r\n\t\t\t\t\t$email = htmlspecialchars($email);\r\n \t\r\n\t\t\t\t\t//Formular-Fehlerüberprüfung\r\n\t\t\t\t\t$form = new FormValidator(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\tnew FieldValidator(\"vorname\", $vorname),\r\n\t\t\t\t\t\t\tnew FieldValidator(\"nachname\", $nachname),\r\n\t\t\t\t\t\t\tnew FieldValidator(\"email\", $email, FieldType::Email)\r\n\t\t\t\t\t));\r\n\t\t\t\t // Kein Formulareingabe-Fehler\r\n\t\t\t\t\tif($form->isValid()) {\r\n\t\t\t\t\t\t//E-Mail-Adresse auf Übereinstimmung mit den vorhandenen Einträgen prüfen\r\n\t\t\t\t\t\t$emails = $model->getEmails();\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!in_array($email, $emails))\r\n\t\t\t\t\t\t{//falls E-Mail-Adresse noch nicht vorhanden --> Eintragung\r\n\t\t\t\t\t\t\t$erg = $model->insertEntry($vorname, $nachname, $email);\r\n\t\t\t\t\t\t\tif($erg == false)\r\n\t\t\t\t\t\t\t\t$this->error = $model->getError();\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\theader(\"Location:index.php\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//falls E-Mail-Adresse bereits vorhanden --> Fehlermeldung\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t $view->assign('fehler', \"Die E-Mail-Adresse ist bereits vorhanden! Die Eintragung war nicht erfolgreich.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { // Formulareingabe-Fehler\r\n\t\t\t\t\t\t$view->assign('fehler', $form->getErrors());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$view->setTemplate('eintrag');\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 'email':\r\n\t\t\t\t//Formular abgeschickt?\r\n\t\t\t if(isset($this->request['betreff']) &&\r\n\t\t\t\t isset($this->request['nachricht']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$betreff = $this->request['betreff'];\r\n\t\t\t\t\t$nachricht = $this->request['nachricht'];\r\n\t\r\n\t\t\t\t\t$betreff = htmlspecialchars($betreff);\r\n\t\t\t\t\t$betreff = utf8_encode($betreff);\r\n\t\t\t\t\t$nachricht = htmlspecialchars($nachricht);\r\n \t\r\n\t\t\t\t\t//Formular-Fehlerüberprüfung\r\n\t\t\t\t\t$form = new FormValidator(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\tnew FieldValidator(\"betreff\", $betreff),\r\n\t\t\t\t\t\t\tnew FieldValidator(\"nachricht\", $nachricht)\r\n\t\t\t\t\t));\r\n\t\t\t\t // Kein Formulareingabe-Fehler\r\n\t\t\t\t\tif($form->isValid()) {\r\n\t\t\t\t\t\t//E-Mail-Adressen aus der Datenbank auslesen\t\t\t\r\n\t\t\t\t\t\t$emails = $model->getEmails();\r\n\t\t\t\t\t\t//falls kein Ergebnis:\r\n\t\t\t\t\t\tif($emails == null)\r\n\t\t\t\t\t\t\t$this->error = $model->getError();\r\n\t\t\t\t\t\t//wenn E-Mail-Adressen vorliegen, Nachricht an alle Adressen senden\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach($emails as $email)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$header = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n\t\t\t\t\t\t\t\t$header .= 'Content-type: text/plain; charset=utf8' . \"\\r\\n\";\r\n\t\t\t\t\t\t\t\tmail(\"$email\", \"$betreff\", \"$nachricht\", $header);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//... und zurück zur Hauptansicht\r\n\t\t\t\t\t\t\theader(\"Location:index.php\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { // Formulareingabe-Fehler\r\n\t\t\t\t\t\t$view->assign('fehler', $form->getErrors());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$view->setTemplate('email');\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 'ansicht':\r\n\t\t\tdefault:\r\n\t\t\t\t$entries = $model->getEntries();\r\n\t\t\t\tif(!isset($entries)) // Fehler\r\n\t\t\t\t\t$this->error = $model->getError();\r\n\t\t\t\telse // Alles O.K.\r\n\t\t\t\t{\r\n\t\t\t\t\t$view->setTemplate('ansicht');\r\n\t\t\t\t\t$view->assign('entries', $entries);\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Rahmen-Template\r\n\t\t$this->view->setTemplate('frame'); //Rahmentemplate\r\n\t\t$this->view->assign('verteiler_title', 'Verteiler');\r\n\t\t$this->view->assign('verteiler_content', $view->loadTemplate());\r\n\t\t$this->view->assign('verteiler_footer', 'Ein Mail-Verteiler von und mit MVC');\r\n\t\treturn $this->view->loadTemplate();\r\n\t}", "public function actionView($id= null)\n {\n \n \n $request = Yii::$app->request;\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'const' => $this->const,\n ]);\n \n }", "public function show(KegiatanHarian $kegiatanHarian)\n {\n //\n }", "public function show($nim)\n {\n // Prak ORM\n //$mahasiswa=Mahasiswa::find($nim);\n //return view('mahasiswas.detail',compact('mahasiswa'));\n\n //prak orm lanjutan\n $mahasiswa = Mahasiswa::with('kelas')->where('nim', $nim)->first();\n return view('mahasiswas.detail',['mahasiswa' => $mahasiswa]);\n\n }", "public function show($id)\n {\n $m = new MataKuliah;\n $subheader = 'Hapus Mata Kuliah '.$m->findOrFail($id)->prodi->findOrFail($m->findOrFail($id)->prodi_id)->deskripsi;\n $prodi = $m->findOrFail($id)->prodi->findOrFail($m->findOrFail($id)->prodi_id)->deskripsi;\n $prodi_id = $m->findOrFail($id)->prodi->findOrFail($m->findOrFail($id)->prodi_id)->id;\n $data = $m->findOrFail($id);\n return view('matakuliah.show', compact('subheader','prodi','prodi_id', 'data'));\n }", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView($id)\n{\n$this->render('view',array(\n'model'=>$this->loadModel($id),\n));\n}", "protected function findModel($id)\r\n {\r\n if (($model = HariTidakEfektif::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public function show(Klasifikasi $Klasifikasi)\n {\n //\n }", "public function show(Tiempo $tiempo)\n {\n //\n }", "public function show($id)\n {\n $pilih= Pilih::find($id);\n return view('pilih.show',compact('pilih')); // //\n }", "public function show(qlsv_tudanhgia $qlsv_tudanhgia)\n {\n //\n }", "public function actionView($id = null)\n {\n// if($orderPart === null) {\n// throw new \\yii\\base\\UserException('Страница оформления заказа не найдена.', 400);\n// }\n\n $model = Serie::findOne(['id' => $id, 'is_publish' => 1]);\n if($model === null) {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n return $this->render('view', [\n 'model' => $model\n ]);\n }", "public function actionShow()\r\n\t{\r\n\t\t$this->render('show',array('model'=>$this->loadcontent()));\r\n\t}", "public function actionView($id)\n {\n $dispositivos = PrefacturaDispositivoFijoElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n //$count_fijo = $dispositivos->count();\n // $pag_fijos = new Pagination([\n // 'defaultPageSize'=>10,\n // 'totalCount' => $dispositivos->count()\n // ]);\n // $disp_fijos = $dispositivos\n // ->offset($pag_fijos->offset)\n // ->limit($pag_fijos->limit)\n // ->all();\n\n $modelo=new PrefacturaDispositivoFijoElectronico();\n $variables=PrefacturaDispositivoVariableElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n $monitoreos=PrefacturaMonitoreo::find()->where('id_prefactura_electronica='.$id)->all();\n\n\n if (isset($_POST['fecha_factura'])) {\n $model =PrefacturaElectronica::find()->where('id='.$id)->one();\n $model->setAttribute('numero_factura', $_POST['num_factura']);\n $model->setAttribute('fecha_factura', $_POST['fecha_factura']);\n\n $model->save();\n\n return $this->redirect(['view', 'id' => $id ]);\n }\n\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dispositivos' => $dispositivos/*$disp_fijos*/,\n 'pag_fijos'=>$pag_fijos,\n 'modelo'=>$modelo,\n 'variables'=>$variables,\n 'monitoreos'=>$monitoreos\n ]);\n }", "public function show(Efectivo $efectivo)\n {\n //\n }", "public function actionView()\r\n {\r\n $this->_userAutehntication();\r\n /*\r\n * Check if id was submitted via GET method \r\n */\r\n if(!isset($_GET['id']))\r\n $this->_sendResponse(500, 'Error: Parameter <b>id</b> is missing' );\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']);\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>view</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model)) {\r\n $this->_sendResponse(404, 'No Post found with id '.$_GET['id']);\r\n } else {\r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes));\r\n }\r\n }", "public function show($id)\n {\n // $isdh = Isdh::with('title_isdh')->where('id', $id)->first();\n $isdh = Isdh::find($id);\n \treturn view('website.isdh_single', compact('isdh'));\n }", "private function view($id) {\n $model = Inmueble::model()->findByPk($id);\n if ($model !== null) {\n Response::ok(CJSON::encode($model->toArray()));\n } else {\n Response::ok(CJSON::encode(array(\"resultado\" => \"falla\", \"mensaje\" => \"inmueble no encontrado\")));\n }\n }", "public function show($id)\n\t{\n \n\t}", "public function show(BarangKeluar $barangKeluar)\n {\n // $halaman = 'hobi';\n // $hobi = Hobi::findOrFail($id);\n // return view('hobi.show', compact('halaman', 'hobi')); \n }", "public function index(){\r\n //del modelo\r\n $fichas[\"ver\"] = $this->FichaModel->ver();\r\n \r\n //cargo la vista y le paso los datos\r\n $this->load->view(\"FichaView\",$fichas);\r\n }", "public function actionView($id)\n {\n\n $model = $this->findModel($id);\n $ambito= $model->localizacion;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) \n {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n else\n {\n //Tablas relacionadas\n $localizacion = new ActiveDataProvider([\n 'query' => LocalizacionAccVariable::find()->where(['id_variable'=>$model->id]),\n 'pagination' => [\n 'pageSize' => 5,\n ]\n ]);\n\n $usuarios_variables=new AccionCentralizadaVariablesUsuarios;\n\n return $this->render('view', [\n 'model' => $model,\n 'localizacion' => $localizacion,\n 'ambito' => $ambito,\n 'usuarios' =>$usuarios_variables->obtener_usuario_variables($model->id),\n ]);\n }\n }", "public function actionView($id) {\n $id = Html::encode($id); //Why this \n $model = $this->findModel($id);\n\n $model_station = new Station;\n $model_station_search = new StationSearch;\n $model_data_source_search = new DataSourcesSearch();\n $model_station_search->stationowner = $model->id;\n $dataProviderStation = $model_station_search->search(NULL);\n $model_data_source_search->stakeholderid = $model->id;\n $dataProviderDataSources = $model_data_source_search->search(NULL);\n \n return $this->render('view', [\n 'model' => $model,\n 'model_station' => $model_station,\n 'model_station_search' => $model_station_search,\n 'model_data_source_search' => $model_data_source_search,\n 'dataProvider_station' => $dataProviderStation,\n 'dataProvider_datasources' => $dataProviderDataSources,\n ]);\n }", "public function actionView($id)\n\t{\n\t\t//$this->layout='//layouts/column2';\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'manajemen'=>'manajemen',\n\t\t));\n\t}", "public function actionView()\n {\n \t$id = isset($_REQUEST['id'])?$_REQUEST['id']:null;\n \t$model = $this->findModel($id);\n \t \n \treturn CommonUtils::json_success($model);\n }", "public function actionView()\n\t{\n\t\tif (!($model = $this->loadModel()))\n\t\t\treturn;\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionView($id)\n { \n return $this->findModel($id);\n \n }", "public function show($id)\n {\n //Nous n'utiliserons pas cette méthode car l'affichage s'executera sur l'index.\n }", "public function actionView($id)\n {\n $model=$this->findModel($id);\n\n $searchThongTin=new ThuocTinhSanPhamSearch();\n $dataThongTin = $searchThongTin->search(Yii::$app->request->queryParams);\n $dataThongTin->query->andFilterWhere(['thuoc_san_pham_id'=>$model->id]);\n\n return $this->render('view', [\n 'model' => $model,\n 'searchThongTin'=>$searchThongTin,\n 'dataThongTin'=>$dataThongTin,\n ]);\n }", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function show(Emploi $emploi)\n {\n //\n }", "public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionView($id)\n {\n $model=$this->findModel($id);\n $tahunAjaran = TahunAjaran::findOne(['status'=>1]);\n $kelas= RelasiKelasSiswa::findOne(['uid_data_siswa'=> $model->uid_siswa, 'uid_tahun_ajaran'=>$tahunAjaran->uid_thn_ajaran]);\n $kelas= $kelas->uidKelas->nama_kelas;\n if(\\Yii::$app->user->can('superUser')){\n $attributes=[\n\n 'nis_siswa',\n 'nisn_siswa',\n 'nik_siswa',\n 'nama_siswa',\n 'jenis_kelamin_siswa',\n 'tempat_lahir_siswa',\n 'tanggal_lahir_siswa',\n [\n 'attribute'=>'kelas',\n 'value'=>$kelas,\n ],\n 'hobi_siswa',\n 'cita_cita_siswa',\n 'alamat_domisili',\n 'jarak_rumah_kesekolah',\n 'no_telp_orangtua',\n 'nama_ayah',\n 'nama_ibu',\n 'alamat_lengkap_orang_tua',\n\n ];\n }\n else{\n $attributes=[\n\n 'nis_siswa',\n 'nisn_siswa',\n 'nik_siswa',\n 'nama_siswa',\n 'jenis_kelamin_siswa',\n 'tempat_lahir_siswa',\n 'tanggal_lahir_siswa',\n [\n 'attribute'=>'kelas',\n 'value'=>$kelas,\n ],\n 'hobi_siswa',\n 'cita_cita_siswa',\n 'alamat_domisili',\n 'jarak_rumah_kesekolah',\n 'no_telp_orangtua',\n 'nama_ayah',\n 'nama_ibu',\n 'alamat_lengkap_orang_tua',\n\n ];\n }\n\n return $this->render('view', [\n 'model' => $model,\n 'attributes'=> $attributes,\n 'kelas'=> $kelas,\n ]);\n }", "public function show($id)\n {\n return Kolekcija::find($id);\n }", "public function indexAction()\n {\n $this->view->title = ' - Themenübersicht';\n\n $topics = new TopicModel();\t\t\t//loads table\n $this->view->topics = $topics->fetchAll();\t//sends table to view\n }", "public function show($id)\n {\n // $anak = $this->aktor->anak->where('id',$id)->first();\n // return dd(!is_null($anak));\n if(method_exists($this, $id))\n {\n return $this->$id();\n }\n else\n {\n return view('errors.takboleh',['pesan'=>'sistem tidak mengenali request anda']);\n }\n }", "public function show(Sekolah $sekolah)\n {\n //\n }", "public function showAction() {\n $model = new Application_Model_Compromisso();\n //busco o id que eu quero ver\n $comp = $model->find($this->_getParam('id'));\n //crio uma view para o id referente;\n $this->view->assign(\"compromisso\", $comp);\n }", "public function show($id)\n {\n $nhanviens = NhanVien::all();\n $phieuxuat = PhieuXuat::where('id', $id)->with(['nhanvien', 'kho', 'khachhang'])->first(); \n return view('phieuxuat.show', ['phieuxuat' => $phieuxuat, 'nhanviens' => $nhanviens]);\n }", "public function actionView($id)\n {\n //BefugnisTeil\n if(!Yii::$app->user->can('viewBenutzer')){\n throw new ForbiddenHttpException('Sie haben kein Befugniss');\n }\n \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->MarterikelNr]);\n } else {\n return $this->render('view', ['model' => $model]);\n }\n }", "public function show(TrangThais $trangThais)\n {\n //\n }", "public function index()\n {\n //Menginialisasi data pembeli yang diambil dari model getPembeli()\n $data['pembeli'] = $this->pembeli->getPembeli();\n //Menampilkan view tabel dan menampilkan data yang diinisialisasi tadi\n echo view('tabel', $data);\n }", "public function index()\n {\n $this->session->unset_userdata('id_kelas_sekarang', '');\n $this->session->unset_userdata('kelas_sekarang', '');\n\n\n\n // Cari semua data kelas\n $kelas = $this->kelas->cari_semua();\n\n // data kelas ada, tampilkan\n if ($kelas) {\n // buat tabel\n $tabel = $this->kelas->buat_tabel($kelas);\n\n $this->data['tabel_data'] = $tabel;\n $this->load->view('template', $this->data);\n }\n // data kelas tidak ada\n else {\n $this->data['pesan'] = 'Tidak ada data kelas.';\n $this->load->view('template', $this->data);\n }\n }", "public function actionView($id) {\n $this->title = 'Rincian Paket';\n $packageAccount = new PackageAccount('searchPackage');\n// $realization = new Realization('searchPackage');\n $packageAccount->unsetAttributes(); // clear any default values\n// $realization->unsetAttributes(); // clear any default values\n if (isset($_GET['PackageAccount']))\n $model->attributes = $_GET['PackageAccount'];\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n 'packageAccount' => $packageAccount,\n// 'realization' => $realization,\n ));\n }", "public function actionView($id)\n {\n $kareer = Kareer::findOne($id);\n if (empty($kareer))\n throw new \\yii\\web\\HttpException(404, 'Такой вакансии нет');\n $kareer_employee=new Kareer_employee();\n $kareer_employee->kareer_id = $id;\n\n if( $kareer_employee->load(Yii::$app->request->post())&& $kareer_employee->save()) {\n\n Yii::$app->session->setFlash('success', \"Заявка на имя {$kareer_employee->name} о вакансии {$kareer->vacaition} отправлена\");\n\n return $this->redirect(['kareer/view', 'id' => $kareer_employee->kareer_id]);\n }\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'kareer_employee' => $kareer_employee,\n 'kareer' => $kareer,\n\n ]);\n }", "public function show($id)\n {\n\n \n \n \n }", "public function index()\n\t{\n\t\t$model = new ModelHome();\n $data['help_infosementara'] = $model->TampilInfoGangguan()->getResult();\n $data['help_berita'] = $model->TampilBerita()->getResult();\n $data['help_info'] = $model->TampilGangguanLengkap()->getResult();\n\t\techo view('LandingPage\\Home', $data);\n\t}", "public function show(Instituicao $instituicao)\n {\n //\n }", "public function show(){\r\n $etudiants = Etudiant::all();\r\n $classes = Classroom::all();\r\n $filieres = Filiere::all();\r\n return view('Ensaj.etudiant', ['mesEtudiants'=>$etudiants, 'mesClasses'=>$classes, 'mesFilieres'=>$filieres]);\r\n }", "public function actionView($id) {\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function index()\n\t{\n //ambil data lalu simpan di var data\n $data=$this->mymodel-> Get (\"film\");\n $data= array('data' => $data);\n //var data diubah menjadi var tipe data\n\t\t$this->load->view('hal_depan', $data);\n }", "public function show($id)\n {\n // include view file\n }", "public function actionViewByAtasan($id){\n $atasanSearchModel = new AtasanIzinSearch();\n $pegawai = Pegawai::find()->where(['user_id' => Yii::$app->user->identity->user_id])->one();\n $atasanSearchModel->pegawai_id = $pegawai['pegawai_id'];\n\n $model = $atasanSearchModel->search(Yii::$app->request->queryParams)->query->where(['cist_atasan_izin.permohonan_izin_id' => $id])->one();\n\n return $this->render('viewByAtasan',[\n 'model' => $model,\n ]);\n }", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function show($id) {\n \n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $feuils = $em->getRepository('WorldCupRussiaBundle:Feuil')->findAll();\n\n return $this->render('feuil/index.html.twig', array(\n 'feuils' => $feuils,\n ));\n }" ]
[ "0.6637011", "0.6349116", "0.63444686", "0.62707895", "0.62528276", "0.6251735", "0.6251457", "0.6204706", "0.61933017", "0.6189639", "0.61523026", "0.6148129", "0.61437666", "0.61155707", "0.61099935", "0.61068106", "0.6106434", "0.6083485", "0.6076037", "0.6074094", "0.6043192", "0.6043022", "0.6021941", "0.6018341", "0.599664", "0.59940434", "0.5993029", "0.59899235", "0.59790075", "0.597546", "0.5967528", "0.59654903", "0.59488535", "0.594867", "0.5947881", "0.5938768", "0.59380823", "0.5934693", "0.59337646", "0.59300697", "0.5918241", "0.5910045", "0.59041893", "0.5904017", "0.5904017", "0.5904017", "0.5904017", "0.5904017", "0.5902029", "0.5894138", "0.5891709", "0.58910835", "0.5877804", "0.5876416", "0.5869678", "0.5867593", "0.586748", "0.58650386", "0.5856556", "0.5856208", "0.58534044", "0.5852923", "0.5850641", "0.58462244", "0.58455205", "0.58411294", "0.58400416", "0.5839382", "0.58371556", "0.58365285", "0.5835703", "0.58294374", "0.5828672", "0.58280116", "0.58250064", "0.5823118", "0.58162904", "0.5815634", "0.581101", "0.5810885", "0.581039", "0.5810091", "0.5806533", "0.58047974", "0.5799226", "0.579905", "0.5795915", "0.57947606", "0.57909787", "0.5790519", "0.57890093", "0.57854235", "0.5779301", "0.577855", "0.57773167", "0.57762533", "0.57748455", "0.57748455", "0.57748455", "0.5770152", "0.57680523" ]
0.0
-1
Creates a new HariTidakEfektif model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new HariTidakEfektif(); if ($model->loadAll(Yii::$app->request->post())) { if( $this->checkDate($model->tanggal_awal, $model->tanggal_akhir) ){ if( $this->validDate($model) ){ $model->save(); Yii::$app->session->setFlash('success', "Hari tidak efektif berhasil ditambahkan."); return $this->redirect(['view', 'id' => $model->id_hari_tidak_efektif]); }else{ Yii::$app->session->setFlash('error', "Tanggal akhir tidak boleh lebih kecil dari tanggal awal."); } }else{ Yii::$app->session->setFlash('error', 'Tanggal yang anda input telah tersedia, didata lain.'); } return $this->render('create', [ 'model' => $model, ]); } else { return $this->render('create', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new TaKegiatan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Prog' => $model->Kd_Prog, 'Kd_Keg' => $model->Kd_Keg, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new HasilKonsultasi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_hasil_konsultasi]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new KegiatanSkpd();\n \tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n \treturn $this->redirect(['view', 'tahun' => $model->tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Program' => $model->Kd_Program, 'Kd_Kegiatan' => $model->Kd_Kegiatan]);\n \t} else {\n \t\treturn $this->render('create', [\n \t'model' => $model,\n ]);\n \t}\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new JenisPelayanan();\n\n if ($model->load(Yii::$app->request->post()) && $model->simpan()) {\n return $this->redirect(['view', 'id' => $model->id_halaman]);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=new RJAsuhankeperawatanT;\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['RJAsuhankeperawatanT']))\n {\n \n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=new SAAsuhankeperawatanT;\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['SAAsuhankeperawatanT']))\n {\n \n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $model = new HorarioEstudiante();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new AktaBadan();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->register = $this->generateRegister(\"register\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->id, 'akta_badan_jenis_id' => $model->akta_badan_jenis_id]);\n } else {\n $not = Notaris::find()->where(['id'=>Yii::$app->user->identity->notaris_id])->one();\n $kelurahan = Kelurahan::find()->where(['id'=>$not->kelurahan_id])->one();\n $kecamatan = Kecamatan::find()->where(['id'=>$kelurahan->kecamatan])->one();\n $kabupaten = Kabupaten::find()->where(['id'=>$kecamatan->kabupaten])->one();\n\n //$model->kelurahan_id = $kelurahan->id;\n //$model->kecamatan_id = $kelurahan->kecamatan_id;\n $model->kabupaten_id = $kecamatan->kabupaten_id;\n $model->provinsi_id = $kabupaten->provinsi_id;\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Pelanggaran();\r\n $trans = Yii::$app->db->beginTransaction();\r\n\r\n if ($model->loadAll(Yii::$app->request->post()) && $model->save()) {\r\n $check = $this->checkDetailPoint($model, 'create');\r\n \r\n if( isset($check['failed']) ){\r\n $trans->rollBack();\r\n Yii::$app->session->setFlash('error', $check['failed'] );\r\n return $this->redirect(['index']);\r\n }\r\n\r\n $trans->commit();\r\n Yii::$app->session->setFlash('success','Pelanggaran berhasil ditambahkan.');\r\n return $this->redirect(['index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new SkepPenetapanBcf15();\n //detail yang sudah konek idnya\n $searchModeldet = new \\backend\\modules\\penarikan\\models\\Bcf15Search(['status_bcf15'=>5, 'skep_penetapan_bcf15_id'=>'0']);\n $dataProviderdet = $searchModeldet->search(Yii::$app->request->queryParams);\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'searchModeldet' => $searchModeldet,\n 'dataProviderdet' => $dataProviderdet,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Takwim();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new PPJadwaldokterM;\n $listHari = array( 'Senin'=> 'Senin',\n 'Selasa'=> 'Selasa',\n 'Rabu'=> 'Rabu',\n 'Kamis'=> 'Kamis',\n 'Jumat'=> 'Jumat',\n 'Sabtu'=> 'Sabtu',\n 'Minggu'=> 'Minggu',\n );\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['PPJadwaldokterM']))\n\t\t{\n\t\t\t$model->attributes=$_POST['PPJadwaldokterM'];\n\t\t\t$model->jadwaldokter_buka = $model->jadwaldokter_mulai.' S/d '.$model->jadwaldokter_tutup;\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('admin','id'=>$model->jadwaldokter_id,'sukses'=>1));\n }\n\t\t}\n\n\t\t$this->render($this->path_view.'create',array(\n\t\t\t'model'=>$model,\n 'listHari'=>$listHari\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Skripsi();\n $model->scenario = \"sidang\";\n\n if ($model->load(Yii::$app->request->post())) {\n $skripsi=Yii::$app->request->post('Skripsi');\n $model = $this->findModel($skripsi['id_skripsi']);\n $model->load(Yii::$app->request->post());\n $model->scenario = \"sidang\";\n \n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->detailskripsipengujis = Yii::$app->request->post('Detailskripsipenguji', []);\n $unit = isset($_COOKIE['kodeunit'])?$_COOKIE['kodeunit']:'';\n $model->kode_unit = $unit;\n if ($model->save() && (count($model->detailskripsipengujis) > 0)) {\n $transaction->commit();\n return $this->redirect(['index']);\n }\n } catch (\\Exception $ecx) {\n $transaction->rollBack();\n throw $ecx;\n }\n if (count($model->detailskripsipengujis) == 0) {\n $model->addError('penguji', 'Data Skripsi Harus Memiliki Dosen penguji');\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n \n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Uprawnienia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'konto_id' => $model->konto_id, 'podkategoria_id' => $model->podkategoria_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Talabalar();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n if(!session()->get('id'))\n {\n session()->setFlashdata('message', 'Silahkan login terlebih dahulu!');\n return redirect()->to(base_url('login'));\n }\n\n helper(['form']);\n\n $penghunis = new PenghunisModel();\n\n $data = array(\n 'title' => 'Tambah Data Paket',\n 'penghuni' => $penghunis->findAll(),\n );\n echo view('backend/paket/create', $data);\n }", "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new RKInfoPasienLamaV;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKInfoPasienLamaV']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKInfoPasienLamaV'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pendaftaran_id));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Lahan();\n\n if($model->load(Yii::$app->request->post())){\n $request = Yii::$app->request;\n if(empty($request->post('Lahan')['keldes'])) {\n if(empty($request->post('Lahan')['kec'])) {\n if(empty($request->post('Lahan')['kotakab'])) {\n $model->lokasi_kode = $request->post('Lahan')['provinsi'];\n } else {\n $model->lokasi_kode = $request->post('Lahan')['kotakab'];\n }\n } else {\n $model->lokasi_kode = $request->post('Lahan')['kec'];\n }\n if($model->save(false)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->lokasi_kode = $request->post('Lahan')['keldes'];\n if($model->save(false)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // } else {\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n // }\n }", "public function actionCreate()\n {\n $model = new TaPeriode();\n $pemda = \\common\\models\\TaPemdaUmum::find()->where('ID = (SELECT(MAX(ID)) FROM ta_pemda_umum)')->one();\n $model->ID_Tahun = (\\common\\models\\TaPeriode::find()->select('MAX(ID_Tahun) AS ID_Tahun')->one()['ID_Tahun']) + 1;\n $model->Kd_Prov = $pemda->Kd_Prov;\n $model->Kd_Kab_Kota = $pemda->Kd_Kab_Kota;\n //var_dump($model);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'ID_Tahun' => $model->ID_Tahun, 'Kd_Prov' => $model->Kd_Prov, 'Kd_Kab_Kota' => $model->Kd_Kab_Kota]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n // var_dump(1);\n $request = Yii::$app->request;\n $model['tintuc'] = new TinTuc();\n $model['loaitin']= DmLoaitin::find()->orderBy('ten_loai')->all();\n \n if ($request->isPost && $model['tintuc']->load($request->post()) && $model['tintuc']->validate()) {\n // $model['tintuc']->taikhoan_id= Yii::$app->user->id;\n // dd($model['tintuc']);\n $model['tintuc']->save();\n\n return $this->redirect(['view', 'id' => $model['tintuc']->id_tintuc]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'const' => $this->const,\n 'categories' => $this->getCategories(),\n ]);\n \n }", "public function actionCreate()\n {\n IF($this->cekakses() !== true){\n Yii::$app->getSession()->setFlash('warning', 'Anda tidak memiliki hak akses');\n return $this->redirect(Yii::$app->request->referrer);\n } \n IF(Yii::$app->session->get('tahun'))\n {\n $tahun = Yii::$app->session->get('tahun');\n }ELSE{\n $tahun = DATE('Y');\n }\n\n $model = new Unit();\n\n if ($model->load(Yii::$app->request->post())) {\n IF($model->save()){\n echo 1;\n }ELSE{\n echo 0;\n }\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new DetailKompensasiDanBenefitBulanan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Id_KomBen' => $model->Id_KomBen, 'Id_Karyawan' => $model->Id_Karyawan]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n\n $model = new Baocaokiemtra();\n $nguoinopthue = new Nguoinopthue();\n $quyetdinhkiemtra = new Quyetdinhkiemtra();\n $truongdoankiemtra = new Truongdoankiemtra();\n $lichsunopsaukiemtra = new Lichsunopsaukiemtra();\n $quyetdinhxuly = new Quyetdinhxuly();\n $datevalidation = new DateValidation();\n $lichsunopquyhoanthue = new Lichsunopquyhoanthue();\n\n if ($model->load(Yii::$app->request->post())) {\n $nguoinopthue->load(Yii::$app->request->post());\n $quyetdinhkiemtra->load(Yii::$app->request->post());\n $quyetdinhxuly->load(Yii::$app->request->post());\n $truongdoankiemtra->load(Yii::$app->request->post());\n $lichsunopsaukiemtra->load(Yii::$app->request->post());\n $lichsunopquyhoanthue->load(Yii::$app->request->post());\n $datevalidation->load(Yii::$app->request->post());\n\n if ($truongdoankiemtra->truongDoan) {\n $temp = Truongdoankiemtra::find()->where(['=', 'truongDoan', $truongdoankiemtra->truongDoan])->one();\n if (!$temp) {\n $truongdoankiemtra->save();\n $quyetdinhkiemtra->truongDoanId = $truongdoankiemtra->id;\n } else {\n $quyetdinhkiemtra->truongDoanId = $temp->id;\n }\n }\n\n $quyetdinhkiemtra->ngayQdKiemTra = $this->convertDatetime($datevalidation->ngayQdKiemTra);\n $quyetdinhkiemtra->ngayCongBoQdkt = $this->convertDatetime($datevalidation->ngayCongBoQdkt);\n $quyetdinhkiemtra->ngayTrinhVbTamDungKt = $this->convertDatetime($datevalidation->ngayTrinhVbTamDungKt);\n $quyetdinhkiemtra->ghiChu4 = $quyetdinhkiemtra->nienDoKiemTra;\n $quyetdinhkiemtra->ngayTao = date('Y-m-d 00:00:00', time() + 3600 * 7);\n $quyetdinhkiemtra->save();\n\n if ($datevalidation->soQdxl) {\n $quyetdinhxuly->soQdXuLy = $datevalidation->soQdxl;\n $quyetdinhxuly->ngayQdXuLy = $this->convertDatetime($datevalidation->ngayQdXuLy);\n $quyetdinhxuly->ngayTao = date('Y-m-d 00:00:00', time() + 3600 * 7);\n $quyetdinhxuly->save();\n }\n\n $model->soQdktId = $quyetdinhkiemtra->id;\n $model->soQdXuLyId = $quyetdinhxuly->id;\n\n $model->mst = $nguoinopthue->maSoThue;\n $model->ngayKyBbkt = $this->convertDatetime($datevalidation->ngayKyBbkt);\n\n if ($model->loaiKhuVucId == 0) {\n $model->loaiKhuVucId = null;\n }\n if ($model->loaiNdktId == 0) {\n $model->loaiNdktId = null;\n }\n if ($model->loaiQuyMoId == 0) {\n $model->loaiQuyMoId = null;\n }\n\n $model->save();\n\n $lichsunopsaukiemtra->soQdktId = $model->id;\n $lichsunopsaukiemtra->save();\n\n if ($model->soQdXuLyId) {\n preg_match('/^[0-9]{4}-[0-9]{4}$/', $quyetdinhkiemtra->nienDoKiemTra, $matches);\n\n if (count($matches)) {\n\n $baocaobaohiemxahoi = new Baocaobaohiemxahoi();\n\n $baocaobaohiemxahoi->soQdxlId = $quyetdinhxuly->id;\n $baocaobaohiemxahoi->mst = $nguoinopthue->maSoThue;\n $baocaobaohiemxahoi->truongDoan = $truongdoankiemtra->truongDoan;\n $baocaobaohiemxahoi->save();\n\n $year = explode('-', $quyetdinhkiemtra->nienDoKiemTra);\n\n for ($i = $year[0]; $i <= $year[1]; $i++) {\n $baocaobaohiemxahoitheonam = new Baocaobaohiemxahoitheonam();\n\n $baocaobaohiemxahoitheonam->mst = $nguoinopthue->maSoThue;\n $baocaobaohiemxahoitheonam->soQdxlId = $quyetdinhxuly->id;\n\n $baocaobaohiemxahoitheonam->bhxhId = $baocaobaohiemxahoi->id;\n $baocaobaohiemxahoitheonam->namKtbhxh = $i;\n\n $baocaobaohiemxahoitheonam->ghiChu3 = Nguoinopthue::findOne($nguoinopthue->maSoThue)->maSoThue;\n $baocaobaohiemxahoitheonam->ghiChu4 = $quyetdinhxuly->soQdXuLy;\n\n $baocaobaohiemxahoitheonam->save();\n\n }\n }\n\n }\n\n if ($model->loaiNdktId == 14 || $model->loaiNdktId == 15) {\n\n $sotheodoisauhoanthue = new Sotheodoisauhoanthue();\n\n $sotheodoisauhoanthue->truocHoanSauHoan = $model->loaiNdktId == 14 ? 0 : 1;\n\n $sotheodoisauhoanthue->mst = $model->mst;\n $sotheodoisauhoanthue->soQdKtId = $model->soQdktId;\n\n $quyetdinhxuphat = new Quyetdinhxuphat();\n if ($model->soQdXuLyId) {\n $quyetdinhxuphat->soQdXuPhat = $quyetdinhxuly->soQdXuLy;\n $quyetdinhxuphat->ngayQdXuPhat = $quyetdinhxuly->ngayQdXuLy;\n\n $sotheodoisauhoanthue->soQdXuPhatId = $quyetdinhxuphat->id;\n }\n\n $sotheodoisauhoanthue->chiTietHanhViViPham = $model->hanhViViPham;\n\n $sotheodoisauhoanthue->save();\n\n $lichsunopquyhoanthue = new Lichsunopquyhoanthue();\n $lichsunopquyhoanthue->soTheoDoiId = $sotheodoisauhoanthue->id;\n $lichsunopquyhoanthue->daNopThueThuHoi = $lichsunopsaukiemtra->daNopPhatSinhTruyHoan;\n $lichsunopquyhoanthue->daNopTienPhatViPham = $lichsunopsaukiemtra->daNopTienPhat;\n $lichsunopquyhoanthue->thoiDiemNop = date(\"Y-m-d H:i:s\", time() + 3600 * 7);\n\n $lichsunopquyhoanthue->save();\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'nguoinopthue' => $nguoinopthue,\n 'quyetdinhkiemtra' => $quyetdinhkiemtra,\n 'truongdoankiemtra' => $truongdoankiemtra,\n 'quyetdinhxuly' => $quyetdinhxuly,\n 'lichsunopsaukiemtra' => $lichsunopsaukiemtra,\n 'datevalidation' => $datevalidation\n ]);\n }\n\n }", "public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new MaklumatPelajarPenjaga();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate() {\n $model = new Barang();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->stok = 0;\n\n if ($model->save()) {\n if (Url::previous('b-create')) {\n $var = Url::previous('b-create');\n Yii::$app->session->remove('b-create');\n Yii::$app->getSession()->setFlash(\n 'success', 'Berhasil menambahkan barang : <b>' . $model->nama\n );\n return $this->redirect($var);\n } else {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $model = new Keranjang;\n //list_barang dipakai untuk menampilkan \n //pilihan semua barang pada form\n $list_barang = Barang::all(); //select & barang\n return view('keranjang.create', compact(\n 'model', 'list_barang'\n ));\n }", "public function actionCreate()\n\t{\n\t\t$model=new Barangmasuk;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Barangmasuk']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Barangmasuk'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Aduan();\n $modelAction = new AduanAction();\n\t\t\n if ($model->load(Yii::$app->request->post())) {\n $model->progress_id = 30;\n $model->created_at = new Expression('NOW()'); \n\t\t\t$model->updated_at = new Expression('NOW()'); \n\t\t\t$random = Yii::$app->security->generateRandomString();\n\t\t\t$model->token = $random;\n\t\t\t$code = rand(1000,9999);\n\t\t\t$model->email_code = $code;\n\t\t\tif($model->save()){\n\t\t\t\tYii::$app->session->addFlash('success', \"Aduan telah berjaya dihantar.\");\n\t\t\t\tif(!$model->upload()){\n\t\t\t\t\tYii::$app->session->addFlash('error', \"Fail lampiran gagal dimuatnaik\");\n\t\t\t\t}\n\t\t\t\treturn $this->redirect(['index']);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$model->flashError();\n\t\t\t}\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Peticiones();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Produksi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n { \n $status_kk = status_kk ::all();\n $tpekerjaan = tpekerjaan ::all();\n $tem_bag = tem_bag ::all();\n $nam_tem = nam_tem ::all();\n $keterangan = keterangan ::all();\n $pendidikan = pendidikan ::all();\n $jk =jk::all();\n $title = \"Tambah Data Keluarga\";\n return view('admin.keluarga.inputkeluarga', \n compact ('title', 'jk', 'pendidikan', 'keterangan', 'nam_tem', 'tem_bag', 'tpekerjaan', 'status_kk'));\n }", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new TaSasaran();\n $dataMisi = ArrayHelper::map(TaMisi::findAll(Yii::$app->levelcomponent->PosisiUnit()), 'No_Misi', 'Ur_Misi');\n\n $unit = Yii::$app->levelcomponent->getUnit();\n\n $model->Tahun=2019;\n $model->Kd_Urusan=$unit['Kd_Urusan'];\n $model->Kd_Bidang=$unit['Kd_Bidang'];\n $model->Kd_Unit=$unit['Kd_Unit'];\n $model->Kd_Sub=$unit['Kd_Sub_Unit'];\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub, 'No_Misi' => $model->No_Misi, 'No_Tujuan' => $model->No_Tujuan, 'No_Sasaran' => $model->No_Sasaran]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'dataMisi' => $dataMisi,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new EnfermedadesSintomas([\n 'enfermedad_id' => Yii::$app->request->post('list'),\n 'sintoma_id' => Yii::$app->request->post('item'),\n ]);\n //dd($model->validate());\n if (!$model->save()) {\n throw new \\Exception('No se ha ppodido agregar el sintoma a la enfermedad', 1);\n }\n }", "public function actionCreate($praktek_id)\n {\n $model = new PraktekMahasiswa();\n $model->praktek_id = $praktek_id;\n\n $angkatan = Angkatan::find()->all();\n $angkatan = ArrayHelper::map($angkatan,'id','tahun');\n array_unshift($angkatan,'Semua');\n\n $list_mahasiswa = PraktekMahasiswa::find()->where(['praktek_id'=>$praktek_id])->all();\n $list_mahasiswa = ArrayHelper::map($list_mahasiswa,'mahasiswa_id','mahasiswa_id');\n\n $searchModel = new MahasiswaSearch();\n $queryParams = Yii::$app->request->queryParams;\n if(isset($queryParams['MahasiswaSearch']['angkatan']) && $queryParams['MahasiswaSearch']['angkatan'] == 0)\n unset($queryParams['MahasiswaSearch']['angkatan']);\n $queryParams['MahasiswaSearch']['not_in_mahasiswa_id'] = $list_mahasiswa;\n $dataProvider = $searchModel->search($queryParams);\n if ($model->load(Yii::$app->request->post())){\n // && $model->save()) {\n $post = Yii::$app->request->post();\n foreach($post['mahasiswa'] as $mahasiswa)\n {\n $m = new PraktekMahasiswa;\n $m->praktek_id = $praktek_id;\n $m->mahasiswa_id = $mahasiswa;\n $m->save();\n }\n return $this->redirect(['index', 'PraktekMahasiswaSearch[praktek_id]' => $praktek_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'angkatan' => $angkatan,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Pegawai;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\n\t\tif(isset($_POST['Pegawai']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pegawai'];\n\t\t\t\n\t\t\t$nip = $_POST['Pegawai']['nip'];\n\t\t\t$nama_peg = $_POST['Pegawai']['nama'];\n\t\t\t$alamat = $_POST['Pegawai']['alamat'];\n\t\t\t$ttl = $_POST['Pegawai']['tanggal_lahir'];\n\t\t\t$agama = $_POST['Pegawai']['agama'];\n\n $sql = \"INSERT INTO pegawai(nip, nama, alamat, tanggal_lahir, agama)\n VALUES(:nip,:nama_peg,:alamat,:ttl,:agama)\";\n\n $cmd = Yii::app()->db->createCommand($sql);\n $cmd->bindParam(\":nip\",$nip,PDO::PARAM_INT);\n $cmd->bindParam(\":nama_peg\",$nama_peg,PDO::PARAM_STR);\n $cmd->bindParam(\":alamat\",$alamat,PDO::PARAM_STR);\n $cmd->bindParam(\"ttl\",$ttl,PDO::PARAM_INT);\n $cmd->bindParam(\"agama\",$agama,PDO::PARAM_STR);\n try {\n \t$cmd->execute();\n \t$this->redirect(array('admin'));\n } catch (Exception $e) {\n \tYii:app()->user->setFlash('adaKesalahan',\n \t\t\"Ada Kesalahan :\".\"{$e->getMessage()}\");\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public\n function actionCreate()\n {\n $model = new Phforum();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $anggotakk = AnggotaKKModel::all();\n $kas = DB::table('tb_kas')->where('id_kas', 3)->first();\n return view('fidyah.create', compact('anggotakk', 'kas'));\n }", "public function actionCreate()\n {\n $model = new StoreKasir();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->KASIR_ID]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new EntOficiales();\n $model->uddi = Utils::generateToken();\n $model->fch_creacion = Calendario::getFechaActual();\n $model->txt_rol='oficial';\n $model->b_habilitado=1;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n $model = new TabellePlattform();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n// $this->success = 2; // 2->insert erfolgreich\n \n// $model = $this->findModel($model->id);\n// $model->setIsNewRecord(false);\n \n return $this->redirect(['update','id'=>$model->id,'mySuccess' => 2]);\n// return $this->render('update', [\n// 'model' => $model,\n// ]);\n// $this->redirect(\\Yii::$app->urlManager->createUrl(\"test/show\"));\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Inventorier();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->codebien]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate($faktur_id = '')\n {\n $model = new SalesFakturBarang();\n\n $model->id_faktur = !empty($faktur_id) ? $faktur_id : '';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $stok = SalesStokGudang::find()->where(['id_gudang'=>$model->id_gudang,'id_barang'=>$model->id_barang])->one();\n $stok->jumlah += $model->jumlah;\n $stok->save();\n return $this->redirect(['/sales-faktur/view', 'id' => $model->id_faktur]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new DetailPkl();\n\n $userid = Yii::$app->user->identity->id;\n $mahasiswa = VwmahasiswaProdi::find()\n ->where(['user_id' => $userid])\n ->one();\n\n $listPkl = PengajuanPkl::find()\n ->where(['mhs_id' => $mahasiswa->mhsid])\n ->orderBy(['id' => SORT_DESC])\n ->one();\n\n $mitra = MitraPkl::find()\n ->where(['id' => $listPkl->mitra_id])\n ->one();\n\n if ($model->load(Yii::$app->request->post())) {\n $laporan = UploadedFile::getInstance($model, 'laporan');\n if (!is_null($laporan)) {\n $model->laporan = $laporan->name;\n // $ext = end((explode(\".\", $laporan->name)));\n // generate a unique file name to prevent duplicate filenames\n // $model->image_web_filename = Yii::$app->security->generateRandomString() . \".{$ext}\";\n // the path to save file, you can set an uploadPath\n // in Yii::$app->params (as used in example below) \n Yii::$app->params['uploadPath'] = Yii::$app->basePath . '/web/uploads/file-laporan/';\n $path = Yii::$app->params['uploadPath'] . $model->laporan;\n $laporan->saveAs($path);\n }\n $model->pkl_id = $listPkl->id;\n $model->dosen_id = $listPkl->dosen_id;\n $model->created_at = date('d-M-Y');\n $model->updated_at = date('d-M-Y');\n if ($model->save()) {\n return $this->redirect(['/pkl/detail-pkl']);\n } else {\n var_dump($model->getErrors());\n die();\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'userid' => $userid,\n 'mahasiswa' => $mahasiswa,\n 'listPkl' => $listPkl,\n 'mitra' => $mitra,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Gejala;\n\t\tif(isset($_POST['Gejala']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Gejala'];\n\t\t\t\n\t\t\t$user=User::model()->findByAttributes(array(\n\t\t\t\t'id_user' => Yii::app()->user->id,\n\t\t\t));\n\t\t\t$model->usia=date('Y') - date_format(date_create($user->tanggal_lahir), 'Y');\n\t\t\t$model->jenis_kelamin=$user->jenis_kelamin;\n\t\t\tif($model->save()){\n\t\t\t\t$usia=$model->usia;\n\t\t\t\t$jk=$model->jenis_kelamin;\n\t\t\t\t$tb=$_POST['Gejala']['tinggi_badan'];\n\t\t\t\t$bb=$_POST['Gejala']['berat_badan'];\n\t\t\t\t$aktivitas=$_POST['Gejala']['aktivitas'];\n\t\t\t\t$gula2jam=$_POST['Gejala']['glukosa_2_jam'];\n\t\t\t\t$gulapuasa=$_POST['Gejala']['glukosa_puasa'];\n\t\t\t\t$kolesterol=$_POST['Gejala']['kolesterol'];\n\t\t\t\t$tekanandarah=$_POST['Gejala']['tekanan_darah'];\n\n\t\t\t\t//Hitung\n\t\t\t\t$bbi=90/100*($tb-100);\n\t\t\t\t//\n\t\t\t\tif($jk==1){\n\t\t\t\t\t$kb=$bbi*30;\n\t\t\t\t}else{\n\t\t\t\t\t$kb=$bbi*25;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\t$imt=$bb/($tb/100*$tb/100);\n\t\t\t\t//\n\t\t\t\tif($usia<59){\n\t\t\t\t\t$kusia=(-5/100)*$kb;\n\t\t\t\t}elseif($usia<69){\n\t\t\t\t\t$kusia=(-10/100)*$kb;\n\t\t\t\t}else{\n\t\t\t\t\t$kusia=(-20/100)*$kb;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tif($aktivitas==\"Ringan\"){\n\t\t\t\t\t$kaktiv=(20/100)*$kb;\n\t\t\t\t}elseif($aktivitas==\"Sedang\"){\n\t\t\t\t\t$kaktiv=(40/100)*$kb;\n\t\t\t\t}elseif($aktivitas==\"Berat\"){\n\t\t\t\t\t$kaktiv=(40/100)*$kb;\n\t\t\t\t}elseif($aktivitas==\"Bedrest\"){\n\t\t\t\t\t$kaktiv=(10/100)*$kb;\n\t\t\t\t}else{\n\t\t\t\t\t$kaktiv=0;\n\t\t\t\t}\n\t\t\t\t//\n\t\t\t\tif($imt<18.5){\n\t\t\t\t\t$kimt=(20/100)*$kb;\n\t\t\t\t}elseif($imt>22.9){\n\t\t\t\t\t$kimt=(-20/100)*$kb;\n\t\t\t\t}else{\n\t\t\t\t\t$kimt=0;\n\t\t\t\t}\n\t\t\t\t$kalori=$kb+$kusia+$kaktiv+$kimt;\n\t\t\t\tif($gulapuasa<110 && $gula2jam<140){\n\t\t\t\t\t$dm=0;\n\t\t\t\t}else{\n\t\t\t\t\t$dm=1;\n\t\t\t\t}\n\t\t\t\tif($dm==1){\n\t\t\t\t\tif($kalori<=1200){\n\t\t\t\t\t\t$diet=1100;\n\t\t\t\t\t}elseif($kalori<=1400){\n\t\t\t\t\t\t$diet=1300;\n\t\t\t\t\t}elseif($kalori<=1600){\n\t\t\t\t\t\t$diet=1500;\n\t\t\t\t\t}elseif($kalori<=1800){\n\t\t\t\t\t\t$diet=1700;\n\t\t\t\t\t}elseif($kalori<=2000){\n\t\t\t\t\t\t$diet=1900;\n\t\t\t\t\t}elseif($kalori<=2200){\n\t\t\t\t\t\t$diet=2100;\n\t\t\t\t\t}elseif($kalori<=2400){\n\t\t\t\t\t\t$diet=2300;\n\t\t\t\t\t}elseif($kalori>2400){\n\t\t\t\t\t\t$diet=2500;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$diet=0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//di loop like DM\n\t\t\t$menus = Menu::model()->findAll(array(\"condition\"=>\"dm = $diet\", \"order\"=>\"id_menu\"));\n\t\t\tforeach($menus as $i=>$j){\n\t\t\t\t$riwayat=new Riwayat;\n\t\t\t\t$riwayat->bulan=date('Y-m-01'); //Inputan\n\t\t\t\t$riwayat->id_gejala=$model->id_gejala;\n\t\t\t\t$riwayat->id_menu=$j['id_menu'];\n\t\t\t\t$riwayat->created=date('Y-m-d H:i:s');\n\t\t\t\t$riwayat->save();\n\t\t\t}\n\t\t\t\n\t\t\t$this->redirect(array('view','id'=>$model->id_gejala,'dm'=>$diet));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new RKPengirimanrmT;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKPengirimanrmT']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKPengirimanrmT'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pengirimanrm_id));\n }\n\t\t}\n\n\t\t$this->render($this->path_view.'create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n //\n $karyawan=Pegawai::all();\n $data=Absensi::all();\n return view('Absensi.tambah',compact('data','karyawan'));\n }", "public function actionCreate()\n {\n $model = new Ddiet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $brand=Adminmodel_brand::all();\n $kategori=kategori_model::all();\n\n return view('Dashboard.kontentambah', compact('brand','kategori'));\n }", "public function actionCreate()\n\t{\n\t\t$model=new ConfFa;\n $condicion = new CodicionPago;\n $bodega = new Bodega;\n $categoria = new Categoria;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ConfFa']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ConfFa'];\n if($_POST['ConfFa']['NIVEL_PRECIO'] == '')\n $model->NIVEL_PRECIO = NULL; \n \n if($model->save())\n\t\t\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'condicion'=>$condicion,\n 'categoria'=>$categoria,\n 'bodega'=>$bodega,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new RefJkel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Trivia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new LogPkl();\n\n $userid = Yii::$app->user->identity->id;\n\n $mahasiswa = VwmahasiswaProdi::find()\n ->where(['user_id' => $userid])\n ->one();\n\n $pengajuanPkl = PengajuanPkl::find()\n ->where(['mhs_id' => $mahasiswa->mhsid, 'status_kegiatan' => 5])\n ->one();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->pkl_id = $pengajuanPkl->id;\n $model->dosen_id = $pengajuanPkl->dosen_id;\n $model->tanggal = date('d-M-Y');\n $model->created_at = date('d-M-Y');\n $model->updated_at = date('d-M-Y');\n if($model->ket == 0){\n $model->kegiatan = \"\";\n }\n if ($model->save()) {\n return $this->redirect(['/pkl/log-pkl']);\n }\n }\n\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t\t{\n\t\t\tif (Yii::app()->request->isAjaxRequest) {\n\t\t\t\t$modelTopografi = new Topografi;\n\n\t\t\t\tif ($_POST) {\n\t\t\t\t\t$modelTopografi['datar']=$_POST['datar'];\n\t\t\t\t\t$modelTopografi['bergelombang']=$_POST['bergelombang'];\n\t\t\t\t\t$modelTopografi['curam']=$_POST['curam'];\n\t\t\t\t\t$modelTopografi['sgtcuram']=$_POST['sgtcuram'];\n\t\t\t\t\t$modelTopografi['tinggidpl']=$_POST['tinggidpl'];\n\t\t\t\t\t$modelTopografi->save();\n\t\t\t\t}\n\n\t\t\t\t$this->render('create');\n\t\t\t}\n\t\t}", "public function actionCreate()\n {\n $model = new Kareer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function siak_create(){\n\t\t$this->siak_model->siak_create();\n\t\theader('location: ' . URL . 'siak_predikat_nilai');\n\t}", "public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}", "public function actionCreate()\n {\n $model = new TbDadosmes();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Talleres();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n //$model = new DataPribadi();\n\t\t$datapribadi_model = new DataPribadi();\n\t\t$orangtua_model = new Orangtua();\n\t\t$wilayahMatra_model = new WilayahMatra();\n\t\t$pendidikan_model = new Pendidikan();\n\t\t\n\t\t$no_registrasi = \"REG-\".time();\n\t\t\n\t\t//if ($model->load(Yii::$app->request->post())) {\n\t\tif (Yii::$app->request->isPost) {\n\t\t\t\n\t\t\t$datapribadi_model->surat_keterangan_sehat2 = UploadedFile::getInstance($datapribadi_model, 'surat_keterangan_sehat2');\n\t\t\t$datapribadi_model->ktp2 = UploadedFile::getInstance($datapribadi_model, 'ktp2');\n\t\t\t$datapribadi_model->kk2 = UploadedFile::getInstance($datapribadi_model, 'kk2');\n\t\t\t$datapribadi_model->ijazah_transkrip_nilai2 = UploadedFile::getInstance($datapribadi_model, 'ijazah_transkrip_nilai2');\n\t\t\t$datapribadi_model->skck2 = UploadedFile::getInstance($datapribadi_model, 'skck2');\n\t\t\t$datapribadi_model->foto2 = UploadedFile::getInstance($datapribadi_model, 'foto2');\n\t\t\t\n\t\t\t//var_dump($foto);exit;\n\t\t\t\n\t\t\tif($datapribadi_model->validate()){\n\t\t\t\t$datapribadi_model->no_registrasi=$no_registrasi;\n\t\t\t\t\n\t\t\t\t//var_dump($datapribadi_model->errors);exit;\n\t\t\t\t$datapribadi_model->save();\n\t\t\t\tif(!empty($datapribadi_model->surat_keterangan_sehat2) && !empty($datapribadi_model->ktp2) && !empty($datapribadi_model->kk2) &&\n\t\t\t\t!empty($datapribadi_model->ijazah_transkrip_nilai2) && !empty($datapribadi_model->skck2) && !empty($datapribadi_model->foto2)){\n\t\t\t\t\t\n\t\t\t\t\t$datapribadi_model->surat_keterangan_sehat2->saveAs('uploads/dokumen/1SUKETSHT/' . $no_registrasi.'_SUKETSHT.' . $datapribadi_model->surat_keterangan_sehat2->extension);\n\t\t\t\t\t$datapribadi_model->surat_keterangan_sehat=$no_registrasi.'_SUKETSHT.' . $datapribadi_model->surat_keterangan_sehat2->extension;\n\t\t\t\t\t\n\t\t\t\t\t$datapribadi_model->ktp2->saveAs('uploads/dokumen/2KTP/' . $no_registrasi.'_KTP.' . $datapribadi_model->ktp2->extension);\n\t\t\t\t\t$datapribadi_model->ktp=$no_registrasi.'_KTP.' . $datapribadi_model->ktp2->extension;\n\t\t\t\t\t\n\t\t\t\t\t$datapribadi_model->kk2->saveAs('uploads/dokumen/3KK/' . $no_registrasi.'_KK.' . $datapribadi_model->kk2->extension);\n\t\t\t\t\t$datapribadi_model->kk=$no_registrasi.'_KK.' . $datapribadi_model->kk2->extension;\n\t\t\t\t\t\n\t\t\t\t\t$datapribadi_model->ijazah_transkrip_nilai2->saveAs('uploads/dokumen/4IJAZAH/' . $no_registrasi.'_IJAZAH.' . $datapribadi_model->ijazah_transkrip_nilai2->extension);\n\t\t\t\t\t$datapribadi_model->ijazah_transkrip_nilai=$no_registrasi.'_IJAZAH.' . $datapribadi_model->ijazah_transkrip_nilai2->extension;\n\t\t\t\t\t\n\t\t\t\t\t$datapribadi_model->skck2->saveAs('uploads/dokumen/5SKCK/' . $no_registrasi.'_SKCK.' . $datapribadi_model->skck2->extension);\n\t\t\t\t\t$datapribadi_model->skck=$no_registrasi.'_SKCK.' . $datapribadi_model->skck2->extension;\n\t\t\t\t\t\n\t\t\t\t\t$datapribadi_model->foto2->saveAs('uploads/dokumen/6FOTO/' . $no_registrasi.'_FOTO.' . $datapribadi_model->foto2->extension);\n\t\t\t\t\t$datapribadi_model->foto=$no_registrasi.'_FOTO.' . $datapribadi_model->foto2->extension;\n\t\t\t\t\t\n\t\t\t\t\t$datapribadi_model->save(FALSE);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\tvar_dump($datapribadi_model->errors);exit;\n\t\t\t\treturn $this->redirect(['view', 'id' => $no_registrasi]);\n }else{\n\t\t\t$title = 'Pendaftaran Komponen Cadangan';\n\t\t\t\n\t\t\treturn $this->render('create', [\n\t\t\t\t'title' => $title,\n\t\t\t\t'datapribadi_model' => $datapribadi_model,\n\t\t\t\t'orangtua_model' => $orangtua_model,\n\t\t\t\t'wilayahMatra_model' => $wilayahMatra_model,\n\t\t\t\t'pendidikan_model' => $pendidikan_model,\n\t\t\t]);\n\t\t}\n }", "public function create()\n {\n return view('backend.kegiatan.create');\n }", "public function create()\n {\n $kategori = KategoriSampah::select('id', 'jenis_sampah')->get();\n $kota = Kota::all();\n $kecamatan = Kecamatan::all();\n $desa = Desa::all();\n return view('backend.warga.tambah', compact('kategori', \n 'kota', 'kecamatan', 'desa'));\n }", "public function create()\n {\n return view('admin.kegiatan.create');\n }", "public function create()\n {\n //\n $getKategori = MasterKategori::where('flag_utama','=' ,'article')->get();\n return view('backend.article.tambah', compact('getKategori'));\n }", "public function actionCreate()\n {\n $model = new Planilla_entrega();\n $model->scenario = 'create';\n if ($model->load(Yii::$app->request->post())) {\n \n if ($model->validate() ){ \n \n \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n //Se guarda encabezado de la PLanilla\n $model->PE_PROCESADO = 0;\n if ($model->save()){\n $this->guardar_renglones($model);\n \n }else{\n $mensaje = \"\"; \n foreach ($model->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n\n $this->verificar_pedido_completo($model->PE_NUMVALE);\n\n $transaction->commit();\n Yii::$app->getSession()->setFlash('exito_deposito_central', 'Planilla de entrega creada con éxito.');\n return $this->redirect(['view', 'id' => $model->PE_NROREM]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n \n Yii::$app->getSession()->setFlash('error_deposito_central', $e->getMessage());\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Penulis();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n\t\t$idInstitucion = $_SESSION['instituciones'][0];\n $model = new InfraestructuraEducativa();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\t\n\t\t$sedes = $this->obtenerSedes($idInstitucion);\n\t\t$estados = $this->obtenerEstados();\n\t\t\n return $this->render('create', [\n 'model' => $model,\n\t\t\t'sedes'=> $sedes,\n\t\t\t'estados'=>$estados,\n\t\t\t'idInstitucion'=>$idInstitucion,\n ]);\n }", "function create(){\n\n \t$this->load->view('Kesma/VFormbenang');\n\n }", "public function create()\n {\n // Jika session data username tidak ada maka akan dialihkan kehalaman login\n if (!isset($this->session->userdata['username'])) {\n redirect(base_url(\"login\"));\n }\n\n // Menampilkan data berdasarkan id-nya yaitu username\n $row = $this->UserModel->get_by_id($this->session->userdata['username']);\n $dataAdm = array(\n 'wa' => 'Web administrator',\n 'univ' => 'SMA Negeri 1 Bandung',\n 'username' => $row->username,\n 'email' => $row->email,\n 'level' => $row->level,\n );\n\n // Menampung data yang diinputkan\n $data = array(\n 'button' => 'Create',\n 'back' => site_url('merk'),\n 'action' => site_url('merk/create_action'),\n \n 'kodemerk' => set_value('kodemerk'),\n 'namamerk' => set_value('namamerk'),\n );\n $this->load->view('header', $dataAdm); // Menampilkan bagian header dan object data users\n $this->load->view('merk/merk_form', $data); // Menampilkan form merk\n $this->load->view('footer'); // Menampilkan bagian footer\n }", "public function actionCreate()\r\n {\r\n $model = new Tax;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'added' => 'yes']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function create()\n {\n //\n $count = NhapDiemGiuaKy::count();\n if($count == 0) $idCurrent = 'ND00';\n \n else $idCurrent = NhapDiemGiuaKy::max('MaND'); \n $array_id = explode('D',$idCurrent);\n $array_id[0] .= \"D\";\n $array_id[1] = intval($array_id[1]) + 1;\n if($array_id[1] < 10) {\n $array_id[1] = \"0\" . $array_id[1];\n }\n $data['text_id'] = implode('', $array_id);\n $data['khoi'] = Khoi::orderBy('TenKhoi', 'asc')->get();\n $data['monhoc'] = MonHoc::orderBy('TenMH', 'asc')->get();\n return view('admin.chophepnhapdiem.create', $data);\n }", "public function create()\n {\n //untuk tambah data\n $data_kategori = KategoriProduk::all();\n return view('produk.create', compact('data_kategori'));\n }", "public function actionCreate() {\n $model = new NubeFactura;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['NubeFactura'])) {\n $model->attributes = $_POST['NubeFactura'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->IdFactura));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "function create()\n\t{\n\t\t//simpan data yang diperoleh kedalam database\n\t\t//berikan response data tunggal yang berisi data terakhir yang tersimpan\n\t\tif($this->input->post('submit')){\n \t\tif($this->data_siswa->validation(\"save\")){ \n \t$this->data_siswa->save();\n \t\tredirect('siswa');\n \t\t}\n \t}\n \t$this->load->view('siswa/form_create');\n\t}", "public function create()\n {\n $kelurahan = kelurahan::all();\n $kecamatan = kecamatan::all();\n return view('keloladatapenyakit.tambahdatapenyakit', compact('kelurahan', 'kecamatan'));\n\n }", "public function actionCreate()\n {\n $model = new EnglishNanorep();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n $fk = Fakultas::all();\n return view('JurusanView.jurusan-create', compact('fk'));\n }", "public function actionCreate()\n {\n if(\\Yii::$app->user->can('gerenciamento-cadastros-basicos')){\n $model = new Pessoa();\n $alerta = \"Pessoa já cadastrada\";\n \n \n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $validacpf = Pessoa::find()->where(['cpf' => $model->cpf])->one();\n if($validacpf == true){\n return $this->redirect(['create',\n 'model' => $model, 'alerta' => $alerta\n ]);\n }else{\n\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n }else{\n return $this->render('create', [\n 'model' => $model, \n ]);\n }\n }else {\n throw new \\yii\\web\\ForbiddenHttpException('Você não está autorizado a realizar essa ação.');\n }\n \n }", "public function actionCreate()\n {\n $model = new DrugTuri();\n\n if ($model->load(Uni::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_DrugTuri]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new TfLunas();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_tf_lunas]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model = new Classes;\n\t\tif(isset($_POST['Classes'])) {\n\t\t\t$model->attributes = $_POST['Classes'];\n\t\t\t$model->formTags = isset($_POST['Classes']['formTags']) ? explode(',', $_POST['Classes']['formTags']) : null;\n\t\t\t$model->teachers = isset($_POST['Classes']['teachers']) ? $_POST['Classes']['teachers']: null;\n\t\t\t$model->classDays = isset($_POST['Classes']['classDays']) ? explode(',', $_POST['Classes']['classDays']) : null;\n\t\t\t$model->price = isset($_POST['Classes']['price']) ? $_POST['Classes']['price'] : 0;\n\t\t\t$model->teacher_id = 0;\n\n\t\t\tif($model->save()) {\n\t\t\t\tYii::app()->user->setFlash('success', '<span class=\"icon-check\"></span>&nbsp;&nbsp;اطلاعات با موفقیت ذخیره شد.');\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t} else\n\t\t\t\tYii::app()->user->setFlash('failed', 'در ثبت اطلاعات خطایی رخ داده است! لطفا مجددا تلاش کنید.');\n\t\t}\n\n\t\t$this->render('create', array(\n\t\t\t\t'model' => $model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Penilaian();\n\n $data_pegawai_exist = $model->find()->select(['id_pegawai'])->column();\n $pegawais = Pegawai::find()->where(['NOT IN', 'id_pegawai', $data_pegawai_exist])->all();\n $kriteria = Kriteria::find()->all();\n $data_pegawai = [];\n\n foreach ($pegawais as $key => $pegawai) {\n $data_pegawai[$pegawai->id_pegawai] = $pegawai->nip . ' | ' . $pegawai->nama_pegawai;\n }\n\n $post_data = Yii::$app->request->post();\n if (!empty($post_data)) {\n $model->load($post_data);\n\n if (!empty($post_data['Penilaian']['penilaian'])) {\n $model->penilaian = json_encode($post_data['Penilaian']['penilaian']); \n }\n\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'data_pegawai' => $data_pegawai,\n 'kriteria' => $kriteria,\n ]);\n }", "public function actionCreate()\n {\n $model = new Devolucion_salas_granel();\n $model->scenario = \"create_sobrante\";\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->validate() ){ \n $model->DE_SOBRAN = 1;\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n \n //Se guarda encabezado Devolucion\n if ($model->save()){\n $this->guardar_renglones($model);\n }\n\n $this->generarPdf($model->DE_NRODEVOL);\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n \n }\n else{\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n \n } else {\n $model->DE_FECHA = date('Y-m-d');\n $model->DE_HORA = date('H:i:s');\n $model->DE_CODOPE = Yii::$app->user->identity->LE_NUMLEGA; //El usuario logueado\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->enableCsrfValidation = false;\n $model = new FoodForm();\n //定义场景\n $model->setScenario(FoodForm::SCENARIOS_CREATE);\n if ($model->load(Yii::$app->request->post()) && $model->validate()) \n {\n if(!$model->create())\n\t\t\t{\n\t\t\t\tYii::$app->session->setFlash('warning', $model->_lastError);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $this->redirect(['food/view', 'id' => $model->id]);\n\t\t\t}\n }\n return $this->render('create', ['model' => $model]);\n }", "public function actionNew()\n {\n $model = new Pekerjaan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success','Berhasil Menambahkan Pekerjaan Baru');\n return $this->redirect(['/admin/user/index']);\n }\n\n return $this->render('form', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$this->layout='//layouts/column2';\n\t\t$model=new RekruitmenMaba;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['RekruitmenMaba']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RekruitmenMaba'];\n\t\t\tif($model->save()){\n\t\t\t\tif($model->lampiran){\n\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_rmaba));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'manajemen'=>'manajemen',\n\t\t));\n\t}", "public function create()\n {\n $kecamatan = Kecamatan::all();\n return view('admin.kelurahan.create', compact('kecamatan'));\n }", "public function actionCreate()\n\t{\n\t\t$model=new Indicadores;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Indicadores']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Indicadores'];\n\t\t\tif($model->save()){\n\t\t\t\tYii::app()->user->setFlash(\"success\",\"EL indicador de ha guardado de manera correcta\");\n\t\t\t\t// agregar valores segun los periodos existentes\n\t\t\t\t$this->nuevosValores($model->id);\n\n\t\t\t\t$this->redirect(array('index','id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n\t{\n\t \n\t \n\t return view('admin.khachhang.create');\n\t}", "public function actionCreate()\n {\n $model = new Kamar();\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->kamar_id]);\n // }\n if ($model->load(Yii::$app->request->post())) {\n $model->created_by = Yii::$app->user->identity->username;\n\t\t $model->created_date = date(\"Y-m-d\");\n\n $model->save();\n \n if ($model->validate()) {\n if (UploadedFile::getInstances($model, 'filesaver') != null) {\n $names = UploadedFile::getInstances($model, 'filesaver');\n $kamar = $model->kamar_id;\n $creator_name = Yii::$app->user->identity->username;\n $creator_date = date(\"Y-m-d\");\n $status = 'Aktif';\n foreach ($names as $name) {\n $timestamp = time();\n $path = Yii::$app->basePath . '/web/foto_kamar/' .$name->baseName.'_'.$timestamp.'.'.$name->extension;\n if ($name->saveAs($path)) {\n $nama_foto = $name->baseName.'_'.$timestamp.'.'.$name->extension;\n $file = '/foto_kamar/' .$name->baseName.'_'.$timestamp.'.'.$name->extension;\n Yii::$app->db->createCommand()->insert('foto_kamar', ['foto_id_kamar' => $kamar, 'foto_kamar' => $nama_foto, 'created_by' => $creator_name, 'created_date' => $creator_date, 'file' => $file, 'status' => $status])->execute();\n }\n }\n }\n }else{\n return $model->getErrors();\n }\n Yii::$app->session->setFlash('success', 'Data berhasil ditambah.');\n return $this->redirect(['view', 'id' => $model->kamar_id]);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate($id_kategori=null, $id_penulis=null, $id_penerbit=null)\n {\n $model = new Buku();\n $model->id_kategori = $id_kategori;\n $model->id_penulis = $id_penulis;\n $model->id_penerbit = $id_penerbit;\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $sampul = UploadedFile::getInstance($model, 'sampul');\n $berkas = UploadedFile::getInstance($model, 'berkas');\n\n $model->sampul = time() . '_' . $sampul->name;\n $model->berkas = time() . '_' . $berkas->name;\n\n $model->save(false);\n\n $sampul->saveAs(Yii::$app->basePath.'/web/upload/sampul/' . $model->sampul);\n $berkas->saveAs(Yii::$app->basePath.'/web/upload/berkas/' . $model->berkas);\n\n\n\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n //\n return view('admin.diamond.sertifikasi.create');\n }", "public function actionCreate()\n {\n $model = new TabContato();\n\n\t\t$this->titulo = 'Incluir Contato';\n\t\t$this->subTitulo = '';\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'update' );\n\t\t\t\n return $this->redirect(['view', 'id' => $model->cod_contato]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Ocorrencia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$this->updateOcorrenciaQueixa($_POST['Ocorrencia']['idQueixas'], $model->id);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }" ]
[ "0.7768468", "0.7561494", "0.74219865", "0.7332276", "0.72359896", "0.7234877", "0.72175694", "0.7180778", "0.7092869", "0.7074271", "0.7072099", "0.70652896", "0.70625997", "0.7061233", "0.70147824", "0.70072204", "0.69908154", "0.69884586", "0.6911177", "0.6906506", "0.68804324", "0.6879636", "0.6879259", "0.68682444", "0.68666273", "0.68326104", "0.68185866", "0.67924166", "0.6784249", "0.67645687", "0.6762962", "0.675038", "0.6733209", "0.67173517", "0.6717127", "0.6695085", "0.66938007", "0.6665736", "0.66479325", "0.6646308", "0.66401047", "0.6638686", "0.6628018", "0.6623813", "0.66087765", "0.66034645", "0.66010106", "0.659319", "0.658458", "0.6572107", "0.6570013", "0.65605944", "0.6552618", "0.6532785", "0.6520122", "0.6516705", "0.6509262", "0.6505379", "0.65033597", "0.65022486", "0.64980644", "0.6494575", "0.6493653", "0.64934015", "0.6487458", "0.6480058", "0.64761114", "0.6474229", "0.64732677", "0.64731526", "0.64726603", "0.6467671", "0.6459123", "0.644197", "0.6441188", "0.64406186", "0.6440617", "0.6438802", "0.6424097", "0.64201516", "0.64166623", "0.64160436", "0.6415481", "0.6408229", "0.64060503", "0.64048666", "0.64041466", "0.64015865", "0.63995874", "0.63973236", "0.638961", "0.63895386", "0.6386903", "0.63856125", "0.6383866", "0.63826066", "0.6378855", "0.6377839", "0.63731736", "0.6369957" ]
0.8092022
0
Updates an existing HariTidakEfektif model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel($id); if ($model->loadAll(Yii::$app->request->post())) { if( $this->validDate($model) ){ $model->save(); Yii::$app->session->setFlash('success', "Hari tidak efektif berhasil diubah."); return $this->redirect(['view', 'id' => $model->id_hari_tidak_efektif]); }else{ Yii::$app->session->setFlash('error', "Tanggal akhir tidak boleh lebih kecil dari tanggal awal."); return $this->render('update', [ 'model' => $model, ]); } } else { return $this->render('update', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['GZTerimabahanmakan']))\n\t\t{\n\t\t\t$model->attributes=$_POST['GZTerimabahanmakan'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->terimabahanmakan_id));\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['RJAsuhankeperawatanT']))\n {\n $model->attributes=$_POST['RJAsuhankeperawatanT'];\n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n }", "public function actionUpdate($id)\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['SAAsuhankeperawatanT']))\n {\n $model->attributes=$_POST['SAAsuhankeperawatanT'];\n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n }", "public function actionUpdate($id)\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=$this->loadModel($id);\n $listHari = array( 'Senin'=> 'Senin',\n 'Selasa'=> 'Selasa',\n 'Rabu'=> 'Rabu',\n 'Kamis'=> 'Kamis',\n 'Jumat'=> 'Jumat',\n 'Sabtu'=> 'Sabtu',\n 'Minggu'=> 'Minggu',\n );\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['PPJadwaldokterM']))\n\t\t{\n\t\t\t$model->attributes=$_POST['PPJadwaldokterM'];\n $model->jadwaldokter_buka = $model->jadwaldokter_mulai.' S/d '.$model->jadwaldokter_tutup;\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('admin','id'=>$model->jadwaldokter_id,'sukses'=>1));\n }\n\t\t}\n\n\t\t$this->render($this->path_view.'update',array(\n\t\t\t'model'=>$model,\n 'listHari'=>$listHari\n\t\t));\n\t}", "public function update() {\n\t\t$id = $this->input->post('idUpdate');\n\t\t$data = $this->input->post();\n\t\t$update['nama'] = $data['nama_kategoriUpdate'];\n\t\tif ($this->kategori_m->update($id, $update)) {\n\t\t\t$this->message('Berhasil! Data berhasil di update', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n\t\t} else {\n\t\t\t$this->message('Gagal! Data gagal di update', 'danger');\n\t\t}\n\t\tredirect('kategori');\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $userid = Yii::$app->user->identity->id;\n $mahasiswa = VwmahasiswaProdi::find()\n ->where(['user_id' => $userid])\n ->one();\n\n if(Roles::currentRole($userid) == Roles::MHS){\n $listPkl = PengajuanPkl::find()\n ->where(['mhs_id' => $mahasiswa->mhsid])\n ->orderBy(['id' => SORT_DESC])\n ->one();\n $mitra = MitraPkl::find()\n ->where(['id' => $listPkl->mitra_id])\n ->one();\n }else{\n $mitra=NULL;\n }\n\n\n if ($model->load(Yii::$app->request->post())) {\n $laporan = UploadedFile::getInstance($model, 'laporan');\n if (!is_null($laporan)) {\n $model->laporan = $laporan->name;\n // $ext = end((explode(\".\", $laporan->name)));\n // generate a unique file name to prevent duplicate filenames\n // $model->image_web_filename = Yii::$app->security->generateRandomString() . \".{$ext}\";\n // the path to save file, you can set an uploadPath\n // in Yii::$app->params (as used in example below) \n Yii::$app->params['uploadPath'] = Yii::$app->basePath . '/web/uploads/file-laporan/';\n $path = Yii::$app->params['uploadPath'] . $model->laporan;\n $laporan->saveAs($path);\n }\n if ($model->nilai_dosen != \"\" || $model->nilai_dosen != \"\") {\n $model->nilai_akhir = ($model->nilai_dosen + $model->nilai_mentor) / 2;\n }else{\n $model->nilai_akhir = null;\n $model->nilai_dosen = null;\n $model->nilai_mentor = null;\n }\n $model->updated_at = date('d-M-Y');\n if ($model->save()) {\n return $this->redirect(['/pkl/detail-pkl']);\n } else {\n var_dump($model->getErrors());\n die();\n }\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'userid' => $userid,\n 'mitra' => $mitra\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Diubah');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Diubah');\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_hasil_konsultasi]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKInfoPasienLamaV']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKInfoPasienLamaV'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pendaftaran_id));\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n\t\t $model = $this->findModel($id);\n\t\t \n\t\t Yii::$app->view->title = Yii::t('app', 'Update {modelClass}: ', [\n 'modelClass' => 'Invt Check',\n]) . $model->id.' - '.Yii::t('app', Yii::$app->controller->module->params['title']);\n\t\t \n if ($model->load(Yii::$app->request->post())) {\n\t\t\tif($model->save()){\n AdzpireComponent::succalert('edtflsh', 'ปรับปรุงรายการเรียบร้อย');\n\t\t\t return $this->redirect(['view', 'id' => $model->id]);\n\t\t\t}else{\n AdzpireComponent::dangalert('edtflsh', 'ปรับปรุงรายการไม่ได้');\n\t\t\t}\n return $this->redirect(['view', 'id' => $model->id]);\n } \n\n return $this->render('update', [\n 'model' => $model,\n ]);\n \n\n }", "public function update($id){\n if($this->input->post('submit')){\n $this->m_sekolah->update($id);\n\n redirect('Welcome/index');\n }\n $data['sekolah'] = $this->m_sekolah->getById($id)[0];\n $data['id'] = $id;\n $this->load->view('up_sekolah',$data);\n }", "public function actionUpdate($id)\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKPengirimanrmT']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKPengirimanrmT'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pengirimanrm_id));\n }\n\t\t}\n\n\t\t$this->render($this->path_view.'update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update()\n {\n $where = array('id_isi_paket' => $this->input->post('id_isi_paket'));\n // menentukan siapa dan kapan baris data ini diperbarui\n $updated_by = \"admin\";\n $updated_at = date('Y-m-d H:i:s');\n \n\n $data = array(\n 'id_isi_paket' => $this->input->post('id_isi_paket'),\n 'nama_isi_paket' => $this->input->post('nama_isi_paket'),\n 'keterangan' => $this->input->post('keterangan', true),\n 'status' => $this->input->post('status'),\n 'updated_by' => $updated_by,\n 'updated_at' => $updated_at\n );\n \n\n // menjalankan method update pada model isi paket\n $this->M_isipaket->update($where, $data, 'isi_paket');\n\n // mengirim pesan berhasil update data\n $this->session->set_flashdata('pesan', '\n <div class=\"alert alert-success alert-dismissible fade show\" role=\"alert\">\n Anda <strong>berhasil</strong> mengubah data.\n <button type=\"button\" class=\"close py-auto\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n ');\n // mengarahkan ke halaman tabel isi paket\n redirect('admin/C_isipaket');\n }", "public function update()\n\t{\n\t\t$redirect =\"\";\n\t\t$uri3=$this->input->post('uri3');\n\t\t$uri4=$this->input->post('uri4');\n\t\tif($this->input->post('saveOnly'))\n\t\t{\n\t\t\t$redirect=\"kelompokprakerin/edit/\".$uri3.\"/\".$uri4;\n\t\t}else\n\t\t{\n\t\t\t$redirect=\"kelompokprakerin\";\n\t\t}\n\t\t$data = array(\n\t\t\t'kelompokprakerin_id'\t\t\t=>$this->input->post('kelompokprakerin_id'),\n\t\t\t'nama_kelompokprakerin'\t\t=>$this->input->post('nama_kelompokprakerin'),\n\t\t\t'pimpinan_kelompokprakerin'\t=>$this->input->post('pimpinan_kelompokprakerin'),\n\t\t\t'jenis_kelompokprakerin_id'\t=>$this->input->post('jenis_kelompokprakerin_id'),\n\t\t\t'alamat_kelompokprakerin'\t\t=>$this->input->post('alamat_kelompokprakerin'),\n\t\t\t'no_tlp'\t\t\t\t=>$this->input->post('no_tlp'),\n\t\t);\n\t\t$kelompokprakerin_id= $this->input->post('kelompokprakerin_id');\n\t\t\t$this->primary_model->updateData('kelompokprakerin_id',$kelompokprakerin_id,'tb_kelompokprakerin',$data);\n\t\t\tredirect($redirect);\n\t\t\n\t\n\t}", "public function actionUpdate($id)\n {\n \n $request = Yii::$app->request; \n $model['tintuc'] = $this->findModel($id);\n \n $model['loaitin']=DmLoaitin::find()->orderBy('ten_loai')->all();\n if ($request->isPost && $model['tintuc']->load($request->post()) && $model['tintuc']->validate()) {\n // $model['tintuc']->taikhoan_id= Yii::$app->user->id;\n $model['tintuc']->save();\n return $this->redirect(['view', 'id' => $model['tintuc']->id_tintuc]);\n }\n return $this->render('update', [\n 'model' => $model,\n 'const' => $this->const,\n 'categories' => $this->getCategories()\n ]);\n \n }", "function update()\n {\n $nim = $this->input->post('nim');\n $nama = $this->input->post('nama');\n $kota = $this->input->post('kota');\n $this->siswa_model->update($nim, $nama, $kota);\n redirect('siswa/page');\n }", "public function actionUpdate($id)\n {\n// $model = $this->findModel($id);\n//\n// if ($model->load(Yii::$app->request->post())) {\n// $model->nguoi_cap_nhat=Yii::$app->user->id;\n// $model->ngay_cap_nhat=date(\"Y-m-d\");\n// if($model->save()){\n// Yii::$app->session->setFlash('success','Cập nhật thông tin nhóm sản phẩm thành công.');\n// return $this->redirect(['view', 'id' => $model->id]);\n// } else {\n// Yii::$app->session->setFlash('error','Cập nhật thông tin nhóm sản phẩm thất bại');\n// return $this->render('update',['model'=>$model]);\n// }\n// }\n $model = $this->findModel($id);\n $anhCu=$model->anh_dai_dien;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->nguoi_cap_nhat=Yii::$app->user->id;\n $model->ngay_cap_nhat=date(\"Y-m-d\");\n\n $fileUpload=UploadedFile::getInstance($model,'anh_dai_dien');\n if(!is_null($fileUpload)){\n $fileTam=$fileUpload->name;\n Yii::$app->params['uploadPath']=Yii::$app->basePath .'/web/images/san-pham/';\n $path=Yii::$app->params['uploadPath'].$fileTam;\n $model->anh_dai_dien=$fileTam;\n $fileUpload->saveAs($path);\n\n } else {\n $model->anh_dai_dien=$anhCu;\n }\n if($model->save()){\n Yii::$app->session->setFlash('success','Cập nhật thông tin nhóm sản phẩm thành công.');\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n Yii::$app->session->setFlash('error','Cập nhật thông tin nhóm sản phẩm thất bại');\n return $this->render('update',['model'=>$model]);\n }\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if($model->load(Yii::$app->request->post())){\n $request = Yii::$app->request;\n if(empty($request->post('Lahan')['keldes'])) {\n if(empty($request->post('Lahan')['kec'])) {\n if(empty($request->post('Lahan')['kotakab'])) {\n $model->lokasi_kode = $request->post('Lahan')['provinsi'];\n } else {\n $model->lokasi_kode = $request->post('Lahan')['kotakab'];\n }\n } else {\n $model->lokasi_kode = $request->post('Lahan')['kec'];\n }\n if($model->save(false)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->lokasi_kode = $request->post('Lahan')['keldes'];\n if($model->save(false)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // } else {\n // return $this->render('update', [\n // 'model' => $model,\n // ]);\n // }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $sekolah= DmSekolah::find()->all();\n if($sekolah==NULL){\n $sek=[NULL=>'belum ada sekolah diinputkan'];\n }\n else{\n foreach ($sekolah as $key=> $item){\n $sek[$item->uid_dm_sekolah]=$item->nama;\n }\n }\n //get sekolah selected\n $tahunAjaran = TahunAjaran::findOne(['status'=>1]);\n $sekolah= RelasiKelasSiswa::findOne(['uid_data_siswa'=> $model->uid_siswa, 'uid_tahun_ajaran'=>$tahunAjaran->uid_thn_ajaran]);\n $model->sekolah= $sekolah->uidKelas->uid_sekolah;\n //get kelas from schooluid\n $kelas= Kelas::find()->where(['uid_sekolah'=>$sekolah->uidKelas->uid_sekolah])->all();\n if($kelas!=NULL){\n foreach ($kelas as $key=> $item){\n $kel[$item->uid_kelas]= $item->nama_kelas;\n }\n }\n else{\n $kel[NULL]='--tidak ada data kelas di inputkan--';\n }\n $model->kelas= $sekolah->uid_kelas;\n\n $kls_lama= $model->kelas;\n if ($model->load(Yii::$app->request->post())) {\n //if edit kelas\n if($kls_lama!= $model->kelas){\n $sekolah->uid_kelas= $model->kelas;\n $sekolah->save();\n }\n //jika update foto\n if($model->help_foto=UploadedFile::getInstance($model, 'help_foto')){\n $uploadGDrive=new GDriveSetting();\n $tempPath = $model->help_foto->tempName;\n $type= $model->help_foto->type;\n $folder= Yii::$app->params['googleDrive']['folder']['general'];\n $id= $uploadGDrive->uploadGDrive($model->uid_siswa, $tempPath, $type, $folder, 'public');\n $model->gdrive_pasfoto_siswa=$id;\n }\n if($model->save()){\n return $this->redirect(['view', 'id' => $model->uid_siswa]);\n }\n else{\n\n }\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'sekolah'=> $sek,\n 'kelas'=> $kel,\n ]);\n }\n }", "public function update()\n {\n if (!$_POST || $this->input->post('qty_barang_keluar') < 1) {\n $this->session->set_flashdata('error', 'Kuantitas tidak boleh kosong');\n redirect(base_url('cartout'));\n }\n\n $id = $this->input->post('id');\n $id_barang = $this->input->post('id_barang');\n\n // Mengambil data dari keranjang\n $data['content'] = $this->cartout->where('id_barang', $id_barang)\n ->where('id', $id)\n ->first();\n\n if (!$data['content']) {\n $this->session->set_flashdata('warning', 'Data tidak ditemukan');\n redirect(base_url('cartout'));\n }\n\n $data['input'] = (object) $this->input->post(null, true);\n\n // Update kuantitas\n $cart = ['qty' => $data['input']->qty_barang_keluar];\n\n if ($this->cartout->where('id', $id)\n ->where('id_barang', $id_barang)\n ->where('id_user', $this->id_user)\n ->update($cart)\n ) {\n // Jika update berhasil\n $this->session->set_flashdata('success', 'Kuantitas berhasil diubah');\n } else {\n $this->session->set_flashdata('error', 'Oops! Terjadi kesalahan');\n }\n\n redirect(base_url('cartout'));\n }", "public function actionUpdate($Kd_Urusan, $Kd_Bidang, $Kd_Unit)\n {\n IF($this->cekakses() !== true){\n Yii::$app->getSession()->setFlash('warning', 'Anda tidak memiliki hak akses');\n return $this->redirect(Yii::$app->request->referrer);\n } \n IF(Yii::$app->session->get('tahun'))\n {\n $tahun = Yii::$app->session->get('tahun');\n }ELSE{\n $tahun = DATE('Y');\n }\n\n $model = $this->findModel($Kd_Urusan, $Kd_Bidang, $Kd_Unit);\n\n if ($model->load(Yii::$app->request->post())) {\n IF($model->save()){\n echo 1;\n }ELSE{\n echo 0;\n }\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n 'data' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n // $model->ReClave=$model->Clave;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->idUsuario]);\n }\n\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if (!empty($model->idJurusanKaryawan)) {\n $model->jurusan = $model->idJurusanKaryawan->id_jurusan;\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Data Karyawan '.$model->nama.' Berhasil Diperbaharui');\n return $this->redirect(['index']);\n } else {\n $model->id_provinsi = $model->idKelurahan->kecamatan->kabupaten->provinsi_id;\n $model->id_kabupaten = $model->idKelurahan->kecamatan->kabupaten_id;\n $model->id_kecamatan = $model->idKelurahan->kecamatan_id;\n $listBidang = ArrayHelper::map($this->getAllBidang(), 'id', 'bidang');\n $listTempatLahir = ArrayHelper::map(TKabupaten::ambilKabupaten(), 'id', 'nama');\n $listPendidikan = ArrayHelper::map($this->getAllPendidikan(), 'id', 'pendidikan_akhir');\n $listJurusan = ArrayHelper::map(TJurusan::find()->asArray()->all(), 'id', 'jurusan');\n\n $listProvinsi = ArrayHelper::map(TProvinsi::ambilSemuaProvinsi(), 'id', 'nama');\n $listKabupaten = ArrayHelper::map(TKabupaten::ambilKabupaten(['provinsi_id'=>$model->id_provinsi]), 'id', 'nama');\n $listKecamatan = ArrayHelper::map(TKecamatan::ambilKecamatan(['kabupaten_id'=>$model->id_kabupaten]), 'id', 'nama');\n $listKelurahan = ArrayHelper::map(TKelurahan::ambilKelurahan(['kecamatan_id'=>$model->id_kecamatan]), 'id', 'nama');\n \n return $this->render('update', [\n 'model' => $model,\n 'listBidang' => $listBidang,\n 'listTempatLahir' => $listTempatLahir,\n 'listPendidikan' => $listPendidikan,\n 'listJurusan' => $listJurusan,\n 'listProvinsi' => $listProvinsi,\n 'listKabupaten' => $listKabupaten,\n 'listKecamatan' => $listKecamatan,\n 'listKelurahan' => $listKelurahan,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t//if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=$this->loadModel($id);\n\t\t// Uncomment the following line if AJAX validation is needed\t\n\n\t\tif(isset($_POST['PPDokrekammedisM']))\n\t\t{\n\t\t\t$model->attributes=$_POST['PPDokrekammedisM'];\n\t\t\tif($model->save()){\n\t\t\t\tYii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('admin','id'=>$model->dokrekammedis_id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n\t{\n\t\t//$this->layout='//layouts/column2';\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['RekruitmenMaba']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RekruitmenMaba'];\n\t\t\tif($model->save()){\n\t\t\t\tif($model->lampiran){\n\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_rmaba));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,'manajemen'=>'manajemen',\n\t\t));\n\t}", "function update() {\n \n // update with foto\n $data = array(\n'ID_Desk' => $this->input->post('ID_Desk', TRUE),\n 'Semester' => $this->input->post('Semester', TRUE),\n 'id_tahun_akademik' => $this->input->post('id_tahun_akademik', TRUE),\n 'NISN' => $this->input->post('NISN', TRUE),\n 'ID_Rombel' => $this->input->post('ID_Rombel', TRUE),\n 'ID_Mapel' => $this->input->post('ID_Mapel', TRUE),\n 'Desk_P' => $this->input->post('Desk_P',TRUE),\n 'Desk_K' => $this->input->post('Desk_K',TRUE),\n 'N_Sikap1' => $this->input->post('N_Sikap1',TRUE),\n 'N_Sikap2' => $this->input->post('N_Sikap2',TRUE)\n );\n \n $ID_Desk = $this->input->post('ID_Desk');\n $this->db->where('ID_Desk',$ID_Desk);\n $this->db->update('tb_r_deskripsi',$data);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index' ,'id' => $model->inmueble_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n //BefugnisTeil\n if(!Yii::$app->user->can('updateBenutzer')){\n throw new ForbiddenHttpException('Sie haben kein Befugniss');\n }\n \n $model = $this->findModel($id);\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \n $FotoName = $model->MarterikelNr;\n // die Instance von File zu kriegen\n if($model->file = UploadedFile::getInstance($model,'file')){\n $model->file->saveAs('../../profiefoto/'.$FotoName.'.'.$model->file->extension);\n $model->Profiefoto = '../../profiefoto/'.$FotoName.'.'.$model->file->extension;\n //Image::getImagine()->open($model->Profiefoto)->thumbnail(new Box(160, 160))->save($model->Profiefoto , ['quality' => 90]);\n Image::thumbnail($model->Profiefoto, 160, 160)->save($model->Profiefoto , ['quality' => 90]);\n }\n \n $model->save();\n /*\n $model->save();\n VarDumper::dump($model->errors);\n exit(0);\n */\n return $this->redirect(['view', 'id' => $model->MarterikelNr]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n $condicion = new CodicionPago;\n $bodega = new Bodega;\n $categoria = new Categoria;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ConfFa']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ConfFa'];\n\t\t\tif($model->save()) {\n\t\t\t\t//$this->redirect(Yii::app()->user->returnUrl);\n\t\t\t\t$this->redirect(array('update&id=1&men=S002'));\n } else {\n $this->redirect(array('update&id=1&men=E002'));\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n 'condicion'=>$condicion,\n 'categoria'=>$categoria,\n 'bodega'=>$bodega,\n\t\t));\n\t}", "public function update()\n\t{\n\t\t\n\t\t//\n\t\t\n \t\t$id = Input::get('id');\n \t\t$laporan = Laporan::find($id);\n\n \t\t$laporan->no_bukti = Input::get('nobukti');\n\t\t$laporan->tanggal = Input::get('tanggal');\n\t\t$laporan->no_perk = Input::get('noperk');\n\t\t$laporan->kode_akun = Input::get('akun');\n\t\t$laporan->kredit = Input::get('kredit');\n\t\t$laporan->debet = Input::get('debet');\n\t\t$laporan->keterangan = Input::get('keterangan');\n\t\t$laporan->save();\n\t\treturn Redirect::to('laporan')->with('pesan_update', 'Data Update Berhasil');\n\n\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->kamar_id]);\n // }\n if ($model->load(Yii::$app->request->post())) {\n // Yii::$app->creator->update($model);\n $model->updated_by = Yii::$app->user->identity->username;\n \t $model->updated_date = date(\"Y-m-d\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->kamar_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) \r\n {\r\n return $this->redirect(['view', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n\r\n ]);\r\n }\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\t\t$listKeluarBarang = $model->getListBarangKeluar();\n\n if ($model->load(Yii::$app->request->post())) {\n\t\t\tif($model->save(false)){\n\t\t\t\tYii::$app->session->setFlash('success', 'Proses dengan id='.$model->id.' telah selesai!');\n\t\t\t\treturn $this->redirect('index');\n\t\t\t}\n\t\t\t\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n \n \n\t\tif(isset($_POST['Pegawai'])){\n\t\t\t\n\t\t\t$nip = $_POST['Pegawai']['nip'];\n\t\t\t$nama_peg = $_POST['Pegawai']['nama'];\n\t\t\t$alamat = $_POST['Pegawai']['alamat'];\n\t\t\t$ttl = $_POST['Pegawai']['tanggal_lahir'];\n\t\t\t$agama = $_POST['Pegawai']['agama'];\n\n\t\t\t$sql = \"UPDATE pegawai SET nip=:nip, nama=:nama_peg, alamat=:alamat, tanggal_lahir=:ttl, agama=:agama\n\t\t\t WHERE id=:id\";\n\t\t\t$cmd = Yii::app()->db->createCommand($sql);\n\t\t\t//deklarasi untuk variabel yang dibuat ke simpan dalam databases\n\t\t\t$cmd->bindParam(\":nip\",$nip,PDO::PARAM_INT);\n\t\t\t$cmd->bindParam(\":nama_peg\",$nama_peg,PDO::PARAM_STR);\n\t\t\t$cmd->bindParam(\":alamat\",$alamat,PDO::PARAM_STR);\n\t\t\t$cmd->bindParam(\":ttl\",$ttl,PDO::PARAM_INT);\n\t\t\t$cmd->bindParam(\":agama\",$agama,PDO::PARAM_STR);\n\t\t\t$cmd->bindParam(\":id\",$id,PDO::PARAM_INT);\n\t\t\ttry {\n\t\t\t\t$cmd->execute();\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t} catch (Exception $e) {\n\t\t\t\tYii::app()->user->setFlash('adaKesalahan',\n\t\t\t\t\t\"Anda Kesalahan : \".\"{$e->getMessage()}\");\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }", "public function actionUpdate($no_surat) {\n $model = $this->findModel($no_surat);\n $session = new session();\n $id_perkara = $session->get('id_perkara');\n $no_register_perkara = $session->get('no_register_perkara');\n $no_akta = $session->get('no_akta');\n $no_reg_tahanan = $session->get('no_reg_tahanan');\n $no_eksekusi = $session->get('no_eksekusi');\n\n $sysMenu = PdmSysMenu::findOne(['kd_berkas' => GlobalConstMenuComponent::D1]);\n //$modeljakpen = PdmJaksaPenerima::findOne(['id_perkara' => $model->id_perkara, 'code_table' => GlobalConstMenuComponent::D1, 'id_table' => $model->id_d1]);\n $modelTerpanggil = VwTerdakwaT2::findOne(['no_register_perkara'=>$no_register_perkara, 'no_reg_tahanan'=>$no_reg_tahanan]);\n //$modelSpdp = PdmSpdp::findOne($model->id_perkara);\n $searchJPU = new VwJaksaPenuntutSearch();\n $dataJPU = $searchJPU->searchttd(Yii::$app->request->queryParams);\n $dataJPU->pagination->pageSize = 5;\n //$model->hari = Yii::$app->globalfunc->GetNamaHari($model->tgl_relas);\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n\n $model->no_eksekusi = $no_eksekusi;\n $model->no_reg_tahanan = $no_reg_tahanan;\n $model->no_register_perkara = $no_register_perkara;\n if(!$model->update()){\n var_dump($model->getErrors());exit;\n }else{\n $transaction->commit();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Update',\n 'title' => 'Update Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['update', 'no_surat' => $model->no_surat]);\n }\n } catch (Exception $ex) {\n $transaction->rollback();\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'danger',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Gagal di Update',\n 'title' => 'Error',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['update', 'no_surat' => $model->no_surat]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'sysMenu' => $sysMenu,\n 'modeljakpen' => $modeljakpen,\n 'modelSpdp' => $modelSpdp,\n 'searchJPU' => $searchJPU,\n 'dataJPU' => $dataJPU,\n 'modelTerpanggil' => $modelTerpanggil\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $this->layout =\"main-admin\";\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_factura_gastos]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->loadModel($id);\n\t\tif($model->tags)\n\t\t\tforeach($model->tags as $tag)\n\t\t\t\tarray_push($model->formTags, $tag->title);\n//var_dump($model->teacherModels);exit;\n\t\tif($model->teacherModels)\n\t\t\tforeach($model->teacherModels as $teacher)\n\t\t\t\tarray_push($model->teachers, $teacher->id);\n\t\t\n\t\t$model->classDays = $model->classDays ? explode(',', $model->classDays) : null;\n\t\tif(isset($_POST['Classes'])) {\n\t\t\t$model->attributes = $_POST['Classes'];\n\t\t\t$model->formTags = isset($_POST['Classes']['formTags']) ? explode(',', $_POST['Classes']['formTags']) : null;\n $model->teachers = isset($_POST['Classes']['teachers']) ? $_POST['Classes']['teachers']: null;\n\t\t\t$model->classDays = isset($_POST['Classes']['classDays']) ? explode(',', $_POST['Classes']['classDays']) : null;\n\t\t\t$model->price = isset($_POST['Classes']['price']) ? $_POST['Classes']['price'] : 0;\n\n\t\t\tif($model->save()) {\n\t\t\t\tYii::app()->user->setFlash('success', '<span class=\"icon-check\"></span>&nbsp;&nbsp;اطلاعات با موفقیت ذخیره شد.');\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t} else\n\t\t\t\tYii::app()->user->setFlash('failed', 'در ثبت اطلاعات خطایی رخ داده است! لطفا مجددا تلاش کنید.');\n\t\t}\n\n\t\t$this->render('update', array(\n\t\t\t\t'model' => $model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->KASIR_ID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update()\n {\n $user_session = $this->session->userdata('pengguna');\n $post = $this->input->post();\n\n $this->id_kategori = $post[\"id\"];\n $this->deskripsi_kategori = $post[\"deskripsi_kategori\"];\n\n $this->modiby = $user_session;\n $this->modidate = date('Y-m-d H:i:s');\n\n return $this->db->update($this->_table, $this, array('id_kategori' => $this->id_kategori));\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "function update()\n{\n $id = $this->input->post('id');\n $nama = $this->input->post('nama');\n // $kerajinan = $this->input->post('kerajinan');\n // $kuliner = $this->input->post('kuliner');\n // $fashion = $this->input->post('fashion');\n // $kebudayaan = $this->input->post('kebudayaan');\n // $aksesoris = $this->input->post('aksesoris');\n // $lainnya = $this->input->post('lainnya');\n // $tanggal = $this->input->post('tanggal');\n\n $id = array('id'=>$id);\n $data = array('nama' => $nama\n // 'kuliner' => $kuliner,\n // 'fashion' => $fashion,\n // 'kebudayaan' => $kebudayaan,\n // 'aksesoris' => $aksesoris,\n // 'lainnya' => $lainnya,\n // 'tanggal' => $tanggal\n\n \n );\n $this->m_kategori->update_kategori($data,$id);\n\n redirect('admin/ikm_cilacap/kategori');\n // echo $this->db->last_query();\n \n \n\n\n }", "public function update()\n {\n $session = \\Config\\Services::session();\n if ($session->status != 'admin') {\n return redirect()->to('/dashboard');\n }\n\n\n $model = new PenayanganModel();\n helper('form');\n $this->form_validation = \\Config\\Services::validation();\n\n\n $data = [\n 'kd_penayangan' => $this->request->getPost('kd_penayangan'),\n 'kd_film' => $this->request->getPost('kd_film'),\n 'kd_ruangan' => $this->request->getPost('kd_ruangan'),\n 'tanggal' => $this->request->getPost('tanggal'),\n 'waktu_mulai' => $this->request->getPost('waktu_mulai')\n ];\n\n $id = $this->request->getPost('kd_penayangan');\n\n if ($this->form_validation->run($data, 'penayangan') == FALSE) {\n $error = $this->form_validation->listErrors();\n session()->setFlashdata('error', '<br><small class=\"red-text\">\n ' . $error . '</small>');\n return redirect()->to($_SERVER['HTTP_REFERER']);;\n } else {\n $model->updatePenayangan($data, $id);\n session()->setFlashdata('tipe', 'admin');\n session()->setFlashdata('success', 'diubah');\n return redirect()->to('http://localhost:8080/penayangan/');\n }\n }", "public function update()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_POST['id']);\n $tacgia->anh = $_POST['anh'];\n $tacgia->ten = $_POST['ten'];\n $tacgia->thongtin = $_POST['thongtin'];\n $tacgia->update();\n\n go_back();\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->simpan()) {\n return $this->redirect(['view', 'id' => $model->id_halaman]);\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['TrxDosen'])) {\n $model->attributes = $_POST['TrxDosen'];\n if ($model->save()) {\n TrxMataKuliah::model()->deleteAll(\"trx_dosen_id = $model->id\");\n\n $param = explode(',', $_POST['TrxDosen']['mata_kuliah']);\n foreach ($param as $a) {\n $model2 = new TrxMataKuliah;\n $model2->trx_dosen_id = $model->id;\n $model2->mata_kuliah = $a;\n $model2->save();\n }\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TDespachoCabecera']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TDespachoCabecera'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_despacho));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n // check active diet\n if($model->status_del) throw new NotFoundHttpException('The requested page does not exist.');//return $this->redirect(['index']);\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $uploadModel = new VersiProdukUploadForm();\n $produk = $model->produk;\n\n if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validate($model);\n }\n if ($model->load(Yii::$app->request->post()) && $model->save() && $uploadModel->load(Yii::$app->request->post())) {\n $uploadModel->dokumen = UploadedFile::getInstance($uploadModel, 'dokumen');\n if ($filename = $uploadModel->upload($model->produk)) {\n $model->cara_instalasi = $filename;\n }\n $produk->download_link = $model->link_baru;\n $produk->save(false);\n Yii::$app->session->setFlash('success', 'Berhasil mengubah VersiProduk.');\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'uploadModel' => $uploadModel\n ]);\n }", "public function actionUpdate($id) {\n $model_ = $this->findModel($id);\n $model = $this->findModel($id);\n $aggrement_ = $model->aggrement;\n $ejari_ = $model->ejari;\n $cheque_copy_ = $model->cheque_copy;\n $cheque_details = \\common\\models\\ChequeDetails::find()->where(['master_id' => $id])->all();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $data = Yii::$app->request->post();\n $aggrement = UploadedFile::getInstances($model, 'aggrement');\n $ejari = UploadedFile::getInstance($model, 'ejari');\n $cheque_copy = UploadedFile::getInstance($model, 'cheque_copy');\n $model->ejari_expiry = $model->ejari_expiry != '' ? date('Y-m-d', strtotime($model->ejari_expiry)) : '';\n if (!empty($aggrement)) {\n $model->aggrement = $aggrement->extension;\n } else {\n $model->aggrement = $aggrement_;\n }\n if (!empty($ejari)) {\n $model->ejari = $ejari->extension;\n } else {\n $model->ejari = $ejari_;\n }\n if (!empty($cheque_copy)) {\n $model->cheque_copy = $cheque_copy->extension;\n } else {\n $model->cheque_copy = $cheque_copy_;\n }\n if ($model->save()) {\n $this->UpdateRealEstateDetails($model, $model_);\n $this->upload($model, $aggrement, $ejari, $cheque_copy);\n $this->ChequeDetails($model, $data);\n if (isset($_POST['updatee']) && $_POST['updatee'] != '') {\n $this->UpdateChequeDetails($_POST['updatee']);\n }\n Yii::$app->session->setFlash('success', \"Real Estate Updated successfully\");\n }\n return $this->redirect(['update', 'id' => $model->id]);\n } return $this->render('update', [\n 'model' => $model,\n 'cheque_details' => $cheque_details,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n \n \n if(Yii::$app->request->isAjax && $model->load($_POST)){\n \\Yii::$app->response->format = 'json';\n return ActiveForm::validate($model);\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $model->KlausurID]);\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionKnprManajemenWaktu() {\n $model = new Waktu;\n if (Waktu::find()->where(['status'=>'aktif'])->exists()){\n $model_0 = Waktu::find()->where(['status'=>'aktif'])->one();\n } \n else {\n $model_0 = null;\n }\n \n if ($model->load(Yii::$app->request->post())) {\n $waktu = $model->tahun.'/'.$model->triwulan.'/'.$model->putaran;\n if (!$model_update = Waktu::find()->where(['id_waktu' => $waktu])->exists()){\n $model->save(); \n } else {\n $model_update = Waktu::find()->where(['id_waktu' => $waktu])->one();\n Waktu::gantiStatus();\n $model_update->status ='aktif';\n $model_update->save($runValidation=false);\n }\n return $this->redirect(['site/knpr-home']);\n } else {\n return $this->render('knpr/knpr-manajemen-waktu', [\n 'model' => $model,\n 'model_0' => $model_0\n ]);\n } \n }", "public function actionUpdate($id, $akta_badan_jenis_id)\n {\n $model = $this->findModel($id, $akta_badan_jenis_id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id, 'akta_badan_jenis_id' => $model->akta_badan_jenis_id]);\n } else {\n $kelurahan = Kelurahan::find()->where(['id'=>$model->kelurahan_id])->one();\n $kecamatan = Kecamatan::find()->where(['id'=>$kelurahan->kecamatan])->one();\n $kabupaten = Kabupaten::find()->where(['id'=>$kecamatan->kabupaten])->one();\n\n $model->kelurahan_id = $kelurahan->id;\n $model->kecamatan_id = $kelurahan->kecamatan_id;\n $model->kabupaten_id = $kecamatan->kabupaten_id;\n $model->provinsi_id = $kabupaten->provinsi_id;\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n\n // p($id);die;\n $model = $this->findModel($id);\n // p($model);die;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update ()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_update');\n $view->title = \"Verein\";\n $view->heading = \"Verein bearbeiten\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->display();\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_faktur_barang]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Barangmasuk']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Barangmasuk'];\n\t\t\t$model->faktur=$_POST['Barangmasuk']['faktur'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('items/laporanmasuk','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function update($id)\n\t{\n\t\t$nama = $this->input->post('nama');\n\t\t$tipe = $this->input->post('tipe');\n\t\t$harga = $this->input->post('harga');\n\t\t$bintang = $this->input->post('bintang');\n\t\t$fasilitas = $this->input->post('fasilitas');\n\t\t$strategis = $this->input->post('strategis');\n\n\t\t//save ke db (nama_lengkap dan alamat sesuai nama tabel di DB)\n\t\t$data = array('nama_hotel'=> $nama, 'tipe_kamar'=> $tipe, 'harga'=> $harga, 'bintang'=> $bintang, 'fasilitas'=> $fasilitas, 'strategis'=> $strategis);\n\t\t$edit = $this->model_alternatif->editDataTry($id, 'alternatif', $data);\n\n\t\tif($edit >0)\n\t\t{\n\t\t\tredirect ('Alternatif/index');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\techo 'Gagal Update';\n\t\t}\n\n\t}", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n $trans = yii::$app->db->beginTransaction();\r\n\r\n $point_update = $model->aturan->point_aturan;\r\n $old_id_siswa = $model->id_siswa;\r\n\r\n if ($model->loadAll(Yii::$app->request->post()) && $model->save()) {\r\n $check = $this->checkDetailPoint($model, 'update', $point_update, $old_id_siswa);\r\n \r\n if( isset($check['failed']) ){\r\n $trans->rollBack();\r\n Yii::$app->session->setFlash('error', $check['failed'] );\r\n return $this->redirect(['index']);\r\n }\r\n \r\n $trans->commit();\r\n Yii::$app->session->setFlash('success','Pelanggaran berhasil diubah.');\r\n return $this->redirect(['index']);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\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('update', [\n 'model' => $model,\n ]);\n }\n }", "public function EditTU(){\n $tipeusaha = $this->ModelPengaturan;\n $validation = $this->form_validation;\n $validation->set_rules($tipeusaha->rulesTU());\n\n if ($validation->run()) {\n $tipeusaha->updateTU();\n $this->session->set_flashdata('msg','Tipe Usaha Berhasil di Edit!');\n redirect('admin/Pengaturan');\n }\n redirect('admin/Pengaturan');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\t\n\t\t$this->titulo = 'Alterar Contato';\n\t\t$this->subTitulo = '';\n\t\t\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'update' );\n \n\t\t\treturn $this->redirect(['view', 'id' => $model->cod_contato]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update($id = null)\n {\n if ($this->input->post('submit')) {\n $id = $this->input->post('id');\n $data = array( \n 'isi_menimbang' => $this->input->post('isi_menimbang') \n );\n \n // Jalankan function update pada model\n\n $query = $this->Model_menimbang->update($id, $data);\n\n\n\n // cek jika query berhasil\n if ($query) $message = array('status' => true, 'message' => 'Data menimbang telah di perbaharui');\n else $message = array('status' => true, 'message' => 'Data Menimbang gagal di perbaharui');\n \n // simpan message sebagai session\n $this->session->set_flashdata('message', $message);\n\n // refresh page\n redirect('menimbang');\n }\n\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n \n if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {\n Yii::$app->response->format = Response::FORMAT_JSON; \n return ActiveForm::validate($model);\n }\n\n if ($model->load(Yii::$app->request->post())) {\n \n $flag = false;\n \n if (($model->image = Tools::uploadFile('/img/mtable/', $model, 'image', 'id'))) {\n $flag = true; \n } else {\n $flag = true;\n $model->image = $model->oldAttributes['image'];\n }\n \n if ($model->save() && $flag) {\n Yii::$app->session->setFlash('status', 'success');\n Yii::$app->session->setFlash('message1', 'Update Sukses');\n Yii::$app->session->setFlash('message2', 'Proses update sukses. Data telah berhasil disimpan.');\n \n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n Yii::$app->session->setFlash('status', 'danger');\n Yii::$app->session->setFlash('message1', 'Update Gagal');\n Yii::$app->session->setFlash('message2', 'Proses update gagal. Data gagal disimpan.');\n }\n \n \n }\n \n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no_registrasi]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(KabupatenRequest $request, $id)\n {\n //Find or Fail to get ID\n $kab = Kabupaten::findOrFail($id);\n\n //Save record to the database\n $kab->update($request->all());\n\n \\Session::flash('pesan','Kabupaten telah berhasil diperbaharui!');\n\n //Return to universities controller\n return redirect('admin/kabupaten');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n //detail yang sudah konek idnya\n $searchModeldet = new \\backend\\modules\\penarikan\\models\\Bcf15Search(['skep_penetapan_bcf15_id'=>$model->id]);\n $dataProviderdet = $searchModeldet->search(Yii::$app->request->queryParams);\n \n //detail yang belum konek mau ditambahkan\n $searchModel = new \\backend\\modules\\penarikan\\models\\Bcf15Search(['status_bcf15'=>4]);\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'searchModeldet' => $searchModeldet,\n 'dataProviderdet' => $dataProviderdet,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success','Berhasil Mengubah Pekerjaan');\n return $this->redirect(['/admin/user/index']);\n }\n\n return $this->render('form', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view','id' => $model->weid \n\t\t\t] );\n\t\t} else {\n\t\t\treturn $this->render ( 'update', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Setting berhasil diubah. Anda perlu masuk kembali ke program agar setting teraplikasikan.');\n Yii::$app->user->logout();\n return $this->goHome();\n } else {\n return $this->render('update', ['model' => $model]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->scenario = 'update';\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->validate() ){ \n \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n //Se guarda encabezado Vale deposito_central\n if ($model->save()){\n $this->deshacer_renglones($model);\n $this->guardar_renglones($model);\n }\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->PE_NROREM]);\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n }\n else{\n return $this->render('update', [\n 'model' => $model,\n \n ]);\n }\n \n } else {\n \n\n $renglones = $this->agrupar_medicamentos($model->renglones);\n \n foreach ($renglones as $key => $renglon) {\n $renglones[$key]->descripcion = $renglon->articulo->AG_NOMBRE;\n $renglon->PR_FECVTO = Yii::$app->formatter->asDate($renglon->PR_FECVTO,'php:d-m-Y');\n }\n\n $model->renglones = $renglones;\n\n \n return $this->render('update', [\n 'model' => $model,\n \n ]);\n \n }\n }", "public function actionUpdate($id)\n {\n $model = $this->loadModel($id);\n\n $this->performAjaxValidation($model, 'ahorro-form');\n\n if (isset($_POST['Ahorro'])) {\n $model->attributes = $_POST['Ahorro'];\n// $model->fecha = Yii::app()->dateFormatter->format(\"yyyy-MM-dd hh:mm:ss\", $model->fecha);\n $model->fecha = Util::FormatDate($model->fecha, 'Y-m-d');\n if ($model->save()) {\n $this->redirect(array('admin'));\n }\n }\n $model->fecha = Util::FormatDate($model->fecha, 'd/m/Y');\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\t\t//print_r(\"update mode\");exit;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n // return $this->redirect(['view', 'id' => $model->id]);\r\n\t\t return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('update', [\r\n 'model' => $model,\r\n ]);\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['peminjaman/view', 'id' => $model->id_pinjam]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "function update(){\n session_start();\n $id=$_SESSION['id_alumno'];\n $nombre= $_POST['nombre'];\n $apellido= $_POST['apellido'];\n $telefono= $_POST['telefono'];\n \n unset($_SESSION['id_alumno']);\n $this->model->update(['id'=>$id,'nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n \n $url= constant('URL').\"alumno\";\n header(\"Location: $url\");\n\n // $this->index();\n\n // if ($this->model->update(['id'=>$id,'nombre'=>$nombre , 'apellido'=>$apellido,'telefono'=>$telefono])) {\n // $alumno = new Alumnos();\n // $alumno->id=$id;\n // $alumno->nombre=$nombre;\n // $alumno->apellido=$apellido;\n // $alumno->telefono=$telefono;\n // $this->view->alumno=$alumno;\n // $this->render();\n\n\n // }else{\n // $this->view->render('errors/index');\n // }\n // $url= constant('URL').\"alumno\";\n // header(\"Location: $url\");\n }", "public function actionUpdate($id)\n {\n $this->checkPrivilege();\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n $mulai = $model->tanggal_mulai;\n $jangka = $model->jangka_kalibrasi;\n $model->kalibrasi_selanjutnya = date('Y-m-d', strtotime(\"+\".$jangka.\" Weeks\", strtotime($mulai)));\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n }", "function update($id)\n\t{\n\t\t$nama = $this->input->post('nama');\n\n\t\t//save ke db (nama_lengkap dan alamat sesuai nama tabel di DB)\n\t\t$data = array('nama_kategori'=> $nama);\n\t\t$edit = $this->model_kategori->editData($id, 'kategori', $data);\n\n\t\tif($edit >0)\n\t\t{\n\t\t\tredirect ('Kategori/index');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\techo 'Gagal Update';\n\t\t}\n\n\t}", "public function update(Request $request, MataKuliah $matakuliah)\n {\n //\n // $matakuliah->kode_mk=$request->input('kode');\n // $matakuliah->mata_kuliah=$request->input('nama');\n // $matakuliah->jumlah_sks=$request->input('jml_sks');\n // $matakuliah->save();\n\n //method update\n $matakuliah->update([\n 'kode_mk'=>$request->input('kode'),\n 'mata_kuliah'=>$request->input('nama'),\n 'jumlah_sks'=>$request->input('jml_sks'),\n ]);\n\n return redirect()->route('matakuliah.index')->with('status','data berhasil diubah');\n\n }", "public function actionUpdate($tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Unit, $Kd_Program, $Kd_Kegiatan)\n {\n $model = $this->findModel($tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Unit, $Kd_Program, $Kd_Kegiatan);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'tahun' => $model->tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Program' => $model->Kd_Program, 'Kd_Kegiatan' => $model->Kd_Kegiatan]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n date_default_timezone_set('America/Sao_Paulo');\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if($model->status_chegada == 1){\n $model->data_chegada = date('Y-m-d');\n $model->save();\n }\n if ($model->status_entrega == 1){\n $model->data_pronto = date('Y-m-d');\n $model->save();\n }elseif ($model->status_entrega == 2 && !$model->data_pronto) {\n $model->data_entregue = date('Y-m-d');\n $model->data_pronto = date('Y-m-d');\n $model->save();\n }elseif ($model->status_entrega == 2){\n $model->data_entregue = date('Y-m-d');\n $model->save();\n }\n\n return $this->redirect(['index']);\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n // $this->validate($request, [\n // 'nama_fidyah' => 'required',\n // 'nominal_fidyah' => 'required|numeric',\n // ]);\n $fidyah = FidyahModel::find($id);\n // $fidyah->id_anggotakk = $request['nama_fidyah'];\n // $fidyah->nominal_fidyah = $request['nominal_fidyah'];\n $fidyah->created_at = $request['tgl_pembayaran'];\n $fidyah->update();\n\n return redirect(route('fidyah.index'))->with('info', 'Tanggal Pembayaran Berhasil Diubah!');\n }", "public function actionUpdate($ID_Tahun, $Kd_Prov, $Kd_Kab_Kota)\n {\n $model = $this->findModel($ID_Tahun, $Kd_Prov, $Kd_Kab_Kota);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'ID_Tahun' => $model->ID_Tahun, 'Kd_Prov' => $model->Kd_Prov, 'Kd_Kab_Kota' => $model->Kd_Kab_Kota]);\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update($id)\n\t{\n\t\t$validasi=Validator::make(Input::all(),Kkm::$rules,Kkm::$pesan);\n\n\t\tif($validasi->fails()){\n\t\t\treturn Redirect::back()\n\t\t\t\t->withInput()\n\t\t\t\t->withErrors($validasi);\n\t\t}else{\n\t\t\t$kkm=Kkm::find($id);\n\t\t\t$kkm->nilai_kkm=Input::get('nilai');\n\t\t\t$kkm->save();\n\n\n\t\t\tSession::flash('pesan',\"<div class='alert alert-success'>\n\t\t\t\tData KKm berhasil diupdate</div>\");\n\n\t\t\treturn Redirect::back();\n\t\t}\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->codebien]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pago']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pago'];\n\t\t\t$model->fechahoraregistro = date('Y-m-d H:i:s');\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_detalle_factura]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Indicadores']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Indicadores'];\n\t\t\tif($model->save()){\n\t\t\t\tYii::app()->user->setFlash(\"success\",\"EL indicador de ha guardado de manera correcta\");\n\t\t\t\t$this->redirect(array('lista'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pedidos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pedidos'];\n\t\t\tif($model->save()) {\n Yii::app()->user->setFlash('success', \"El tiket se ha modificado correctamente!\");\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\t\t$form = new FoodForm($model);\n\n\t\tif ($form->load(Yii::$app->request->post()) && $form->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t}\n\n\t\t$this->view->title = 'Редактировать блюдо';\n\n\t\treturn $this->render('update', [\n\t\t\t'form' => $form,\n\t\t]);\n\t}", "public function EditJU(){\n $jenisusaha = $this->ModelPengaturan;\n $validation = $this->form_validation;\n $validation->set_rules($jenisusaha->rulesJU());\n\n if ($validation->run()) {\n $jenisusaha->updateJU();\n $this->session->set_flashdata('msg','Jenis Usaha Berhasil di Edit!');\n redirect('admin/Pengaturan');\n }\n redirect('admin/Pengaturan');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if (Yii::$app->request->post()) {\n $model->load(Yii::$app->request->post());\n $model->save();\n return $this->redirect(['site/view', 'id' => $model->id]);\n } else {\n return $this->render('knpr/update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['index']);\n }\n else\n {\n //var_dump($model);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n \n $this->validate($request, [\n 'keterangan' => 'required',\n 'tanggal' => 'required',\n 'jumlahpemasukan' => 'required',\n\n \n ]);\n\n\n\n $update = pemasukan::find($id);\n $update->tanggal=$request->tanggal;\n $update->keterangan=$request->keterangan;\n $update->jumlahpemasukan=$request->jumlahpemasukan;\n\n\n $update->save(); \n\n\n\n return redirect()->route('pemasukan.index')\n ->with('success','pemasukan Berhasil di edit');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel(crypt::Decrypt($id));\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Consegne']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Consegne'];\n\t\t\t$tmp = explode(\"/\",$model->data);\n\t\t\t$model->data = strtotime($tmp[2].'-'.$tmp[1].'-'.$tmp[0]);\n\t\t\t$model->id_user = Yii::app()->user->objUser['id_user'];\n\t\t\t$model->codfisc = strtoupper($model->codfisc);\n\t\t\t$model->nome = strtoupper($model->nome);\n\t\t\t$model->cognome = strtoupper($model->cognome);\n\t\t\t$model->indirizzo = strtoupper($model->indirizzo);\n\t\t\t$model->note = strtoupper($model->note);\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>crypt::Encrypt($model->id_archive)));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ElBezQuests']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElBezQuests'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($Tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Prog, $Kd_Keg, $Kd_Unit, $Kd_Sub)\n {\n $model = $this->findModel($Tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Prog, $Kd_Keg, $Kd_Unit, $Kd_Sub);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Prog' => $model->Kd_Prog, 'Kd_Keg' => $model->Kd_Keg, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $universidades = ArrayHelper::map(\n Universidad::find()\n ->select('id, nombre')\n ->where('activo = 1')\n ->orderBy('nombre')\n ->all(),\n 'id', 'nombre'\n );\n\n // Solo se puede editar a usuario Administrador o Evaluador\n if (!$model->isAdministrador() && !$model->isEvaluador()) {\n return $this->redirect(['index']);\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'titulo_sin' => $this->titulo_sin,\n 'titulo_plu' => $this->titulo_plu,\n 'universidades' => $universidades,\n ]);\n }\n }" ]
[ "0.7548448", "0.72302777", "0.7230049", "0.7200174", "0.71722513", "0.70733505", "0.7031027", "0.69959694", "0.69848317", "0.69564074", "0.69536424", "0.69501776", "0.69431573", "0.69332767", "0.6908523", "0.6897991", "0.6895972", "0.6889265", "0.6875075", "0.6868031", "0.685115", "0.68506765", "0.6850112", "0.684532", "0.68414307", "0.6840265", "0.68386054", "0.68364364", "0.6827433", "0.6822907", "0.6817736", "0.68022513", "0.6796512", "0.6795612", "0.6770664", "0.6770311", "0.67693484", "0.67673075", "0.67621875", "0.6759721", "0.6751634", "0.6743849", "0.6739449", "0.6736361", "0.6735838", "0.6734665", "0.6724683", "0.67216927", "0.67163664", "0.6713351", "0.671255", "0.6707137", "0.67066306", "0.66958505", "0.6693465", "0.66919374", "0.66908693", "0.6681707", "0.6676017", "0.6673684", "0.66682607", "0.66566724", "0.6650889", "0.66459787", "0.6643791", "0.6643082", "0.6642286", "0.6635794", "0.6622766", "0.6622551", "0.6616278", "0.6612243", "0.6610671", "0.66100633", "0.6607918", "0.66048944", "0.65996677", "0.6591671", "0.6591642", "0.65910304", "0.6587927", "0.65872234", "0.65869004", "0.6580748", "0.6577699", "0.65678006", "0.65656275", "0.65633154", "0.6549855", "0.65486234", "0.6543599", "0.65434057", "0.6542581", "0.6541684", "0.653986", "0.6532024", "0.65314037", "0.65277565", "0.6526907", "0.65243286" ]
0.7193484
4
Deletes an existing HariTidakEfektif model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $trans = Yii::$app->db->beginTransaction(); try { $this->findModel($id)->delete(); $trans->commit(); Yii::$app->session->setFlash('success', "Hari tidak efektif berhasil dihapus."); } catch (\Exception $e) { $trans->rollBack(); Yii::$app->session->setFlash('error', 'Error, cant perform this action correctly.'); } return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function actionDelete($nim){\r\n if(Tugas::model()->deleteByPk($nim)){\r\n // setelah berhasil menghapus data, alihkan ke index\r\n $this->redirect(array(self::INDEX));\r\n }else{\r\n // jika proses menghapus data gagal, tampilkan error 404 \r\n throw new CHttpException(404,'The requested page does not exist.');\r\n }\r\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n $id= @$_POST['id'];\n if($this->findModel($id)->delete()){\n echo 1;\n }\n else{\n echo 0;\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tEstateImage::deleteAllImages($model->id);\t\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->tour);\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->image);\n\t\t\n\t\t$model->delete();\n\t\t\n\t\t\n\t\tModeratorLogHelper::AddToLog('deleted-estate-'.$model->id,'Удален объект #'.$model->id.' '.$model->title,null,$model->user_id);\n\t\t$this->redirect('/cabinet/index');\n\t\t\n\t}", "function index_delete() {\n $id = $this->delete('id');\n $id_pemesanan = $this->delete('id_pemesanan');\n $id_komplain_nonmarket = $this->delete('id_komplain_nonmarket');\n $id_komplain = $this->delete('id_komplain');\n $id_sp = $this->delete('id_sp');\n $id_pelanggan = $this->delete('id_pelanggan');\n $id_pemasukan = $this->delete('id_pemasukan');\n $id_SKP = $this->delete('id_SKP');\n $idTagihan = $this->delete('idTagihan');\n $idKategori = $this->delete('idKategori');\n $idSupplier = $this->delete('idSupplier');\n $idBarang = $this->delete('idBarang');\n $id_about = $this->delete('id_about');\n $id_article = $this->delete('id_article');\n $id_banner = $this->delete('id_banner');\n $id_pegawai = $this->delete('idpegawai');\n $id_absen = $this->delete('id_absen');\n $id_status = $this->delete('id_status');\n $id_karyawan = $this->delete('id_karyawan');\n $id_sdm = $this->delete('id_sdm');\n\n if ($id != '') {\n $this->db->where('id', $id);\n $delete = $this->db->delete('login');\n } elseif ($id_pemesanan != '') {\n $this->db->where('id_pemesanan', $id_pemesanan);\n $delete = $this->db->delete('pemesanan');\n } elseif ($id_komplain_nonmarket != '') {\n $this->db->where('id_komplain_nonmarket', $id_komplain_nonmarket);\n $delete = $this->db->delete('komplain_nonmarket');\n } elseif ($id_komplain != '') {\n $this->db->where('id_komplain', $id_komplain);\n $delete = $this->db->delete('komplain');\n } elseif ($id_sp != '') {\n $this->db->where('id_sp', $id_sp);\n $delete = $this->db->delete('status_pemasangan');\n } elseif ($id_pelanggan != '') {\n $this->db->where('id_pelanggan', $id_pelanggan);\n $delete = $this->db->delete('pelanggan');\n } elseif ($id_pemasukan != '') {\n $this->db->where('id_pemasukan', $id_pemasukan);\n $delete = $this->db->delete('finance');\n } elseif ($id_SKP != '') {\n $this->db->where('id_SKP', $id_SKP);\n $delete = $this->db->delete('skp');\n } elseif ($idTagihan != '') {\n $this->db->where('idTagihan', $idTagihan);\n $delete = $this->db->delete('tagihan');\n } elseif ($idKategori != '') {\n $this->db->where('idKategori', $idKategori);\n $delete = $this->db->delete('kategori');\n } elseif ($idSupplier != '') {\n $this->db->where('idSupplier', $idSupplier);\n $delete = $this->db->delete('supplier');\n } elseif ($idBarang != '') {\n $this->db->where('idBarang', $idBarang);\n $delete = $this->db->delete('inventory');\n } elseif ($id_about != '') {\n $this->db->where('id_about', $id_about);\n $delete = $this->db->delete('about');\n } elseif ($id_article != '') {\n $this->db->where('id_article', $id_article);\n $delete = $this->db->delete('article');\n } elseif ($id_banner != '') {\n $this->db->where('id_banner', $id_banner);\n $delete = $this->db->delete('banner');\n } elseif ($id_pegawai != '') {\n $this->db->where('idpegawai', $id_pegawai);\n $delete = $this->db->delete('pegawai');\n } elseif ($id_absen != '') {\n $this->db->where('id_absen', $id_absen);\n $delete = $this->db->delete('absensi');\n } elseif ($id_status != '') {\n $this->db->where('id_status', $id_status);\n $delete = $this->db->delete('status_karyawan');\n } elseif ($id_karyawan != '') {\n $this->db->where('id_karyawan', $id_karyawan);\n $delete = $this->db->delete('karyawan');\n } elseif ($id_sdm != '') {\n $this->db->where('id_sdm', $id_sdm);\n $delete = $this->db->delete('sdm');\n }\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function delete($id){\n $this->m_sekolah->delete($id); \n redirect('Welcome/index');\n\n }", "public function actionDelete($id)\n {\n $user = Yii::$app->user->identity; \n if($user->view_cuahang == 1 ){\n throw new NotFoundHttpException('Bạn chi có quyền xem không có quyền xóa');\n }\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $praktek_id = $model->praktek_id;\n $model->delete();\n\n return $this->redirect(['index','PraktekMahasiswaSearch[praktek_id]'=>$praktek_id]);\n }", "public function actionDelete($id)\n {\n //BefugnisTeil\n if(!Yii::$app->user->can('deleteNoteneintragung ')){\n throw new ForbiddenHttpException('Sie haben kein Befugniss');\n }\n \n $model = $this->findModel($id);\n $klausurID = $model->KlausurID;\n $this->findModel($id)->delete();\n\n return $this->redirect(['index','id'=>$klausurID]);\n }", "public function destroy($id)\n {\n $model = Keranjang::find($id);\n $model->delete();\n return redirect(\"keranjang\");\n }", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n $model = Pengalaman::findOne($id);\n var_dump($model);die();\n return $this->redirect(['//keterangan/updatepencaker','id'=>$model->id_daftar]);\n }", "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 actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function delete()\n {\n if (!$_POST) {\n // Jika diakses tidak dengan menggunakan method post, kembalikan ke home (forbidden)\n $this->session->set_flashdata('error', 'Akses pengeluaran barang dari keranjang ditolak!');\n redirect(base_url('home'));\n }\n\n $id = $this->input->post('id');\n\n if (!$this->cartout->where('id', $id)->first()) { // Jika cart tidak ditemukan\n $this->session->set_flashdata('warning', 'Maaf data tidak ditemukan');\n redirect(base_url('cartout'));\n }\n\n if ($this->cartout->where('id', $id)->delete()) { // Jika penghapusan cart berhasil\n $this->session->set_flashdata('success', '1 Barang berhasil dikeluarkan dari keranjang');\n } else {\n $this->session->set_flashdata('error', 'Oops, terjadi suatu kesalahan');\n }\n\n redirect(base_url('cartout'));\n }", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$model=$this->loadModel($_POST['id']);\n\t\t $model->delete();\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function deleteAction()\n\t{\n\t\t$message = 'Une erreur est survenue. Votre &eacute;cole n\\'a pas été supprimé.';\n\n\t\t$school = School::find( (int) $this->getRequest()->post('id') );\n\t\t$deleted = $school->delete();\n\n\t\tif ( $deleted ) {\n\t\t\t$message = 'Votre &eacute; a correctement été supprimé.';\n\t\t}\n\t\t$this->render( View::make( 'schools/index' , array(\n\t\t\t'status' => $deleted,\n\t\t\t'message' => $message,\n\t\t\t'title' => 'Mes &Eacute;coles',\n\t\t\t'entities' => School::all()\n\t\t) ) );\n\t}", "public function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query->execute();\n\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t}\n\t}", "public function actionDelete($id) {\n $model=$this->findModel($id);\n\t\t$id_operacion=$model->id_operacion;\n\t\t$model->delete();\n\t\t\n\t\treturn $this->redirect(['index', 'id_operacion' => $id_operacion]);\n //return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['bcf15/penetapan']);\n }", "public function actionDelete()\n {\n $id_mata_kuliah_tayang = Yii::$app->getRequest()->getQueryParam('jk');\n $id_mahasiswa = Yii::$app->getRequest()->getQueryParam('js');\n\n $mata_kuliah_tayang = MataKuliahTayang::find()\n ->joinWith('refCpmks')\n ->where([MataKuliahTayang::tableName() . '.id' => $id_mata_kuliah_tayang])\n ->all();\n\n $count = count($mata_kuliah_tayang[0]['refCpmks']);\n\n foreach ($mata_kuliah_tayang as $key => $value) {\n foreach ($value['refCpmks'] as $key => $value) {\n $exist = CapaianMahasiswa::findOne(['id_ref_mahasiswa' => $id_mahasiswa, 'id_ref_cpmk' => $value->id]);\n // $exist->status = 0;\n $exist->delete();\n Yii::$app->session->setFlash('erro', [['Delete', 'Data Berhasil Dihapus']]);\n }\n }\n return $this->redirect(['nilai-upload', 'jk' => $id_mata_kuliah_tayang]);\n }", "function delete($idUsuario){\n $this->UsuarioModel->destroy($idUsuario);\n\n redirect(\"usuario\");\n\n\n }", "public function deleteAction() {\n\t\t$id = intval($this->getInput('id'));\n\t\t$info = Client_Service_Besttj::getBesttj($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Client_Service_Besttj::deleteBesttj($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\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->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function actionDelete($id)\n\t{\n\t\t$model = $this->loadModel($id);\t\n\t\t\t\n\t\t// if (!empty($model->foto_principal)) \n\t\t// \tunlink(Yii::app()->basePath.'/../'.$model->foto_principal);\t\t\n\t\t\n\t\t// if (!empty($model->foto_detalle)) \n\t\t// \tunlink(Yii::app()->basePath.'/../'.$model->foto_detalle);\n\n\t\t// if (!empty($model->foto_descripcion)) \n\t\t// \tunlink(Yii::app()->basePath.'/../'.$model->foto_descripcion);\n\n\t\t// if (!empty($model->foto_posologia)) \n\t\t// \tunlink(Yii::app()->basePath.'/../'.$model->foto_posologia);\n\n\t\t// if (!empty($model->foto_uso)) \n\t\t// \tunlink(Yii::app()->basePath.'/../'.$model->foto_uso);\n\t\t\t\n\t\t//BORRA El PRODUCTO Y SACA DEL INVENTARIO\n\t\t// $idInventario = TInventario::model()->with('idProducto')->find('t.id_producto = '.$id);\n\t\t// $modelInventario=TInventarioController::loadModel($idInventario->id_inventario);\n\n\t\t// $modelInventario->delete();\n\t\t$model->id_estatus=2;\n\t\t$model->save();\t\t\n\t\t\n\n\t\techo CJSON::encode(array(\t\n\t\t\t'salida' => \"OK\",\t\t\t\n\t\t\t'mensaje' => '<div class=\"alert alert-danger alert-dismissible\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><i class=\"glyphicon glyphicon-ok-sign\"></i> El producto fue eliminado exitosamente.</div>',\n\t\t\t'id' => $id\t\t\t\n\t\t));\n\n\t\tYii::app()->end();\n\n\n\n\t}", "public function actionDelete() {\n $model = new \\UsersModel();\n $login = $this->getParam('login');\n\n if ( $model->delete($login) ) {\n $this->flashMessage('Odstraněno', self::FLASH_GREEN);\n } else {\n $this->flashMessage('Záznam nelze odstranit', self::FLASH_RED);\n }\n\n $this->redirect('default');\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['site/verleih']);\n }", "public function actionDelete($id)\n {\n $model=$this->findModel($id);\n $inmueble_id=$model->inmueble_id;\n $model->delete();\n \n return $this->redirect(['index','id' => $inmueble_id]);\n }", "public function actionDeleteFine() \r\n {\r\n extract($_POST);\r\n $res=0;\r\n $searchCriteria=new CDbCriteria;\r\n $query = \"Delete From `HajzMaster` where `HajzID`='$HajzID'\";\r\n $command =Yii::app()->db->createCommand($query);\r\n \r\n if($command->execute()) $res=1;\r\n print CJSON::encode($res);\r\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function delete()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $tacgia->delete();\n\n go_back();\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function delete() {\n $flg = $this->Seatmodel->delete();\n\n if (!empty($flg)) {\n $this->session->set_flashdata('successmessage', 'Data deleted successfully');\n } else {\n $this->session->set_flashdata('errormessage', 'Oops! Something went wrong');\n }\n\n redirect(base_url('admin-seat-list'));\n }", "public function actionDelete(){\n $session = new session();\n $no_eksekusi = $session->get('no_eksekusi');\n $id = $_POST['hapusIndex'];\n\n if(count($id)>1){\n for ($i = 0; $i < count($id); $i++) {\n PdmD1::deleteAll(['no_surat' => $id[$i]]);\n }\n }else{\n PdmD1::deleteAll(['no_eksekusi'=>$no_eksekusi]);\n }\n return $this->redirect(['index']);\n }", "public function deleteAction() {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('backend-guildes-list');\n }\n $oTable = $this->getTableGuilde();\n $oEntite = $oTable->findRow($id);\n $oTable->delete($oEntite);\n $this->flashMessenger()->addMessage($this->_getServTranslator()->translate(\"La guilde a été supprimée avec succès.\"), 'success');\n return $this->redirect()->toRoute('backend-guildes-list');\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n Yii::$app->session->setFlash('success','Prefactura eliminada correctamente');\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n { \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n \n try {\n $model = $this->findModel($id);\n \n $this->deshacer_renglones($model);\n\n $model->delete();\n \n $transaction->commit();\n \n return $this->redirect(['index']);\n\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n\n }", "public function actionDelete($id)\n { \n\t\t$model = $this->findModel($id); \n $model->isdel = 1;\n $model->save();\n //$model->delete(); //this will true delete\n \n return $this->redirect(['index']);\n }", "function delete() {\n if (isset($_GET['id'])) {\n $coche=new coches_model();\n\n $id = $_GET['id'];\n\n $error = $coche->delete($id);\n\n if (!$error) {\n header( \"Location: index.php?controller=coches&action=listado\");\n }\n else {\n echo $error;\n }\n }\n }", "public function actionDelete()\n {\n\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_tabla_presupuesto=$request->get('id_tabla_presupuesto');\n $id_postulacion = $request->get('id_postulacion');\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n $buscaTablaPresupuesto = Tablapresupuesto::find()->where(['id_tabla_presupuesto' => $id_tabla_presupuesto])->one();\n if($buscaPostulacion != null && $buscaTablaPresupuesto != null){ \n\n $this->findModel($id_tabla_presupuesto)->delete();\n\n return $this->redirect(['/site/section4', 'id_postulacion' => $id_postulacion]);\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n\n }", "function index_delete() {\n $id = $this->delete('id');\n $this->db->where('id', $id);\n $delete = $this->db->delete('barang');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "function index_delete()\n {\n $no_resi = $this->delete('no_resi');\n $this->db->where('no_resi', $no_resi);\n $delete = $this->db->delete('tabel_user');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }", "public function actionDelete($id)\n {\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "function delete($kd_jenis){\n\n $this->db->delete('benang_tb', array('kd_jenis'=>$kd_jenis));\n\n $this->session->set_flashdata('notifhapus','<div class=\"alert alert-danger alert alert-dismissible fade in\" role=\"alert\"> <button type=\"button \" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button><h4><i class=\"icon fa fa-check\"></i> Berhasil!</h4>Data Berhasil dihapus </div>');\n\n redirect(base_url('Benang'));\n\n }", "public function actionDelete($id)\r\n {\r\n # Obtenemos el modelo.\r\n $model = $this->findModel($id); \r\n $municipios = $model->tblMunicipios;\r\n if(count($municipios) > 0){\r\n # alerta\r\n } else {\r\n $model->delete();\r\n }\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id){\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n return $this->findModel(Yii::$app->request->post('id'))->delete(false);\n }", "function delete()\n {\n $nim = $this->uri->segment(3);\n $this->siswa_model->delete($nim);\n redirect('siswa/page');\n }", "public function delete()\n {\n \t$id = request()->input('id');\n\n \t//ambil data pendaftaran kp dengan id lalu delete\n \t$ujian_skripsi = ujian_skripsi::find($id);\n \t$ujian_skripsi->delete();\n \t\n \t//ambil data untuk ditampilkan kembali\n \t$datas = ujian_skripsi::all();\n\n \treturn view('admin.ad-ujian_skripsi')->with('datas', $datas);\n }", "function eliminar(){\n\t\t$this->load->helper('url');\n\t\t$id=$this->input->post('documento');\n\t\t\n\t\t$this->load->model('Investigador_Model');\n\t\t$this->Investigador_Model->eliminar($id);\n\t\tredirect('Investigador_Controller');\n\t}", "public function actionDelete($id)\n {\n\t\t\n\t\t$model = $this->findModel($id);\n\t\t$model->dte_exclusao = 'NOW()';\n\t\t\n\t\tif ($model->save())\n\t\t{\n\t\t\t\n\t\t\t$this->session->setFlashProjeto( 'success', 'delete' );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$this->session->setFlashProjeto( 'danger', 'delete' );\n\t\t}\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n\t\t$empleado = $this->findModel ( $id );\n\t\t$empleado->b_habilitado = 0;\n\t\t$empleado->save ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t//$this->loadModel($id)->delete();\n $model=$this->loadModel($id);\n $model->IdEstadoSolicitudCita = 3;\n $model->save();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n Yii::$app->session->setFlash('success', 'Data berhasil dihapus.');\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\t$model = $this->loadModel();\n $rbi_id = $model->rbi_id;\n $model->delete();\n if($model->rbi_rentorsell==1){//出租\n Residencerentinfo::model()->findByAttributes(array(\"rr_rbiid\"=>$rbi_id))->delete();\n }else{//出售\n Residencesellinfo::model()->findByAttributes(array(\"rs_rbiid\"=>$rbi_id))->delete();\n }\n Residencetag::model()->findByAttributes(array(\"rt_rbiid\"=>$rbi_id))->delete();\n //下面的需要包括文件一起删除\n $pictureModel = Picture::model()->findAllByAttributes(array(\"p_sourceid\"=>$rbi_id,\"p_sourcetype\"=>Picture::$sourceType['residencebaseinfo']));//住宅图片\n if($pictureModel){\n foreach($pictureModel as $value){\n Picture::model()->deleteFile(PIC_PATH.$value['p_img'], Officebaseinfo::$officePictureNorm);\n $value->delete();\n }\n }\n\n $subpanoramaModel = Subpanorama::model()->findAllByAttributes(array(\"spn_sourceid\"=>$rbi_id,\"spn_sourcetype\"=>Subpanorama::residence));//客服为用户制作的全景\n if($subpanoramaModel){\n foreach($subpanoramaModel as $value){\n Subpanorama::model()->deleteOnePanoramaById($value['spn_id']);\n }\n }\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function actionDelete($id)\r\n {\r\n if(Yii::app()->request->isPostRequest)\r\n {\r\n $detalle_venta= $this->loadModel($id);\r\n //actualizar la cantidad disponible en ProductoAlmacen\r\n ProductoAlmacen::model()->actualizarCantidadDisponible($detalle_venta,0); \r\n //actualizando credito disponible en cliente\r\n Cliente::model()->actualizarCreditoDisponible($detalle_venta,0);\r\n \r\n //actualizar importe, subtotal, impuesto.\r\n //obtiendo venta\r\n $_venta= Venta::model()->findByPk($detalle_venta->venta_id);\r\n \r\n //we only allow deletion via POST request\r\n $detalle_venta->delete();\r\n \r\n //actualizando el total, base imponible e impuesto de la venta\r\n $_total=$detalle_venta->SumaTotal();\r\n $_bi= Producto::model()->getSubtotal($_total);\r\n $_venta->importe_total=$_total;//$this->SumaTotal()['total'];\r\n $_venta->base_imponible=$_bi; \r\n $_venta->impuesto=$_total-$_bi;\r\n $_venta->save();\r\n\r\n \r\n // $this->loadModel($id)->delete();\r\n\r\n\r\n\r\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\r\n if(!isset($_GET['ajax']))\r\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\r\n }\r\n else\r\n throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\t\t\\Yii::$app->session->setFlash('updated',\\Yii::t('admin', 'Данные успешно удалены'));\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($ID_Tahun, $Kd_Prov, $Kd_Kab_Kota)\n {\n $this->findModel($ID_Tahun, $Kd_Prov, $Kd_Kab_Kota)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id= null)\n {\n \n $request = Yii::$app->request;\n $model = $this->findModel($id);\n //xóa file upload\n if($model->ten_hinh !='no-image.png'){\n $path=Yii::$app->basePath . '/uploads/file/hinhtintuc/'.$model->ten_hinh;\n if(is_file($path)){\n unlink($path);\n }\n }\n\n if($request->isAjax){\n /*\n * Process for ajax request\n */\n \n $model->delete();\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];\n }else{\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n \n }", "public function actionDelete($id)\n {\n $exits = \\backend\\models\\RefPemohon::find()->where(['id_ref_jkel'=>$id])->exists();\n if($exits>0){\n \\Yii::$app->session->setFlash('danger','Data masih dipakai, tidak bisa dihapus');\n }else{\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "public function delete()\n {\n $id = $this->uri->segment('5');\n if ($this->global_model->delete('classified', array('id' => $id))) {\n $this->session->set_flashdata('success', 'Delete successfully!');\n redirect('admin/Classifieds/Classifieds/viewmyclassfied');\n }\n\n }", "function submitDeleteLogistik()\n\t{\n\t\t$execQueryDelete = $this->Kesehatan_M->delete('logistik',array('id'=>$this->input->post('id')));\n\t\tif ($execQueryDelete) {\n\t\t\talert('alert','success','Berhasil','Data berhasil dihapus');\n\t\t\tredirect(\"Dokter/logistik\");\n\t\t}else{\n\t\t\tvar_dump($execQueryDelete);\n\t\t}\n\t}", "public function deleteAction()\r\n\t{\r\n\t\t// check if we know what should be deleted\r\n\t\tif ($id = $this->getRequest()->getParam('faq_id')) {\r\n\t\t\ttry {\r\n\t\t\t\t\r\n\t\t\t\t// init model and delete\r\n\t\t\t\t$model = Mage::getModel('flagbit_faq/faq');\r\n\t\t\t\t$model->load($id);\r\n\t\t\t\t$model->delete();\r\n\t\t\t\t\r\n\t\t\t\t// display success message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('cms')->__('FAQ Entry was successfully deleted'));\r\n\t\t\t\t\r\n\t\t\t\t// go to grid\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t\treturn;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e) {\r\n\t\t\t\t\r\n\t\t\t\t// display error message\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\t\r\n\t\t\t\t// go back to edit form\r\n\t\t\t\t$this->_redirect('*/*/edit', array (\r\n\t\t\t\t\t\t'faq_id' => $id ));\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// display error message\r\n\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('cms')->__('Unable to find a FAQ entry to delete'));\r\n\t\t\r\n\t\t// go to grid\r\n\t\t$this->_redirect('*/*/');\r\n\t}", "public function actionDelete($id)\n\t{\n\t\t\n\t\t\n\t\t$this->loadModel($id)->delete();\n\t\t\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax'])){\n\t\t\t\n\t\t\tYii::app()->user->setFlash('success', 'Sikeres törlés.');\n\t\t\t$this->redirect($this->createAbsoluteUrl($this->uniqueid));\n\t\t\t\n\t\t}\n\t\t\n\t}", "public function actionDelete($id) {\n\n $model = $this->findModel($id);\n $model->dte_exclusao = 'NOW()';\n\n if ($model->save()) {\n\n $this->session->setFlashProjeto('success', 'delete');\n } else {\n\n $this->session->setFlashProjeto('danger', 'delete');\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n Yii::$app->session->setFlash('success','Pekerjaan Berhasil Dihapus');\n return $this->redirect(['/admin/user/index']);\n }", "public function actionDelete($id) {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id)->delete();\n\n return $this->redirect(['peminjaman/view', 'id_pinjam' => $model->id_pinjam ]);\n }", "public function actionDelete($id)\n {\n\t$model = static::findModel($id);\n\n\t$this->processData($model, 'delete');\n\n\t$model->delete();\n\n \treturn $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model=$this->findModel ( $id );\n\t\t$model->is_delete=1;\n\t\t$model->save ();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n\t{\n\t\t$id = intval($_GET['iId']);\n\t\t$this->loadModel($id)->delete();\n\t\t$this->redirect('/app/DayPush/index');\n\t}", "public function deleteAction()\n {\n $service = $this->getServiceLocator()->get($this->service);\n if( $service->delete($this->params()->fromRoute('id', 0)) )\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n else\n $this->getResponse()->setStatusCode(404);\n\n }", "public function deleteAction()\n {\n $id = (int) $this->params()->fromRoute('id', 0);\n if (!$id) {\n return $this->redirect()->toRoute('backend-evenements-personnage-list');\n }\n $oTable = $this->getTable();\n $oEntite = $oTable->findRow($id);\n $oTable->delete($oEntite);\n $this->flashMessenger()->addMessage($this->_getServTranslator()->translate(\"La evenements-personnage a été supprimé avec succès.\"), 'success');\n return $this->redirect()->toRoute('backend-evenements-personnage-list');\n }", "public function actionDelete($id) {\r\n\t\t$this->findModel ( $id )->delete ();\r\n\t\t\r\n\t\treturn $this->redirect ( [ \r\n\t\t\t\t'index' \r\n\t\t] );\r\n\t}", "public function actionDelete($id)\r\n {\r\n // $this->findModel($id)->delete();\r\n echo 'Not Allowed';\r\n exit();\r\n return $this->redirect(['index']);\r\n\r\n }", "public function actionDelete($id)\r\n {\r\n $model = $this->findModel($id);\r\n $model->STATUS =\"3\";\r\n $model->save(false);\r\n // print_r($model);die(); \r\n Yii::$app->session->setFlash('error', \"Data Produk <b>\".$model->PRODUCT_NM.\"</b> Berhasil dihapus\");\r\n return $this->redirect(['index-produk']);\r\n \r\n }", "public function actionDelete()\n {\n try{\n $id = $_POST['hapusIndex'];\n\n if($id == \"all\"){\n $session = new Session();\n $id_perkara = $session->get('id_perkara');\n\n PdmBa13::updateAll(['flag' => '3'], \"id_perkara = '\" . $id_perkara . \"'\");\n }else{\n for($i=0;$i<count($id);$i++){\n $model = $this->findModel($id[$i]);\n $model->flag = '3';\n $model->update();\n }\n }\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Berhasil di Hapus',\n 'title' => 'Hapus Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['index']);\n }catch (Exception $e){\n Yii::$app->getSession()->setFlash('success', [\n 'type' => 'success',\n 'duration' => 3000,\n 'icon' => 'fa fa-users',\n 'message' => 'Data Gagal di Hapus',\n 'title' => 'Hapus Data',\n 'positonY' => 'top',\n 'positonX' => 'center',\n 'showProgressbar' => true,\n ]);\n return $this->redirect(['index']);\n }\n }", "public function actionDelete($id)\n {\n if(Yii::app()->request->isPostRequest)\n {\n // we only allow deletion via POST request\n $data['sukses'] = 0;\n $data['pesan'] = \"Data gagal dihapus!\";\n $transaction = Yii::app()->db->beginTransaction();\n try {\n if($this->loadModel($id)->delete()){\n $data['sukses'] = 1;\n $data['pesan'] = \"Data berhasil dihapus!\";\n $transaction->commit();\n }else{\n $transaction->rollback();\n $data['sukses'] = 0;\n $data['pesan'] = \"Data gagal dihapus karna sudah digunakan di tabel lain!\";\n }\n }catch (Exception $exc) {\n $transaction->rollback();\n $data['sukses'] = 0;\n $data['pesan'] = \"Data gagal dihapus karna sudah digunakan di tabel lain!\";\n }\n echo CJSON::encode($data);\n Yii::app()->end();\n\n // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if(!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }\n else\n throw new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\n }", "public function destroyAction() {\n $model = new Application_Model_Compromisso();\n //mando para a model o id de quem sera excluido\n $model->delete($this->_getParam('id'));\n //redireciono\n $this->_redirect('compromisso/index');\n }", "public function actionDelete($id)\n {\n \t\n \ttry{\n \t\t//$model = $this->findModel($id)->delete();\n \t\t$UserInfo = User::find()->where(['id' => $id])->one();\n \t\t$UserInfo->status = 0;\n \t\t$UserInfo->update();\n \t\tYii::$app->getSession()->setFlash('success', 'You are successfully deleted Nursing Home.');\n \t\n \t}\n \t \n \tcatch(\\yii\\db\\Exception $e){\n \t\tYii::$app->getSession()->setFlash('error', 'This Nursing Home is not deleted.');\n \t\n \t}\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "function deleteid($id_cekdahak)\n\t\t{\n\t\t\t$data['dahak'] = $this->Pendataan_model->Deletedahak($id_cekdahak);\n\t\t\tredirect('Cek_dahak/listdahak');\n\t\t\t//$this->load->view(\"cekdahak/form_cekdahak2\", $data);\n\t\t}", "public function actionDelete($id)\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t$model=$this->loadModel($id);\n\t\t\tif(Riwayat::model()->deleteAll('id_gejala = ' . $model->id_gejala)){\n\t\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));\n\t\t\t\t\n\t\t\t\tif ($model->delete()) {\n\t\t\t\t\tif(Yii::app()->user->level==1){\n\t\t\t\t\t\tYii::app()->user->setFlash('success', 'Data <strong>berhasil</strong> dihapus. Terima kasih');\n\t\t\t\t\t\t$this->redirect(array('admin'));\n\t\t\t\t\t}else{\n\t\t\t\t\t\tYii::app()->user->setFlash('success', 'Data <strong>berhasil</strong> dihapus. Terima kasih');\n\t\t\t\t\t\t$this->redirect(array('index'));\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function delete($id)\n {\n $list_jadwal = jadwal_kuliah::find($id);\n $list_jadwal->delete();\n\n return redirect()->route('jadwalkuliah.index')->with('success','Jadwal berhasil dihapus');\n\n }", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\tif (!($model = $this->loadModel()))\n\t\t\t\treturn;\n\t\t\t$model->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "public function actionDelete($id)\n {\n\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }", "public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }", "public function actionDelete($id)\n {\n $model=$this->findModel($id);\n $model->IsDelete=1;\n $model->save();\n Yii::$app->session->setFlash('success', \"Your message to display.\");\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }" ]
[ "0.73528236", "0.73261446", "0.7153847", "0.7110991", "0.71102315", "0.7101923", "0.70264125", "0.6949522", "0.6930283", "0.6929831", "0.6907093", "0.69039434", "0.6889994", "0.68698287", "0.6869678", "0.6857336", "0.68562174", "0.6850053", "0.68488777", "0.681839", "0.68168586", "0.68071616", "0.68037665", "0.67907155", "0.6788591", "0.6770277", "0.6765392", "0.6763957", "0.67637587", "0.6761525", "0.67601055", "0.6755984", "0.6747899", "0.67469066", "0.67423576", "0.67423576", "0.6740192", "0.67398894", "0.6739388", "0.6735701", "0.6735442", "0.67309594", "0.67298245", "0.6722709", "0.67092854", "0.6703776", "0.66997", "0.6678639", "0.6675384", "0.66636777", "0.6650674", "0.6645435", "0.66452295", "0.6639805", "0.66384333", "0.6631807", "0.662286", "0.66202486", "0.6618032", "0.6618032", "0.6608241", "0.66072637", "0.6605124", "0.6604747", "0.65968674", "0.6590121", "0.65892327", "0.6589053", "0.65874374", "0.6582243", "0.65808177", "0.6577814", "0.65777045", "0.65764", "0.65753424", "0.65723103", "0.6571898", "0.6571898", "0.6571018", "0.65695024", "0.6568095", "0.656306", "0.6561506", "0.6555222", "0.6555198", "0.65551007", "0.65533566", "0.6552529", "0.6551197", "0.65483415", "0.65456796", "0.65432346", "0.65424395", "0.6540491", "0.6537967", "0.653796", "0.65364665", "0.6527207", "0.65266186", "0.652627" ]
0.6554327
86
Finds the HariTidakEfektif model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = HariTidakEfektif::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public abstract function find($primary_key, $model);", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = HasilKonsultasi::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Korzet::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'A keresett tartalom nem található.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PoinKebaikan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = TKaryawan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Was27Inspeksi::findOne(['id_was_27_inspeksi'=>$id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = KhoSanPham::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = AplikasiItday::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = StoreKasir::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function loadModel($id)\n {\n $model=SAAsuhankeperawatanT::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id) {\n $model = Task::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('app', 'Http.404'));\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=MasterTransaksi::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Kaohao::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n {\n $model=RJAsuhankeperawatanT::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = IzinRuangan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($Tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Prog, $Kd_Keg, $Kd_Unit, $Kd_Sub)\n {\n if (($model = TaKegiatan::findOne(['Tahun' => $Tahun, 'Kd_Urusan' => $Kd_Urusan, 'Kd_Bidang' => $Kd_Bidang, 'Kd_Prog' => $Kd_Prog, 'Kd_Keg' => $Kd_Keg, 'Kd_Unit' => $Kd_Unit, 'Kd_Sub' => $Kd_Sub])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($Tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Unit, $Kd_Sub, $No_Misi, $No_Tujuan, $No_Sasaran)\n {\n if (($model = TaSasaran::findOne(['Tahun' => $Tahun, 'Kd_Urusan' => $Kd_Urusan, 'Kd_Bidang' => $Kd_Bidang, 'Kd_Unit' => $Kd_Unit, 'Kd_Sub' => $Kd_Sub, 'No_Misi' => $No_Misi, 'No_Tujuan' => $No_Tujuan, 'No_Sasaran' => $No_Sasaran])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=RequestFuel::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('rdt','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "protected function findKegiatan($id)\n {\n if (($model = RenjaKegiatan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SkepPenetapanBcf15::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kamar::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = DaftarSmk::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SubAkun::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=GZTerimabahanmakan::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "private function findModel($id)\n {\n return Pekerjaan::findOne($id);\n }", "protected function findModel($id)\r\n {\r\n if (($model = Pelanggaran::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "protected function findModel($id)\n {\n if (($model = Buku::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = Takwim::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = JenisPelayanan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "protected function findModel($id)\n {\n if (($model = TablePetugas::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($ID_Tahun, $Kd_Prov, $Kd_Kab_Kota)\n {\n if (($model = TaPeriode::findOne(['ID_Tahun' => $ID_Tahun, 'Kd_Prov' => $Kd_Prov, 'Kd_Kab_Kota' => $Kd_Kab_Kota])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = MagentoFruugoInfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Transaksi::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = ImAdjustHead::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Nursinghomes::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Topik::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = SasaranEs4::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "protected function findModel($tahun, $Kd_Urusan, $Kd_Bidang, $Kd_Unit, $Kd_Program, $Kd_Kegiatan)\n {\n if (($model = KegiatanSkpd::findOne(['tahun' => $tahun, 'Kd_Urusan' => $Kd_Urusan, 'Kd_Bidang' => $Kd_Bidang, 'Kd_Unit' => $Kd_Unit, 'Kd_Program' => $Kd_Program, 'Kd_Kegiatan' => $Kd_Kegiatan])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PraktekMahasiswa::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Klien::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = HorarioEstudiante::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Talabalar::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Empleado::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = InfraestructuraEducativa::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=RKPengirimanrmT::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Voucher::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app','Không tồn tại trang yêu cầu'));\n }\n }", "protected function findModel($id)\n {\n if (($model = PermohonanIzin::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SalesFakturBarang::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\r\n {\r\n if (($model = Usertable::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = EnglishKb::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "private function _findModel($id)\n {\n $modelClass = $this->_getModelClass();\n\n if (($model = $modelClass::findOne($id)) === null) {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n return $model;\n }", "protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}", "protected function findModel($id) {\n if (($model = Tblwork::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Persyaratan::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Fenhong::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Tshirt::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Kzone::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Klient::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id){\n\t\t\n\t\t$model=XhTitle::model()->findByPk($id);\n\t\t\n\t\tif($model===null)\n\t\t\t\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t\n\t\treturn $model;\n\t\n\t}", "protected function findModel($id) {\n if (($model = RealEstateMaster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Pegawai::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Kus::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Consulta::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function returnFindByPK($id);", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = TransInfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n if(User::isAdmin()){\n $condition = $id;\n }else{\n $condition = ['id'=>$id,'user_id'=>User::loginUser()['id']];\n }\n if (($model = ExhibitionHall::findOne($condition)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}", "public function loadModel($id)\n\t{\n\t\t$model=Talonario::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Prefix::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = TblSupervisores::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\r\n if (($model = Fltr::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public function loadModel($id) {\n $model = Consultor::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Sfida::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=TDespachoCabecera::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id) {\n if (($model = Recetastbl::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kart::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Jadwal::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = TinTuc::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kareer::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Amphur::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = WorksystemContentinfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\t\tif(($model = Alert::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n {\n $model=Seat::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = SanPham::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = PengirimanKoleksi::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }" ]
[ "0.7034504", "0.69822717", "0.6880581", "0.6879831", "0.67916036", "0.67512184", "0.67037404", "0.67021054", "0.6678447", "0.6670472", "0.66675436", "0.6663013", "0.6654499", "0.66273", "0.6624129", "0.6618539", "0.66180223", "0.66145146", "0.66010976", "0.6598995", "0.65952176", "0.65928054", "0.65921515", "0.65912646", "0.65910804", "0.6590955", "0.6590727", "0.6581613", "0.65814", "0.6572779", "0.6567296", "0.6566776", "0.6560328", "0.65585864", "0.6553047", "0.6551627", "0.65405774", "0.6539155", "0.6536081", "0.6535992", "0.65326166", "0.6530992", "0.6529302", "0.65292495", "0.65276396", "0.65271115", "0.65258807", "0.652314", "0.65217566", "0.65212864", "0.65203655", "0.6520131", "0.65189284", "0.65132564", "0.6509768", "0.6508609", "0.65074575", "0.6503377", "0.6498873", "0.64988637", "0.6497501", "0.64935243", "0.64922196", "0.64891505", "0.6487569", "0.6487394", "0.6486045", "0.64853567", "0.6483912", "0.6480506", "0.6479135", "0.64772314", "0.6476255", "0.6472076", "0.6471859", "0.6469678", "0.6466068", "0.64651304", "0.6463995", "0.64617425", "0.64615464", "0.64613664", "0.646064", "0.64592314", "0.64557815", "0.64503706", "0.6443574", "0.6437976", "0.64329344", "0.64315474", "0.6430019", "0.64282554", "0.6428042", "0.6427588", "0.64249533", "0.642451", "0.6422267", "0.64222246", "0.64206284", "0.64200646" ]
0.6981371
2
check if tanggal_awal less than tanggal akhir
protected function validDate($model){ if($model->tanggal_akhir == null){ return true; } if(strtotime($model->tanggal_awal) < strtotime($model->tanggal_akhir) ){ return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOvertime()\n {\n if($this->jadwalKembali > $this->tanggalKembali){\n return false;\n }else{\n return true;\n }\n }", "public function getTresholdPembayaran ($tahun_sekarang,$semester_sekarang,$data=false) {\n\t\t$total_biaya=($this->isMhsBaru($tahun_sekarang,$semester_sekarang))?$this->getTotalBiayaMhsPeriodePembayaran():$this->getTotalBiayaMhsPeriodePembayaran('lama');\n\t\t$total_biaya_setengah=$total_biaya/2;\t\t\n\t\t$total_bayar_mhs=$this->getTotalBayarMhs ($tahun_sekarang,$semester_sekarang);\t\t\t\t\t\n\t\t$bool=$total_biaya_setengah<=$total_bayar_mhs;\t\n\t\tif ($data) {\n\t\t\t$data=array();\n\t\t\t$data['total_biaya']=$total_biaya;\n\t\t\t$data['total_bayar']=$total_bayar_mhs;\n\t\t\t$data['ambang_pembayaran']=$total_biaya_setengah;\n\t\t\t$data['bool']=$bool;\n\t\t\treturn $data;\n\t\t}else {\n\t\t\treturn $bool;\n }\n\t}", "function ranijiDatum($datum1, $datum2)\n {\n if ($datum1->getGodina() < $datum2->getGodina()) {\n echo \"datum 1 raniji je od datuma 2\";\n } else if ($datum1->getGodina() > $datum2->getGodina()) {\n echo \"datum 2 je raniji od datuma 1\";\n } else if ($datum1->getMesec() < $datum2->getMesec()) {\n echo \"datum 1 je raniji od datuma 2 (godine se poklapaju ali je mesec prvog datuma raniji od meseca drugog datuma)\";\n } else if ($datum1->getMesec() > $datum2->getMesec()) {\n echo \"datum 2 je raniji od datuma 1 (godine se poklapaju ali je mesec drugog datuma raniji od meseca prvog datuma)\";\n } else if (\n $datum1->getMesec() == $datum2->getMesec()\n && $datum1->getDan() < $datum2->getDan()\n ) {\n echo \"datum 1 je raniji od datuma 2(poklapaju se meseci i godine ali je dan prvog datuma raniji od\n dana drugog datuma\";\n } else if ($datum1->getDan() > $datum2->getDan()) {\n echo \"datum 2 je raniji od datuma 1(poklapaju se meseci i godine ali je dan drugog datuma raniji od\n dana prvog datuma\";\n } else {\n echo \"datumi su jednaki\";\n }\n }", "function get_nilai_awal($tanggal_awal, $bulan_sebelum, $tahun, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_nilai_saldo_awal + produk_nilai_saldo_awal2 + produk_nilai_saldo_awal3 + produk_nilai_saldo_awal4) as produk_nilai_saldo_awal,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal = \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\t\t\t\r\n\t\t\treturn $row_saldo_awal->produk_nilai_saldo_awal;\r\n\t\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\t(hpp_nilai_awal + hpp_nilai_masuk - hpp_nilai_keluar) as nilai_awal\r\n\t\t\t\t\tFROM hpp_bulan\r\n\t\t\t\t\tWHERE\r\n\t\t\t\t\t\thpp_bulan = '$bulan_sebelum' AND hpp_tahun = '$tahun'\";\r\n\t\t\t\r\n\t\t\t$rs_sql \t= $this->db->query($sql);\r\n\t\t\t$row_sql\t= $rs_sql->row();\r\n\t\t\t\r\n\t\t\tif($rs_sql->num_rows()>0){\r\n\t\t\t\treturn $row_sql->nilai_awal;\r\n\t\t\t}\r\n\t\t\telse return 0;\r\n\t\t}\r\n\t}", "public function isplata($iznos){\n\n $stanjesalimitom=$this->stanje+$this->limit;\n\n if($iznos<=$stanjesalimitom){\n // $novostanje=$stanjesalimitom-$iznos;\n //echo \"Vas iznos je isplacen<br>\";\n // echo \"Novo stanje na racunu je: \".$novostanje;\n if($iznos>$this->stanje){\n // ovde je kontrolno logika ako klijent ulazi u minus\n $zaduzenje=$iznos-$this->stanje;\n $this->limit-=$zaduzenje;\n $this->stanje=0;\n echo \"Vas iznos je isplacen<br>\";\n echo \"Usli ste u dozvoljeni minus, Vas limit iznosi jos: \".$this->limit;\n\n }else{\n // ako trazi manji iznos od stanja koje ima na racunu\n $this->stanje-=$iznos;\n echo \"Vas iznos je isplacen, novo stanje je: \".$this->stanje;\n }\n\n }else{\n echo \"Nemate dovoljno sredstava na racunu\";\n }\n\n\n\n}", "function absen_tgl($id,$tgl,$bln,$thn)\n{\n\t$data = strtotime(date(\"Y-m-d\"));\n\t$date = date(\"$thn-$bln-$tgl\");\n\tif($data == strtotime($date))\n\t\t$minus = \"\";\n\telse \n\t\t$minus = \"and (jam_keluar is not null and jam_masuk is not null) \";\n\t$t=mysql_query(\"SELECT count(id_absen) as total, keterangan_hadir as hadir FROM absen WHERE id_karyawan='$id' and tanggal_absen='$thn-$bln-$tgl' $minus \") or die(alert_error(mysql_error()));\n\t\n\t$q=mysql_fetch_array($t);\n\tif(mysql_num_rows($t)>0)\n\t{\n\t\tif(@$q['hadir']=='')\n\t\t\t$status=$q['total'];\n\t\telse if(@$q['hadir']=='sakit')\n\t\t\t$status=\"S\";\n\t\telse if(@$q['hadir']=='alfa')\n\t\t\t$status=-1;\n\t\telse if(@$q['hadir']=='izin')\n\t\t\t$status=\"I\";\n\t\telse if(@$q['hadir']=='skd')\n\t\t\t$status=\"skd\";\n\t\telse if(@$q['hadir']=='spd')\n\t\t\t$status=\"spd\";\n\t\telse if(@$q['hadir']=='pulang' || @$q['hadir']=='pulang_libur' || @$q['hadir']=='masuk_setengah_hari')\n\t\t\t$status=\"0.5\";\n\t\telse if(@$q['hadir']=='libur')\n\t\t\t$status=\"lbr\";\n\t\telse if(@$q['hadir']=='out')\n\t\t\t$status=\"out\";\n\t\telse if(@$q['hadir']=='off')\n\t\t\t$status=\"off\";\n\t\telse\n\t\t\t$status=0;\n\n\t}\n\telse\n\t\t$status=0;\n\t\n\treturn $status;\n\t\n\t\n}", "function hitungUmur($thn_lahir, $thn_sekarang){\n $umur = $thn_sekarang - $thn_lahir;\n return $umur;\n}", "function hitung_hari($awal,$akhir){\n\t\t$tglAwal = strtotime($awal);\n\t\t$tglAkhir = strtotime($akhir);\n\t\t$jeda = abs($tglAkhir - $tglAwal);\n\t\treturn floor($jeda/(60*60*24));\n\t}", "function checkHanMuc()\n{\n $SoTien = $_POST[\"SoTien\"];\n $temp = new QuyDinh();\n $temp->getInfo(1);\n if ($SoTien >= $temp->HanMuc)\n echo 0;\n else echo 1;\n}", "public function getSelisihAnggaran()\n\t{\n\t\t$unitkerja=$this->unitkerja;\n\t\t$kegiatan=$this->kegiatan;\n\n\t\t$sql=\"SELECT IF(SUM(jumlah) IS NULL, 0, SUM(jumlah)) AS val FROM value_anggaran WHERE unit_kerja=$unitkerja AND kegiatan=$kegiatan\";\n\t\t$total=Yii::app()->db->createCommand($sql)->queryScalar();\n\t\t\n\t\treturn floor($this->target_anggaran - $total);\n\t}", "public function _validarHelado()\n {\n $listaHelados = Helado::_traerHelados();\n //Son distintos, pasa la validación.(Si y solo si se queda en este valor)\n $retorno = -1;\n if($this->_precio < 0 || $this->_tipo != \"agua\" && $this->_tipo != \"crema\" || $this->_cantidad < 0)\n {\n return 1;\n }\n foreach($listaHelados as $helado)\n { \n if($this->_sabor == $helado->_sabor && $this->_tipo == $helado->_tipo)\n {\n $helado->_cantidad = $this->_cantidad;\n $helado->_precio = $this->_precio;\n Helado::_actualizarHelado($listaHelados);\n $retorno = 0;\n break;\n }\n }\n return $retorno;\n }", "public function VanMegLapAPakliban():bool\r\n {\r\n return ($this->getLapokSzama()>0);\r\n }", "public function egal(KDate $date)\n{\n$egal = false;\nif (strcmp($this->getDateSysteme(), $date->getDateSysteme()) == 0)\t\n\t$egal = true;\nreturn $egal;\n}", "function en_rojo($anio){\n $ar=array();\n $ar['anio']=$anio;\n $sql=\"select sigla,descripcion from unidad_acad \";\n $sql = toba::perfil_de_datos()->filtrar($sql);\n $resul=toba::db('designa')->consultar($sql);\n $ar['uni_acad']=$resul[0]['sigla'];\n $res=$this->get_totales($ar);//monto1+monto2=gastado\n $band=false;\n $i=0;\n $long=count($res);\n while(!$band && $i<$long){\n \n if(($res[$i]['credito']-($res[$i]['monto1']+$res[$i]['monto2']))<-50){//if($gaste>$resul[$i]['cred']){\n $band=true;\n }\n \n $i++;\n }\n return $band;\n \n }", "public function getGrafikPelayanan()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getResultArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray(); \n\n if ($id_jad == NULL) {\n \n $grafik_pelayanan = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->where('pertanyaan.id_unit', 3)->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_pelayanan = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->where('pertanyaan.id_unit', 3)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n\n $grafik_pelayanan = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal', $roow)\n ->where('pertanyaan.id_unit', 3)->get()->getResultArray();\n }\n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_pelayanan as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "public function lessThan(Money $money): bool;", "function terlambat($tgl_dateline, $tgl_kembali) {\n$tgl_dateline_pcs = explode (\"-\", $tgl_dateline);\n$tgl_dateline_pcs = $tgl_dateline_pcs[2].\"-\".$tgl_dateline_pcs[1].\"-\".$tgl_dateline_pcs[0];\n$tgl_kembali_pcs = explode (\"-\", $tgl_kembali);\n$tgl_kembali_pcs = $tgl_kembali_pcs[2].\"-\".$tgl_kembali_pcs[1].\"-\".$tgl_kembali_pcs[0];\n$selisih = strtotime ($tgl_kembali_pcs) - strtotime ($tgl_dateline_pcs);\n$selisih = $selisih / 86400;\nif ($selisih>=1) {\n\t$hasil_tgl = floor($selisih);\n}\nelse {\n\t$hasil_tgl = 0;\n}\nreturn $hasil_tgl;\n}", "function checkSoDu()\n{\n // lay tham so post\n $STK = $_POST[\"TKDi\"];\n $SoTien = $_POST[\"SoTien\"];\n // lay muc phi giao dich\n $QD = new QuyDinh();\n $QD->getInfo(1);\n // kiem tra so du\n $TK = new TKNganHang();\n $SoDu = $TK->getSoDu($STK);\n //\n $SoTien += $QD->MucPhi;\n\n $TK = new TKNganHang();\n $SoDu = $TK->getSoDu($STK);\n ////echo \"<script>alert(\".$SoDu.\");</script>\";\n $SoDuSauKhiChuyen=$SoDu-$SoTien;\n // if ($SoDuSauKhiChuyen<=0)\n // echo 0;\n // else\n echo $SoDuSauKhiChuyen;\n //echo $SoDu;\n //echo $SoDu;\n}", "function minfas($idkost, $tipe_kost)\r\n{\r\n global $koneksi;\r\n $cost = mysqli_query($koneksi, \"SELECT min(biaya_fasilitas) FROM kamar WHERE id_kost=$idkost\");\r\n $p = mysqli_fetch_array($cost);\r\n if ($tipe_kost == \"Bulan\") {\r\n return $p['min(biaya_fasilitas)'];\r\n } else if ($tipe_kost == \"Tahun\") {\r\n return $p['min(biaya_fasilitas)'] * 12;\r\n }\r\n}", "function highLow($data) {\n \t$auction = $this->Auction->find('first', array('conditions' => array('Auction.id' => $this->data['Bidbutler']['auction_id']), 'contain' => '', 'fields' => array('Auction.price','Auction.reverse')));\n\t\tif ($auction['Auction']['reverse'] or Configure::read('App.bidButlerType')=='simple') {\n\t\t\treturn true;\n\t\t}\n\t\t\n \tif(!empty($this->data['Bidbutler']['minimum_price']) && !empty($this->data['Bidbutler']['maximum_price'])) {\n \t\tif($this->data['Bidbutler']['minimum_price'] < $this->data['Bidbutler']['maximum_price']) {\n \t\t\treturn true;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t} else {\n \t\treturn true;\n \t}\n }", "public function lessThanOrEqual(Money $money): bool;", "function minimum ($tab)\r\n{\r\n $min = $tab[0]; // ASTUCE: INITIALISER LA VALEUR AU PREMIER ELEMENT\r\n foreach($tab as $current) \r\n {\r\n if ($current < $min) {\r\n $min = $current; // ON MET A JOUR LA VALEUR MINIMALE\r\n }\r\n }\r\n return $min; // IL FAUT ATTENDRE LA FIN DE LA BOUCLE\r\n}", "function aprovados($nota){\n return $nota >= 7;\n}", "function ge ($value) {\n return '>= '.$value;\n }", "function get_qty_awal($tanggal_awal, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal <= \".$tanggal_awal;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_awal >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur < \".$tanggal_awal.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') >= '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' \r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') <\".$tanggal_awal.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_awal.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "function campare($a,$b){\nif($a == $b)return 0;\nreturn ($a > $b)?1 : -1;\n}", "public function findcheck_tgl($attribute, $params)\n { \n\t\tif (!$this->hasErrors()) {\n\t\t\tif (strtotime(\\Yii::$app->formatter->asDate($this->tanggal1,'Y-M-d')) > strtotime(\\Yii::$app->formatter->asDate($this->tanggal2,'Y-M-d'))) {\n $this->addError($attribute,'Date-End, should be higher or Equal than the Start-Date');\t\t\t\t\n } \n }\n }", "public function ketersediaan_warkah( $lemari = 0, $rak = 0, $album = 0, $laman = 0)\n\t{\n\t\t$penyimpanan = $this->CI->db->query(\"SELECT * FROM tb_simpan_warkah WHERE no_lemari = '{$lemari}' AND no_rak = '{$rak}' AND no_album = '{$album}' AND no_halaman = '{$laman}'\");\n\t\tif (!$penyimpanan->num_rows()) :\n\t\t\t$availability = true;\n\t\telse :\n\t\t\t$availability = false;\n\t\tendif;\n\t\treturn $availability;\n\t}", "function compareDate($from_date, $to_date) {\r\n $from_date = trim($from_date);\r\n $to_date = trim($to_date);\r\n\r\n if ($from_date == $to_date){\r\n return 3;\r\n }\r\n\r\n $waktu_awal = explode(\"-\",$from_date);\r\n $waktu_akhir = explode(\"-\",$to_date);\r\n if ($waktu_awal[0] > $waktu_akhir[0]){\r\n return 2;\r\n }else if ($waktu_awal[0] == $waktu_akhir[0]){\r\n if ($waktu_awal[1] > $waktu_akhir[1]){\r\n return 2;\r\n }else if ($waktu_awal[1] == $waktu_akhir[1]){\r\n if ($waktu_awal[2] > $waktu_akhir[2]){\r\n return 2;\r\n }\r\n }\r\n }\r\n return 1;\r\n}", "public function hitung()\n\t{\n\t\t// \t'bulan' => \"january\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 122,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"february\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 74,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"maret\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 76,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"april\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 86,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"mei\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 203,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"juni\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 187,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"juli\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 90,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"agustus\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 156,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"september\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 84,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"oktober\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 172,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"november\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 118,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"desember\",\n\t\t// \t'tahun' => 2017,\n\t\t// \t'jumlah' => 120,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"january\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 176,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"february\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 65,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"maret\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 55,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"april\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 154,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"mei\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 97,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"juni\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 113,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"juli\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 115,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"agustus\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 95,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"september\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 177,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"oktober\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 123,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"november\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 96,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"desember\",\n\t\t// \t'tahun' => 2018,\n\t\t// \t'jumlah' => 54,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"january\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 131,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"february\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 79,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"maret\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 77,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"april\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 73,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"mei\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 68,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"juni\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 112,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"juli\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 94,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"agustus\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 90,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"september\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 146,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"oktober\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 127,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"november\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 83,\n\t\t// ];\n\t\t// $db_penjualan[] = (object) [\n\t\t// \t'bulan' => \"desember\",\n\t\t// \t'tahun' => 2019,\n\t\t// \t'jumlah' => 30,\n\t\t// ];\n\n\n\t\t\n\t\t#post\n\t\t$tahun = $this->input->post('tahun');\n\t\t$merk = $this->input->post('merk');\n\n\t\t#langkah 1\n\n\t\tif ($merk != \"\" AND $tahun == \"\") {\n\t\t\t$this->db->where('produk.merk', $merk);\n\t\t}else if($tahun != \"\" AND $merk != \"\"){\n\t\t\t$this->db->where('produk.merk', $merk);\n\t\t\t$this->db->where('year(tgl)', $tahun);\n\t\t}else if($tahun != \"\" AND $merk == \"\"){\n\t\t\t$this->db->where('year(tgl)', $tahun);\n\t\t}\n\t\t$db_penjualan = $this->db\n\t\t\t->select('transaksi.*,year(tgl) as tahun,monthname(tgl) as bulan,sum(jumlah) as jumlah')\n\t\t\t->join('transaksi', 'transaksi.id=detailtransaksi.fk_transaksi')\n\t\t\t->join('produk', 'produk.id=detailtransaksi.fk_produk')\n\t\t\t->group_by('year(tgl)')\n\t\t\t->group_by('month(tgl)')\n\t\t\t->get('detailtransaksi')\n\t\t\t->result();\n\n\t\tif(count($db_penjualan) == 0){\n\t\t\techo json_encode([\n\t\t\t\t'error' => 1,\n\t\t\t\t'message' => \"Data Kosong\",\n\t\t\t]);\n\t\t\tdie();\n\t\t}\n\n\t\t$keterangan_data = [];\n\t\t$datas = [];\n\n\t\tforeach ($db_penjualan as $key => $value) {\n\t\t\t$keterangan_data[$key] = $value;\n\t\t\t$datas[$key] = $value->jumlah;\n\t\t}\n\n\t\t#langkah 2\n\t\t$dmin = min($datas);\n\t\t$dmax = max($datas);\n\n\t\t#cons\n\t\t$d1 = 10;\n\t\t$d2 = 7;\n\n\t\t$Himpunan1 = $dmin - $d1;\n\t\t$Himpunan2 = $dmax + $d2;\n\n\n\t\t#cons\n\t\t$jumlah_interval_kelas = 10;\n\n\t\t#langkah 3\n\t\t$data = [];\n\t\tforeach ($datas as $key => $value) {\n\t\t\tif ($key == 0) continue;\n\t\t\t$data[] = abs($datas[$key] - $datas[$key - 1]);\n\t\t}\n\n\t\t$avg_data = array_sum($data) / count($data);\n\n\n\t\t#langkah3.1\n\t\t$b = $avg_data / 2;\n\n\t\t$basis = 0;\n\n\t\tif ($b >= 0.1 && $b <= 1) {\n\t\t\t$basis = 0.1;\n\t\t} else if ($b >= 1.1 && $b <= 10) {\n\t\t\t$basis = 1;\n\t\t} else if ($b >= 11 && $b <= 100) {\n\t\t\t$basis = 10;\n\t\t} else if ($b >= 101 && $b <= 1000) {\n\t\t\t$basis = 100;\n\t\t} else if ($b >= 1001 && $b <= 10000) {\n\t\t\t$basis = 1000;\n\t\t}\n\n\t\t#langka3.2\n\t\t$panjang_interval = ($dmax + $d1 - $dmin + $d2) / $basis;\n\n\n\t\t#langkah4\n\t\t$himpunan_interval = [];\n\t\tfor ($i = $Himpunan1; $i < $Himpunan2; $i += $panjang_interval) {\n\t\t\t$himpunan_interval[] = [\n\t\t\t\t'min' => $i,\n\t\t\t\t'max' => $i + $panjang_interval\n\t\t\t];\n\t\t}\n\n\t\t$nilaitengah_A = [];\n\t\tforeach ($himpunan_interval as $key => $value) {\n\t\t\t$nilaitengah_A[$key] = ($value['min'] + $value['max']) / 2;\n\t\t}\n\n\n\t\t#langkah5\n\t\t$fuzzifikasi = [];\n\t\tforeach ($datas as $key => $value) {\n\t\t\tforeach ($himpunan_interval as $k => $v) {\n\t\t\t\tif ($value >= $v['min'] && $value <= $v['max']) {\n\t\t\t\t\t$fuzzifikasi[$key] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#langkah6\n\t\t$relasi_fuzzy = [];\n\t\tforeach ($fuzzifikasi as $key => $value) {\n\t\t\tif ($key == 0) continue;\n\t\t\t$relasi_fuzzy[] = [\n\t\t\t\t'index_from' => ($key - 1),\n\t\t\t\t'index_to' => ($key),\n\t\t\t\t'from' => $fuzzifikasi[$key - 1],\n\t\t\t\t'to' => $fuzzifikasi[$key],\n\t\t\t];\n\t\t}\n\n\t\t#langkah7\n\t\t$relasi_group_fuzzy = [];\n\t\tforeach ($relasi_fuzzy as $key => $value) {\n\t\t\tif (isset($relasi_group_fuzzy[$value['from']][$value['to']])) {\n\t\t\t\t$relasi_group_fuzzy[$value['from']][$value['to']] += 1;\n\t\t\t} else {\n\t\t\t\t$relasi_group_fuzzy[$value['from']][$value['to']] = 1;\n\t\t\t}\n\t\t}\n\n\t\t#langkah7\n\t\t$matrix = [];\n\t\tforeach ($relasi_group_fuzzy as $key => $value) {\n\t\t\t$sum = array_sum($value);\n\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t$matrix[$key][$k] = $v / $sum;\n\t\t\t}\n\t\t}\n\t\t/*$maxku = max($relasi_group_fuzzy);\n\t\t$coba = [];\n\t\tforeach ($relasi_fuzzy as $boy => $maxku) {\n\t\t\t$coba[$maxku['from']][$maxku['to']];\n\t\t}*/\n\t\t$data_ramalan = [];\n\t\tforeach ($relasi_fuzzy as $key => $value) {\n\t\t\tif ($value['from'] == $value['to']) {\n\n\t\t\t\t$value_to = $value['to'];\n\t\t\t\t$before = 0;\n\t\t\t\tif (isset($matrix[$value_to][$value_to - 1])) {\n\t\t\t\t\t$before = $matrix[$value_to][$value_to - 1] * $nilaitengah_A[$value_to - 1];\n\t\t\t\t}\n\t\t\t\t$after = 0;\n\t\t\t\tif (isset($matrix[$value_to][$value_to + 1])) {\n\t\t\t\t\t$after = $matrix[$value_to][$value_to + 1] * $nilaitengah_A[$value_to + 1];\n\t\t\t\t}\n\t\t\t\t$rumus_many = $before + ($datas[$value['index_to'] - 1] * $matrix[$value_to][$value_to]) + $after;\n\t\t\t\t$data_ramalan[$value['index_to']] = $rumus_many;\n\t\t\t} else {\n\t\t\t\t$data_ramalan[$value['index_to']] = $nilaitengah_A[$value['to']];\n\t\t\t}\n\t\t}\n\n\t\t$chart_label = [];\n\t\t$chart_data_predik = [];\n\t\t$chart_data_aktual = [];\n\t\tforeach ($data_ramalan as $key => $value) {\n\t\t\t$chart_label[] = $keterangan_data[$key]->bulan . \" \" . $keterangan_data[$key]->tahun;\n\t\t\t$chart_data_predik[] = $value;\n\t\t\t$chart_data_aktual[] = $keterangan_data[$key]->jumlah;\n\t\t}\n\n\t\techo json_encode([\n\t\t\t'error' => 0,\n\t\t\t'chart' => [\n\t\t\t\t'label' => $chart_label,\n\t\t\t\t'predik' => $chart_data_predik,\n\t\t\t\t'aktual' => $chart_data_aktual,\n\t\t\t]\n\t\t]);\n\t}", "function compare($wert_a, $wert_b)\n {\n $a = $wert_a[0];\n $b = $wert_b[0];\n if ($a == $b) {\n return 0;\n }\n return ($a > $b) ? -1 : +1;\n }", "public function getGrafikPerpus()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getResultArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray(); \n\n if ($id_jad == NULL) {\n \n $grafik_perpus = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->where('pertanyaan.id_unit', 1)->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_perpus = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->where('pertanyaan.id_unit', 5)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n\n $grafik_perpus = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal', $roow)\n ->where('pertanyaan.id_unit', 5)->get()->getResultArray();\n }\n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_perpus as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "function compare_coal_power($coal1,$coal2){\n\t// must return an integer\n\t$val = $coal1['power']-$coal2['power'];\n\n\tif($val>0){\n\t\treturn -1;\n\t} elseif ($val<0) {\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\n}", "function tanggalan($tanggal) {\n\t\t$tahun = substr($tanggal,6,4);\n\t\t$bulan = substr($tanggal,3,2);\n\t\t$tanggal = substr($tanggal,0,2);\n\t\t$tanggal_antar = $tahun.'-'.$bulan.'-'.$tanggal;\n\t\treturn $tanggal_antar;\n\t}", "public function checking( $th, $tr, $bank, $tgl, $penerimaan ) {\n \t\t$this->dbesamjat->where( 'tgl_batas_penyetoran>=', $this->Fungsi->getdatetimesql_string( $tgl ) );\n \t\t$this->dbesamjat->where( 'id_bank', $bank );\n\t\t$this->dbesamjat->where( 'jenis_transaksi', $tr );\n\t\t$this->dbesamjat->where( 'id_th_anggaran_app', $th );\n\t\t$this->dbesamjat->where( 'id_jenis_tr_esamsat', $penerimaan );\n\n\t\treturn $this->dbesamjat->get( 'dt_no_sts' );\n\n \t}", "public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }", "function kaloriusia($u, $tb, $g){\n\tif($u <=39){\n\t\t$kbu = \"0 kkal \";\n\t}else if($u >=40 && $u <= 59){\n\t\t$kbu = kalorinormal($g, $tb) * 0.05;\n\t}else if($u >=60 && $u <= 69){\n\t\t$kbu = kalorinormal($g, $tb) * 0.1;\n\t}else if($u >69){\n\t\t$kbu = kalorinormal($g, $tb) * 0.2;\n\t}\nreturn $kbu;\n}", "public function isLessThan(self $that): bool;", "public function tampil($sql){\n\t\t\t$query = mysql_query($sql);\n\t\t\tif($query){\n\t\t\t\t$this->jmlBaris = mysql_num_rows($query);\t// Menghitung jumlah baris\n\t\t\t\tfor ($i=0; $i<$this->jmlBaris; $i++) {\n\t\t\t\t\t$r = mysql_fetch_array($query);\t\t// Memasukkan data tiap baris kedalam variabel 'r'\n\t\t\t\t\t$kunci = array_keys($r);\t// Memasukkan nama field kedalam variabel 'kunci'\n\t\t\t\t\tfor($x=0; $x<count($kunci); $x++){\n\t\t\t\t\t\tif(!is_int($kunci[$x])){\n\t\t\t\t\t\t\t$this->hasil[$i][$kunci[$x]] = $r[$kunci[$x]];\t// Memasukkan data kedalam variabel 'hasil'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->pesan = \"Proses Berhasil\";\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t$this->pesan = \"Proses Gagal\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function get_pmin_theo($t100,$v100,$v0) {\r\n\tglobal $mw,$mw_zu,$F_haft,$evmail;\r\n\t# Wieviel Leistung noetig für Beschleunigung 0-100km/h in x Sekunden?\r\n\t# Ausgangsbasis: Annahme nur Haftgrenze:\r\n\t$Pmin=$F_haft*$v100/1000; \t\t\t\t\t # 0-100km/h\r\n\t# 1.Bereich: Konstante Reifenkraftschlussgrenze\r\n\t#\t\tv=a*t ergibt: t=vx*mw/F_haft\r\n\t$vx=$Pmin*1000/$F_haft; # Schnittpunkt von F_haft mit plot_data_hyp - vx in m/s\r\n\t$tx=($vx-$v0)*($mw+$mw_zu)/$F_haft;\t\t\t\t# 0-100km/h\r\n\tif ($tx > $t100) { ### Fall 2 ### \r\n\t\t$error= \"ERROR: Traction not enough for \".$v0*3.6.\"-\".$v100*3.6.\"km/h in $t100\".\"s! Even with drag NOT taken into account.Increase traction by coeff. or axleload, minimize weight or change to AWD.\"; \r\n\t return $error;\r\n\t} else {\t### Fall 3 ### \r\n\t if ($v0 == 0) {$Pmin=ceil($Pmin*$tx/$t100);} # Anpassen von Pmin anhand von Verhaeltnis t100 zu tx, nicht bei 80-120km/h\r\n\t $n=1; $switch=false; $a=$Pmin/20; $b=$Pmin/100; $c=0.5; $d=0.01; # Genauigkeit d # Anfangswerte fuer while-Schleife - $Pmin in kW\r\n\t\twhile (abs($t100-$tx)>$d) {\r\n\t\t\t# Veraenderlicher Teil $Pmin \r\n\t\t\t# -->\r\n\t\t\tif ($t100 > $tx and $switch==false) { # $switch als check zum Schleifen sparen\r\n\t\t\t \t$Pmin=$Pmin-$a; \r\n\t\t\t} elseif ($t100 > $tx and $switch==true) {\r\n\t\t\t \t$Pmin=$Pmin-$c; \r\n\t\t\t} else {$Pmin=$Pmin+$b; $switch=true;}\t\r\n\t\t\t# <-- ENDE Veraenderlicher Teil\t\r\n\t\t\t# Erzeugen des Arrays fuer function getacctimebyforce () // tbd kuerzer mit $plot_data_hyp, weil Abschneiden aller Werte groeßer als F_haft in der Funktion\r\n\t\t\t# -->\t\r\n\t\t\t$plot_data_max = array(); //empty previous array first\r\n\t\t\t$vx=$Pmin*1000/$F_haft; # Schnittpunkt von F_haft mit plot_data_hyp - vx in m/s\r\n\t\t\tfor ($v = 0; $v <= 300 && $v < $vx*3.6; $v += 10) { # $v in km/h\r\n\t\t\t $plot_data_max[] = array('',$v,$F_haft);\r\n\t\t\t}\r\n\t\t\tif ($vx*3.6!=ceil($vx*3.6/10)*10) {\r\n\t\t\t\t$plot_data_max[] = array('',$vx*3.6,$F_haft); # Einfuegen des Schnittpunkts \r\n\t\t\t\t}\r\n\t\t\tfor ($v = ceil($vx*3.6/10)*10; $v <= 300; $v += 10) { # $v in km/h\r\n\t\t\t\t$Fmax=round($Pmin*1000/($v/3.6),1); # $v in m/s\r\n\t\t\t $plot_data_max[] = array('',$v,$Fmax);\r\n\t\t\t}\r\n\t\t\t# <-- ENDE Erzeugen des Arrays\r\n\t if ($v0 != 0) { // tbd static if? or switch-case? for not calling if in every loop\r\n\t\t\t $tx= round(getacctimebyforce($plot_data_max,$v100)-getacctimebyforce($plot_data_max,$v0),3); \r\n\t\t\t} else {\r\n\t\t\t \t$tx= round(getacctimebyforce($plot_data_max,$v100),3);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// echo \"$n: $t100, $tx , $vx , $Pmin <br>\";\t// for checking while loop\t\r\n\t\t\t\r\n\t\t\t//////////////// Troubleshooting: --> ////////////////\r\n\t\t\tif ($Pmin >= ($F_haft*$v100/1000)+1) { # falls Traktion inkl. Fahrtwiderstaende nicht ausreicht\r\n\t\t\t\t$error= \"ERROR: Traction not enough for \".$v0*3.6.\"-\".$v100*3.6.\"km/h in $t100\".\"s! Drag taken into account. Increase traction by coeff. or axleload, minimize weight or change to AWD.\";\r\n\t\t\t \treturn $error;\r\n\t\t\t}\t\r\n\t\t\t$n++; // for counting while loops \t\t\t\r\n\t\t\tif ($n > 40) { $c=0.1;};\r\n\t\t\tif ($n > 80) { $d=0.05;};\r\n\t\t\tif ($n > 200) { //tbd 3.8 @ average throws this ERROR\r\n\t\t\t\t$error= \"ERROR: Minimum Power required \".$v0*3.6.\"-\".$v100*3.6.\"km/h in $t100\".\"s could not be calculated. Please contact EV Wizard via email: $evmail.\"; \r\n\t\t\t return $error;} \r\n\t\t\t//////////////// <-- Troubleshooting ////////////////\r\n\t\t}; // <-- END while\r\n\t\tif (isset($Pmin) && is_float($Pmin)) { \r\n\t\t\t$Pmin100=ceil($Pmin);\r\n\t\t\treturn $Pmin100;\r\n\t\t} else {\r\n\t\t\t $error= \"ERROR: Have you just found a bug??? O_o Please tell us about it via email: $evmail.\"; \r\n\t\t\t return $error;\r\n\t\t}\t\t \t\r\n};}", "function isNaikGaji($conn,$idpegawai,$tglkgb){\n\t\t\t$tglkgb = Cstr::formatDate($tglkgb);\n\t\t\t$bln = substr($tglkgb,5,2);\n\t\t\t$isnaik = true;\n\t\t\t//cek apakah pegawai sudah diproses naik pangkat\n\t\t\t$kgb = $conn->GetOne(\"select idpegawai from \".self::table('pe_kgb').\" \n\t\t\t\t\twhere idpegawai = $idpegawai and datepart(month,tglkgb)='$bln'\");\n\t\t\t\t\t\n\t\t\n\t\t\tif(!empty($kgb))\n\t\t\t\t$isnaik = false;\n\t\t\t\t\n\t\t\t//mendapatkan next pangkat\n\t\t\t$rown = mKenaikan::getNaikGaji($conn,$idpegawai,$tglkgb);\n\t\t\t\n\t\t\t//cek untuk status pegawai yang naik pangkat\n\t\t\t$sql = \"select p.idpegawai,coalesce(p.nik+' - ','')+\".static::schema.\".f_namalengkap(p.gelardepan,p.namadepan,p.namatengah,p.namabelakang,p.gelarbelakang) as pegawai,\n\t\t\t\t\tu.kodeunit+' - '+u.namaunit as namaunit,pl.golongan as golonganlama,p.tmtpangkat as tmtpangkatlama,cast(p.masakerjathngol as varchar)+' tahun '+cast(p.masakerjablngol as varchar)+' bulan' as mklama,\n\t\t\t\t\t'\".$rown['idpangkat'].\"' as pangkatbaru,'\".$rown['tmtpangkat'].\"' as tmtpangkat,substring(right(replicate('0', 4) + cast(\".$rown['mkg'].\" as varchar), 4),1,2) as mkthn, substring(right(replicate('0', 4) + cast(\".$rown['mkg'].\" as varchar), 4),3,2) as mkbln\n\t\t\t\t\tfrom \".self::table('ms_pegawai').\" p\n\t\t\t\t\tleft join \".self::table('ms_unit').\" u on u.idunit=p.idunit\n\t\t\t\t\tleft join \".self::table('ms_pangkat').\" pl on pl.idpangkat=p.idpangkat\n\t\t\t\t\tleft join \".self::table('pe_kgb').\" k on k.idpegawai=p.idpegawai and k.tglkgb = '$tglkgb'\n\t\t\t\t\twhere p.idpegawai = $idpegawai and p.idstatusaktif = 'AA'\";\n\t\t\t$row = $conn->GetRow($sql);\t\n\t\t\t\t\t\t\n\t\t\tif(empty($row))\n\t\t\t\t$isnaik = false;\n\t\t\t\t\n\t\t\t$a_data = array('kgb' => $kgb, 'row' => $rown, 'isnaik' => $isnaik, 'sql' => $sql);\n\t\t\t\n\t\t\treturn $a_data;\n\t\t}", "public function ketersediaan_buku( $lemari = 0, $rak = 0, $album = 0, $laman = 0)\n\t{\n\t\t$penyimpanan = $this->CI->db->query(\"SELECT * FROM tb_simpan_buku WHERE no_lemari = '{$lemari}' AND no_rak = '{$rak}' AND no_album = '{$album}' AND no_halaman = '{$laman}'\");\n\t\tif (!$penyimpanan->num_rows()) :\n\t\t\t$availability = true;\n\t\telse :\n\t\t\t$availability = false;\n\t\tendif;\n\t\treturn $availability;\n\t}", "public function isSmallerOrEqual(ilADT $a_adt)\n\t{\n\t\treturn ($this->equals($a_adt) ||\n\t\t\t$this->isSmaller($a_adt));\n\t}", "function _compareItemAndBuyMinLimt()\r\n {\r\n if (empty($this->data[$this->name]['max_limit']) || $this->data[$this->name]['max_limit'] >= $this->data[$this->name]['buy_min_quantity_per_user']) {\r\n return true;\r\n }\r\n return false;\r\n }", "function in_crenaux(int $heure, array $crenaux) :string{\r\n foreach($crenaux as $crenau){\r\n $debut = $crenau[0];\r\n $fin = $crenau[1];\r\n if($heure >= $debut && $heure < $fin){\r\n return <<<HTML\r\n <div class =\"alert alert-success\">Le magasin est ouvert! </div>\r\nHTML;\r\n }\r\n\r\n }\r\n return <<<HTML\r\n <div class =\"alert alert-danger\">Le magasin est fermé! </div>\r\nHTML;\r\n}", "function renvoyerMin ($tabNombre)\n { // SI JE VEUX PRENDRE CHAQUE ELEMENT D'UN TABLEAU\n // => BOUCLE\n // IL FAUT DONNER UNE VALEUR A $plusPetit\n $plusPetit = $tabNombre[0]; // ON PREND LA PREMIERE VALEUR\n foreach($tabNombre as $nombre)\n {\n // SI JE COMPARE DES VALEURS => CONDITION\n if ($nombre < $plusPetit)\n {\n // $nombre EST PLUS PLUS PETIT QUE $plusPetit\n // DONC $nombre DEVIENT LE PLUS PETIT\n $plusPetit = $nombre;\n }\n } \n\n return $plusPetit;\n }", "function compareDate($date2){\n\t\t\t// mendapatkan jumlah selisih dari tanggal yang anda masukan pada kontruktor awal dan tanggal yang anda masukkan pada parameter method ini\n\t\t\t$t = strtotime($date2);\n\t\t\t$gregorian1 = gregoriantojd($this->_m,$this->_d,$this->_y); // dapatkan format julian day dari tanggal awal\n\t\t\t$gregorian2 = gregoriantojd(date('m',$t),date('d',$t),date('Y',$t)); // dapatkan format julian day dari tanggal akhir\n\t\t\t$diff = $gregorian2 - $gregorian1;\n \n\t\t\treturn $diff; // kembalikan hasil selisih tanggal\n\t\t}", "public function isLessThanOrEqualTo(self $that): bool;", "function o_lt($a, $b) {\n\t\t\treturn Obj::singleton()->lessThan($a, $b);\n\t\t}", "function waktu_lalu($timestamp){\n $selisih = time() - strtotime($timestamp) ;\n $detik = $selisih ;\n $menit = round($selisih / 60 );\n $jam = round($selisih / 3600 );\n $hari = round($selisih / 86400 );\n $minggu = round($selisih / 604800 );\n $bulan = round($selisih / 2419200 );\n $tahun = round($selisih / 29030400 );\n if ($detik <= 60) {\n $waktu = $detik.' detik yang lalu';\n } else if ($menit <= 60) {\n $waktu = $menit.' menit yang lalu';\n } else if ($jam <= 24) {\n $waktu = $jam.' jam yang lalu';\n } else if ($hari <= 7) {\n $waktu = $hari.' hari yang lalu';\n } else if ($minggu <= 4) {\n $waktu = $minggu.' minggu yang lalu';\n } else if ($bulan <= 12) {\n $waktu = $bulan.' bulan yang lalu';\n } else {\n $waktu = $tahun.' tahun yang lalu';\n }\n return $waktu;\n}", "function o_le($a, $b) {\n\t\t\treturn Obj::singleton()->lessThanOrEqual($a, $b);\n\t\t}", "public function getGrafikTotal()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getRowArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray();\n \n \n if ($id_jad == NULL) {\n\n $grafik_total = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_total = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n $grafik_total = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal',$roow)\n ->get()->getResultArray();\n } \n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_total as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "public function luas_Persegi()\n {\n $hitung = $this->lebar * $this->panjang;\n return $hitung;\n }", "function age($age){\n if($age >= 1 && $age <= 17){\n echo \"Mineur\";\n } else if($age >= 18){\n echo \"Majeur\";\n } else {\n echo \"Erreur\";\n }\n}", "function get_qty_akhir($tanggal_akhir, $produk_id){\r\n\t\t$sql_saldo_awal=\r\n\t\t \"SELECT\r\n\t\t\t\t(produk_saldo_awal + produk_saldo_awal2 + produk_saldo_awal3 + produk_saldo_awal4) / konversi_nilai as jumlah,\r\n\t\t\t\tproduk_tgl_nilai_saldo_awal\r\n\t\t\tFROM produk, satuan_konversi\r\n\t\t\tWHERE \r\n\t\t\t\tkonversi_produk = produk_id\r\n\t\t\t\tAND\tkonversi_default = true\r\n\t\t\t\tAND\tproduk_id = '\".$produk_id.\"'\r\n\t\t\t\tAND produk_tgl_nilai_saldo_awal < \".$tanggal_akhir;\r\n\t\t\t\t\r\n\t\t$rs_saldo_awal\t= $this->db->query($sql_saldo_awal) or die(\"Error - 1.1 : \".$sql_saldo_awal);\r\n\t\t\r\n\t\t//dari hasil query di atas, akan diketahui apakah tanggal_akhir >= produk_tgl_nilai_saldo_awal? jika tidak maka return 0\r\n\t\tif($rs_saldo_awal->num_rows()>0){\r\n\t\t\t\t\t\r\n\t\t\t$row_saldo_awal\t= $rs_saldo_awal->row();\r\n\t\t\r\n\t\t\t//Saldo transaksi, dihitung sejak produk_tgl_nilai_saldo_awal di master produk\r\n\t\t\t$sql = \"SELECT\r\n\t\t\t\t\t\tSUM(stok_masuk - stok_keluar) as stok_saldo\r\n\t\t\t\t\tFROM\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\tks.ks_masuk as stok_masuk,\r\n\t\t\t\t\t\t\tks.ks_keluar as stok_keluar\r\n\t\t\t\t\t\tFROM kartu_stok_fix ks\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = ks.ks_satuan_id) AND (sk.konversi_produk = ks.ks_produk_id)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\tks.ks_produk_id = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND ks.ks_tgl_faktur BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tUNION ALL\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tSELECT\r\n\t\t\t\t\t\t\t0 as stok_masuk,\r\n\t\t\t\t\t\t\td.cabin_jumlah as stok_keluar\r\n\t\t\t\t\t\tFROM detail_pakai_cabin d\r\n\t\t\t\t\t\tLEFT JOIN satuan_konversi sk ON (sk.konversi_satuan = d.cabin_satuan) AND (sk.konversi_produk = d.cabin_produk)\r\n\t\t\t\t\t\tWHERE \r\n\t\t\t\t\t\t\td.cabin_produk = '\".$produk_id.\"'\r\n\t\t\t\t\t\t\tAND date_format(cabin_date_create,'%Y-%m-%d') BETWEEN '\".$row_saldo_awal->produk_tgl_nilai_saldo_awal.\"' AND \".$tanggal_akhir.\"\r\n\t\t\t\t\t) \r\n\t\t\t\t\tAS ks_gabungan\";\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$query = $this->db->query($sql);\r\n\t\t\r\n\t\t\r\n\t\t\tif($query->num_rows()>0){\r\n\t\t\t\t$row = $query->row();\r\n\t\t\t\t$total = $row_saldo_awal->jumlah + $row->stok_saldo;\r\n\t\t\t\t//print_r(' sql: '.$sql.', saldo awal: '.$row_saldo_awal->jumlah.', stok saldo: '.$row->stok_saldo);\r\n\t\t\t\treturn $total;\r\n\t\t\t}\r\n\t\t\telseif($query->num_rows()==0){\r\n\t\t\t\treturn $row_saldo_awal->jumlah;\r\n\t\t\t\t//print_r($tanggal_akhir.$row_saldo_awal->jumlah);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "function jumlahkalori($tb, $g, $av, $u){\n\n\t$jumlah = kalorinormal($g, $tb) + kaloriaktivitas($av, $tb, $g) - kaloriusia($u, $tb, $g) ;\n\n\treturn $jumlah;\n}", "function kaloriaktivitas($av, $tb, $g){\n\tif($av == \"Ringan\"){\n\t\t$kba = kalorinormal($g, $tb) * 0.2;\n\t}else if($av == \"Sedang\"){\n\t\t$kba = kalorinormal($g, $tb) * 0.3;\n\t}else if($av == \"Berat\"){\n\t\t$kba = kalorinormal($g, $tb) * 0.5;\n\t}\nreturn $kba;\n}", "function compare_user_data($a, $b) {\n if ($a['won'] == $b['won']) {\n return 0;\n } else if ($a['won'] > $b['won']) {\n return -1;\n } else {\n return 1;\n }\n}", "public function berekenInkoopWaarde() {\n //var_dump(['aantal'=>$this->aantal, 'waarde'=>$this->artikel->verkoopprijs]);\n return $this->aantal * $this->artikel->inkoopprijs;\n }", "public function berekenVerkoopWaarde() {\n return $this->aantal * $this->artikel->verkoopprijs;\n }", "public function tanggal_undaran($tgl){\n\t\t$query=\"SELECT tanggal AS tgl, tempat FROM penjadwalan \n\t\t\t\tWHERE jenis_ujian = 'UNDARAN' AND tanggal = '$tgl'\"; //untuk menampilkan tanggal dari tabel penjadwalan\n\t\t$this->eksekusi($query); //untuk mengeksekusi query diatas\n\t\treturn $this->result; //untuk hasil query diatas\n\t}", "function solucion($fecha1, $fecha2){\r\n $respuesta=false;\r\nif($fecha1 < $fecha2){\r\n //$respuesta=true\r\n echo \"es mayor\" (date(\"d-m-Y\",$fecha1));\r\n}else{\r\n\techo \"La fecha menor\";\r\n }\r\nreturn $respuesta; \r\n }", "public function ambilAngsuranPembiayaanBerdasarkanDuaTanggal($tanggalAwal, $tanggalAkhir)\n {\n return $this->db->query(\"SELECT bagi_hasil_anggota, bagi_hasil_koperasi FROM tb_angsuran_pembiayaan WHERE tanggal_pembayaran_angsuran BETWEEN \" . \"'\" . $tanggalAwal . \"' AND '\" . $tanggalAkhir . \"'\")->result();\n }", "function toekomst($datum) {\n $vandaagdatum = date(\"Y-m-d\");\n $vandaag = strtotime($vandaagdatum);\n $anderedatum = strtotime($datum);\n return ($vandaag <= $anderedatum);\n}", "function pengurangan($first_number,$second_number){\n\t\t\t\t// variabel kurang\n\t\t\t\t$kurang = $first_number - $second_number;\n\t\t\t\techo \"Pengurangan $first_number - $second_number = $kurang <br><br>\";\n\t\t\t}", "public function lessThan($value);", "function maxGetal($getal1, $getal2){\n $input1 = doubleval($_POST['eerstegetal']);\n $input2 = doubleval($_POST['tweedegetal']);\n if($getal1>$getal2){\n return($getal1);\n }elseif($getal2>$getal1){\n return($getal2);\n }else{return(\"gelijk\");}\n}", "function compare($d1, $d2)\r\n {\r\n $d1->convertTZ(new Date_TimeZone('UTC'));\r\n $d2->convertTZ(new Date_TimeZone('UTC'));\r\n $dias1 = Data_Calc::dataParaDias($d1->dia, $d1->mes, $d1->ano);\r\n $dias2 = Data_Calc::dataParaDias($d2->dia, $d2->mes, $d2->ano);\r\n if($dias1 < $dias2) return -1;\r\n if($dias1 > $dias2) return 1;\r\n if($d1->hora < $d2->hora) return -1;\r\n if($d1->hora > $d2->hora) return 1;\r\n if($d1->minuto < $d2->minuto) return -1;\r\n if($d1->minuto > $d2->minuto) return 1;\r\n if($d1->segundo < $d2->segundo) return -1;\r\n if($d1->segundo > $d2->segundo) return 1;\r\n return 0;\r\n }", "private function choixEffectuer()\n {\n $valider = false;//on mets le forrmulaire a faux\n $valeur = $this->recupValeur($this->position['valeur']);//on recupêre la valeur a comparer\n\n if($this->position['egal'])\n {\n \n if($this->choix == $valeur)\n {\n $valider = true;\n }\n }\n else if($this->position['different'])\n {\n \n if($this->choix != $valeur)\n {\n $valider = true;\n }\n }\n else\n {\n Erreur::declarer_dev(27);\n }\n\n return $valider;\n\n }", "public function isk_compare($a, $b) {\n\t\t/*\n\t\t * cast to int since it might be misbehaving with float\n\t\t *\n\t\t */\n\t\t$t1 = $a ['total'];\n\t\t$t2 = $b ['total'];\n\t\t\n\t\treturn $t2 - $t1;\n\t\t// return $t2 - $t1;\n\t}", "function wp_pre_kses_less_than($content)\n {\n }", "public function crt_min()\n {\t\t\n\n \t$crt = $this->input->post('crt_update');\n\t\t\t$ob = $this->input->post('ob_update');\n\t\t\t$inc = $this->input->post('inc_update');\n\t\t\t$crt_new = $this->input->post('crt_new');\n\t\t\t$totalOB = $ob + $inc;\n\t\t\t$totalCRT = $crt + $inc;\n\n\t \t\tif ($crt ==0){\n\t\t \t\t\tif ($crt_new < $totalOB)\n\t\t\t\t {\n\t\t\t\t $this->form_validation->set_message('crt_min', 'Bidding harus sama dengan atau lebih besar dari Next Minimum Bidding');\n\t\t\t\t return FALSE;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t return TRUE;\n\t\t\t\t }\n\t\t }\n\t\t else {\n\t\t \t\t\tif ($crt_new < $totalCRT)\n\t\t\t\t {\n\t\t\t\t $this->form_validation->set_message('crt_min', 'Bidding harus sama dengan atau lebih besar dari Next Minimum Bidding');\n\t\t\t\t return FALSE;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t return TRUE;\n\t\t\t\t }\n\t\t }\n \n }", "private function evallessthan($value, $data){\n\t\t\treturn (bool) $passed = ($data < $value) ? true : false;\n\t\t}", "function advancedPrice($data) {\n \tif(Configure::read('App.bidButlerType') == 'advanced') {\n \t\t$auction = $this->Auction->find('first', array('conditions' => array('Auction.id' => $this->data['Bidbutler']['auction_id']), 'contain' => '', 'fields' => array('Auction.price','Auction.reverse')));\n \t\tif ($auction['Auction']['reverse']) {\n \t\t\treturn true;\n \t\t} else {\n\t\t\t\tif($data['minimum_price'] - $auction['Auction']['price'] < 0.01) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n \t} else {\n \t\treturn true;\n \t}\n }", "public function rgveda_verse_modern($gra) {\n $data = [\n [1,191,1,1,191],\n [192,234,2,1,43],\n [235,295,3,1,62],\n [297,354,4,1,58],\n [355,441,5,1,87],\n [442,516,6,1,75],\n [517,620,7,1,104],\n [621,668,8,1,48],\n [1018,1028,8,59,59], //Vālakhilya hymns 1—11\n [669,712,8,60,103],\n [713,826,9,1,114],\n [827,1017,10,1,191]\n ];\n for($i=0;$i<count($data);$i++) {\n list($gra1,$gra2,$mandala,$hymn1,$hymn2) = $data[$i];\n if (($gra1 <= $gra) && ($gra<=$gra2)) {\n $hymn = $hymn1 + ($gra - $gra1);\n $x = \"$mandala.$hymn\";\n return $x;\n }\n }\n return \"?\"; // algorithm failed\n}", "public function compare($t1, $t2)\n {\n // Zwangsabstieg prüfen\n if ($t1['static_position']) {\n return 1;\n }\n if ($t2['static_position']) {\n return -1;\n }\n\n // Zuerst die Punkte\n if ($t1['points'] == $t2['points']) {\n // tx_rnbase_util_Debug::debug($t1,'compare'.__LINE__);\n // Die gewonnenen Spiele prüfen\n if ($t1['winCount'] == $t2['winCount']) {\n // Jetzt den Satzquotient prüfen\n $t1setquot = $t1['sets_quot'];\n $t2setquot = $t2['sets_quot'];\n if ($t1setquot == $t2setquot) {\n // Jetzt der Ballquotient\n $t1balls = $t1['balls_quot'];\n $t2balls = $t2['balls_quot'];\n if ($t1balls == $t2balls) {\n // Und jetzt der direkte Vergleich\n $baseData = Util::prepareH2H($this->_teamData, $t1, $t2);\n $t1vst2 = $baseData['t1vst2'];\n $t2vst1 = $baseData['t2vst1'];\n $t1H2HPoints = $baseData['t1H2HPoints'];\n $t2H2HPoints = $baseData['t2H2HPoints'];\n if ($t1H2HPoints == $t2H2HPoints) {\n // dann eben zuerst die Satzdifferenz der 2 Spiele prüfen (Hin- und Rückspiel)\n $t1H2HDiff = 0 + $t1vst2[0] + $t2vst1[1] - $t1vst2[1] - $t2vst1[0];\n $t2H2HDiff = 0 + $t1vst2[1] + $t2vst1[0] - $t1vst2[0] - $t2vst1[1];\n if ($t1H2HDiff == $t2H2HDiff) {\n return 0; // Gleichstand. Entscheidungsspiel wird nicht beachtet\n }\n\n return $t1H2HDiff > $t2H2HDiff ? -1 : 1;\n }\n\n return $t1H2HPoints > $t2H2HPoints ? -1 : 1;\n }\n\n return $t1balls > $t2balls ? -1 : 1;\n }\n\n return $t1setquot > $t2setquot ? -1 : 1;\n }\n\n return $t1['winCount'] > $t2['winCount'] ? -1 : 1;\n }\n\n return $t1['points'] > $t2['points'] ? -1 : 1;\n }", "function above (float $value, float $min) : float\n{\n return $value < $min ? $min : $value;\n}", "function procesar_vinculo ($datos){\n $hora_inicio=$this->s__aula_disponible['hora_inicio'];\n $hora_inicio_datos=\"{$datos['hora_inicio']}:00\";\n $hora_fin=$this->s__aula_disponible['hora_fin'];\n $hora_fin_datos=\"{$datos['hora_fin']}:00\";\n \n if(($hora_inicio_datos < $hora_fin_datos) && (($hora_inicio_datos >= $hora_inicio) && ($hora_inicio_datos <= $hora_fin)) && ($hora_fin_datos <= $hora_fin)){\n $this->procesar_carga($datos);\n $this->s__accion=\"Nop\";\n }\n else{\n $mensaje=\" El horario especificado no pertenece al rango disponible : $hora_inicio y $hora_fin hs \";\n toba::notificacion()->agregar($mensaje);\n }\n }", "function gibtWeiterGeleitschutz($jaeger_id) {\n $schiff_infos = @mysql_query(\"SELECT flug, zielid FROM skrupel_schiffe WHERE id='$jaeger_id'\");\n $schiff_infos = @mysql_fetch_array($schiff_infos);\n if($schiff_infos['flug'] != 4) return false;\n $ziel_schiff = $schiff_infos['zielid'];\n $ziel_infos = @mysql_query(\"SELECT schaden FROM skrupel_schiffe WHERE id='$ziel_schiff'\");\n $ziel_infos = @mysql_fetch_array($ziel_infos);\n\n return ($ziel_infos['schaden'] <= eigenschaften::$jaeger_infos->max_jaeger_schaden);\n }", "function get_transactions_above_value($threshold){\n $str_query=\"select * from pos_transaction where value>='$threshold'\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }", "public function passes($attribute, $value)\n {\n return $this->kode != null and $value <= $this->kode->peminjaman;\n }", "public function getGrafikSarpras()\n {\n $tgl_skrg = Time::now('Asia/Jakarta')->toDateString();\n $id_jad = $this->db->table('jadwal')->select('id_jadwal')->get()->getResultArray();\n $id_kat = $this->db->table('jadwal')->get()->getRowArray();\n\n if ($id_jad == NULL) {\n \n $grafik_sarpras = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal')\n ->where('pertanyaan.id_unit', 2)->get()->getResultArray();\n\n }elseif (($id_kat['tgl_mulai'] <= $tgl_skrg) && ($id_kat['tgl_akhir'] >= $tgl_skrg)){\n\n $grafik_sarpras = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('jadwal.tgl_mulai <=', $tgl_skrg)->where('jadwal.tgl_akhir >=', $tgl_skrg)\n ->where('pertanyaan.id_unit', 2)\n ->get()->getResultArray();\n }else {\n $row =$this->db->table('jadwal')->limit(1)->orderBy('id_jadwal',\"DESC\")->get()->getRowArray();\n $roow = $row['id_jadwal'];\n\n $grafik_sarpras = $this->db->table('hsl_survei')->select('jadwal.id_jadwal, opsi.opsi')\n ->join('pertanyaan','pertanyaan.id_pert=hsl_survei.id_pert', 'left')\n ->join('jadwal','jadwal.id_jadwal=hsl_survei.id_jadwal', 'left')\n ->join('opsi','opsi.id_ops=hsl_survei.opsi')\n ->where('hsl_survei.id_jadwal', $roow)\n ->where('pertanyaan.id_unit', 2)->get()->getResultArray();\n } \n\n $sangatBaik = 0;\n $baik = 0;\n $tidakBaik = 0;\n $sangatTidakBaik = 0;\n foreach ($grafik_sarpras as $grafik):\n if ($grafik['opsi'] == \"Sangat Baik\") {\n $sangatBaik = $sangatBaik + 1;\n }\n elseif($grafik['opsi'] == \"Baik\"){\n $baik = $baik + 1;\n }\n elseif($grafik['opsi'] == \"Tidak Baik\"){\n $tidakBaik = $tidakBaik + 1;\n }\n elseif($grafik['opsi'] == \"Sangat Tidak Baik\"){\n $sangatTidakBaik = $sangatTidakBaik + 1;\n }\n endforeach;\n\n $data = [$sangatBaik, $baik, $tidakBaik, $sangatTidakBaik];\n return $data;\n }", "function vek($rokNarodenia)\n {\n return 2021 - $rokNarodenia;\n }", "function validasi_masukan_minimal(&$pesan_error, $name, $panjang) {\n //mengecek jika panjang masukan masih kurang dari ketentuan minimal\n if (strlen(@$_POST[$name])<$panjang) $pesan_error[$name] = 'Panjang minimal harus '.$panjang.' karakter';\n}", "private function unbalancedSupply() {\n $rapporto = $_POST['quantitaCercata'] / $_POST['quantitaOfferta'];\n if ($rapporto >= 0.5 && $rapporto <= 2)\n return false;\n return true;\n }", "function klasifikasi(){\n\t\t$klasifikasi['data']=$this->mamdani->getdata();\n\t\t$klasifikasi['klas']=$this->mamdani->klasifikasi3();\n\t\t\t\t\n\t\tforeach ($klasifikasi['data'] as $key) {\n\t\t$id=$key->id;\n\t\t$tot= $key->total_bobot;\n\t\tforeach($klasifikasi['klas'] as $data){\n\t\t\tif(($data->min <= $key->total_bobot) && ($key->total_bobot <= $data->max)){\n\t\t\t\t// $ting[]= $data->nama; \n\t\t\t\t$this->db->query(\"UPDATE tb_klasifikasi_penduduk SET klasifikasi='$data->nama' where id='$key->id' \");\n\t\t\tbreak;\n\t\t}\n\t}\n\t}\n\tredirect('fuzzy/view_hasil_klasifikasi_penduduk');\n}", "public function isSquare(){\n if($this->panjang == $this->lebar){\n return true; // Persegi\n } else{\n return false; // Bukan persegi\n }\n }", "function tanggal_sql($tanggal)\n{\n if ($tanggal) {\n // pisahkan berdasarkan -\n $pisahkan_tanggal = explode(\"-\", $tanggal);\n // atur tanggal ke yyyy-mm-dd\n $tanggal_sql = $pisahkan_tanggal[2] . '-' . $pisahkan_tanggal[1] . '-' . $pisahkan_tanggal[0];\n return $tanggal_sql;\n } else {\n // atur ke nol\n return \"0000-00-00\";\n }\n}", "public function check_peminjaman(){\n\t\t$tbl_peminjaman_inventaris = $this->db->query(\" SELECT a.kodepeminjam_user, a.kode_inventaris, \n\t\t\tCASE \n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='0' THEN 'Menunggu Konfirmasi'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='1' THEN 'Batal Pinjam'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() >0) THEN 'Belum Kembali'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() <0) THEN 'Terlambat'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='1' THEN 'Sudah Kembali'\n\t\t\tEND as keterangan\n\t\t\tFROM tbl_peminjaman_inventaris a \n\t\t\tLEFT JOIN tbl_inventaris b ON a.kode_inventaris=b.kode_inventaris\n\t\t\tLEFT JOIN tbl_user c ON a.kodepeminjam_user=c.kodepeminjam_user\n\t\t\tWHERE (CASE \n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='0' THEN 'Menunggu Konfirmasi'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='0' AND a.konfirmasi_kembali='1' THEN 'Batal Pinjam'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() >0) THEN 'Belum Kembali'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='0' AND (UNIX_TIMESTAMP(a.tanggal_kembali) - UNIX_TIMESTAMP() <0) THEN 'Terlambat'\n\t\t\t\tWHEN a.konfirmasi_peminjaman='1' AND a.konfirmasi_kembali='1' THEN 'Sudah Kembali'\n\t\t\tEND)='Terlambat'\n\t\t\torder by created_peminjaman DESC\")->result();\n\t\tforeach($tbl_peminjaman_inventaris as $peminjaman_inventaris){\n\t\t\t$tbl_user = $this->db->query(\"select GROUP_CONCAT(CONCAT('{',a.user_name,' - ',a.notelp_user,'}')) as admin from tbl_user a where a.level_user='administrator'\")->row();\n\t\t\t$where2['kode_inventaris'] = $peminjaman_inventaris->kode_inventaris;\n\t\t\t$inventaris = $this->m_general->view_by(\"tbl_inventaris\",$where2);\n\t\t\t$pesan = \"Anda terlambat mengembalikan { $inventaris->kode_inventaris } { $inventaris->nama_inventaris }, Mohon segera untuk menghubungi pihak Labor Komputer FASILKOM UNILAK: $tbl_user->admin, Terimakasih.\";\n\t\t\t$id_inbox = $this->m_general->bacaidterakhir(\"tbl_inbox\", \"id_inbox\");\n\t\t\t$inbox = array(\n\t\t\t\t\t'id_inbox' => $id_inbox,\n\t\t\t\t\t'isi_inbox' => $pesan,\n\t\t\t\t\t'kodepeminjam_user' => $peminjaman_inventaris->kodepeminjam_user\n\t\t\t);\n\t\t\t$this->m_general->add(\"tbl_inbox\", $inbox);\t\t\t\t\n\t\t}\n\t}", "abstract public function isLarger(ilADT $a_adt);", "function subsub_awal($kode, $gol, $ps, $pt)\n{\n $param_satker = $ps;\n $splitKodeSatker = explode ('.', $param_satker);\n if(count ($splitKodeSatker) == 4) {\n $paramSatker = \"kodeSatker = '$param_satker'\";\n } else {\n $paramSatker = \"kodeSatker like '$param_satker%'\";\n }\n $param_tgl = $pt;\n if($gol == 'mesin_ori') {\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 and kondisi != '3' and \n ( (TglPerolehan < '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and kodeKa=1) or \n (TglPerolehan >= '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and (NilaiPerolehan >=300000 or kodeKa=1)))\n and $paramSatker\";\n\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } elseif($gol == 'bangunan_ori') {\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 and kondisi != '3' and \n ( (TglPerolehan < '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and kodeKa=1) or \n (TglPerolehan >= '2008-01-01' and TglPembukuan <= '$param_tgl' and kodeLokasi like '12%' and (NilaiPerolehan >=10000000 or kodeKa=1)))\n and $paramSatker\";\n\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } else {\n if($gol != \"tanahView\")\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 \n and TglPerolehan <= '$param_tgl' \n and TglPembukuan <='$param_tgl' \n and kodeLokasi like '12%' \n and kondisi != '3' \n and $paramSatker\";\n else\n $param_where = \"Status_Validasi_barang=1 and StatusTampil = 1 \n and TglPerolehan <= '$param_tgl' \n and TglPembukuan <='$param_tgl' \n and kodeLokasi like '12%' \n and $paramSatker\";\n\n if($gol == 'jaringan_ori') {\n $sql = \"select kodeKelompok as kelompok,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n PenyusutanPerTahun as PP,Tahun as Tahun, noRegister as noRegister,\n AkumulasiPenyusutan as AP, NilaiBuku as NB,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n } else {\n $sql = \"select kodeKelompok as kelompok,Tahun as Tahun, noRegister as noRegister,Aset_ID,TglPembukuan,kodeSatker,\n NilaiPerolehan as nilai,Status_Validasi_barang as jml,\n (select Uraian from kelompok \n where kode= kodeKelompok \n ) as Uraian,\n Status_Validasi_barang,kodeSatker from $gol m\n where kodeKelompok like '$kode_sub%' and\n $param_where \n order by kelompok asc\";\n }\n }\n //echo \"$gol == $sql\";\n $resultparentSubSub = mysql_query ($sql) or die(mysql_error());\n $data = array();\n while ($data_subsub = mysql_fetch_array ($resultparentSubSub, MYSQL_ASSOC)) {\n $data[] = $data_subsub;\n }\n return $data;\n}", "function o_ge($a, $b) {\n\t\t\treturn Obj::singleton()->greaterThanOrEqual($a, $b);\n\t\t}", "function normalisasiData(){\n\n\t\tglobal $uanData;\n\t\tglobal $testData;\n\t\tglobal $minR;\n\t\tglobal $maxR;\n\t\tglobal $minT;\n\t\tglobal $maxT;\n\n\t\tif ($uanData < $minR) $minR = $uanData;\n\t\tif ($uanData > $maxR) $maxR = $uanData;\n\t\tif ($testData < $minT) $minT = $testData;\n\t\tif ($testData > $maxT) $maxT = $testData;\n\t\t\n\n\t\t$newDataUan = ($uanData-$minR)/($maxR-$minR);\n\t\t$newDataTest = ($testData-$minT)/($maxT-$minT);\n\n\t}", "function minimo( $resultado, $valor) {\n\t$resultado = ($valor < $resultado ) ? $valor : $resultado; \n\treturn $resultado;\n}", "function penjumlahan($bil1,$bil2){//fungsi penjumlahan\r\n $jumlah=$bil1 + $bil2;//operasi dengan operator aritmatika\r\n return $jumlah;//mengembalikan nilai ke var. jumlah\r\n }", "public function check(){\n $auth=Auth::user();\n $sodu=$auth->money;\n $gia=Session('tongtien');\n if($sodu-$gia > 0){\n return \"<span style='color:red;'>Số dư hợp lệ !</span>\";\n }else{\n return \"<script>document.getElementById('taikhoanweb').innerHTML = '<b><i>Tài khoản web không đủ !</i></b>';</script>\";\n }\n }", "function buscar_fecha ($fecha) {\n global $DB;\n $fechamin = buscar_menor_fecha();\n $fechamax = buscar_mayor_fecha();\n if ($fecha >= $fechamin->date && $fecha <= $fechamax->date) {\n return true;\n } else {\n return false;\n }\n}", "public static function kiemtra_duyet_haychua(){\n $idsv=Auth::user()->getAuthIdentifier();\n $dk = new DangKy;\n $result=$dk->where('sv_ma','=',$idsv)\n ->where('sv_ma','=',$idsv)\n ->where('kq','=',1)\n ->first();\n if(!empty($result)){\n return true;\n }\n else{\n return false;\n }\n }", "function get_status_lima($nilai) {\r\n\t\t\r\n\t\tif ($nilai < 0.6)\r\n\t\t\t$hasil = \"LoS A\";\r\n\t\telse if ($nilai >= 0.6 && $nilai < 0.7)\r\n\t\t\t$hasil = \"LoS B\";\r\n\t\telse if ($nilai >= 0.7 && $nilai < 0.8)\r\n\t\t\t$hasil = \"LoS C\";\r\n\t\telse if ($nilai >= 0.8 && $nilai < 0.9)\r\n\t\t\t$hasil = \"LoS D\";\r\n\t\telse if ($nilai >= 0.9 && $nilai < 1.0)\r\n\t\t\t$hasil = \"LoS E\";\r\n\t\telse if ($nilai >= 1.0)\r\n\t\t\t$hasil = \"LoS F\";\r\n\r\n\t\treturn $hasil;\r\n\t}", "function cari_tgl($name,$cari_tgl)\n\t {\n\t \t$this->db->where('username',$name);\n\t \t$query = $this->db->get('user');\n\t \tforeach($query->result() as $r){\n\t \t\t$id = $r->id;\n\t \t}\n\t \t\n\t \t$this->db->where('id_user',$id);\n\t \t$this->db->where('tgl',$cari_tgl);\n\t \t$query = $this->db->get('lembur');\n\t \t\n\t \t$hasil = 0;\n\t \t\n\t \tif ($query -> num_rows() == null){\n\t \t\t$hasil = '-';\n\t \t}else{\n\t \t\tforeach($query->result() as $r){\n\t \t\t\t$hasil = $hasil + $r->nilai;\t \t\t\t \n\t \t\t}\n\t \t}\n\t \t\n\t \treturn $hasil;\n\t \t\n\t }" ]
[ "0.70686704", "0.60095924", "0.5759015", "0.5753707", "0.5752393", "0.5721219", "0.56688166", "0.56582874", "0.5622258", "0.56030333", "0.5562244", "0.55151814", "0.5492553", "0.54838574", "0.5475036", "0.5432387", "0.54313105", "0.542212", "0.54179746", "0.5410573", "0.5400193", "0.5330472", "0.5318182", "0.5311279", "0.5289119", "0.52875996", "0.52811253", "0.5278293", "0.5278112", "0.5270927", "0.5254288", "0.52385443", "0.5237804", "0.5234571", "0.5215202", "0.52077156", "0.52055764", "0.52000266", "0.51941055", "0.5192868", "0.5181074", "0.51617336", "0.51488596", "0.5136148", "0.51333845", "0.51299226", "0.51039785", "0.5097869", "0.5089385", "0.5086049", "0.508263", "0.50785875", "0.5072357", "0.5070798", "0.5063144", "0.5059819", "0.5057869", "0.50555676", "0.505369", "0.50489986", "0.50472945", "0.5043432", "0.5042714", "0.50307095", "0.50262964", "0.5025361", "0.50207174", "0.50205183", "0.5018681", "0.50093263", "0.50023985", "0.5002158", "0.50014806", "0.4993616", "0.49909416", "0.49810997", "0.49803197", "0.49721894", "0.4969627", "0.49623266", "0.4961445", "0.49586982", "0.4958393", "0.49543923", "0.4950396", "0.49495104", "0.49419218", "0.49405643", "0.49296555", "0.49253786", "0.49243933", "0.49127766", "0.491264", "0.49118027", "0.49110162", "0.4909587", "0.49001676", "0.489258", "0.4891614", "0.48915932" ]
0.54028785
20
Check if date exist in database or not
protected function checkDate($start_date, $end_date = null){ $checkStartDate = HariTidakEfektif::find() ->where([ 'Or', "date(tanggal_awal) = '$start_date' And tanggal_akhir IS null", [ 'And', "date(tanggal_awal) <= '$start_date'", "date(tanggal_akhir) >= '$start_date'" ] ])->one(); if( $end_date != null ){ $checkEndDate = HariTidakEfektif::find() ->where([ 'Or', "date(tanggal_awal) = '$end_date' And tanggal_akhir IS null", [ 'And', "date(tanggal_awal) <= '$end_date'", "date(tanggal_akhir) >= '$end_date'" ] ])->one(); } if ( is_null($checkStartDate)){ if( isset($checkEndDate) ){ if (is_null($checkEndDate)) return true; else false; } else { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasDate() : bool;", "public function hasDate() {\n return $this->_has(3);\n }", "function IfExists($holidaycode) {\r\n $conn = conn();\r\n $sql = \"SELECT * FROM `specialdates` WHERE RateCode='$holidaycode'\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute();\r\n $result = $stmt->fetchAll();\r\n if (!empty($result)) {\r\n return 1;\r\n }\r\n return 0;\r\n $conn = NULL;\r\n }", "private function compare_with_date()\n {\n }", "public function hasDate(): bool\n {\n return isset($this->date);\n }", "public function hasDate(): bool\n {\n return isset($this->date);\n }", "public function hasDate() : bool\n {\n return isset($this->date);\n }", "function validate_date($date) {\n $d = \\DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') === $date;\n }", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "function validateDate($date)\n\t\t{\n\t\t\t$d = DateTime::createFromFormat('Y-m-d', $date);\n\t\t\treturn $d && $d->format('Y-m-d') == $date;\n\t\t}", "public function is_date()\n {\n }", "public function isDate();", "public function has_date( $date ) {\n\t\n\t\treturn in_array( $date, $this->dates );\n\t\n\t}", "public static function exists($date)\n {\n return self::query()\n ->where('date', $date)\n ->exists();\n }", "function isFeeExiste($date, $nature, $amount, $site_id)\n {\n global $db;\n $existe = false;\n $reqFee = $db->prepare('SELECT * FROM fees WHERE date = ? AND nature = ? AND amount = ? AND site_id = ?');\n $reqFee->execute(array($date, $nature, $amount, $site_id));\n if ($reqFee->rowCount() >= 1) {\n $existe = true;\n }\n return $existe;\n }", "public function checkholiday($date)\n {\n $this->db->select('Name');\n $this->db->from($this::DB_TABLE);\n $this->db->where(\"CONVERT(VARCHAR(10), Date, 21) = '\" . $date . \"'\");\n $this->db->where(\"Name <> ''\");\n $query = $this->db->get(); \n $ret_val = $this->_populaterows($query);\n \n if (isset($ret_val) && !empty($ret_val))\n {\n if (isset($ret_val[0]->Name) && trim($ret_val[0]->Name) != \"\")\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }\n else\n {\n return FALSE;\n } \n }", "function nrua_validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "public function check_modifying_date($venueID,$usrID)\n {\n $seoqry = DB::table('venue_master')\n ->where('creater_id',$usrID)\n ->where('id',$venueID)\n ->select('modified_date')\n ->first();\n $rtmodify = $seoqry->modified_date;\n // echo $rtmodify;\n if($rtmodify == '0000-00-00 00:00:00')\n {\n return 1; \n }else\n {\n return 2; \n }\n }", "protected function checkDate($date)\r\n\t{\r\n\t\tif(!$date)\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tif(!preg_match('/^([1-3][0-9]{3,3})-(0?[1-9]|1[0-2])-(0?[1-9]|[1-2][1-9]|3[0-1])$/', $date)) {\r\n\t\t\t\tthrow new Exception ( 'checkDate() expects a SQL formatted date like 2009-12-24.' );\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function in_date(BadmintonDate $badminton_date) {\r\n\t\tif ($badminton_date->date_id && $user->user_id) {\r\n\t\t\t$mysqli = Database::connection();\r\n\t\t\t$sql = \"SELECT user_id FROM joins WHERE user_id = '$this->user_id' AND date_id = '$date->date_id'\";\r\n\t\t\t$result = $mysqli->query($sql)\r\n\t\t\tor die ($mysqli->error);\r\n\t\t\treturn ($result->num_rows == 1);\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function validar_fecha_stock($fechaStock)\n{\n //$fecha = date('d-m-Y');\n $fecha = date('d/m/Y');\n //$fecha = strftime($fecha);\n\n if ($fecha == $fechaStock) {\n return true;\n }\n\n return false;\n}", "static function checkDate($date, $format = 'Y-m-d')\n\t{\n\t\tdate_default_timezone_set('UTC');\n\t\t$d = DateTime::createFromFormat($format, $date);\n\t\treturn $d && $d->format($format) == $date;\n\t}", "function isDateValid($dateInput){\n\t\t$d = DateTime::createFromFormat('Y-m-d', $dateInput);\n\t\treturn $d && $d->format('Y-m-d') === $dateInput;\n\t}", "function validateDate($date,$format ='Y-m-d'){\n$d = dateTime::createFromFormat($format,$date);\n\nif($d && $d->format($format) == $date){\nreturn true;\n } else {\n return false;\n }\n}", "function is_date ($date) {\n\t\n\t\treturn !(\n\t\t\tis_null($date) ||\n\t\t\t(gettype($date)!=='object') ||\n\t\t\t(get_class($date)!=='DateTime') ||\n\t\t\t($date->format('Y m j')==='-0001 11 30')\n\t\t);\n\t\n\t}", "private function isValidDate($date)\n\t\t{\n\t\t\t$date = str_replace('/', '-', $date);\n\t\t\treturn (date_create($date)) ? Factory::getDate($date)->format(\"Y-m-d\") : null;\n\t\t}", "function isValidDate($date) {\n $d = DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') == $date;\n}", "public function checkImageExists($date){\n try {\n $stmt = $this->db->prepare(\"SELECT * FROM img_liked WHERE imgDate =:imgDate\");\n $stmt->execute(array(':imgDate'=>$date));\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n \n // if row exists with id\n if($row['id']) {\n return $row['id'];\n } else {\n return false;\n }\n\n } catch(PDOException $e) {\n echo $e->getMessage();\n }\n\n}", "function doesDateFileExist($ID, $date) {\n\tglobal $DATA_DIR;\n\t$handle = fopen($DATA_DIR.$ID.'/'.$date.'.csv',\"r\");\n\tif ($handle === FALSE) {\n\t\tfclose($handle);\n\t\treturn FALSE;\n\t}\n\telse {\n\t\tfclose($handle);\t\n\t\treturn TRUE;\n\t}\n}", "function _validateDate($date, $format = 'd/m/Y'){\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "function ValidateDate($date)\n{\n // Cut date for some strings to check it.\n list($dd, $mm, $yyyy) = explode(\"-\", $date);\n \n // Check if date exist. \n if (is_numeric($dd) && is_numeric($mm) && is_numeric($yyyy))\n {\n if (!checkdate($mm, $dd, $yyyy)) \n {\n return false;\n }\n else \n {\n // Reverse date to mysql format.\n $date = sprintf(\"%d-%02d-%02d\", $yyyy,$mm,$dd);\n return $date; \n }\n }\n return false;\n}", "function validateDate($date, $format = 'Y-m-d') {\n \t $d = DateTime::createFromFormat($format, $date);\n \t return $d && $d->format($format) === $date;\n }", "private function isUserIDExists($id)\n {\n $stmt = $this->con->prepare(\"SELECT primeiro_acesso from tbl_analitics WHERE fk_usuario = ?\");\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $stmt->bind_result($date);\n $stmt->fetch();\n return $date;\n }", "public function hasAdddate(){\n return $this->_has(29);\n }", "public function post_dated(){ \n\t\tif(strtotime($this->format_date_save($this->data['HrPermission']['per_date'])) < strtotime(date('Y-m-d'))){\t\t\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "function valideDate($date, $format = 'Y-m-d H:i:s')\n {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "public function test_getDrawByDate_calledWithInvalidDate_returnActionResultFalse()\n {\n $today = new \\DateTime('2015-11-04');\n $sut = $this->getSut();\n $this->lotteryDrawRepository_double->findOneBy(['draw_date' => $today])->willReturn(self::DOCTRINE_EMPTY_SINGLEOBJECT_RESULT);\n $actual = $sut->getDrawByDate($today);\n $this->assertEquals(false,$actual->success());\n }", "private function isValidDate($date) {\n $date = str_replace('/', '-', $date);\n return (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n }", "public function existReturned(){\r\n $docs=ClientSDocs::where('projectclientservices_id',$this->id)->where('file_id',-1) ->get();\r\n if($docs!=null){\r\n foreach($docs as $doc)\r\n if($doc->signdate != \"\")\r\n return true;\r\n }\r\n return false;\r\n }", "public function check_dob($date) {\n\n\t\t// valid if empty\n\t\tif (empty($date)) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// check valid date\n\t\tif (!check_uk_date($date)) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// check date is in future\n\t\tif (strtotime(uk_to_mysql_date($date)) > time()) {\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "private function isValidDate($date)\n\t{\n\t\t$date = str_replace('/', '-', $date);\n\t\treturn (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n\t}", "function validateDate($date, $format = 'Y-m-d H:i:s')\n {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "public function checkExistDateOfCompanyStaffWork($workId, $date)\n {\n $checkDate = date('Y-m-d', strtotime($date));\n return QcOverTimeRequest::where('work_id', $workId)->where('requestDate', 'like', \"%$checkDate%\")->exists();\n }", "public function isValidDate() {\n\t\t// TODO\n\t\treturn TRUE;\n\t}", "public function date(string $field) : bool\n\t{\n\t\tif(Datetime::createFromFormat('Y-m-d', $this->data[$field]) === false)\n\t\t{\n\t\t\t$this->errors[$field] = \"Date incorrecte\";\n\n\t\t\treturn false;\n\t\t}\t\n\n\t\treturn true;\n\t}", "private function validMySQLDate($date) {\r\n if (!$this->validMySQLDateFormat($date)) {\r\n return false;\r\n }\r\n $day = substr($date, 8);\r\n $month = substr($date, 5, 2);\r\n $year = substr($date, 0, 4);\r\n return (checkdate($month, $day, $year));\r\n }", "function validateDate($date,$format = 'Y-m-d H:i:s') {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function verifyDate($date, $date_format)\n {\n $datetime=DateTime::createFromFormat($date_format, $date);\n $errors=DateTime::getLastErrors();\n if (!$datetime || !empty($errors['warning_count'])) //date was invalid\n {\n $date_check_ok=false;\n }\n else //everything OK\n {\n $date_check_ok=true;\n }\n\n return $date_check_ok;\n }", "private function checkEventDateNotDue(){\n $event = Event::find($this->id);\n $now = Carbon::now();\n \n $startTime = Carbon::createFromFormat('Y-m-d H:i:s', $event->start_time);\n return $startTime->gt($now);\n }", "public function hasBirthdate(): bool;", "public function validateDate($data)\n {\n\n if($data =='now' || (strlen($data)>=8 && strlen($data)<=10)) {\n try {\n $value_time = new DateTime($data);\n return true;\n } catch (Exception $e) {\n // Is not a valida Date\n }\n }\n return false;\n }", "public function checkDateWithTypo3DateSyntaxDataProvider() {}", "function existeFechaPrestador($idPrestador, $fecha, $idCiudad, $conectar)\n{\n\t$sql = mysql_query(\"\n\tSELECT \n\t\th.`id` \n\tFROM \n\t\thoras_prestadores h\n\tWHERE \n\t\th.`prestador`=$idPrestador AND \n\t\th.`ciudad`=$idCiudad AND \n\t\th.`hora`='$fecha'\n\t\", $conectar);\n\t\n\tif(mysql_num_rows($sql) == 1)\n\t{\n\t\treturn true;\n\t}\n\telse \n\t{\n\t\treturn false;\n\t}\n}", "private function validateCreatedAt()\n {\n try {\n new DateTime($this->created_at);\n return true;\n } catch (Exception $e) {\n return false;\n }\n }", "private function isValidDate($date)\n {\n try\n {\n $date = str_replace('/', '-', $date);\n return (date_create($date)) ? JFactory::getDate($date)->format(\"Y-m-d\") : null;\n }\n catch(Exception $e)\n {\n Gm_ceilingHelpersGm_ceiling::add_error_in_log($e->getMessage(), __FILE__, __FUNCTION__, func_get_args());\n }\n }", "public function hasCreatetime(){\n return $this->_has(1);\n }", "public static function isValidDate($date){\n return (DateTime::createFromFormat('d/m/Y', $date)) ? true : false;\n }", "function validaNascimento($ano, $mes, $dia)\n{\n\n $dataCheck = $ano.'-'.$mes.'-'.$dia;\n if (checkdate($mes, $dia, $ano) && $dataCheck<=date('Y-m-d'))\n return true;\n else return false;\n}", "function validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function validateDate($date, $format = 'Y-m-d H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "private function validateDate($date, $format = 'Y-m-d H:i:s'){\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n }", "public function isValidPaydate($date);", "public static function validateDate($date)\n {\n $d = \\DateTime::createFromFormat('Y-m-d', $date);\n return $d && $d->format('Y-m-d') === $date;\n }", "private function check_date($value) : bool\n {\n // 'YYYY-MM-DDThh:mm:ss'\n // 'YYYY-MM-DD hh:mm:ss.u'\n // 'YYYY-MM-DD hh:mm:ss'\n // 'YYYY-MM-DD'\n // 'YYYYMMDD'\n\n if (!is_string($value))\n return false;\n\n // TODO: the \\DateTime::createFromFormat() can't handle certain\n // types of date time formats allowed by the standard (i.e, partial\n // times given by \".ttt\" in the following: YYYY-MM-DDThh:mm:ss.tttZ)\n $dt = \\DateTime::createFromFormat(\\DateTime::ISO8601, $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Y-m-d H:i:s.u', $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Y-m-d H:i:s', $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Y-m-d', $value);\n if ($dt !== false)\n return true;\n\n $dt = \\DateTime::createFromFormat('Ymd', $value);\n if ($dt !== false)\n return true;\n\n return false;\n }", "private function checkDate($date) {\n // date/time\n\t$datetimePattern1 = '/^\\d\\d\\d\\d-\\d\\d-\\d\\d \\d\\d:\\d\\d:\\d\\d$/';\n // date\n\t$datetimePattern2 = '/^\\d\\d\\d\\d-\\d\\d-\\d\\d$/';\n return (preg_match($datetimePattern1, $date) ||\n preg_match($datetimePattern2, $date));\n }", "private function eventDateOcuppied(Event $event) {\n $select = new Select();\n $select->from( $this->_events );\n // Create betweens\n $betweenStartAt = new Expression(\"BETWEEN ({$event->getStartAt()}+1) AND ({$event->getFinishAt()}-1) \"); \n $betweenNewStartAt = new Expression(\"BETWEEN start_at AND finish_at \");\n $select->where( [\n 'id != ?' => (integer)$event->getId(),\n 'room_id = ?' => (integer)$event->getRoomId(),\n '(start_at ? ' => $betweenStartAt, // Notice! open parenthesis \n ]);\n // Build date range \n $select->where( [ \"finish_at ? \" => $betweenStartAt, ], Predicate::OP_OR );\n $select->where( [ \"(\".$event->getStartAt().\"+1) ? )\" => $betweenNewStartAt, ], Predicate::OP_OR );// Notice! closing parenthesis\n \n $exists = new RecordExists( $select );\n// DEBUG ONLY\n //$sql = new Sql( $this->db );\n //$statement = $sql->prepareStatementForSqlObject($select); \n //echo $sql->buildSqlString( $select ); die();\n// DEBUG ONLY\n \n // We still need to set our database adapter\n $exists->setAdapter( $this->db );\n return $exists->isValid( $event->getId() ); \n }", "public function checkDate($date)\n\t{\n\t\tif (preg_match(\"/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/\",$date)){\n\t return true;\n\t }\n\t else{\n\t \t$this->form_validation->set_message('checkDate','date should be as yyyy-mm-dd');\n\t return false;\n\t }\n\t}", "public function isNewHire($date = \"\") {\n\t\tif ($date == '') { $date = date(\"Y-m-d\"); }\n\t\t$when = new DateTime($date);\n\t\tif ($when->diff($this->hiredate)->format(\"%a\") < NEW_HIRE_DAYS) { return true; }\n\t\treturn false;\n\t}", "protected static function check_date($date) {\n $date_arr = explode(\"-\", $date);\n\n if (count($date_arr) == 3 && checkdate($date_arr[1], $date_arr[2], $date_arr[0])) {\n return false;\n } else {\n return true;\n }\n }", "function validateDate($date, $format = 'd/m/Y H:i:s')\n{\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) == $date;\n}", "function func_existeDato($dato, $tabla, $columna){\n selectConexion('onmworkflow');\n $query = \"select * from $tabla where $columna = '$dato' ;\";\n $result = pg_query($query) or die (\"Error al realizar la consulta\");\n if (pg_num_rows($result)>0)\n {\n return true;\n } else {\n return false;\n }\n }", "public function createDate($date)\n {\n $sql = \"INSERT INTO dates (date) values (:date)\";\n\n if ($stmt = $this->dbHandle->prepare($sql)) {\n // Bind variables to the prepared statement as parameters\n $stmt->bindParam(\":date\", $param_date, PDO::PARAM_STR);\n\n // Set parameters\n $param_date = trim($date);\n\n // Attempt to execute the prepared statement\n if ($stmt->execute()) {\n return $this->getDateID($date);\n } else {\n return false;\n }\n } else {\n return false;\n }\n // Close statement\n unset($stmt);\n // Close connection\n unset($pdo);\n }", "public function checkDateWithInvalidDateValuesDataProvider() {}", "function check_today($player) {\n $found = 1;\n\n $last = trim(file_get_contents(_PWD . '/' . $player->steamid));\n if ($last != date('m/d/Y')) {\n $found = 0;\n }\n\n return $found;\n }", "public function containsDate($date) {\n // if my time period starts AFTER the date, then it doesn't contain it.\n if ($date < $this->eff_date) {\n return false;\n }\n\n // if my time period never expires then we know we're ok at this point\n if (is_null($this->exp_date)) {\n return true;\n }\n\n // if my time period ends before or on date, then I don't contain it.\n if (is_null($date)) {\n return false;\n }\n if ($this->exp_date <= $date) {\n return false;\n }\n\n // no more failure scenarios.\n return true;\n }", "public function getDateID($date)\n {\n //checks if value exists in database\n $sql = \"SELECT dateID FROM dates WHERE date = :date\";\n\n if ($stmt = $this->dbHandle->prepare($sql)) {\n // Bind variables to the prepared statement as parameters\n $stmt->bindParam(\":date\", $param_date, PDO::PARAM_STR);\n\n // Set parameters\n $param_date = trim($date);\n\n // Attempt to execute the prepared statement\n if ($stmt->execute()) {\n if ($stmt->rowCount() == 1) {\n $row = $stmt->fetch();\n return (int)$row['dateID'];\n } else {\n return false;\n }\n } else {\n return false;\n }\n }\n //Close statement\n unset($stmt);\n //Close connection\n unset($pdo);\n }", "function checkIsValidDate($date, $format = 'Y-m-d H:i:s')\n {\n $d = DateTime::createFromFormat($format, $date);\n return $d && $d->format($format) === $date;\n }", "function checkRecordDate($mLink, $fundID, $table, $column, $dateType, $fromDate, $orderBy='timestamp', $orderType='DESC'){\r\n\t\r\n\t//Lets assume the record passes\r\n\t$checkRecordDate = true;\r\n\t\r\n\t//If no fromDate is passed lets default it to yesterday\r\n\tif($fromDate == NULL){\r\n\t\t$today\t\t\t= time();\r\n\t\t$fromDate\t\t= strtotime('-1 day', $today);\r\n\t}\r\n\t\r\n\t//Grab the record in question\r\n\t$query = \"\r\n\t\tSELECT \".$column.\", timestamp\r\n\t\tFROM \".$table.\"\r\n\t\tWHERE fund_id=:fund_id\r\n\t\tORDER BY \".$orderBy.\" \".$orderType.\"\r\n\t\";\r\n\ttry{\r\n\t\t$rsAudit = $mLink->prepare($query);\r\n\t\t$aValues = array(\r\n\t\t\t':fund_id'\t=> $fundID\r\n\t\t);\r\n\t\t$preparedQuery = str_replace(array_keys($aValues), array_values($aValues), $query); //Debug\r\n\t\t$rsAudit->execute($aValues);\r\n\t}\r\n\tcatch(PDOException $error){\r\n\t\t// Log any error\r\n\t}\r\n\t$dateCheck \t= $rsAudit->fetch(PDO::FETCH_ASSOC);\r\n\t\r\n\t$checkDate \t= $dateCheck[$column];\r\n\t$timestamp\t= $dateCheck['timestamp'];\r\n\t\r\n\tswitch($dateType){\r\n\t\tcase 'unix':\r\n\t\t\t\r\n\t\t\tif($checkDate <= $fromDate){\r\n\t\t\t\t$checkRecordDate = false;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 'yyyymmdd':\r\n\t\t\t\r\n\t\t\tif($checkDate != date('Ymd', $checkDate)){\r\n\t\t\t\t$checkRecordDate = false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\tbreak;\t\r\n\t}\r\n\t\r\n\treturn($checkRecordDate);\r\n\t\t\r\n}", "function old_validate_date($date){\n if ($date == \"\" ) { return '00:00:00' ; }\n # create temp table and attempt insert there\n $query = \"CREATE TEMP TABLE validation (test date) \";\n $result = do_sql($query);\n\n # Check if date is valid format by entering it into temp table\n $query = \"INSERT INTO validation (test) values ( '$date' )\";\n $result = do_sql($query);\n\n if ( $result ) {\n do_sql(\"DROP TABLE validation\") ;\n return \"$date\" ;\n }\n else { \n do_sql(\"DROP TABLE validation\") ;\n return false ;\n }\n}", "public function check_exists(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$count = $this->find('count', array('conditions' => array('or' => array('leave_from between ? and ?' => array($from, $to),\n\t\t\t'leave_to between ? and ?' => array($from, $to)), 'Leave.users_id' => CakeSession::read('USER.Login.id'), \n\t\t\t'Leave.is_deleted'=> 'N', 'Leave.is_approve !=' => 'R')));\n\t\t\tif($count > 0){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function validateDate()\n {\n if (\n ($from = $this->getAvailableFrom()) &&\n ($till = $this->getAvailableTill()) &&\n $from->InPast() &&\n $till->InFuture()\n ) {\n return true;\n }\n\n return false;\n }", "public function testDateFieldValidation()\n {\n $field = $this->table->getField('dateone');\n\n $testDate = 'July 4, 2016';\n\n $fldObj = $field->getPHPValue($testDate);\n\n $this->assertInstanceOf('DateTime', $fldObj);\n $this->assertEquals('2016-07-04', $fldObj->format('Y-m-d'));\n\n $fieldVal = $field->getSqlBoundValue($testDate);\n $key = $fieldVal->getValueMarker();\n\n $this->assertEquals(1, $fieldVal->getBindCount());\n $this->assertEquals('2016-07-04', $fieldVal->getBoundValues()[$key]);\n }", "public function issetMovementDate(): bool\n {\n return isset($this->movementDate);\n }", "public function is_day()\n {\n }", "private function checkDateAvailable($object)\n\t{\n\t\tif($object->FormCode == 'M505')\n\t\t{\n\t\t\t$issueDateAlias = 'NgayXuatHang';\n\t\t\t$deliveryDateAlias = 'NgayGiaoHang';\n\t\t\t$orderDateAlias = 'NgayDatHang';\n\t\t\t$requiredDateAlias = 'NgayYCNH';\n\t\t\t\n\t\t}\n\t\telseif($object->FormCode == 'M403')\n\t\t{\n\t\t\t$issueDateAlias = 'NgayXuatHang';\n\t\t\t$deliveryDateAlias = 'NgayGiaoHang';\n\t\t\t$orderDateAlias = 'NgayYeuCau';\n\t\t\t$requiredDateAlias = 'NgayTraHang';\t\t\n\t\t}\n\t\t\n\t\t// Ngay xuat hang bang so co the so sanh\n\t\t$issueDate = Qss_Lib_Date::i_fString2Time($object->getFieldByCode($issueDateAlias)->getValue());\n\t\t// Ngay giao hang bang so co the so sanh\n\t\t$deliveryDate = Qss_Lib_Date::i_fString2Time($object->getFieldByCode($deliveryDateAlias)->getValue());\n\t\t$orderDate = Qss_Lib_Date::i_fMysql2Time($this->_params->$orderDateAlias);// Ngay dat hang bang so co the so sanh\n\t\t$requiredDate = Qss_Lib_Date::i_fMysql2Time($this->_params->$requiredDateAlias);// Ngay yeu cau bang so co the so sanh\n\t\t\n\t\t// Ngay xuat hang nam trong khoang tu ngay dat hang den ngay yeu cau\n\t\tif( $issueDate < $orderDate || $issueDate > $requiredDate )\n\t\t{\n\t\t\t$this->setMessage($this->_translate(1));\n\t\t\t$this->setError();\n\t\t}\n\t\t\n\t\t// Ngay giao hang nam trong khoang tu ngay dat hang den ngay yeu cau\n\t\tif( $deliveryDate < $orderDate || $deliveryDate > $requiredDate )\n\t\t{\n\t\t\t$this->setMessage($this->_translate(2));\n\t\t\t$this->setError();\n\t\t}\n\t\t\n\t\t// Ngay giao hang phai lon hon hoac bang ngay xuat hang\n\t\tif( $deliveryDate < $issueDate )\n\t\t{\n\t\t\t$this->setMessage($this->_translate(3));\n\t\t\t$this->setError();\n\t\t}\n\t\t\t\n\t}", "private function _is_date($date) {\n\t\tif (empty($date)) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif(!strpos($date,'-') && is_numeric($date)) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tlist( $y, $m, $d ) = explode('-', $date );\n\n\t\tif ( is_numeric($m) && is_numeric($d) && is_numeric($y) && checkdate( $m, $d, $y ) ) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function eventInDb($title,$sDate,$eDate,$sTime,$eTime) {\r\n\t$q =\r\n\t\"SELECT\r\n\t\ttitle\r\n\tFROM [db]events\r\n\tWHERE\r\n\t\tstatus >= 0\r\n\t\tAND title = '$title'\r\n\t\tAND s_date = '$sDate'\r\n\t\tAND e_date = '$eDate'\r\n\t\tAND s_time = '$sTime'\r\n\t\tAND e_time = '$eTime'\r\n\t\t\";\r\n\t$rset = dbQuery($q);\r\n\treturn (mysql_num_rows($rset) > 0 ? true : false);\r\n}", "function storeHolidayCheck($storeId=null,$time=null,$date=null) {\n \n App::import('Model', 'StoreHoliday');\n $this->StoreHoliday = new StoreHoliday();\n $dateformat= explode(\"-\", $date);\n $result=FALSE;\n $dateInt=$dateformat[2].\"-\".$dateformat[1].\"-\".$dateformat[0]; // date foramate Y-M-D\n $StoreHolidayTime=$this->StoreHoliday->find('all',array('conditions'=>array('StoreHoliday.store_id'=>$storeId,'StoreHoliday.is_deleted'=>0,'StoreHoliday.holiday_date'=>$dateInt,'StoreHoliday.is_active'=>1)));\n if(empty($StoreHolidayTime)){\n $result=TRUE;\n }else{\n $result=FALSE;\n }\n return $result;\n }", "private static function validateDate(string $date): bool\n {\n $date = \\DateTime::createFromFormat('Y-m-d', $date);\n\n if (!$date) {\n return false;\n }\n\n return true;\n }", "function existeFechaPrestadorCiudadTiempo($idPrestador, $fecha, $idCiudad, $conectar)\n{\n\t//Separo la fecha para la verificacion\n\t$fechaSeparada = explode('-', $fecha);\n\t$mes = $fechaSeparada[1];\n\t$ano = $fechaSeparada[0];\n\t$fechaSeparada = explode(' ', $fechaSeparada[2]);\n\t$dia = $fechaSeparada[0];\n\n\t$sql = mysql_query(\"\n\tSELECT \n\t\th.`id`\n\tFROM \n\t\thoras_prestadores h\n\tWHERE \n\t\th.`prestador`=$idPrestador AND \n\t\th.`ciudad`<>$idCiudad AND \n\t\th.`hora` BETWEEN '\".$ano.\"-\".$mes.\"-\".$dia.\" 00:00:00' AND '\".$ano.\"-\".$mes.\"-\".$dia.\" 23:59:59'\n\t\", $conectar);\n\t\n\tif(mysql_num_rows($sql) == 0)//Si no existen\n\t{\n\t\treturn false;\n\t}\n\telse \n\t{\n\t\treturn true;\n\t}\n}", "public function isCreated() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->creationDate) ? false: true;\r\n\t}", "public function IsLeaveAlreadyExist()\r\n\t{\r\n\t\t$txt_user_Leave_date = $this->input->post('txt_user_Leave_date');\r\n\t\t$Formated_txt_user_Leave_date = date('Y-m-d', strtotime($txt_user_Leave_date));\r\n\t\t$user_id = $this->session->userdata('user_id');\r\n\t\t\r\n\t\t$WhereCondition = \"\";\r\n\t \t$query = $this->db->query(\" \t\r\n \t\t\t\t\t\t\t\t\tSELECT user_Leave_id\r\n \t\t\t\t\t\t\t\t\tFROM `tbl_user_leaves`\r\n\t\t\t\t\t\t\t\t\tWHERE user_Leave_date = '$Formated_txt_user_Leave_date'\r\n\t\t\t\t\t\t\t\t\tAND user_id = $user_id\r\n\t\t\t\t\t\t\t\t\t$WhereCondition\r\n\t\t\t\t\t\t\t\t\");\t\t\r\n\t\t$result = $query->result_array();\t\t\t\r\n\t\treturn $result;\r\n\t}", "public static function checkIfHoliday( $date ) {\n\t\t$log = vglobal('log');\n\t\t$log->debug(\"Entering Settings_PublicHoliday_Module_Model::checkIfHoliday(\".$date.\") method ...\");\n\n\t\t$db = PearDatabase::getInstance();\n\t\t$sql = 'SELECT COUNT(1) as num FROM `vtiger_publicholiday` WHERE `holidaydate` = ?;';\n\t\t$params = array( $date );\n\n\t\t$result = $db->pquery( $sql, $params );\n\t\t$num = $db->query_result( $result, 0, 'num' );\n\n\t\t$log->debug(\"Exiting Settings_PublicHoliday_Module_Model::checkIfHoliday() method ...\");\n\n\t\tif ( $num > 0 )\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "function wp_checkdate($month, $day, $year, $source_date)\n {\n }", "private function checkDatesValidity(){\n\t\t$valid=true;\n\t\t$today = date(\"Y-m-d\");\n\t\tif($this->validFrom!=\"\" && $this->validFrom!=\"0000-00-00\" && $today<$this->validFrom) $valid=false;\n\t\tif($this->validUntil!=\"\" && $this->validUntil!=\"0000-00-00\" && $today>$this->validUntil) $valid=false;\n\t\treturn $valid;\n\t}", "public function isDate($row, $column) {\n\t}", "public function checkValidity()\n {\n // le pb est que la propriété publicationDate est de type dateTime or les tests initiaux\n // se basent sur un format de type date --> ce qui génère une erreur de type notice\n \n return true;\n }", "private function validMySQLDateFormat($date) {\r\n return (preg_match(\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/\", $date));\r\n }", "function validateDate($date, $format = 'Y-m-d')\n {\n $d = DateTime::createFromFormat($format, $date);\n // The Y ( 4 digits year ) returns TRUE for any integer with any number of digits so changing the comparison from == to === fixes the issue.\n return $d && $d->format($format) === $date;\n }", "public function issetPaymentDate(): bool\n {\n return isset($this->paymentDate);\n }" ]
[ "0.7254087", "0.69935584", "0.69268507", "0.68994254", "0.685307", "0.685307", "0.6824353", "0.6664956", "0.6601435", "0.6601435", "0.6570155", "0.655138", "0.6529371", "0.6408139", "0.63978213", "0.63493776", "0.63126564", "0.6299787", "0.6295223", "0.6270217", "0.6264994", "0.6254214", "0.6238562", "0.62370646", "0.6226135", "0.6215005", "0.62050456", "0.6198617", "0.61951077", "0.61887395", "0.617963", "0.61762685", "0.6160664", "0.61567676", "0.6147827", "0.6136", "0.610664", "0.6088168", "0.6076111", "0.6068425", "0.60634285", "0.6063067", "0.602698", "0.60266614", "0.6022389", "0.6011529", "0.60035235", "0.6001598", "0.6001223", "0.6000967", "0.59815043", "0.5977565", "0.59731597", "0.5967399", "0.5945688", "0.59371996", "0.5926878", "0.59241235", "0.59202206", "0.59202206", "0.5906517", "0.5893541", "0.5885539", "0.58833736", "0.5875955", "0.5873204", "0.5869054", "0.58534193", "0.58495325", "0.5841308", "0.5840058", "0.58358455", "0.5830192", "0.5801975", "0.5790679", "0.578857", "0.5787845", "0.5785531", "0.5782694", "0.57801706", "0.5774186", "0.57695836", "0.5760369", "0.57603663", "0.5759773", "0.57548976", "0.5746259", "0.5745438", "0.57386875", "0.57343376", "0.57307285", "0.57289636", "0.5726491", "0.5724161", "0.5723265", "0.57217807", "0.56984305", "0.56847024", "0.5675726", "0.56703115" ]
0.571835
96
1 : first item
function getUriHistory(string $uri, int $count):string { // 2 : two first items // -1 : all except last item // -2 : all except two last items $items = explode('/', $uri); if ($count < 0) $count = count($items) + $count; $count = min($count, count($items)); return implode('/', array_slice($items, 0, $count)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function firstItem();", "function getFirstItem() { return $this->m_firstItem; }", "public function getFirstItem();", "public function getFirstItem() {}", "public function getFirstItem() {}", "public function hasFirstItem() {}", "public function FirstItem()\n {\n return ($start = $this->getPageStart()) ? $start + 1 : 1;\n }", "public function first()\r\n {\r\n $this->index = 0;\r\n }", "function getFirst() ;", "public static function first();", "public function first() {\n $this->index = 0;\n }", "public function first(): void\n {\n $this->index = 0;\n }", "public function testFirst()\n {\n $this->collection->seek(2);\n $this->collection->first();\n $this->assertEquals(0, $this->collection->key());\n $this->assertEquals(1, $this->collection->current());\n }", "private function set_firstItem()\n {\n $firstItem = null;\n\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Get TS filter configuration\n //$conf_name = $this->conf_view['filter.'][$table . '.'][$field];\n $conf_array = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ];\n\n // RETURN first item shouldn't displayed\n if ( !$conf_array[ 'first_item' ] )\n {\n return;\n }\n // RETURN first item shouldn't displayed\n // RETURN first item shouldn't displayed\n if ( !$conf_array[ 'first_item.' ][ 'display_wo_items' ] )\n {\n if ( ( int ) $this->hits_sum[ $this->curr_tableField ] < 1 )\n {\n return;\n }\n }\n // RETURN first item shouldn't displayed\n // Get the labels for the fields uid and hits\n $uidField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n $hitsField = $this->sql_filterFields[ $this->curr_tableField ][ 'hits' ];\n\n // Get the uid of the first item\n $uid = $conf_array[ 'first_item.' ][ 'option_value' ];\n\n // LOOP all fields of current filter / tableField\n foreach ( $this->sql_filterFields[ $this->curr_tableField ] as $field )\n {\n // SWITCH field\n switch ( true )\n {\n case( $field == $uidField ):\n $firstItem[ $uid ][ $uidField ] = $uid;\n break;\n case( $field == $hitsField ):\n $firstItem[ $uid ][ $hitsField ] = ( int ) $this->hits_sum[ $this->curr_tableField ];\n break;\n default:\n $firstItem[ $uid ][ $field ] = null;\n break;\n }\n // SWITCH field\n }\n // LOOP all fields of current filter / tableField\n // Add first item to the rows of the current filter\n $this->rows = ( array ) $firstItem + ( array ) $this->rows;\n\n return;\n }", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first();", "public function first() { \t\n \ttry{\n if (!is_array($this->Items)) return $this->Items ; \t\t\n if (!count($this->Items)) return null; \t\n \treset($this->Items); \t\t\n return $this->Items[key($this->Items)]; \n }catch(Exception $e){\n throw $e;\n } \t\n }", "public function first()\r\n\t{\r\n\t\treturn reset($this->_items);\r\n\t}", "public function first() {\n\t\treturn $this->items[0];\n\t}", "public function first(): mixed;", "public function first(): mixed;", "public function first() {}", "public function first() {\n return reset($this->list);\n }", "public function getFirst()\n {\n return 1;\n }", "public function first()\n {\n return reset($this->items);\n }", "function _first($ar){\n\treturn array_shift(array_values($ar));\t\n}", "public function first()\n {\n foreach ($this->items as $currentItem) {\n return $currentItem;\n }\n }", "public function first() {\n return $this->nth( 0 );\n }", "function first()\n{\n\t$this->rewind();\n\treturn $this->current();\n}", "public function first()\n {\n return Arr::first($this->items);\n }", "function twig_first(Twig_Environment $env, $item)\n{\n $elements = twig_slice($env, $item, 0, 1, false);\n return is_string($elements) ? $elements[0] : current($elements);\n}", "public function getFirstItem()\n {\n if ($this->valid() === false) {\n return null;\n }\n return $this->rewind()->current();\n }", "public function first(){\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function getAndRemoveFirstItem ();", "public function getFirst ()\n {\n return end ( $this->_list ) ;\n }", "public function getFirst();", "public function first()\n\t{\n\t\tif ($this->count()) {\n\t\t\treturn $this->_items[0];\n\t\t}\n\t}", "public function isFirst() {\r\n return key($this->collection) == 0;\r\n }", "public function getFirst()\n\t{\t\treturn $this->first;\n\t}", "public function firstKey();", "function head(iterable $items)\n{\n foreach ($items as $key => $value) {\n return $value;\n }\n}", "public function firstItem(): SearchItem\n {\n return $this->items[0];\n }", "public function get_first_item_id(): int {\n\t\t\treturn LP_Course_DB::getInstance()->get_first_item_id( $this->get_id() );\n\t\t}", "public function getFirst() {}", "public function first()\n {\n return count($this->items) > 0 ? reset($this->items) : null;\n }", "public function getFirstItem(...$types);", "function first()\n\t{\n\t\treturn array_values($this->_data)[0];\n\t}", "public function first() {\n if (count($this->items) > 0) {\n return $this->items[0];\n }\n else\n return null;\n }", "public function first(): mixed\n {\n return Iterators::first($this->iterator);\n }", "public function isFirst()\n {\n return $this->getSortableRank() == 1;\n }", "public function getPageFirstItemIndex() {\r\n return $this->getItemsPerPage() * ($this->getPageIndex() - 1);\r\n }", "public function peekFirst();", "public function first()\n {\n return ($this->pointer == 0);\n }", "public function first()\n {\n }", "function head(array $list)\n{\n return array_shift($list);\n}", "public function first()\n {\n // return $this->_results[0];\n return $this->results()[0];\n }", "public function isFirst($path): bool\n {\n return $this->items && $path === array_keys($this->items)[0];\n }", "public function getFirst()\n\t{\n\t\treturn $this->first;\n\t}", "public function hasFirst()\n\t{\n\t\treturn ($this->blnShowFirstLast && $this->intItem > 2) ? true : false;\n\t}", "public function firstKey(): ?int;", "public function getFirst()\n {\n return $this->first;\n }", "public function getFirst()\n {\n return $this->first;\n }", "public function firstRow() {\n\t}", "public function first() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_shift( $result );\n\t}", "public function first()\n {\n return (count($this->list) > 0 ?\n $this->list[0] : null\n );\n }", "function firstrow() {\r\n\t\t$result=@mysql_data_seek($this->result,0);\r\n\t\tif ($result) {\r\n\t\t\t$result=$this->getrow();\r\n\t\t}\r\n\t\treturn $this->row;\r\n\t}", "public function first()\n {\n $this->rewind();\n return $this->current();\n }", "function first ()\n {\n return $this->A ? $this->A[0] : null;\n }", "public function getFirstPage();", "function KeyFirstList ( )\n{\n if ( count($this->_dataset) > 0 ) {\n $n = $this->_CurrPtr;\n $this->FirstRecord();\n $this->_fetch_current_key_($this->_KeyFirstList);\n $this->_CurrPtr = $n;\n }\n return $this->_KeyFirstList;\n}", "public function first(): mixed\n {\n return array_first($this->data);\n }", "public function first()\n {\n return reset($this->_elements);\n }", "public static function first($array) {\n\t\treturn $array[0];\n\t}", "function first(array $array): mixed\n{\n return $array ? reset($array) : null; // No falses.\n}", "public function first()\n {\n if(isset($this->list[0]))\n {\n return $this->list[0];\n }\n else\n {\n throw new NoSuchElementException(\"no element found in the first position of the sequence\");\n }\n }", "function head() {\r\n return $this->list[0];\r\n }", "public function first($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function first() {\n return $this->seek(0);\n }", "public function firstKey() {\n\t\t$keys = $this->keys();\n\t\treturn array_shift($keys);\n\t}", "function MoveFirst() \n\t{\n\t\tif ($this->_currentRow == 0) return true;\n\t\treturn $this->Move(0);\t\t\t\n\t}", "public function testFirst()\r\n {\r\n self::assertEquals(1, Arr::first([1, 2, 3]));\r\n self::assertEquals('a', Arr::first(['a', 'b', 'c']));\r\n self::assertNotEquals('b', Arr::first(['a', 'b', 'c']));\r\n\r\n self::assertEquals(2, Arr::first([1, 2, 3], function ($value) {\r\n return $value === 2;\r\n }));\r\n self::assertEquals(null, Arr::first([1, 2, 3], function ($value) {\r\n return $value === 20;\r\n }));\r\n\r\n self::assertInternalType('int', Arr::first([1, 2, 3]));\r\n self::assertInternalType('string', Arr::first(['a', 'b', 'c']));\r\n }", "public function First()\n {\n return $this->Results()[0];\n }", "public function getFirstItemValue()\n {\n $slab = $this->getFirstSlab();\n\n if (empty($slab)) {\n return false;\n }\n\n return $this->getFirstItemValueInSlab($slab);\n }", "public function first()\n {\n return $this->getData(0);\n }", "static public function getFirstPage() {\n\t\treturn self::$first_page;\n\t}", "function combunity_is_first(){\n\n}", "public function first(){\n\n //using the above (results) method here\n return $this->results()[0]; //depends on the version of your PHP server\n //return $this->results[0];\n }", "final public function getFirst() {\n\t\treturn null;\n\t}", "public function first()\n {\n if($this->length()>0)\n {\n return $this->getAt(0);\n }\n throw new \\OutOfBoundsException();\n }", "function firstPage()\n\t\t{\n\t\t\t$this->currentPage = 1;\n\t\t}", "public function first(): string;", "public function getFirstId() {\n return $this->id[0];\n }", "public function first()\n {\n return $this->take(1)->get()->first();\n }", "public function first()\n {\n return $this->results()[0];\n }", "public function getFirstCarItem()\n {\n $query = $this->createQueryBuilder('car')\n ->setMaxResults(1)\n ->getQuery();\n\n return $query->getSingleResult();\n }" ]
[ "0.8342806", "0.79867476", "0.7901766", "0.78733444", "0.7873051", "0.759306", "0.72803336", "0.7273573", "0.7205533", "0.7191162", "0.7114984", "0.7054638", "0.7052236", "0.69821215", "0.6979443", "0.6979443", "0.6979443", "0.6979443", "0.6979443", "0.6979443", "0.6979443", "0.6979443", "0.6938723", "0.687203", "0.686952", "0.68684673", "0.68684673", "0.68502605", "0.67911124", "0.67759603", "0.67486256", "0.6747602", "0.67244726", "0.67177063", "0.66673124", "0.66238725", "0.66172194", "0.66166365", "0.66126454", "0.66122895", "0.65868825", "0.65508366", "0.6550198", "0.6538724", "0.6536829", "0.65300196", "0.6477175", "0.64506614", "0.644338", "0.64403737", "0.64393693", "0.64388096", "0.64159936", "0.64132804", "0.6411521", "0.64019305", "0.6396026", "0.6392839", "0.63847196", "0.63707507", "0.6368999", "0.6295564", "0.62640405", "0.6246743", "0.6229244", "0.6216462", "0.62000585", "0.62000585", "0.6198665", "0.6192884", "0.6191564", "0.61815125", "0.61810327", "0.6173846", "0.61673033", "0.6157716", "0.61455476", "0.61403495", "0.61354625", "0.61282843", "0.6111216", "0.6075707", "0.607474", "0.6053875", "0.6045993", "0.6040654", "0.6036384", "0.60162705", "0.60070336", "0.60033584", "0.6001337", "0.59917647", "0.5981442", "0.59810215", "0.59777987", "0.5973303", "0.59617776", "0.5929999", "0.59279907", "0.5922208", "0.5914556" ]
0.0
-1
Field is Empty check
public function fieldIsEmpty(?string $field) { return empty($field); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAllFieldsAreEmpty() {}", "function checkEmptyField($field) {\n\t return isset($field) && $field !== \"\" && $field !== '';\n }", "function is_field_empty(array $fields) {\n foreach ($fields as $key => $value) {\n $fields[$key] = isset($value) ? trim($value) : '';\n }\n /* If there is nothing a field then valid empty index is false */\n if (in_array(\"\", $fields, true)) {\n return false;\n }\n /* return array */\n return $fields;\n}", "function empty_field($field)\n{\n return empty($field);\n}", "function not_empty($fields = [])\r\n{\r\n if (count($fields) !=0) {\r\n foreach ($fields as $field) {\r\n if (empty($_POST [$field]) || trim($_POST[$field]) == \"\") { //trim escape all spaces. If empty : false\r\n return false;\r\n }\r\n }\r\n return true ; //fields filled\r\n }\r\n}", "function acf_is_empty($var)\n{\n}", "public function is_empty()\r\n {\r\n if( $this->is_submit() && ($this->taintedInputs->length()=== 0))\r\n return true; \r\n else\r\n return false;\r\n }", "public function isEmpty()\n {\n return $this->_value === '' || $this->_value === null;\n }", "function is_empty()\n {\n }", "public function isEmpty() {\r\n\t\treturn $this->getValue() == null || $this->getValue() == '' || $this->getValue() == 0;\r\n\t}", "function is_empty() {\n\t\treturn !$this->count();\n\t}", "public function isEmpty()\n {\n return '' === $this->getValue();\n }", "function not_empty(array $fields) { // création tableau\r\n\t\r\n\r\n\t\tif (count($fields)!=0)\t{ // verif.si il y a des elements dans le tableau\r\n\t\t\r\n\r\n\t\t\tforeach ($fields as $field) {\r\n\r\n\t\t\t\tif (empty($_POST[$field]) || trim($_POST[$field])==\"\") {\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\treturn false; // verif.que tous les champs soient remplis, sinon \"false\"\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\t\r\n\r\n\r\n\t\t}", "public function isFilled()\n {\n return ! empty($this->data);\n }", "function validate_not_empty($field_input, &$field)\n{\n if (strlen($field_input) == 0) {\n $field['error'] = 'field is empty';\n return false;\n }\n return true;\n}", "function fieldsEmpty() {\n if(empty($_POST['title']) || empty($_POST['date']) || empty($_POST['location'])) {\n return true;\n } else {\n return false;\n }\n}", "public function isEmpty()\n {\n return\n empty($this->items)\n && empty($this->fields);\n }", "public function notEmpty($field) {\n\t\treturn ( ! empty($_POST[$field['name']]));\n\t}", "public function nonEmpty();", "function acf_not_empty($var)\n{\n}", "public function is_empty(){\r\n\t\treturn $this->size==0;\r\n\t}", "public static function isEmpty($field)\n {\n return ($field === '' or $field === NULL);\n }", "public function isEmpty()\r\n {\r\n return isset($this->data['total']) AND $this->data['total'] == '0';\r\n }", "function _ting_boost_field_filter($element) {\n return !(empty($element['field_name']) || empty($element['field_value']));\n}", "public function isField() : bool\n {\n return null == $this->fields || empty($this->fields);\n }", "public function isEmpty() {\n return empty($this->__value);\n }", "public function is_empty() {\n return ($this->count == 0);\n }", "public function isEmpty()\n {\n return empty($this->record);\n }", "public function isEmpty()\n {\n return $this->length === 0;\n }", "public function testValidateFieldExistsFieldEmptyOK()\n {\n $actual = TestJsConnect::validateFieldExists(\n \"foo\",\n [\"foo\" => \"\"],\n \"bar\",\n false\n );\n $this->assertSame(\"\", $actual);\n }", "function validate_not_empty($field_input, &$field) {\r\n if ($field_input === '') {\r\n $field['error'] = 'Laukas negali b?ti tuš?ias!';\r\n } else {\r\n return true;\r\n }\r\n}", "public function isEmpty() {}", "public function is_empty()\r\n {\r\n return count($this->errors) == 0;\r\n }", "public function is_empty()\r\n {\r\n return count($this->errors) == 0;\r\n }", "public function isEmpty() {\n\t\treturn empty($this->_value);\n\t}", "function isEmpty()\n {\n }", "public function isNotEmpty();", "protected function checkEmpty($field)\n\t{\n\t\tif(isset($field) && !empty($field))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isEmpty()\n {\n return count($this->values) === 0;\n }", "public function isEmpty() {\n return $this->getLength() == 0;\n }", "public function isNotEmpty() {\n\t\treturn !empty($this->_value);\n\t}", "function checkEmpty(){\n\t\tif(!empty($_POST)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isEmpty()\n {\n return empty(trim($this->_value));\n }", "public function isEmpty() {\n return !(\n ($this->dict['account_id'] && $this->dict['account_id'] != 0)\n || ($this->dict['entry'] && !$this->dict['entry']->isEmpty())\n || ($this->dict['recurring'] && !$this->dict['recurring']->isEmpty())\n || ($this->dict['entryDefault'] && !$this->dict['entryDefault']->isEmpty())\n || ($this->dict['recurringDefault'] && !$this->dict['recurringDefault']->isEmpty())\n );\n }", "function isEmpty($field, $msg, $inner=FALSE){\n\t\t$value = $this->_getValue($field);\n\t\tif (trim($value) == \"\"){\n if($inner==FALSE){\n $this->_errorList[] = array(\"field\" => $field,\n\t\t\"value\" => $value, \"msg\" => $msg);\n\t\treturn false;\n }else{\n return false;\n }\n\t\t\n\t\t}else{\n\t\treturn true;\n\t\t}\n\t}", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function isEmpty();", "public function hasFields()\n {\n return !empty($this->fields);\n }", "public function hasField($key){ return !empty($this->field_map[$key]); }", "public function isBlank()\n {\n return $this->matchesPattern('^[[:space:]]*$');\n }", "function empty_field_check() {\n $all_full =\n isset($_POST['email']) &&\n isset($_POST['username']) &&\n isset($_POST['password']) &&\n isset($_POST['name']) &&\n isset($_POST['surname']);\n \n if(!$all_full)\n launch_error(\"Some fields are empty.\");\n}", "function filled_out($form_vars) {\n foreach ($form_vars as $key => $value) {\n if ((!isset($key)) || ($value == '')) {\n return false;\n }\n }\n return true;\n}", "function blankCheck() {\n\tfor($i = 0; $i < func_num_args(); $i++) {\n\t\tif (($_POST[func_get_arg($i)] == '') OR ($_POST[func_get_arg($i)] === 0)) {\n\t\t\tresponse(1, '必填项中含有空值');\n\t\t\texit(0);\n\t\t}\n\t}\n}", "function emptyFieldAccount($account){\n\t\t$checker = false;\n\t\tif($account['userFirstName'] == ''){\n\t\t\t$checker = true;\n\t\t}\n\t\telseif ($account['userSurName'] == '') {\n\t\t\t$checker = true;\n\t\t}\n\t\telseif($account['userEmail'] == ''){\n\t\t\t$checker = true;\n\t\t}\n\t\telseif ($account['usernameCredentials'] == '') {\n\t\t\t$checker = true;\n\t\t}\n\t\telseif($account['passwordCredentials'] == ''){\n\t\t\t$checker = true;\n\t\t}\n\t\telseif ($account['userGender'] == '') {\n\t\t\t$checker = true;\n\t\t}\n\t\telseif($account['userAddress'] == ''){\n\t\t\t$checker = true;\t\n\t\t}\n\t\treturn $checker;\n\t}", "function filled_out($form_vars)\r\n{\r\n foreach ($form_vars as $key => $value)\r\n {\r\n if (!isset($key) || ($value == \"\"))\r\n return true;\r\n }\r\n return true;\r\n}", "public function isEmpty()\n {\n return empty($this->data);\n }", "static function all_Empty()\r\n {\r\n echo PageBuilder::printError(\"Please enter valid data in all the fields, nothing can not be empty.\");\r\n }", "public function notempty($field)\n {\n return is_string($field) && trim($field) !== '';\n }", "public function isEmpty(): bool\n {\n return 0 === \\mb_strlen($this->getValue());\n }", "public function isVoid()\n {\n return empty($this->fields);\n }", "public function isEmpty() {\n return $this->size() == 0;\n }", "function is_empty($data) {\n\treturn empty($data);\n}", "public function isEmpty()\n {\n return $this->count() === 0;\n }", "public function isEmpty() {\n return empty($this->_data);\n }", "function _testIsEmpty()\n {\n parent::_testIsEmpty();\n $this->assertFalse($this->m_attribute->isEmpty(array($this->m_attribute->m_name=>array(0=>1,1=>2))), \"isempty\");\n }", "public function isEmpty()\n {\n \treturn 0 == $this->getItemCount();\n }", "public function isEmpty()\n {\n return count($this->_metaData) == 0;\n }", "public function isEmpty()\n\t{\n\t\treturn (empty($this->title)\n\t\t\t\t&& empty($this->body)\n\t\t\t\t&& is_null($this->sub_alert));\n\t}", "public function hasBlankFields($array) : bool\n { \n return (in_array('', $array, true) || in_array(null, $array, true)) ? true && $this->setError(true) : false;\n }", "function filled($value)\n {\n return !blank($value);\n }", "public function hasFields(){ return !empty($this->field_map); }", "function is_blank($value) {\n if (is_object($value) && method_exists($value, 'is_blank')) return $value->is_blank();\n if (is_string($value)) $value = trim($value);\n return is_empty($value);\n}", "public function validateEmpty($data)\n {\n return true;\n }", "public function isEmpty()\n\t{\n\t\treturn count( $this ) < 1;\n\t}", "public function isEmpty()\n {\n return $this->getTotalQty() == 0;\n }", "public function notEmpty()\n {\n $this->non_empty = true;\n }", "public function isNotEmpty(): bool\n {\n return ! $this->isEmpty();\n }", "public function isNotEmpty()\n {\n return ! $this->isEmpty();\n }", "public function isNotEmpty()\n {\n return ! $this->isEmpty();\n }", "public function isEmpty()\r\n {\r\n return empty($this->attributes);\r\n }", "function not_empty($tableau) {\n\tforeach ($tableau as $champ) {\n\t\tif(empty($_POST[$champ]) || trim($_POST[$champ])==\"\" ){\n\t\t\treturn false;\n\t\t# code.\n\t\t}\n\n\t}\n\treturn true;\n}", "public function isEmpty() {\n return $this->is(new NotPossible('is empty'));\n }", "public function isEmpty(): bool\n {\n return is_null($this->value);\n }", "public function emptyField($content) {\r\n if (!isset($content) || strlen ( $content ) == 0) {\r\n throw new ValidationException ( self::ERROR_FIELD_EMPTY );\r\n }\r\n }", "public function isEmpty()\n {\n }" ]
[ "0.8290879", "0.8093673", "0.79162854", "0.7916175", "0.7638938", "0.76159126", "0.757369", "0.7543083", "0.7514282", "0.75054026", "0.7420845", "0.7345277", "0.7342716", "0.7310584", "0.72944057", "0.72915643", "0.7282386", "0.72814345", "0.72140265", "0.72110516", "0.71909773", "0.7181607", "0.71737045", "0.71625763", "0.7155079", "0.71352655", "0.7127093", "0.71155155", "0.71135", "0.70976764", "0.70502275", "0.7045072", "0.70383877", "0.70383877", "0.70272326", "0.7026055", "0.70245725", "0.70223916", "0.7016544", "0.7016497", "0.70117384", "0.70106125", "0.69921356", "0.69778425", "0.6928009", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.69248354", "0.6914902", "0.6908884", "0.6907896", "0.6904409", "0.6903067", "0.69009405", "0.68986213", "0.6893396", "0.68856466", "0.6885428", "0.6875558", "0.68726194", "0.6869958", "0.6868533", "0.6856745", "0.68440396", "0.68433046", "0.6841159", "0.6840919", "0.6837496", "0.68373615", "0.6829092", "0.6823643", "0.6820423", "0.68111736", "0.68091863", "0.6800963", "0.67948085", "0.6768775", "0.6765051", "0.6761597", "0.6761597", "0.6753681", "0.6751743", "0.6751261", "0.6743963", "0.67415756", "0.67370623" ]
0.722624
18
Realiza una consulta que espera obtener como resultado solo un registro
public function getOneResult($sql){ $connection = $this->connect(); $logger = Logger::getRootLogger(); try{ if (!$query = $connection->query($sql)){ $mensaje = "No se pudo consultar. SQL: " . $sql; $logger->error($mensaje); throw new Exception($mensaje); } if ($query->num_rows === 0) { return null; } if ($query->num_rows > 1) { $mensaje = "La consulta devolvió mas de un resultado."; $logger->error($mensaje); throw new Exception($mensaje); } $result = $query->fetch_assoc(); $query->free(); }catch(Exception $e){ $mensaje = "Ha ocurrido un error: " . $e; $logger->error($mensaje); throw new Exception($mensaje); }finally{ $connection->close(); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consulta($Conexion_ID, $Where = \"\"){\r\n\r\n $SQL = \"SELECT me.id, me.snombre,\r\n\t\t me.sapellido, me.stelefono,\r\n\t\t me.stelefono_1, me.id_especialidad,\r\n\t\t me.bactivo, esp.id as esp_id, esp.sdescripcion as esp_descrip FROM doctor me, especialidad esp WHERE me.id_especialidad = esp.id \";\r\n\r\n if (!empty($Where)) {\r\n $SQL .= \" AND \" . $Where;\r\n\r\n }\r\n\r\n $SQL .= \" ORDER BY sapellido \";\r\n\r\n//ejecutamos la consulta\r\n\r\n\r\n $this->Consulta_ID = @mysql_query($SQL, $Conexion_ID);\r\n\r\n if (!$this->Consulta_ID) {\r\n\r\n $this->Errno = mysql_errno();\r\n\r\n $this->Error = mysql_error();\r\n\r\n }\r\n\r\n/* Si hemos tenido éxito en la consulta devuelve el identificador de la conexión, sino devuelve 0 */\r\n\r\n return $this->Consulta_ID;\r\n\r\n}", "private function _consultar() {\n $where = \"\";\n if(!empty($this->_idDato)){\n $where = \"AND b.id_valor = $this->_idDato \";\n }\n if(!empty($this->_valor)){\n if(is_array($this->_valor)){\n $aux = each($this->_valor);\n $where = \"AND b.valor {$aux['key']} '{$aux['value']}' \";\n }else{\n $where = \"AND b.valor = '$this->_valor' \";\n }\n \n }\n $query = \"SELECT a.nom_tabla,b.* FROM \nmt_tablas a,\nmt_contenidos b\nWHERE a.id_tablas = {$this->_idTabla}\nAND a.estado = 1 $where\nAND a.id_tablas = b.id_tabla\nAND b.estado = 1\";\n \n if(is_array($this->_orden) && count($this->_orden) == 2){\n $query .= (\" ORDER BY \" . ($this->_orden[0] == 1 ? \"id_valor \" : \"valor \") . $this->_orden[1] );\n }\n $con = ConexionSQL::getInstance();\n $id = $con->consultar($query);\n if($res = $con->obenerFila($id)){\n $R = array();\n do{\n $aux = array();\n foreach($res as $key => $valor){\n if(!is_numeric($key)){\n $aux[$key] = $valor;\n }\n }\n $R[] = $aux;\n }while($res = $con->obenerFila($id));\n return $R;\n }\n return false;\n }", "public function consultarDatos($consultaSQL){\n $conexionBD=$this->conectarBD();\n\n //2.Preparar la consulta que se va a realizar\n $consultaBuscarDatos= $conexionBD->prepare($consultaSQL);\n\n //3. Definir la forma en la que vmos a traer los datos\n // setFetchMode\n $consultaBuscarDatos->setFetchMode(PDO::FETCH_ASSOC);\n\n //4.Ejecutar la consulta\n $consultaBuscarDatos->execute();\n\n //5. Retornar los datos consultados\n return($consultaBuscarDatos->fetchAll());\n\n\n\n}", "private function query_consultores(){\n\n \t$respuesta = false;\n\n\t\ttry {\n\n\t\t\t$this->db->select('cao_usuario.co_usuario');\n\t\t\t$this->db->select('cao_usuario.no_usuario');\n\t\t\t$this->db->select('cao_usuario.no_email');\t\n\t\t\t$this->db->from('cao_usuario');\n\t\t\t$this->db->join('permissao_sistema', 'permissao_sistema.co_usuario = cao_usuario.co_usuario');\n\t\t\t$this->db->where('cao_usuario.co_usuario is NOT NULL', NULL, FALSE);\n\t\t\t$this->db->where('permissao_sistema.co_sistema',$this->_co_sistema);\n\t\t\t$this->db->where('permissao_sistema.in_ativo',$this->_in_ativo);\n\t\t\t$this->db->where_in('permissao_sistema.co_tipo_usuario', $this->_co_tipo_usuario);\n\t\t\t$this->db->order_by(\"cao_usuario.co_usuario\", \"asc\");\t\t\t\n\n\t\t\t$query = $this->db->get();\n\n\t\t if ($query && $query->num_rows() > 0)\n\t\t {\n\t\t\t\t$respuesta = $query->result_array();\n\n\t\t }else{\n\n\t\t throw new Exception('Error al intentar listar todos los consultores');\n\t\t\t log_message('error', 'Error al intentar listar todos los consultores');\t\t \n\n\t\t $respuesta = false;\t\t\t\t\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\n\t\t\t$respuesta = false;\n\t\t}\t\t\t\n\n\t\treturn $respuesta;\n }", "public function consult(){\n\t\t\t$para = array(\"1\"=>1);\n\t\t\tif($this->tipodocum_id_tipodocum != null){\n\t\t\t\t$para[\"tipodocum_id_tipodocum\"] = $this->tipodocum_id_tipodocum;\n\t\t\t}\n\t\t\tif($this->documento != null){\n\t\t\t\t$para[\"documento\"] = $this->documento;\n\t\t\t}\n\t\t\t\n\t\t\t$query = $this->db->get_where(\"paciente\",$para);\n\t\t\treturn $query->result();\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 }", "function listar($objeto){\n\t\t$condicion.=(!empty($objeto['id']))?' AND r.id='.$objeto['id']:'';\n\t// Filtra por los insumos preparados\n\t\t$condicion.=(!empty($objeto['insumos_preparados']))?' AND ids_insumos_preparados!=\\'\\'':'';\n\t// Filtra por tipo\n\t\t$condicion.=(!empty($objeto['tipo'])) ? ' AND p.tipo_producto = '.$objeto['tipo'] : '';\n\t// Filtros\n\t\t$condicion.=(!empty($objeto['filtro']) && $objeto['filtro'] == 'insumos_preparados_formula') ? ' AND (p.tipo_producto = 8 OR p.tipo_producto = 9) ' : '';\n\n\n\t// Ordena la consulta si existe\n\t\t$condicion.=(!empty($objeto['orden']))?' ORDER BY '.$objeto['orden']:'';\n\n\t\t$sql = \"SELECT\n\t\t\t\t\tp.id AS idProducto, p.nombre, p.costo_servicio AS costo,\n\t\t\t\t\tp.id_unidad_compra AS idunidadCompra, p.id_unidad_venta AS idunidad, p.factor as multiplo,\n\t\t\t\t\t(SELECT\n\t\t\t\t\t\tnombre\n\t\t\t\t\tFROM\n\t\t\t\t\t\tapp_unidades_medida uni\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tuni.id=p.id_unidad_venta) AS unidad, u.factor, p.tipo_producto,\n\t\t\t\t\tr.ids_insumos_preparados AS insumos_preparados, r.ids_insumos AS insumos,\n\t\t\t\t\tr.preparacion, r.ganancia, ROUND(p.precio, 2) AS precio, p.codigo, p.minimos\n\t\t\t\tFROM\n\t\t\t\t\tapp_productos p\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_campos_foodware f\n\t\t\t\t\tON\n\t\t\t\t\t\tp.id = f.id_producto\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tcom_recetas r\n\t\t\t\t\tON\n\t\t\t\t\t\tr.id = p.id\n\t\t\t\tLEFT JOIN\n\t\t\t\t\t\tapp_unidades_medida u\n\t\t\t\t\tON\n\t\t\t\t\t\tu.id = p.id_unidad_compra\n\t\t\t\tWHERE\n\t\t\t\t\tp.status = 1 AND (p.tipo_producto = 8 OR p.tipo_producto = 9)\";\n\n\t\treturn $this->queryArray($sql);\n\t}", "public function buscarEstudiante() {\n\n $sql = \"SELECT D.tipodocumento, D.nombrecortodocumento, E.codigocarrera,\n EG.numerodocumento, EG.idestudiantegeneral, EG.nombresestudiantegeneral, \n EG.apellidosestudiantegeneral, EG.expedidodocumento, EG.codigogenero, \n EG.ciudadresidenciaestudiantegeneral, EG.fechanacimientoestudiantegeneral, EG.direccionresidenciaestudiantegeneral, \n EG.telefonoresidenciaestudiantegeneral, EG.emailestudiantegeneral, D.nombredocumento\n\t\tFROM \n estudiantegeneral EG\n\t\tINNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n\t\tINNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n\t\tWHERE\n E.codigoestudiante = ? \";\n /* FIN MODIFICACION */\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n $this->setFechaNacimiento($this->persistencia->getParametro(\"fechanacimientoestudiantegeneral\"));\n $this->setDireccion($this->persistencia->getParametro(\"direccionresidenciaestudiantegeneral\"));\n $this->setTelefono($this->persistencia->getParametro(\"telefonoresidenciaestudiantegeneral\"));\n $this->setEmail($this->persistencia->getParametro(\"emailestudiantegeneral\"));\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n $this->setCarrera($carrera);\n\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n $tipoDocumento->setNombreDocumento($this->persistencia->getParametro(\"nombredocumento\"));\n\n $genero = new Genero(null);\n $genero->setCodigo($this->persistencia->getParametro(\"codigogenero\"));\n\n $ciudad = new Ciudad(null);\n $ciudad->setId($this->persistencia->getParametro(\"ciudadresidenciaestudiantegeneral\"));\n\n $this->setCiudad($ciudad);\n $this->setGenero($genero);\n $this->setTipoDocumento($tipoDocumento);\n }\n\n $this->persistencia->freeResult();\n }", "public function buscarEstudianteAcuerdo() {\n\n $sql = \"SELECT \n D.tipodocumento, D.nombrecortodocumento, EG.numerodocumento, EG.idestudiantegeneral,\n EG.nombresestudiantegeneral, EG.apellidosestudiantegeneral, EG.expedidodocumento, C.codigocarrera\n FROM \n estudiantegeneral EG\n INNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n INNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n INNER JOIN carrera C ON ( C.codigocarrera = E.codigocarrera )\n INNER JOIN FechaGrado FG ON ( FG.CarreraId = C.codigocarrera )\n INNER JOIN AcuerdoActa A ON ( A.FechaGradoId = FG.FechaGradoId )\n INNER JOIN DetalleAcuerdoActa DAC ON ( DAC.AcuerdoActaId = A.AcuerdoActaId AND E.codigoestudiante = DAC.EstudianteId )\n WHERE\n E.codigoestudiante = ?\n AND D.CodigoEstado = 100\n AND DAC.EstadoAcuerdo = 0\n AND DAC.CodigoEstado = 100\";\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n\n $fechaGrado = new FechaGrado(null);\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n\n $fechaGrado->setCarrera($carrera);\n\n $this->setTipoDocumento($tipoDocumento);\n\n $this->setFechaGrado($fechaGrado);\n }\n\n $this->persistencia->freeResult();\n }", "public function select(){\n\t\t$sql = \"SELECT * FROM cargo\n\t\t\t\twhere car_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function consulta_asistencia()\n {\n $fecha_reporte = cambiaf_a_mysql($this->txt_fecha_desde->Text);\n $dir = $this->drop_direcciones->SelectedValue;\n $cod_organizacion = usuario_actual('cod_organizacion');\n\n // se obtienen las justificaciones del día seleccionado\n $sql=\"SELECT (p.cedula) as cedula_just, p.nombres, p.apellidos, j.codigo, jd.fecha_desde, jd.hora_desde,\n jd.fecha_hasta, jd.hora_hasta, jd.observaciones, jd.lun, jd.mar, jd.mie, jd.jue, jd.vie,\n tf.descripcion as descripcion_falta, tj.descripcion as descripcion_tipo_justificacion\n\t\t\t\t\t FROM asistencias.justificaciones as j, asistencias.justificaciones_dias as jd,\n\t\t\t\t\t\t asistencias.justificaciones_personas as jp, organizacion.personas as p, organizacion.personas_nivel_dir as n, asistencias.tipo_faltas tf, asistencias.tipo_justificaciones tj\n\t\t\t\t\t\tWHERE ((p.cedula = jp.cedula) and\n\t\t\t\t\t\t (p.cedula = n.cedula) and (jd.codigo_tipo_falta = tf.codigo) and (tj.id = jd.codigo_tipo_justificacion) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t (jd.fecha_desde <= '$fecha_reporte') and\n\t\t\t\t\t\t\t (jd.fecha_hasta >= '$fecha_reporte') and\n\t\t\t\t\t\t\t (j.estatus='1') and (j.codigo=jd.codigo_just) and (j.codigo=jp.codigo_just))\n\t\t\t\t\t\tORDER BY p.nombres, p.apellidos, jp.cedula \";\n $this->justificaciones=cargar_data($sql,$this); \n\n // se obtiene el horario vigente para la fecha seleccionada\n $this->horario_vigente = obtener_horario_vigente($cod_organizacion,$fecha_reporte,$this);\n \n // se realizan las consultas para mostrar los listados\n // Se consultan los asistentes\n $sql=\"SELECT (p.cedula) as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre,\n e.cedula, e.fecha, MIN(e.hora) as entrada, MAX(e.hora) as salida\n FROM asistencias.entrada_salida as e, organizacion.personas as p, organizacion.personas_nivel_dir as n\n WHERE ((p.cedula = e.cedula) and\n (p.cedula = n.cedula) and\n (n.cod_direccion LIKE '$dir%') and\n (p.fecha_ingreso <= '$fecha_reporte') and\n (e.fecha <= '$fecha_reporte') and\n (e.fecha >= '$fecha_reporte'))\n GROUP BY e.cedula\n ORDER BY entrada, p.nombres, p.apellidos \";\n $this->asistentes=cargar_data($sql,$this);\n $this->ind_asistentes = count($this->asistentes);\n\n // se consultan los inasistentes\n $sql2=\"SELECT p.cedula as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre\n\t\t\t\t\t\t\t\t\t FROM organizacion.personas as p, asistencias.personas_status_asistencias as s,\n\t\t\t\t\t\t\t\t\t organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t WHERE ((s.status_asistencia = '1') and\n\t\t\t\t\t\t\t\t\t \t\t (s.cedula = p.cedula) and\n\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t (p.cedula not in\n\t\t\t\t\t\t\t\t\t (SELECT e.cedula\n\t\t\t\t\t\t\t\t\t\t FROM asistencias.entrada_salida as e, organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t\t \t WHERE ((e.fecha = '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%'))\n\t\t\t\t\t\t\t\t\t\t\t GROUP BY e.cedula)))\n\t\t\t\t\t\t\t\t\t ORDER BY p.nombres, p.apellidos\";\n $this->inasistentes=cargar_data($sql2,$this);\n\n\n // Se consultan los asistentes para comparar inconsistencia de horas en el marcado\n // Si le falta hora\n $inconsistentes = array();\n foreach($this->asistentes as $arreglo){\n \n $sql2=\"SELECT COUNT(*) as n_horas FROM asistencias.entrada_salida as e\n\t\t\t WHERE e.fecha = '$fecha_reporte' AND e.cedula = '$arreglo[cedula_integrantes]' \";\n $resultado2=cargar_data($sql2,$this);\n if(!empty($resultado2)){\n if ($resultado2[0][n_horas]%2!=0) {//impar\n array_unshift($inconsistentes, array('cedula'=>$arreglo[cedula_integrantes], 'nombre'=>$arreglo[nombre],'salida'=>$arreglo[salida]));\n }//fin si\n }//fin si\n }//fin each\n\n\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n //$this->DataGrid_fj->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n if(!empty($inconsistentes)){\n $this->DataGrid_fh->DataSource=$inconsistentes;\n $this->DataGrid_fh->dataBind();\n }\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n $this->DataGrid->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n $this->DataGrid->DataSource=$this->asistentes;\n $this->DataGrid->dataBind();\n\n\n $this->DataGrid_ina->Caption=\"Inasistentes el d&iacute;a \".$this->txt_fecha_desde->Text;\n $this->DataGrid_ina->DataSource=$this->inasistentes;\n $this->DataGrid_ina->dataBind();\n\n /* Por un error que no supe identificar, el cual suma un numero adicional a la variable\n * de inasistentes no justificados, he tenido que sacarla del procedimiento donde normalmente\n * se contaba y tuve que realizarla por resta en esta sección.\n */\n $this->ind_inasistentes_no_just = count($this->inasistentes) - $this->ind_inasistentes_si_just;\n\n $this->Repeater->DataSource = $this->justificaciones;\n $this->Repeater->dataBind();\n\n $xale=rand(100,99999);\n // Se realiza la construcción del gráfico para indicadores\n\n $chart = new PieChart();\n $dataSet = new XYDataSet();\n if ($this->ind_asistentes>=1) {$dataSet->addPoint(new Point(\"Funcionarios Asistentes: (\".$this->ind_asistentes.\")\", $this->ind_asistentes));};\n if ($this->ind_inasistentes_no_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes NO JUSTIFICADOS: (\".$this->ind_inasistentes_no_just.\")\", $this->ind_inasistentes_no_just));};\n if ($this->ind_inasistentes_si_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes JUSTIFICADOS: (\".$this->ind_inasistentes_si_just.\")\", $this->ind_inasistentes_si_just));};\n $chart->setDataSet($dataSet);\n $chart->setTitle(\"Porcentajes de Asistencias / Inasistencias del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_01.png\");\n $chart->render(\"imagenes/temporales/\".$xale.\"_01.png\");\n $this->grafico1->ImageUrl = \"imagenes/temporales/\".$xale.\"_01.png\";\n\n\n $chart2 = new PieChart();\n $dataSet2 = new XYDataSet();\n $this->ind_asistentes_no_retrasados=$this->ind_asistentes-$this->ind_asistentes_tarde_no_just-$this->ind_asistentes_tarde_si_just;\n if ($this->ind_asistentes_no_retrasados>=1) {$dataSet2->addPoint(new Point(\"Puntuales: (\".$this->ind_asistentes_no_retrasados.\")\", $this->ind_asistentes_no_retrasados));};\n if ($this->ind_asistentes_tarde_no_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales NO JUSTIFICADOS: (\".$this->ind_asistentes_tarde_no_just.\")\", $this->ind_asistentes_tarde_no_just));};\n if ($this->ind_asistentes_tarde_si_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales JUSTIFICADOS: (\".$this->ind_asistentes_tarde_si_just.\")\", $this->ind_asistentes_tarde_si_just));};\n $chart2->setDataSet($dataSet2);\n $chart2->setTitle(\"Porcentajes de Retrasos del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_02.png\");\n $chart2->render(\"imagenes/temporales/\".$xale.\"_02.png\");\n $this->grafico2->ImageUrl = \"imagenes/temporales/\".$xale.\"_02.png\";\n\n // si la consulta de asistentes tiene resultados se habilita la impresion, sino, se deshabilita\n if (!empty($this->asistentes)) {$this->btn_imprimir->Enabled = true;} else {$this->btn_imprimir->Enabled = false;}\n\n }", "public function select(){\n\t$sql=\"SELECT * FROM tipousuario\";\n\treturn ejecutarConsulta($sql);\n}", "function realizarConsultas($sql)\r\n {\r\n $this->resultado = $this->mysqli->multi_query($sql);\r\n }", "function readOne(){\n\n $query = \"SELECT ordine.id_ordine, ordine.articolo, fornitore.nome as 'fornitore', ordine.stato \n FROM \". $this->table_name . \" INNER JOIN fornitore \n ON ordine.id_fornitore = fornitore.id_fornitore\n WHERE ordine.id_ordine = ?\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->bindParam(1, $this->id_ordine);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n \n if($row){\n\n $this->id_ordine = $row['id_ordine'];\n $this->articolo = $row['articolo'];\n $this->fornitore = $row['fornitore'];\n $this->stato = $row['stato'];\n\n }\n else{\n\n $query = \"SELECT ordine.id_ordine, ordine.articolo, ordine.stato \n FROM \". $this->table_name . \" WHERE ordine.id_ordine = ?\";\n\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->id_ordine);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n if($row){\n $this->id_ordine = $row['id_ordine'];\n $this->articolo = $row['articolo'];\n $this->stato = $row['stato'];\n }\n }\n }", "function consultarEmpleado(){\n\t$ced=$this->objEmpleado->getCedula();\n\t$objConexion = new ControlConexion();\n\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE CEDULA='\".$ced.\"' \";\n\n\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\n\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\n\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\t\t}\t\n\t\t$objConexion->cerrarBd(); \n\t\treturn $this->objEmpleado; \t\t\n}", "public function seleccionar(){\n //sql de la consulta\n $sql = \"SELECT * FROM especialidad E WHERE E.Estado = 1;\";\n //preparando la consulta\n $query = $this->conexion->prepare($sql);\n //ejecutandola\n $query->execute();\n //obteniendo el resultado en un arreglo asociativo\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n $this->conexion = null;\n return $result;\n }", "function RellenaDatosPorEdificio()\n{\n $sql = \"SELECT *\n\t\t\tFROM CENTRO\n\t\t\tWHERE (\n\t\t\t\t(CODEDIFICIO = '$this->CODEDIFICIO') \n\t\t\t)\";\n\t//si se ha actualizado guardamos un mensaje de éxito en la variable resultado\n\t//si se cumple la condicion\n\tif (!$resultado = $this->mysqli->query($sql))\n\t{\n\t\t\treturn 'Error de gestor de base de datos';\n\t}\n\treturn $resultado;//devuelve el mensaje\n}", "public function get_datos_empresa($empresa){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select *from empresas where nombre=?\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$empresa);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function consultar()\r\n {\r\n $id = $_GET['id'];\r\n\r\n //criando conexão com o banco\r\n $q = new QueryBuilder();\r\n\r\n //selecionando dados\r\n $dados = $q->selectinner2($id);\r\n\r\n \r\n\r\n //devolvendo a pagina \r\n require './app/views/consultar.php';\r\n\r\n \r\n\r\n \r\n }", "function consultarUserEmpleado(){\n\t\t\n\t\t$usu=$this->objEmpleado->getUsuario();\n\t\t//SELECT ESTADO FROM `cliente` WHERE `usuario`=\"lili\"\n\t\t$objConexion = new ControlConexion();\n\t\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE USUARIO='\".$usu.\"' \";\n\t\t\n\t\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\t\n\t\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\t\n\t\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t\t$this->objEmpleado->setCedula($registro[\"cedula\"]);\n\t\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\n\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t$objConexion->cerrarBd(); \n\t\t\treturn $this->objEmpleado; \t\t\n\t}", "public function BuscarVentasCajas() \n{\n\tself::SetNames();\n\t$sql =\"SELECT detalleventas.codventa, cajas.nrocaja, ventas.idventa, ventas.codcliente, ventas.codcaja, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, SUM(detalleventas.cantventa) as articulos FROM (detalleventas LEFT JOIN ventas ON detalleventas.fechadetalleventa=ventas.fechaventa) \n\tLEFT JOIN cajas ON cajas.codcaja=ventas.codcaja LEFT JOIN clientes ON ventas.codcliente=clientes.codcliente WHERE ventas.codcaja = ? AND DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') <= ? GROUP BY detalleventas.codventa\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim($_GET['codcaja']));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(3, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN VENTAS DE PRODUCTOS PARA LA CAJA Y EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($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}", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function searchItemById(){\n\n $this -> Conexion -> abrir();\n $this -> Conexion -> ejecutar( $this -> ProductoDAO -> searchItemById());\n $res = $this -> Conexion -> extraer();\n $this -> idProducto = $res[0];\n $this -> nombre = $res[1];\n $this -> foto = $res[2];\n $this -> descripcion = $res[3];\n $this -> precio = $res[4];\n $this -> Conexion -> cerrar();\n }", "public function filtrar(){\n\n \t\t$sql=\"select * from __________ where ;\";\n \t return $this->ejecutar($sql); \n\n }", "public function select(){\n\t\t$sql = \"SELECT * FROM producto\n\t\t\t\twhere prod_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "function RellenaDatos()\n {\t// se construye la sentencia de busqueda de la tupla\n $sql = \"SELECT * FROM ENTREGA WHERE (IdTrabajo = '$this->idTrabajo' AND login = '$this->login')\";\n // Si la busqueda no da resultados, se devuelve el mensaje de que no existe\n if (!($resultado = $this->mysqli->query($sql))){\n return 'No existe en la base de datos'; //\n }\n else{ // si existe se devuelve la tupla resultado\n $result = $resultado->fetch_array();\n return $result;\n }\n }", "function consultarPedido (){\n\t\t$x = $this->pdo->prepare('SELECT * FROM pedido');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function consultar(){\n\t\t\n\t\t$this->mysqli = conectarBD();\n\t\t\n\t\t$sql = \"SELECT Linea_Factura.Id_Linea_Factura,Linea_Factura.Id_Factura,Servicio.Nombre,Linea_Factura.Importe,Linea_Factura.Descripcion FROM Linea_Factura INNER JOIN Servicio WHERE Linea_Factura.Id_Factura='\".$this->factura.\"' AND Linea_Factura.Id_Servicio=Servicio.Id_Servicio AND Linea_Factura.Borrado='0';\";\n\t\t$resultado = $this->mysqli->query($sql);\t\n\t\tif ($resultado->num_rows > 0){\n\t\t\twhile($row = $resultado->fetch_array()){\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t\treturn $array;\n\t\t}\n\t}", "public static function findById2($id=NULL)\n {\n $request=\"\";\n\n //Si On ne saisit pas l'id, on retourne toute la liste\n if ($id==NULL){\n $request=\"SELECT transTermi.idTerminal, termi.macAdress, transTermi.statut, transTermi.login, transTermi.password, transpo.RaisonSociale, transpo.idTransporteur FROM Entrepriseterminal as transTermi INNER JOIN terminals as termi on transTermi.idTerminal = termi.idTerminal INNER JOIN transporteurs as transpo on transpo.idTransporteur = transTermi.idEntreprise\";\n }\n else\n $request=\"SELECT transTermi.idTerminal, termi.macAdress, transTermi.statut, transTermi.login, transTermi.password, transpo.RaisonSociale, transpo.idTransporteur FROM Entrepriseterminal as transTermi INNER JOIN terminals as termi on transTermi.idTerminal = termi.idTerminal INNER JOIN transporteurs as transpo on transpo.idTransporteur = transTermi.idEntreprise WHERE login = :x\";\n\n $termTab= Array();\n\n $db = Database::getInstance();\n\n\n try{\n\n //On s'assure que la connexion n'est pas null\n if (is_null($db)){\n throw new PDOException(\"Impossible d'effectuer une requette de recherche verifier la connexion\");\n }\n //Preparation de la requette SQL pour l'execution(Tableau)\n $pstmt = $db->prepare($request);\n\n $pstmt->execute(array(':x' => $id));\n\n //Parcours de notre pstm tant qu'il y des données\n while ($result = $pstmt->fetch(PDO::FETCH_OBJ)){\n\n\n //Creation d'un terminal\n $terminal = new TerminalEntreprise();\n\n //Transfere des information d'objet vers un tableau\n $terminal->loadFromObjet($result);\n\n\n\n //On insere chaque objet a la fin du tableau $termTab\n array_push($termTab,$terminal);\n }\n\n $pstmt->closeCursor();\n $pstmt= NULL;\n\n\n }\n catch (PDOException $ex){\n ?>\n <!-- Affichage du message d'erreur au console terminal-->\n <script>console.log(\"Error createDAO: <?= $ex->getMessage()?>\")</script>\n <?php\n }\n return $termTab;\n\n\n\n\n }", "public function buscarPorIdEndereco($endereco) {\n \n //Preparando um comando sql para parametrização \n $sql = \"SELECT * FROM Endereco WHERE id_endereco = ?;\";\n\n $stmt = $this->conn->prepare($sql); \n\n $idEndereco = $endereco->getId(); \n \n\n //Passando os parametros e seus tipos (s = String, d = Double , i = Int)\n $stmt->bind_param('i', $idEndereco);\n \n // Executando o comando parametrizad\n\n if ($stmt->execute()){\n /* store first result set */\n $result = $stmt->get_result();\n while ($row = $result->fetch_assoc()) { \n\n $enderecoLocatario = new Endereco();\n $enderecoLocatario->setIdLocatario((int)$row[\"id_locatario\"]);\n $enderecoLocatario->setLogradouro((string)$row[\"logradouro\"]);\n $enderecoLocatario->setId((int)$row[\"id_endereco\"]);\n $enderecoLocatario->setCep((int)$row[\"cep\"]);\n $enderecoLocatario->setEstado((string)$row[\"estado\"]);\n $enderecoLocatario->setBairro((string)$row[\"Bairro\"]);\n $enderecoLocatario->setCidade((string)$row[\"Cidade\"]);\n $enderecoLocatario->setNumero((int)$row[\"numero\"]);\n $listEnderecoLocatario = $enderecoLocatario;\n \n }\n \n return $listEnderecoLocatario;\n }\n\n //$conexao->close();\n }", "function SEARCH(){\n//Se contruye la sentencia de busqueda usando Like\n $sql= \"SELECT\n IdTrabajo,\n login,\n Alias,\n Horas,\n Ruta\n FROM ENTREGA\n WHERE (\n (IdTrabajo LIKE REPLACE('%$this->idTrabajo%', ' ', '' ))&&\n (login LIKE REPLACE('%$this->login%', ' ', '' ))&&\n (Alias LIKE REPLACE('%$this->alias%', ' ', '' ))&&\n (Horas LIKE REPLACE('%$this->horas%', ' ', '' ))&&\n (Ruta LIKE REPLACE('%$this->ruta%', ' ', '' ))\n )\";\n // si se produce un error en la busqueda mandamos el mensaje de error en la consulta\n if (!($resultado = $this->mysqli->query($sql))){\n return 'Error en la consulta sobre la base de datos';\n }\n else{ // si la busqueda es correcta devolvemos el recordset resultado\n return $resultado;\n }\n}", "public function consultar ($conexion){\r\n // PROCEDIMIENTO ALMACENADO \r\n $query=\"call consulta_acudiente()\";\r\n $consulta=mysqli_query($conexion, $query);\r\n return $consulta;\r\n }", "function consultarCliente (){\n\t\t$x = $this->pdo->prepare('SELECT * FROM cliente');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "function consultarProducto (){\n\t\t$x = $this->pdo->prepare('SELECT * FROM producto');\n\t\t$x->execute();\n\t\treturn $x->fetchALL(PDO::FETCH_OBJ);\n\t}", "public function consultarTodos()\n\t{\n\t\t$sql = \t' SELECT colores.* '.\n\t\t\t\t' FROM colores '.\n\t\t\t\t' ORDER BY nombre ';\n\t\n\t\t$stmt = $this->getEntityManager()->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll(); //Se utiliza el fecth por que es un registro\n\t\t\n\t\t//Elimina los espacios\n\t\tforeach($result as &$reg)\n\t\t{\n\t\t\t$reg['nombre'] = trim($reg['nombre']);\n\t\t}//end foreach\n\t\n\t\treturn $result;\n\t}", "public function get_ventas_consulta($id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$sql=\"select*from ventas where id_paciente=?;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "public function buscarEstudianteActa() {\n\n $sql = \"SELECT\n D.tipodocumento, D.nombrecortodocumento, EG.numerodocumento, EG.idestudiantegeneral,\n EG.nombresestudiantegeneral, EG.apellidosestudiantegeneral, EG.expedidodocumento, C.codigocarrera\n FROM \n estudiantegeneral EG\n INNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n INNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n INNER JOIN carrera C ON ( C.codigocarrera = E.codigocarrera )\n WHERE \n E.codigoestudiante = ?\n AND E.codigoestudiante NOT IN ( \n SELECT \n DC.EstudianteId\n FROM \n DetalleAcuerdoActa DC\n WHERE \n CodigoEstado = 100)\";\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n\n $fechaGrado = new FechaGrado(null);\n $carrera = new Carrera(null);\n\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n $fechaGrado->setCarrera($carrera);\n $this->setTipoDocumento($tipoDocumento);\n $this->setFechaGrado($fechaGrado);\n }\n\n $this->persistencia->freeResult();\n }", "public function exposConEntrada(){\n\t\t$query = sprintf(\"SELECT * FROM Eventos EV, Entradas EN WHERE EV.id=EN.id_evento AND EN.id_usuario=%d\", $this->id);\n\t\t$obras = self:: consulta($query);\n\t\treturn $obras;\n\t}", "public function consultaRetorno($id_retorno, $primeiraPalavraCliente, $ultimoRetorno, $consultaUltima)\n {\n $this->logSis('DEB', 'Entrou no Retorno. idRetorno: ' . $id_retorno . ' Palavra: ' . $primeiraPalavraCliente . ' UltimoRetorno: ' . $ultimoRetorno . ' Tipo da consulta: ' . $consultaUltima['tipo']);\n\n include(\"dados_conexao.php\");\n include_once(\"horarios.php\");\n include_once(\"servicos.php\");\n\n\n\n if ($consultaUltima['tipo'] == 8) { //( Verifica se o retorno trata-se de uma marcação de horário\n\n\n //( Verifica qual o último subtipo para pesquisar o próximo retorno de acordo com o próximo subtipo\n if ($consultaUltima['subtipo'] == 'mes') {\n $proximoSubtipo = 'dia';\n } else if ($consultaUltima['subtipo'] == 'dia') {\n $proximoSubtipo = 'hora';\n } else if ($consultaUltima['subtipo'] == 'hora') { //( Envia a pergunta de confirmação\n $this->logSis('DEB', 'Entrou no subtipo Hora');\n if (is_numeric($primeiraPalavraCliente)) {\n $this->logSis('DEB', 'É número');\n\n //( Decodifica o Json que foi salvo no BD\n $opcoes = json_decode($this->opcoesVariaveis, true);\n $this->logSis('DEB', 'opcoes->' . print_r($opcoes, true));\n\n $indice = array_search($primeiraPalavraCliente, array_column($opcoes, 'ind'));\n $idHorario = $opcoes[$indice]['id'];\n $this->logSis('DEB', 'idHorario->' . $idHorario);\n\n\n //( Consulta o horário encontrado pra ver se está disponível ainda\n\n $result = fctConsultaParaArray(\n 'ConsultaHorario',\n \"SELECT *, DATE_FORMAT(horario, '%d/%m/%Y %H:%i') AS hora_formatada FROM tbl_horarios WHERE status = 1 AND horario >= NOW() AND id_horario = $idHorario\",\n array('hora_formatada')\n );\n $this->logSis('DEB', 'result->' . print_r($result, true));\n\n if ($result == false) {\n //& VEr se realmente vai ser possível escolher um outro horário\n //& Sugestão aqui seria voltar ao menu anterior\n $this->sendMessage('MensageErro', $this->numero, \"Esse horário não está mais disponível, favor escolher uma outra data.\", \"\");\n } else {\n $horaFormatada = $result[0]['hora_formatada'];\n $texto = \"CONFIRME O HORÁRIO\\n\";\n $texto .= \"*$horaFormatada*\\n\\n\";\n $texto .= \"Você confirma esse horário?\";\n\n $arrayRetorno = array(\n \"modo\" => 9, //tipo confirmação\n \"subtipo\" => 'horario',\n \"id_retorno\" => '',\n \"opcoes\" => $idHorario\n );\n\n //& Organizar o array retorno\n $this->confirmacao($texto, $arrayRetorno);\n }\n } else {\n $this->sendMessage('MensageErro', $this->numero, \"Responda somente com o número referente à opção desejada.\", \"\");\n }\n }\n\n //( Faz a pesquisa do retorno\n $sql = \"SELECT * FROM tbl_retornos WHERE tipo = 8 AND coringa = '$proximoSubtipo'\";\n } else if ($consultaUltima['tipo'] == 9) { //( Uma solicitação de confirmação\n\n //( Verifica que é uma confirmação de horário \n if ($consultaUltima['subtipo'] == 'horario') {\n\n //( Verifica se tem SIM ou NÃO na mensagem do cliente\n $nao = $this->verficaPalavras('', $this->mensagem, array('não', 'nao', 'NÃO', 'Nao', 'NAO', 'NO', 'no'));\n $sim = $this->verficaPalavras('', $this->mensagem, array('sim', 'Sim', 'Si', 'si', 'SI', 'sin', 'Sin', 'SIN', 'SIM'));\n\n\n if ($nao == 1) { //( Se tiver NÃO, é enviada o MENU RAIZ \n $this->envioMenuRaiz($this->numero, \"*OPERAÇÃO CANCELADA*\\n\\n\");\n } else if ($sim == 1) { //( Se tiver SIM, é reservado o horário\n $this->reservaHorario($this->opcoesVariaveis);\n } else { //( Se na mensagem não tem nem SIM nem Não, é enviado a mensagem de erro dizendo que não entendeu\n $this->sendMessage('MensageErro', $this->numero, \"Não compreendi a sua resposta, favor responder exatamente como foi solicitado.\", \"\");\n }\n }\n } else if ($id_retorno == '') { //ou seja, não sei qual o retorno\n $sql = \"SELECT * FROM tbl_retornos WHERE id_retorno = (SELECT resposta FROM tbl_opcoes WHERE id_instancia = $this->idInstancia AND indice = '$primeiraPalavraCliente' AND id_retorno = $ultimoRetorno)\";\n } else { //Sei qual o retorno atual\n //$idInstancia = $this->idInstancia;\n $sql = \"SELECT * FROM tbl_retornos WHERE id_instancia = $this->idInstancia AND id_retorno = $id_retorno\";\n }\n\n $this->logSis('DEB', $sql);\n\n $query = mysqli_query($conn['link'], $sql);\n $consultaRetorno = mysqli_fetch_array($query, MYSQLI_ASSOC);\n $this->logSis('DEB', 'Sql: ' . $sql . ' consultaRetorno->' . print_r($consultaRetorno, true));\n\n $numRow = mysqli_num_rows($query);\n if (!$query) {\n $this->logSis('ERR', 'Mysql Connect: ' . mysqli_error($conn['link']));\n exit(0);\n }\n if ($numRow == 0) { //VERIFICA SE EXISTE NO BANCO DE DADOS\n $this->logSis('ERR', 'Não encontrou a mensagem inicial Instância. Instância: ' . $this->idInstancia);\n exit(0);\n } else {\n\n //& VERIFICAR AQUI SE VAI TER AMBIGUIDADE COM A PRIMEIRA CONSULTA \n $id_retorno = $consultaRetorno['id_retorno']; //ID da tabela retorno (chave)\n $mensagem = utf8_encode($consultaRetorno['mensagem']);\n //Consulta das opções\n $sql = \"SELECT * FROM tbl_opcoes WHERE listavel = 1 AND id_instancia = $this->idInstancia AND id_retorno = $id_retorno ORDER BY indice ASC\";\n $this->logSis('DEB', $sql);\n\n $query = mysqli_query($conn['link'], $sql);\n $numRow = mysqli_num_rows($query);\n\n //Teste DEploy\n if ($numRow != 0) {\n $mensagem .= \"\\n\";\n while ($opcao = mysqli_fetch_array($query)) {\n $mensagem .= '*' . $opcao['indice'] . '.* ' . utf8_encode($opcao['mensagem']) . \"\\n\";\n }\n if ($consultaRetorno['modo'] == 1 && $consultaRetorno['id_retorno'] != $this->menuRaiz) {\n $mensagem .= \"*0.* Voltar ao menu anterior\\n\";\n }\n }\n\n $retorno = array(\n 'id_retorno' => $consultaRetorno['id_retorno'],\n 'nome' => $consultaRetorno['nome'],\n 'modo' => $consultaRetorno['modo'],\n 'tipo' => $consultaRetorno['tipo'],\n 'coringa' => $consultaRetorno['coringa'], //para tipo 6 (Inclusão lista) -> lista_X\n 'mensagem' => $mensagem,\n 'url' => $consultaRetorno['url'],\n 'lat' => $consultaRetorno['lat'],\n 'lng' => $consultaRetorno['lng'],\n 'name' => $consultaRetorno['name'],\n 'address' => $consultaRetorno['address']\n );\n $this->logSis('DEB', 'Retorno->' . print_r($retorno, true));\n\n return $retorno;\n }\n }", "private function consultar_usuario_por_nombre() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.nombrecompleto ilike '%{$this->referencia_a_buscar}%'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }", "public function consultarUsuario($parametros)\n {\n //echo \"<h1>$correo -- $contrasena</h1>\";\n // header('Location: ../vistas/index.php');\n\n #LLAMO LA CONEXION PARA PODER CONSULTAR A LA BASE DE DATOS\n $modelo = new Conexion_PDO();\n $conexion = $modelo->get_Conexion_Mysql();\n #PREPARO LA SQL PARA VERIFICAR SI EL USUARIO EXISTE Y ESTA ACTIVO\n $sql = \"SELECT priape,segape,nom from datosiniciales\";\n $statement = $conexion->prepare($sql);\n $statement->execute();\n $resultados = $statement->fetch();\n // VERIFICA SI EL RESULTADO ES DIFERENTE DE VACIO QUIERE DECIR QUE EL CORREO SI EXISTE Y ESTA ACTIVO\n if ($resultados != '') {\n\n echo \"<br>- \"$resultados['priape'];\n echo \"<br>- \"$resultados['segape'];\n echo \"<br>- \"$resultados['nom'];\n return 1;\n\n // $_SESSION['identificacion'] = $dato['numeroid'];\n // $_SESSION['nombre'] = $dato['nombre1'];\n // $_SESSION['apellido'] = $dato['apellido1'];\n // header('location:acceso.php');\n\n } else {\n return 2;\n // echo \"Error, verifica tu usuario y contraseña\";\n // header('location:../index.php');\n }\n\n }", "function consulta_datos_empresa($id) {\n $sql = \"SELECT nombre_empresa,ruc_empresa FROM prosic_empresa WHERE id_empresa=\" . $id;\n $sql = \"SELECT nombre_empresa,ruc_empresa FROM prosic_empresa WHERE id_empresa=\" . $id;\n $result = $this->Consulta_Mysql($sql);\n $row = mysql_fetch_array($result);\n return $row;\n }", "public function selectMedecin(){\n $bdd=Connexion::getInstance();\n $req=\" select * from utilisateur u ,specialite s,service ser \n WHERE u.idSpecialite=s.idSpecialite and s.idService=ser.idService\n AND idStatus=\".self::NIVEAU_1;\n $rep=$bdd->query($req);\n return $rep->fetchall();\n \n }", "public static function buscar($nombre){\n try{\n $resultado = parent::conectar()->query( //antes decia: $resultado = $this->conectar()->query(\n \"SELECT * FROM \".self::TABLE.\" WHERE nombre LIKE '%$nombre%'\" //antes para acceder a la tabla usabamos esto: $this->table\n );\n $resultado->setfetchMode(\\PDO::FETCH_OBJ);\n if($resultado->rowCount()){\n return $resultado->fetchAll();\n }else{\n return null;\n }\n return $resultado->fetchAll();\n\n }catch (\\PDOException $e) {\n //comentado en clase3\n //echo \"Error: \".$e->getMessage();\n session_start();\n $_SESSION[\"error\"] = $e->getMessage();\n header(\"Location: error1.php\");\n }\n }", "function consultar(){\n global $conexion, $data;\n $eliminado = $data[\"eliminado\"];\n $resultado= mysqli_query($conexion,\"SELECT * FROM usuario, catalogo_tipo_usuario WHERE usu_id_tipo_usuario=cau_id AND usu_eliminado='$eliminado'\");\n echo validarError($conexion, false, $resultado);\n }", "function consulta_registro_ventas_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=2\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED)\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function consultaJuegoUsuario($Usuario_idUsuario, $Juego_idJuego){\n $conexion = openBD();\n\n $sentenciaText = \"select * from usuario_has_juego where Usuario_idUsuario=$Usuario_idUsuario and Juego_idJuego=$Juego_idJuego\";\n\n $sentencia =$conexion->prepare($sentenciaText);\n $sentencia->execute();\n $resultado = $sentencia->fetch();\n $conexion = closeBD();\n\n \n\n return $resultado;\n\n\n }", "public function read(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function select() {\r\n\r\n $oc_id = $this->oc_id;\r\n $prov_id = $this->prov_id;\r\n $oc_tipo = $this->oc_tipo;\r\n $oc_estado = $this->oc_estado;\r\n $oc_fecha_entrega = $this->oc_fecha_entrega;\r\n $oc_fecha_entrega_fin = $this->oc_fecha_entrega_fin;\r\n\r\n $sql = \"SELECT * FROM ing_oc p LEFT JOIN efectua_compra h ON p.oc_id=h.oc_id WHERE \";\r\n\r\n if ($oc_estado != null) {\r\n $sql = $sql . \"p.oc_estado = '\" . $oc_estado . \"' \";\r\n } else {\r\n $sql = $sql . \"p.oc_estado > '0' \";\r\n }\r\n if ($oc_id != null) {\r\n $sql = $sql . \"AND p.oc_id = '\" . $oc_id . \"' \";\r\n }\r\n if ($prov_id != null) {\r\n $sql = $sql . \"AND p.prov_id = '\" . $prov_id . \"' \";\r\n }\r\n if ($oc_tipo != null) {\r\n $sql = $sql . \"AND p.oc_tipo = '\" . $oc_tipo . \"' \";\r\n }\r\n if ($oc_fecha_entrega != null) {\r\n if ($oc_fecha_entrega_fin != null) {\r\n $sql = $sql . \"AND P.oc_fecha_entrega BETWEEN '\" . $oc_fecha_entrega . \"' AND '\" . $oc_fecha_entrega_fin . \"' \";\r\n }\r\n $sql = $sql . \"AND P.oc_fecha_entrega = '\" . $oc_fecha_entrega . \"' \";\r\n }\r\n\r\n $result = $this->database->query($sql);\r\n// $result = $this->database->result;\r\n// $row = mysql_fetch_object($result);\r\n\r\n $i = 0;\r\n while ($datos = $this->database->fetch_array($result)) {\r\n $this->arringoc[$i]['prov_id'] = $datos['prov_id'];\r\n $this->arringoc[$i]['oc_id'] = $datos['oc_id'];\r\n $this->arringoc[$i]['oc_codigo'] = $datos['oc_codigo'];\r\n $this->arringoc[$i]['oc_tipo'] = $datos['oc_tipo'];\r\n $this->arringoc[$i]['oc_empresa'] = $datos['oc_empresa'];\r\n $this->arringoc[$i]['oc_log'] = $datos['oc_log'];\r\n $this->arringoc[$i]['oc_estado'] = $datos['oc_estado'];\r\n $this->arringoc[$i]['oc_fecha_entrega'] = $datos['oc_fecha_entrega'];\r\n $this->arringoc[$i]['oc_solicitante'] = $datos['oc_solicitante'];\r\n $this->arringoc[$i]['oc_observacion'] = $datos['oc_observacion'];\r\n $this->arringoc[$i]['oc_neto'] = $datos['oc_neto'];\r\n $this->arringoc[$i]['oc_iva'] = $datos['oc_iva'];\r\n $this->arringoc[$i]['oc_total'] = $datos['oc_total'];\r\n $this->arringoc[$i]['oc_forma_pago'] = $datos['oc_forma_pago'];\r\n $this->arringoc[$i]['oc_condiciones'] = $datos['oc_condiciones'];\r\n $this->arringoc[$i]['oc_tipo_descuento'] = $datos['oc_tipo_descuento'];\r\n $this->arringoc[$i]['oc_impuesto'] = $datos['oc_impuesto'];\r\n $this->arringoc[$i]['oc_gasto_envio'] = $datos['oc_gasto_envio'];\r\n $this->arringoc[$i]['solc_id'] = $datos['solc_id'];\r\n $i++;\r\n }\r\n\r\n// $this->prov_id = $row->prov_id;\r\n//\r\n// $this->oc_id = $row->oc_id;\r\n//\r\n// $this->oc_codigo = $row->oc_codigo;\r\n//\r\n// $this->oc_tipo = $row->oc_tipo;\r\n//\r\n// $this->oc_empresa = $row->oc_empresa;\r\n//\r\n// $this->oc_log = $row->oc_log;\r\n//\r\n// $this->oc_estado = $row->oc_estado;\r\n//\r\n// $this->oc_fecha_entrega = $row->oc_fecha_entrega;\r\n//\r\n// $this->oc_solicitante = $row->oc_solicitante;\r\n//\r\n// $this->oc_observacion = $row->oc_observacion;\r\n//\r\n// $this->oc_neto = $row->oc_neto;\r\n//\r\n// $this->oc_iva = $row->oc_iva;\r\n//\r\n// $this->oc_total = $row->oc_total;\r\n//\r\n// $this->oc_forma_pago = $row->oc_forma_pago;\r\n//\r\n// $this->oc_condiciones = $row->oc_condiciones;\r\n//\r\n// $this->oc_rut_emision = $row->oc_rut_emision;\r\n//\r\n// $this->oc_rut_aprobacion = $row->oc_rut_aprobacion;\r\n//\r\n// $this->oc_cheque_adjunto = $row->oc_cheque_adjunto;\r\n//\r\n// $this->oc_descuento = $row->oc_descuento;\r\n//\r\n// $this->oc_tipo_descuento = $row->oc_tipo_descuento;\r\n//\r\n// $this->oc_impuesto = $row->oc_impuesto;\r\n//\r\n// $this->oc_gasto_envio = $row->oc_gasto_envio;\r\n//\r\n// $this->oc_estado_pago = $row->oc_estado_pago;\r\n }", "public function buscarCargaLaboral()\n {\n $em = $this->getDoctrine()->getEntityManager();\n $user = $em->getRepository('MinsalsifdaBundle:FosUserUser')->find($this->getUser()->getId());\n $temp_tdest = $user->getIdDependenciaEstablecimiento()->getId();\n $temp_fi = $this->get('request')->request->get('fechaInicio');\n $temp_ff = $this->get('request')->request->get('fechaFin');\n $rsm = new ResultSetMapping();\n $rsm->addScalarResult('id','id');\n $rsm->addScalarResult('tecnico','tecnico');\n $rsm->addScalarResult('atendidas','atendidas');\n $rsm->addScalarResult('pendientes','pendientes');\n $rsm->addScalarResult('finalizadas','finalizadas');\n $sql = \"select distinct(e.id),e.nombre|| ' ' ||e.apellido as tecnico,count(distinct id_orden) as atendidas,\n(select count(distinct v.id_orden) from vwetapassolicitud v where v.id_estado = 2 and v.id_empleado = vw.id_empleado) as pendientes,\n(select count(distinct v.id_orden) from vwetapassolicitud v where v.id_estado = 4 and v.id_empleado = vw.id_empleado) as finalizadas\nfrom ctl_empleado e left outer join\nvwetapassolicitud vw on e.id = vw.id_empleado where 1=1\";\nif($temp_fi!=\"\" && $temp_ff!=\"\"){\n$sql.=\" and fchcrea_orden >= '$temp_fi' and fchcrea_orden <= '$temp_ff'\";\n }\n$sql.=\" and e.id_dependencia_establecimiento = $temp_tdest\ngroup by e.id,e.nombre|| ' ' ||e.apellido,(select count(distinct v.id_orden) from \nvwetapassolicitud v where v.id_estado = 2 and v.id_empleado = vw.id_empleado),\n(select count(distinct v.id_orden) from vwetapassolicitud v where v.id_estado = \n4 and v.id_empleado = vw.id_empleado) order by (select count(distinct v.id_orden) from vwetapassolicitud v where v.id_estado = 2 and v.id_empleado = vw.id_empleado) desc\";\n// $sql = \"select id, nombre || ' ' ||apellido as tecnico, id_cargo as atendidas,id_cargo+3 as asignadas,id+2 as terminadas from ctl_empleado where 1 = 0\";\n \n $query = $em->createNativeQuery($sql, $rsm);\n $resultado = $query->getResult();\n $response = new JsonResponse();\n $response->setData(array(\n 'query' => $resultado\n ));\n return $response;\n }", "function consultar()\n{\n global $conexao, $tipoServicos;\n\n $tipoServicos = $conexao->query(\"SELECT * FROM tipoServico\") or die($conexao->error);\n}", "public function consultar($valor){\r\n\t\t$oSicasAtendimentoBD = new SicasAtendimentoBD();\t\r\n\t\treturn $oSicasAtendimentoBD->consultar($valor);\r\n\t}", "public function BuscarProductosVendidos() \n{\n\tself::SetNames();\n\t$sql =\"SELECT productos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, categorias.nomcategoria, SUM(detalleventas.cantventa) as cantidad FROM (productos LEFT JOIN detalleventas ON productos.codproducto=detalleventas.codproducto) \n\tLEFT JOIN categorias ON categorias.codcategoria=productos.codcategoria WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? GROUP BY detalleventas.codproducto, detalleventas.precioventa ORDER BY productos.codproducto ASC\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN PRODUCTOS FACTURADOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($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 select($datos_){\n $id=$datos_->getId();\n\n try {\n $sql= \"SELECT `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`\"\n .\"FROM `datos_`\"\n .\"WHERE `id`='$id'\";\n $data = $this->ejecutarConsulta($sql);\n for ($i=0; $i < count($data) ; $i++) {\n $datos_->setId($data[$i]['id']);\n $datos_->setNombre_proyecto($data[$i]['nombre_proyecto']);\n $datos_->setNombre_actividad($data[$i]['nombre_actividad']);\n $datos_->setModalidad_participacion($data[$i]['modalidad_participacion']);\n $datos_->setResponsable($data[$i]['responsable']);\n $datos_->setFecha_realizacion($data[$i]['fecha_realizacion']);\n $datos_->setProducto($data[$i]['producto']);\n $semillero = new Semillero();\n $semillero->setId($data[$i]['semillero_id']);\n $datos_->setSemillero_id($semillero);\n\n }\n return $datos_; } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n return null;\n }\n }", "function realizarBusqueda(){\n\n $cedula = $_GET['cedula'];\n\n $fbd = FachadaBD::getInstance();\n $resultado = $fbd->consultarPacienteBD($cedula);\n $paciente = new Paciente();\n\n if (($row = oci_fetch_array($resultado, OCI_BOTH))){\n $paciente->setCI($row[0]);\n $paciente->setNombres($row[1]);\n $paciente->setApellidos($row[2]);\n $paciente->setProfesion($row[3]);\n $paciente->setLugarRes($row[4]);\n $paciente->setFechaNac($row[5]);\n $paciente->setID_Historial($row[6]);\n $paciente->setDiagnostico($row[7]);\n $paciente->setInterQuir($row[8]);\n }\n\n return $paciente; \n}", "public function getUsuario(){\n $sql=\"SELECT id, tipo, tipo_identificacion, numero_identificacion, apellidos, nombres, razon_social, codigo, \n direccion, telefono1, telefono2, celular1, celular2, email1, email2, fecha_nacimiento, profesion, \n actividades, rol, fecha_registro, descripcion FROM ctk_usuario where estado=1\";\n //$sentencia=$this->conexion_db->prepare($sql);\n //$sentencia->execute(array());\n //$resultado=$sentencia->fetchAll(PDO::FETCH_ASSOC);\n //otra opcion \n //$resultado=$this->conexion_db->query($sql)->fetchAll(PDO::FETCH_ASSOC);\n $resultado=$this->conexion_db->query($sql)->fetchAll(PDO::FETCH_OBJ);\n //$sentencia->closeCursor();\n return $resultado;\n $this->conexion_db=null;\n \n //El ejemplo que se encuentra a continuacion realiza la consulta con la libreria mysqli\n /*\n $resultado=$this->conexion_db->query(\"SELECT codigo_ticket, abierto_por, fecha_apertura, fecha_cierre, \n descripcion_evento, tecnico_ctk FROM ctk_ticket WHERE tecnico_ctk='\".$buscar.\"'\");\n $ticket=$resultado->fetch_all(MYSQLI_ASSOC);\n return $ticket;\n */\n }", "public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }", "public function get_detalle_recibo_paciente($numero_venta){\n $conectar=parent::conexion();\n parent::set_names();\n\n $sql=\"select e.nombre,p.nombres,p.telefono,r.numero_venta,r.numero_recibo,r.cant_letras,r.monto,r.a_anteriores,r.abono_act,r.saldo,r.forma_pago,r.asesor,r.id_usuario,r.prox_abono,r.marca_aro,r.modelo_aro,r.color_aro from pacientes as p inner join recibos as r on p.id_paciente=r.id_paciente inner join empresas as e on p.id_empresas=e.id_empresas where numero_venta=? order by r.numero_recibo desc limit 1;\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1,$numero_venta);\n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n}", "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}", "function consultar(){\n global $conexion, $data;\n $eliminado = $data[\"eliminado\"];\n $usuario = $data[\"usuario\"];\n $resultado= pg_query($conexion, \"SELECT * FROM decidim_users WHERE email='$usuario' AND id='$password'\");\n codificarJSON($resultado);\n }", "public function listar()\n {\n $sql = \"SELECT CO.idconsulta, US.nombre, US.area, US.email, CO.problema, CO.tipo_problema,CO.estado, CO.tipo_estado,date(CO.fecha_hora) as fecha \n FROM usuarios US JOIN consulta CO\n ON US.idusuarios = CO.idusuario\n WHERE CO.tipo_estado IN ('Pendiente','En Proceso') AND CO.condicion=''\";\n return ejecutarConsulta($sql);\n\n }", "function select($parametro, $modo){\n $ingrediente = new ingrediente();\n try{\n if($modo == 1){\n $stmte = $this->pdo->prepare(\"SELECT * FROM tb_ingrediente WHERE igr_nome LIKE :parametro\");\n $stmte->bindParam(\":parametro\", $parametro . \"%\", PDO::PARAM_STR);\n }elseif ($modo == 2) {\n $stmte = $this->pdo->prepare(\"SELECT * FROM tb_ingrediente WHERE igr_pk_id = :parametro\");\n $stmte->bindParam(\":parametro\", $parametro , PDO::PARAM_INT);\n }\n if($stmte->execute()){\n if($stmte->rowCount() > 0){\n while($result = $stmte->fetch(PDO::FETCH_OBJ)){\n $ingrediente->setPkId($result->igr_pk_id);\n $ingrediente->setNome($result->igr_nome);\n $ingrediente->setUnidade($result->igr_unidade);\n $ingrediente->setValor($result->igr_valor);\n }\n }\n }\n return $ingrediente;\n }\n catch(PDOException $e){\n echo $e->getMessage();\n return -1;\n }\n }", "public function consultar($sql){\n $this->configura();\n $this->conectar();\n return $this->conn->query($sql);\n }", "public function TraerCiudadRiesgo(){\n $sentencia = $this->db->prepare(\"SELECT *FROM ciudad WHERE zona_riesgo=1 \" ); \n $sentencia->execute(); // ejecuta -\n $query= $sentencia->fetchAll(PDO::FETCH_OBJ); // obtiene la respuesta\n return $query;\n }", "function ColsultarTodosLosID(){///funciona\n try {\n $FKAREA=$this->objRequerimiento->getFKAREA();\n $objControlConexion = new ControlConexion();\n $objControlConexion->abrirBd();\n //$comandoSql = \"select * from Requerimiento where FKAREA = '\".$FKAREA.\"' \";\n $comandoSql = \"SELECT IDREQ ,TITULO,FKEMPLE,FKAREA,FKESTADO,OBSERVACION,FKEMPLEASIGNADO FROM Requerimiento INNER JOIN detallereq ON Requerimiento.IDREQ=detallereq.FKREQ where FKAREA = '\".$FKAREA.\"'\";\n $rs = $objControlConexion->ejecutarSelect($comandoSql);\n return $rs;\n $objControlConexion->cerrarBd();\n } catch(Exception $e) {\n echo \"Error: \" . $e->getMessage();\n }\n}", "public function select()\n {\n $sql = \"SELECT * FROM tipousuario\";\n return ejecutarConsulta($sql);\n }", "public function consulta(){\n\n $this->db->select(\"*\");\n $this->db->from(\"empleados\");\n\n /*\n if( $this->session->userdata('perfil') != \"admin\"){\n $this->db->where( $where );\n }\n */\n\n // El get() se utiliza para ejecutar el query.\n $resultado = $this->db->get();\n\n // El result() se utiliza para enviar solamente los datos de la consulta.\n return $resultado->result();\n\n }", "public function consultar($valor){\r\n $oSicasEspecialidadeMedicaBD = new SicasEspecialidadeMedicaBD();\r\n return $oSicasEspecialidadeMedicaBD->consultar($valor);\r\n }", "public function get_datos_pac_rec_ini($sucursal,$id_usuario){\n\n $conectar= parent::conexion();\n\t \n\t $sql= \"select v.id_ventas,v.sucursal,v.subtotal,v.numero_venta,p.nombres,p.telefono,p.id_paciente,v.tipo_pago,v.vendedor from ventas as v join pacientes as p where p.id_paciente=v.id_paciente and v.sucursal=? and v.id_usuario=? order by id_ventas DESC limit 1;\";\n\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $sucursal);\n $sql->bindValue(2, $id_usuario);\n $sql->execute();\n\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n\n}", "public function buscarDocente($codigo){\r\n $query = \"SELECT * FROM docente WHERE codigo = \".$codigo.\";\";\r\n $statement = $this->cdb->prepare($query);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(\\PDO::FETCH_OBJ);\r\n return $rows; \r\n }", "function select_one($sql){\n\t\t\t$conexion = new ConexionOther();\n\t\t\t$stmt = $conexion->prepare($sql);\n $stmt->execute(); \n $datos = $stmt->fetch();\n\t\t\t$stmt = null;\n\t\t\treturn $datos;\n}", "public function consultar($valor){\r\n\t\t$oSicasConsultaMedicaBD = new SicasConsultaMedicaBD();\t\r\n\t\treturn $oSicasConsultaMedicaBD->consultar($valor);\r\n\t}", "public function getComentarios($idAnuncio){ \n /*$query = \"SELECT fc.idUser, fc.idComentario, fc.idAnuncio, fc.comentario, fc.idPadre, fc.fecha, fu.nick, fu2.nick nickPadre\n FROM final_comentario fc INNER JOIN final_usuario fu USING(idUser) LEFT JOIN final_usuario fu2 ON(fc.idPadre = fu2.idUser) \n WHERE idAnuncio = '\".$idAnuncio.\"' ORDER BY fecha ASC\"; */\n \n $query = \"SELECT fc.idAnuncio, fc.idComentario, fc.idUser, fu.nick, fc.comentario, fc.idPadre, fc.fecha, aux2.nick nickPadre\n FROM final_comentario fc INNER JOIN final_usuario fu ON(fc.idUser=fu.idUser) LEFT JOIN\n (SELECT aux.idComentario, fu.nick\n FROM (SELECT fc2.idComentario, fc2.idUser FROM final_comentario fc1 INNER JOIN final_comentario fc2 ON (fc1.idPadre=fc2.idComentario)) aux\n INNER JOIN final_usuario fu ON(aux.idUser=fu.idUser)) aux2 ON (fc.idPadre=aux2.idComentario)\n WHERE fc.idAnuncio = '\".$idAnuncio.\"' ORDER BY fc.fecha ASC\";\n \n return $this->con->action($query); \n }", "public function buscarEnderecoPorId($endereco) {\n \n //Preparando um comando sql para parametrização \n $sql = \"SELECT * FROM Endereco WHERE id_locatario = ?;\";\n\n $stmt = $this->conn->prepare($sql); \n\n $idLocatario = $endereco->getIdLocatario(); \n \n\n //Passando os parametros e seus tipos (s = String, d = Double , i = Int)\n $stmt->bind_param('i', $idLocatario);\n \n // Executando o comando parametrizad\n\n if ($stmt->execute()){\n /* store first result set */\n $result = $stmt->get_result();\n while ($row = $result->fetch_assoc()) { \n\n $enderecoLocatario = new Endereco();\n $enderecoLocatario->setIdLocatario((int)$row[\"id_locatario\"]);\n $enderecoLocatario->setLogradouro((string)$row[\"logradouro\"]);\n $enderecoLocatario->setId((int)$row[\"id_endereco\"]);\n $enderecoLocatario->setCep((int)$row[\"cep\"]);\n $enderecoLocatario->setNumero((int)$row[\"numero\"]);\n $enderecoLocatario->setEstado((string)$row[\"estado\"]);\n $enderecoLocatario->setBairro((string)$row[\"Bairro\"]);\n $enderecoLocatario->setCidade((string)$row[\"Cidade\"]);\n $listEnderecoLocatario[] = $enderecoLocatario;\n \n }\n \n return $listEnderecoLocatario;\n }\n\n // $conexao->close();\n }", "public function Consultar()\n {\n $condicion = $this->obtenerCondicion();\n $sentenciaSql = \"SELECT \n d.id_detalle_orden\n ,d.valor_inventario\n ,d.valor_venta\n ,d.cantidad\n ,d.id_orden\n ,d.id_producto\n ,d.estado\n ,p.descripcion AS nombre_producto \n FROM \n detalle_orden AS d \n INNER JOIN producto AS p ON d.id_producto = p.id_producto \".$condicion;\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n return true;\n }", "function SEARCH(){\n\t\t$sql = \"SELECT * FROM RESERVA\n\t\t\t\tWHERE FECHA BETWEEN '$this->hoy' AND '$this->hoy_mas6'\n\t\t\t\tORDER BY FECHA\";\n\n if (!($resultado = $this->mysqli->query($sql))){\n $this->mensaje['mensaje'] = 'ERROR: Fallo en la consulta sobre la base de datos';\n return $this->mensaje;\n }\n else{ // si la busqueda es correcta devolvemos el recordset resultado\n return $resultado;\n }\n }", "public function consulta_usuarios_activos(){\n\t \n\t session_start();\n\t $id_rol=$_SESSION[\"id_rol\"];\n\t \n\t $usuarios = new UsuariosModel();\n\t $catalogo = null; $catalogo = new CatalogoModel();\n\t $where_to=\"\";\n\t $columnas = \" usuarios.id_usuarios,\n\t\t\t\t\t usuarios.cedula_usuarios,\n\t\t\t\t\t usuarios.nombre_usuarios,\n usuarios.apellidos_usuarios,\n\t\t\t\t\t claves.clave_claves,\n\t\t\t\t\t claves.clave_n_claves,\n\t\t\t\t\t usuarios.telefono_usuarios,\n\t\t\t\t\t usuarios.celular_usuarios,\n\t\t\t\t\t usuarios.correo_usuarios,\n\t\t\t\t\t rol.id_rol,\n\t\t\t\t\t rol.nombre_rol,\n\t\t\t\t\t usuarios.estado_usuarios,\n\t\t\t\t\t usuarios.fotografia_usuarios,\n\t\t\t\t\t usuarios.creado\";\n\t \n\t $tablas = \"public.usuarios INNER JOIN public.claves ON claves.id_usuarios = usuarios.id_usuarios\n INNER JOIN public.privilegios ON privilegios.id_usuarios=usuarios.id_usuarios\n INNER JOIN public.rol ON rol.id_rol=privilegios.id_rol\n INNER JOIN public.catalogo ON privilegios.tipo_rol_privilegios = catalogo.valor_catalogo\n AND catalogo.nombre_catalogo='PRINCIPAL' AND catalogo.tabla_catalogo ='privilegios' AND catalogo.columna_catalogo = 'tipo_rol_privilegios'\n INNER JOIN public.catalogo c1 ON c1.tabla_catalogo='usuarios' AND c1.columna_catalogo='estado_usuarios' \n AND c1.nombre_catalogo='ACTIVO' AND c1.valor_catalogo=usuarios.estado_usuarios\";\n\t \n\t \n\t $where = \" 1=1\";\n\t \n\t $id = \"usuarios.id_usuarios\";\n\t \n\t \n\t $action = (isset($_REQUEST['action'])&& $_REQUEST['action'] !=NULL)?$_REQUEST['action']:'';\n\t $search = (isset($_REQUEST['search'])&& $_REQUEST['search'] !=NULL)?$_REQUEST['search']:'';\n\t \n\t \n\t if($action == 'ajax')\n\t {\n\t //estado_usuario\n\t $wherecatalogo = \"tabla_catalogo='usuarios' AND columna_catalogo='estado_usuarios'\";\n\t $resultCatalogo = $catalogo->getCondiciones('valor_catalogo,nombre_catalogo' ,'public.catalogo' , $wherecatalogo , 'tabla_catalogo');\n\t \n\t \n\t \n\t if(!empty($search)){\n\t \n\t \n\t $where1=\" AND (usuarios.cedula_usuarios LIKE '\".$search.\"%' OR usuarios.nombre_usuarios LIKE '\".$search.\"%' OR usuarios.correo_usuarios LIKE '\".$search.\"%' OR rol.nombre_rol LIKE '\".$search.\"%' )\";\n\t \n\t $where_to=$where.$where1;\n\t }else{\n\t \n\t $where_to=$where;\n\t \n\t }\n\t \n\t $html=\"\";\n\t $resultSet=$usuarios->getCantidad(\"*\", $tablas, $where_to);\n\t $cantidadResult=(int)$resultSet[0]->total;\n\t \n\t $page = (isset($_REQUEST['page']) && !empty($_REQUEST['page']))?$_REQUEST['page']:1;\n\t \n\t $per_page = 10; //la cantidad de registros que desea mostrar\n\t $adjacents = 9; //brecha entre páginas después de varios adyacentes\n\t $offset = ($page - 1) * $per_page;\n\t \n\t $limit = \" LIMIT '$per_page' OFFSET '$offset'\";\n\t \n\t $resultSet=$usuarios->getCondicionesPag($columnas, $tablas, $where_to, $id, $limit);\n\t $count_query = $cantidadResult;\n\t $total_pages = ceil($cantidadResult/$per_page);\n\t \n\t \n\t \n\t \n\t \n\t if($cantidadResult>0)\n\t {\n\t \n\t $html.='<div class=\"pull-left\" style=\"margin-left:15px;\">';\n\t $html.='<span class=\"form-control\"><strong>Registros: </strong>'.$cantidadResult.'</span>';\n\t $html.='<input type=\"hidden\" value=\"'.$cantidadResult.'\" id=\"total_query\" name=\"total_query\"/>' ;\n\t $html.='</div>';\n\t $html.='<div class=\"col-lg-12 col-md-12 col-xs-12\">';\n\t $html.='<section style=\"height:425px; overflow-y:scroll;\">';\n\t $html.= \"<table id='tabla_usuarios' class='tablesorter table table-striped table-bordered dt-responsive nowrap dataTables-example'>\";\n\t $html.= \"<thead>\";\n\t $html.= \"<tr>\";\n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Cedula</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Nombre</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Teléfono</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Celular</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Correo</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Rol</th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\">Estado</th>';\n\t \n\t if($id_rol==1){\n\t \n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t $html.='<th style=\"text-align: left; font-size: 12px;\"></th>';\n\t \n\t }\n\t \n\t $html.='</tr>';\n\t $html.='</thead>';\n\t $html.='<tbody>';\n\t \n\t \n\t $i=0;\n\t \n\t foreach ($resultSet as $res)\n\t {\n\t $i++;\n\t $html.='<tr>';\n\t $html.='<td style=\"font-size: 11px;\"><img src=\"view/DevuelveImagenView.php?id_valor='.$res->id_usuarios.'&id_nombre=id_usuarios&tabla=usuarios&campo=fotografia_usuarios\" width=\"80\" height=\"60\"></td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$i.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->cedula_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->nombre_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->telefono_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->celular_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->correo_usuarios.'</td>';\n\t $html.='<td style=\"font-size: 11px;\">'.$res->nombre_rol.'</td>';\n\t \n\t if(!empty($resultCatalogo)){\n\t foreach ($resultCatalogo as $r_estado){\n\t if($r_estado->valor_catalogo == $res->estado_usuarios ){\n\t $html.='<td style=\"font-size: 11px;\">'.$r_estado->nombre_catalogo.'</td>';\n\t }\n\t }\n\t }\n\t \n\t \n\t if($id_rol==1){\n\t \n\t $html.='<td style=\"font-size: 18px;\"><span class=\"pull-right\"><a href=\"index.php?controller=Usuarios&action=index&id_usuarios='.$res->id_usuarios.'\" class=\"btn btn-success\" style=\"font-size:65%;\"><i class=\"glyphicon glyphicon-edit\"></i></a></span></td>';\n\t $html.='<td style=\"font-size: 18px;\"><span class=\"pull-right\"><a href=\"index.php?controller=Usuarios&action=borrarId&id_usuarios='.$res->id_usuarios.'\" class=\"btn btn-danger\" style=\"font-size:65%;\"><i class=\"glyphicon glyphicon-trash\"></i></a></span></td>';\n\t \n\t }\n\t \n\t $html.='</tr>';\n\t }\n\t \n\t \n\t \n\t $html.='</tbody>';\n\t $html.='</table>';\n\t $html.='</section></div>';\n\t $html.='<div class=\"table-pagination pull-right\">';\n\t $html.=''. $this->paginate_usuarios(\"index.php\", $page, $total_pages, $adjacents,\"load_usuarios\").'';\n\t $html.='</div>';\n\t \n\t \n\t \n\t }else{\n\t $html.='<div class=\"col-lg-6 col-md-6 col-xs-12\">';\n\t $html.='<div class=\"alert alert-warning alert-dismissable\" style=\"margin-top:40px;\">';\n\t $html.='<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">&times;</button>';\n\t $html.='<h4>Aviso!!!</h4> <b>Actualmente no hay usuarios registrados...</b>';\n\t $html.='</div>';\n\t $html.='</div>';\n\t }\n\t \n\t \n\t echo $html;\n\t die();\n\t \n\t }\n\t \n\t}", "public function resultados($bus){\n $this->busqueda=$bus;\n $this->consulta= $this->con->query(\"SELECT * FROM usuarios WHERE apellido like '%$this->busqueda%'\");\n if($this->busqueda==''){\n \n }else{\n \n \n ?>\n <table class=\"table table-bordered table-striped table-hover\">\n <thead>\n <tr class=\"bg-blue\">\n <th>APELLIDO Y NOMBRE</th>\n <th>DNI</th>\n <th>EDAD</th>\n <th>DIRECCIÓN</th>\n <th>CONTACTO</th>\n </tr>\n </thead>\n <tbody>\n <?php\n while($this->datos= $this->consulta->fetch_array()){\n ?>\n <tr>\n <td><?php echo $this->datos['apellido'].', '.$this->datos['nombre'] ?></td>\n <td><?php echo $this->datos['dni']?></td>\n <td><?php echo $this->datos['edad'] ?></td>\n <td><?php echo $this->datos['domicilio'] ?></td>\n <td><?php echo $this->datos['email']?></td>\n </tr>\n <?php\n }\n ?>\n </tbody>\n </table> \n <?php \n } \n }", "public function producto_tralado_por_id($id_producto,$id_ingreso){\n $conectar= parent::conexion();\n $sql=\"select p.modelo,p.marca,p.medidas,p.color,e.id_producto,e.id_ingreso,e.categoriaub,e.stock from producto as p inner join existencias as e on p.id_producto=e.id_producto and e.id_producto=? and id_ingreso=?\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1, $id_producto);\n $sql->bindValue(2, $id_ingreso);\n $sql->execute();\n return $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "function requestDadosProduto($produto_id)\n {\n\n $conn = new db_conect();\n //Inserir visualizacao\n $conn->visualizacaoProduto($produto_id);\n\n $query = 'SELECT \n produto.nome AS produto, \n produto.preco, \n qntd_disponivel,\n qntd_min_vendida, \n categoria,\n tipo_venda,\n data_producao,\n data_validade,\n descricao,\n cliente.nome AS vendedor,\n cliente.num_vendas AS vendas_vendedor,\n cliente.avaliacao AS vendedor_avaliacao,\n cliente.cidade,\n cliente.estado,\n produto.data_cadastro AS data_anuncio, \n produto.avaliacao AS avaliacao_produto, \n produto.num_vendas AS num_vendas_produto, \n produto.num_visualizacao AS visualizacoes,\n caminho_foto AS foto \n FROM produto \n INNER JOIN cliente ON cliente.cpf = produto.produtor_fk\n INNER JOIN img_produto ON img_produto.produto_fk = produto.codigo \n WHERE \n produto.codigo = ' . $produto_id . '\n AND \n caminho_foto = (SELECT caminho_foto FROM img_produto WHERE produto_fk = codigo LIMIT 1);';\n\n $result = $conn->selectCustom($query);\n return $result;\n }", "function selectByIdac_consumos($consumo_id){\n\t\t\t$this->connection = Connection::getinstance()->getConn();\n\t\t\t$PreparedStatement = \"SELECT consumo_id, socio_id, nro_medidor, fecha_lectura, fecha_emision, periodo_mes, periodo_anio, consumo_total_lectura, consumo_por_pagar, costo_consumo_por_pagar, estado, fecha_hora_pago, usuario_pago, monto_pagado, pagado_por, ci_pagado_por,\n (SELECT CONCAT(nombres,' ',apellidos) FROM asapasc.ac_socios WHERE socio_id = asapasc.ac_consumos.socio_id) AS socio \n FROM asapasc.ac_consumos WHERE consumo_id = \".Connection::inject($consumo_id).\" ;\";\n\t\t\t$ResultSet = mysql_query($PreparedStatement,$this->connection);\n\t\t\tlogs::set_log(__FILE__,__CLASS__,__METHOD__, $PreparedStatement);\n\n\t\t\t$elem = new ac_consumosTO();\n\t\t\twhile($row = mysql_fetch_array($ResultSet)){\n\t\t\t\t$elem = new ac_consumosTO();\n\t\t\t\t$elem->setConsumo_id($row['consumo_id']);\n\t\t\t\t$elem->setSocio_id($row['socio_id']);\n\t\t\t\t$elem->setNro_medidor($row['nro_medidor']);\n\t\t\t\t$elem->setFecha_lectura($row['fecha_lectura']);\n\t\t\t\t$elem->setFecha_emision($row['fecha_emision']);\n\t\t\t\t$elem->setPeriodo_mes($row['periodo_mes']);\n\t\t\t\t$elem->setPeriodo_anio($row['periodo_anio']);\n\t\t\t\t$elem->setConsumo_total_lectura($row['consumo_total_lectura']);\n\t\t\t\t$elem->setConsumo_por_pagar($row['consumo_por_pagar']);\n\t\t\t\t$elem->setCosto_consumo_por_pagar($row['costo_consumo_por_pagar']);\n\t\t\t\t$elem->setEstado($row['estado']);\n\t\t\t\t$elem->setFecha_hora_pago($row['fecha_hora_pago']);\n\t\t\t\t$elem->setUsuario_pago($row['usuario_pago']);\n\t\t\t\t$elem->setMonto_pagado($row['monto_pagado']);\n\t\t\t\t$elem->setPagado_por($row['pagado_por']);\n\t\t\t\t$elem->setCi_pagado_por($row['ci_pagado_por']);\n $elem->setSocio($row['socio']);\n\n\t\t\t}\n\t\t\tmysql_free_result($ResultSet);\n\t\t\treturn $elem;\n\t\t}", "function buscar_comprobante_documento($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)/prosic_tipo_cambio.compra_sunat) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function BusquedaDetallesVentas()\n\t{\n self::SetNames();\n\n if ($_SESSION['acceso'] == \"administrador\") {\n\n\tif ($_GET['tipobusquedad'] == \"1\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria WHERE ventas.codventa = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS CON ESTE N&deg; DE FACTURA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"2\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.codcaja = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"3\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\t\t } \n\n ################# AQUI BUSCAMOS POR CAJEROS Y DISTRIBUIDOR ################\n\n\t } else {\n\n\n\t\t \tif ($_GET['tipobusquedad'] == \"1\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria WHERE ventas.idventa = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codventa\"]));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS CON ESTE N&deg; DE FACTURA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"2\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.codcaja = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusquedad'] == \"3\") {\n\n$sql = \"SELECT ventas.idventa, ventas.codventa, ventas.codcliente, ventas.codmesa, ventas.codcaja, ventas.tipopagove, detalleventas.coddetalleventa, detalleventas.codventa, detalleventas.codproducto, detalleventas.producto, detalleventas.cantventa, detalleventas.preciocompra, detalleventas.precioventa, detalleventas.ivaproducto, detalleventas.importe, detalleventas.importe2, detalleventas.fechadetalleventa, categorias.nomcategoria, cajas.nrocaja, cajas.nombrecaja FROM detalleventas LEFT JOIN ventas ON ventas.codventa = detalleventas.codventa LEFT JOIN categorias ON detalleventas.codcategoria = categorias.codcategoria LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' ORDER BY detalleventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\t\t }\n\t }\n}", "public function buscarFuncionarioPorCampo($campo, $filtro){\n \n $query = \"SELECT Usuario.*, Funcionario.* FROM Usuario JOIN Funcionario \n ON Usuario.idUsuario = Funcionario.idUsuario\"; //criação da query base\n\n if(isset($campo) && isset($filtro)){ //verifica se os filtros foram especificados\n if(strcmp($campo, nome) || strcmp($campo, sobrenome) || strcmp($campo, email)){ //verifica se o campo corresponde a nome, sobrenome ou email\n $query .= \" WHERE Usuario.nome LIKE '%'.'.$campo.'.'%'\"; //adicionar filtro de nome, sobrenome ou email à query\n }else if(strcmp($campo, matricula)){ //verifica se o campo corresponde a matricula\n $query .= \" WHERE Funcionario.matricula = $campo\"; //adiciona filtro de matricula à query\n }else{\n return array(); //retorna um array vazio caso o campo não seja encontrado\n }\n }\n\n /*Caso não seja especificados filtros retorna todos os funcionarios*/\n\n $result = $this->PDO->query($query); //executa a query\n\n $funcionarios = array(); //cria array para armazenar os resultados da consulta\n\n if(!empty($result) && $result->rowCount() > 0){ //verifica se existem resultados para consulta\n foreach($result->fetchAll() as $item){ //percorre as tuplas retornadas pela consulta\n $funcionarios[] = new funcionario( //cria um novo funcionario e add uma array, apartir dos dados obtidos\n isset($item['idUsuario'])?utf8_encode($item['idUsuario']):null,\n isset($item['email'])?utf8_encode($item['email']):null,\n isset($item['nome'])?utf8_encode($item['nome']):null,\n isset($item['sobrenome'])?utf8_encode($item['sobrenome']):null,\n isset($item['senha'])?utf8_encode($item['senha']):null,\n isset($item['cadastroConfirmado'])?utf8_encode($item['cadastroConfirmado']):null,\n isset($item['tipoUsuario'])?utf8_encode($item['tipoUsuario']):null,\n isset($item['matricula'])?utf8_encode($item['matricula']):null,\n isset($item['funcao'])?utf8_encode($item['funcao']):null,\n isset($item['cadastroObra'])?utf8_encode($item['cadastroObra']):null,\n isset($item['gerenciaObra'])?utf8_encode($item['gerenciaObra']):null,\n isset($item['remocaoObra'])?utf8_encode($item['remocaoObra']):null,\n isset($item['cadastroNoticia'])?utf8_encode($item['cadastroNoticia']):null, \n isset($item['gerenciaNoticia'])?utf8_encode($item['gerenciaNoticia']):null,\n isset($item['remocaoNoticia'])?utf8_encode($item['remocaoNoticia']):null,\n isset($item['backup'])?utf8_encode($item['backup']):null\n );\n }\n }\n\n return $funcionarios; //retorna os resultados\n }", "public function BuscarIngredientesVendidos() \n{\n\tself::SetNames();\n\t$sql = \"SELECT productos.codproducto, productos.producto, productos.codcategoria, productos.precioventa, productos.existencia, ingredientes.costoingrediente, ingredientes.codingrediente, ingredientes.nomingrediente, ingredientes.cantingrediente, productosvsingredientes.cantracion, detalleventas.cantventa, SUM(productosvsingredientes.cantracion*detalleventas.cantventa) as cantidades FROM productos INNER JOIN detalleventas ON productos.codproducto=detalleventas.codproducto INNER JOIN productosvsingredientes ON productos.codproducto=productosvsingredientes.codproducto LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente WHERE DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') >= ? AND DATE_FORMAT(detalleventas.fechadetalleventa,'%Y-%m-%d') <= ? GROUP BY ingredientes.codingrediente\";\n\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN INGREDIENTES FACTURADOS PARA EL RANGO DE FECHAS SELECCIONADAS</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($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 incluir(){\n header(\"Content-type: text/html;charset=utf-8\");\n $sql = \"SHOW FULL FIELDS FROM \" . $this->table;\n $execute = conexao::toConnect()->executeS($sql);\n $atributos = \"\";\n $values = \"\";\n $id_registro = \"\";\n $contador = count($execute) - 1;\n foreach ($execute as $key => $attr){\n if ($attr->Key != 'PRI') {\n $atributos_field = $attr->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($contador != $key) {\n $atributos .= $attr->Field . ',';\n $values .= \"'\".$this->$get() .\"',\";\n } else {\n $atributos .= $attr->Field;\n $values .= \"'\".$this->$get() .\"'\";\n }\n }else{\n $id_registro = $attr->Field;\n }\n }\n $insert = \"INSERT INTO \".$this->table.\" (\".$atributos.\") VALUES($values)\";\n $execute_into = conexao::toConnect()->executeQuery($insert);\n if (count($execute_into) > 0) {\n $sql = \"SELECT \".$id_registro.\" FROM \".$this->table.\" ORDER BY \".$id_registro.\" DESC LIMIT 1\";\n $id_r = conexao::toConnect()->executeS($sql);\n return $id_r[0]->$id_registro;\n }else{\n return false;\n }\n\n }", "public function querySeleciona($dado){\n try{\n \n $SQL = \"SELECT idUsuario, nomeUsuario, email, dataCriacao, ultimoLog,permissao FROM 'usuario' WHERE idCliente = :id\";\n $sqlCliente = $this->conecta->conectar()->prepare($SQL);\n $id = $idCliente;\n $sqlCliente->bindParam(\":id\", $id, PDO::PARAM_INT);\n $sqlCliente->execute();\n return $sqlCliente->fetchALL(PDO::FETCH_OBJ);\n } catch (PDOException $ex) {\n return 'error '.$ex->getMessage();\n }\n }", "function MostrarU($conexion, $id){\n $result = $conexion->query(\"SELECT * FROM usuario WHERE id_usuario=$id\");\n return $result;\n}", "function consultar($codigo) {\n\t\tif ($this->con->conectar() == true) {\n\t\t\t$Sql = \" SELECT * FROM liquidacion WHERE liquidacionCodigo = '\".$codigo.\"' \";\n\t\t\t$this->resultado= mysql_query($Sql);\n\t\t\treturn true;\n\t\t}\n\t}", "function _ConsultarClientes()\n\t\t{\n\t\t\t$query='\n\t\t\t\tSELECT\n\t\t\t\tclientes.id,\n\t\t\t\tclientes.nb_cliente,\n\t\t\t\tclientes.nb_apellidos,\n\t\t\t\tclientes.de_email,\n\t\t\t\tclientes.num_celular,\n\t\t\t\tusuarios.nb_nombre as \"Ins_nombre\", \n\t\t\t\tusuarios.nb_apellidos as \"Ins_apellido\" \n\t\t\t\tFROM sgclientes clientes\n\t\t\t\tleft join sgusuarios usuarios on clientes.id_usuario_registro=usuarios.id\n\t\t\t\twhere clientes.sn_activo=1\n\t\t\t\tORDER BY clientes.id ASC\n\t\t\t\n\t\t\t';\n\t\t\t$clientes = $this->EjecutarTransaccionAllNoParams($query);\n\t\t\treturn $clientes;\n\t\t}", "public function BuscarComprasProveedor() \n{\n\tself::SetNames();\t\t\n\t$sql = \" SELECT compras.codcompra, compras.subtotalivasic, compras.subtotalivanoc, compras.ivac, compras.totalivac, compras.descuentoc, compras.totaldescuentoc, compras.totalc, compras.statuscompra, compras.fechavencecredito, compras.fechacompra, proveedores.ritproveedor, proveedores.nomproveedor, SUM(detallecompras.cantcompra) AS articulos FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN detallecompras ON detallecompras.codcompra = compras.codcompra WHERE proveedores.codproveedor = ? GROUP BY compras.codcompra\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN COMPRAS DE PRODUCTOS PARA EL PROVEEDOR SELECCIONADO</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($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}", "function consultar($nomClase, $arrPar = array()) {\n $tb = \"\";\n $sql = \"\";\n $n = \"\";\n $arrPar['aliasTb'] = (isset($arrPar['aliasTb'])) ? $arrPar['aliasTb'] : '';\n $arrPar['join'] = (isset($arrPar['join'])) ? $arrPar['join'] : '';\n $arrPar['filtro'] = (isset($arrPar['filtro'])) ? $arrPar['filtro'] : '';\n $arrPar['orderBy'] = (isset($arrPar['orderBy'])) ? $arrPar['orderBy'] : '';\n $arrPar['limit'] = (isset($arrPar['limit'])) ? $arrPar['limit'] : '';\n $retornos = array();\n\n $tb = \"tb_{$nomClase} {$arrPar['aliasTb']}\";\n $sql = \"SELECT \" . ($arrPar['aliasTb'] ? $arrPar['aliasTb'] . \".id_\" . $nomClase : \"id_\" . $nomClase) . \" FROM {$tb} \";\n $sql .= \" \" . ($arrPar['join'] != '' ? $arrPar['join'] : '');\n $sql .= ($arrPar['filtro'] != '' ? \" WHERE \" . $arrPar['filtro'] : '');\n $sql .= \" ORDER BY \" . ($arrPar['orderBy'] != '' ? $arrPar['orderBy'] : \" id_{$nomClase} \");\n $sql .= \" \" . ($arrPar['limit'] != '' ? $arrPar['limit'] : 'LIMIT 2500 OFFSET 0');\n\n $bd = new conector_bd();\n// IF($_SESSION[SESSION_USUARIO] == 1706){PRINT_R ($sql);EXIT;}\n $query = $bd->consultar($sql);\n\n $n = $bd->num_reg($tb, $arrPar['filtro'], $arrPar['join']);\n while ($row = pg_fetch_row($query))\n $retornos[] = new $nomClase($row[0]);\n return array('elementos' => $retornos, 'n' => $n);\n }", "function consulta2(){\n$sql1= \"SELECT id_producto, nombre_marca, Nombre_modelo, nombre_division, nombre_categoria\nFROM producto P\nJOIN marca M ON M.id_marca = P.id_marca\nJOIN modelo MO ON MO.id_modelo = P.id_modelo\nJOIN division D ON D.id_division = P.id_division\nJOIN categoria C ON C.id_categoria = P.id_categoria\nWHERE id_producto=\".$valor.\"\";//$res[id_producto]\n$rs1= mysql_query($sql1);\n$res1 = mysql_fetch_array($rs1);\n}", "public function consultas_aplicarFiltrosConsultas($fechaInicial, $fechaFinal, $usuarios, $idDxConsulta, $idPropietario, $paciente){\n \t\n\t\t\t$resultado = array();\n\t\t\t//$adicionQuery = \"WHERE 1 \";\n\t\t\t\n\t\t\tif($idDxConsulta != '0'){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$adicionQuery = \" INNER JOIN tb_consultas_diagnosticos AS DC ON DC.idConsulta = C.idConsulta\n\t\t\t\t\t\t\t\t INNER JOIN tb_panelDiagnosticoConsulta AS PCD ON PCD.idPanelDiagnosticoConsulta = DC.idPanelDiagnosticoConsulta\n\t\t\t\t\t\t\t\t WHERE PCD.idPanelDiagnosticoConsulta = '$idDxConsulta' \";\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$adicionQuery = \"WHERE 1 \";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif($usuarios != \"\"){\t\t\t\t\n\t\t\t\t\n\t\t\t\t$adicionQuery = \" AND C.idUsuario = '$usuarios' \";\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($fechaInicial != \"\" AND $fechaFinal != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \"AND ( C.fecha BETWEEN '$fechaInicial' AND '$fechaFinal')\";\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\tif($idPropietario != \"0\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND P.idPropietario = '$idPropietario' \";\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($paciente != \"\"){\n\t\t\t\t\n\t\t\t\t$adicionQuery .= \" AND C.idMascota = '$paciente' \";\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\t$query = \"SELECT \n\t\t\t\t\t\t C.idConsulta,\n\t\t\t\t\t\t C.fecha,\n\t\t\t\t\t\t DATE_FORMAT(C.hora, '%H:%i') as hora,\n\t\t\t\t\t\t C.motivo,\n\t\t\t\t\t\t C.observaciones,\n\t\t\t\t\t\t C.planASeguir,\n\t\t\t\t\t\t C.edadActualMascota,\n\t\t\t\t\t\t \n\t\t\t\t\t\t EF.idExamenFisico,\n\t\t\t\t\t\t EF.peso,\n\t\t\t\t\t\t EF.medidaCm,\n\t\t\t\t\t\t EF.temperatura,\n\t\t\t\t\t\t EF.observaciones as observacionesExamenFisico,\n\t\t\t\t\t\t \n\t\t\t\t\t\t M.nombre AS nombreMascota,\n\t\t\t\t\t\t M.sexo AS sexoMascota,\n\t\t\t\t\t\t P.identificacion AS identificacionPropietario,\n\t\t\t\t\t\t P.nombre AS nombrePropietario,\n\t\t\t\t\t\t P.apellido AS apellidoPropietario,\n\t\t\t\t\t\t P.telefono,\n\t\t\t\t\t\t SU.nombre AS nombreSucursal,\n\t\t\t\t\t\t U.nombre AS nombreUsuario,\n\t\t\t\t\t\t U.apellido AS apellidoUsuario\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t tb_consultas AS C\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_mascotas AS M ON C.idMascota = M.idMascota\n\t\t\t\t\t\t \tLEFT JOIN\n\t\t\t\t\t\t tb_examenFisico AS EF ON EF.idConsulta = C.idConsulta\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_propietarios AS P ON P.idPropietario = M.idPropietario\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_sucursales AS SU ON SU.idSucursal = C.idSucursal\n\t\t\t\t\t\t INNER JOIN\n\t\t\t\t\t\t tb_usuarios AS U ON U.idUsuario = C.idUsuario\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\".$adicionQuery.\"\n\t\t\t\t\t\t\n\t\t\t\t\t\tGROUP BY (C.idConsulta)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tORDER BY (C.idConsulta) DESC; \";\n\t\t\t\t\t\t\n\t\t\t$conexion = parent::conexionCliente();\n\t\t\t\n\t\t\tif($res = $conexion->query($query)){\n\t \n\t /* obtener un array asociativo */\n\t while ($filas = $res->fetch_assoc()) {\n\t $resultado[] = $filas;\n\t }\n\t \n\t /* liberar el conjunto de resultados */\n\t $res->free();\n\t \n\t }\n\t\n\t return $resultado;\n\t\t\t\n\t\t\t\n }", "function RellenaDatos()\n{\n $this->ConectarBD();\n $sql = \"select * from EMPLEADOS where EMP_USER = '\".$this->EMP_USER.\"'\";\n\n if (!($resultado = $this->mysqli->query($sql))){\n\treturn 'Error en la consulta sobre la base de datos';\n\t}\n else{\n\t$result = $resultado->fetch_array();\n\treturn $result;\n\t}\n}", "function trier(){\r\n \r\n $db = config::getConnexion();\r\n $sql=\"SElECT * From livreur ORDER BY nom\";\r\n\r\n try{\r\n $req=$db->prepare($sql);\r\n $req->execute();\r\n $livreur= $req->fetchALL(PDO::FETCH_OBJ);\r\n return $livreur;\r\n }\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n } \r\n}", "function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }", "function consultaUsuario($conexion){\n $resultado = $conexion->query(\"SELECT * FROM usuario\");\n return $resultado;\n}", "public function selectIniciarSesion(){\n $query = \"SELECT codUsuario, nombre, apellido, sexo, COUNT(*) AS existe FROM usuario WHERE correo = '\".parent::string($this->getCorreo()).\"' AND contrasenia = '\".md5(md5(\"PAO%%%%0001TPIPSADSADasdsad\").parent::string($this->getContrasenia())).\"' LIMIT 1;\";\n $result = mysqli_query(parent::conexion(), $query);\n if($result){\n $fila = mysqli_fetch_array($result);\n parent::desconectar();\n return $fila;\n } else{\n echo parent::conexion()->error;\n parent::desconectar();\n return false;\n }\n }", "public function BusquedaVentas()\n\t{\n\n self::SetNames();\n\n if ($_SESSION['acceso'] == \"administrador\") {\n\n\n\tif ($_GET['tipobusqueda'] == \"1\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcliente = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcliente']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS PARA EL CLIENTE INGRESADO !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"2\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, cajas.nombrecaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcaja = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"3\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\t\t } \n\n ################# AQUI BUSCAMOS POR CAJEROS Y DISTRIBUIDOR ################\n\n\t } else {\n\n\n\t\t \tif ($_GET['tipobusqueda'] == \"1\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcliente = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcliente']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS PARA EL CLIENTE INGRESADO !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"2\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, cajas.nombrecaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE ventas.codcaja = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET['codcaja']));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA CAJA SELECCIONADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\n\t\t} else if ($_GET['tipobusqueda'] == \"3\") {\n\n$sql = \" SELECT ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, clientes.nomcliente, cajas.nrocaja, SUM(detalleventas.cantventa) AS articulos FROM (ventas LEFT JOIN clientes ON ventas.codcliente = clientes.codcliente) LEFT JOIN mesas ON ventas.codmesa = mesas.codmesa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN detalleventas ON detalleventas.codventa = ventas.codventa WHERE DATE_FORMAT(ventas.fechaventa,'%Y-%m-%d') = ? AND ventas.codigo = '\".$_SESSION[\"codigo\"].\"' GROUP BY ventas.codventa\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(date(\"Y-m-d\",strtotime($_GET['fecha']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\t\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO EXISTEN VENTAS EN LA FECHA INGRESADA !</div></center>\";\n\texit;\n\t\t } else {\n\n\t\twhile($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\n\t\t }\n\t\t }\n\t }\n}" ]
[ "0.6859501", "0.67955106", "0.67582035", "0.6621916", "0.66036844", "0.65978634", "0.65577996", "0.65557784", "0.6553234", "0.65264165", "0.652343", "0.65099674", "0.65064216", "0.64927614", "0.64910465", "0.64874876", "0.6420683", "0.639818", "0.63807964", "0.6375432", "0.63702726", "0.63622373", "0.63605493", "0.6359255", "0.63505715", "0.63482064", "0.63467646", "0.63412744", "0.63405555", "0.63388216", "0.63287175", "0.63264513", "0.63187325", "0.63112926", "0.63108695", "0.631001", "0.63062614", "0.6304108", "0.63035923", "0.62734514", "0.6269772", "0.62691075", "0.6268245", "0.62653655", "0.6265217", "0.62642056", "0.6261243", "0.62594986", "0.62582016", "0.62578326", "0.6254549", "0.6253494", "0.62486327", "0.62484246", "0.62343293", "0.6233495", "0.6229852", "0.62263", "0.6223345", "0.6216473", "0.6210194", "0.6209591", "0.6206721", "0.62046397", "0.6198885", "0.6193761", "0.61895514", "0.6189459", "0.61834884", "0.6182783", "0.6182369", "0.618227", "0.6181757", "0.61715305", "0.6165563", "0.6162915", "0.6159262", "0.6151261", "0.61483634", "0.61476254", "0.61443573", "0.6139716", "0.6136321", "0.6134045", "0.61334246", "0.6131894", "0.6131511", "0.6131228", "0.6126323", "0.6123758", "0.61198574", "0.61186194", "0.61026", "0.6102538", "0.60993135", "0.6098476", "0.60967344", "0.60961115", "0.60953814", "0.6089291", "0.6088353" ]
0.0
-1
Realiza una consulta que espera recibir multiples registros
public function getMultipleResults($sql){ $connection = $this->connect(); $logger = Logger::getRootLogger(); try{ if (!$query = $connection->query($sql)){ $mensaje = "No se pudo consultar. SQL: " . $sql; $logger->error($mensaje); throw new Exception($mensaje); } if ($query->num_rows === 0) { $mensaje = "La consulta no devolvió resultados."; $logger->error($mensaje); throw new Exception($mensaje); } $array = array(); while ($result = $query->fetch_assoc()) { array_push($array, $result); } $query->free(); }catch(Exception $e){ $mensaje = "Ha ocurrido un error: " . $e; $logger->error($mensaje); throw new Exception($mensaje); }finally{ $connection->close(); } return $array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtenerRegistros($datos = []) {\n\t\t$this->openConnection();\n\t\t$sentencia = $this->conn->prepare($this->consulta);\n\t\tif(!empty($datos)){\n\t\t\tforeach ($datos as $key => $value) {\n\t\t\t\t$sentencia->bind_param($key, $value);\n\t\t\t}\n\t\t}\n\t\t$sentencia->execute();\n\t\t$reg = $sentencia->get_result();\n\t\t$rows = $reg->num_rows;\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$this->registros[] = $reg->fetch_assoc();\n\t\t\t$i++;\n\t\t} while ($i < $rows);\n\t\t$this->closeConnection();\n\t}", "function getRegistros() {\n\t\tif (isset($this->extra[\"monitor_id\"]) and isset($this->extra[\"pagina\"])) {\n\t\t\t$this->resultado = $this->getDetalleRegistros($this->extra[\"monitor_id\"], $this->extra[\"pagina\"]);\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT unnest(_nodos_id) AS nodo_id FROM _nodos_id(\".\n\t\t\t pg_escape_string($current_usuario_id).\", \".\n\t\t\t pg_escape_string($this->objetivo_id).\", '\".\n\t\t\t pg_escape_string($this->timestamp->getInicioPeriodo()).\"','\".\n\t\t\t pg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t//print($sql);\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\t\t$monitor_ids = array();\n\t\twhile($row = $res->fetchRow()) {\n\t\t\t$monitor_ids[] = $row[\"nodo_id\"];\n\t\t}\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif (count($monitor_ids) == 0) {\n\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\treturn;\n\t\t}\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'contenedor_tabla.tpl');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_CONTENEDORES', 'lista_contenedores');\n\n\t\t/* LISTA DE MONITORES */\n\t\t$orden = 1;\n\t\tforeach ($monitor_ids as $monitor_id) {\n\t\t\t$T->setVar('__contenido_id', 'reg_'.$monitor_id);\n\t\t\t$T->setVar('__contenido_tabla', $this->getDetalleRegistros($monitor_id, 1, $orden));\n\t\t\t$T->parse('lista_contenedores', 'LISTA_CONTENEDORES', true);\n\t\t\t$orden++;\n\t\t}\n\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}", "function getRegistros($sql) {\n\t\t$res = $this->ejecutar($sql);\n\t\t$arreglo = array();\n\t\twhile ($registro = mysqli_fetch_array($res,MYSQL_ASSOC)) {\n\t\t\t$arreglo[]=$registro;\t\t\t\n\t\t}\n\t\treturn $arreglo;\n\t}", "function obtener_registro_todos_los_registros(){\n $this->sentencia_sql=\"CALL pa_consultar_todos_los_\".$this->TABLA.\"()\"; \n \n if($this->ejecutar_consulta_sql()){\n //return array(\"codigo\"=>\"00\",\"mensaje\"=>\"Estos son los resultados de la consulta a la tabla $this->TABLA\",\"respuesta\"=>TRUE);\n return array(\"codigo\"=>\"00\",\"mensaje\"=>\"Estos son los resultados de la consulta a la tabla $this->TABLA\",\"respuesta\"=>TRUE,\"valores_consultados\"=>$this->filas_json);\n }else{\n return array(\"codigo\"=>\"01\",\"mensaje\"=> $this->mensajeDepuracion,\"respuesta\"=>TRUE);\n }\n \n }", "function getRegistrosPlus() {\n\t\tif (isset($this->extra[\"monitor_id\"]) and isset($this->extra[\"pagina\"])) {\n\t\t\t$this->resultado = $this->getDetalleRegistrosPlus($this->extra[\"monitor_id\"], $this->extra[\"pagina\"]);\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT foo.nodo_id FROM (\".\n\t\t\t \"SELECT DISTINCT unnest(_nodos_id) AS nodo_id FROM _nodos_id(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->objetivo_id).\",'\".\n\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"','\".\n\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')) AS foo, nodo n \".\n\t\t\t \"WHERE foo.nodo_id=n.nodo_id ORDER BY orden\";\n\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\n\t\t$monitor_ids = array();\n\t\twhile ($row = $res->fetchRow()) {\n\t\t\t$monitor_ids[] = $row[\"nodo_id\"];\n\t\t}\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif (count($monitor_ids) == 0) {\n\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\treturn;\n\t\t}\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'contenedor_tabla.tpl');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_CONTENEDORES', 'lista_contenedores');\n\n\t\t/* LISTA DE MONITORES */\n\t\t$orden = 1;\n\t\tforeach ($monitor_ids as $monitor_id) {\n\t\t\t$T->setVar('__contenido_id', 'regplus_'.$monitor_id);\n\t\t\t$T->setVar('__contenido_tabla', $this->getDetalleRegistrosPlus($monitor_id, 1, $orden));\n\t\t\t$T->parse('lista_contenedores', 'LISTA_CONTENEDORES', true);\n\t\t}\n\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}", "public function ContarRegistros()\n\t{\n$sql = \"select\n(select count(*) from productos where existencia <= stockminimo) as stockproductos,\n(select count(*) from ingredientes where CAST(cantingrediente AS DECIMAL(10,5)) <= CAST(stockminimoingrediente AS DECIMAL(10,5))) as stockingredientes,\n(select count(*) from ventas where tipopagove = 'CREDITO' AND formapagove = '' AND fechavencecredito <= '\".date(\"Y-m-d\").\"') as creditosventasvencidos,\n(select count(*) from compras where tipocompra = 'CREDITO' AND statuscompra = 'PENDIENTE' AND fechavencecredito <= '\".date(\"Y-m-d\").\"') as creditoscomprasvencidos\";\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\treturn $this->p;\n\t\t$this->dbh=null;\n\t}", "public function getRegistros(){\n $query = $this->db->query('select c.orden_servicio,c.p1,c.p2,c.p3,c.p4,c.p5,c.p6,c.p7,r.DISTRIB,r.RAZON,r.CIUCLIEN,r.NUMSERIE,r.TIPORDEN,r.OPER1,r.ORDEN,r.CLIENTE,r.TELCASA,r.TELOFIC,r.TELCEL,r.EMAIL,r.ASESOR,r.RFCASESOR,r.DESCRIP\n from reporte r\n left join calificacion c\n on r.orden like concat(\"%\",c.orden_servicio,\"%\")');\n return $query->result();\n }", "function consulta_registro_ventas_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=2\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED)\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function realizarConsultas($sql)\r\n {\r\n $this->resultado = $this->mysqli->multi_query($sql);\r\n }", "function consultaProyectos() {\r\n if(!isset($_REQUEST['facultad'])||$_REQUEST['facultad']<0)\r\n {\r\n echo \"No se seleccionó facultad. Por favor regrese y seleccione una opci&oacute;n\";exit;\r\n }\r\n $facultad=$_REQUEST['facultad'];\r\n include_once($this->configuracion[\"raiz_documento\"].$this->configuracion[\"clases\"].\"/html.class.php\");\r\n $this->html = new html();\r\n $proyectos=$this->consultarProyectos($facultad);\r\n $registro[0][0]=10000+$facultad;\r\n $registro[0][1]=\"TODOS LOS PROYECTOS DE LA FACULTAD\";\r\n foreach ($proyectos as $key=>$proyecto) {\r\n $registro[$key+1][0]=$proyecto['COD_PROYECTO'];\r\n $registro[$key+1][1]=$proyecto['COD_PROYECTO'].\" - \".$proyecto['NOMBRE_PROYECTO'];\r\n }?>\r\n\t\t<form enctype='multipart/form-data' method='POST' action='index.php' name='<? echo $this->formulario?>'>\r\n <table width=\"100%\" align=\"center\" border=\"1\" cellpadding=\"10\" cellspacing=\"0\" >\r\n <tr>\r\n <td>Seleccione El Proyecto: \r\n <?$mi_cuadro=$this->html->cuadro_lista($registro,'codProyecto',$this->configuracion,-1,\"\",FALSE,\"\",\"codProyecto\");\r\n echo $mi_cuadro;?>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">\r\n <input type=\"hidden\" name=\"opcion\" value=\"consultaEstudiantes\">\r\n <input type=\"hidden\" name=\"action\" value=\"<? echo $this->bloque ?>\">\r\n <input class=\"boton\" type=\"button\" value=\"Ejecutar Proceso\" onclick=\"document.forms['<? echo $this->formulario?>'].submit()\">\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t</form>\t\r\n <?\r\n \r\n \r\n }", "function llamarRegistrosMySQLPlaneServicios() {\n\t\t\tglobal $res;\n\t\t\t$cnx = conectar_mysql(\"Salud\");\n\t\t\t$cons = \"SELECT * FROM Salud.EPS ORDER BY AutoId ASC\";\n\t\t\t$res = mysql_query($cons);\n\t\t\treturn $res; \n\t\t\n\t\t}", "function buscar_materiales($registrado,$texto_buscar,$licencia,$sql) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND material_estado=1\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (material_titulo LIKE '%$texto_buscar%' \n\t\t\tOR material_descripcion LIKE '%$texto_buscar%' \n\t\t\tOR material_objetivos LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t}\n\t\t\n\t\t$query = \"SELECT COUNT(*) FROM materiales\n\t\tWHERE material_licencia = '$licencia'\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY fecha_alta desc\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows[0] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $numrows[0];\n\t\t}\n\t}", "function listarFormula(){\r\n\t\t$this->procedimiento='vef.ft_formula_v2_sel';\r\n\t\t$this->transaccion='VF_FORMULAV2_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_formula','int4');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('nombre','varchar');\r\n\t\t$this->captura('descripcion','text');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('fecha_reg','timestamp');\r\n\t\t$this->captura('id_usuario_ai','int4');\r\n\t\t$this->captura('usuario_ai','varchar');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('fecha_mod','timestamp');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('sw_autorizacion','varchar');\r\n\t\t$this->captura('regionales','varchar');\r\n\t\t$this->captura('nivel_permiso','varchar');\r\n\r\n\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function consultar_sms_noreg($tlf,$grupos,$nombres)\n\t{\n\t\t\n\t\t$where='';\n\t\t//BLOQUE DE FILTROS\n\t\tif($tlf!=\"\")\n\t\t{\n\t\t\t$where=\"AND contactos_no_reg.tlf1 like '%\".$tlf.\"%'\";\n\t\t}\n\t\tif($grupos!=\"\")\n\t\t{\n\t\t\t$where=\"AND upper(grupos.nombre_grupo) like '%\".strtoupper($grupos).\"%'\";\n\t\t}\n\t\tif($nombres!=\"\")\n\t\t{\n\t\t\t$where=\"AND upper(contactos_no_reg.nombre) like '%\".strtoupper($nombres).\"%'\";\n\t\t}\n\t\t//\n\t\t$this->sql=\"SELECT \n\t\t\t\t\t\t\t tlf1 AS tlf,\n\t\t\t\t\t\t\t upper(nombre) AS nombres,\n\t\t \t\t\t\t\t upper(grupos.nombre_grupo) AS nombre_grupo,\n\t\t\t\t\t\t\t upper(observacion)\n\t\t\t\t\t FROM\n\t\t\t\t\t \t\tcontactos_no_reg\n\t\t\t\t\t INNER JOIN \n\t\t\t\t\t \t\tgrupos\n\t\t\t\t\t ON \n\t\t\t\t\t \t\tcontactos_no_reg.id_grupos=grupos.id\t\t\t\t\n\t\t\t\t\t WHERE\n\t\t\t\t\t \t\t1=1\n\t\t\t\t\t \".$where.\"\n\t\t\t\t\t ORDER BY contactos_no_reg.id desc\";\n\t\t//return $this->sql;\t\t\t \n\t\t$rs=$this->procesar_query($this->sql);\n\t\treturn $rs; \t\t\t\n\t}", "function buscarNovasSolicitacoes($solicitacao){\r\n\r\n require 'conexao.php';\r\n\r\n $sql = \"SELECT * FROM tb_solicitacao\r\n INNER JOIN tb_cliente ON solcliid = cliid\r\n INNER JOIN tb_servico ON solserid = serid\r\n INNER JOIN tb_autonomo ON solautid = autid\r\n WHERE solstatus = 'Aguardando autônomo' AND (soldata LIKE '%\".$solicitacao.\"%' OR serdescricao OR '%\".$solicitacao.\"%' OR solstatus LIKE '%\".$solicitacao.\"%' )\";\r\n\r\n $result = mysqli_query($con,$sql) or die(mysqli_error($con));\r\n\r\n $valida = mysqli_num_rows($result);\r\n\r\n //valida busca e retorna o resultado ou falso\r\n if($valida > 0){\r\n return $result;\r\n }else{\r\n return false;\r\n }\r\n}", "function consultarEmpleado(){\n\t$ced=$this->objEmpleado->getCedula();\n\t$objConexion = new ControlConexion();\n\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE CEDULA='\".$ced.\"' \";\n\n\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\n\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\n\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\t\t}\t\n\t\t$objConexion->cerrarBd(); \n\t\treturn $this->objEmpleado; \t\t\n}", "public function buscar($req,$pagina=1,$max=0){\t\t\n\t\t$conexion = $GLOBALS['conexion'];\n\t\t$c = $this->getCodeKey($req);\n\t\t$codigosReq = array();\t\t\n\t\tforeach ($c as $value) {\n\t\t\t$codigosReq[]=\"cg.code LIKE '$value%'\";\n\t\t}\n\t\t$codigosReq = '('.implode(' OR ', $codigosReq).')';\n\t\t$areas = $this->getAreaCode($req);\n\t\t$codigosAreas = \"rpi.cod_descripcion IN (\".implode(',', $areas).\")\";\t\n\t\t$flagCode = false;$flagArea = false;\t\n\t\t$codAreas = array();\n\t\t$codigos = array();\t\n\t\t$sql = array();\n\t\t$joins = array(); \n\t\t$where = array();\n\t\t$having = array();\n\t\t$order = array();\n\t\t$sql[] = \"SELECT SQL_CALC_FOUND_ROWS DISTINCT pers.* \";\t\t\t\n\t\t$from = \"FROM persona pers \";\t\t\n\t\t/*campo nombres**/\n\t\tif(isset($req['nom_ape']) && !empty($req['nom_ape'])){\t\t\t\n\t\t\t$nom_ape = addslashes(trim($req['nom_ape']));\n\t\t\t$where[] = \"(pers.nombre LIKE '%$nom_ape%')\";\n\t\t\t//$where[] = \"(CONCAT(pers.apellidos,' ',pers.nombre) LIKE '%$nom_ape%' OR CONCAT(pers.nombre,' ',pers.apellidos) LIKE '%$nom_ape%')\";\t\t\t \n\t\t\t//$where[] = \"(pers.apellidos LIKE '%$nom_ape%' OR pers.nombre LIKE '%$nom_ape%' OR CONCAT(pers.apellidos,' ',pers.nombre) LIKE '%$nom_ape%' OR CONCAT(pers.nombre,' ',pers.apellidos) LIKE '%$nom_ape%')\";\n\t\t\t//$where[] = \"(pers.apellidos LIKE '%$nom_ape%' OR pers.nombre LIKE '%$nom_ape%')\";\n\t\t}\t\t\n\t\t/*campo apellidos**/\n\t\tif(isset($req['apellido']) && !empty($req['apellido'])){\t\t\t\n\t\t\t$apellido = addslashes(trim($req['apellido']));\t\t\t\t\t\t \n\t\t\t$where[] = \"(pers.apellidos LIKE '%$apellido%')\";\n\t\t}\t\n\t\t\n\t\tif(isset($req['telefono']) && !empty($req['telefono'])){\t\t\t\n\t\t\t$telefono = addslashes(trim($req['telefono']));\n\t\t\t$where[] = \"(pers.telefono_movil LIKE '%$telefono%' OR pers.telefono_fijo LIKE '%$telefono%')\";\n\t\t}\n\t\t\n\t\t/**seccion codigos**/\t\n\t\tif(isset($req['cod_020_010'])){\n\t\t\t$flagCode = true;\n\t\t\t$codigos[] = \"code LIKE '%020.010.%;'\";\t\t\t\n\t\t}\t\t\n\t\tif(isset($req['cod_020_010_010'])){\n\t\t\t$flagCode = true;\n\t\t\t$codigos[] = \"code LIKE '%020.010.010.%;'\";\t\t\t\n\t\t}\t\n\t\tif(isset($req['cod_020_010_020'])){\n\t\t\t$flagCode = true;\n\t\t\t$codigos[] = \"code LIKE '%020.010.020.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_030_010'])){\n\t\t\t$flagCode = true;\t\t\n\t\t\t$codigos[] = \"code LIKE '%030.010.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_030_040'])){\n\t\t\t$flagCode = true;\t\t\t\t\t\t\t\t\n\t\t\t$codigos[] = \"code LIKE '030.040.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_030_050'])){\n\t\t\t$flagCode = true;\t\t\t\t\t\t\t\t\n\t\t\t$codigos[] = \"code LIKE '030.050.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_030_060'])){\n\t\t\t$flagCode = true;\n\t\t\t$codigos[] = \"code LIKE '030.060.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_030_070'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '030.070.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_050_010'])){\n\t\t\t$flagCode = true;\n\t\t\t$codigos[] = \"code LIKE '050.010.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_050_020'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '050.020.%;'\";\n\t\t}\n\t\tif(isset($req['cod_060_010_010'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '060.010.010.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_060_010_020'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '060.010.020.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_060_010_030'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '060.010.030.%;'\";\n\t\t}\n\t\tif(isset($req['cod_060_010_040'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '060.010.040.%;'\";\t\t\n\t\t}\n\t\tif(isset($req['cod_060_010_050'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '060.010.050.%;'\";\n\t\t}\n\t\tif(isset($req['cod_060_030_010'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '060.030.010.%;'\";\t\t\t\n\t\t}\n\t\tif(isset($req['cod_060_030_020'])){\n\t\t\t$flagCode = true;\t\t\t\n\t\t\t$codigos[] = \"code LIKE '060.030.020.%;'\";\t\t\t\n\t\t}\n\t\tif($flagCode){\n\t\t\t$sql[] = \"GROUP_CONCAT(DISTINCT SUBSTR(cg.code,1,11) ORDER BY cg.code ASC SEPARATOR ';') as code\";\n\t\t\t$joins [] = \"INNER JOIN categorias_generales cg ON cg.id_persona=pers.id \";\n\t\t\t$where[] = \"cg.code=ANY(SELECT code FROM categorias_generales WHERE categorias_generales.id_persona=pers.id AND $codigosReq)\";\n\t\t\t$having[] = \"code LIKE '\".implode('%;', $c).\"%'\";\n\t\t}\n\t\t/****fin seccion codigos***/\t\t\n\t\t\n\t\t\n\t\t\n\t\t/**al ser las areas dinamicas se debe consultar en base**/\n\t\t/*$objArea = new Area();\n\t\t$dataAreas = $objArea->getAllAreas();\n\t\tforeach ($dataAreas as $area) {\n\t\t\t$cod = $area['id'];\t\t\t\t\t\t\t\n\t\t\tif(isset($req['area_'.$cod])){\t\t\t\t\t\n\t\t\t\t$flagArea = true;\n\t\t\t\t$codAreas[] = $cod;\n\t\t\t}\n\t\t}\n\t\tif($flagArea){\n\t\t\t$sql[] = \"GROUP_CONCAT(DISTINCT cod_descripcion ORDER BY cod_descripcion ASC SEPARATOR ';') as area\";\t\n\t\t\t$joins [] = \"INNER JOIN r_personas_interes rpi ON rpi.id_persona=pers.id \";\n\t\t\t$where[] = \"rpi.cod_descripcion=ANY(SELECT cod_descripcion FROM r_personas_interes WHERE r_personas_interes.id_persona=pers.id AND $codigosAreas)\";\n\t\t\t$having[] = \"area='\".implode(';', $areas).\"'\";\n\t\t}*/\n\t\t\n\t\t\n\t\t/**al ser los temas dinamicos se debe consultar en base**/\n\t\t/*$flagTema = false;\n\t\t//$codTemas = array();\n\t\t\n\t\t$objTema = new Tema();\n\t\t$dataTemas = $objTema->getAllTemas();//todos los temas\n\t\tforeach ($dataTemas as $tema) {\n\t\t\t$idTema = $tema['id'];\t\t\t\t\t\t\t\n\t\t\tif(isset($req['tema_'.$idTema])){\t\t\t\t\t\n\t\t\t\t$flagTema = true;\n\t\t\t\t//$codTemas[] = $idTema;//aqui estarian los codigos de los temas que se enviaron\n\t\t\t}\n\t\t}*/\n\t\t\n\t\t\n\t\t$temas = $this->getTemaCode($req);//obtener codigos de temas\t\t\n\t\t//if($flagTema){\n\t\tif(count($temas)>0){\n\t\t\t$temas = $this->getTemaCode($req);//obtener codigos de temas\n\t\t\t$codigosTemas = \"pt.id_tema IN (\".implode(',', $temas).\")\";\t\t\t\n\t\t\t//$sql[] = \"GROUP_CONCAT(DISTINCT pt.id_tema ORDER BY pt.id_tema ASC SEPARATOR ';') as tema\";\t\n\t\t\t$joins [] = \"INNER JOIN r_personas_temas pt ON pt.id_persona=pers.id \";\n\t\t $where[] = $codigosTemas;\n\t\t\t//$where[] = \"pt.id_tema=ANY(SELECT id FROM r_personas_temas WHERE r_personas_temas.id_persona=pers.id AND $codigosTemas)\";\n\t\t\t//$having[] = \"tema='\".implode(';', $temas).\"'\";\n\t\t}\n\t\t\n\t\t\n\t\t//listar solo personas con estado publico\n\t\t$where[] = \"pers.estado='publico'\";\n\t\t\n\t\t$order[] = \"pers.apellidos\";\t\t\t\t\n\t\t$sql = implode(',',$sql).' ';\n\t\t(!empty($where))?$where=' WHERE '.implode(' AND ', $where):$where='';\t\t\n\t\t$joins = array_unique($joins);\n\t\t$joins = implode(' ', $joins);\t\n\t\t$group = \" GROUP BY id \";\n\t\t(!empty($having))?$having= \" HAVING \".implode(' AND ', $having):$having='';\t\t\t\n\t\t(!empty($order))?$order = \" ORDER BY \".implode(' , ', $order):$order='';\n\t\t\n\t\t($max!=0)?$limit = \" LIMIT $pagina,$max \": $limit = '';\n\t\t\t\t\t\t\n\t\t$sql.= $from.$joins.$where.$group.$having.$order.$limit;\n\t\t$data = $conexion->query($sql);//consultar \n\t\t$total = $conexion->fetch_row($conexion->query(\"SELECT FOUND_ROWS()\"));//devuelve un array con el total de registros sin limit de la ultima consulta\t\t\n\t\t$res = $this->generarArrayEnvio($data);\n\t\t$res['rows_total'] = $total[0];\n\t\treturn $res;\n\t}", "function selectAll($txtCampania, $txtFechaInicio) {\n ejecutarConsulta1(\"CREATE TEMPORARY TABLE bancopichinchaincrementos.TMP AS (\n SELECT C.CAMPAIGN, C.GOALS,CODIGO_CAMPANIA, substr(TMSTMP,1,10) AS TMSTMP, ResultLevel1, ResultLevel2, AGENT\n FROM bancopichinchaincrementos.GESTIONFINAL G, CCK.GOALSBYCAMPAIGN C\n WHERE C.CampaignCode = G.CODIGO_CAMPANIA AND TmStmp LIKE '%$txtFechaInicio%');\");\n \n $sql = \" SELECT B.AGENT, B.CAMPAIGN, B.GOALS,\n IFNULL((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA AND Agent = B.AGENT \n AND ResultLevel1 LIKE '%CU1 A%' AND TmStmp = B.TMSTMP GROUP BY AGENT),0) AS EXITOSOS,\n IFNULL((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA AND Agent = B.AGENT \n AND ResultLevel1 LIKE '%%' AND TmStmp = B.TMSTMP GROUP BY AGENT),0) AS GESTIONADOS,\n IFNULL((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA AND Agent = B.AGENT \n AND ResultLevel1 LIKE '%CU%' AND TmStmp = B.TMSTMP GROUP BY AGENT),0) AS CONTACTADOS,\n ROUND(IFNULL(((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA AND Agent = B.AGENT \n AND ResultLevel1 LIKE '%CU%' AND TmStmp = B.TMSTMP GROUP BY AGENT)*100/\n (SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA AND Agent = B.AGENT \n AND ResultLevel1 LIKE '%%' AND TmStmp = B.TMSTMP GROUP BY AGENT)),0),2) AS CONTACTABILIDAD,\n ROUND(IFNULL(((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA AND Agent = B.AGENT \n AND ResultLevel1 LIKE '%CU1 A%' AND TmStmp = B.TMSTMP GROUP BY AGENT)*100/\n (SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA AND Agent = B.AGENT \n AND ResultLevel1 LIKE '%%' AND TmStmp = B.TMSTMP GROUP BY AGENT)),0),2) AS EFECTIVIDAD\n FROM bancopichinchaincrementos.TMP B\n WHERE B.CODIGO_CAMPANIA = '$txtCampania'\n GROUP BY B.AGENT\n UNION ALL\n SELECT 'TOTAL', B.CAMPAIGN, B.GOALS,\n IFNULL((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA \n AND ResultLevel1 LIKE '%CU1 A%' AND TmStmp = B.TMSTMP),0) AS EXITOSOS,\n IFNULL((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA\n AND ResultLevel1 LIKE '%%' AND TmStmp = B.TMSTMP),0) AS GESTIONADOS,\n IFNULL((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA\n AND ResultLevel1 LIKE '%CU%' AND TmStmp = B.TMSTMP),0) AS CONTACTADOS,\n ROUND(IFNULL(((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA\n AND ResultLevel1 LIKE '%CU%' AND TmStmp = B.TMSTMP)*100/\n (SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA\n AND ResultLevel1 LIKE '%%' AND TmStmp = B.TMSTMP)),0),2) AS CONTACTABILIDAD,\n ROUND(IFNULL(((SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA\n AND ResultLevel1 LIKE '%CU1 A%' AND TmStmp = B.TMSTMP)*100/\n (SELECT COUNT(RESULTLEVEL1) FROM bancopichinchaincrementos.TMP\n WHERE CODIGO_CAMPANIA = B.CODIGO_CAMPANIA\n AND ResultLevel1 LIKE '%%' AND TmStmp = B.TMSTMP)),0),2) AS EFECTIVIDAD\n FROM CCK.GOALSBYCAMPAIGN C, bancopichinchaincrementos.TMP B\n WHERE B.CODIGO_CAMPANIA = '$txtCampania'\n GROUP BY Campaign, GOALS;\n \";\n \n \n return ejecutarConsulta1($sql);\n ejecutarConsulta1(\"DROP TABLE bancopichinchaincrementos.TMP;\");\n }", "function listarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_sel';\n\t\t$this->transaccion='REC_CLI_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_cliente','int4');\n\t\t$this->captura('genero','varchar');\n\t\t$this->captura('ci','varchar');\n\t\t$this->captura('email','varchar');\n\t\t$this->captura('email2','varchar');\n\t\t$this->captura('direccion','varchar');\n\t\t$this->captura('celular','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('lugar_expedicion','varchar');\n\t\t$this->captura('apellido_paterno','varchar');\n\t\t$this->captura('telefono','varchar');\n\t\t$this->captura('ciudad_residencia','varchar');\n\t\t$this->captura('id_pais_residencia','int4');\n\t\t$this->captura('nacionalidad','varchar');\n\t\t$this->captura('barrio_zona','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('apellido_materno','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\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\n $this->captura('nombre_completo1','text');\n $this->captura('nombre_completo2','text');\n\t\t$this->captura('pais_residencia','varchar');\n\t\t//$this->captura('nombre','varchar');\n\n\n\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}", "function listar($camposMostrar,$campo,$operador,$valor,$separador,$inicio,$fin)\n\t\t{\n\t\t\t$tablas=\"menciones*\".$this->tabla;\n\t\t\t$campos=\"en.mencion*en.apellidos*en.mencion\".$campo;\n\t\t\t$operadores=\"=*=*=\".$operador;\n\t\t\t$valores=\"me.id*\".$valor;\n\t\t\t$config=new config($tablas,$this->id,\"en.codigo*en.apellidos*en.nombres*en.maestria*me.nombre*en.anoEgreso*en.ofEnlace\",$campos,$operadores,$valores,\"AND*AND\",\"\",\"\",\"me*en\",$inicio,$fin);\n\t\t\t$config->enlazar();\n\t\t\t$a=$config->conn->crearConsultaMultiple();\n\t\t\treturn $a;\n\t\t}", "function consulta_registro_compras_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n\t, prosic_comprobante.referencia_fecha\n\t, prosic_comprobante.referencia_serie\n\t, prosic_comprobante.referencia_nro\n\t, prosic_comprobante.referecia_tipo_doc\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=3\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY prosic_tipo_comprobante.sunat_tipo_comprobante,prosic_comprobante.codigo_comprobante\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function selectRegistos($connectDB, $pesquisa, $grupo)\n{\n $rows = array();\n $this_user = $_SESSION['id'];\n\n $result = mysqli_query($connectDB, \"SELECT idutilizador, nome, email, numero, fotografia \n FROM utilizador \n WHERE nome LIKE '%$pesquisa%' \n OR email LIKE '%$pesquisa%'\n OR numero LIKE '%$pesquisa%'\n ORDER BY nome\");\n\n if (mysqli_num_rows($result) > 0) {\n while ($row = $result->fetch_assoc()) {\n if ($row['idutilizador'] != $this_user) {\n //--\n if (!checkIfMember($connectDB, $grupo, $row['idutilizador'])) {\n $rows[] = $row;\n }\n }\n }\n //-- print do json para ser retornado no ajax da pagina dos contactos\n print json_encode(($rows));\n } else {\n echo \"</br> Não encontrou contacto\";\n }\n}", "function getRegs($filter = \"\")\n {\n\n global $sql;\n\t\t \n\t if(isset($filter) && strlen(trim($filter))>0) $where = sprintf(\" where subscr_code='%s' \",$sql->escape_string($filter));\n\t else $where = \"\";\n\n $laRet = array();\n $sql->query(\"SELECT * from registry $where ORDER BY id\");\n while ($row = $sql->fetchObject()) {\n\t $item = new Registry(); \n\t \t$item->id = $row->id;\n\t\t$item->subscr_code = $row->subscr_code;\n $item->firstName = $row->firstname;\n $item->lastName = $row->lastname;\n $item->email = $row->email;\n\t $item->phone = $row->phone;\n\t $item->postCode = $row->postcode;\n\t $item->address = $row->address;\n\t $item->kidSize = $row->kidsize;\n\t $item->bigSize = $row->bigsize;\n\t $item->referer = $row->referer;\n\t $item->postId = $row->postid;\n\t $item->dateReg = $row->datereg;\n\t $item->dateSend = $row->datesend;\n\t $item->status = $row->status;\n\t $item->sid = $row->sid;\n $laRet[(int)$row->id] = $item;\n }\n\n return $laRet;\n }", "public function recunotas($idempresa){\r\n \t/*\r\n \t$sql = \"(SELECT 'Sistema','',comentario, calificacion, fecha_registro from calificaciones where id_empresa = '$idempresa' and id_clasificacion = '1' \r\n \tand comentario LIKE '%(GENERADO POR EL SISTEMA)%' order by id desc limit 2) UNION ALL (SELECT 'Supervisor',(SELECT username from users \r\n \t\twhere users.id = id_user),comentario, calificacion, fecha_registro from calificaciones where id_empresa = '$idempresa' and id_clasificacion = '1' \r\n \tand comentario NOT LIKE '%(GENERADO POR EL SISTEMA)%' order by id desc limit 1)\";\r\n\t\t*/\r\n\t\t$sql = \"(SELECT 'Sistema','' as 'Usuario',comentario as 'Comentario', calificacion as 'Calificacion', fecha_registro as 'Fecha' from calificaciones where id_empresa = '$idempresa' and id_clasificacion = '1' \r\n \tand comentario LIKE '%(GENERADO POR EL SISTEMA)%' order by id desc limit 2) UNION ALL (SELECT 'Supervisor',(SELECT username from users \r\n \t\twhere users.id = id_user) as 'Usuario',comentario as 'Comentario', calificacion as 'Calificacion', fecha_registro as 'Fecha' from calificaciones where id_empresa = '$idempresa' and id_clasificacion = '1' \r\n \tand comentario NOT LIKE '%(GENERADO POR EL SISTEMA)%' order by id desc limit 1)\";\r\n \treturn db::query(Database::SELECT, $sql)->execute();\r\n }", "function listarSolicitacoesBusca($solicitacao,$cliente){\r\n\r\n require 'conexao.php';\r\n\r\n $sql = \"SELECT * FROM tb_solicitacao\r\n INNER JOIN tb_cliente ON solcliid = cliid\r\n INNER JOIN tb_servico ON solserid = serid\r\n\r\n WHERE solcliid = $cliente AND (solstatus = 'Pendente' OR solstatus = 'Aguardando Autônomo') AND (soldata LIKE '%\".$solicitacao.\"%' OR serdescricao OR '%\".$solicitacao.\"%' OR solstatus LIKE '%\".$solicitacao.\"%' )\";\r\n\r\n $result = mysqli_query($con,$sql) or die(mysqli_error($con));\r\n\r\n $valida = mysqli_num_rows($result);\r\n\r\n if($valida > 0){\r\n return $result;\r\n\r\n }else{\r\n\r\n return false;\r\n }\r\n}", "function cargar_data_registro_venta($nombre_anio='', $nombre_mes='', $nrocomprobante='', $limit='') {\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo\n ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes\n ON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio\n ON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario\n ON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\n ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable\n ON (prosic_comprobante.id_plan_contable = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\n ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n\t\t\tWHERE prosic_comprobante.id_subdiario=2 \";\n if ($nombre_anio != ''\n )$sql.=\" AND prosic_anio.nombre_anio='\" . $nombre_anio . \"'\";\n if ($nombre_mes != ''\n )$sql.=\" AND prosic_mes.nombre_mes='\" . $nombre_mes . \"'\";\n if ($nrocomprobante != ''\n )$sql.=\" AND prosic_comprobante.nro_comprobante like'%\" . $nrocomprobante . \"%' \";\n if ($limit != ''\n )$sql.=$limit;\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function listarChequera(){\n\t\t$this->procedimiento='tes.f_chequera_sel';\n\t\t$this->transaccion='TES_CHQ_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->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->captura('id_chequera','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('nro_chequera','int4');\n\t\t$this->captura('codigo','varchar');\n\t\t$this->captura('id_cuenta_bancaria','int4');\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\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}", "private function _consultar() {\n $where = \"\";\n if(!empty($this->_idDato)){\n $where = \"AND b.id_valor = $this->_idDato \";\n }\n if(!empty($this->_valor)){\n if(is_array($this->_valor)){\n $aux = each($this->_valor);\n $where = \"AND b.valor {$aux['key']} '{$aux['value']}' \";\n }else{\n $where = \"AND b.valor = '$this->_valor' \";\n }\n \n }\n $query = \"SELECT a.nom_tabla,b.* FROM \nmt_tablas a,\nmt_contenidos b\nWHERE a.id_tablas = {$this->_idTabla}\nAND a.estado = 1 $where\nAND a.id_tablas = b.id_tabla\nAND b.estado = 1\";\n \n if(is_array($this->_orden) && count($this->_orden) == 2){\n $query .= (\" ORDER BY \" . ($this->_orden[0] == 1 ? \"id_valor \" : \"valor \") . $this->_orden[1] );\n }\n $con = ConexionSQL::getInstance();\n $id = $con->consultar($query);\n if($res = $con->obenerFila($id)){\n $R = array();\n do{\n $aux = array();\n foreach($res as $key => $valor){\n if(!is_numeric($key)){\n $aux[$key] = $valor;\n }\n }\n $R[] = $aux;\n }while($res = $con->obenerFila($id));\n return $R;\n }\n return false;\n }", "function executaRelatorio() {\n\n try {\n $form_values = $this->getValues();\n $matriculas = $form_values['matricula'];\n $matriculas = explode(\"\\n\", $matriculas);\n $matriculas = array_map('trim', $matriculas);\n $array = array(array());\n foreach ($matriculas as $matricula) {\n $aluno = TbalunoPeer::retrieveByPK($matricula);\n $result = array();\n $result['periodo'] = TbperiodoPeer::retrieveByPK($form_values['periodo']);\n $result['idperiodo'] = $form_values['periodo'];\n $result['aluno'] = $aluno;\n $result['show_fields'] = $form_values['show_fields'];\n $result['data_fields'] = $this->getModelFields();\n $result['list'] = TbdisciplinaPeer::retrieveByCodDisciplina($aluno->getDisciplinasACursar($form_values['periodo']));\n $result['list2'] = TbdisciplinaPeer::retrieveByCodDisciplina($aluno->getDisciplinasIntbfila($form_values['periodo']));\n $array['array'][] = $result;\n }\n } catch (PropelException $exc) {\n#throw new Exception( utf8_decode($exc->getMessage()).\" SQL: \".$criteria->toString() );\n throw new Exception(utf8_decode($exc->getMessage()));\n }\n\n return $array;\n }", "function buscar_eu($registrado,$texto_buscar,$sql,$idioma) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND eu_estado=1\n\t\t\t\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='' && $idioma=='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t} elseif ($texto_buscar !='' && $idioma!='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion_\".$idioma.\" LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t} else {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT COUNT(*) \n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=eu_descripcion.id_eu\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY eu.fecha_alta desc\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows[0] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $numrows[0];\n\t\t}\n\t}", "public function queryAll($campos=\"*\",$criterio=\"\");", "function buscarJuegos($datos) {\n global $textos, $sql, $configuracion, $sesion_usuarioSesion;\n\n $juego = new Juego();\n $destino = \"/ajax\".$juego->urlBase.\"/searchGames\";\n\n if (empty($datos)) {\n\n $forma2 = HTML::campoOculto(\"datos[criterio]\", \"titulo\");\n $forma2 .= HTML::parrafo($textos->id(\"TITULO\"), \"negrilla margenSuperior\");\n $forma2 .= HTML::parrafo(HTML::campoTexto(\"datos[patron]\", 30, 255).HTML::boton(\"buscar\", $textos->id(\"BUSCAR\")), \"margenSuperior\");\n\n // $codigo1 = HTML::forma($destino, $forma1);\n $codigo1 = HTML::forma($destino, $forma2);\n $codigo = HTML::contenedor($codigo1, \"bloqueBorde\");\n $codigo .= HTML::contenedor(\"\",\"margenSuperior\", \"resultadosBuscarJuegos\");\n\n $respuesta[\"generar\"] = true;\n $respuesta[\"codigo\"] = $codigo;\n $respuesta[\"destino\"] = \"#cuadroDialogo\";\n $respuesta[\"titulo\"] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id(\"BUSCAR_JUEGOS\"), \"letraNegra negrilla\"), \"bloqueTitulo-IS\"), \"encabezadoBloque-IS\");\n $respuesta[\"ancho\"] = 500;\n $respuesta[\"alto\"] = 400;\n\n } else {\n\n if (!empty($datos[\"criterio\"]) && !empty($datos[\"patron\"])) {\n\n if ($datos[\"criterio\"] == \"titulo\") {\n $palabras = explode(\" \", $datos[\"patron\"]);\n\n foreach ($palabras as $palabra) {\n $palabrasResaltadas[] = HTML::frase($palabra, \"resaltado\");\n $palabrasMarcadas[] = \"%\".$palabra.\"%\";\n }\n }\n\n $tablas = array(\n \"j\" => \"juegos\",\n \"i\" => \"imagenes\"\n );\n\n $columnas = array(\n \"id\" => \"j.id\",\n \"nombre\" => \"j.nombre\",\n \"descripcion\" => \"j.descripcion\", \n \"id_imagen\" => \"j.id_imagen\",\n \"idImagen\" => \"i.id\",\n \"ruta\" => \"i.ruta\"\n );\n $condicion = \"(j.id_imagen = i.id AND j.nombre REGEXP '(\".implode(\"|\", $palabras).\")') OR( j.id_imagen = i.id AND j.descripcion REGEXP '(\".implode(\"|\", $palabras).\")')\";\n \n //$sql->depurar = true;\n $consulta = $sql->seleccionar($tablas, $columnas, $condicion);\n \n \n $listaJuegos = array();\n \n if($sql->filasDevueltas){\n while ($fila = $sql->filaEnObjeto($consulta)) {\n \n $nombre = str_ireplace($palabras, $palabrasMarcadas, $fila->nombre);\n \n $imagen = $configuracion[\"SERVIDOR\"][\"media\"].$configuracion[\"RUTAS\"][\"imagenesDinamicas\"].\"/\".$fila->imagen; \n $item = HTML::enlace(HTML::imagen($imagen, \"flotanteIzquierda margenDerecha miniaturaListaUltimos5\"), HTML::urlInterna(\"JUEGOS\", $fila->id)); \n $item3 = HTML::parrafo(HTML::enlace(str_ireplace($palabrasMarcadas, $palabrasResaltadas, $nombre).\" \".\" \".HTML::imagen($configuracion[\"SERVIDOR\"][\"media\"].$configuracion[\"RUTAS\"][\"imagenesEstilos\"].\"goButton.png\"), HTML::urlInterna(\"JUEGOS\", $fila->id)), \"negrilla\");\n $item3 .= HTML::parrafo( substr($fila->descripcion, 0, 50).\"...\", \" cursiva pequenia\"); \n $item = HTML::contenedor($item3, \"fondoBuscadorBlogs\");//barra del contenedor gris\n $listaJuegos[] = $item;\n\n }//fin del while\n }//fin del if\n \n \n if(sizeof($listaJuegos) == 0){\n $listaJuegos[] = HTML::frase($textos->id(\"SIN_REGISTROS\"));\n }\n \n $listaJuegos = HTML::lista($listaJuegos, \"listaVertical listaConIconos bordeSuperiorLista\");\n \n\n $respuesta[\"accion\"] = \"insertar\";\n $respuesta[\"contenido\"] = $listaJuegos;\n $respuesta[\"destino\"] = \"#resultadosBuscarJuegos\";\n\n } else {\n $respuesta[\"error\"] = true;\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_CADENA_BUSQUEDA\");\n }\n\n }\n\n Servidor::enviarJSON($respuesta);\n}", "function fetchReg($consulta = NULL){\n if(!$consulta) $consulta = $this->consulta;\n return pg_fetch_array($consulta);\n }", "function buscar_materiales_limit($registrado,$texto_buscar,$licencia,$sql,$inicial,$cantidad) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND material_estado=1\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (material_titulo LIKE '%$texto_buscar%' \n\t\t\tOR material_descripcion LIKE '%$texto_buscar%' \n\t\t\tOR material_objetivos LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t}\n\t\t\n\t\t$query = \"SELECT * FROM materiales\n\t\tWHERE material_licencia = '$licencia'\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY fecha_alta desc\n\t\tLIMIT $inicial,$cantidad\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function affiche_relais_demande () {\n\t\tglobal $bdd;\n\t\t\n\t\t$req = $bdd->query(\"SELECT * FROM relais_mail JOIN utilisateur ON relais_mail.utilisateur_id_utilisateur = utilisateur.id_utilisateur WHERE status_relais = '2'\");\n\t\treturn $req;\n\t\t\n\t\t$req->closeCursor();\n\t}", "function SEARCH(){\n\t\t$sql = \"SELECT * FROM RESERVA\n\t\t\t\tWHERE FECHA BETWEEN '$this->hoy' AND '$this->hoy_mas6'\n\t\t\t\tORDER BY FECHA\";\n\n if (!($resultado = $this->mysqli->query($sql))){\n $this->mensaje['mensaje'] = 'ERROR: Fallo en la consulta sobre la base de datos';\n return $this->mensaje;\n }\n else{ // si la busqueda es correcta devolvemos el recordset resultado\n return $resultado;\n }\n }", "private function buscar($sql) {\n $aRe = array();\n if ($sql) {\n $res = Funciones::gEjecutarSQL($sql);\n while($aRow = $res->fetch(PDO::FETCH_ASSOC)) {\n //$aRe[] = array($aRow['FECHA'], html_entity_decode($aRow['CODPUN'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['PUNTO'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['TITULO'],ENT_QUOTES,'UTF-8'), $aRow['CODAPA'], html_entity_decode($aRow['APARTADO'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['SUBTITULO'],ENT_QUOTES,'UTF-8'), html_entity_decode($aRow['TEXTO'],ENT_QUOTES,'UTF-8'), $aRow['RELEVANCIA']);\n $aRe[] = array($aRow['FECHA'], Funciones::gDecodificar($aRow['CODPUN']), Funciones::gDecodificar($aRow['PUNTO']), Funciones::gDecodificar($aRow['TITULO']), $aRow['CODAPA'], Funciones::gDecodificar($aRow['APARTADO']), Funciones::gDecodificar($aRow['SUBTITULO']), Funciones::gDecodificar($aRow['TEXTO']), $aRow['RELEVANCIA']);\n }\n $res->closeCursor();\n }\n return $aRe;\n }", "function consulta_personalizada_registro_compras_imprimir($w_anio, $w_mes, $w_anexo) {\n $sql = \"SELECT\n prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.pago_comprobante\n , prosic_tipo_comprobante.sunat_tipo_comprobante\n , prosic_comprobante.serie_comprobante\n , prosic_comprobante.anio_dua_comprobante\n , prosic_comprobante.nro_comprobante\n , prosic_tipo_documento.sunat_tipo_documento\n , prosic_anexo.codigo_anexo\n , SUBSTRING(prosic_anexo.descripcion_anexo,1,20)\n , prosic_comprobante.afecto_comprobante\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.igv_comprobante\n , prosic_comprobante.total_comprobante \t\n , prosic_comprobante.id_operacion\n , prosic_comprobante.no_gravadas_igv\n , prosic_comprobante.inafecto_comprobante\n , prosic_comprobante.isc_comprobante\n , prosic_comprobante.otros_tributos\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.tipo_cambio_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n , prosic_comprobante.id_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_tipo_comprobante ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_tipo_documento ON (prosic_anexo.id_tipo_documento = prosic_tipo_documento.id_tipo_documento)\n WHERE prosic_comprobante.id_subdiario=3\";\n if ($w_anio != '')$sql.=\" AND prosic_comprobante.id_anio=\" . $w_anio;\n if ($w_mes != '')$sql.=\" AND prosic_comprobante.id_mes=\" . $w_mes;\n if ($w_anexo != '')$sql.=\" AND prosic_comprobante.id_anexo='\" . $w_anexo . \"'\";\n $sql.=\" ORDER BY CAST(prosic_comprobante.codigo_comprobante AS UNSIGNED),prosic_tipo_comprobante.sunat_tipo_comprobante\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function listarProcesoCompra(){\n\t\t$this->procedimiento='adq.f_proceso_compra_sel';\n\t\t$this->transaccion='ADQ_PROC_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_proceso_compra','int4');\n\t\t$this->captura('id_depto','int4');\n\t\t$this->captura('num_convocatoria','varchar');\n\t\t$this->captura('id_solicitud','int4');\n\t\t$this->captura('id_estado_wf','int4');\n\t\t$this->captura('fecha_ini_proc','date');\n\t\t$this->captura('obs_proceso','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t$this->captura('num_tramite','varchar');\n\t\t$this->captura('codigo_proceso','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('estado','varchar');\n\t\t$this->captura('num_cotizacion','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\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\n\t\t$this->captura('desc_depto','varchar');\n\t\t$this->captura('desc_funcionario','text');\n\t\t$this->captura('desc_solicitud','varchar');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t\n\t\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}", "function consultaFacultades() {\r\n include_once($this->configuracion[\"raiz_documento\"].$this->configuracion[\"clases\"].\"/html.class.php\");\r\n $this->html = new html();\r\n $facultades=$this->consultarFacultades();\r\n \r\n foreach ($facultades as $key=>$facultad) {\r\n $registro[$key][0]=$facultad['COD_FACULTAD'];\r\n $registro[$key][1]=$facultad['NOMBRE_FACULTAD'];\r\n }?>\r\n\t\t<form enctype='multipart/form-data' method='POST' action='index.php' name='<? echo $this->formulario?>'>\r\n <table width=\"100%\" align=\"center\" border=\"1\" cellpadding=\"10\" cellspacing=\"0\" >\r\n <tr>\r\n <td>Seleccione la Facultad: \r\n <?$mi_cuadro=$this->html->cuadro_lista($registro,'facultad',$this->configuracion,-1,\"\",FALSE,\"\",\"facultad\");\r\n echo $mi_cuadro;?>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\">\r\n <input type=\"hidden\" name=\"opcion\" value=\"consultaProyectos\">\r\n <input type=\"hidden\" name=\"action\" value=\"<? echo $this->bloque ?>\">\r\n <input class=\"boton\" type=\"button\" value=\"Continuar\" onclick=\"document.forms['<? echo $this->formulario?>'].submit()\">\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t</form>\t\r\n <?\r\n \r\n \r\n }", "function get_cuentas_registro_all() {\n $this->db->select();\n $this->db->from(\"cuentas_registro\");\n $query = $this->db->get();\n \n if ($query->num_rows() > 0) return $query;\n return NULL;\n }", "function _Registros($Regs=0){\n\t\t// Creo grid\n\t\t$Grid = new nyiGridDB('NOTICIAS', $Regs, 'base_grid.htm');\n\t\t\n\t\t// Configuro\n\t\t$Grid->setParametros(isset($_GET['PVEZ']), 'titulo');\n\t\t$Grid->setPaginador('base_navegador.htm');\n\t\t$arrCriterios = array(\n\t\t\t'id'=>'Identificador',\n\t\t\t'titulo'=>'T&iacute;tulo', \n\t\t\t\"IF(p.visible, 'Si', 'No')\"=>\"Visible\"\n\t\t);\n\t\t$Grid->setFrmCriterio('base_criterios_buscador.htm', $arrCriterios);\n\t\n\t\t// Si viene con post\n\t\tif ($_SERVER[\"REQUEST_METHOD\"] == \"POST\"){\n\t\t\t$Grid->setCriterio($_POST['ORDEN_CAMPO'], $_POST['ORDEN_TXT'], $_POST['CBPAGINA']);\n\t\t\tunset($_GET['NROPAG']);\n\t\t}\n\t\telse if(isset($_GET['NROPAG'])){\n\t\t\t// Numero de Pagina\n\t\t\t$Grid->setPaginaAct($_GET['NROPAG']);\n\t\t}\n\t\n\t\t$Campos = \"p.id_noticia AS id, p.titulo, pf.nombre_imagen, pf.extension, IF(p.visible, 'Si', 'No') AS visible, p.copete\";\n\t\t$From = \"noticia p LEFT OUTER JOIN noticia_foto pf ON pf.id_noticia = p.id_noticia AND pf.orden = 1\";\n\t\t\n\t\t$Grid->getDatos($this->DB, $Campos, $From);\n\t\t\n\t\t// Devuelvo\n\t\treturn($Grid);\n\t}", "public function getRegistros(){\n $sql = \"SELECT * FROM \".$this->getTable().\" WHERE \".$this->getTableId().\" = \".$this->getIdTable();\n $execute = conexao::toConnect()->executeS($sql);\n if (count($execute) > 0) {\n return $execute;\n }else{\n return false;\n }\n }", "function consultar_cuerpo_sms_noreg($tlf,$grupos,$nombres,$offset,$limit)\n\t{\n\t\t//FILTROS\n\t\t$where='';\n\t\t$where2='';\n\t\tif($tlf!=\"\")\n\t\t{\n\t\t\t$where.=\" AND contactos_no_reg.tlf1 like '%\".$tlf.\"%'\";\n\t\t}\n\t\tif($grupos!=\"\")\n\t\t{\n\t\t\t$where.=\" AND upper(grupos.nombre_grupo) like '%\".strtoupper($grupos).\"%'\";\n\t\t}\n\t\tif($nombres!=\"\")\n\t\t{\n\t\t\t$where.=\" AND upper(contactos_no_reg.nombre) like '%\".strtoupper($nombres).\"%'\";\n\t\t}\n\t\tif(($offset!=\"\")&&($limit!=\"\"))\t\n\t\t{\n\t\t\t$where2=\" limit '\".$limit.\"' \n offset '\".$offset.\"' \";\n\t\t}\n\t\t//\n\t\t$this->sql=\" SELECT \n\t\t\t\t\t\t\t tlf1 AS tlf,\n\t\t\t\t\t\t\t nombre AS nombres,\n\t\t \t\t\t\t\t upper(grupos.nombre_grupo) AS nombre_grupo,\n\t\t\t\t\t\t\t upper(observacion)\n\t\t\t\t\t FROM\n\t\t\t\t\t \t\tcontactos_no_reg\n\t\t\t\t\t INNER JOIN \n\t\t\t\t\t \t\tgrupos\n\t\t\t\t\t ON \n\t\t\t\t\t \t\tcontactos_no_reg.id_grupos=grupos.id\t\t\t\t\n\t\t\t\t\t WHERE\n\t\t\t\t\t \t\t1=1\n\t\t\t\t\t \".$where.\"\n\t\t\t\t\t ORDER BY contactos_no_reg.id desc\n\t\t\t\t\t \".$where2.\";\";\n\t\t//return $this->sql;\t \n\t\t$rs=$this->procesar_query($this->sql);\n\t\t//calculo cuantos son...\n\t\t$this->cuantos_son_sms_noreg($where);\n\t\t//verifico cuanto es el total de personas no registradas....\n\t\t//$this->cuantos_son_no_reg_total($where);\n\t\treturn $rs; \n\t}", "function _ConsultarResultadosPruebasIMM1($tipo_prueba, $id_cliente) //consulta el último biotest para imm se necesitan 16 campos.\n\t{\n\t\t$query='\n\t\t\tselect * from sg_pruebas \n\t\t\twhere Tipo_Prueba=\"'.$tipo_prueba.'\" \n\t\t\tand id_cliente=\"'.$id_cliente.'\" order by fecha and id asc limit 16\n\n\t\t';\n\t\t$con=Conectar::_con();\n\t\t$result=$con->query($query) or die(\"Error en: $query \".mysqli_error($query));\n\t\treturn $result;\n\t}", "function buscar_eu_limit($registrado,$texto_buscar,$sql,$inicial,$cantidad,$idioma) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND eu_estado=1\n\t\t\t\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='' && $idioma=='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t} elseif ($texto_buscar !='' && $idioma!='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion_\".$idioma.\" LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t} else {\n\t\t\t\n\t\t\t$sql_texto=\"AND (eu.eu_titulo LIKE '%$texto_buscar%' \n\t\t\tOR eu_descripcion.eu_descripcion LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT eu.*, eu_descripcion.*\n\t\tFROM eu, eu_descripcion\n\t\tWHERE eu.id_eu=eu_descripcion.id_eu\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY eu.eu_destacado desc\n\t\tLIMIT $inicial,$cantidad\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function realizarBusquedaNombre(){\n\n $string = $_GET['nombre'];\n $nombres = preg_split(\"/[\\s]+/\", $string);\n\n\n if (count($nombres) >= 2){\n $nombre = $nombres[0];\n $apellido = $nombres[1];\n } else if ( count($nombres) == 1){\n $nombre = $nombres[0];\n $apellido = NULL;\n } else {\n $nombre = \"\";\n $apellido = NULL;\n }\n\n $fbd = FachadaBD::getInstance();\n $results = $fbd->consultarPacienteNombre($nombre,$apellido);\n\n echo '<div class=\"table-responsive\">';\n echo '<table class=\"table\">';\n echo '<tr class=\"tablita\">';\n echo \"<th>Nombres</th>\";\n echo \"<th>Apellidos</th>\";\n echo \"<th>Cedula</th>\";\n echo \"</tr>\";\n\t\n while (($row = oci_fetch_array($results, OCI_BOTH))) {\n echo '<tr class=\"tablita\">';\n $link = '\"resultadoConsultaCedula.php?cedula='.$row[2].'\"';\n for ($i=0; $i <= 2; $i++) {\n echo \"<td><a href=$link>\".$row[$i].\"</a></td>\";\n\t}\n echo \"</tr>\";\n }\n echo \"</table>\";\n}", "private function iniciarRecolectarData()\r\n\t\t{\r\n\t\t\tself::findPagoDetalleActividadEconomica();\r\n\t\t\tself::findPagoDetalleInmuebleUrbano();\r\n\t\t\tself::findPagoDetalleVehiculo();\r\n\t\t\tself::findPagoDetalleAseo();\r\n\t\t\tself::findPagoDetallePropaganda();\r\n\t\t\tself::findPagoDetalleEspectaculo();\r\n\t\t\tself::findPagoDetalleApuesta();\r\n\t\t\tself::findPagoDetalleVario();\r\n\t\t\tself::findPagoDetalleMontoNegativo();\r\n\t\t\tself::ajustarDataReporte();\r\n\t\t}", "public function getComentarios()\n\t\t{\n\t\t\t $this->limpiarVariables();\n\t\t\t $this->conexion = new Conexion();\n\t\t\t $registros[]=array();\n\t\t\t $this->queryComentarios=\"select * from contacto\";\n\t\t\t $resultado=$this->conexion->consultar( $this->queryComentarios );\n\t\t\t \n\t\t\t \n\t\t\t return $resultado;\n\t\t}", "function buscar($datos, $idSubcategoria) {\n global $textos, $sql, $configuracion, $sesion_usuarioSesion;\n\n $objeto = new BulletinBoardItem();\n $destino = '/ajax'.$objeto->urlBase.'/search';\n\n if (empty($datos)) {\n\n $forma2 = HTML::campoOculto('datos[criterio]', 'titulo');\n $forma2 .= HTML::campoOculto('procesar', true);\n $forma2 .= HTML::campoOculto('datos[id_subcategoria]', $idSubcategoria);\n $forma2 .= HTML::parrafo($textos->id('TITULO'), 'negrilla margenSuperior');\n $forma2 .= HTML::parrafo(HTML::campoTexto('datos[patron]', 30, 255).HTML::boton('buscar', $textos->id('BUSCAR')), 'margenSuperior');\n\n $codigo1 = HTML::forma($destino, $forma2);\n $codigo = HTML::contenedor($codigo1, 'bloqueBorde');\n $codigo .= HTML::contenedor('','margenSuperior', 'resultadosBusqueda');\n\n $respuesta['generar'] = true;\n $respuesta['codigo'] = $codigo;\n $respuesta['destino'] = '#cuadroDialogo';\n $respuesta['titulo'] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id('BUSCAR_ITEM'), 'letraNegra negrilla'), 'bloqueTitulo-IS'), 'encabezadoBloque-IS');\n $respuesta['ancho'] = 530;\n $respuesta['alto'] = 400;\n\n } else {\n\n if (!empty($datos['criterio']) && !empty($datos['patron'])) {\n\n if ($datos['criterio'] == 'titulo') {\n\n $palabras = explode(' ', htmlspecialchars($datos['patron']));\n\n foreach ($palabras as $palabra) {\n $palabrasResaltadas[] = HTML::frase($palabra, 'resaltado');\n $palabrasMarcadas[] = '%'.$palabra.'%';\n } \n \n }\n\n $condicion = \"(n.titulo REGEXP '(\".implode(\"|\", $palabras).\")' OR n.resumen REGEXP '(\".implode(\"|\", $palabras).\")' OR n.descripcion REGEXP '(\".implode(\"|\", $palabras).\")' \";\n\n if(isset($sesion_usuarioSesion)){\n $condicion .= \" OR n.id_usuario = '$sesion_usuarioSesion->id')\";\n } else {\n $condicion .= \" )\";\n }\n\n $condicion .= \" AND sc.id_subcategoria = '\".$datos['id_subcategoria'].\"' \";\n\n //$sql->depurar = true;\n $consulta = $objeto->listar(0, 0, array(0), $condicion);\n\n //print_r($consulta);\n \n if (sizeof($consulta) > 0) {\n $listaNoticias = array();\n\n foreach ($consulta as $key => $fila) {\n $titulo = str_ireplace($palabras, $palabrasMarcadas, $fila->titulo);\n\n $autor = $sql->obtenerValor('usuarios', 'sobrenombre', 'id = \"'.$fila->idAutor.'\"');\n $item3 = HTML::parrafo(str_replace('%1', $autor, $textos->id('CREADO_POR')), 'negrilla');\n $item3 .= HTML::parrafo(HTML::enlace(str_ireplace($palabrasMarcadas, $palabrasResaltadas, $titulo).' '.' '.HTML::imagen($configuracion['SERVIDOR']['media'].$configuracion['RUTAS']['imagenesEstilos'].'goButton.png'), HTML::urlInterna('ITEMS_BB', $fila->id)), 'negrilla');\n $item3 .= HTML::parrafo(str_replace('%1', date('D, d M Y h:i:s A',$fila->fechaCreacion), $textos->id('PUBLICADO_EN')), 'negrilla cursiva pequenia'); \n\n $item = HTML::contenedor($item3, 'fondoBuscadorNoticias');//barra del contenedor gris\n\n $listaNoticias[] = $item; \n\n }\n } else {\n $listaNoticias[] = HTML::frase($textos->id('SIN_REGISTROS'));\n } \n\n $listaNoticias = HTML::lista($listaNoticias, 'listaVertical listaConIconos bordeSuperiorLista');\n\n\n $respuesta['accion'] = 'insertar';\n $respuesta['contenido'] = $listaNoticias;\n $respuesta['destino'] = '#resultadosBusqueda';\n $respuesta['limpiaDestino'] = true;\n\n } else {\n $respuesta['error'] = true;\n $respuesta['mensaje'] = $textos->id('ERROR_FALTA_CADENA_BUSQUEDA');\n\n }\n\n }\n\n Servidor::enviarJSON($respuesta);\n}", "private function query_consultores(){\n\n \t$respuesta = false;\n\n\t\ttry {\n\n\t\t\t$this->db->select('cao_usuario.co_usuario');\n\t\t\t$this->db->select('cao_usuario.no_usuario');\n\t\t\t$this->db->select('cao_usuario.no_email');\t\n\t\t\t$this->db->from('cao_usuario');\n\t\t\t$this->db->join('permissao_sistema', 'permissao_sistema.co_usuario = cao_usuario.co_usuario');\n\t\t\t$this->db->where('cao_usuario.co_usuario is NOT NULL', NULL, FALSE);\n\t\t\t$this->db->where('permissao_sistema.co_sistema',$this->_co_sistema);\n\t\t\t$this->db->where('permissao_sistema.in_ativo',$this->_in_ativo);\n\t\t\t$this->db->where_in('permissao_sistema.co_tipo_usuario', $this->_co_tipo_usuario);\n\t\t\t$this->db->order_by(\"cao_usuario.co_usuario\", \"asc\");\t\t\t\n\n\t\t\t$query = $this->db->get();\n\n\t\t if ($query && $query->num_rows() > 0)\n\t\t {\n\t\t\t\t$respuesta = $query->result_array();\n\n\t\t }else{\n\n\t\t throw new Exception('Error al intentar listar todos los consultores');\n\t\t\t log_message('error', 'Error al intentar listar todos los consultores');\t\t \n\n\t\t $respuesta = false;\t\t\t\t\n\t\t\t}\n\n\t\t} catch (Exception $e) {\n\n\t\t\t$respuesta = false;\n\t\t}\t\t\t\n\n\t\treturn $respuesta;\n }", "function SEARCH_PISTAS_LIBRES(){\n\t\t$sql1 = \"SELECT *\n\t\t\t\tFROM PARTIDO PA\n\t\t\t\tWHERE ( ( PA.FECHA = '$this->fecha') AND ( PA.HORARIO_ID = '$this->horario_ID'))\";\n $sql2 = \"SELECT *\n FROM RESERVA R\n WHERE ( ( R.FECHA = '$this->fecha') AND ( R.HORARIO_ID = '$this->horario_ID'))\";\n\n if ( !($resultado1 = $this->mysqli->query($sql1)) || !($resultado2 = $this->mysqli->query($sql2))){\n return 'ERROR: Fallo en la consulta sobre la base de datos';\n }\n else{ // si la busqueda es correcta devolvemos el recordset resultado\n $pistasLibres = NULL;\n \t$num_rows1 = mysqli_num_rows($resultado1);\n $num_rows2 = mysqli_num_rows($resultado2);\n\n \tif(($num_rows1 == 0) && (($num_rows2 == 0) )){ //Si no hay reservas ni partidos ese dia a esa hora\n\t\t\t\t$sql = \"SELECT * FROM PISTA ORDER BY ID\";\n\t\t if (!($resultado = $this->mysqli->query($sql)) ){\n\t\t return 'ERROR: Fallo en la consulta sobre la base de datos';\n\t\t }else{\n while($row = mysqli_fetch_array($resultado)){\n $pistasLibres[$row[\"ID\"]] = array($row[\"NOMBRE\"],$row[\"TIPO\"]);\n }\n\t\t \treturn $pistasLibres;\n\t\t }\n \t}else{\n\n $sql1 = \"SELECT PA.PISTA_ID\n FROM PARTIDO PA\n WHERE PA.FECHA = '$this->fecha' AND PA.HORARIO_ID = '$this->horario_ID'\n ORDER BY PA.ID\";\n $sql2 = \"SELECT R.PISTA_ID\n FROM RESERVA R\n WHERE R.FECHA = '$this->fecha' AND R.HORARIO_ID = '$this->horario_ID'\n ORDER BY R.ID\";\n $sql3 = \"SELECT * FROM PISTA ORDER BY ID\";\n\n if ( !($resultado1 = $this->mysqli->query($sql1))\n || !($resultado2 = $this->mysqli->query($sql2))\n || !($resultado3 = $this->mysqli->query($sql3)) ){\n return 'ERROR: Fallo en la consulta sobre la base de datos';\n }else{\n\n if($resultado1 <> NULL){\n while($row = mysqli_fetch_array($resultado1)){\n $list[$row[\"PISTA_ID\"]] = \"Ocupada\";\n }\n }\n if($resultado2 <> NULL){\n while($row = mysqli_fetch_array($resultado2)){\n $list[$row[\"PISTA_ID\"]] = \"Ocupada\";\n }\n }\n if($resultado3 <> NULL){\n while($row = mysqli_fetch_array($resultado3)){\n if(!array_key_exists($row[\"ID\"], $list)){\n $pistasLibres[$row[\"ID\"]] = array($row[\"NOMBRE\"],$row[\"TIPO\"]);\n }\n }\n }\n return $pistasLibres;\n }//fin del else\n return NULL;\n }//fin else\n } //fin else\n }", "function cargar_cuenta_de_gastos($buscar='') {\n if($buscar==''){\n $sql = \"SELECT id_plan_contable,cuenta_plan_contable,descripcion_plan_contable,cargar_plan_contable,abonar_plan_contable,transferencia_plan_contable FROM prosic_plan_contable WHERE cuenta_plan_contable LIKE '3%' OR cuenta_plan_contable LIKE '6%' ORDER BY cuenta_plan_contable\";\n }else{\n $sql = \"SELECT id_plan_contable,cuenta_plan_contable,descripcion_plan_contable,cargar_plan_contable,abonar_plan_contable,transferencia_plan_contable FROM prosic_plan_contable WHERE cuenta_plan_contable LIKE '\".$buscar.\"%' ORDER BY cuenta_plan_contable\";\n }\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function RellenaDatos()\n{//buscamos todos los atributos de la tupla\n $sql = \"SELECT *\n\t\t\tFROM PROF_ESPACIO\n\t\t\tWHERE (\n\t\t\t\t(DNI = '$this->DNI' AND CODESPACIO = '\".$this->CODESPACIO.\"') \n\t\t\t)\";\n\n\t//si no se ejecuta con éxito devuelve mensaje de error\n\t\t\tif (!$resultado = $this->mysqli->query($sql))\n\t{\n\t\t\treturn 'Error de gestor de base de datos';//devuelve el mensaje\n\t} //si no se ejecuta con éxito \n\telse\n\t{\n\t\t$tupla = $resultado->fetch_array();//guardamos el resultado de la busqueda en la variable tupla\n\t}\n\treturn $tupla;//devolvemos la información de ese centro\n}", "public function buscar_comprobante_venta_3($anio ,$mes ,$fech1 ,$fech2 ,$tipodocumento) {\n //CPC_TipoDocumento => F factura, B boleta\n //CPC_total => total de la FACTURA o BOLETA CPC_FechaRegistro BETWEEN '20121201' AND '20121202'\n\n $where=\"\";\n //----------\n if($anio!=\"--\" && $mes ==\"--\"){// SOLO AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"'\";\n }\n if($anio!=\"--\" && $mes !=\"--\" ){// MES Y AÑO\n $where=\"AND YEAR(CPC_FechaRegistro)='\" . $anio . \"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n if($anio==\"--\" && $mes !=\"--\"){//MES CON AÑO ACTUAL\n $where=\"AND YEAR(CPC_FechaRegistro)=' \".date(\"Y\").\"' AND MONTH(CPC_FechaRegistro)='\" . $mes .\"'\";\n }\n\n //-----------------\n \n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2==\"--\"){//FECHA INICIAL\n $where=\"AND CPC_FechaRegistro > '\" . $fech1 . \"'\";\n }\n if($anio==\"--\" && $mes ==\"--\" && $fech1!=\"--\" && $fech2!=\"--\" ){//FECHA INICIAL Y FECHA FINAL\n $where=\"AND CPC_FechaRegistro >= '\" . $fech1 . \"' AND CPC_FechaRegistro <= '\" . $fech2 . \"'\";\n }\n \n \n //------------\n\n \n $wheretdoc= \"\";\n if($tipodocumento !=\"--\")\n $wheretdoc= \" AND CPC_TipoDocumento='\".$tipodocumento.\"' \";\n\n \n\n $sql = \" SELECT com.*,CONCAT(pe.PERSC_Nombre , ' ', pe.PERSC_ApellidoPaterno, ' ', pe.PERSC_ApellidoMaterno) as nombre , MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_persona pe on pe.PERSP_Codigo = cl.PERSP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo=com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\n \n UNION \n SELECT com.* ,EMPRC_RazonSocial as nombre ,MONED_Simbolo from cji_comprobante com\n inner join cji_cliente cl on cl.CLIP_Codigo = com.CLIP_Codigo\n inner join cji_empresa es on es.EMPRP_Codigo = cl.EMPRP_Codigo\n inner JOIN cji_moneda m ON m.MONED_Codigo = com.MONED_Codigo \n WHERE CPC_TipoOperacion='V' \".$wheretdoc.$where.\"\";\n\n //echo $sql;\n $query = $this->db->query($sql);\n if ($query->num_rows > 0) {\n foreach ($query->result() as $fila) {\n $data[] = $fila;\n }\n return $data;\n }\n return array();\n }", "function buscarCondominio($cond){\r\n\r\n require 'conexao.php';\r\n\r\n $sql = \"SELECT con.*,sin1.sinnome as sindico, sin2.sinnome as subsindico FROM tb_condominio con\r\n INNER JOIN tb_sindico sin1 ON con.consinid = sin1.sinid\r\n INNER JOIN tb_sindico sin2 ON con.consubsindico = sin2.sinid\r\n WHERE connome LIKE '%\".$cond.\"%' OR concep LIKE '%\".$cond.\"%' OR conrua LIKE '%\".$cond.\"%' OR sin1.sinnome LIKE '%\".$cond.\"%' \";\r\n\r\n $result = mysqli_query($con,$sql) or die(mysqli_error($con));\r\n\r\n $valida = mysqli_num_rows($result);\r\n\r\n //valida busca e retorna o resultado ou falso\r\n if($valida > 0){\r\n return $result;\r\n }else{\r\n return false;\r\n }\r\n}", "public function get_recibos_contado($mes_recibo,$ano_recibo){\n $conectar=parent::conexion();\n parent::set_names();\n\n $mes=$_POST[\"mes_recibo\"];\n $ano=$_POST[\"ano_recibo\"]; \n $fecha= ($ano.\"-\".$mes.\"%\");\n\n if($mes=='todos'){\n $sql=\"select r.fecha,r.numero_recibo,r.numero_venta,r.abono_act,r.paciente,r.empresa,r.id_recibo,v.tipo_pago from ventas as v inner join recibos as r on v.numero_venta=r.numero_venta where v.tipo_venta='Contado';\";\n $sql=$conectar->prepare($sql); \n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n }else{\n $sql=\"select r.fecha,r.numero_recibo,r.numero_venta,r.abono_act,r.paciente,r.empresa,r.id_recibo,v.tipo_pago from ventas as v inner join recibos as r on v.numero_venta=r.numero_venta where fecha like ? and v.tipo_venta='Contado';\";\n $sql=$conectar->prepare($sql);\n $sql->bindValue(1,$fecha); \n $sql->execute();\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n}\n}", "function buscar_software($registrado,$texto_buscar,$sql,$idioma) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND software_estado=1\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='' && $idioma=='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (software.software_titulo LIKE '%$texto_buscar%' \n\t\t\tOR software_descripcion.software_descripcion LIKE '%$texto_buscar%' \n\t\t\tOR software_objetivo.software_objetivo LIKE '%$texto_buscar%'\n\t\t\tOR software_informacion_adicional.software_informacion_adicional LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t} elseif ($texto_buscar !='' && $idioma!='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (software.software_titulo LIKE '%$texto_buscar%' \n\t\t\tOR software_descripcion.software_descripcion_\".$idioma.\" LIKE '%$texto_buscar%' \n\t\t\tOR software_objetivo.software_objetivo_\".$idioma.\" LIKE '%$texto_buscar%'\n\t\t\tOR software_informacion_adicional.software_informacion_adicional_\".$idioma.\" LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t} else {\n\t\t\t\n\t\t\t$sql_texto=\"AND (software.software_titulo LIKE '%$texto_buscar%' \n\t\t\tOR software_descripcion.software_descripcion LIKE '%$texto_buscar%' \n\t\t\tOR software_objetivo.software_objetivo LIKE '%$texto_buscar%'\n\t\t\tOR software_informacion_adicional.software_informacion_adicional LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT COUNT(*) \n\t\tFROM software, software_descripcion,software_objetivo,\n\t\tsoftware_informacion_adicional\n\t\tWHERE software.id_software=software_descripcion.id_software\n\t\tAND software.id_software=software_objetivo.id_software\n\t\tAND software.id_software=software_informacion_adicional.id_software\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY fecha_alta desc\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows[0] == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $numrows[0];\n\t\t}\n\t}", "function grabar_consulta($variable_array){\n//creo el xajaxResponse para generar una salida\n$respuesta = new xajaxResponse('ISO-8859-1');\n$id_campo = $variable_array[\"id_campo\"];\n$id_especialista = $variable_array[\"id_especialista\"];\n$id_usuario = $variable_array[\"id_usuario\"];\n$id_turno = $variable_array[\"id_turno\"];\n$tipo = $variable_array[\"tipo\"];\n$cie_10 = $variable_array[\"29\"];\n$cabeza = $variable_array[\"22\"];\n$cuello = $variable_array[\"23\"];\n$torax = $variable_array[\"24\"];\n$abdomen = $variable_array[\"25\"];\n$timestamp = time(); \n$link=conectarse();\nmysql_query(\"SET NAMES 'utf8'\");\n\n/// CAMPOS OBLIGATORIOS\nif ($cie_10 == ''){\n$nuevo_select =\"<center><h1><img src='images/atencion.gif' alt='!'>No ha especificado un código de diagnóstico</h1><h2>Los datos no se guardarán!</h2></center>\";\n$respuesta->addAssign(\"consulta_dinamico\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// comprueba si el cie 1o es valido\n$sql=mysql_query(\"SELECT * FROM cie_10 WHERE codigo = '$cie_10' LIMIT 1\",$link);\n\nif (mysql_num_rows($sql)=='0'){\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n$nuevo_select =\"<center><h1><img src='images/atencion.gif' alt='!'> $cie_10 No es un código válido!</h1><h2>Los datos no se guardarán!</h2></center>\";\n\t\t\t\t\t\t\t\t\t\t\n\n$respuesta->addAssign(\"consulta_dinamico\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}\n\nif ($cabeza == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '22' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo CABEZA en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta; }\n\t\t\t\t\t\t\t\t\t\t}\n\nif ($cuello == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '23' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo CUELLO en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}}\nif ($torax == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '24' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo TORAX en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}}\nif ($abdomen == ''){\n$sql=mysql_query(\"SELECT contenido FROM consulta_datos WHERE id_campo = '25' AND id_turno='$id_turno' LIMIT 1\",$link);\nif (mysql_num_rows($sql)=='0'){\n$nuevo_select =\"<center><img src='images/atencion.gif' alt='!'>\n<input type='button' onClick=\\\"xajax_campos_consulta_dinamico('8','Exámen físico','<? echo $id_usuario; ?>');\\\" \n\t\t\t\tvalue='El campo ABDOMEN en exámen fisico, no puede estar vacio'>\n\t\t\t\t\t\t\t<h2>Los datos no se guardarán!</h2>\n\t\t\t\t\t\t\t</center>\";\n$respuesta->addAssign(\"alerta\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\t\t\t\t\t\t\t\t\t\t}}\n\n/// FIN CAMPOS OBLIGATORIOS\n\n\t\t\t\t\t\t\t\t\t\t\n\n\nif ($tipo == 'mostrar'){\n\nforeach ($variable_array as $campo => $contenido)\n\t{\n$campos=mysql_query(\"\n \t\tSELECT id_consulta_campo, campo_nombre\n\t\tFROM `consulta_campos`\n\t\tWHERE id_consulta_campo = '$campo'\n\t\t\",$link);\n\nwhile( $row = mysql_fetch_array( $campos ) ) {\nif($contenido != \"\"){ \n/// revisando si el campo ya fue grabado en el mismo turno\n$sql_campo=mysql_query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\t\tFROM consulta_datos \n\t\t\t\t\t\t\t\t\t\t\t\tWHERE id_campo = '$campo'\n\t\t\t\t\t\t\t\t\t\t\t\tAND id_turno='$id_turno' \n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\",$link);\n\nif (mysql_num_rows($sql_campo)!='0'){\nwhile( $row = mysql_fetch_array( $sql_campo ) ) { \n$id_consulta_datos = $row['id_consulta_datos'];\n\n\n//\t\t\t\t\t\t\t$nuevo_select .= \"$timestamp EXISTIA - $id_consulta_campos -\";\t\n\t\t\t\tmysql_query(\"\nUPDATE `consulta_datos` SET \n`id_especialista` = '$id_especialista',\n`id_usuario` = '$id_usuario',\n`contenido` = '$contenido',\n`timestamp` = '$timestamp',\n`id_turno` = '$id_turno' WHERE`id_consulta_datos` = '$id_consulta_datos' LIMIT 1 \",$link);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else {\t\n//\t\t\t\t\t\t\t\t$nuevo_select .= \"nuevo\";\t\t\nmysql_query(\"\nINSERT INTO `consulta_datos` ( `id_consulta_datos` , `id_campo` , `id_especialista` , `id_usuario` , `contenido` , `timestamp` , `id_turno` )\nVALUES (NULL , '$campo', '$id_especialista', '$id_usuario', '$contenido', '$timestamp', '$id_turno')\",$link);\n// $nuevo_select .= \"$campo --- $contenido <br>\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\n\t\n\n\t}\t\n//\t\t$nuevo_select .= \"<h1>La consulta fu&eacute; guardada</h1>\t<a href=?page=plan&id_turno=$id_turno>Recetar</a>; \n\t\t\n$respuesta->addAssign(\"cabecera\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n$nuevo_select .= \"<h1>Los siguientes datos ser&aacute;n guardados en la consulta:</h1>\";\n\n \n$nuevo_select .= \"<ol>\";\n\nforeach ($variable_array as $campo => $valor)\n\t{\n\n$campos=mysql_query(\"\n \t\tSELECT id_consulta_campo, campo_nombre\n\t\tFROM `consulta_campos`\n\t\tWHERE id_consulta_campo = '$campo'\n\t\t\",$link);\n\nwhile( $row = mysql_fetch_array( $campos ) ) {\n$nuevo_select .= \"<li>\". $row['id_consulta_campo'].\" \" . $row['campo_nombre'].\":\" .$valor.\"</li>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t}\n\t\n\t\n\n//while( $row = mysql_fetch_array( $sql ) ) {\n//$nuevo_select .= '' . $row['id'] . '\">' . $row['nombre_completo'] . '<br>';\n//}\n$nuevo_select .= \"<input type='text' name='tipo' id='tipo' value='guardar'>\n\t\t\t\t\t\t<input type='button' onClick=\\\"xajax_grabar_consulta(xajax.getFormValues('consulta'));confirmacion(); \\\" value='Confirmar' >\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\";\n$respuesta->addAssign(\"cabecera\",\"innerHTML\",$nuevo_select);\nreturn $respuesta;\n}", "function buscador($productesBuscar){\n $conn=connexioBD();\n $productes=\"\";\n $sql=\"SELECT * FROM productes WHERE nom LIKE '%$productesBuscar%'\";\n if (!$resultado =$conn->query($sql)){\n die(\"Error al comprobar datos\".$conn->error);\n }\n if($resultado->num_rows>=0){\n while($producte=$resultado->fetch_assoc()){\n $idProducte=$producte[\"id\"];\n $imatges=mostrarImatgesPublica($idProducte);\n $productes.=\"ID: \".$producte[\"id\"].\" Nom \".$producte[\"nom\"].\" Descripcio \".$producte[\"descripcio\"].\" Preu \".$producte[\"preu\"].\"<br>\".$imatges.\"<br><br>\"; \n }\n }\n return $productes;\n $resultado->free();\n $conn->close();\n}", "function listarClienteLibro()\n {\n $this->procedimiento='rec.ft_cliente_sel';\n $this->transaccion='REC_RELIBRO_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->setParametro('id_oficina_registro_incidente','id_oficina_registro_incidente','integer');\n $this->setParametro('fecha_ini','fecha_ini','date');\n $this->setParametro('fecha_fin','fecha_fin','date');\n $this->setCount(false);\n\n $this->captura('id_reclamo','int4');\n $this->captura('nro_frd','varchar');\n $this->captura('correlativo_preimpreso_frd','int4');\n $this->captura('fecha_hora_incidente','timestamp');\n $this->captura('fecha_hora_recepcion','timestamp');\n $this->captura('fecha_hora_recepcion_sac','date');\n $this->captura('detalle_incidente','text');\n $this->captura('nombre','text');\n $this->captura('celular','varchar');\n $this->captura('telefono','varchar');\n $this->captura('nombre_incidente','varchar');\n $this->captura('sub_incidente','varchar');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\t\t//var_dump($this->respuesta); exit;\n $this->ejecutarConsulta();\n //var_dump($this->respuesta); exit;\n //Devuelve la respuesta\n return $this->respuesta;\n\n }", "function _ConsultarClientes()\n\t\t{\n\t\t\t$query='\n\t\t\t\tSELECT\n\t\t\t\tclientes.id,\n\t\t\t\tclientes.nb_cliente,\n\t\t\t\tclientes.nb_apellidos,\n\t\t\t\tclientes.de_email,\n\t\t\t\tclientes.num_celular,\n\t\t\t\tusuarios.nb_nombre as \"Ins_nombre\", \n\t\t\t\tusuarios.nb_apellidos as \"Ins_apellido\" \n\t\t\t\tFROM sgclientes clientes\n\t\t\t\tleft join sgusuarios usuarios on clientes.id_usuario_registro=usuarios.id\n\t\t\t\twhere clientes.sn_activo=1\n\t\t\t\tORDER BY clientes.id ASC\n\t\t\t\n\t\t\t';\n\t\t\t$clientes = $this->EjecutarTransaccionAllNoParams($query);\n\t\t\treturn $clientes;\n\t\t}", "public function BuscarComprasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT compras.codcompra, compras.subtotalivasic, compras.subtotalivanoc, compras.ivac, compras.totalivac, compras.descuentoc, compras.totaldescuentoc, compras.totalc, compras.statuscompra, compras.fechavencecredito, compras.fechacompra, proveedores.ritproveedor, proveedores.nomproveedor, SUM(detallecompras.cantcompra) AS articulos FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN detallecompras ON detallecompras.codcompra = compras.codcompra WHERE DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') >= ? AND DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') <= ? GROUP BY compras.codcompra\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN COMPRAS DE PRODUCTOS PARA EL RANGO DE FECHA INGRESADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function rec_empresa_list(){\n\t\t}", "function consultarProyectos() {\n $cadena_sql = $this->sql->cadena_sql(\"consultaProyectos\",\"\");\n return $resultadoProyectos = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\n }", "function establecer_m2_reservas_concretadas() {\n// inner join lote on (res_lot_id=lot_id)\n// inner join zona on (lot_zon_id=zon_id)\n// where res_promotor like 'NET%'\");\n// $reservas = FUNCIONES::lista_bd_sql(\"select res_id,zon_precio from reserva_terreno\n// inner join lote on (res_lot_id=lot_id)\n// inner join zona on (lot_zon_id=zon_id)\n// where res_multinivel = 'si' and res_monto_m2=0\");\n\n\n\n $reservas = FUNCIONES::lista_bd_sql(\"select res_id,ven_metro from reserva_terreno\n\n inner join venta on (ven_res_id=res_id)\n\n where res_monto_m2=0 and res_estado in ('Concretado') and ven_estado in ('Pendiente','Pagado')\");\n\n\n\n $conec = new ADO();\n\n foreach ($reservas as $res) {\n\n $conec->ejecutar(\"update reserva_terreno set res_monto_m2=$res->ven_metro where res_id=$res->res_id\");\n }\n}", "public function BusquedaClientes()\n\t{\nself::SetNames();\n\t\t\n$sql = \" SELECT * from clientes WHERE CONCAT(cedcliente, '',nomcliente) LIKE '%\".$_GET[\"buscacliente\"].\"%' ORDER BY codcliente ASC LIMIT 0,20\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\t if($num==0)\n\t\t{\n\t\t\n\techo \"<center><div class='alert alert-danger'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\techo \"<span class='fa fa-info-circle'></span> NO SE ENCONTRARON RESULTADOS PARA TU B&Uacute;SQUEDA !</div></center>\";\n\texit;\n\t\t }\n\t\telse\n\t\t{\n\t\twhile($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 queryAll(){\n\t\t$sql = 'SELECT * FROM telefonos';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function buscarEstudiante() {\n\n $sql = \"SELECT D.tipodocumento, D.nombrecortodocumento, E.codigocarrera,\n EG.numerodocumento, EG.idestudiantegeneral, EG.nombresestudiantegeneral, \n EG.apellidosestudiantegeneral, EG.expedidodocumento, EG.codigogenero, \n EG.ciudadresidenciaestudiantegeneral, EG.fechanacimientoestudiantegeneral, EG.direccionresidenciaestudiantegeneral, \n EG.telefonoresidenciaestudiantegeneral, EG.emailestudiantegeneral, D.nombredocumento\n\t\tFROM \n estudiantegeneral EG\n\t\tINNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n\t\tINNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n\t\tWHERE\n E.codigoestudiante = ? \";\n /* FIN MODIFICACION */\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n $this->setFechaNacimiento($this->persistencia->getParametro(\"fechanacimientoestudiantegeneral\"));\n $this->setDireccion($this->persistencia->getParametro(\"direccionresidenciaestudiantegeneral\"));\n $this->setTelefono($this->persistencia->getParametro(\"telefonoresidenciaestudiantegeneral\"));\n $this->setEmail($this->persistencia->getParametro(\"emailestudiantegeneral\"));\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n $this->setCarrera($carrera);\n\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n $tipoDocumento->setNombreDocumento($this->persistencia->getParametro(\"nombredocumento\"));\n\n $genero = new Genero(null);\n $genero->setCodigo($this->persistencia->getParametro(\"codigogenero\"));\n\n $ciudad = new Ciudad(null);\n $ciudad->setId($this->persistencia->getParametro(\"ciudadresidenciaestudiantegeneral\"));\n\n $this->setCiudad($ciudad);\n $this->setGenero($genero);\n $this->setTipoDocumento($tipoDocumento);\n }\n\n $this->persistencia->freeResult();\n }", "function buscar_recomendado2($localidad){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND disponible_pro='1' AND categoria_pro!='10' AND \n\t\t\t(nombre_pro LIKE '%' '\".$localidad.\"' '%' OR \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tdescripcion_pro LIKE '%' '\".$localidad.\"' '%') GROUP BY id_pro ORDER BY RAND() LIMIT 0,5\";\n\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t//calculando el URL\n\t\t\t\tsetlocale(LC_ALL, 'es_ES');\n\t\t\t\t//$resultado['nombre_pro']=ucwords(strtolower($resultado['nombre_pro']));\n\t\t\t\t$sql2=\"SELECT * FROM categoria WHERE id_cat='$cat' GROUP BY id_cat\";\n\t\t\t\t$consulta2=mysql_query($sql2) or die(mysql_error());\n\t\t\t\t$resultado2 = mysql_fetch_array($consulta2);\n\t\t\t\t$aux=$this->modificar_url($resultado2['claves_cat']);\n\t\t\t\t$resultado['url']=$aux.\"_\".$this->modificar_url($resultado['claves_pro']);\n\t\t\t\t\n\t\t\t\t$temp=$resultado['limite_pro'];\n\t\t\t\t$resultado['limite_pro']=\"\";\n\t\t\t\t//echo \"Numero: \".$temp;\n\t\t\t\t\n\t\t\t\tfor($i=1;$i<=$temp;$i++){\n\t\t\t\t\tif($i<=12) $resultado['limite_pro'][]=$i; else break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$resultado['detal_pro']=$this->mostrar_precio($resultado['detal_pro']);\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t}", "public function busquedaUsuarios($txtEmail,$txtNroId,$txtNombre1,$txtNombre2,$txtApellido1,$txtApellido2){\n\t\t\t$usuarios = array();\n\t\t\t$sql = \"SELECT U.id_usuarios, U.nro_encuesta_form, U.USUARIO, LOWER(U.USUARIO) AS usu_minuscula, P.cedula, P.primer_nombre, P.segundo_nombre, P.primer_apellido, P.segundo_apellido,\n\t\t\t\t\tC.FK_ESTADO, e.desc_estado, V.C1I1_DPTO, D.DEPTO, V.C1I2_MPIO, M.MPIO, CL.CLASE,\n\t\t\t\t\tV.C1I4_CO, V.C1I5_AO, V.C1I6_UC, V.C1IV10_DIR\n\t\t\t\t\tFROM cnp_admin_usuarios U\n\t\t\t\t\tLEFT JOIN cnp_preregistro P ON U.nro_encuesta_form = P.nro_encuesta_form \n\t\t\t\t\tLEFT JOIN cnpv_admin_control C ON U.nro_encuesta_form = C.nro_encuesta_form \n\t\t\t\t\tLEFT JOIN cnpv_param_estados E ON C.fk_estado = E.id_estado\n\t\t\t\t\tLEFT JOIN cnpv_vivienda V ON V.C0I1_ENCUESTA = U.nro_encuesta_form\n\t\t\t\t\tLEFT JOIN (SELECT to_number(VALOR_MINIMO) VALOR_MINIMO, DESCRIPCION DEPTO FROM cnp_respuesta_dominio WHERE ID_DOMINIO = 1) D ON D.valor_minimo = V.C1I1_DPTO\n\t\t\t\t\tLEFT JOIN (SELECT to_number(VALOR_MINIMO) VALOR_MINIMO, DESCRIPCION MPIO FROM cnp_respuesta_dominio WHERE ID_DOMINIO = 2) M ON M.valor_minimo = V.C1I2_MPIO\n\t\t\t\t\tLEFT JOIN (SELECT to_number(VALOR_MINIMO) VALOR_MINIMO, DESCRIPCION CLASE FROM cnp_respuesta_dominio WHERE ID_DOMINIO = 3) CL ON CL.valor_minimo = V.C1I3_CLASE\n\t\t\t\t\tWHERE 1=1 \";\n\t\t\t\n\t\t\tif ($txtEmail!='-'){\n\t\t\t\t$sql.= \"AND U.USUARIO = '$txtEmail' \";\n\t\t\t}\n\t\t\tif ($txtNroId!='-' && $txtNroId!='0'){\n\t\t\t\t$sql .= \"AND P.cedula = '$txtNroId' \";\n\t\t\t}\n\t\t\tif ($txtNombre1!='-'){\n\t\t\t\t$sql .= \"AND LOWER(P.primer_nombre) LIKE LOWER('%$txtNombre1%') \";\n\t\t\t}\n\t\t\tif ($txtNombre2!='-'){\n\t\t\t\t$sql .= \"AND LOWER(P.segundo_nombre) LIKE LOWER('%$txtNombre2%') \";\n\t\t\t}\n\t\t\tif ($txtApellido1!='-'){\n\t\t\t\t$sql .= \"AND LOWER(P.primer_apellido) LIKE LOWER('%$txtApellido1%') \";\n\t\t\t}\n\t\t\tif ($txtApellido2!='-'){\n\t\t\t\t$sql .= \"AND LOWER(P.segundo_apellido) LIKE LOWER('%$txtApellido2%') \";\n\t\t\t}\n\t\t\t\n\t\t\t$sql.=\" ORDER BY usu_minuscula ASC \";\n\t\t\t//echo $sql;\n\t\t\t$query = $this->db->query($sql);\n\t\t\tif ($query->num_rows() > 0){\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($query->result() as $row){\n\t\t\t\t\t$usuarios[$i][\"txtEmail\"] = $row->USUARIO;\n\t\t\t\t\t$usuarios[$i][\"txtNroId\"] = $row->CEDULA;\n\t\t\t\t\t$usuarios[$i][\"txtNombre1\"] = $row->PRIMER_NOMBRE;\n\t\t\t\t\t$usuarios[$i][\"txtNombre2\"] = $row->SEGUNDO_NOMBRE;\t\t\t\t\t\n\t\t\t\t\t$usuarios[$i][\"txtApellido1\"] = $row->PRIMER_APELLIDO;\n\t\t\t\t\t$usuarios[$i][\"txtApellido2\"] = $row->SEGUNDO_APELLIDO;\n\t\t\t\t\t$usuarios[$i][\"txtEstado\"] = $row->DESC_ESTADO;\n\t\t\t\t\t$usuarios[$i][\"txtcodDepto\"] = $row->C1I1_DPTO;\n\t\t\t\t\t$usuarios[$i][\"txtDepto\"] = $row->DEPTO;\n\t\t\t\t\t$usuarios[$i][\"txtcodMPIO\"] = $row->C1I2_MPIO;\n\t\t\t\t\t$usuarios[$i][\"txtMPIO\"] = $row->MPIO;\n\t\t\t\t\t$usuarios[$i][\"txtClase\"] = $row->CLASE;\n\t\t\t\t\t$usuarios[$i][\"txtcodCO\"] = $row->C1I4_CO;\n\t\t\t\t\t$usuarios[$i][\"txtcodAO\"] = $row->C1I5_AO;\n\t\t\t\t\t$usuarios[$i][\"txtcodUC\"] = $row->C1I6_UC;\n\t\t\t\t\t$usuarios[$i][\"txtDireccion\"] = $row->C1IV10_DIR;\n\t\t\t\t\t\n\t\t\t\t\t$usuarios[$i][\"opc\"] = '<a href=\"'.site_url(\"/operativo/mostrarDetalleUsuario/$row->NRO_ENCUESTA_FORM\").'\">Ver</a> | <a href=\"'.site_url(\"/operativo/formNovedad/$row->NRO_ENCUESTA_FORM\").'\">Novedad</a>';\n\t\t\t\t\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->db->close();\n\t\t\treturn $usuarios;\n\t\t}", "function ejecutarConsulta() {\n\t\t$this->openConnection();\n\t\t$res = $this->conn->query($this->consulta);\n\t\t$this->closeConnection();\n\t\treturn $res;\n\t}", "function buscar_software_limit($registrado,$texto_buscar,$sql,$inicial,$cantidad,$idioma) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_visibles=\"AND software_estado=1\";\n\t\t}\n\t\t\n\t\tif ($texto_buscar !='' && $idioma=='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (software.software_titulo LIKE '%$texto_buscar%' \n\t\t\tOR software_descripcion.software_descripcion LIKE '%$texto_buscar%' \n\t\t\tOR software_objetivo.software_objetivo LIKE '%$texto_buscar%'\n\t\t\tOR software_informacion_adicional.software_informacion_adicional LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t\n\t\t} elseif ($texto_buscar !='' && $idioma!='es') {\n\t\t\t\n\t\t\t$sql_texto=\"AND (software.software_titulo LIKE '%$texto_buscar%' \n\t\t\tOR software_descripcion.software_descripcion_\".$idioma.\" LIKE '%$texto_buscar%' \n\t\t\tOR software_objetivo.software_objetivo_\".$idioma.\" LIKE '%$texto_buscar%'\n\t\t\tOR software_informacion_adicional.software_informacion_adicional_\".$idioma.\" LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t} else {\n\t\t\t\n\t\t\t$sql_texto=\"AND (software.software_titulo LIKE '%$texto_buscar%' \n\t\t\tOR software_descripcion.software_descripcion LIKE '%$texto_buscar%' \n\t\t\tOR software_objetivo.software_objetivo LIKE '%$texto_buscar%'\n\t\t\tOR software_informacion_adicional.software_informacion_adicional LIKE '%$texto_buscar%') \n\t\t\t\";\n\t\t}\n\t\t\n\t\t$query = \"SELECT software.*, software_descripcion.*,software_objetivo.*,\n\t\tsoftware_informacion_adicional.* \n\t\tFROM software, software_descripcion,software_objetivo,\n\t\tsoftware_informacion_adicional\n\t\tWHERE software.id_software=software_descripcion.id_software\n\t\tAND software.id_software=software_objetivo.id_software\n\t\tAND software.id_software=software_informacion_adicional.id_software\n\t\t$sql\n\t\t$sql_texto\n\t\t$mostrar_visibles\n\t\tORDER BY software.software_destacado desc\n\t\tLIMIT $inicial,$cantidad\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function ConsultarSoporteRefrigerios($param) {\n extract($param);\n $resultado = array();\n $registro = array();\n $sql = \"CALL SPCONSULTARCARGAMASIVASR('$busqueda');\";\n $rs=null;\n $conexion->getPDO()->query(\"SET NAMES 'utf8'\");\n $host= $_SERVER[\"HTTP_HOST\"];\n if ($rs = $conexion->getPDO()->query($sql)) {\n if ($filas = $rs->fetchAll(PDO::FETCH_ASSOC)) {\n foreach ($filas as $fila) {\n foreach ($fila as $key => $value) {\n $rutaFuente= \"<a href='/\".$fila['RutaAutorizacion'].\"'>Descargar Archivo Fuente</a>\";\n $rutaEscaneado= \"<a href='/\".$fila['RutaSoporte'].\"'>Descargar Archivo Soporte</a>\";\n array_push($registro, $fila['Salon'],$fila['Fecha'],$rutaFuente, $rutaEscaneado ,$value);\n \n array_push($registro, $value);\n }\n array_push($resultado, $registro);\n $registro = array();\n }\n }\n } else {\n $registro = 0;\n }\n echo json_encode($resultado);\n }", "public function readAll(){\n\t\t\t$req = \"SELECT recette.idRec, recette.nom AS lib, descriptif, difficulte, prix, nbPersonnes, \n\t\t\t\t\tdureePreparation, dureeCuisson, dureeTotale, qteCalories, qteProteines, qteGlucides, qteLipides, \n\t\t\t\t\tutilisateur.nom AS utilNom, utilisateur.prenom AS utilprenom, illustration.adresse\n\t\t\t\t\tFROM recette \n\t\t\t\t\tINNER JOIN utilisateur\n\t\t\t\t\tON recette.idUtil = utilisateur.idUtil\n\t\t\t\t\tINNER JOIN illustration\n\t\t\t\t\tON recette.idRec = illustration.idRec\n\t\t\t\t\tORDER BY recette.nom ASC\";\n\t\t\t$curseur=$this->cx->query($req);\n\t\t\treturn $curseur;\n\t\t}", "public function busquda_Filtro($_Palabra,$_Orden,$_Estado,$_Calificaciones,$_Certificaciones,$_Asociaciones,$IDEMpresa){\n\t\t//primero verifico en que ordern las voy a solicitar\n\t\tif($_Orden===''){\n\t\t\t$_Orden=\"\";\n\t\t}else if($_Orden==='az'){\n\t\t\t$_Orden=\" order by Razon_Social asc\";\n\t\t}else if($_Orden==='za'){\n\t\t\t$_Orden=\" order by Razon_Social desc\";\n\t\t}\n\t\t$_Resultadosr=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Razon_Social LIKE '%$_Palabra%'\");\n\t\t$_Resultadosr=$_Resultadosr->result_array();\n\t\t\n\t\t//busco en su nombre comercial\n\t\t$_Resultadosnc=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Nombre_Comer LIKE '%$_Palabra%'\");\n\t\t$_Resultadosnc=$_Resultadosnc->result_array();\n\n\t\t//busco por su rfc\n\t\t$_Resultadosrfc=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE RFC LIKE '%$_Palabra%' \");\n\t\t$_Resultadosrfc=$_Resultadosrfc->result_array();\n\n\t\t//busco por su descripcion\n\t\t$_Resultadosprefil=$this->db->query(\"SELECT IDEmpresa FROM empresa WHERE Perfil LIKE '%$_Palabra%' \");\n\t\t$_Resultadosprefil=$_Resultadosprefil->result_array();\n\t\t\n\t\t//buscos por sus productos y servicios\n\t\t$_Resultadospprod=$this->db->query(\"SELECT IDEmpresa FROM productos WHERE Producto LIKE '%$_Palabra%'\");\n\t\t$_Resultadospprod=$_Resultadospprod->result_array();\n\t\t\n\n\t\t//buscos por sus productos y servicios de su descripcion\n\t\t$_Resultadospprodd=$this->db->query(\"SELECT IDEmpresa FROM productos WHERE Descripcion LIKE '%$_Palabra%'\");\n\t\t$_Resultadospprodd=$_Resultadospprodd->result_array();\n\t\t\n\n\t\n\t\n\n\t\t//buscos por sus marca\n\t\t$_Resultadosmarcas=$this->db->query(\"SELECT IDEmpresa FROM marcas WHERE Marca LIKE '%$_Palabra%'\");\n\t\t$_Resultadosmarcas=$_Resultadosmarcas->result_array();\n\n\t\t//buscos por sus normas de calidad\n\t\t$_Resultadosnormas=$this->db->query(\"SELECT IDEmpresa FROM normascalidad WHERE Norma LIKE '%$_Palabra%'\");\n\t\t$_Resultadosnormas=$_Resultadosnormas->result_array();\n\n\t\t// ahohora tengo que unir todos los resultados en un solo array para obtener sus datos\n\t\t$todos=array_merge($_Resultadosr, $_Resultadosnc,$_Resultadosrfc,$_Resultadosprefil,$_Resultadospprod,$_Resultadospprodd,$_Resultadosmarcas,$_Resultadosnormas);\n\t\t\n\t\t$_Resultados=[];\n\t\t//ahora elimino los repetidos\n\t\tforeach($todos as $empresa){\n\t\t\t$bandera=false;\n\t\t\t$resulta=in_array_r($empresa[\"IDEmpresa\"],$_Resultados);\n\t\t\tif($resulta===false){\n\t\t\t\tarray_push($_Resultados,array(\"IDEmpresa\"=>$empresa[\"IDEmpresa\"]));\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t// ahora obtengo el filtro de estados\n\t\tif($_Estado!==''){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_Empresa($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif($_datos_empresa[\"Estado\"]!==$_Estado){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\n\t\t\n\t\t// ahora obtengo el filtro de Certificaciones\n\t\tif($_Certificaciones===TRUE){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_certificaciones($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif(count($_datos_empresa)===0){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\n\t\t\n\t\t// ahora obtengo el filtro de Asociaciones\n\t\tif($_Asociaciones===TRUE){\n\t\t\tforeach($_Resultados as $keys=>$_empresa){\n\t\t\t\t$_datos_empresa=$this->Datos_Asociaciones($_empresa[\"IDEmpresa\"]);\n\t\t\t\tif(count($_datos_empresa)===0){\n\t\t\t\t\tunset($_Resultados[$keys]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$_Resultados = array_values($_Resultados);\n\t\n\t\t$_Datos=[];\n\t\t\n\t\tif($_Calificaciones!==\"\"){\n\t\t\t$_DatosCalificaciones=explode('-',$_Calificaciones);\n\t\t\t\n\t\t\tforeach($_Resultados as $_Empresa){\n\t\t\t\t$_DatosEmpresa=$this->Datos_Empresa($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_DatosNormas=$this->Model_Norma->getall($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_seguida = $this->Model_Follow->getfollowtrue($IDEMpresa,$_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$ImagenCliente= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'cliente');\n\t\t\t\t$ImagenProveedor= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'proveedor');\n\t\t\t\t$_total=$this->db->query(\"SELECT COUNT('*') AS total FROM tbcalificaciones where IDEmpresaReceptor='\".$_Empresa[\"IDEmpresa\"].\"'\");\n\t\t\t\t$_total=$_total->row_array();\n\t\t\t\tif((int)$_total[\"total\"]>=(int)$_DatosCalificaciones[0] && (int)$_total[\"total\"]<=(int)$_DatosCalificaciones[1] ){\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t$_Datos,\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\"IDEmpresa\"=>$_DatosEmpresa[\"IDEmpresa\"],\n\t\t\t\t\t\t\t\"Razon_Social\"=>$_DatosEmpresa[\"Razon_Social\"],\n\t\t\t\t\t\t\t\"RFC\"=>$_DatosEmpresa[\"RFC\"],\n\t\t\t\t\t\t\t\"Nombre_Comer\"=>$_DatosEmpresa[\"Nombre_Comer\"],\n\t\t\t\t\t\t\t\"Perfil\"=>$_DatosEmpresa[\"Perfil\"],\n\t\t\t\t\t\t\t\"Logo\"=>$_DatosEmpresa[\"Logo\"],\n\t\t\t\t\t\t\t\"Banner\"=>$_DatosEmpresa[\"Banner\"],\n\t\t\t\t\t\t\t\"Normas\"=>$_DatosNormas,\n\t\t\t\t\t\t\t\"Follow\"=>$_seguida,\n\t\t\t\t\t\t\t\"ImagenCliente\"=>$ImagenCliente,\n\t\t\t\t\t\t\t\"ImagenProveedor\"=>$ImagenProveedor\n\t\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}else{\n\t\t\tforeach($_Resultados as $_Empresa){\n\t\t\t\t\n\t\t\t\t$_DatosEmpresa=$this->Datos_Empresa($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_DatosNormas=$this->Model_Norma->getall($_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$_seguida = $this->Model_Follow->getfollowtrue($IDEMpresa,$_Empresa[\"IDEmpresa\"]);\n\t\t\t\t$ImagenCliente= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'cliente');\n\t\t\t\t$ImagenProveedor= $this->Model_Imagen->ImagenGen($_Empresa[\"IDEmpresa\"],'proveedor');\n\t\t\t\t$_total=$this->db->query(\"SELECT COUNT('*') AS total FROM tbcalificaciones where IDEmpresaReceptor='\".$_Empresa[\"IDEmpresa\"].\"'\");\n\t\t\t\tarray_push($_Datos,\n\t\t\t\tarray(\n\t\t\t\t\t\"IDEmpresa\"=>$_DatosEmpresa[\"IDEmpresa\"],\n\t\t\t\t\t\"Razon_Social\"=>$_DatosEmpresa[\"Razon_Social\"],\n\t\t\t\t\t\"RFC\"=>$_DatosEmpresa[\"RFC\"],\n\t\t\t\t\t\"Nombre_Comer\"=>$_DatosEmpresa[\"Nombre_Comer\"],\n\t\t\t\t\t\"Perfil\"=>$_DatosEmpresa[\"Perfil\"],\n\t\t\t\t\t\"Logo\"=>$_DatosEmpresa[\"Logo\"],\n\t\t\t\t\t\"Banner\"=>$_DatosEmpresa[\"Banner\"],\n\t\t\t\t\t\"Normas\"=>$_DatosNormas,\n\t\t\t\t\t\"Follow\"=>$_seguida,\n\t\t\t\t\t\"ImagenCliente\"=>$ImagenCliente,\n\t\t\t\t\t\"ImagenProveedor\"=>$ImagenProveedor\n\t\t\t\t));\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn $_Datos;\t\t\n\t}", "public function buscar() \n {\n \n if($buscar = \\Request::get('q')){\n $lineas= Linea:: where(function($query) use ($buscar){\n $query->where('nombre','LIKE', \"%$buscar%\")->orWhere('rif','LIKE',\"%$buscar%\")\n ->orWhere('estado','LIKE',\"%$buscar%\")->orWhere('municipio','LIKE',\"%$buscar%\")\n ->orWhere('tipo_ruta','LIKE',\"%$buscar%\");\n\n })->paginate(20);\n }\n\n return $lineas; //retorna toda la consulta\n }", "function update_res($_POST){\n$cta_b = substr(current($_POST),0,4);\n$cheque = substr(current($_POST),5,4);\n$res = $_POST['res'];\nsql_update($cta_b, $cheque, $res);\n$reg = count($_POST)-2; //Numero de Registros por evaluar\nfor($i=$reg; $i>1; $i--){\n\tnext($_POST);\n\t$cta_b = substr(current($_POST),0,4);\n\t$cheque = substr(current($_POST),5,4);\n\t$res = $_POST['res'];\n\tsql_update($cta_b, $cheque, $res);\n\t}\n}", "public function selectAllRegiuniData(){\n $sql = \"SELECT * FROM regiune ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "function consultar(){\n\t\t\n\t\t$this->mysqli = conectarBD();\n\t\t\n\t\t$sql = \"SELECT Linea_Factura.Id_Linea_Factura,Linea_Factura.Id_Factura,Servicio.Nombre,Linea_Factura.Importe,Linea_Factura.Descripcion FROM Linea_Factura INNER JOIN Servicio WHERE Linea_Factura.Id_Factura='\".$this->factura.\"' AND Linea_Factura.Id_Servicio=Servicio.Id_Servicio AND Linea_Factura.Borrado='0';\";\n\t\t$resultado = $this->mysqli->query($sql);\t\n\t\tif ($resultado->num_rows > 0){\n\t\t\twhile($row = $resultado->fetch_array()){\n\t\t\t\t$array[] = $row;\n\t\t\t}\n\t\t\treturn $array;\n\t\t}\n\t}", "function consulta($Conexion_ID, $Where = \"\"){\r\n\r\n $SQL = \"SELECT me.id, me.snombre,\r\n\t\t me.sapellido, me.stelefono,\r\n\t\t me.stelefono_1, me.id_especialidad,\r\n\t\t me.bactivo, esp.id as esp_id, esp.sdescripcion as esp_descrip FROM doctor me, especialidad esp WHERE me.id_especialidad = esp.id \";\r\n\r\n if (!empty($Where)) {\r\n $SQL .= \" AND \" . $Where;\r\n\r\n }\r\n\r\n $SQL .= \" ORDER BY sapellido \";\r\n\r\n//ejecutamos la consulta\r\n\r\n\r\n $this->Consulta_ID = @mysql_query($SQL, $Conexion_ID);\r\n\r\n if (!$this->Consulta_ID) {\r\n\r\n $this->Errno = mysql_errno();\r\n\r\n $this->Error = mysql_error();\r\n\r\n }\r\n\r\n/* Si hemos tenido éxito en la consulta devuelve el identificador de la conexión, sino devuelve 0 */\r\n\r\n return $this->Consulta_ID;\r\n\r\n}", "function consultarNotas(){ \n $cadena_sql=$this->cadena_sql(\"notas\",$this->codProyecto);\n $estudiantes=$this->funcionGeneral->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\" );\n return $estudiantes;\n }", "function consulta_datos_formulario_033($req_no) { \n $sql=\" SELECT \n COALESCE(a.req_no::TEXT,'No Aplica') AS req_no\n ,COALESCE(a.dcm_no::TEXT,'No Aplica') AS dcm_no\n ,COALESCE(a.dcm_nm::TEXT,'No Aplica') AS dcm_nm\t\t\t\t\t\n ,COALESCE(a.req_city_nm::TEXT,'No Aplica') AS req_city_nm\n ,COALESCE(nullif(a.exp_sty_ctft_req_no,'')::TEXT,'No Aplica') AS exp_sty_ctft_req_no\n ,COALESCE(nullif(a.qlt_ctft_no,'')::TEXT,'No Aplica') AS qlt_ctft_no\t\t\t\t\t\n ,case \n when dclr_cl_cd='001' \n then 'Persona Jurídica'::TEXT\n WHEN dclr_cl_cd='002'\n then 'Persona Natural'::TEXT\n else\n 'No Aplica'\n end AS dclr_cl_cd\t\t\t\t\t\t\t\t\t\t\n ,COALESCE(a.dclr_idt_no::TEXT,'No Aplica') AS dclr_idt_no\n ,COALESCE(nullif(a.dclr_nole,'')::TEXT,'No Aplica') AS dclr_nole\n ,COALESCE(a.dclr_nm::TEXT,'No Aplica') AS dclr_nm\n ,COALESCE(a.dclr_rpgp_nm::TEXT,'No Aplica') AS dclr_rpgp_nm\t\t\t\t\t\n ,COALESCE(a.dclr_prvhc_nm::TEXT,'No Aplica') AS dclr_prvhc_nm\t\t\t\n ,COALESCE(a.dclr_cuty_nm::TEXT,'No Aplica') AS dclr_cuty_nm\t\t\t\t\t\n ,COALESCE(a.dclr_prqi_nm::TEXT,'No Aplica') AS dclr_prqi_nm\n ,COALESCE(a.dclr_ad::TEXT,'No Aplica') AS dclr_ad\n ,COALESCE(a.dclr_tel_no::TEXT,'No Aplica') AS dclr_tel_no\n ,COALESCE(nullif(a.dclr_fax_no,'')::TEXT,'No Aplica') AS dclr_fax_no\n ,COALESCE(nullif(a.dclr_em,'')::TEXT,'No Aplica') AS dclr_em\n ,COALESCE(a.impr_nm::TEXT,'No Aplica') AS impr_nm\t\t\t\t\t\n ,COALESCE(a.impr_ntn_nm::TEXT,'No Aplica') AS impr_ntn_nm\t\t\t\t\t\n ,COALESCE(a.impr_city_nm::TEXT,'No Aplica') AS impr_city_nm\n ,COALESCE(a.impr_ad::TEXT,'No Aplica') AS impr_ad\n ,COALESCE(nullif(a.impr_tel_no,'')::TEXT,'No Aplica') AS impr_tel_no\n ,COALESCE(nullif(a.impr_fax_no,'')::TEXT,'No Aplica') AS impr_fax_no\n ,COALESCE(nullif(a.impr_em,'')::TEXT,'No Aplica') AS impr_em\n ,case \n when expr_cl_cd='001' \n then 'Persona Jurídica'::TEXT\n WHEN expr_cl_cd='002'\n then 'Persona Natural'::TEXT\n else\n 'No Aplica'\n end AS expr_cl_cd\t\t\t\t\t\t\t\t\t\t\n ,COALESCE(a.expr_idt_no::TEXT,'No Aplica') AS expr_idt_no\n ,COALESCE(a.expr_nm::TEXT,'No Aplica') AS expr_nm\n ,COALESCE(a.expr_atr_no::TEXT,'No Aplica') AS expr_atr_no\t\t\t\t\t\n ,COALESCE(a.expr_ntn_nm::TEXT,'No Aplica') AS expr_ntn_nm\t\t\t\t\t\n ,COALESCE(nullif(a.expr_city_nm,'')::TEXT,'No Aplica') AS expr_city_nm\t\t\t\t\t\n ,COALESCE(a.expr_prvhc_nm::TEXT,'No Aplica') AS expr_prvhc_nm\t\t\t\t\t\n ,COALESCE(a.expr_cuty_nm::TEXT,'No Aplica') AS expr_cuty_nm\t\t\t\t\t\n ,COALESCE(a.expr_prqi_nm::TEXT,'No Aplica') AS expr_prqi_nm\n ,COALESCE(a.expr_ad::TEXT,'No Aplica') AS expr_ad\n ,COALESCE(a.expr_tel_no::TEXT,'No Aplica') AS expr_tel_no\n ,COALESCE(NULLIF(a.expr_fax_no,'')::TEXT,'No Aplica') AS expr_fax_no\n ,COALESCE(NULLIF(a.expr_em,'')::TEXT,'No Aplica') AS expr_em\n ,case \n when pcs_cl_cd='001' \n then 'Persona Jurídica'::TEXT\n WHEN pcs_cl_cd='002'\n then 'Persona Natural'::TEXT\n else\n 'No Aplica'\n end AS pcs_cl_cd\t\t\t\t\t\t\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_idt_no,'')::TEXT,'No Aplica') AS pcs_idt_no\n ,COALESCE(NULLIF(a.pcs_nm,'')::TEXT,'No Aplica') AS pcs_nm\n ,COALESCE(NULLIF(a.pcs_atr_no,'')::TEXT,'No Aplica') AS pcs_atr_no\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_ntn_nm,'')::TEXT,'No Aplica') AS pcs_ntn_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_city_nm,'')::TEXT,'No Aplica') AS pcs_city_nm\n ,COALESCE(NULLIF(a.pcs_rpgp_nm,'')::TEXT,'No Aplica') AS pcs_rpgp_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_prvhc_nm,'')::TEXT,'No Aplica') AS pcs_prvhc_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_cuty_nm,'')::TEXT,'No Aplica') AS pcs_cuty_nm\t\t\t\t\t\n ,COALESCE(NULLIF(a.pcs_prqi_nm,'')::TEXT,'No Aplica') AS pcs_prqi_nm\n ,COALESCE(NULLIF(a.pcs_ad,'')::TEXT,'No Aplica') AS pcs_ad\n ,COALESCE(NULLIF(a.pcs_tel_no,'')::TEXT,'No Aplica') AS pcs_tel_no\n ,COALESCE(NULLIF(a.pcs_fax_no,'')::TEXT,'No Aplica') AS pcs_fax_no\n ,COALESCE(NULLIF(a.pcs_em,'')::TEXT,'No Aplica') AS pcs_em\t\t\t\t\t\n ,COALESCE(a.dst_ntn_nm::TEXT,'No Aplica') AS dst_ntn_nm\t\t\t\t\t\n ,COALESCE(a.dst_city_nm::TEXT,'No Aplica') AS dst_city_nm\t\t\t\t\t\n ,COALESCE(a.dst_port_nm::TEXT,'No Aplica') AS dst_port_nm\n ,COALESCE(a.inv_no::TEXT,'No Aplica') AS inv_no\t\t\t\t\t\n ,COALESCE(a.spm_port_ntn_nm::TEXT,'No Aplica') AS spm_port_ntn_nm\t\t\t\t\t\n ,COALESCE(a.spm_port_city_nm::TEXT,'No Aplica') AS spm_port_city_nm\n ,COALESCE(a.trsp_way_nm::TEXT,'No Aplica') AS trsp_way_nm\t\t\t\t\t\n ,COALESCE(a.carr_nm::TEXT,'No Aplica') AS carr_nm\n ,COALESCE(nullif(a.vsl_nm,'')::TEXT,'No Aplica') AS vsl_nm\n ,COALESCE(nullif(a.fghnb,'')::TEXT,'No Aplica') AS fghnb\n ,COALESCE(nullif(a.oter_trsp_way_nm,'')::TEXT,'No Aplica') AS oter_trsp_way_nm\n ,COALESCE(nullif(a.ctnr_no,'')::TEXT,'No Aplica') AS ctnr_no\n ,COALESCE(nullif(a.seal_no,'')::TEXT,'No Aplica') AS seal_no\t\t\t\t\t\n ,COALESCE(CAST(round(a.prdt_tot_qt,2)AS CHARACTER VARYING)::TEXT,'No Aplica') AS prdt_tot_qt\n ,COALESCE(a.prdt_tot_qt_ut::TEXT,'No Aplica') AS prdt_tot_qt_ut\t\t\t\t\t\n ,COALESCE(CAST(round(a.prdt_tot_nwt,2)AS CHARACTER VARYING)::TEXT,'No Aplica') AS prdt_tot_nwt\n ,COALESCE(a.prdt_tot_nwt_ut::TEXT,'No Aplica') AS prdt_tot_nwt_ut\n ,COALESCE(a.dclr_rmk::TEXT,'No Aplica') AS dclr_rmk\t\t\t\t\t\n ,COALESCE(to_char(a.mdf_dt,'DD/MM/YYYY HH24:MI:SS')::TEXT,'No Aplica') AS mdf_dt\t\t\t\t\t\n FROM vue_gateway.tn_inp_033 as a \n where a.req_no='\".$req_no.\"'\"; \n $conexion=new DB();\n $row = $conexion->consultar($sql,1); \n $TnInp033=new TnInp033($row); \n return $TnInp033; \n}", "function listarReenvioFactura(){\n\t\t$this->procedimiento='vef.ft_reenvio_factura_sel';\n\t\t$this->transaccion='VF_REFACOR_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_venta', 'id_venta', 'int4');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_reenvio_factura','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_venta','int4');\n\t\t$this->captura('correo','varchar');\n\t\t$this->captura('correo_copia','varchar');\n\t\t$this->captura('observacion','text');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('estado_envio_correo','int4');\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 buscar_rango($sender, $param)\n {\n $cadena=$this->drop_rango->text; \n $desde=substr($cadena, 0, 10); \n $hasta=substr($cadena, 13); \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender); \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion muy por debajo de lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Muy por debajo de lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $muy_por_debajo=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion por debajo de lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Por debajo de lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $por_debajo=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion dentro de lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Dentro de lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $dentro_lo_esperado=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion sobre lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Sobre lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $sobre_lo_esperado=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion excepcional\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Excepcional' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $excepcional=$resultado[0]['count(*)']; \n //genera un aleatorio para asignarselo al nombre del .png del grafico\n $demo=rand(100,99999);\n //crea el grafico\n $grafico=new verticalbarchart();\n //crea un arreglo con los valores del grafico\n $datos = new XYDataSet();\n //añade elementos al arreglo que contiene los valores del grafico\n $datos->addPoint(new Point(\"Muy por debajo de lo esperado\", $muy_por_debajo));\n $datos->addPoint(new Point(\"Por debajo\", $por_debajo));\n $datos->addPoint(new Point(\"Dentro lo esperado\", $dentro_lo_esperado));\n $datos->addPoint(new Point(\"sobre lo esperado\", $sobre_lo_esperado));\n $datos->addPoint(new Point(\"Excepcional\", $excepcional));\n $grafico->setDataSet($datos);\n //pone el titulo del grafico\n $grafico->setTitle(\"Grafica de las categorías de actuación\");\n //genera el grafico\n $grafico->render(\"imagenes/temporales/\".$demo.\"_E1.png\");\n $this->grafico->ImageUrl = \"imagenes/temporales/\".$demo.\"_E1.png\";\n }", "public function buscar_hotels() {\n $ciutat = $_POST['ci'];\n $categoria = $_POST['ca'];\n $places = $_POST['pl'];\n $preu_min = $_POST['pmi'];\n $preu_max = $_POST['pma'];\n \n $usuari = session::get('idusuari');\n \n $sql = \"SELECT DISTINCT hotels.nom AS hotelnom, hotels.ciutat AS hotelciutat, hotels.categoria AS hotelcategoria,\n serveis.id AS servei_id, reserves.idusuari AS reservesidusuari, serveis.preu AS serveipreu, serveis_reservats.idreserva AS idreserva,\n reserves.status AS status, hotels.latitud AS latitud, hotels.longitud AS longitud\n\n FROM hotels \n LEFT JOIN serveis ON hotels.id = serveis.id\n LEFT JOIN serveis_reservats ON serveis.id = serveis_reservats.idservei\n LEFT JOIN reserves ON serveis_reservats.idreserva = reserves.id\n\n WHERE hotels.ciutat = '\".utf8_decode($ciutat).\"' AND serveis.nplaces >= \".$places.\" AND serveis.preu >= \".$preu_min.\" \n AND serveis.preu <= \".$preu_max.\"\";\n if($categoria != 0)\n $sql = $sql . \" AND hotels.categoria = \".$categoria.\" \";\n \n $sql = $sql . \" GROUP BY hotelnom;\";\n \n $query=$this->db->prepare($sql);\n $query->execute();\n $res=$query->fetchAll();\n \n return $res;\n }", "function SelectValuesServicios_MReferenciado($db_conx, $table, $multiple = NULL) {\r\n $sql = \"\";\r\n $script = \"\";\r\n\r\n if ($table == \"servicios\") {\r\n $sql = \"SELECT * FROM tservicios ORDER BY ser_descrip ASC\";\r\n $script = 'onchange=\"getMedicoxServicios(\\'medicos\\');\"';\r\n } else {\r\n $sql = \"SELECT * FROM tmedicoreferenciado WHERE mer_estado = 'activo' ORDER BY mer_sape ASC\";\r\n $script = 'onchange=\"getMedicoxServicios(\\'servicios\\');\"';\r\n }\r\n\r\n if ($multiple == NULL) {\r\n if ($table == \"servicios\") {\r\n $data = '<select ' . $script . ' size=\"30\" style=\"width: 90%;\" class=\"cmb' . $table . 'x\" id=\"cmb' . $table . 'x\">\r\n <option value=\"\">Ninguno</option>';\r\n } else {\r\n $data = '<select ' . $script . ' size=\"30\" style=\"width: 90%;\" class=\"cmb' . $table . '\" id=\"cmb' . $table . '\">\r\n <option value=\"\">Ninguno</option>';\r\n }\r\n } else {\r\n if ($table == \"servicios\") {\r\n $data = '<select size=\"30\" style=\"width: 90%; float:right;\" multiple=\"multiple\" class=\"cmb' . $table . '\" id=\"cmb' . $table . '\">\r\n <option value=\"\">Ninguno</option>';\r\n } else {\r\n $data = '<select size=\"30\" style=\"width: 90%; float:right;\" multiple=\"multiple\" class=\"cmb' . $table . 'x\" id=\"cmb' . $table . 'x\">\r\n <option value=\"\">Ninguno</option>';\r\n }\r\n }\r\n $c = 0;\r\n $query = mysqli_query($db_conx, $sql);\r\n $n_filas = $query->num_rows;\r\n while ($c < $n_filas) {\r\n $row = mysqli_fetch_array($query);\r\n if ($table == \"servicios\") {\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>';\r\n } else {\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[7] . \" \" . $row[8] . \" \" . $row[5] . \" \" . $row[6] . '</option>';\r\n }\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "function listarServicio(){\r\n\t\t$this->procedimiento='gev.f_tgv_servicio_sel';\r\n\t\t$this->transaccion='tgv_SERVIC_SEL';\r\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\r\n\r\n\t\t$this->setParametro('tipo_interfaz','tipo_interfaz','varchar');\t\r\n\t\t//Definicion de la lista del resultado del query\r\n\t\t$this->captura('id_servicio','int4');\r\n\t\t$this->captura('estado','varchar');\r\n\t\t$this->captura('estado_reg','varchar');\r\n\t\t$this->captura('id_lugar_destino','int4');\r\n\t\t$this->captura('id_ep','int4');\r\n\t\t$this->captura('fecha_asig_fin','date');\r\n\t\t$this->captura('fecha_sol_ini','date');\r\n\t\t$this->captura('descripcion','varchar');\r\n\t\t$this->captura('id_lugar_origen','int4');\r\n\t\t$this->captura('cant_personas','int4');\r\n\t\t$this->captura('fecha_sol_fin','date');\r\n\t\t$this->captura('id_funcionario','int4');\r\n\t\t$this->captura('fecha_asig_ini','date');\r\n\t\t$this->captura('id_usuario_reg','int4');\r\n\t\t$this->captura('fecha_reg','timestamp');\r\n\t\t$this->captura('id_usuario_mod','int4');\r\n\t\t$this->captura('fecha_mod','timestamp');\r\n\t\t$this->captura('usr_reg','varchar');\r\n\t\t$this->captura('usr_mod','varchar');\r\n\t\t$this->captura('desc_funcionario','text');\r\n\t\t$this->captura('desc_lugar_ini','varchar');\r\n\t\t$this->captura('desc_lugar_des','varchar');\r\n\t\t$this->captura('id_funcionario_autoriz','int4');\r\n\t\t$this->captura('observaciones','varchar');\r\n\t\t$this->captura('desc_funcionario_autoriz','text');\r\n\t\t\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\t\t//echo '--->'.$this->getConsulta(); exit;\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}", "function armar_consulta($pdia,$udia,$anio){\n //designaciones sin licencia UNION designaciones c/licencia sin norma UNION designaciones c/licencia c norma UNION reservas\n// $sql=\"(SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON ( m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND not exists(SELECT * from novedad t_no\n// where t_no.id_designacion=t_d.id_designacion\n// and (t_no.tipo_nov=1 or t_no.tipo_nov=2 or t_no.tipo_nov=4 or t_no.tipo_nov=5)))\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// 0 as dias_lic, case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// AND t_d.carac = t_c.id_car \n// AND t_d.uni_acad = t_ua.sigla \n// AND t_d.tipo_desig=1 \n// AND t_no.id_designacion=t_d.id_designacion\n// AND (((t_no.tipo_nov=2 or t_no.tipo_nov=5 ) AND (t_no.tipo_norma is null or t_no.tipo_emite is null or t_no.norma_legal is null))\n// OR (t_no.tipo_nov=1 or t_no.tipo_nov=4))\n// )\n// UNION\n// (SELECT distinct t_d.id_designacion, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac,t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n// sum((case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen ) as dias_lic,\n// case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n// FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n// LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n// LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n// LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n// LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n// LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n// LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n// LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n// LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n// LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n// LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n// LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n// \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n// docente as t_d1,\n// caracter as t_c,\n// unidad_acad as t_ua,\n// novedad as t_no \n// \n// WHERE t_d.id_docente = t_d1.id_docente\n// \tAND t_d.carac = t_c.id_car \n// \tAND t_d.uni_acad = t_ua.sigla \n// \tAND t_d.tipo_desig=1 \n// \tAND t_no.id_designacion=t_d.id_designacion \n// \tAND (t_no.tipo_nov=2 or t_no.tipo_nov=5) \n// \tAND t_no.tipo_norma is not null \n// \tAND t_no.tipo_emite is not null \n// \tAND t_no.norma_legal is not null\n// GROUP BY t_d.id_designacion,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\n// )\".\n //--sino tiene novedad entonces dias_lic es 0 case when t_no.id_novedad is null \n //--si tiene novedad tipo 2,5 y no tiene norma entonces dias_lic es 0\n $sql=\" SELECT distinct t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig, trim(t_d1.apellido)||', '||t_d1.nombre as docente_nombre, t_d1.legajo, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento,t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n sum(case when t_no.id_novedad is null then 0 else (case when (t_no.desde>'\".$udia.\"' or (t_no.hasta is not null and t_no.hasta<'\".$pdia.\"')) then 0 else (case when t_no.desde<='\".$pdia.\"' then ( case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_no.hasta-'\".$pdia.\"')+1) end ) else (case when (t_no.hasta is null or t_no.hasta>='\".$udia.\"' ) then ((('\".$udia.\"')-t_no.desde+1)) else ((t_no.hasta-t_no.desde+1)) end ) end )end)*t_no.porcen end) as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d \n LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\n LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo)\n LEFT OUTER JOIN novedad t_no ON (t_d.id_designacion=t_no.id_designacion and t_no.tipo_nov in (2,5) and t_no.tipo_norma is not null \n \t\t\t\t\tand t_no.tipo_emite is not null \n \t\t\t\t\tand t_no.norma_legal is not null \n \t\t\t\t\tand t_no.desde<='\".$udia.\"' and t_no.hasta>='\".$pdia.\"'),\n docente as t_d1,\n caracter as t_c,\n unidad_acad as t_ua \n WHERE t_d.id_docente = t_d1.id_docente\n AND t_d.carac = t_c.id_car \n AND t_d.uni_acad = t_ua.sigla \n AND t_d.tipo_desig=1 \n GROUP BY t_d.id_designacion,t_d.por_permuta,t_d.tipo_desig,docente_nombre,t_d1.legajo,t_d.nro_cargo,anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, cat_mapuche_nombre, cat_estat, dedic,t_c.descripcion , t_d3.descripcion , t_a.descripcion , t_o.descripcion ,t_d.uni_acad, t_m.quien_emite_norma, t_n.nro_norma, t_x.nombre_tipo , t_d.nro_540, t_d.observaciones, m_p.nombre, t_t.id_programa, t_t.porc,m_c.costo_diario, check_presup, licencia,t_d.estado \t\".\n\n \" UNION\n (SELECT distinct t_d.id_designacion,0 as por_permuta,t_d.tipo_desig, 'RESERVA'||': '||t_r.descripcion as docente_nombre, 0, t_d.nro_cargo, t_d.anio_acad, t_d.desde, t_d.hasta, t_d.cat_mapuche, t_cs.descripcion as cat_mapuche_nombre, t_d.cat_estat, t_d.dedic, t_c.descripcion as carac, t_d3.descripcion as id_departamento, t_a.descripcion as id_area, t_o.descripcion as id_orientacion, t_d.uni_acad, t_m.quien_emite_norma as emite_norma, t_n.nro_norma, t_x.nombre_tipo as tipo_norma, t_d.nro_540, t_d.observaciones, t_t.id_programa, m_p.nombre as programa, t_t.porc,m_c.costo_diario, case when t_d.check_presup=0 then 'NO' else 'SI' end as check_presup,'NO' as licencia,t_d.estado,\n 0 as dias_lic,\n case when t_d.desde<='\".$pdia.\"' then ( case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null ) then (((cast('\".$udia.\"' as date)-cast('\".$pdia.\"' as date))+1)) else ((t_d.hasta-'\".$pdia.\"')+1) end ) else (case when (t_d.hasta>='\".$udia.\"' or t_d.hasta is null) then ((('\".$udia.\"')-t_d.desde+1)) else ((t_d.hasta-t_d.desde+1)) end ) end as dias_des \n FROM designacion as t_d LEFT OUTER JOIN categ_siu as t_cs ON (t_d.cat_mapuche = t_cs.codigo_siu) \n LEFT OUTER JOIN categ_estatuto as t_ce ON (t_d.cat_estat = t_ce.codigo_est) \n LEFT OUTER JOIN norma as t_n ON (t_d.id_norma = t_n.id_norma) \n LEFT OUTER JOIN tipo_emite as t_m ON (t_n.emite_norma = t_m.cod_emite) \n LEFT OUTER JOIN tipo_norma_exp as t_x ON (t_x.cod_tipo = t_n.tipo_norma) \n LEFT OUTER JOIN tipo_emite as t_te ON (t_d.emite_cargo_gestion = t_te.cod_emite)\n LEFT OUTER JOIN departamento as t_d3 ON (t_d.id_departamento = t_d3.iddepto) \n LEFT OUTER JOIN area as t_a ON (t_d.id_area = t_a.idarea) \n LEFT OUTER JOIN orientacion as t_o ON (t_d.id_orientacion = t_o.idorient and t_o.idarea=t_a.idarea)\n LEFT OUTER JOIN imputacion as t_t ON (t_d.id_designacion = t_t.id_designacion) \n LEFT OUTER JOIN mocovi_programa as m_p ON (t_t.id_programa = m_p.id_programa) \n LEFT OUTER JOIN mocovi_periodo_presupuestario m_e ON (m_e.anio=\".$anio.\")\".\n \"LEFT OUTER JOIN mocovi_costo_categoria as m_c ON (t_d.cat_mapuche = m_c.codigo_siu and m_c.id_periodo=m_e.id_periodo),\n caracter as t_c,\n unidad_acad as t_ua,\n reserva as t_r \n \n WHERE t_d.carac = t_c.id_car \n \tAND t_d.uni_acad = t_ua.sigla \n \tAND t_d.tipo_desig=2 \n \tAND t_d.id_reserva = t_r.id_reserva \t\n )\";\n //esto es para las designaciones que tienen mas de un departamento,area,orientacion\n $sql2=\"SELECT distinct sub1.id_designacion,sub1.por_permuta,sub1.tipo_desig,sub1.docente_nombre,sub1.legajo,sub1.nro_cargo,sub1.anio_acad,sub1.desde,sub1.hasta,sub1.cat_mapuche, sub1.cat_mapuche_nombre,\n sub1.cat_estat, sub1.dedic, sub1.carac,case when sub2.id_designacion is not null then sub2.dpto else sub1.id_departamento end as id_departamento,case when sub2.id_designacion is not null then sub2.area else sub1.id_area end as id_area,case when sub2.id_designacion is not null then sub2.orientacion else sub1.id_orientacion end as id_orientacion\n , sub1.uni_acad, sub1.emite_norma, sub1.nro_norma, sub1.tipo_norma, sub1.nro_540, sub1.observaciones, sub1.id_programa, sub1.programa, sub1.porc, sub1.costo_diario, sub1.check_presup, sub1.licencia, sub1.estado, sub1.dias_lic, sub1.dias_des\n FROM (\".$sql.\")sub1\"\n . \" LEFT OUTER JOIN (select d.id_designacion,excepcion_departamento(a.id_designacion)as dpto,excepcion_area(a.id_designacion) as area,excepcion_orientacion(a.id_designacion) as orientacion\n from designacion d,dao_designa a \n where d.desde <='\".$udia.\"' and (d.hasta>='\".$pdia.\"' or d.hasta is null)\n and a.id_designacion=d.id_designacion)sub2 ON (sub1.id_designacion=sub2.id_designacion)\";\n return $sql2;\n }", "function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}", "function m_consulta($p_query){\n\t\t$this->m_seleBD();\n\t\t//echo \"<br><br>funcion m_consulta: \". $p_query .\"<br><br>\";\n\t\t$this->a_resuConsulta = mysql_query($p_query);\n\t\t//echo \"<br><br>resuConsulta: \". $this->a_resuConsulta .\"<br><br>\";\n\t\t$this->a_mensError=mysql_error();\t// si no hay error, se asigna cadena vacía a a_error\n\t\tif($this->a_mensError > \"\"){\n\t\t\t$this->a_mensError .= \" -> \" .$p_query;\n\t\t\t$this->a_bandError = true;\n\t\t}else{\n\t\t\t$this->a_bandError = false;\n\t\t\t$this->a_numRegistros = mysql_num_rows($this->a_resuConsulta);\n\t\t}\n\t}", "function mostrarDatos($resultados){\n global $CampoNombre;\n global $CampoContrasena;\n global $CampoCorreo;\n global $Repetido;\n //captura de datos \n $CampoNombre=$_POST['Camponombre'];\n $CampoContrasena=$_POST['Campocedula'];\n $CampoCorreo=$_POST['Campocorreo'];\n //echo '$CampoNombre ','$CampoContrasena ','$CampoCorreo'; \n //este if recorre todo e array que se creo con la columna correo de la bd\n if($resultados !=NULL) {//en vez de imprimir los comparo con el ingresado en formulario\n if($CampoCorreo==$resultados['Correo']){\n $Repetido=$Repetido+1;\n echo 'El correo esta repetido :( <br>'; \n } \n }//echo 'reps: ',$Repetido,\"<br>\"; \n }", "public function buscarEstudianteAcuerdo() {\n\n $sql = \"SELECT \n D.tipodocumento, D.nombrecortodocumento, EG.numerodocumento, EG.idestudiantegeneral,\n EG.nombresestudiantegeneral, EG.apellidosestudiantegeneral, EG.expedidodocumento, C.codigocarrera\n FROM \n estudiantegeneral EG\n INNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n INNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n INNER JOIN carrera C ON ( C.codigocarrera = E.codigocarrera )\n INNER JOIN FechaGrado FG ON ( FG.CarreraId = C.codigocarrera )\n INNER JOIN AcuerdoActa A ON ( A.FechaGradoId = FG.FechaGradoId )\n INNER JOIN DetalleAcuerdoActa DAC ON ( DAC.AcuerdoActaId = A.AcuerdoActaId AND E.codigoestudiante = DAC.EstudianteId )\n WHERE\n E.codigoestudiante = ?\n AND D.CodigoEstado = 100\n AND DAC.EstadoAcuerdo = 0\n AND DAC.CodigoEstado = 100\";\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n\n $fechaGrado = new FechaGrado(null);\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n\n $fechaGrado->setCarrera($carrera);\n\n $this->setTipoDocumento($tipoDocumento);\n\n $this->setFechaGrado($fechaGrado);\n }\n\n $this->persistencia->freeResult();\n }", "function multiquery ($mysqli, $query){\r\n\t\r\n\t\t$res = $mysqli->query($query);\r\n\t\treturn $res;//Devuelve los resultados de la consulta.\r\n\t\t\r\n}", "public function consultaRetorno($id_retorno, $primeiraPalavraCliente, $ultimoRetorno, $consultaUltima)\n {\n $this->logSis('DEB', 'Entrou no Retorno. idRetorno: ' . $id_retorno . ' Palavra: ' . $primeiraPalavraCliente . ' UltimoRetorno: ' . $ultimoRetorno . ' Tipo da consulta: ' . $consultaUltima['tipo']);\n\n include(\"dados_conexao.php\");\n include_once(\"horarios.php\");\n include_once(\"servicos.php\");\n\n\n\n if ($consultaUltima['tipo'] == 8) { //( Verifica se o retorno trata-se de uma marcação de horário\n\n\n //( Verifica qual o último subtipo para pesquisar o próximo retorno de acordo com o próximo subtipo\n if ($consultaUltima['subtipo'] == 'mes') {\n $proximoSubtipo = 'dia';\n } else if ($consultaUltima['subtipo'] == 'dia') {\n $proximoSubtipo = 'hora';\n } else if ($consultaUltima['subtipo'] == 'hora') { //( Envia a pergunta de confirmação\n $this->logSis('DEB', 'Entrou no subtipo Hora');\n if (is_numeric($primeiraPalavraCliente)) {\n $this->logSis('DEB', 'É número');\n\n //( Decodifica o Json que foi salvo no BD\n $opcoes = json_decode($this->opcoesVariaveis, true);\n $this->logSis('DEB', 'opcoes->' . print_r($opcoes, true));\n\n $indice = array_search($primeiraPalavraCliente, array_column($opcoes, 'ind'));\n $idHorario = $opcoes[$indice]['id'];\n $this->logSis('DEB', 'idHorario->' . $idHorario);\n\n\n //( Consulta o horário encontrado pra ver se está disponível ainda\n\n $result = fctConsultaParaArray(\n 'ConsultaHorario',\n \"SELECT *, DATE_FORMAT(horario, '%d/%m/%Y %H:%i') AS hora_formatada FROM tbl_horarios WHERE status = 1 AND horario >= NOW() AND id_horario = $idHorario\",\n array('hora_formatada')\n );\n $this->logSis('DEB', 'result->' . print_r($result, true));\n\n if ($result == false) {\n //& VEr se realmente vai ser possível escolher um outro horário\n //& Sugestão aqui seria voltar ao menu anterior\n $this->sendMessage('MensageErro', $this->numero, \"Esse horário não está mais disponível, favor escolher uma outra data.\", \"\");\n } else {\n $horaFormatada = $result[0]['hora_formatada'];\n $texto = \"CONFIRME O HORÁRIO\\n\";\n $texto .= \"*$horaFormatada*\\n\\n\";\n $texto .= \"Você confirma esse horário?\";\n\n $arrayRetorno = array(\n \"modo\" => 9, //tipo confirmação\n \"subtipo\" => 'horario',\n \"id_retorno\" => '',\n \"opcoes\" => $idHorario\n );\n\n //& Organizar o array retorno\n $this->confirmacao($texto, $arrayRetorno);\n }\n } else {\n $this->sendMessage('MensageErro', $this->numero, \"Responda somente com o número referente à opção desejada.\", \"\");\n }\n }\n\n //( Faz a pesquisa do retorno\n $sql = \"SELECT * FROM tbl_retornos WHERE tipo = 8 AND coringa = '$proximoSubtipo'\";\n } else if ($consultaUltima['tipo'] == 9) { //( Uma solicitação de confirmação\n\n //( Verifica que é uma confirmação de horário \n if ($consultaUltima['subtipo'] == 'horario') {\n\n //( Verifica se tem SIM ou NÃO na mensagem do cliente\n $nao = $this->verficaPalavras('', $this->mensagem, array('não', 'nao', 'NÃO', 'Nao', 'NAO', 'NO', 'no'));\n $sim = $this->verficaPalavras('', $this->mensagem, array('sim', 'Sim', 'Si', 'si', 'SI', 'sin', 'Sin', 'SIN', 'SIM'));\n\n\n if ($nao == 1) { //( Se tiver NÃO, é enviada o MENU RAIZ \n $this->envioMenuRaiz($this->numero, \"*OPERAÇÃO CANCELADA*\\n\\n\");\n } else if ($sim == 1) { //( Se tiver SIM, é reservado o horário\n $this->reservaHorario($this->opcoesVariaveis);\n } else { //( Se na mensagem não tem nem SIM nem Não, é enviado a mensagem de erro dizendo que não entendeu\n $this->sendMessage('MensageErro', $this->numero, \"Não compreendi a sua resposta, favor responder exatamente como foi solicitado.\", \"\");\n }\n }\n } else if ($id_retorno == '') { //ou seja, não sei qual o retorno\n $sql = \"SELECT * FROM tbl_retornos WHERE id_retorno = (SELECT resposta FROM tbl_opcoes WHERE id_instancia = $this->idInstancia AND indice = '$primeiraPalavraCliente' AND id_retorno = $ultimoRetorno)\";\n } else { //Sei qual o retorno atual\n //$idInstancia = $this->idInstancia;\n $sql = \"SELECT * FROM tbl_retornos WHERE id_instancia = $this->idInstancia AND id_retorno = $id_retorno\";\n }\n\n $this->logSis('DEB', $sql);\n\n $query = mysqli_query($conn['link'], $sql);\n $consultaRetorno = mysqli_fetch_array($query, MYSQLI_ASSOC);\n $this->logSis('DEB', 'Sql: ' . $sql . ' consultaRetorno->' . print_r($consultaRetorno, true));\n\n $numRow = mysqli_num_rows($query);\n if (!$query) {\n $this->logSis('ERR', 'Mysql Connect: ' . mysqli_error($conn['link']));\n exit(0);\n }\n if ($numRow == 0) { //VERIFICA SE EXISTE NO BANCO DE DADOS\n $this->logSis('ERR', 'Não encontrou a mensagem inicial Instância. Instância: ' . $this->idInstancia);\n exit(0);\n } else {\n\n //& VERIFICAR AQUI SE VAI TER AMBIGUIDADE COM A PRIMEIRA CONSULTA \n $id_retorno = $consultaRetorno['id_retorno']; //ID da tabela retorno (chave)\n $mensagem = utf8_encode($consultaRetorno['mensagem']);\n //Consulta das opções\n $sql = \"SELECT * FROM tbl_opcoes WHERE listavel = 1 AND id_instancia = $this->idInstancia AND id_retorno = $id_retorno ORDER BY indice ASC\";\n $this->logSis('DEB', $sql);\n\n $query = mysqli_query($conn['link'], $sql);\n $numRow = mysqli_num_rows($query);\n\n //Teste DEploy\n if ($numRow != 0) {\n $mensagem .= \"\\n\";\n while ($opcao = mysqli_fetch_array($query)) {\n $mensagem .= '*' . $opcao['indice'] . '.* ' . utf8_encode($opcao['mensagem']) . \"\\n\";\n }\n if ($consultaRetorno['modo'] == 1 && $consultaRetorno['id_retorno'] != $this->menuRaiz) {\n $mensagem .= \"*0.* Voltar ao menu anterior\\n\";\n }\n }\n\n $retorno = array(\n 'id_retorno' => $consultaRetorno['id_retorno'],\n 'nome' => $consultaRetorno['nome'],\n 'modo' => $consultaRetorno['modo'],\n 'tipo' => $consultaRetorno['tipo'],\n 'coringa' => $consultaRetorno['coringa'], //para tipo 6 (Inclusão lista) -> lista_X\n 'mensagem' => $mensagem,\n 'url' => $consultaRetorno['url'],\n 'lat' => $consultaRetorno['lat'],\n 'lng' => $consultaRetorno['lng'],\n 'name' => $consultaRetorno['name'],\n 'address' => $consultaRetorno['address']\n );\n $this->logSis('DEB', 'Retorno->' . print_r($retorno, true));\n\n return $retorno;\n }\n }", "public function readAllInfo()\n {\n //recupération des données en post\n $data = $this->request->data;\n try\n {\n //selection d'une UE en foction de l'identifiant\n if (!empty($data['id_matiere'])) {\n $results = $this->model->read_all_info_id((int)$data['id_matiere']);\n\n if (empty($results)) {\n $this->_return('la matière demandée n\\'existe pas dans la base de donnée', false);\n }\n $this->_return('Informations sur la matière '.$results->nom_matiere.' ', true, $results);\n }\n //selection de toutes les UE d'enseignement\n $results = $this->model->read_all_info_matiere();\n if (empty($results)) {\n $this->_return('Vous n\\'avez pas encore de matière en base de données', false);\n }\n $this->_return('liste des matières disponibles dans la base de données', true, $results);\n }\n catch(Exception $e)\n {\n $this->_exception($e);\n }\n }", "function consulta1($query){\n $resultado=mysql_query($query);\n $ca=mysql_num_rows($resultado);\n for($i=0;$ca>$i;$i++){\n \t$arreglo[]=mysql_fetch_assoc($resultado);\n }\n $devolver[\"resultante\"]=$arreglo;\n $devolver[\"contador\"]=$ca;\n return $devolver;\n }", "function listarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_sel';\n\t\t$this->transaccion='SNX_MAQ_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_maquinaria','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('potencia','numeric');\n\t\t$this->captura('peso','numeric');\t\t\n\t\t$this->captura('maquinaria','varchar');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('valor','numeric');\n\t\t$this->captura('valormat','numeric');\n\t\t$this->captura('id_factorindexacion','int4');\n\t\t$this->captura('desc_factorindexacion','varchar');\n\t\t$this->captura('id_tipopreciomaquinaria','int4');\n\t\t$this->captura('tipopreciomaquinaria','varchar');\n\t\t$this->captura('id_ambitoprecio','int4');\n\t\t$this->captura('ambitoprecio','varchar');\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}", "function getResult(){\n\t\t\n\t\t$cx\t\t= new Connexion();\n\t\t$managerVisuel\t= new ManagerVisuel($cx);\n\t\t$managerLike\t= new ManagerLike($cx);\n\t\t$managerFavoris\t= new ManagerFavoris($cx);\n\n\t\t$transformDate = new DateTimeTransform();\n\n\t\t$http = new HTTPRequest();\n\t\t$offset = $http->getDataPost('offset');\n\t\t$values = $http->getDataPost('select');\n\t\t$exp = explode(\",\", $values);\n\n\t\tforeach ($exp as $value) {\n\t\t\tif(preg_match('/^theme-/', $value)){\n\t\t\t\t$theme[] = preg_replace('/[a-zA-Z-]/', '', $value);\n\t\t\t}\n\t\t\tif(preg_match('/^logiciel-/', $value)){\n\t\t\t\t$log[] = preg_replace('/[a-zA-Z-]/', '', $value);\n\t\t\t}\n\t\t}\n\t\tif(isset($theme)){\n\t\t\t$themes = implode(',', $theme);\n\t\t}\n\t\tif(isset($log)){\n\t\t\t$logs = implode(',', $log);\n\t\t}\n\t\t\n\t\t\n\n\t\tif((isset($themes)) || (isset($logs))){\n\n\t\t\tif(!isset($logs)){\n\t\t\t\t$tabVisuChaine = $managerVisuel->selectVisuelsAndChainesByThemes($offset,$themes);\n\t\t\t}else if(!isset($themes)){\n\t\t\t\t$tabVisuChaine = $managerVisuel->selectVisuelsAndChainesByLogs($offset,$logs);\n\t\t\t}else{\n\t\t\t\t$tabVisuChaine = $managerVisuel->selectVisuelsAndChainesByCat($offset,$themes,$logs);\n\t\t\t}\n\n\t\t}else{\n\t\t\t$tabVisuChaine = $managerVisuel->selectVisuelsAndChaines($offset);\n\t\t}\n\n\t\tif(!is_null($tabVisuChaine)){\n\t\t\tforeach ($tabVisuChaine as $visuel) {\n\n\t\t\t\t$visuel->{'3'} = $transformDate->transformDateTime($visuel->{'3'});\n\t\t\t\tif(isset($_SESSION['auth'])){\n\t\t\t\t\t$like = $managerLike->likePostExist($_SESSION['auth'][\"id\"],$visuel->getIdVisuel());\n\t\t\t\t\t$fav = $managerFavoris->favorisVisuelExist($_SESSION['auth'][\"id\"],$visuel->getIdVisuel());\n\t\t\t\t\t$tabLike[] = $like;\n\t\t\t\t\t$tabFav[] = $fav;\n\t\t\t\t}\n\t\t\t\t$countLikes[] = $managerLike->countLikeVisuel($visuel->getIdVisuel());\n\t\t\t}\n\t\t\tif(isset($_SESSION['auth'])){\n\t\t\t\t$result[\"user\"] = $_SESSION['auth']['id'];\n\t\t\t\t$result[\"favoris\"] = $tabFav;\n\t\t\t\t$result[\"likes\"] = $tabLike;\n\t\t\t}\n\t\t\t$result[\"countLikes\"] = $countLikes;\n\t\t\t$result[\"visu\"] = $tabVisuChaine;\n\t\t}else{\n\t\t\t$result[\"visu\"] = \"Aucun visuel trouvé\";\n\t\t}\n\t\t$cx->close();\n\t\techo json_encode($result);\n\t\texit();\n\t}", "public function BuscarClientesAbonos() \n{\n\tself::SetNames();\n\t$sql =\"SELECT \n\tventas.idventa, ventas.codventa, ventas.totalpago, ventas.fechavencecredito, ventas.statusventa, ventas.fechaventa, abonoscreditos.fechaabono, SUM(abonoscreditos.montoabono) as abonototal, clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.emailcliente, cajas.nrocaja\n\tFROM\n\t(ventas LEFT JOIN abonoscreditos ON ventas.codventa=abonoscreditos.codventa) LEFT JOIN clientes ON \n\tclientes.codcliente=ventas.codcliente LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja WHERE ventas.codcliente = ? AND ventas.tipopagove ='CREDITO' GROUP BY ventas.codventa\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_GET[\"codcliente\"]) );\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"<div class='alert alert-danger'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN CREDITOS DE VENTAS PARA EL CLIENTE INGRESADO</center>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\twhile($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}", "function carregarDadosEquip($idSimEquip){\n\n // CRIA UM OBJETO DE DA CLASSE DE CONEXAO\n $connBase = new EficazDB;\n\n // $query = \"SELECT equip.nomeEquipamento, equip.modelo, tipoEquip.tipo_equipamento, simEquip.ambiente,clieInfo.nome AS ´cliente´, fili.nome AS 'filial'\n // FROM tb_equipamento equip\n // JOIN tb_sim_equipamento simEquip ON equip.id = simEquip.id_equipamento\n // JOIN tb_cliente clieInfo ON clieInfo.id = equip.id_cliente\n // LEFT JOIN tb_filial fili ON equip.id_filial = fili.id_matriz\n // JOIN tb_tipo_equipamento tipoEquip ON equip.tipo_equipamento = tipoEquip.id\n // WHERE simEquip.id = '$idSimEquip'\";\n\n // $query = \"SELECT equip.nomeEquipamento, equip.modelo, tipoEquip.tipo_equipamento, simEquip.ambiente,clieInfo.nome AS 'cliente', fili.nome AS 'filial'\n // FROM tb_equipamento equip\n // JOIN tb_sim_equipamento simEquip ON equip.id = simEquip.id_equipamento\n // JOIN tb_cliente clieInfo ON clieInfo.id = equip.id_cliente\n // LEFT JOIN tb_filial fili ON equip.id_filial = fili.id_matriz\n // JOIN tb_tipo_equipamento tipoEquip ON equip.tipo_equipamento = tipoEquip.id\n // WHERE simEquip.id = '$idSimEquip'\";\n\n //QUERY ATUALIZADA\n\n $query = \"SELECT equip.nomeModeloEquipamento, tipoEquip.tipo_equipamento, simEquip.ambiente, clieInfo.nome AS 'cliente', fili.nome AS 'filial'\n FROM tb_equipamento equip\n JOIN tb_sim_equipamento simEquip ON equip.id = simEquip.id_equipamento\n JOIN tb_cliente clieInfo ON clieInfo.id = equip.id_cliente\n LEFT JOIN tb_filial fili ON equip.id_filial = fili.id_matriz\n JOIN tb_tipo_equipamento tipoEquip ON equip.tipo_equipamento = tipoEquip.id\n WHERE simEquip.id = '$idSimEquip'\";\n\n // Monta a result\n $result = $connBase->select($query);\n\n // Verifica se existe valor de retorno\n if (@mysql_num_rows ($result) > 0)\n {\n /* ARMAZENA NA ARRAY */\n while ($row = @mysql_fetch_assoc ($result))\n {\n $retorno[] = $row;\n }\n\n }else{\n // Se nao existir valor de retorno\n // Armazena 0 no vetor\n $retorno[] = 0;\n }\n\n // Fecha a conexao\n $connBase->close();\n\n return $retorno;\n}" ]
[ "0.6803096", "0.65269756", "0.63736147", "0.63475484", "0.63384867", "0.6332289", "0.6313488", "0.6292143", "0.6145638", "0.60941726", "0.60836047", "0.6021482", "0.59683466", "0.5960811", "0.59554625", "0.5945844", "0.59204644", "0.5917565", "0.5894087", "0.5890949", "0.5878784", "0.5875245", "0.58716226", "0.5858188", "0.5849394", "0.58481747", "0.58355325", "0.5826389", "0.5821542", "0.58130074", "0.58095914", "0.5805586", "0.5801981", "0.5795951", "0.57939917", "0.579222", "0.57875806", "0.57870096", "0.57725525", "0.5772474", "0.5770479", "0.57613873", "0.5752306", "0.5743726", "0.57275707", "0.5724978", "0.5713468", "0.5706279", "0.5704216", "0.5701246", "0.56962997", "0.56962353", "0.5694747", "0.5688871", "0.5687819", "0.56808156", "0.56767386", "0.56641954", "0.56453234", "0.56426585", "0.56414664", "0.56278855", "0.56254435", "0.56244606", "0.5618055", "0.56115603", "0.5608838", "0.5593986", "0.55936867", "0.5587821", "0.5580603", "0.55795205", "0.55740225", "0.5572852", "0.5572587", "0.5566115", "0.5563056", "0.5560366", "0.5558235", "0.5556535", "0.5547524", "0.5545558", "0.5541095", "0.55355245", "0.55304235", "0.55275524", "0.5523771", "0.5519237", "0.55075395", "0.5505647", "0.5500861", "0.5500196", "0.5490903", "0.5489761", "0.5486651", "0.5486112", "0.548228", "0.54795146", "0.5479086", "0.5478861", "0.54785573" ]
0.0
-1
Ejecuta una sentencia sql. Ej: insert, update en caso de insert la variable $isInsert debe estar en true para devolver el id insertado no olvidar agregar select last_insert_id() en la sentencia de insert
public function execute($sql, $isInsert = false){ $connection = $this->connect(); try{ $connection->query($sql); if($isInsert){ $id = $connection->insert_id; return $id; }else{ return true; } }catch(Exception $e){ $mensaje = "Ha ocurrido un error: " . $e; $logger = Logger::getRootLogger(); $logger->error($mensaje); throw new Exception($mensaje); }finally{ $connection->close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeInsert($script) {\n\t\t$queryRes = mysqli_query($this->connectionString, $script);\n\t}", "private function Execute(){\n $this->Connect();\n\n try{\n $this->Create->execute($this->Dados);\n $this->Result = $this->Conn->lastInsertId();\n $this->StatusInsert = true;\n\n }catch (PDOException $e){\n $this->Result = null;\n WSErro(\"<b>Erro ao cadastrar:</b> {$e->getMessage()}\", $e->getCode());\n }\n }", "protected function execute_single_query() {\n\t\t//ejecución de un single command\n\t\t$this->crear_conexion();\n\t\t//cambiar el charset\n\t\t$this->set_charset();\n\t\t\n\t\t//$this->conn->query($this->query);\n\t\tif (!$this->conn->query($this->query)) {\n\t\t\tdie($this->conn->error . $this->query);\n\t\t\t$this->mensaje_db = $this->conn->error . $this->query;\n\t\t\treturn FALSE;\n\t\t}\n\t\t//return $conn->insert_id;\t\t\n\t\t$this->cerrar_conexion();\n\t\treturn TRUE;\n\t}", "public function execute()\n {\n if (isset($this->preparedQuery))\n {\n $result = $this->preparedQuery->execute();\n\n if ($result === false)\n {\n die('Execute() failed: ' . htmlspecialchars($this->preparedQuery->error));\n }\n\n $this->lastInsertId = $this->connection->insert_id;\n\n return true;\n }\n\n return false;\n }", "public function ejecutar($sql){\r\n $sql=trim($sql);\r\n if(empty($sql))\r\n throw new Exception(\"La sentencia de ejecucion esta vacia\");\r\n\r\n $resultado=mysql_query ($sql, $this->conexion);\r\n if($resultado===FALSE)\r\n throw new Exception(\"No fue posible ejecutar $sql\");\r\n\r\n return $this->getUltimoId();\r\n }", "static function execute($sql,$values,$types=null) {\n\t\t$stmt = self::prepareCommand($sql,$values,$types);\n\t\tif(strpos(strtolower(trim($sql)),'insert')===0) {\n\t\t\treturn $stmt->insert_id;\n\t\t}\n\t\treturn $stmt->affected_rows;\n\t}", "protected static function execute_insert($parametros){\n self::StartTrans();\n try {\n $tabla=strtolower(static::$prefijo_tabla.get_called_class());\n if(ACTIVAR_LOG_APACHE_DE_CONSULTAS_SQL) \n Logger::developper('INSERT '.$tabla.' VALUES '.static::$id_tabla.'='.$parametros['id'], 0);\n $tiempo_inicio=microtime(true);\n $result=self::$conection->AutoExecute($tabla, $parametros, 'INSERT');\n if($result) $resultado=true;\n else $resultado=false;\n $duracion=microtime(true)-$tiempo_inicio;\n// if($resultado) $resultado=Gestor_de_log::set_auto('INSERT',$tabla,static::$id_tabla,$parametros, $resultado,$duracion);\n\n } catch (Exception $e) {\n $resultado=false;\n error_log($e->getMessage());\n }\n self::CompleteTrans();\n if($resultado){\n return $result;\n }\n return false; \n }", "public function Insert() // Inaczej !!! \n\t\t{\n\t\t\t$result = mysqli_query($this->link, $this->task);\n\t\t\treturn mysqli_affected_rows($this->link).\" line affected by SELECT\\n\\n\";\n\t\t}", "public function submit()\n\t{\n\t\t$identifier = $this->sql_id_field;\n\n\t\tif (!$this->$identifier)\n\t\t{\n\t\t\treturn $this->insert();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->update();\n\t\t}\n\t}", "function ejecutar($sql){\n\t\t$res = mysqli_query($this->id,$sql);\t\n\t\t/*if (!$res) // error en la sentencia\n\t\t\tthrow new Exception (\"Error en la sentencia SQL\");*/\n\t\treturn $res;\n\t}", "function postStatic($conn, $sql){\n\t\t\tif($conn->query($sql) === TRUE){\n\t\t\t\t$last_id = $conn->insert_id;\n\t\t\t\treturn $last_id;\n\t\t\t} else {\n\t\t\t\techo \"Error:\" . $sql . \"<br\" . $conn->error;\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}", "public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}", "function insert( $sql ){\n\t\tif( $this->db == null ){\n\t\t\treturn false;\n\t\t}\n\t\t$insert_id = $this->db->query( $sql );\n\n\t\treturn $insert_id;\n\t}", "public function execute()\n {\n $platform = $this->connection->getDatabasePlatform();\n\n if (method_exists($platform, 'getInsertMaxRows')) {\n $insertMaxRows = $platform->getInsertMaxRows();\n } else {\n $insertMaxRows = 0;\n }\n\n if ($insertMaxRows > 0 && count($this->values) > $insertMaxRows) {\n throw new \\LogicException(\n sprintf(\n 'You can only insert %d rows in a single INSERT statement with platform \"%s\".',\n $insertMaxRows,\n $platform->getName()\n )\n );\n }\n\n return $this->connection->executeUpdate($this->getSQL(), $this->parameters, $this->types);\n }", "public function insert( )\n {\n $sql_insert_string = $this->formatInsertCommand( );\n if ( $sql_insert_string == false )\n return false;\n\n $l_result = $this->query( $sql_insert_string );\n $this->clearDataBuffer( );\n if($l_result)\n return @mysql_insert_id(underQL::$db_handle);\n\n return false;\n }", "public function Ejecutar($sql){\n \t\t$objMySQL = new mysqli($this->_servidor, $this->_usuario,\n $this->_clave, $this->_basedatos);\n\t\tif (!$sentenciaSQL = $objMySQL->query($sql)){\n\t\t\t$this->errorBD = \"<b>AccesoBD->Ejecutar: </b>\".$objMySQL->error;\n\t\t\techo $this->errorBD;\n\t\t}\n\t}", "public function execute() { \n return $this -> stmt -> execute();\n }", "public function execute($sql);", "public function execute($sql);", "function insert_update_exec($sql){\n\t$conn = connect();\n\n\tif(($statement = oci_parse($conn, $sql)) == false){\n\t\t$err = oci_error($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\n\t$exec = oci_execute($statement);\n\n\tif(!$exec){\n\t\t$err = oci_error($statement);\n\t\toci_free_statement($statement);\n\t\techo htmlentities($err['message']);\n\t\toci_close($conn);\n\t\treturn FALSE;\n\t}\n\toci_commit($conn);\n\toci_free_statement($statement);\n\toci_close($conn);\n\techo \"Success \";\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}", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "function execSqlId($query) {\n if ($result = mysql_query($query, $this->linkDatabaseSrc)) {\n $result=mysql_insert_id();\n return $result;\n } else {\n return 0;\n }\n }", "private function sql($sql) {\r\n $this->query = $sql;\r\n $this->log($this->query);\r\n if(!$result = mysql_query($this->query)){throw new Exception(mysql_error());}\r\n if (strpos($sql, 'REPLACE') !== false || strpos($sql, 'INSERT') !== false) {\r\n return mysql_insert_id();\r\n } else {\r\n return $result;\r\n }\r\n }", "public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }", "public function execute()\n\t{\n\t\t$this->mutator = $this->mutator_open($this->ns, $this->table, NULL, 0);\n\t\t$insert = $this->mutator_set_cells($this->mutator, $this->cells); \n\t\t$this->mutator_flush($this->mutator);\n\t\t$this->mutator_close($this->mutator);\n\t\t$this->table = NULL;\n\t\t$this->cells = array();\n\t\treturn $insert;\n\t}", "public function Insert(){\r\n $query = \"INSERT INTO \". $this->_table_name .\"(ITEM_ID , USER_ITEM_ID , USER_FROM , USER_TO , TOO , IO_TYPE , MODE , TRANK_NO , PERMIT_ID , TYPE , NOTE , IN_UNIT , IN_SUBUNIT , LONGDATE , STATUS , CREATE_ON , CREATE_BY , MODIFY_ON , MODIFY_BY , IS_ACTIVE) \r\n VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?) \" ; \r\n $success = 0;\r\n try{\r\n $stmt = $this->conn->prepare($query);\r\n $stmt->bindParam (1 , $this->getItemId()); \r\n $stmt->bindParam (2 , $this->getUserItemId()); \r\n $stmt->bindParam (3 , $this->getUserFrom()); \r\n $stmt->bindParam (4 , $this->getUserTo()); \r\n $stmt->bindParam (5 , $this->getToo()); \r\n $stmt->bindParam (6 , $this->getIoType()); \r\n $stmt->bindParam (7 , $this->getMode()); \r\n $stmt->bindParam (8 , $this->getTrankNo()); \r\n $stmt->bindParam (9 , $this->getPermitId()); \r\n $stmt->bindParam (10 , $this->getType()); \r\n $stmt->bindParam (11 , $this->getNote()); \r\n $stmt->bindParam (12 , $this->getInUnit()); \r\n $stmt->bindParam (13 , $this->getInSubunit()); \r\n $stmt->bindParam (14 , $this->getLongdate()); \r\n $stmt->bindParam (15 , $this->getStatus()); \r\n $stmt->bindParam (16 , $this->getCreateOn()); \r\n $stmt->bindParam (17 , $this->getCreateBy()); \r\n $stmt->bindParam (18 , $this->getModifyOn()); \r\n $stmt->bindParam (19 , $this->getModifyBy()); \r\n $stmt->bindParam (20 , $this->getIsActive()); \r\n\r\n $stmt->execute(); \r\n $this->setId($this->conn->lastInsertId());\r\n $success = 1;}\r\n catch(PDOException $ex){ echo $ex->getMessage(); } \r\n return $success;}", "protected function execute_single_query() {\n\t\tif($_POST) {\n\t\t\t$this->open_connection();\n\t\t\t$this->conn->query($this->query);\n\t\t\t\n\t\t} else {\n\t\t\t$this->mensaje = 'Metodo no permitido';\n\t\t}\n\t}", "public function execute() {\n $lastImplementaion = '';\n $finalWhere = ( count($this->_lastWhere) > 0) ? ' WHERE ' . join($this->_currentImplement['where'], ' ' ) : '';\n $finalLimit = ( strlen($this->_lastLimit) > 0 ) ? ' lIMIT ' . $this->_lastLimit : '';\n\n if ( !empty($this->_lastSelect) ) {\n $finalSelect = ' SELECT ' . join( $this->_currentImplement['select'], ',' );\n\n $finalTables = ' FROM ' . join( array_map(function($item ){\n return '`'.$item.'`';\n }, $this->_currentImplement['table']), ',');\n\n $finalOrder = ( strlen($this->_lastOrder) > 0 ) ? ' ORDER BY ' . $this->_lastOrder : '';\n\n $finalJoin = '';\n\n if ( isset($this->_currentImplement['join']) && count($this->_currentImplement['join']) > 0 ) {\n foreach ( $this->_currentImplement['join'] as $key => $value ) {\n $finalJoin[] = ' ' . $value['type'] . ' JOIN `' . $value['table'] . '`' . ' ON ' . $value['on'];\n }\n\n $finalJoin = join( $finalJoin, ' ' );\n }\n\n $lastImplementaion = $finalSelect . $finalTables . $finalJoin . $finalWhere . $finalOrder . $finalLimit;\n } else if ( !empty($this->_lastUpdate) ) {\n if(empty($finalWhere)){\n throw new Exception(\"If you preform this query, you will update all rows in table\", 1);\n }\n\n $lastImplementaion = 'UPDATE ' . $this->_lastTable . ' SET ' . $this->_lastUpdate . $finalWhere . $finalLimit;\n } else if ( !empty($this->_lastInsert) ) {\n $lastImplementaion = 'INSERT INTO `' . $this->_lastTable . '` ' . $this->_lastInsert;\n } else if ( !empty($this->_lastCreate) ) {\n $lastImplementaion = $this->_lastCreate;\n } else if ( !empty($this->_lastDrop) ) {\n $lastImplementaion = $this->_lastDrop;\n }else if( !empty($this->_lastTruncate) ){\n $lastImplementaion = $this->_lastTruncate;\n }else if( !empty($this->_lastDelete) ) {\n if(empty($finalWhere)){\n throw new Exception(\"If you preform this query, you will delete all rows in table, if you want so user truncate() instead.\", 1);\n }\n\n $lastImplementaion = $this->_lastDelete . $finalWhere . $finalLimit;\n }\n\n $lastImplementaion = trim( $lastImplementaion );\n $this->unsetAll();\n\n unset( $this->_currentImplement );\n unset( $finalSelect );\n unset( $finalTables );\n unset( $finalJoin );\n unset( $finalWhere );\n unset( $finalOrder );\n unset( $finalLimit );\n return $lastImplementaion;\n }", "public function save() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query=\"UPDATE \";\t\n\t\t\tfor ($i=0; $i<count($this->originalData); $i++) {\n\t\t\t\tif (!isset($this->modifiedData)) {\n\t\t\t\t\t$this->modifiedData = $this->originalData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$query=\"INSERT INTO \";\n\t\t}\n\t\t$query.=$this->table.' SET ';\n\t\tforeach ($this->modifiedData as $key=>$value) {\n\t\t\t$value = mysqli_real_escape_string($this->connection->connection,$value);\n\t\t\t$query.= '`'.$key .\"`='\".$value.'\\',';\n\t\t}\n\t\t$query = substr($query,0,-1);\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query.=' WHERE '.self::$primaryKey[$this->table].'=\\''.$this->originalData[self::$primaryKey[$this->table]].\"'\";\n\t\t}\n\t\t$this->connection->query($query);\n\t\tif ($this->connection->getError()) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($this->originalData)) {\n\t\t\t$this->originalData[self::$primaryKey[$this->table]] = $this->connection->getInsertID();\n\t\t}\n\t\t$this->originalData = array_merge($this->originalData,$this->modifiedData);\n\t\treturn true;\n\t}", "public function execute()\n {\n $this->dbStmt->execute();\n return true;\n }", "public function executeStatement()\n {\n \n }", "final public function save() {\n\t\t$table_id = $this::TABLE_ID;\n\t\tif (strlen ( $this->$table_id ) != 0) {\n\t\t\treturn $this->update ();\n\t\t}\n\t\t\n\t\tif ($this::USR_CREATE_ID != 'undefined') {\n\t\t\t$usrid = PwConnexion::getInstance ()->getUserId ();\n\t\t\t$colUsrId = $this::USR_CREATE_ID;\n\t\t\t$this->$colUsrId = $usrid;\n\t\t}\n\t\t\n\t\tif ($this::USR_CREATE_DATE != 'undefined') {\n\t\t\t$objDateTime = new DateTime ( 'NOW' );\n\t\t\t$colUsrDat = $this::USR_CREATE_DATE;\n\t\t\t$usrid = PwConnexion::getInstance ()->getUserId ();\n\t\t\t$this->$colUsrDat = $objDateTime->format ( \"Y-m-d H:i:s\" );\n\t\t}\n\t\t\n\t\t$this->$table_id = \"\";\n\t\t\n\t\t$row = $this->getSqlRow ();\n\t\t$k = 0;\n\t\t$filds = \"\";\n\t\tforeach ( $row as $key => $value ) {\n\t\t\tif ($k == 0)\n\t\t\t\t$sep = \" \";\n\t\t\telse\n\t\t\t\t$sep = \",\";\n\t\t\t$filds = $filds . $sep . $key;\n\t\t\t$k = 1;\n\t\t}\n\t\t$k = 0;\n\t\t$values = \"\";\n\t\tforeach ( $row as $key => $value ) {\n\t\t\tif ($k == 0)\n\t\t\t\t$sep = \" \";\n\t\t\telse\n\t\t\t\t$sep = \",\";\n\t\t\t$values = $values . $sep . \"'\" . $value . \"'\";\n\t\t\t$k = 1;\n\t\t}\n\t\t$cmd = \"insert into \" . $this::TABLE_NAME . \"(\" . $filds . \")values(\" . $values . \");\";\n\t\t$rid = \"\";\n\t\ttry {\n\t\t\t$stmt = PwPDO::getInstance ( PwPDO::DB_0 )->prepare ( $cmd );\n\t\t\t$stmt->execute ();\n\t\t\t$rid = PwPDO::getInstance ( PwPDO::DB_0 )->lastInsertId ();\n\t\t} catch ( Exception $e ) {\n\t\t\tPwDebug::debug ( $e->getMessage (), $cmd );\n\t\t\tPwDebug::debugInLogFile ( $e->getMessage () . \" \" . $cmd );\n\t\t\treturn 0;\n\t\t}\n\t\treturn PwPDO::getInstance ( PwPDO::DB_0 )->lastInsertId ();\n\t}", "protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }", "protected function execute()\n{\n\t$this->result = $this->db->query($this->getSql());\n\t$this->position = 0;\n\t$this->data = array();\n\n\treturn $this->result;\n}", "function executeQuery($sql, $params, $isInsert = false){\n\t\ttry{\n\t\t\t$query = $this->dbconn->prepare($sql);\n\t\t\tif($isInsert){\n\t\t\t\tforeach ($params as $key => $value){\n\t\t\t\t\tif($value === true){\n\t\t\t\t\t\t$query->bindValue($key+1, $value, PDO::PARAM_INT);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$query->bindValue($key+1, $value);\n\t\t\t\t\t}\n\t\t\t\t\tunset($params[$key]);\n\t\t\t\t}\n\t\t\t\t$query->execute();\n\t\t\t}else {\n\t\t\t\t$query->execute($params);\n\t\t\t}\n\t\t}catch (Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $query;\n\t}", "function insert($sql) {\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\t$statement = $this->execute($sql, $args);\n\t\treturn $this->pdo->lastInsertId();\n\t}", "function put($sql){\n $conn=getconn();\n if($conn->query($sql)===TRUE){\n return array('status'=>true,'id'=>$conn->insert_id);\n }else{\n return array('status'=>false,'error'=>$conn->error);\n }\n }", "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}", "public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\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 insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }", "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}", "public function __doSave()\n {\n $_SESSION[\"logger\"]->info(get_class($this) . '->__doSave');\n $_SESSION[\"logger\"]->info($this->toDebugStr());\n\n if (!$this->__exists()) {\n $strSQL = $this->getInsertSql();\n } else {\n $strSQL = $this->getUpdateSql();\n }\n $result = $this->query($strSQL);\n\n return $result;\n }", "abstract public function execute($sql);", "function performSQLInsert($sql) {\n $conn = $GLOBALS[\"connection\"];\n $result = mysqli_query($conn, $sql);\n if (!$result) {\n printCallstackAndDie();\n }\n return mysqli_insert_id($conn);\n}", "public abstract function execute($sql);", "public function execute($sql){\n\t\tif ($this->conn->query($sql)) {\n//\t\t\treturn $this->conn->query($sql)->fetch_assoc();\n//\t\t\treturn $this->conn->insert_id;\n//\t\t\treturn $this->conn->query($sql);\n\t\t\treturn $this->conn;\n\t\t} else {\n\t\t\tdie('Error: ' . $sql . '<br>' . $this->conn->error);\n\t\t}\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 }", "public function execute()\n {\n if (!$this->sessionSet && $this->platform instanceof MySqlPlatform) {\n $this->connection->exec(\"SET @@SESSION.sql_mode = '';\");\n $this->sessionSet = true;\n }\n\n // Take a local copy so that we don't modify the original query and cause issues later\n $query = $this->replacePrefix((string) $this->sql);\n\n if (!($this->sql instanceof \\JDatabaseQuery) && ($this->limit > 0 || $this->offset > 0)) {\n // @TODO\n if ($this->offset > 0) {\n $query .= ' LIMIT ' . $this->offset . ', ' . $this->limit;\n } else {\n $query .= ' LIMIT ' . $this->limit;\n }\n }\n\n $this->prepared = $this->connection->prepare($query);\n\n // Increment the query counter.\n $this->count++;\n\n // Reset the error values.\n $this->errorNum = 0;\n $this->errorMsg = '';\n $memoryBefore = null;\n\n // If debugging is enabled then let's log the query.\n if ($this->debug) {\n // Add the query to the object queue.\n $this->log[] = $query;\n\n \\JLog::add($query, \\JLog::DEBUG, 'databasequery');\n\n $this->timings[] = microtime(true);\n }\n\n // Execute the query.\n $this->executed = false;\n $previous = null;\n\n if ($this->prepared instanceof Statement) {\n // Bind the variables:\n if ($this->sql instanceof JDatabaseQueryPreparable) {\n $bounded = $this->sql->getBounded();\n\n foreach ($bounded as $key => $obj) {\n $this->prepared->bindParam($key, $obj->value, $obj->dataType, $obj->length, $obj->driverOptions);\n }\n }\n\n try {\n $this->executed = $this->prepared->execute();\n } catch (\\Exception $previous) {\n }\n }\n\n if ($this->debug) {\n $this->timings[] = microtime(true);\n\n if (defined('DEBUG_BACKTRACE_IGNORE_ARGS')) {\n $this->callStacks[] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n } else {\n $this->callStacks[] = debug_backtrace();\n }\n }\n\n // If an error occurred handle it.\n if (!$this->executed) {\n // Get the error number and message before we execute any more queries.\n $errorNum = (int) $this->connection->errorCode();\n $errorMsg = (string) 'SQL: ' . implode(\", \", $this->connection->errorInfo());\n\n // Get the error number and message from before we tried to reconnect.\n $this->errorNum = $errorNum;\n $this->errorMsg = $errorMsg;\n\n // Throw the normal query exception.\n \\JLog::add(\n \\JText::sprintf('JLIB_DATABASE_QUERY_FAILED', $this->errorNum, $this->errorMsg),\n \\JLog::ERROR,\n 'databasequery'\n );\n throw new RuntimeException($this->errorMsg, $this->errorNum, $previous);\n }\n\n return $this->prepared;\n }", "static function insert($sql,$err_message=\"Impossibile inserire dati\"){\n \n \n //open DB connection\n $mysqli = self::_DbConnect();\n \n //if there's no connection I return false\n if(!$mysqli): return false; endif;\n \n //execute query\n $result = $mysqli->query($sql);\n\n\n //if there's any warning I return false\n if($mysqli->warning_count):\n $warnings=mysqli_get_warnings($mysqli);\n Notify::developer($warnings->message);\n \n //close connection\n mysqli_close($mysqli);\n return false;\n endif;\n \n if($mysqli->insert_id):\n \n $insert_id=$mysqli->insert_id;\n \n //close connection\n mysqli_close($mysqli);\n \n return $insert_id;\n \n endif;\n \n // echo 'affected rows '.$mysqli->affected_rows.$mysqli->error.$sql;;\n return true;\n \n }", "public static function Ejecutar($sql) {\n // Consulta de la meta\n $consulta = $sql;\n\n try {\n // Preparar sentencia\n $comando = Database::getInstance()->getDb()->prepare($consulta);\n // Ejecutar sentencia preparada\n $comando->execute();\n \n return 1;\n\n } catch (PDOException $e) {\n // Aquí puedes clasificar el error dependiendo de la excepción\n // para presentarlo en la respuesta Json\n return -1;\n }\n }", "public function exec_query($sql = null) {\n\t\t$this->setFoundRows();\n\t\tif($this->debug) {\n\t\t\ttry {\n\t\t\t\t// Execute query\n\t\t\t\t$this->query = (isset($sql) && !empty($sql)) ? $sql : $this->getFullQuery();\n\t\t\t\t$Rs = $this->Connection->Execute($this->query, $this->params);\n\t\t\t\t$Rs->last_query = $this->getSQL($this->query); // full query with parameter\n\t\t\t\t//$this->writeQueryInLog($Rs->last_query, debug_backtrace());\n\n\t\t\t\t// $this->query_debugger($Rs->last_query); // Debug queries\n\t\t\t\t\n\t\t\t\t$this->resetVariables(); // reset all variables\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$newex = new Exception($e->getMessage());\n\t\t\t\t//echo 'ex :: '.$this->getSQL($this->getFullQuery());exit;\n\t\t\t\t$this->displayException($newex);\n\t\t\t}\n\t\t} \n\t\telse {\n\t\t\t$this->query = (isset($sql) && !empty($sql)) ? $sql : $this->getFullQuery();\n\t\t\t$Rs = $this->Connection->Execute($this->query, $this->params);\n\t\t\t$Rs->last_query = $this->getSQL($this->query); // full query with parameter\n\t\t\t$this->resetVariables();\t\t\t\n\t\t}\n\t\t\n\t\t$this->query = trim($this->query);\n\t\tif(stripos($this->query, 'INSERT') === 0) {\n\t\t\treturn $this->Connection->getLastInsertedId();\n\t\t} \n\t\telseif(stripos($this->query, 'UPDATE') === 0) {\n\t\t\treturn $Rs;\n\t\t} \n\t\telse {\n\t\t\tif($Rs->RecordCount() == 0)\n\t\t\t\treturn false;\n return $Rs;\n\t\t}\n\t}", "public function execute()\n\t{\n\t\t$insert = $this->offer_cells($this->ns, $this->table, $this->mutateSpec, $this->cells);\n\t\t$this->table = NULL;\n\t\t$this->cells = array();\n\t\t$this->mutateSpec = NULL;\n\t\treturn $insert;\n\t}", "public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}", "public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}", "function executeSQLStatementGetID($connection, $sqlStatement){\n\t//Execute the prepared SQL\n\tif (!$sqlStatement->execute()) {\n\t\techo \"Execute of SQL Statement failed: $sqlStatement->error\";\n\t\t$connection->rollback();\n\t}\n\t//Return the ID of last inserted row\n\treturn mysqli_insert_id($connection);\n}", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "public function execute();", "protected function Insert($sql) { \n if ((empty($sql)) || (!eregi(\"^insert\",$sql)) || (empty($this->CONNECTION))) { \n $this->ERROR_MSG = \"\\r\\n\" . \"SQL Statement is <code>null</code> or not an INSERT - \" . date('H:i:s'); \n $this->debug(); \n return false; \n } else { \n $conn = $this->CONNECTION; \n $results = mysql_query($sql,$conn); \n if (!$results) { \n $this->ERROR_MSG = \"\\r\\n\" . mysql_error().\" - \" . date('H:i:s'); \n $this->debug(); \n return false; \n } else { \n $result = mysql_insert_id(); \n if (!$result) \n {\n return TRUE;\n }\n return $result; \n } \n } \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}", "public function execSql(){\n\t\t$cant=func_num_args();\n\t\t$instSql=\"\";\n\t\t$instSql=$this->reemplazaParametro(func_get_args());\n//\t\techo \"<br>\".$instSql.\"<br>\";\n//\t\techo $this->tipodb.\"<br>\";\n//\t\t$this->registroLog($instSql,$_SESSION['PERMISO'][0],$_SESSION['PERMISO'][1]);\n\t\tswitch ($this->tipodb) {\n\t\t\tcase \"my\":\n\t\t\t\t$resultado=mysql_query($instSql,$this->conn);\n//echo mysql_errno().\"<br>\";\n\t\t\t\tbreak;\n\t\t\tcase \"pg\":\n\t\t\t\t$resultado=pg_query($this->conn,$instSql);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $resultado;\n\t}", "public function save()\n {\n if (!$this->beforeSave()){return false;}\n\n $id = $this->primaryName;\n if($this->$id)\n {\n $stmt = $this->Adapter->prepare(\"UPDATE $this->table SET \".$this->getPrepared()['update'].\" WHERE $this->primaryName=\".$this->$id);\n if($stmt->execute($this->getPrepared()['values'])){\n return true;\n }\n $this->errors[] = $stmt->errorInfo();\n return false;\n }\n else\n {\n $stmt = $this->Adapter->prepare(\"INSERT INTO $this->table( \".$this->getPrepared()['set'].\" ) values( \".implode(\", \", array_keys($this->getPrepared()['values'])).\" )\");\n if($stmt->execute($this->getPrepared()['values'])){\n return $this->Adapter->lastInsertId('id');\n }\n $this->errors[] = $stmt->errorInfo();\n return false;\n }\n }", "function insert($sql = \"\") {\n\t\t\t$this->time_start();\n\n\t\t\tif (empty ($sql)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!eregi(\"^insert\", $sql)) {\n\t\t\t\treturn $this->error(\"error, its not a insert-query: \".$sql);\n\t\t\t}\n\t\t\tif (empty ($this->CONN)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$conn = $this->CONN;\n\t\t\t$results = mysqli_query($conn, $sql) or $this->error($sql);\n\t\t\t$results = mysqli_insert_id($conn);\n\t\t\t$results == 0 ? $results = mysqli_affected_rows($conn) : 1;\n\n\t\t\t$this->time_stop(\"insert\");\n\t\t\treturn $results;\n\t\t}", "public function execute()\n {\n return $this->query($this->sSql);\n }", "public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}", "public function doInsert ($sql) {\n\treturn ($this->_sendQuery($sql)) ? true : false;\n }", "function perform_insertion($statement) {\n $dbconn = new DBConnection();\n $conn = $dbconn->getConnection();\n // on the connection, we need to check if the insertion worked.\n // Check affected_rows\n if ($conn->query($statement) == FALSE) {\n return array('response' => 'Failed to insert.');\n }\n return array('response' => 'Success');\n}", "private static function _execSql($sql, array $params = array(), &$lastInsertId = null)\n {\n self::connect();\n $stmt = self::$_db->prepare($sql);\n $flattenSql = $stmt->queryString . '. With Params(size=' . count($params) . '): ' . print_r($params, true);\n try\n {\n if(self::$debug === true)\n echo '<pre>Debug for: ' . $flattenSql;\n $stmt->execute($params);\n $retVal = self::$_db->lastInsertId();\n if(is_numeric($retVal) && $retVal > 0)\n {\n $lastInsertId = $retVal;\n if(self::$debug === true)\n echo \"\\n Last Insert Id: \" . $lastInsertId;\n }\n if(self::$debug === true)\n echo \"\\n============================</pre>\";\n }\n catch (Exception $ex)\n {\n // echo '<pre>';\n // $stmt->debugDumpParams();\n // die();\n throw new DaoException(\"Sql error(\" . $ex->getMessage() . \"): \" . $flattenSql);\n }\n return $stmt;\n }", "public function execute($sql){\r\n\t\t\tglobal $link;\r\n\t\t\tmysqli_query($link,$sql);\r\n\t\t}", "public function testCanReturnInsertIdAfterSqlQueryExecution()\n\t {\n\t\t$this->object->exec(\"INSERT INTO MySQLdatabase SET string = 'test1'\");\n\t\t$this->assertEquals(1, $this->object->insertID());\n\t\t$this->object->exec(\"INSERT INTO MySQLdatabase SET string = 'test2'\");\n\t\t$this->assertEquals(2, $this->object->insertID());\n\n\t\t$this->object = new MySQLdatabase($GLOBALS[\"DB_HOST\"], \"nonexistentdb\", $GLOBALS[\"DB_USER\"], $GLOBALS[\"DB_PASSWD\"]);\n\t\t$this->object->exec(\"INSERT INTO MySQLdatabase SET string = 'test1'\");\n\t\t$this->assertEquals(false, $this->object->insertID());\n\t }", "public function datai($sql) {\n //$this->getDB()->query($sql);\n $this->data($sql);\n return $this->getDB()->insert_id;\n }", "function exec_query($sql_query,$flag) {\n\t\t\t$arrAllData = array();\n\t\t\t$result = mysqli_query($this->conexion, $sql_query) or die (json_encode(array(\"success\" => \"false\", \"m\" => \"record not inserted. \" . $sql_query)));\n\t\t\t\n\t\t\tswitch($flag) {\n\t\t\t\tcase 'INS':\n\t\t\t\t\tif($result) { return mysqli_insert_id($this->conexion); }\n\t\t\t\tbreak;\n\t\t\t\tcase 'SEL':\n\t\t\t\t\t$arrData = mysqli_fetch_array($result, MYSQLI_ASSOC);\n\t\t\t\t\treturn $arrData;\n\t\t\t\tbreak;\n\t\t\t\tcase 'ALL' :\n\t\t\t\t\t while($row = mysqli_fetch_array($result, MYSQLI_ASSOC) ) {\n\t\t\t\t\t\t\t$arrAllData[] = $row;\n\t\t\t\t\t }\n\t\t\t\t\t return $arrAllData;\n\t\t\t\tbreak;\n\t\t\t\tcase 'DEL':\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function executeUpdate($script) {\n\t\t$queryRes = mysqli_query($this->connectionString, $script);\n\t}", "public function execute() \r\n\t{\r\n\t\treturn $this->objStatement->execute();\r\n\t}", "public function execute($sql) {\n\tif (!is_resource($this->link)) {\n\t $this->connect();\n\t}\n\t$this->lastqueryid = mysql_query($sql, $this->link) or $this->halt(mysql_error(), $sql);\n\t$this->querycount++;\n\treturn $this->lastqueryid;\n }", "private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }", "public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }", "public function execute () {\n $this->query->execute();\n }", "function insertQuery($sql)\n {\n\t\t\tif($this->rsQry = $this->parse($sql)) \n {\n\t\t\t\t$this->sql = $sql;\n\t\t\t\t\n\t\t\t\t$this->no_of_rows = $this->getNRows();\n\t\t $this->no_of_colums = $this->getNCols(); //Fetch no of rows affected....\n\t\t\t\t$this->close();\n\t\t\t\treturn true;\t\t\t\t\n\t\t\t}\n else\n { \n //echo \"Exit Part\";\n\t\t\t\treturn 0x00; \n\t\t\t}\n\t\t}", "public function SQLInsert($tabela, $colunas, $valores){\n\n\t\t\t$this->failedQuery = true;\n\n\t\t\t$query = \"INSERT INTO $tabela ($colunas) VALUES($valores)\";\n\t\t\t\n\n\t\t\t$this->lastQuery = $query;\n\n\t\t\tswitch($this->databaseType){\n\n\t\t\t\tcase 1:\n\t\t\t\t$result = mysqli_query($this->connection, $query) or $this->reportQueryError(mysqli_error(), $query, 2,$this->failedToInsert);\n\t\t\t\tif($this->auditLastId)\n\t\t\t\t\t$this->lastInsertedIds = mysqli_insert_id($this->connection) or $this->reportQueryError(mysqli_error(), '', 1,$this->failedToInsert);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t$result = odbc_exec($this->connection, $query) or $this->reportQueryError(odbc_errormsg(), $query, 2,$this->failedToInsert);\n\n\t\t\t\t\tif($this->auditLastId){\n\n\t\t\t\t\t\t$lastId = $this->SQLSelect(\"SELECT max(id) AS ID FROM $tabela\");\n\n\t\t\t\t\t\t$this->lastInsertedIds = $row_id[0][\"ID\"];\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t\n\t\t\t\t$result = $this->connection->query($query) or $this->reportQueryError(implode(\":\", $this->connection->errorInfo()), $query, 2,$this->failedToInsert);\n\t\t\t\t\t\n\t\t\t\tif($this->auditLastId)\n\t\t\t\t\t\t$this->lastInsertedIds = $this->connection->lastInsertId();\n\t\t\t\t\tbreak;\n\t\t\t}\n/*\n\t\t\tif($this->audit){\n\n\t\t\t\t$dataAfter = $this->SQLSelect(array(\"*\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"$tabela\"),\n\t\t\t\t\t\t\t\t\t\t\t array(\"id = '$this->lastInsertedIds'\"));\n\n\t\t\t\t$this->audit = false;\n\t\t\t\t$this->auditLastId = false;\n\n\t\t\t\t$this->autoAudit($query, $dataAfter);\n\t\t\t}*/\n\n\t\t\treturn $result;\n\t\t}", "public function execute() {\r\n // $this->connecxao = parent::getConnect();\r\n $stmt = $this->connecxao->prepare($this->getQuery());\r\n $this->transition = $stmt->execute($this->getBinds());\r\n $this->error = $stmt->errorInfo();\r\n\r\n if ($this->error[0] == \"00000\") {\r\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\r\n $this->data = $stmt;\r\n } else {\r\n $this->setMsgError(\"Code Aplic Error: \" . $this->error[0] . \"<br />Code BD Error: \" . $this->error[1] . \"<br />Msg BD Error: \" . $this->error[2]);\r\n }\r\n }", "abstract public function execute() ;", "public function save()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n $queryBuilder->insert(self::TABLE_NAME);\n\n foreach (['delivery_id', 'status', 'topic', 'body', 'sent_at', 'direction', 'to', 'result'] as $field) {\n $value = isset($this->data[$field]) ? $this->data[$field] : null;\n $queryBuilder->setValue(\"`$field`\", $queryBuilder->expr()->literal($value));\n }\n\n $queryBuilder->execute();\n\n return $this->db->lastInsertId();\n }", "public function save(){\n $statement =\"INSERT INTO conf_usuario(email,username,pass,estado,id_rol,id_persona,id_main)\n values(:Email,:Username,:Pass,:Estado,:IdRol,:IdPersona,:IdMain)\";\n $sql= MainModel::getConection()->prepare($statement);\n $sql->bindParam(\":Email\",$this->getEmail());\n $sql->bindParam(\":Username\",$this->getUsername());\n $sql->bindParam(\":Pass\",$this->getPass());\n $sql->bindParam(\":Estado\",$this->getEstado());\n $sql->bindParam(\":IdRol\",$this->getId_rol());\n $sql->bindParam(\":IdPersona\",$this->getId_persona());\n $sql->bindParam(\":IdMain\",$this->getId_main());\n $sql->execute();\n return $sql;\n }", "public function ejecutarQuery($sql){\n return mysqli_query($this->conn,$sql);\n }", "public function insertData()\n {\n try {\n// print_r($this->insertUpdateArray);exit;\n $id = DB::table($this->dbTable)->insertGetId($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n return $id;\n }", "abstract public function exec($sql);" ]
[ "0.6910182", "0.6883474", "0.66612834", "0.66031027", "0.6538314", "0.6476569", "0.64683044", "0.6408359", "0.6398912", "0.63869375", "0.63300824", "0.6329485", "0.6328393", "0.6325459", "0.6320903", "0.6306894", "0.6299439", "0.6296878", "0.6296878", "0.6279219", "0.6273144", "0.6235474", "0.62273127", "0.6226791", "0.6199613", "0.6193973", "0.6182465", "0.6178513", "0.6164179", "0.6155329", "0.61492074", "0.61443824", "0.6126849", "0.61187214", "0.6113704", "0.6107534", "0.61041", "0.61034477", "0.61005735", "0.60978895", "0.60977155", "0.60900205", "0.60740525", "0.6063886", "0.60635686", "0.6058937", "0.60583586", "0.60445535", "0.60428405", "0.6037639", "0.60371536", "0.6032857", "0.6029185", "0.60189056", "0.6005981", "0.6004394", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.60025984", "0.59982914", "0.599738", "0.5990822", "0.59894186", "0.59757054", "0.5974608", "0.59700334", "0.59545416", "0.5954454", "0.5946999", "0.59452856", "0.5943112", "0.59427315", "0.5927343", "0.5924938", "0.59225464", "0.5919825", "0.5905009", "0.5899951", "0.58893543", "0.5887836", "0.58728725", "0.5865748", "0.5859602", "0.5849553", "0.5843288", "0.58382976", "0.5836062", "0.583307" ]
0.74303305
0
Validate unique name of user preference
public function validateUniqueName($value, array $context) { $session = new Session(); if(($user_id = $session->read('User.user_id'))) { $names = $this->find('list')->where(['user_id' => $user_id])->toArray(); if(!empty($names) && !in_array($value, $names)) return true; return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Add_validate_user_name($value)\n\t{\n\t\tif(0 != $this->GetOne('id',array('user_name'=>'=?'),$value) )\n\t\t{\n\t\t\t$this->error_msg = DOLang::Get('Do not allow duplicated users!');\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "private function hasValidUserName($input) {\n\t\treturn strtolower($input->user) == strtolower(get_option(\"wp_broadbean_users\"));\n\t}", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "public function validateName()\n {\n if (strlen(trim($_POST[$this->key])) < $this->minLength) {\n self::$errors[] = $this->convertUnderscores() . \" field requires at least $this->minLength characters\";\n }\n\n //check for profanity.\n if ($this->noProfanity) {\n $this->checkProfanity();\n }\n\n //lastly, check for valid first name patterns.\n\n if (!preg_match(\"/^[a-zA-Z]+[ -\\/\\\\'\\\"]*[a-zA-Z]+[ \\\"]{0,2}[a-zA-Z]*$/\", trim($_POST[$this->key]))) {\n self::$errors[] = \"Not a valid \" . $this->convertUnderscores();\n }\n\n return self::$errors ? false : true;\n }", "function validateUserName($name)\n {\n /**condition for validating the type and size of user input string\n *takes user input name as a parameter for validating with the set conditons\n */\n if (preg_match('/[a-zA-Z]{3}/', $name)) {\n return true;\n }\n }", "function myprefix_setting_one_slug_validate($input) {\n\treturn $input;\n}", "function shorthand_admin_settings_validate($form, &$form_state) {\n $user_id = $form_state['values']['shorthand_user_id'];\n $token = $form_state['values']['shorthand_token'];\n if (!is_numeric($user_id)) {\n form_set_error('shorthand_user_id', t('User ID must be an integer.'));\n }\n else {\n $data = sh_get_profile($user_id, $token);\n if (!isset($data->username)) {\n form_set_error('shorthand_token', t('Invalid token.'));\n }\n }\n}", "function acf_validate_setting($name = '')\n{\n}", "function is_valid_name( $name, $id = 0, $language_id=0 )\n\t{\t\n\t\t$conds['key'] = $name;\n\t\t$conds['language_id'] = $language_id;\n\n\t\t \tif( $id != \"\") {\n\t\t\t\tif ( strtolower( $this->Language_string->get_one( $id )->key ) == strtolower( $name )) {\n\t\t\t\t// if the name is existing name for that user id,\n\t\t\t\t\treturn true;\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tif ( $this->Language_string->exists( ($conds ))) {\n\t\t\t\t// if the name is existed in the system,\n\t\t\t\t\t$this->form_validation->set_message('is_valid_name', get_msg( 'err_dup_name' ));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t}", "private function validateUsername() {\r\n $val = trim($this->data['username');\r\n \r\n if( empty($val) ) { \r\n $this->addError('username', 'username cannot be empty');\r\n } else {\r\n if(preg_match('/^[a-aA-Z0-9]{6,12}$/', $val)) {\r\n $this->addError('username', 'username must 6-12 chars $ alphanumeric')\r\n }\r\n } \r\n }", "function wikia_facebook_validateChooseNameForm( &$specialConnect ){\n\twfProfileIn(__METHOD__);\n\n\t$allowDefault = true;\n\tglobal $wgRequest;\n\t$email = $wgRequest->getVal('wpEmail');\n\tif( ($email == \"\") || (!User::isValidEmailAddr( $email )) ) {\n\t\t$specialConnect->sendPage('chooseNameForm', 'facebook-invalid-email');\n\t\t$allowDefault = false;\n\t}\n\n\twfProfileOut(__METHOD__);\n\treturn $allowDefault;\n}", "function verifyUserName($name) {\r\n if (preg_match('/^[a-zA-Z0-9\\ \\\\._\\'\"-]{4,50}$/', $name) != 1) { // no match\r\n return \"Name must be 4-50 characters long and consist of letters, digits, \"\r\n . \"spaces, dots, underscores, apostrophies, or minus sign.\";\r\n }\r\n return TRUE;\r\n}", "function _valid_trayname($str)\r\n\t{\r\n\t\t$this->erpm->auth();\r\n\t\t\r\n\t\t// used for checking valid tray name while editting \r\n\t\t$tray_id = $this->input->post('tray_id');\r\n\t\tif($tray_id)\r\n\t\t\t$cond = ' and tray_id != '.$tray_id;\r\n\t\telse \r\n\t\t\t$cond = '';\r\n\t\t\r\n\t\t$tray_name =$this->input->post('tray_name');\r\n\t\tif($this->db->query(\"select count(*) as t from m_tray_info where tray_name = ? $cond \",$tray_name)->row()->t)\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('_valid_trayname',$tray_name.' is already available ');\r\n\t\t\treturn false; \r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function account_namevalid() {\n if (strspn($_POST['clientusername'],\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-\") == 0) {\n return false;\n }\n \n // must contain all legal characters\n if (strspn($_POST['clientusername'],\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_\") != strlen($_POST['clientusername'])) {\n return false;\n }\n\n // min and max length\n if (strlen($_POST['clientusername']) < 5) {\n return false;\n }\n if (strlen($_POST['clientusername']) > 25) {\n return false;\n }\n\n // illegal names\n if (eregi(\"^((root)|(bin)|(daemon)|(adm)|(lp)|(sync)|(shutdown)|(halt)|(mail)|(news)|(uucp)|(operator)|(games)|(mysql)|(httpd)|(nobody)|(dummy)|(www)|(cvs)|(shell)|(ftp)|(irc)|(debian)|(ns)|(download))$\", $_POST['username'])) {\n return false;\n }\n if (eregi(\"^(anoncvs_)\", $_POST['clientusername'])) {\n return false;\n }\n\nreturn true;\n}", "function _validate_pnhempusername()\r\n\t{\r\n\t\t$username = $this->input->post('username');\r\n\t\tif($this->db->query('select count(*) as t from king_admin where username = ? ',$username)->row()->t)\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('_validate_pnhempusername','Username already available');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function validate_name($name)\r\n\t{\r\n\t\t$trim = trim($name);\r\n\t\tif(strlen($trim) > 1)\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\treturn FALSE;\r\n\t}", "function validate_name($name){\n\t$test = \"\";\n\n\t// Test Null Username\n\n\tif ($name == \"\")\n\t{\n\t\t$test .= \"<li> Username field was blank, This is required.</li>\\n\";\n\t}\n\n\t//Test Existing Username\n\n\t$result = safequery(\"select * from person where name = '\".addslashes($name).\"'\");\n\tif(mysql_num_rows($result)>0)\n\t{\n\t\t$test .= \"<li>That username is already in use. Sorry.</li>\";\n\t}\n\n\n\treturn $test;\n}", "public function getValidatedName($name){\n\t if(empty($name)){\n\t \t$validName=FALSE;\n\t }\n\t\telse {\n\t\t\tif(strlen($name)==1){\n\t \t$validName=FALSE;\n\t }\n\t \t$validName = $this->sanitizeString($name);\n\t\t}\n\t return $validName;\n }", "function _validateUsername($name)\n {\n return trim(substr(preg_replace('/[^A-Za-z0-9_ \\-]/', '',$name),0,24)); \n }", "protected function checkProfileName(&$inMessage = '') {\n\t\t$isValid = true;\n\t\tif ( !is_string($this->_ProfileName) && $this->_ProfileName !== '' ) {\n\t\t\t$inMessage .= \"{$this->_ProfileName} is not a valid value for ProfileName\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid && strlen($this->_ProfileName) > 50 ) {\n\t\t\t$inMessage .= \"ProfileName cannot be more than 50 characters\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid && strlen($this->_ProfileName) <= 1 ) {\n\t\t\t$inMessage .= \"ProfileName must be more than 1 character\";\n\t\t\t$isValid = false;\n\t\t}\n\t\tif ( $isValid ) {\n\t\t\t$oProfile = self::getInstanceByProfileName($this->getProfileName());\n\t\t\tif ( $oProfile->getID() > 0 && $oProfile->getUserID() != $this->getUserID() ) {\n\t\t\t\t$isValid = false;\n\t\t\t\t$inMessage = \"The profile name {$this->getProfileName()} is already in use by another user\";\n\t\t\t}\n\t\t\t$oProfile = null;\n\t\t\tunset($oProfile);\n\t\t}\n\t\treturn $isValid;\n\t}", "function chkusername($str) {\n $this->db->where('username', strtolower($str));\n $query = $this->db->get('user');\n if ($query->num_rows() == 1) {\n $this->form_validation->set_message('chkusername', 'Username is already being used!');\n return false;\n }\n\n return true;\n }", "public function playerpref_validate($prefname = \"\",$prefvalue = \"\")\n\t{\n\t\tif (empty($prefname))\n\t\t{\n\t\t\tuser_error(\"playerpref_validate() empty prefname.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($prefvalue) || $prefvalue == \"?\")\n\t\t{\n\t\t\tuser_error(\"playerpref_validate() empty prefname.\");\n\t\t\treturn false;\n\t\t}\n\t\t$result = $this->CLI->arrayQuery($this->SqueezePlyrID.\" playerpref validate \".urlencode($prefname).\" \".urlencode($prefvalue));\n\t\tif (isset($result['valid']))\n\t\t{\n\t\t\treturn (bool) $result['valid'];\n\t\t}\n\t\treturn false;\n\t}", "function validateUname($data)\n{\n\t\t$pisahUnderscore = explode('_',$data);\n\t\t$str5=$pisahUnderscore[0];\n\t\t$int2=$pisahUnderscore[1];\n\n\t\tif ((str_word_count($str5) == 1) and (strlen((string) trim($str5)) == 5) and ((strlen((int) trim($int2)) == 2)))\n\t\t{\n\t\t\techo \"Terverifikasi\";\n\t\t} else {\n\t\t\techo \"Coba lagi\";\n\t\t}\n}", "private function ValidateName($name){\n if (empty($name)){ //checks if empty\n $this->valid = False;\n }else if (strlen($name)>= 30){ //checks max length\n $this->valid = False;\n }else if(!preg_match(\"/^[a-zA-Z ]*$/\",$name)){ //checks format\n $this->valid = False;\n }\n }", "function twitter_non_auth_account_form_validate($form, &$form_state) {\n $screen_name = $form_state['values']['screen_name'];\n if (twitter_account_load($screen_name, FALSE)) {\n form_set_error('screen_name', t('The Twitter account <em>@screen_name</em> has been added already.',\n array('@screen_name' => $screen_name)));\n }\n}", "function verify_name($name) // Colorize: green\n { // Colorize: green\n return isset($name) // Colorize: green\n && // Colorize: green\n is_string($name) // Colorize: green\n && // Colorize: green\n $name != \"\"; // Colorize: green\n }", "function _name_check($str){\n }", "public function validateName($attribute)\n {\n if (!$this->hasErrors()) {\n if (!preg_match('/^[\\w\\s\\p{L}]{1,255}$/u', $this->$attribute)) {\n $this->addError($attribute, Yii::t('podium/view', 'Name must contain only letters, digits, underscores and spaces (255 characters max).'));\n }\n }\n }", "function is_name_valid($input)\n {\n return (preg_match(\"/^([-a-z_ ])+$/i\", $input)) ? TRUE : FALSE;\n }", "function validateName()\n {\n global $inName, $validForm, $nameErrMsg;\t\t//Use the GLOBAL Version of these variables instead of making them local\n $nameErrMsg = \"\";\t\t\t\t\t\t\t\t//Clear the error message.\n if($inName==\"\")\n {\n $validForm = false;\t\t\t\t\t//Invalid name so the form is invalid\n $nameErrMsg = \"Name is required\";\t//Error message for this validation\n }\n\n else if(!preg_match(\"/^[a-zA-Z\\s]+$/\",$inName)){\n $validForm=false;\n $nameErrMsg=\"Please use only letters\";\n }\n\n else\n {\n $inLname = trim($inName);\t\t\t\t//Removes leading/trailing characters\n $inLname = htmlspecialchars($$inName);\t//converts special characters\n }\n }", "private function validateProfileName($profileName){\n if(strlen($profileName)< 2 || strlen($profileName)> 20){\n array_push($this->errorArray, Constants::$nameLength);\n }\n }", "public function validate_username() {\n\n\t\tif(strtolower($this->username) == 'admin')\n\t\t\t$this->addError('username','Usuario no disponible.');\n\t}", "function unique_username($value, $id = 0)\n\t{\n\t\tif ($this->user_model->is_username_unique($value, $id))\n\t\t\treturn TRUE;\n\t\telse\n\t\t{\n\t\t\t$this->form_validation->set_message('unique_username', lang('already_taken'));\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function valid_name($name) {\r\n\tif (empty($name)) \r\n\t\treturn false;\r\n\telse\r\n\t\treturn true;\r\n }", "public function validateUniqueData(string $data)\n {\n $users = self::selectAllData();\n\n foreach($users as $user) {\n switch($data) {\n case $user->acc_number:\n $message = self::USER_ACCNUMBER_ALREADY_EXISTS;\n break;\n case Helper::decrypt_data($user->document_number):\n $message = self::USER_DOCUMENT_NUMBER_ALREADY_EXISTS;\n break;\n default:\n $message = self::USER_VALID_DATA;\n break;\n }\n }\n\n return $message;\n }", "private function _validateUsername()\n\t{\n\t\t$state = $this->getStateVariables();\n\n\t\t$ret = (object)array('username' => false);\n\t\t$username = $state->username;\n\t\tif(empty($username)) return $ret;\n\t\t$myUser = JFactory::getUser();\n\t\t$user = FOFModel::getTmpInstance('Jusers','AkeebasubsModel')\n\t\t\t->username($username)\n\t\t\t->getFirstItem();\n\n\t\tif($myUser->guest) {\n\t\t\tif(empty($user->username)) {\n\t\t\t\t$ret->username = true;\n\t\t\t} else {\n\t\t\t\t// If it's a blocked user, we should allow reusing the username;\n\t\t\t\t// this would be a user who tried to subscribe, closed the payment\n\t\t\t\t// window and came back to re-register. However, if the validation\n\t\t\t\t// field is non-empty, this is a manually blocked user and should\n\t\t\t\t// not be allowed to subscribe again.\n\t\t\t\tif($user->block) {\n\t\t\t\t\tif(!empty($user->activation)) {\n\t\t\t\t\t\t$ret->username = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ret->username = false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$ret->username = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\t$ret->username = ($user->username == $myUser->username);\n\t\t}\n\t\treturn $ret;\n\t}", "function is_reserved_name($str) {\n\t\t$reserved = array('name','value','content','parent','rank','password','timestamp');\n\t\tif(empty($str) || in_array($str, $reserved)) return true;\n\t\treturn false;\n\t}", "function validate_username($username)\n {\n }", "public static function validate_name( $value ) {\n\t\treturn !DataValidator::cc_number_exists_in_str( $value );\n\t}", "public static function isValidName($name) {}", "function nameFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_NAME_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "private function __validate_name() {\n if (isset($this->initial_data[\"name\"])) {\n if ($this->get_limiter_id_by_name($this->initial_data[\"name\"], true)) {\n $this->id = $this->get_limiter_id_by_name($this->initial_data[\"name\"]);\n } else {\n $this->errors[] = APIResponse\\get(4209);\n }\n } else {\n $this->errors[] = APIResponse\\get(4167);\n }\n }", "function validateName($name) {\n\tif (!preg_match('/[^A-Za-z]+/', $name) && strlen($name) >= 2 && strlen($name) <= 20)\n\t\treturn 1;\t//name is valid\n\telse\n\t\treturn 0;\n}", "public function invalidUsername() {\n\t\t$this->messages[] = \"Användarnamnet har för få tecken. Minst 3 tecken.\";\n\t}", "public static function validateName($name) {\n\t\tif (!empty($name)) {\n\t\t\tif (preg_match('/^[a-z0-9 ]{3,}$/i', $name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function validateUserParam($p){\n\t\t\treturn (preg_match(\"/^user_id=[0-9]+$/\", $p) || preg_match(\"/^screen_name=[0-9a-zA-Z_]+$/\", $p));\n\t\t}", "function test_uname($uname){\n //but may be useful when debugging\n $result = \"\";\n $unamelength = strlen($uname);\n //test length\n if ($unamelength < 3) $result = \"Invalid username: make it longer\";\n if ($unamelength > 25) $result = \"Invalid username: make it shorter\";\n //test for the word 'guest'\n if (strpos($uname, 'guest') !== false) $result=\"This word is restricted.\";\n //test for bad characters\n if (preg_match(\"/[^a-zA-Z0-9-_]/\", $uname)) $result = \"Invalid username\";\n return $result;\n}", "function ValidateNames($inputName, $titleName)\r\n{\r\n $errorMessage = \"\";\r\n if($_POST[$inputName] != \"\" && !IsValidName($_POST[$inputName]))\r\n {\r\n $errorMessage .= \"The $titleName should only contain alphanumeric characters\\\\n\";\r\n }\r\n \r\n return $errorMessage;\r\n}", "private function checkUsername($name){\n\t\t\tif(strlen($name) < 3)\n\t\t\t\tthrow new UserFewCharException();\n\t\t\tif($this->userList->getUsers()->getUserByName($name) != null)\n\t\t\t\tthrow new UserExistsException();\n\t\t\tif($name != strip_tags($name))\n\t\t\t\tthrow new UserBadCharException();\n\t\t\treturn true;\n\t\t}", "public function registrationValidation() \n { \n if ($this->WishlistModel->usernameCheck()) \n { \n\t\t\t$this->form_validation->set_message('registrationValidation', 'Username is already in use'); \n return false; \n } else { \n return true; \n } \n }", "function validateUser(Userinfo $userinfo)\n\t{\n\t\t$username = $this->filterUsername($userinfo->username);\n\t\tif ($username !== $userinfo->username) {\n\t\t\tthrow new RuntimeException('Username Has Invalid Character: ' . $userinfo->username . ' vs ' . $username);\n\t\t}\n\t\treturn true;\n\t}", "function checkUserName()\r\n{\r\n\t// --------- GLOBALIZE ---------\r\n\tglobal $user,$utf8;\r\n\t// --------- CHECK ---------\r\n\t$name = $utf8->toUTF8(GET_INC('name'));\r\n\tif ( $user->uname_exist($name) )\r\n\t{\r\n\t\techo 1;\r\n\t}else{\r\n\t\techo 0;\r\n\t}\r\n}", "public function usernameEntryIsValid() {\r\n if (array_key_exists(\"username\", $_POST) )\r\n {\r\n if ( !Validator::usernameIsValid($_POST[\"username\"]) )\r\n {\r\n $this->errors[\"username\"] = \"Username is not valid!\";// if the username is not valid then the error will be filled with this message\r\n }\r\n if( $this->usernameIsTaken($_POST[\"username\"]) == true ) \r\n {\r\n $this->errors[\"username\"] = \"That Username has been taken!\"; // if the website that the user entered is already in the database\r\n }\r\n }\r\n else\r\n {\r\n $this->errors[\"username\"] = \"Username is required!\"; // requires a Username to be entered\r\n }\r\n \r\n return ( empty($this->errors[\"username\"]) ? true : false );\r\n }", "public function _unique_username ($str){\n\t\t// Do NOT validate if email already exists\n\t\t// UNLESS it's the email for the current user\n\t\t\n\t\t$id = $this->session->userdata('id');\n\t\t$this->db->where('username', $this->input->post('username'));\n\t\t!$id || $this->db->where('id !=', $id);\n\t\t$user = $this->user_m->get();\n\t\t\n\t\tif (count($user)) {\n\t\t\t$this->form_validation->set_message('_unique_username', '%s should be unique');\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function usernameAlreadyTaken() {\n\t\t$this->messages[] = \"Användarnamnet är redan upptaget\";\n\t}", "public function unique_username()\n {\n $username = $this->input->post('username');\n $id = $this->input->post('id');\n $user = $this->user->where('username', $username)->first();\n\n if ($user) {\n if ($id == $user->id) {\n return true;\n }\n $this->load->library('form_validation');\n $this->form_validation->set_message('unique_username', '%s has been used!');\n return false;\n }\n\n return true;\n }", "public function validateValue()\n {\n return (preg_match('/' . $this->preference->value . '/', $this->value) == 1 ? true : false);\n }", "public function username_check($str) {\n // return FALSE;\n return TRUE;\n }", "public static function nameIsValid($name) {\r\n return ( is_string($name) && !empty($name) && strlen($name) >=2 ); \r\n }", "public function checkInputExists($name);", "function validate_user_signup()\n {\n }", "public function isValueMustBeUnique(): bool;", "public function validate_username_conflict($wpValdUser, $username) {\n\t\tglobal $phpbbForum;\n\t\tif($phpbbForum->get_state() == 'phpbb') {\n\t\t\tif(function_exists('phpbb_validate_username')) {\n\t\t\t\treturn phpbb_validate_username($username, false);\n\t\t\t}\n\t\t}\n\t\treturn $wpValdUser;\n\t}", "function validateName($name)\n {\n return (mb_strlen($name) <= CUSTOMER_NAME_MAX_LENGTH && mb_strlen($name) !== 0);\n }", "protected function validateUsername($value) {\n if (preg_match(\"/^[a-z0-9\\-\\_\\@\\.\\*\\^\\~]+$/i\", $value))\n return true;\n $this->setError(t(\"Illegal username\"));\n return false;\n }", "static function checkNames($input)\r\n {\r\n if (preg_match('/^[\\w\\W][\\w\\W]{1,20}$/', $input)) {\r\n return true; //Illegal Character found!\r\n } else {\r\n echo PageBuilder::printError(\"Please enter alphabets only in name fields.\");\r\n return false;\r\n }\r\n }", "private function userNameValidate($uName){\n //Search Pattern\n if(preg_match(\"/^[a-zA-Z0-9]*$/\",$uName)){\n $result = true;\n }else{\n $result = false;\n }\n return $result;\n }", "public function rules()\n {\n return [\n 'name' => 'required|between:3,30|alpha_dash|unique:users,name',\n ];\n }", "public static function prop_name_is_valid( $name ) {\n\t\treturn preg_match( self::PROP_NAME_REGEX, $name );\n\t}", "public function name_valid($name) {\n if (!preg_match(\"/^[a-z0-9]+$/i\", $name)) {\n /* name contains invalid characters */\n return false;\n }\n\n if (strlen($name) >= 100) {\n /* name is too long */\n return false;\n }\n\n /* name already exists? */\n $stmt = get_pdo()->prepare('select * from user where name = :name');\n $stmt->bindValue(':name', $name);\n $stmt->execute();\n return count($stmt->fetchAll()) == 0;\n }", "public function ajax_check_username() {\n\t\tglobal $wpdb;\n\n\t\tif ( !isset( $_REQUEST['action'] ) )\n\t\t\treturn;\n\n\t\tif ( 'visual_form_builder_check_username' !== $_REQUEST['action'] )\n\t\t\treturn;\n\n\t\t$username = esc_html( $_REQUEST['username'] );\n\t\t$user_id = username_exists( $username );\n\t\t$valid = 'true';\n\n\t\t// If username exists, not valid\n\t\tif ( $user_id )\n\t\t\t$valid = 'false';\n\n\t\techo $valid;\n\n\t\tdie(1);\n\t}", "static function validName($name)\r\n {\r\n if (ctype_alpha($name)) {\r\n return $name;\r\n } else if ($name == \"\") {\r\n return !empty($name);\r\n }\r\n }", "public function validateTitle()\n {\n if (empty($this->_taintedData['title'])) {\n $this->_addErrorMessage(\"Please fill in the title\");\n\n return false;\n }\n\n $title = $this->_cleanData['title'];\n\n if (strlen($title) > 100) {\n $this->_addErrorMessage(\"Your talk title has to be 100 characters or less\");\n\n return false;\n }\n\n return true;\n }", "function validatePasswordUsername(&$Model, $data, $params) {\r\n\t\tif ($this->settings[$Model->alias]['passwordPolicy'] == 'weak' || !isset($Model->data[$Model->alias][$params[1]])) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$params[0]];\r\n\t\t$username = $Model->data[$Model->alias][$params[1]];\r\n\t\tif (strpos($compare, $username) !== false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function validateUsername($nombre){\n if(strlen($nombre) < 4){\n return false;\n }\n\n if(!preg_match(\"/^([A-Z|Ñ|a-z|ñ|Á|É|Í|Ó|Ú|á|é|í|ó|ú]+\\s{0,1})+$/\", $nombre)){\n return false;\n }\n\n return true;\n}", "function validateUser($username){\n\t\tglobal $dataModel;\n\n\t\tif($dataModel->userExist($username, \"\")){\n\t\t\t$_SESSION['error'] = \"Username already taken\";\n\t\t\theader(\"location:../views/profUpdate.php\");\n\t\t}\n\t\n\t\tif (strlen($username)< 6){\n\t\t\t$_SESSION['error'] = \"Username too short\";\n\t\t\theader(\"location:../views/profUpdate.php\");\n\t\t}\n\n\t\treturn true;\n\t}", "function isValidName ($name)\r\n{\r\n global $cf_reservedpattern;\r\n\r\n $reservedpattern = $cf_reservedpattern ? $cf_reservedpattern : '[_a-z]{0,1}([\\d]+)';\r\n\r\n if (preg_match(\"%^\".$reservedpattern.\"$%i\", $name, $matches))\r\n return FALSE; // reserved - not permitted\r\n\r\n $pattern = '[a-z\\d][_a-z\\d]{2,23}';\r\n if (preg_match('%^'.$pattern.'$%i', $name))\r\n if (!preg_match(\"%^(api|com|biz|def|gov|net|org|wap|web|www|gamma|mobile|mygamma|buzzcity|netbeacon)[\\d]*$%i\", $name))\r\n return TRUE;\r\n\r\n return FALSE; // not permitted\r\n}", "private function validName() {\n\t\t\tif($this->conn->getNumResults(\"SELECT name FROM usergroup WHERE name = '\".mysql_real_escape_string($this->name).\"' AND groupId != '\".$this->groupId.\"'\") == 0)\n\t\t\t\treturn true;\n\t\t\treturn false;\n\t\t}", "function name_exists($str){\n\n\t\tif(strlen($str)<3 || strlen($str)>30){\n\t\t\t$this->form_validation->set_message('name_exists','The field {field} must be between 3 and 30 characters in length');\n\t\t\treturn false;\n\t\t}\n\t\t$nameExists = $this->DAO->entitySelection('station',array('nameStation'=>$str),TRUE);\n\t\tif($nameExists['data']){\n\t\t\t$this->form_validation->set_message('name_exists','The field {field} already exists');\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "function isNameViable(){\n\t$postName = filter_var($_POST['name'], FILTER_SANITIZE_SPECIAL_CHARS);\n\tif(strlen($postName) < 3){\n\t\treturn false;\n\t}\n\n\t$f = $postName[0]; #first letter is predicted class\n\t$s = $postName[1]; #second letter is actual class\n\t#third letter is '_'\n\tif(($f=='B' || $f=='D' || $f=='F' || $f=='L' || $f=='R') && \n\t\t($s=='B' || $s=='D' || $s=='F' || $s=='L' || $s=='R') &&\n\t\t$postName[2]=='_'){\n\t\t\treturn true;\n\t} else{\n\t\treturn false;\n\t}\n}", "function verify_username_availability($userName){\n $exists = false;\n if(get_user($userName)){\n $exists = true;\n }\n return $exists;\n}", "protected function validateMachineName($value) {\n if (preg_match(\"/^[a-z0-9\\_]+$/\", $value))\n return true;\n $this->setError(t(\"Invalid machine name (only a-z, 0-9, and _)\"));\n return false;\n }", "public function usernameEntryIsValid() {\r\n \r\n //todo put logic here (same as email)\r\n // set the var equal to function call of username\r\n $username = $this->getUsername();\r\n // If the field is empty\r\n if ( empty($username) ) {\r\n // Will send it to errors as username and display the message to user\r\n $this->errors[\"username\"] = \"Username is missing.\";\r\n // Other test calls the validator class and nameisvalid function to test\r\n // the user name is it returns invalid the message is displayed to the user\r\n } else if ( !Validator::nameIsValid($this->getUsername()) ) {\r\n $this->errors[\"username\"] = \"Username is not valid.\"; \r\n }\r\n //Will return if its empty and whether any errors are contained\r\n return ( empty($this->errors[\"username\"]) ? true : false ) ;\r\n }", "protected function validate_username($name) {\r\n\t\t$ret = new Status();\r\n\t\tif (!Users::is_unique_username($name)) {\r\n\t\t\t$ret->append(tr('An user with this username already exists', 'users'));\r\n\t\t}\r\n\t\treturn $ret;\r\n\t}", "public function validateRealname() {\r\n $leng = mb_strlen($this->data[$this->name]['RealName']);\r\n if ($leng > 128) {\r\n return FALSE;\r\n } else if ($leng > 64) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['RealName']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }", "public function validate($value = null)\n {\n // vérification de la longueur\n if (strlen($value) < 3 || strlen($value) > 15) {\n return false;\n }\n \n // vérification du reste\n if (!preg_match(self::USER_REGEX, $value)) {\n return false;\n }\n \n // prevent usage of 'daemon' as its used for git-smart-http\n if ($value == 'daemon') {\n return false;\n }\n \n return true;\n }", "function user_create_validate($data)\r\n{\r\n\tglobal $db;\r\n\t$out = true;\r\n\t@unlink(_CACHE.'user_create_validate_msg.txt');\r\n\tif ($db->getOne(\"SELECT 1 FROM `bbc_user` WHERE `username`='\".$data['username'].\"'\"))\r\n\t{\r\n\t\tuser_create_validate_msg('Username has already been used!');\r\n\t\t$out = false;\r\n\t}\r\n\tif ($out && $db->getOne(\"SELECT 1 FROM `bbc_account` WHERE `email`='\".$data['email'].\"'\"))\r\n\t{\r\n\t\tuser_create_validate_msg('Email address has already been used!');\r\n\t\t$out = false;\r\n\t}\r\n\tif ($out)\r\n\t{\r\n\t\t$out = user_call_func_validate(__FUNCTION__, $data);\r\n\t}\r\n\treturn $out;\r\n}", "function seun_user_profile_nicename_error( $errors, $update, $user ) {\n\t\t\n\t\t\t$errors->add( 'user_nicename', __( '<strong>ERROR</strong>: This user nicename is already registered. Please choose another one.', 'seun' ) );\n\t\t\n\t\t}", "function validName($name)\n {\n //name should not be empty and should contain only letters\n return !empty($name) && ctype_alpha($name);\n }", "function sanitizeName() {\n $pattern = \"/[0-9`!@#$%^&*()_+\\-=\\[\\]{};':\\\"\\\\|,.<>\\/?~]/\";\n if (!preg_match($pattern, $this->fname) && !preg_match($pattern, $this->lname)) {\n $this->fname = trim($this->fname);\n $this->lname = trim($this->lname);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function validate_name($str){\n\t\t//the content of the fields gets automatically passed to the method\n\t\tif ($str == trim($str) && strpos($str, ' ') !== false) {\n\t\t$this->form_validation->set_message('validate_name','Space not allowed');\n\t\treturn FALSE; \n\t\t}\n\t\telse\n\t\t{\n\t\treturn TRUE;\n\t\t}\n\t}", "private function validateUserName($un){\n if(strlen($un)<2 || strlen($un)>25){\n array_push($this->errorArray, Constants::$userNameCharecters);\n return;\n }\n #SQL QUERY\n $query = $this->con->prepare(\"SELECT * FROM users WHERE userName=:un\");\n $query->bindValue(':un', $un); #bind the value to user name\n $query->execute();\n\n if($query->rowCount() !=0){\n array_push($this->errorArray,Constants::$userNameTaken);\n }\n\n }", "public function validateUniqueSpaceCheck(){\n Validator::extend('unique_space_check',function($attribute,$value,$parameters){\n $attribute =(isset($paramters[1]))? $parameters[1]: $attribute;\n $value=trim(preg_replace('/\\s\\s+/', '', $value));\n $check= DB::table($parameters[0])->where($attribute,$value)->count();\n //$this->Fnlog('parameters:'.$parameters[0].' attribute:'.$attribute.' value:'.$value.' check:'.$check);\n return ($check>0)?false:true;\n }, 'The :attribute has already been taken.'\n );\n }", "function check_username(){\n $usernameErr = '';\n if(empty($_POST[\"username\"])){\n $usernameErr = \"Please enter a username\";\n }\n else{\n $username = $_POST['username'];\n if(!preg_match(\"/^[a-zA-Z0-9_]+$/\", $username)) {\n $usernameErr = \"Alpha lower, upper and underscore only for username\";\n }\n else{//username is ok\n $usernameErr = \"ok\";\n }\n }\n return $usernameErr;\n\n}", "public function validate_uniqueUsername($value, $input, $args){\n\t\t$user = $this->user->where('username', $value);\n\n\t\t//ignore current username when updating if the same username is passed\n\t\tif($this->auth && $this->auth->username === $value){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn ! (bool) $user->count();\n\t}", "public function _validWikName($str)\n\t{\n\t\tif (preg_match('/[^a-z0-9\\-\\_]/i', $str))\n\t\t{\n\t\t\tee()->form_validation->set_message('_validWikName', lang('invalid_short_name'));\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function validateUid ($uid) {\n if ((strlen($uid) > 11) &&\n (strlen($uid) < 100) &&\n preg_match('/^[a-z]+-\\d+-\\d+/', $uid)){\n return true;\n }\n return false;\n }", "function validatePasswordSpecialChar(&$Model, $data, $compare) {\r\n\t\tif (in_array($this->settings[$Model->alias]['passwordPolicy'], array('weak', 'normal', 'medium'))) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t$key = key($data);\r\n\t\t$value = $data[$key];\r\n\t\t$compare = $Model->data[$Model->alias][$compare[0]];\r\n\t\tif (!(preg_match('/.*[^\\w].*/', $compare))) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public function username_check($str)\n {\n $this->load->model('Admin_model');\n if ($this->Admin_model->check_user($str))\n {\n return TRUE;\n }\n else\n {\n $this->form_validation->set_message('username_check', 'This username does not exist');\n return FALSE;\n }\n }", "protected function validateOwner()\r\n {\r\n $value = $this->owner->getValue();\r\n $len = strlen($value);\r\n if (empty($len)) {\r\n return true;\r\n }\r\n $parts = explode('@', $value);\r\n if (count($parts) != 2) {\r\n return false;\r\n }\r\n $locallen = strlen($parts[0]);\r\n if ($locallen > 64) {\r\n return false;\r\n }\r\n $domainlen = $len - $locallen;\r\n if ($domainlen < 4 || $domainlen > 255) {\r\n return false;\r\n }\r\n foreach (explode('.', $parts[0]) as $local) {\r\n if (!preg_match('/^[A-Za-z0-9!#$%&\\'*+\\\\/=?^_`{|}~-]+$/D', $local)) {\r\n return false;\r\n }\r\n }\r\n if (!preg_match('/^([a-z0-9][a-z0-9\\-]*[a-z0-9]|[a-z0-9])(\\.([a-z0-9][a-z0-9\\-]*[a-z0-9]|[a-z0-9])){0,10}\\.([a-z]{2,}){1}$/iD', $parts[1])) {\r\n return false;\r\n }\r\n return true;\r\n }" ]
[ "0.65845007", "0.63389695", "0.6288217", "0.62470686", "0.61406606", "0.60693556", "0.60564405", "0.6017954", "0.6015935", "0.59624815", "0.5944039", "0.59053344", "0.58939075", "0.58933294", "0.5880077", "0.5874807", "0.5872603", "0.58667785", "0.5864799", "0.58420634", "0.582511", "0.58167243", "0.58075607", "0.5806416", "0.57992446", "0.577681", "0.57580733", "0.5729873", "0.57230836", "0.5712811", "0.5701058", "0.5687252", "0.56797945", "0.56784135", "0.5664685", "0.5657655", "0.5652826", "0.56367457", "0.56221104", "0.5615419", "0.56057227", "0.5601192", "0.5601005", "0.5595441", "0.5593958", "0.55932176", "0.5579436", "0.5576422", "0.5575472", "0.55613106", "0.55608124", "0.5560316", "0.5556794", "0.5556304", "0.5555744", "0.5538353", "0.5536568", "0.5526599", "0.55256325", "0.5522116", "0.55212194", "0.551598", "0.5511357", "0.5511179", "0.5502932", "0.5493437", "0.54915655", "0.54889554", "0.5474945", "0.54708713", "0.5465906", "0.5464768", "0.5457423", "0.5453929", "0.5453082", "0.5452965", "0.54433256", "0.5435703", "0.54329634", "0.5430937", "0.5426963", "0.54232854", "0.5418885", "0.5411135", "0.5401952", "0.539856", "0.539744", "0.5394746", "0.53927517", "0.5378861", "0.5355815", "0.5355331", "0.5355226", "0.53525853", "0.53507394", "0.5343755", "0.5334939", "0.5327083", "0.5326232", "0.53231186" ]
0.5468058
70
Returns a rules checker object that will be used for validating application integrity.
public function buildRules(RulesChecker $rules) { $rules->add($rules->existsIn(['user_id'], 'Users')); return $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildRules(RulesChecker $rules): RulesChecker\n {\n return $rules;\n }", "private static function rules() : mixed\n {\n return AppContainer::get(Constants::validatorRules);\n }", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::class);\n }", "public function createValidator()\n {\n $validator = Validation::createValidatorBuilder()\n ->setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))\n ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app))\n ->setTranslator($this->getTranslator())\n ->setApiVersion(Validation::API_VERSION_2_5)\n ->getValidator();\n\n return $validator;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "protected function getValidationFactory()\n {\n return app('validator');\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn('bucket_category_id', 'BucketCategories'), ['errorField' => 'bucket_category_id']);\n $rules->add($rules->existsIn('tab_id', 'Tabs'), ['errorField' => 'tab_id']);\n $rules->add($rules->existsIn('plugin_id', 'Plugins'), ['errorField' => 'plugin_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn('system_id', 'Systems'), ['errorField' => 'system_id']);\n $rules->add($rules->existsIn('item_id', 'GroupItems'), ['errorField' => 'item_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['school_id'], 'School'), ['errorField' => 'school_id']);\n $rules->add($rules->existsIn(['lehrberuf_id'], 'Lehrberuf'), ['errorField' => 'lehrberuf_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['loja_id'], 'Lojas'), ['errorField' => 'loja_id']);\n $rules->add($rules->existsIn(['usuario_id'], 'Usuarios'), ['errorField' => 'usuario_id']);\n $rules->add($rules->existsIn(['estado_id'], 'Estados'), ['errorField' => 'estado_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker {\n $rules->add($rules->existsIn(['user_account_id'], 'UserAccounts'));\n $rules->add($rules->existsIn(['form_status_id'], 'FormStatuses'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->isUnique(['title']));\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['sport_id'], 'Sports'), ['errorField' => 'sport_id']);\n $rules->add($rules->existsIn(['country_id'], 'Countries'), ['errorField' => 'country_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn('specification_group_id', 'SpecificationGroups'), ['errorField' => 'specification_group_id']);\n $rules->add($rules->existsIn('specification_unit_group_id', 'SpecificationUnitGroups'), ['errorField' => 'specification_unit_group_id']);\n\n return $rules;\n }", "public function getValidator(){\n \treturn $this->model->rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['item_sku']));\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['external_product_id'], 'ExternalProducts'));\n $rules->add($rules->existsIn(['fulfillment_center_id'], 'FulfillmentCenters'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules) {\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['reseller_id'], 'Resellers'));\n $rules->add($rules->existsIn(['reseller_program_type_id'], 'ResellerProgramTypes'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['product_id'], 'Products'));\n $rules->add($rules->existsIn(['voucher_id'], 'Vouchers'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['fluxoconta_id'], 'Fluxocontas'), ['errorField' => 'fluxoconta_id']);\n $rules->add($rules->existsIn(['fornecedor_id'], 'Fornecedores'), ['errorField' => 'fornecedor_id']);\n $rules->add($rules->existsIn(['cliente_id'], 'Clientes'), ['errorField' => 'cliente_id']);\n $rules->add($rules->existsIn(['lancamento_id'], 'Lancamentos'), ['errorField' => 'lancamento_id']);\n $rules->add($rules->existsIn(['dreconta_id'], 'Drecontas'), ['errorField' => 'dreconta_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['item_id'], 'Items'));\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['borrowed_status_id'], 'BorrowedStatus'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['product_code']));\n $rules->add($rules->existsIn(['category_id'], 'Categories'));\n $rules->add($rules->existsIn(['brand_id'], 'Brands'));\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n // $rules->add($rules->existsIn(['image_id'], 'Images'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['unit_id'], 'Units'), ['errorField' => 'unit_id']);\n $rules->add($rules->existsIn(['user_id'], 'Users'), ['errorField' => 'user_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['usuario_id'], 'Usuarios'), ['errorField' => 'usuario_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['session_year_id'], 'SessionYears'));\n $rules->add($rules->existsIn(['student_class_id'], 'StudentClasses'));\n $rules->add($rules->existsIn(['stream_id'], 'Streams'));\n $rules->add($rules->existsIn(['parent_id'], 'ParentExamMasters'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->isUnique(['username']));\n $rules->add($rules->isUnique(['email']));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['loja_id'], 'Lojas'), ['errorField' => 'loja_id']);\n $rules->add($rules->existsIn(['transportadora_id'], 'Transportadoras'), ['errorField' => 'transportadora_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['email']));\n $rules->add($rules->existsIn(['student_id'], 'Students'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['equipment_type_id'], 'EquipmentTypes'));\n $rules->add($rules->existsIn(['department_id'], 'Departments'));\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->isUnique(['block', 'unit_number']), ['errorField' => 'unit_number']);\n $rules->add($rules->existsIn(['unit_type_id'], 'UnitTypes'), ['errorField' => 'unit_type_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['openid']));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['test_run_id'], 'TestRuns'));\n $rules->add($rules->existsIn(['stream_id'], 'Streams'));\n $rules->add($rules->existsIn(['parameter_id'], 'Parameters'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\r\n {\r\n $rules->add($rules->existsIn(['committee_id'], 'Committees'));\r\n $rules->add($rules->existsIn(['user_id'], 'Users'));\r\n $rules->add($rules->existsIn(['item_category_id'], 'ItemCategories'));\r\n return $rules;\r\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['module_id'], 'Modules'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['material_type_id'], 'MaterialTypes'));\n $rules->add($rules->existsIn(['professor_id'], 'Professors'));\n $rules->add($rules->existsIn(['course_id'], 'Courses'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['categoria_id'], 'Categorias'));\n $rules->add($rules->existsIn(['usuario_id'], 'Usuarios'));\n// $rules->add($rules->existsIn(['empresa_id'], 'Empresas'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['asset_number']));\n $rules->add($rules->existsIn(['warehouse_id'], 'Warehouses'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->isUnique(['email']), ['errorField' => 'email']);\n $rules->add($rules->isUnique(['name']), ['errorField' => 'name']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules) {\n $rules->add($rules->existsIn(['module_id'], 'Modules'));\n $rules->add($rules->existsIn(['module_action_group_id'], 'ModuleActionGroups'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\r\n {\r\n $rules->add($rules->isUnique(['email']));\r\n $rules->add($rules->existsIn(['parent_id'], 'ParentOffices'));\r\n $rules->add($rules->existsIn(['office_level_id'], 'OfficeLevels'));\r\n $rules->add($rules->existsIn(['area_division_id'], 'AreaDivisions'));\r\n $rules->add($rules->existsIn(['area_district_id'], 'AreaDistricts'));\r\n return $rules;\r\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['traysize_id'], 'Traysizes'));\n $rules->add($rules->isUnique(['shelf_barcode']));\n\n return $rules;\n }", "private function getValidator()\n {\n $v = new Validator();\n $v->addRules([\n ['label', 'Label', 'required'],\n ['num_value', 'Number', 'exists type=number'],\n ['comment', 'Comment', 'exists'],\n ]);\n return $v;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['country_id'], 'Countries'));\n $rules->add($rules->existsIn(['price_master_id'], 'PriceMasters'));\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['student_id'], 'Students'));\n $rules->add($rules->existsIn(['meeting_id'], 'Meetings'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['name']));\n $rules->add($rules->existsIn(['expense_type_id'], 'ExpensesTypes'));\n $rules->add($rules->existsIn(['vendor_id'], 'Vendors'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['email']));\n $rules->add($rules->existsIn(['contact_types_id'], 'ContactTypes'));\n $rules->add($rules->existsIn(['clients_id'], 'Clients'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n //$rules->add($rules->isUnique(['email']));\n //$rules->add($rules->existsIn(['state_id'], 'States'));\n\n return $rules;\n }", "public function getValidator();", "public function getValidator();", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['email']));\n $rules->add($rules->existsIn(['empresa_id'], 'Empresas'));\n\n return $rules;\n }", "protected function createValidator() {\n return $this->validator;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['course_id'], 'Courses'));\n $rules->add($rules->existsIn(['professor_id'], 'Professors'));\n $rules->add($rules->existsIn(['semester_id'], 'Semesters'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['zone_id'], 'Zones'), ['errorField' => 'zone_id']);\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['category_id'], 'Categories'));\n $rules->add($rules->existsIn(['series_id'], 'EventSeries'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['budget_item_id'], 'BudgetItems'));\n $rules->add($rules->existsIn(['schedule_id'], 'Schedules'));\n $rules->add($rules->existsIn(['payment_statement_id'], 'PaymentStatements'));\n $rules->add($rules->existsIn(['user_created_id'], 'Users'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['item_id'], 'Items'));\n $rules->add($rules->existsIn(['unit_id'], 'Units'));\n\n return $rules;\n }", "protected function getValidationFactory()\n {\n return app('Illuminate\\Contracts\\Validation\\Factory');\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['cidade_id'], 'Cidades'));\n $rules->add($rules->existsIn(['cliente_id'], 'Clientes'));\n $rules->add($rules->existsIn(['funcionario_id'], 'Funcionarios'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['username']));\n $rules->add($rules->isUnique(['email']));\n $rules->add($rules->existsIn(['role_id'], 'Roles'));\n $rules->add($rules->existsIn(['auth_role_id'], 'AuthRoles'));\n $rules->add($rules->existsIn(['section_id'], 'Sections'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['listing_id'], 'Listings'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['formula_id'], 'Formulas'));\n $rules->add($rules->isUnique(['hash']));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['brand_id'], 'Brands'));\n $rules->add($rules->existsIn(['mobile_model_id'], 'MobileModels'));\n $rules->add($rules->existsIn(['network_id'], 'Networks'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n // $rules->add($rules->existsIn(['recipient_id'], 'Recipients'));\n // $rules->add($rules->existsIn(['collector_id'], 'Collectors'));\n // $rules->add($rules->existsIn(['origin_id'], 'Origins'));\n // $rules->add($rules->existsIn(['origin_survey_id'], 'OriginSurveys'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['designation_id'], 'Designations'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n\t{\n\t\t$rules->add($rules->existsIn(['category_id'], 'Categories'));\n\t\t$rules->add($rules->existsIn(['user_id'], 'Users'));\n\n\t\treturn $rules;\n\t}", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['project_id'], 'Projects'));\n $rules->add($rules->existsIn(['category_id'], 'Categories'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['employee_id'], 'Employees'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['usuario_id'], 'Usuarios'));\n $rules->add($rules->existsIn(['cidade_id'], 'Cidades'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['yearly_sample_id'], 'YearlySamples'));\n $rules->add($rules->existsIn(['monthly_sample_id'], 'MonthlySamples'));\n $rules->add($rules->existsIn(['state_id'], 'States'));\n $rules->add($rules->existsIn(['district_id'], 'Districts'));\n $rules->add($rules->existsIn(['dispatch_id'], 'Dispatches'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['domain_id'], 'Domains'));\n $rules->add($rules->existsIn(['theme_id'], 'Themes'));\n\n return $rules;\n }", "public static function getRules() \n {\n return self::$rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['company_id'], 'Companies'));\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules): RulesChecker\n {\n $rules->add($rules->existsIn(['business_id'], 'Businesses'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n\t{\n\t\t$rules->add($rules->isUnique(['svid']));\n\t\t$rules->add($rules->existsIn(['user_id'], 'Users'));\n\t\t$rules->add($rules->existsIn(['server_id'], 'Servers'));\n\n\t\treturn $rules;\n\t}", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['correo']));\n $rules->add($rules->isUnique(['nombre_usuario']));\n $rules->add($rules->isUnique(['identificacion']));\n $rules->add($rules->existsIn(['roles_id'], 'Roles'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['company_id'], 'Companies'));\n $rules->add($rules->existsIn(['company_member_type_id'], 'CompanyMemberTypes'));\n $rules->add($rules->existsIn(['master_financial_year_id'], 'MasterFinancialYears'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['route_id'], 'Routes'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n //$rules->add($rules->existsIn(['softland_id'], 'Softlands'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['id']));\n $rules->add($rules->existsIn(['category_id'], 'Categories'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['email']));\n $rules->add($rules->existsIn(['role_id'], 'Roles'));\n $rules->add($rules->existsIn(['member_type_id'], 'MemberTypes'));\n $rules->add($rules->existsIn(['turn_over_id'], 'TurnOvers'));\n $rules->add($rules->existsIn(['social_id'], 'Socials'));\n $rules->add($rules->existsIn(['fb_user_id'], 'FbUsers'));\n\n return $rules;\n }", "public function getValidator()\n\t{\n\t\tif (!is_object($this->_validator)) {\n\t\t\t$validatorClass = $this->xpdo->loadClass('validation.xPDOValidator', XPDO_CORE_PATH, true, true);\n\t\t\tif ($derivedClass = $this->getOption(xPDO::OPT_VALIDATOR_CLASS, null, '')) {\n\t\t\t\tif ($derivedClass = $this->xpdo->loadClass($derivedClass, '', false, true)) {\n\t\t\t\t\t$validatorClass = $derivedClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($profitClass = $this->getOption('mlmsystem_handler_class_profit_validator', null, '')) {\n\t\t\t\tif ($profitClass = $this->xpdo->loadClass($profitClass, $this->getOption('mlmsystem_core_path', null, MODX_CORE_PATH . 'components/mlmsystem/') . 'handlers/validations/', false, true)) {\n\t\t\t\t\t$validatorClass = $profitClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($validatorClass) {\n\t\t\t\t$this->_validator = new $validatorClass($this);\n\t\t\t}\n\t\t}\n\t\treturn $this->_validator;\n\t}", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['exam_master_id'], 'ExamMasters'));\n\n return $rules;\n }", "private function createValidator()\n {\n // add custom validation rules\n \\Validator::extend('contains_caps',\n function($field, $value, $params)\n {\n return preg_match('#[A-Z]#', $value);\n }\n );\n\n \\Validator::extend('contains_digit',\n function($field, $value, $params)\n {\n return preg_match('#[0-9]#', $value);\n }\n );\n\n // set array of messages for custom rules\n $messages = array(\n 'contains_caps' => ':attribute must contain at least one capital letter.',\n 'contains_digit' => ':attribute must contain at least one numeric digit.'\n );\n\n // set array of rules to use for validation (many are Laravel's built-ins)\n $rules = array(\n 'email' => 'required|email|max:255',\n 'password' => 'required|between:8,50|contains_caps|contains_digit', // password has some \"strength\" requirements\n 'first_name' => 'required|max:50',\n 'last_name' => 'required|max:50',\n 'city' => 'required|max:100',\n 'state' => 'required|max:2',\n 'zip' => 'required|max:20',\n 'biography' => 'required',\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, $messages);\n\n return $validator;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['book_email']));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['tel']));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['public_post_id'], 'PublicPosts'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules) {\n $rules->add($rules->existsIn(['bank_account_id'], 'BankAccounts'));\n $rules->add($rules->existsIn(['org_id'], 'Orgs'));\n $rules->add($rules->existsIn(['branch_id'], 'Branches'));\n $rules->add($rules->existsIn(['bpartner_id'], 'Bpartners'));\n $rules->add($rules->existsIn(['warehouse_id'], 'Warehouses'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['request_id'], 'Requests'));\n $rules->add($rules->existsIn(['resource_id'], 'Resources'));\n $rules->add($rules->existsIn(['service_id'], 'Services'));\n $rules->add($rules->isUnique(['request_id', 'resource_id', 'service_id']));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['decret_id'], 'Decrets'));\n $rules->add($rules->existsIn(['team_id'], 'Teams'));\n $rules->add($rules->existsIn(['expert_id'], 'Experts'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['student_id'], 'Students'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['trip_id'], 'Trips'));\n $rules->add($rules->existsIn(['stop_id'], 'Stops'));\n\n return $rules;\n }", "public function getRule();", "public function buildRules(RulesChecker $rules) {\n $rules->add($rules->existsIn(['post_id'], 'Posts'));\n $rules->add($rules->existsIn(['group_id'], 'Groups'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['uuid']));\n $rules->add($rules->isUnique(['hash']));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules) {\n\t\t$rules->add($rules->isUnique(['token'], 'This token is already in use.'));\n\t\treturn $rules;\n\t}", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->isUnique(['username']));\n //$rules->add($rules->isUnique(['email']));\n $rules->add($rules->existsIn(['role_id'], 'Roles'));\n $rules->add($rules->existsIn(['shop_id'], 'Shops'));\n\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['user_id'], 'Users'));\n $rules->add($rules->existsIn(['driver_id'], 'Drivers'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['local_id'], 'Locals'));\n $rules->add($rules->existsIn(['visitor_id'], 'Visitors'));\n $rules->add($rules->existsIn(['football_day_id'], 'FootballDays'));\n return $rules;\n }", "public function buildRules(RulesChecker $rules)\n {\n $rules->add($rules->existsIn(['patient_id'], 'Patients'));\n $rules->add($rules->existsIn(['visit_speciality_id'], 'VisitSpecialities'));\n $rules->add($rules->existsIn(['manager_operator_id'], 'ManagerOperators'));\n return $rules;\n }" ]
[ "0.6401195", "0.63879603", "0.6270749", "0.62357", "0.6193363", "0.60837686", "0.6027178", "0.6020149", "0.60078835", "0.5993612", "0.59666306", "0.5961007", "0.595182", "0.595182", "0.58882016", "0.5873845", "0.5867226", "0.5863504", "0.5859753", "0.5851237", "0.5811037", "0.58104545", "0.5798542", "0.57927024", "0.57844263", "0.5780472", "0.5777008", "0.57753825", "0.5774065", "0.57664907", "0.5764755", "0.57616234", "0.5751861", "0.57515705", "0.5749998", "0.5746887", "0.5732181", "0.5732115", "0.5731939", "0.57271856", "0.57254714", "0.5723878", "0.572003", "0.57173544", "0.5716627", "0.57165694", "0.57093525", "0.5700421", "0.569708", "0.56942403", "0.56942403", "0.5690252", "0.5684399", "0.5680205", "0.56771517", "0.5670662", "0.5667726", "0.56666094", "0.5665826", "0.5660966", "0.5653464", "0.56532276", "0.5651506", "0.56451327", "0.5644794", "0.5644579", "0.56431735", "0.56420934", "0.5639976", "0.5637513", "0.56365496", "0.5636415", "0.56364", "0.5633645", "0.563107", "0.563007", "0.56285316", "0.562824", "0.5627858", "0.562606", "0.5625061", "0.5623336", "0.561909", "0.5617984", "0.5616207", "0.5614553", "0.56109744", "0.5606707", "0.5604016", "0.56021446", "0.5596994", "0.5596124", "0.5594893", "0.5593547", "0.55904216", "0.5588834", "0.5577121", "0.5573776", "0.55714744", "0.5571347", "0.557113" ]
0.0
-1
Get a preference value from the prefs table.
public function getPreference($name, $userId = 1, $default = null) { if(($record = $this->find()->where(['user_id' => $userId, 'name' => $name])->first()) != false) return $record['value']; return $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get($n)\n\t{\n\t\tif (isset($this->prefs[$n]['value'])) {\n\t\t\treturn $this->prefs[$n]['value'];\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function get_setting() {\n // $this->db->where('option_name', $opname);\n \n $query = $this->db->get('t_pref');\n return $query->row();\n }", "function func_getPreference($user_id, $preference_name)\n\t{\n\t\t$condition = \"preference_name = '$preference_name' AND user_id = '$user_id' \";\n\t\t$one_record = func_getSingleRowFromTable(\"preferences\", $condition);\n\t\tif ($one_record == null)\n\t\t\treturn null;\n\t\treturn $one_record['preference_value'];\n\t}", "function func_getSystemPreference($preference_name)\n\t{\n\t\t$condition = \"preference_name = '$preference_name'\";\n\t\t$one_record = func_getSingleRowFromTable(\"preferences\", $condition);\n\t\tif ($one_record == null)\n\t\t\treturn null;\n\t\treturn $one_record['preference_value'];\n\t}", "function get_pref($pref, $objectid=null) {\n global $CFG;\n $fullprefname = 'grade_report_' . $pref;\n\n $retval = null;\n\n if (!isset($this) OR get_class($this) != 'grade_report') {\n if (!empty($objectid)) {\n $retval = get_user_preferences($fullprefname . $objectid, grade_report::get_pref($pref));\n } else {\n $retval = get_user_preferences($fullprefname, $CFG->$fullprefname);\n }\n } else {\n if (empty($this->prefs[$pref.$objectid])) {\n\n if (!empty($objectid)) {\n $retval = get_user_preferences($fullprefname . $objectid);\n if (empty($retval)) {\n // No item pref found, we are returning the global preference\n $retval = $this->get_pref($pref);\n $objectid = null;\n }\n } else {\n $retval = get_user_preferences($fullprefname, $CFG->$fullprefname);\n }\n $this->prefs[$pref.$objectid] = $retval;\n } else {\n $retval = $this->prefs[$pref.$objectid];\n }\n }\n\n return $retval;\n }", "public function getPreference()\n {\n return $this->preference;\n }", "public function getPreference(): ?int {\n $val = $this->getBackingStore()->get('preference');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'preference'\");\n }", "function getUserPrefs($user_id){\n\t\t$sql = \"\n\t\t\tSELECT pp.pref_name pref_name, \n\t\t\t\t\tcoalesce(pu.pref_value, pp.pref_value) pref_value\n\t\t\tFROM user_preferences pp \n\t\t\t\tleft join user_preferences pu on \n\t\t\t\t\tpp.pref_name = pu.pref_name and \n\t\t\t\t\tpu.pref_user = '$user_id'\n\t\t\tWHERE pp.pref_user = 0\t\t\n\t\t\";\n\t\treturn db_loadHashList($sql);\n\t}", "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 GetSetting ($cDb, $id, $value) {\n\t$id = MakeSafeString($id);\n\t$sQuery = \"SELECT `VALUE` FROM `setting` WHERE `ID`='$id'\";\n\t$cResult = mysql_query($sQuery, $cDb);\n\tif ($cResult != null) {\n\t\tif ($aRow = mysql_fetch_row($cResult)) $value = $aRow[0];\n\t\tmysql_free_result($cResult);\n\t}\n\treturn $value;\n}", "function get_setting($setting)\n{\n $row = Setting::where('name', $setting)->first();\n\n return $row ? $row->value : null;\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 getReadPreference();", "function preference(\\Illuminate\\Database\\Eloquent\\Model $owner, string $key, $default = null)\n {\n return app('preferences')->getWithValue($owner, $key, $default);\n }", "function getProp($key){\n global $mysqli;\n $sql = \"SELECT * FROM setting WHERE `key` = '\".$key.\"'\";\n if($result = $mysqli->query($sql)){\n return $result->fetch_object()->value;\n }else{\n return false;\n }\n }", "public function getSettingValue()\n {\n if (array_key_exists(\"settingValue\", $this->_propDict)) {\n return $this->_propDict[\"settingValue\"];\n } else {\n return null;\n }\n }", "public function getValue()\n {\n if (array_key_exists(\"value\", $this->_propDict)) {\n return $this->_propDict[\"value\"];\n } else {\n return null;\n }\n }", "public function getValue()\n {\n if (array_key_exists(\"value\", $this->_propDict)) {\n return $this->_propDict[\"value\"];\n } else {\n return null;\n }\n }", "public function get_value() {\n global $wpdb;\n $table_name = $wpdb->prefix . \"gtmetrix\";\n $return = $wpdb->get_results( \"SELECT * FROM $table_name ORDER BY id DESC LIMIT 1\" );\n return $return[0];\n }", "function GetValue($key, $toCookie = true)\r\n\t{\r\n\t\tif ($v = DB::GET ( $key ))\r\n\t\t{\r\n\t\t\t$this->SaveValue ( $key, $v );\r\n\t\t\treturn $v;\r\n\t\t}\r\n\t\t\r\n\t\tif ($v = DB::POST ( $key ))\r\n\t\t{\r\n\t\t\t$this->SaveValue ( $key, $v );\r\n\t\t\treturn $v;\r\n\t\t}\r\n\t\t\r\n\t\tif ($toCookie)\r\n\t\t{\r\n\t\t\treturn DB::COOKIE ( $key );\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "function getConfigValue($key) {\r\n\t\t$db = & JFactory::getDBO() ;\r\n\t\t$sql = 'SELECT config_value FROM #__osmembership_configs WHERE config_key=\"'.$key.'\"';\r\n\t\t$db->setQuery($sql) ;\t\t\r\n\t\treturn $db->loadResult();\r\n\t}", "function getSystemSettingValue($code){\n\t\t\n\t\t$sql = \"SELECT value \n\t\t\t\tFROM settings\n\t\t\t\tWHERE varname = '\".$code.\"'\";\n\t\t$rslt = $this->dbclass->select($sql);\n\t\t\n\t\treturn $rslt[0]['value'];\n\t}", "public static function getVisibleValueToProvider (){\n \t\t$settings = self::where('key', 'visible_value_to_provider')->first();\n\n \t\tif($settings)\n\t\t\treturn $settings->value;\n\t\telse \n\t\t\treturn 0;\n \t}", "private function getUserNativePreferencesTable()\n\t{\n\t\tif (!$this->table_user_native_preferences)\n\t\t{\n\t\t\t$this->table_user_native_preferences = $this->getServiceLocator()->get('FrontUsers\\Tables\\UserNativePreferencesTable');\n\t\t}//end if\n\t\t\n\t\treturn $this->table_user_native_preferences;\n\t}", "function getValue($setting)\n\t\t{\n\t\t\t// lookup the value in the array \n\t\t\tif (isset($this->options[$setting]))\n\t\t\t{\n\t\t\t\t// return its value, if set\n\t\t\t\treturn $this->options[$setting];\n\t\t\t}\n\t\t\t\n\t\t\t// default to NULL\n\t\t\treturn NULL;\n\t\t}", "public static function getSetting($setting_name)\n\t{\n\n\t\t//return SettingValue::where(\"setting_name\", \"=\", $setting_name)->where(\"user_id\",\"=\",Auth::user()->id)->firstOrFail();\n\n\t\t$q = \"SELECT setting_name, label, type, options, description, value, settings.id as id FROM settings \n\t\tRIGHT JOIN setting_values ON setting_values.setting_id=settings.id\n\t\tWHERE setting_name=? AND user_id=? LIMIT 1\";\n\n\t\t$result = DB::select($q,array($setting_name,Auth::user()->id));\n\n\t\tif (count($result) > 0) {\n\t\t\treturn $result[0];\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public function get_preference($preference_name, $defaultvalue='')\n\t{\n\t\treturn CmsApplication::get_preference($this->get_name() . \"_mapi_pref_\" . $preference_name, $defaultvalue);\n\t}", "public function getSetting() {}", "public function getSetting() {}", "public static function getPreferences($preferences_key = '')\n {\n $preferences = (\\Auth::user()) ? \\Auth::user()->preferences : '';\n\n //getting the needle\n $userHelper = new UserHelper();\n\n return $userHelper->getPreferencesNeedle($preferences, $preferences_key);\n }", "public function getSetting($name) {\n\t\t##\n\t\t##\tPARAMETERS\n\t\t##\t\t@name\t\t\t\tThe name of the settings key\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe value of the selected setting on success\n\t\t##\t\tFalse on failure\n\t\t$sql = <<<EOD\n\t\tSELECT\n\t\t\t{$this->wpdb->prefix}topspin_settings.value\n\t\tFROM\n\t\t\t{$this->wpdb->prefix}topspin_settings\n\t\tWHERE\n\t\t\tname = %s\nEOD;\n\t\treturn $this->wpdb->get_var($this->wpdb->prepare($sql,$name));\n\t}", "public function get_value() {\n\t\t$row = $this->get_row();\n\t\tif ($row) {\n\t\t\treturn current($row);\n\t\t}\n\t}", "public function getPreference($id)\n {\n $response = $this->client->get(\n '/checkout/preferences/' . $id,\n [],\n ['access_token' => $this->getAccessToken()]\n );\n\n return $this->handleResponse($response);\n }", "public function preferences()\n {\n return $this->hasOne('Restboat\\Models\\UserPreference', 'user_id', 'id');\n }", "public function playerpref($prefname = \"\",$prefvalue = \"\")\n\t{\n\t\tif (empty($prefname))\n\t\t{\n\t\t\tuser_error(\"playerpref() empty prefname.\");\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($prefvalue) || $prefvalue == \"?\")\n\t\t{\n\t\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" playerpref \".urlencode($prefname).\" ?\");\n\t\t}\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" playerpref \".urlencode($prefname).\" \".urlencode($prefvalue));\n\t}", "public function get($key)\n {\n $item = apc_fetch($key);\n\n return $item ? $item['value'] : null;\n }", "function getSetting($zeile)\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT $zeile FROM \".PREFIX.\"_modul_shop LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\treturn $row->$zeile;\r\n\t}", "function get_value_preferences_by_group_name($params) {\n $sql = \"SELECT * FROM com_preferences\n WHERE pref_group = ? AND pref_nm = ?\n ORDER BY pref_nm ASC\";\n $query = $this->db->query($sql, $params);\n if ($query->num_rows() > 0) {\n $result = $query->row_array();\n $query->free_result();\n return $result['pref_value'];\n } else {\n return '';\n }\n }", "function _get_setting($setting_name, $default = null)\n {\n $value = $this->getDb()->get_value('select value from mwg_setting where name=?', $setting_name); \n if ($value) return $value;\n\n $value = $this->getDb()->get_value('select value from settings where name=?', $setting_name); \n if ($value) {\n return stripslashes($value); \n } \n if ($default) {\n return $default;\n } \n return $value;\n }", "public function getSettingValue($setting_key)\n {\n $sql = \"SELECT setting_value FROM settings WHERE setting_key = :key\";\n\n $this->db->query($sql);\n\n $this->db->bind(\":key\", $setting_key);\n\n if ($this->db->execute()) {\n $setting_value = $this->db->single()->setting_value;\n }\n\n return $setting_value;\n }", "public static function get($key=null){\n\t\t $connection = MyActiveRecord::getDb();\n\t\t if(empty(self::$psconfig_values))\n\t\t {\n\t\t\t $query = \"SELECT name, value FROM \" . SITE_CONFIG;\n\t\t\t $rst = $connection->createCommand($query)->queryAll();\n\t\t\t foreach($rst as $v){\n\t\t\t\t self::$psconfig_values[$v['name']] = $v['value'];\n\t\t\t }\n\t\t }\n \t\treturn self::$psconfig_values[$key];\n\t\t}", "public function GetSettingValue($name)\r\n\t\t{\r\n\t\t\treturn $this->DB->GetOne(\"SELECT value FROM client_settings WHERE clientid=? AND `key`=?\",\r\n\t\t\t\tarray($this->ID, $name)\r\n\t\t\t);\r\n\t\t}", "public function getValue()\n {\n if (isset($_COOKIE[$this->name])) {\n return $_COOKIE[$this->name];\n } else {\n return null;\n }\n }", "function get_value_db()\n\t{\n\t\treturn $this->value;\n\t}", "function getSettingValue($type){\n return sqlSelectOne(\"SELECT * FROM settings WHERE setting_type='$type'\", 'setting_value');\n\n}", "function getSettingValue($key)\n{\n return Setting::where('name', $key)->value('value');\n}", "public function getPreference($className)\n {\n return $this->getObjectManager()->getPreference($className);\n }", "abstract public function findValueInstance(string $settingName): ?SettingValue;", "public function fetchDBVar($name) {\n $name = strtolower($name);\n $configElement = R::findOne($this->_dbConfigTable, 'param = ?', array($name));\n return $configElement->value;\n }", "public function getValue($value_id) {\n return $this->getValueDao()->searchById($value_id, $this->id)->getRow();\n }", "public function get_one_value() {\n return $this->hasMany('App\\SettingsValue')->first();\n }", "private function getSetting()\n {\n $r = Session::get('setting');\n Session::forget('setting');\n\n return $r;\n }", "public function get($key) {\n if (!isset($this->settings->$key)) {\n return null;\n }\n\n return $this->settings->$key;\n }", "public static function get($key)\n\t{\n\t\tif (is_array(self::$_CONF) AND array_key_exists($key, self::$_CONF))\n\t\t\treturn self::$_CONF[$key];\n\t\telseif($value = Db::getInstance()->getValue('SELECT `value` FROM `'.DB_PREFIX.'configuration` WHERE `name` = \\''.pSQL($key).'\\'')){\n\t\t\tself::$_CONF[$key] = $value;\n\t\t\treturn $value;\n\t\t}\n\t\treturn false;\n\t}", "public function getSettingDisplayValue()\n {\n if (array_key_exists(\"settingDisplayValue\", $this->_propDict)) {\n return $this->_propDict[\"settingDisplayValue\"];\n } else {\n return null;\n }\n }", "public function getSetting(){\n\t\treturn $this->findById(1);\n\t}", "public function get($key)\n {\n return $this->settings[$key];\n }", "static function getValue($name) {\r\n if (isset(self::$config[$name])) \r\n return self::$config[$name];\r\n else {\r\n return DB::getConfig($name);\r\n }\r\n }", "function get_blog_status( $id, $pref ) {\n\tglobal $wpdb;\n\n\t$details = get_site( $id );\n\tif ( $details )\n\t\treturn $details->$pref;\n\n\treturn $wpdb->get_var( $wpdb->prepare(\"SELECT %s FROM {$wpdb->blogs} WHERE blog_id = %d\", $pref, $id) );\n}", "public function config($valueOf)\n {\n return DB::table('settings')->where('userId', Auth::user()->id)->value($valueOf);\n }", "function getSettingValue($field_name=null){\r\n\t\tif($field_name==null) return array();\r\n\t\t$this->db->select(\"*\");\r\n\t\t$this->db->where(array('is_active'=>true));\r\n\t\t$recordSet = $this->db->get(TBL_MST_SETTINGS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\tif(count($data)>0){\r\n\t\t\treturn $data[0]->$field_name;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\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 get_setting($code){\n\t\tif(!is_array($this->settings_cache)){\n\t\t\t$this->load_settings();\n\t\t}\n\t\treturn $this->settings_cache[$code];\n\t}", "function &getSetting($userId, $name, $assocType = null, $assocId = null) {\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT\tsetting_value,\n\t\t\t\tsetting_type\n\t\t\tFROM\tuser_settings\n\t\t\tWHERE\tuser_id = ? AND\n\t\t\t\tsetting_name = ? AND\n\t\t\t\tassoc_type = ? AND\n\t\t\t\tassoc_id = ?',\n\t\t\tarray(\n\t\t\t\t(int) $userId,\n\t\t\t\t$name,\n\t\t\t\t(int) $assocType,\n\t\t\t\t(int) $assocId\n\t\t\t)\n\t\t);\n\n\t\tif ($result->RecordCount() != 0) {\n\t\t\t$row =& $result->getRowAssoc(false);\n\t\t\t$returner = $this->convertFromDB($row['setting_value'], $row['setting_type']);\n\t\t} else {\n\t\t\t$returner = null;\n\t\t}\n\n\t\treturn $returner;\n\t}", "public function get_setting($id){\n\t\t$this->db->select('*')\n\t\t->from('settings')\n\t\t->where('setting_id = ', $id)\n\t\t->limit(1);\n\t\treturn $this->db->get()->result();\n\t}", "function userPreferencesDetails($usr=''){\n\t$usr=($usr!='')?$usr:$_SESSION['ws-tags']['ws-user']['id'];\n\t$query=$GLOBALS['cn']->query(\"SELECT preference FROM users_preferences WHERE id_user='\".$usr.\"'\");//todas las preferencias del usuario\n\twhile ($array=mysql_fetch_assoc($query)){\n\t\t$ids=explode(',',$array['preference']);//vector de preferencias\n\t\tforeach ($ids as $index){\n\t\t\tif ($index!=''){\n\t\t\t\t$validar=$GLOBALS['cn']->query(\"SELECT id FROM preference_details WHERE id='\".$index.\"' \");\n\t\t\t\tif (mysql_num_rows($validar)==0){\n\t\t\t\t\t$arrayPrefe[]=$index;\n\t\t\t\t}\n\t\t\t}//si el dato no esta vacio\n\t\t}//foreach\n\t}//while\n\treturn $arrayPrefe;\n}", "public function get($var)\n {\n $tab = $this->config;\n \n $explode = explode(':', $var);\n \n foreach ($explode as $vartmp)\n {\n if (isset($tab[$vartmp]))\n {\n $tab = $tab[$vartmp];\n }\n }\n\n return $tab == $this->config ? null : $tab;\n }", "public function get_setting($setting) {\n\t\treturn $this->settings[$setting] ?? null;\n\t}", "private function getProperty() {\n\t\t$return = NULL;\n\t\tif (session('reviewcycle') && session('property')) {\n\t\t\t$sql = 'SELECT `#__Property`.* FROM `#__Property` WHERE `#__Property`.`id` = ?';\n\t\t\t$result = $this->execute($sql, session('property'));\n\t\t} else {\n\t\t\t$sql = 'SELECT `#__Property`.* FROM `#__Property` LEFT JOIN `#__Property_User` ON `#__Property_User`.`property_id` = `#__Property`.`id` WHERE `#__Property_User`.`user_id` = ?';\n\t\t\t$result = $this->execute($sql, $this->id);\n\t\t}\n\n\t\tif (count($result) > 0) {\n\t\t\t$return[$result[0]['id']] = $result[0];\n\t\t}\n\t\treturn $return;\n\t}", "public function get($id) {\n return $this->currentValues[$id];\n }", "public function get() {\r\n return apc_fetch($this->key);\r\n }", "public function getValue() {\n\t\t$db = Loader::db();\n\t\t$value = $db->GetOne('select value from atDefault where avID = ?', array($this->getAttributeValueID()));\n\t\t\n\t\t$jsonHelper = Loader::helper('json');\n\t\treturn $jsonHelper->decode($value);\n\t}", "public function getValue() {\n\n\t\treturn trim(\n\t\t\tfile_get_contents(\n\t\t\t\tself::PINDIR.'/gpio'.$this->iPinNumber.'/value'\n\t\t\t)\n\t\t);\n\t}", "public function getValue($key){\n\t\tif (isset($this->_storage[$key])){\n\t\t\treturn $this->_storage[$key];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}", "public static function get($name)\n {\n // Check if the setting is cached in our static array\n if (isset(self::$settings[$name])) {\n return self::$settings[$name];\n }\n\n $setting = DB::table('settings')\n ->select('value', 'serialized')\n ->where('name', $name)\n ->first();\n\n if (!$setting) {\n self::$settings[$name] = null;\n } elseif ($setting->serialized) {\n self::$settings[$name] = unserialize($setting->value);\n } else {\n self::$settings[$name] = $setting->value;\n }\n\n return self::$settings[$name];\n }", "public function getDevicePreference()\n {\n return $this->device_preference;\n }", "private function get_back(){\n global $database; \n if(!empty($database)){\n \n $name = \"Wear Back\";\n $sql = \"SELECT value FROM settings WHERE name=:name LIMIT 1\"; \n $new = $database->query($sql,array(\"name\"=>$name),PDO::FETCH_OBJ);\n if(!empty($new)){\n\n $dress = array_shift($new);\n\n return $dress->value;\n \n \n }else{\n \n return \"SunPlus\";\n\n }\n\n }else{\n return \"SunPlus\";\n }\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 }", "function get_option($name) {\n $setting = Setting::where('name', $name)->first();\n if(!$setting) {\n return \"\";\n }\n return $setting->value;\n}", "public function readUserNativePreferences($key = FALSE)\n\t{\n\t\t$this->isInitialized();\n\t\t\n\t\t//load data\n\t\t$objData = $this->getUserNativePreferencesTable()->get($this->user_local_identifier);\n\n\t\tif (!$objData)\n\t\t{\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\t//decrypt data\n\t\t\t$d = $objData->get('data');\n\t\t\t$objData = unserialize($d);\t\n\t\t}//end if\n\t\t\n\t\tif ($key !== FALSE)\n\t\t{\n\t\t\treturn $objData->$key;\n\t\t} else {\n\t\t\treturn $objData;\n\t\t}//end if\n\t}", "function setting($setting_name = null) {\n $CI =& get_instance();\n if ($setting_name) {\n $query = $CI->db->get_where('settings', ['name' => $setting_name]);\n return $query->row() ? trim($query->row()->value) : '';\n }\n return '';\n}", "function getValueFromField()\n {\n return $this->current_row[ key( $this->mapping ) ];\n }", "public function getValueOf($id) {\n\t\t$config = $this->em->getRepository('SSNTherapassBundle:Config')->find($id);\n\t\tif (is_null($config)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $config->getValue();\n\t}", "public static function get($key)\n {\n return @static::$settings[$key];\n }", "static function retrieveById($value) {\n\t\treturn Quiz::retrieveByPK($value);\n\t}", "public function getItembPt() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (array_key_exists(7, $this->_result)) return (string) $this->_result[7];\n\t\t\telse parent::throwGetColException('Not set PollTemplatesModel::getItembPt', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('No result From PollTemplatesModel::getItembPt', __LINE__, __FILE__);\n\t}", "public function getPreferences(): ?array\n {\n return $this->preferences;\n }", "public function findValue(string $settingName)\n {\n if ($setting = $this->findValueInstance($settingName)) {\n return $setting->getValue();\n } else {\n return null;\n }\n }", "public static function get($valueOf, $userId)\n {\n return Setting::where('userId', $userId)->value($valueOf);\n }", "public function value($column)\r\n {\r\n $rs = (array) $this->first();\r\n return $rs[$column];\r\n }", "public\tfunction\tgetValue($offset)\n\t\t{\n\t\t\tif(!array_key_exists($offset, $this->_values)) {\n\t\t\t\treturn\t$this->_values[$offset];\n\t\t\t}\n\t\t}", "function get_setting($setting_id, $default_value = '') {\n //it doesn't requiers the tds_ prefix\n if (td_util::get_option('tds_' . $setting_id) == $this->get_default($setting_id)) {\n return $default_value;\n } else {\n return td_util::get_option('tds_' . $setting_id);\n }\n }", "public function get($key)\n {\n if (!$this->m_active) {\n return false;\n }\n\n $rawCacheValue = apc_fetch($this->getRealKey($key));\n $cacheValue = is_string($rawCacheValue) ? unserialize($rawCacheValue) : $rawCacheValue;\n return $cacheValue;\n }", "function get($a_key)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (is_array(self::$values[$this->component_id]) &&\n\t\t\tis_set(self::$values[$this->component_id][$a_key]))\n\t\t{\n\t\t\treturn self::$values[$this->component_id][$a_key];\n\t\t}\n\t\t\n\t\t$set = $ilDB->query(\"SELECT value FROM usr_sess_istorage \".\n\t\t\t\" WHERE session_id = \".$ilDB->quote($this->session_id, \"text\").\n\t\t\t\" AND component_id = \".$ilDB->quote($this->component_id, \"text\").\n\t\t\t\" AND vkey = \".$ilDB->quote($a_key, \"text\")\n\t\t\t);\n\t\t$rec = $ilDB->fetchAssoc($set);\n\t\tself::$values[$this->component_id][$a_key] = $rec[\"value\"];\n\n\t\treturn $rec[\"value\"];\n\t}", "public function get($key = NULL)\n {\n if (!$key) return;\n $val = $this->_settings[$key];\n\n return isset($val) ? $val : NULL;\n }", "public function get($key){\n return $this->getSetting($key);\n }", "function getConfigurationValue($key) {\r\n $value = '';\r\n $sqlConfiguration = xtc_db_query(\"SELECT * FROM configuration WHERE configuration_key='\".strtoupper($key).\"' LIMIT 1\");\r\n if(xtc_db_num_rows($sqlConfiguration)>0){\r\n $dataConfiguration = xtc_db_fetch_array($sqlConfiguration);\r\n $value = $dataConfiguration['configuration_value'];\r\n }\r\n return $value; \r\n }", "public function getSetting($key) {\n\t\treturn $this->settings[$key];\n\t}", "public function loadRepliesOption()\n\t{\n\t\t$data = $this->db->select(\"select value from options where name ='default_status' and type = 'review_replies'\");\n\t\treturn $data[0]['value'];\n\t}" ]
[ "0.70849293", "0.685122", "0.6731178", "0.64129186", "0.6259684", "0.6232119", "0.59346163", "0.58389115", "0.57377374", "0.57233006", "0.5702368", "0.5677298", "0.55746394", "0.55652326", "0.5538508", "0.5469393", "0.5438157", "0.5438157", "0.5437015", "0.5410989", "0.5386068", "0.5348793", "0.5347433", "0.5336598", "0.5329087", "0.532435", "0.5323408", "0.5310911", "0.5310911", "0.53106284", "0.5289685", "0.5274779", "0.52663594", "0.5244465", "0.5237504", "0.5220392", "0.5204857", "0.51952755", "0.51799774", "0.51777977", "0.51684386", "0.5161956", "0.51593333", "0.5126531", "0.51261586", "0.51198846", "0.51192355", "0.51126856", "0.5077904", "0.5070958", "0.5054271", "0.5050059", "0.50493634", "0.5048083", "0.5035191", "0.5025855", "0.5024157", "0.5014185", "0.500562", "0.4997307", "0.4996982", "0.49812064", "0.49812064", "0.49696398", "0.49646991", "0.4964623", "0.49579242", "0.49551135", "0.49397898", "0.49384552", "0.49337897", "0.49315906", "0.49272785", "0.49228215", "0.49138045", "0.4913791", "0.4886659", "0.4883756", "0.488051", "0.48783836", "0.4878111", "0.4877953", "0.4877276", "0.48744437", "0.48691267", "0.48668164", "0.4866177", "0.48639828", "0.48626563", "0.48605952", "0.48590845", "0.48550898", "0.4854493", "0.48384193", "0.4838246", "0.48373908", "0.48354316", "0.4833748", "0.48313758", "0.4828343" ]
0.5415239
19
Show the form for editing the specified resource.
public function edit() { $user = User::where('id', Auth::user()->id)->get(); return view('admin/edituser', compact('user', '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) { $user = User::where('id', Auth::user()->id)->first(); $user->name = $request->name; $user->username = $request->username; $user->password = bcrypt($request->password); $user->save(); return redirect()->route('home', $request->id)->withSuccessMessage('Berhasil Mengubah Data'); }
{ "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
Create new HTTP response.
public function __construct($status = 200, HeadersInterface $headers = null, StreamInterface $body = null, Url $url) { parent::__construct($status, $headers, $body); $this->url = $url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createHttpResponse()\n {\n return new Response();\n }", "public function createResponse()\n {\n return new Response;\n }", "function response() {\n return new Response;\n }", "public function createResponse(): ResponseInterface\n\t\t{\n\t\t\treturn $this->responseFactory->createResponse()->withHeader('Content-Type', 'text/html; charset=utf-8');\n\t\t}", "public static function response(): Response\n {\n return new Response;\n }", "public function createResponseWriter();", "public function createResponse()\n {\n return new GuzzleResponse();\n }", "public function create(): ResponseInterface\n\t{\n\t\t$this->content = [];\n\t}", "protected function _getResponse() {\n\t\treturn new Response;\n\t}", "public function createResponse(): IResponse;", "public function as_response() {\n return Net_HTTP::Response($this);\n }", "public function create() {\r\n $this->response->setData(1);\r\n $this->response->setHeader('__CREATED', Http::Response(Http::CREATED));\r\n return TRUE;\r\n }", "protected function getResponse(): Response\n {\n return new Response(fopen('data://text/plain,', 'rb'), 200);\n }", "abstract public function createResponse(AbstractRequestClient $request);", "public function createResponse(): ResponseInterface {\n return $this->responseFactory->createResponse()->withHeader('Content-Type', 'application/json');\n }", "protected function construct_response()\n {\n $this->feedback['ok'] = $this->ok;\n $this->feedback['code'] = $this->code;\n $this->feedback['resource'] = $this->resource;\n }", "function create_response() {\n return File::saveLocalFile(get_response_prefix(), \"A response.\");\n}", "private function response() {\n if ($this->responseStatus !== 200) {\n $this->request['format'] = self::DEFAULT_RESPONSE_FORMAT;\n }\n $method = $this->request['format'] . 'Response';\n $this->response = array('status' => $this->responseStatus, 'body' => $this->$method());\n return $this;\n }", "abstract protected function createResponse(GuzzleResponse $response);", "protected function getCreateResponse()\n\t{\n\t\treturn new Api\\Response\\Create();\t\n\t}", "protected function response()\n {\n return new Response('php://memory');\n }", "abstract public function response();", "abstract protected function writeToResponse(Response $response) : Response;", "abstract protected function writeToResponse(Response $response) : Response;", "public function prepareResponse();", "public function response($response)\n {\n\n return new Response($response);\n\n }", "private function createResponse(){\r\n #scraping metatag to get IMAGE TITLE and FULL PATH INC FILE NAME \r\n $metaTag = get_meta_tags($this->url);\r\n\r\n \r\n $this->setImageTitle($metaTag[\"sailthru_title\"]); #setting up title\r\n $this->setFileName($metaTag[\"sailthru_image_full\"]); #setting up full file name\r\n $this->setDimensions(); #setting up image dimensions\r\n \r\n $this->setFileSize(); #setting up file size in kB\r\n \r\n #create response array based on properties\r\n $array = array('title' => $this->imageTitle,\r\n 'dimensions' => $this->imageDimensions,\r\n 'filename' => $this->getPlainFileName(),\r\n 'file size in kB' => $this->fileSize\r\n );\r\n \r\n return $array;\r\n }", "protected function created()\n {\n $this->response = $this->response->withStatus(201);\n $this->jsonBody($this->payload->getOutput());\n }", "public function create()\n {\n return \\Response::json('Not Implemented', 501);\n }", "public function toResponse(): Response\n {\n $response = clone RequestContext::getResponse();\n return $response->setException($this->getException())->auto($this->handleBody(), $this->getStatusCode());\n }", "public function makeResponse(): ResponseInterface;", "public function output(): \\Maleficarum\\Response\\AbstractResponse {\n $contentType = $this->handler->getContentType();\n $body = $this->handler->getBody();\n\n // add typical response headers\n $this\n ->response\n ->setHeader('Content-Type', $contentType);\n\n // send the response\n $this\n ->response\n ->setContent((string)$body)\n ->send();\n\n return $this;\n }", "function getresponse()\n {\n if ($this->response) return $this->response;\n $query_string = http_build_query($this->params);\n if ($this->method == \"GET\")\n {\n $path .= '?' . $query_string;\n }\n // set default headers\n $headers = $this->headers;\n if (empty($headers['User-Agent'])) $headers['User-Agent'] = 'php-httplib/1.0 (PHP ' . phpversion() . ')';\n if (empty($headers['Content-Type'])) $headers['Content-Type'] = 'application/x-www-form-urlencoded';\n if ($this->method == 'POST') $headers['Content-Length'] = strlen($query_string);\n $headers['Host'] = $this->host;\n // build the header string\n $request_header = strtoupper($this->method) . \" \" . $this->path . \" HTTP/1.1\\r\\n\";\n foreach ($headers as $key=>&$value)\n {\n $request_header .= $key . \": \" . $value . \"\\r\\n\";\n }\n $request_header .= \"Connection: close\\r\\n\\r\\n\";\n \n if ($this->method == \"POST\")\n {\n $request_header .= $query_string;\n }\n fwrite($this->socket, $request_header);\n $response_header = '';\n do\n {\n $response_header .= fread($this->socket, 1);\n }\n while (!preg_match('/\\\\r\\\\n\\\\r\\\\n$/', $response_header));\n $this->response = new HTTPResponse($this->socket, $response_header);\n return $this->response;\n }", "function response($newResponse=null) {\n static $response;\n if (!isset($response) || isset($newResponse))\n $response = $newResponse ?: new Response();\n return $response;\n}", "function response($content = '', $statusCode = 200)\n {\n return new \\Anonym\\Http\\Response($content, $statusCode);\n }", "protected function _response() {}", "private function respond()\n {\n $this->response->header('Content-Type', 'application/json');\n return $this->response;\n }", "public function generateResponse(){\n\n switch ($this->requestMethod) {\n\n case 'GET':\n if(isset($this->topicId)){\n\n $response = $this->getTopicById($this->topicId);\n\n }else{\n\n $response = $this->getAllTopic();\n \n } \n \n break;\n\n case 'POST':\n\n $response = $this->createTopic();\n \n break;\n \n case 'PUT':\n\n if($this->userAction === \"update_topic\"){\n $response = $this->updateTopic($this->topicId);\n }else{\n\n $response = $this->notFoundResponse();\n }\n \n break;\n\n case 'DELETE':\n if($this->userAction == \"delete_topic_info\"){\n $response = self::deleteUser($this->topicId);\n } \n \n break;\n \n default:\n $response = $this->invalidRoute();\n break;\n }\n \n echo $response['body'];\n\n }", "public function create() : Response\n {\n if (!$this->request->hasFiles()) {\n /**\n * @todo handle file hash to avoid uploading same files again\n */\n }\n\n return $this->response($this->processFiles());\n }", "public function create()\n {\n return response()->json(['SolicitudHTTP' => 'Exitosa', 'Mensaje' => 'Rubro creado']);\n }", "public function getResponse()\n\t{\n\t\t$outGoingResponse = $this->response;\n\t\t$request = $this->request;\n\n\t\t$headers = $outGoingResponse->getHeaders();\n\t\t$status_code = (isset($headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS])) ? $headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS] : 200;\n\t\tunset($headers[ODataConstants::HTTPRESPONSE_HEADER_STATUS]);\n\n\t\t$response = new Response(trim($outGoingResponse->getStream()), $status_code, array_filter($headers));\n\t\t$response->prepare($request->getRequest());\n\n\t\treturn $response;\n\t}", "function mkOpdsResponse($app, $content, $type)\n{\n $resp = $app->response();\n $resp->status(200);\n $resp->header('Content-type', $type);\n $resp->header('Content-Length', strlen($content));\n $resp->body($content);\n}", "private function resetReponse()\n {\n $this->app->singleton(\"response\", function () {\n return new Response();\n });\n }", "public function createResponse($data)\n {\n return $this->response = new GetManualJournalResponse($this, $data);\n }", "protected function createResponse($request) {\n // don't send anything if client has fresh data\n if (Request::hasMacro('isFresh') && $request->isFresh()) {\n return response(null)->setNotModified();\n }\n\n $response = null;\n\n $methodName = 'create' . ucfirst($this->desiredResponseFormat($request)) . 'Response';\n if (method_exists($this, $methodName)) {\n $response = $this->{$methodName}();\n }\n\n return $response;\n }", "public function getContent(): Response\n {\n return new Response(\n $this->content,\n Response::HTTP_OK\n );\n }", "protected function buildResponse()\n {\n $response = new Response('', 204);\n\n return $this->addHeaders($response, true );\n }", "public function create()\n {\n // NOTE not used\n return Response('Not found', 404);\n }", "public function create()\n {\n // NOTE not used\n return Response('Not found', 404);\n }", "public function create()\n {\n return response(null, 404);\n }", "public function create()\n {\n // Define objet to be returned as a json string\n $data = new \\stdClass();\n $data->success = false;\n $data->error = \"Not allowed\";\n\n return \\Response::json($data);\n }", "public function create(): Response\n {\n // ToDo: replace with correct response\n return response()->view('livewire-crud::create');\n }", "public function __invoke(): Response\n {\n return new Response('', Response::HTTP_NO_CONTENT);\n }", "public function toResponse()\n {\n $base = ['return_code' => is_null($this->fail) ? static::SUCCESS : static::FAIL, 'return_msg' => $this->fail];\n $attributes = array_merge($base, $this->attributes);\n if ($this->sign) {\n $attributes['sign'] = Support\\generate_sign($attributes, $this->app->getKey());\n }\n return new Response(XML::build($attributes));\n }", "function deliver_response(){\n\n // --- Step 1: Initialize variables and functions\n //\n // Deliver HTTP Response\n // The desired HTTP response content type: [json, html, xml]\n // The desired HTTP response data\n\n\n header('HTTP/1.1 '.$this->response['status'] . // Set HTTP Response\n ' '.$this->http_response_code[$this->response['status'] ]);\n header('Content-Type: application/json; charset=utf-8'); // Set HTTP Response Content Type\n $json_response = json_encode($this->response['data']); // Format data into a JSON response\n echo $json_response; // Deliver formatted data\n }", "public function createAction()\n {\n $data = $this->getRequest()->getBody();\n $model = $this->getBinding()->create($data);\n $responseClass = $this->container->getParameter('response.class');\n $response = new $responseClass($model, 201);\n\n return $response;\n }", "public function response();", "public function create()\n {\n return $this->makeJSONResponse(true, 'This endpoint is not implemented', [], []);\n }", "public function createResponse(array $data)\n {\n // Read data from request object\n return $purchaseResponseObj = new CompleteResponse($this, $data);\n }", "public function test_can_create_psr7_response(): void {\n\n\t\t$response = HTTP_Helper::response( array( 'key' => 'test_VALUE' ), 500 );\n\n\t\t$body = json_decode( (string) $response->getBody(), true );\n\n\t\t$this->assertInstanceOf( ResponseInterface::class, $response );\n\t\t$this->assertIsArray( $body );\n\t\t$this->assertArrayHasKey( 'key', $body );\n\t\t$this->assertEquals( 'test_VALUE', $body['key'] );\n\t\t$this->assertEquals( 500, $response->getStatusCode() );\n\t}", "public function create()\n {\n return $this->response->view($this->getViewName('create'));\n }", "function makeResponse($response)\n {\n $result = current(Util::toArray($response));\n\n $response = new Response([\n 'raw_body' => $result,\n\n ## get response message as array\n 'default_expected' => function($rawBody) use ($result) {\n return $result;\n }\n ]);\n // TODO handle exceptions\n\n /** @var iResponse $response */\n $response = $this->exceptionHandler($response);\n \n\n return $response;\n }", "public function test_can_create_wp_http_response(): void {\n\n\t\t$response = HTTP_Helper::wp_response( array( 'key' => 'test_VALUE' ), 500 );\n\n\t\t$this->assertInstanceOf( WP_HTTP_Response::class, $response );\n\t\t$this->assertIsArray( $response->get_data() );\n\t\t$this->assertArrayHasKey( 'key', $response->get_data() );\n\t\t$this->assertEquals( 'test_VALUE', $response->get_data()['key'] );\n\t\t$this->assertEquals( 500, $response->get_status() );\n\t}", "private function getResponse() {\n $this->response['status_code'] = $this->status->getStatusCode();\n $this->response['reason_phrase'] = $this->status->getReasonPhrase();\n \n $this->readHeaders();\n }", "public function response ();", "public function createResponse() {\n\t\t\t$query = \"SELECT * FROM $this->table_name WHERE name=:name AND drink=:drink\";\n\n\t\t\t// prepare \n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t// bind values\n\t\t\t$stmt->bindParam(':name', $this->name);\n\t\t\t$stmt->bindParam(':drink', $this->drink);\n\n\t\t\t$stmt->execute();\n\n\t\t\t// get retrieved row\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t\t// set values to object properties\n\t\t\t$this->id = $row['id'];\n\t\t\t$this->name = $row['name'];\n\t\t\t$this->drink = $row['drink'];\n\t\t}", "public function create()\n\t{\n\t\treturn \\Response::json(Input::json());\n\t}", "public function __invoke() : ResponseInterface {\n $response = new Response();\n\n $response->setStatusCode(404)\n ->setContent(static::$NOTFOUND_BODY)\n ->setContentType(static::$CONTENT_TYPE);\n\n return $response;\n }", "public function __construct()\n {\n return response([],400);\n }", "public function createAction(): string\n {\n $status = self::STATUS_200;\n $message = '';\n return $this->prepareJSONResponse($status, $message);\n }", "public function newDownloadResponse() {\n // getDownloadURI() always returns a fully qualified URI with a complete\n // domain.\n return id(new AphrontRedirectResponse())\n ->setIsExternal(true)\n ->setCloseDialogBeforeRedirect(true)\n ->setURI($this->getDownloadURI());\n }", "public function create(): Response\n {\n return Addr::get();\n }", "public function create()\n {\n return $this->header->srvCreate();\n }", "protected function makeResponse(mixed $result) : Response\n {\n $result = $this->makeResponseBodyPart($result);\n return $this->router->getResponse()->appendBody($result);\n }", "protected function build()\n {\n $this->getResponse()->setVersion($this->getConf()->getVersion());\n $this->getResponse()->setCreate(json_decode($this->getConf()->getCreate()));\n }", "public function sendResponse();", "public function & GetResponse ();", "public function Response($response) {\n\t\t\n\t}", "public function test_response() \n\t{\n\t\treturn CCResponse::create( 'Callbacks are pretty cool' );\n\t}", "public function factory_provider(): Response_Factory {\n\t\treturn new Response_Factory( new HTTP() );\n\t}", "public function createStatusAction(): ResponseInterface\n {\n return $this->htmlResponse();\n }", "public function response(): ResponseContract;", "public function createResponse(\n int $status = 200,\n array $headers = [],\n $body = null,\n string $protocol = '1.1',\n string $reason = null\n ): ResponseInterface;", "public function createResponseFromFPM(): ResponseInterface\n {\n return $this->createResponse(200, '');\n }", "function response($content = '', $status = 200, array $headers = [])\n\t{\n\t\t$factory = app(ResponseFactory::class);\n\n\t\tif (func_num_args() === 0) {\n\t\t\treturn $factory;\n\t\t}\n\n return $factory->make($content, $status, $headers);\n\t}", "public static function create($content, $location, $action, $version) {\n\t\t$response = new SoapResponse ();\n\t\t$response->setContent ( $content );\n\t\t$response->setLocation ( $location );\n\t\t$response->setAction ( $action );\n\t\t$response->setVersion ( $version );\n\t\t$contentType = SoapMessage::getContentTypeForVersion ( $version );\n\t\t$response->setContentType ( $contentType );\n\t\t\n\t\treturn $response;\n\t}", "public function __construct()\n {\n $this->response = new Response();\n }", "public function create()\n {\n return $this->sendSuccessResponse([]);\n }", "public function makeResponse(\n int $status = 200,\n array $headers = [],\n $body = null,\n string $version = '1.1',\n ?string $reason = null\n ): ResponseInterface {\n return new Response($status, $headers, $body, $version, $reason);\n }", "protected function sendResponse() {}", "public function create()\n {\n return response() -> json([\n \"success\" => true,\n \"services\" => \"Crear\"\n ], 200);\n }", "private function createResponse($data, int $statusCode): WP_REST_Response\n {\n $response = new WP_REST_Response($data, $statusCode);\n $response->set_headers(['Cache-Control' => 'must-revalidate, no-cache, no-store, private']);\n return $response;\n }", "public function get_response_object()\n {\n }", "public function _response($response) {\n\t\treturn $this->_instance($this->_classes['response'], array(\n\t\t\t'body' => $response\n\t\t));\n\t}", "final public function getResponse() {\r\n $template = $this->getProvider()->get('PM\\Main\\Web\\Component\\Template\\Json');\r\n $response = $this->getProvider()->get('response');\r\n $response->setTemplate($template);\r\n return $response;\r\n }", "private function __send_response(){\n http_response_code($this->response_code);\n if($this->_redirect) header(\"Location: \".Config::WEB_DIRECTORY.\"{$this->_redirect_location}\");\n elseif($this->_JSON){\n header('Content-Type: application/json; charset=UTF-8');\n print json_encode($this->_JSON_contents, JSON_PRETTY_PRINT);\n }elseif($this->_HTML){\n if($this->_HTML_load_view) $this->_template->render();\n } /** @noinspection PhpStatementHasEmptyBodyInspection */ else{\n // Do nothing\n }\n }", "function response($status,$status_message,$data){\n header(\"HTTP/1.1 \".$status);\n $response['status']=$status;\n $response['status_message']=$status_message;\n $response['data']=$data;\n $json_response = json_encode($response);\n echo $json_response;\n}", "private function createResponse($curl, $raw)\n {\n // fixes bug https://sourceforge.net/p/curl/bugs/1204/\n $version = curl_version();\n if (version_compare($version['version'], '7.30.0', '<')) {\n $pos = strlen($raw) - curl_getinfo($curl, CURLINFO_SIZE_DOWNLOAD);\n } else {\n $pos = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\n }\n\n list($statsLine, $headers) = $this->parseHeaders(rtrim(substr($raw, 0, $pos)));\n $body = strlen($raw) > $pos ? substr($raw, $pos) : '';\n if (!preg_match('|^HTTP/([12].[01]) ([1-9][0-9][0-9]) (.*?)$|', $statsLine, $matches)) {\n throw new HttpException('Not a HTTP response');\n }\n\n return MessageFactoryDiscovery::find()->createResponse((int) $matches[2], $matches[3], $headers, $body, $matches[1]);\n }", "public function create()\n {\n parent::create();\n\n $this->response->setCookie($this->cookieName, $this->id, 0, $this->cookiePath, $this->cookieDomain);\n }", "public function get_response () {\n $this->process_form();\n\n if (!$this->response) {\n $this->response=new Ctz_response();\n }\n\n return $this->response;\n }", "function getResponse()\n\t\t{\n\t\t\t$stream = $this->getRequestStream();\n\t\t\t$stream->write( $this->getRequestString() );\n\n\t\t\t$httpWebResponse = new HTTPWebResponse();\n\t\t\t$httpWebResponse->readFromStream( $stream );\n\n\t\t\t$stream->close();\n\n\t\t\treturn $httpWebResponse;\n\t\t}" ]
[ "0.78573334", "0.76648456", "0.7388646", "0.72108704", "0.7188131", "0.71612024", "0.71367866", "0.70635074", "0.6989094", "0.6948357", "0.69059056", "0.6878798", "0.6844712", "0.6812078", "0.6791313", "0.6745812", "0.67058444", "0.66509724", "0.6575241", "0.6551806", "0.6467801", "0.6467065", "0.6465797", "0.6465797", "0.6375589", "0.6363193", "0.6357555", "0.6349758", "0.63259643", "0.63101643", "0.6294257", "0.62272537", "0.62088203", "0.6199461", "0.61975175", "0.61843896", "0.61744267", "0.6165233", "0.6163132", "0.6136076", "0.6133473", "0.6109966", "0.61036134", "0.6099441", "0.6098482", "0.6097036", "0.6095232", "0.60713834", "0.60713834", "0.6065362", "0.60653245", "0.6062171", "0.60599136", "0.60590243", "0.60568786", "0.60530186", "0.604867", "0.6045838", "0.60363746", "0.6036186", "0.60317117", "0.60072845", "0.60056716", "0.60023165", "0.5998895", "0.598188", "0.59671414", "0.5961228", "0.5952495", "0.5951174", "0.5938491", "0.5937755", "0.59138185", "0.5907096", "0.5900165", "0.5879344", "0.58770293", "0.5875646", "0.58394295", "0.58375263", "0.5825009", "0.58247906", "0.58247113", "0.58119047", "0.5803007", "0.5794704", "0.57885075", "0.5764104", "0.5763983", "0.5750389", "0.5749331", "0.5749275", "0.5745812", "0.57437444", "0.5733188", "0.5722591", "0.57167375", "0.5711156", "0.57051647", "0.57003474", "0.5696643" ]
0.0
-1
Stream the contents of a file directly through to the response.
public function renderFile($file_path, $file_name = null): self { set_time_limit(600); if ($file_name == null) { $file_name = basename($file_path); } $fh = fopen($file_path, 'rb'); $stream = new \Slim\Http\Stream($fh); return $this ->withHeader('Pragma', 'public') ->withHeader('Expires', '0') ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') ->withHeader('Content-Type', mime_content_type($file_path)) ->withHeader('Content-Length', filesize($file_path)) ->withHeader('Content-Disposition', 'attachment; filename=' . $file_name) ->withBody($stream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function stream($file, $name = null) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.(is_null($name) ? basename($file) : $name));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n }", "public function streamFile($file, $file_name=null, $send_mode=\"file\") {\r\r\n\t\r\r\n\t\tif ($file_name == null)\r\r\n\t\t\t$file_name = basename($file);\r\r\n\t\r\r\n\t\t$this->setHeader(\"Content-Description\", \"File Transfer\");\r\r\n\t\tforeach ($this->content_type as $type)\r\r\n\t\t\t$this->setHeader(\"Content-Type\", $type);\r\r\n\t\t$this->setHeader(\"Content-Disposition\", \"inline; filename=\\\"\" . $file_name . \"\\\"\");\r\r\n\t\t$this->setHeader(\"Expires\", \"0\");\r\r\n\t\t$this->setHeader(\"Cache-Control\", \"public, must-revalidate, max-age=0\");\r\r\n\t\t$this->setHeader(\"Pragma\", \"public\");\r\r\n\t\t$this->setHeader(\"Content-Length\", filesize($file));\r\r\n\t\t\r\r\n\t\t$this->output($file, $send_mode);\r\r\n\t}", "public function stream($fileHandle=null)\r\n\t{\r\n\t\t/*\r\n\t\tif ($this->ansKey)\r\n\t\t{\r\n\t\t\treturn $this->streamAns($fileHandle);\r\n\t\t}\r\n\t\telse if ($this->remoteFile) // Old ANS code\r\n\t\t{\r\n\t\t\treturn $this->streamOldAns($fileHandle);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->streamLocal($fileHandle);\r\n\t\t}\r\n\t\t*/\r\n\r\n\t\twhile (($buf = $this->read(8192)))\r\n\t\t{\r\n\t\t\tif ($fileHandle)\r\n\t\t\t{\r\n\t\t\t\tfwrite($fileHandle, $buf);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\techo $buf;\r\n\t\t\t\tflush();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function sendFile($file) {\n $reader = $file->reader();\n if (!$reader || !$reader->isReadable()) {\n return;\n }\n\n\t\tif(class_exists('SapphireTest', false) && SapphireTest::is_running_test()) {\n\t\t\treturn $reader->read();\n\t\t}\n \n $type = HTTP::get_mime_type($file->Filename);\n $disposition = strpos($type, 'image') !== false ? 'inline' : 'attachment';\n\n\t\theader('Content-Description: File Transfer');\n\t\t// Quotes needed to retain spaces (http://kb.mozillazine.org/Filenames_with_spaces_are_truncated_upon_download)\n\t\theader(sprintf('Content-Disposition: %s; filename=\"%s\"', $disposition, basename($file->Filename)));\n\t\theader('Content-Length: ' . $file->FileSize);\n\t\theader('Content-Type: ' . $type);\n\t\theader('Content-Transfer-Encoding: binary');\n\n\t\t// Ensure we enforce no-cache headers consistently, so that files accesses aren't cached by CDN/edge networks\n\t\theader('Pragma: no-cache');\n\t\theader('Cache-Control: private, no-cache, no-store');\n \n increase_time_limit_to(0);\n\n\t\t// Clear PHP buffer, otherwise the script will try to allocate memory for entire file.\n\t\twhile (ob_get_level() > 0) {\n\t\t\tob_end_flush();\n\t\t}\n\n\t\t// Prevent blocking of the session file by PHP. Without this the user can't visit another page of the same\n\t\t// website during download (see http://konrness.com/php5/how-to-prevent-blocking-php-requests/)\n\t\tsession_write_close();\n\n echo $reader->read();\n\t\tdie();\n\t}", "protected function sendFile(SplFileInfo $file): ResponseInterface\n {\n $fileStream = fopen($file->getRealPath(), 'rb');\n\n return $this->response->withHeader('Content-Type', 'application/force-download')\n ->withHeader('Content-Type', 'application/octet-stream')\n ->withHeader('Content-Type', 'application/download')\n ->withHeader('Content-Description', 'File Transfer')\n ->withHeader('Content-Transfer-Encoding', 'binary')\n ->withHeader('Content-Disposition', 'attachment; filename=\"'.$file->getBasename().'\"')\n ->withHeader('Expires', '0')\n ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')\n ->withHeader('Pragma', 'public')\n ->withBody(new Stream($fileStream));\n }", "public function getFile()\n {\n header('Content-type: ' . $this->mime_type);\n header('Content-Disposition: attachment; filename=' . $this->original_name);\n \n echo gzuncompress(base64_decode($this->content));\n \n die();\n }", "public function stream($filename = 'image.jpg')\n {\n return new StreamedResponse(function() {\n echo $this->output();\n }, 200, array(\n 'Content-Type' => 'image/jpeg',\n 'Content-Disposition' => 'inline; filename=\"'.$filename.'\"',\n ));\n }", "public function streamData($file_name, $data) {\r\r\n\t\r\r\n\t\t$this->setHeader(\"Content-Description\", \"File Transfer\");\r\r\n\t\tforeach ($this->content_type as $type)\r\r\n\t\t\t$this->setHeader(\"Content-Type\", $type);\r\r\n\t\t$this->setHeader(\"Content-Disposition\", \"inline; filename=\\\"\" . $file_name . \"\\\"\");\r\r\n\t\t$this->setHeader(\"Expires\", \"0\");\r\r\n\t\t$this->setHeader(\"Cache-Control\", \"public, must-revalidate, max-age=0\");\r\r\n\t\t$this->setHeader(\"Pragma\", \"public\");\r\r\n\t\t$this->setHeader(\"Content-Length\", strlen($data));\r\r\n\t\t\r\r\n\t\t$this->output($data, \"data\");\r\r\n\t}", "public function serve()\n {\n// header('HTTP/1.1 301');\n// header('Location: ' . $this->saveHandler->getPublicServePath() . $this->getFilename());\n// die();\n\n // read file and output\n // this is definitely slower - however current use case is to put it behind a cdn distribution\n $file = $this->saveHandler->getPublicServePath() . $this->getFilename();\n $mimetype = exif_imagetype($file);\n header('Content-Type: '.$mimetype);\n readfile($file);\n die();\n }", "public function getReadStream(File $file);", "public function sendFile($file, $contentType = false)\n {\n $fp = fopen($file, \"r\");\n $this['response']->setBody(new Stream($fp));\n\n if ($contentType) {\n $this['response']->setHeader(\"Content-Type\", $contentType);\n } else {\n if (file_exists($file)) {\n //Set Content-Type\n if (extension_loaded('fileinfo')) {\n $finfo = new \\finfo(FILEINFO_MIME_TYPE);\n $type = $finfo->file($file);\n $this['response']->setHeader(\"Content-Type\", $type);\n } else {\n $this['response']->setHeader(\"Content-Type\", \"application/octet-stream\");\n }\n\n //Set Content-Length\n $stat = fstat($fp);\n $this['response']->setHeader(\"Content-Length\", $stat['size']);\n } else {\n //Set Content-Type and Content-Length\n $data = stream_get_meta_data($fp);\n\n foreach ($data['wrapper_data'] as $header) {\n if (strpos($header, ':') === false) {\n continue;\n }\n\n list($k, $v) = explode(\": \", $header, 2);\n\n if ($k === \"Content-Type\") {\n $this['response']->setHeader(\"Content-Type\", $v);\n } elseif ($k === \"Content-Length\") {\n $this['response']->setHeader(\"Content-Length\", $v);\n }\n }\n }\n }\n }", "public function output_file()\n {\n $file_data = $this->get_cached_path();\n // Create the headers\n $this->_create_headers($file_data);\n\n // Get the file data\n $data = file_get_contents($file_data);\n\n // Send the image to the browser in bite-sized chunks\n $chunk_size = 1024 * 8;\n $fp = fopen('php://memory', 'r+b');\n\n // Process file data\n fwrite($fp, $data);\n rewind($fp);\n while ( ! feof($fp))\n {\n echo fread($fp, $chunk_size);\n flush();\n }\n fclose($fp);\n\n exit();\n }", "private function send_file_response(string $file_path){\n //TODO Keep an eye on this way of returning the file for download.\n //The 'app/' on the beggining is to fix the way it handles file stores and retrievals.\n $full_file_path = storage_path('app/' . $file_path);\n\n if(!File::exists($full_file_path)){\n Log::error(\"File not found at storage: \" . $full_file_path);\n throw new Exception(\"Arquivo não encontrado\", ErrorCodes::FILE_NOT_FOUND);\n }\n\n $file = File::get($full_file_path);\n $response = response()->make($file, 200);\n $response = $response->header('Content-Type', 'application/pdf');\n return $response;\n }", "public function fileGetContents($url)\n {\n $rawResponse = file_get_contents($url, false, $this->stream);\n $this->responseHeaders = $http_response_header;\n\n return $rawResponse;\n }", "public function downloadFile(FileInterface $file) {\n\n $real_path = \\Drupal::service('file_system')->realpath($file->getFileUri());\n $fileContent = file_get_contents($real_path);\n\n $response = new Response($fileContent);\n\n $disposition = $response->headers->makeDisposition(\n ResponseHeaderBag::DISPOSITION_ATTACHMENT, $file->getFilename()\n );\n\n $response->headers->set('Content-Disposition', $disposition);\n\n return $response;\n }", "public function serve()\n {\n $type = $this->getSourceType();\n $sources = $this->getSources();\n $contents = $this->getContents();\n if ($type!='file' && count($sources)==1) {\n $response_data = array(\n 'source' => $sources[0],\n 'content' => $contents[0],\n );\n } else {\n $response_data = array(\n 'sources' => $sources,\n 'contents' => $contents,\n );\n }\n\n $errors_collection = $this->getErrors();\n $errors = array();\n foreach ($errors_collection as $_error) {\n $errors[] = $_error->getFullMessage();\n }\n $response_data['errors'] = $errors;\n\n if ($this->isDebug()) {\n $response_data['dump'] = serialize($this);\n }\n\n if (Container::get('request')->isMethod('head')) {\n Container::get('response')->fetchHeaders();\n exit(PHP_EOL);\n } else {\n try {\n Container::get('response')->send($response_data);\n } catch (\\Exception $e) {\n $this->warning($e->getMessage());\n Container::get('response')\n ->setContent(array('errors'=>$this->getErrors()))\n ->fetch();\n }\n }\n }", "public function getContents($file);", "function http_send_file($file) {}", "public function viewAction()\n {\n $request = Request::createFromGlobals();\n $file = $request->query->get( 'file' );\n\n $portal = $this->container->get('arii_core.portal');\n $workspace = $portal->getWorkspace();\n $path = $portal->getSessionVar('path');\n \n $filename = str_replace('//','/',$workspace.'/'.$path.'/'.$file );\n if ($this->isUtf8($filename))\n $filename = utf8_decode($filename);\n \n if (!($content = file_get_contents($filename)))\n throw new \\Exception('File not found: '.$file);\n \n $response = new Response();\n $ext = strtolower(substr($file,-3));\n switch ($ext) {\n case 'png':\n case 'jpg':\n $type = 'image/'.$ext;\n break;\n// case 'xml':\n// $type = 'text/'.$ext;\n// break;\n case 'xls':\n if (!$this->isUtf8($content))\n $content = utf8_encode($content);\n $response->headers->set('Content-type', 'application/vnd.ms-excel; charset=utf-8');\n $response->headers->set(\"Content-disposition\", \"attachment; filename=$file\"); \n $response->setContent($content);\n return $response;\n break; \n default:\n if (!$this->isUtf8($content))\n $content = utf8_encode($content);\n $type = 'text/plain';\n }\n $response->headers->set('Content-Type', $type);\n $response->setContent($content);\n return $response;\n }", "function output_file($file) {\n\t\tif(!is_readable($file)) die('<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"><HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1><P>The requested URL '.$_SERVER['REQUEST_URI'].' was not found on this server.</P></BODY></HTML>');\n\t\t\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename='.basename($file));\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Pragma: public');\n\t\theader('Content-Length: ' . filesize($file));\n\n\t\treadfile($file);\n\t\texit;\n\t}", "public function sendResponse(){\n\t\theader( 'Content-Type:' . $this->getMimeType() );\n\t\t\n\t\t$encodedName = rawurlencode($this->getFilename());\n\t\tif (preg_match(\"/MSIE/\", $_SERVER[\"HTTP_USER_AGENT\"])){\n\t\t\theader(\n\t\t\t\t\t'Content-Disposition: attachment; filepath=\"' . $encodedName . '\"'\n\t\t\t\t\t);\n\t\t} else {\n\t\t\theader('Content-Disposition: attachment; filepath*=UTF-8\\'\\'' . $encodedName\n\t\t\t\t\t. '; filepath=\"' . $encodedName . '\"');\n\t\t}\n\t\t\n\t\theader('Content-Length: ' . $this->view->filesize($this->filepath));\n\n\t\t\\OC_Util::obEnd();\n\t\t $this->view->readfile($this->filepath);\n\t}", "public function show(File $file)\n {\n //\n return response()->download(ltrim($file->path, '/'));\n }", "public static function streamFile($path)\n {\n return BaseUrl::to([self::$fileflyApiUrl, 'action' => 'stream', 'path' => $path]);\n }", "function wmfStaticStreamFile( $filePath, $responseType = 'nohash' ) {\n\t// `false` below means not to do retroactive upload prevention checks\n\t$ctype = StreamFile::contentTypeFromPath( $filePath, false );\n\tif ( !$ctype || $ctype === 'unknown/unknown' ) {\n\t\t// Directory, extension-less file or unknown extension\n\t\twmfStaticShowError( 'Unknown file path', 404 );\n\t\treturn;\n\t}\n\n\t$stat = stat( $filePath );\n\tif ( !$stat ) {\n\t\twmfStaticShowError( 'Unknown file path', 404 );\n\t\treturn;\n\t}\n\n\t// Match puppet:///mediawiki/apache/expires.conf\n\tif ( preg_match( '/\\.(gif|jpe?g|png|css|js|json|woff|woff2|svg|eot|ttf|ico)$/', $filePath ) ) {\n\t\theader( 'Access-Control-Allow-Origin: *' );\n\t}\n\theader( 'Last-Modified: ' . wfTimestamp( TS_RFC2822, $stat['mtime'] ) );\n\theader( \"Content-Type: $ctype\" );\n\tif ( $responseType === 'nohash' ) {\n\t\t// Unversioned\n\t\theader(\n\t\t\tsprintf( 'Cache-Control: public, s-maxage=%d, max-age=%d, must-revalidate',\n\t\t\t\tWMF_STATIC_1Y, WMF_STATIC_1Y\n\t\t\t)\n\t\t);\n\t} elseif ( $responseType === 'mismatch' ) {\n\t\t// Fallback\n\t\theader(\n\t\t\tsprintf( 'Cache-Control: public, s-maxage=%d, max-age=%d, must-revalidate',\n\t\t\t\tWMF_STATIC_1MIN, WMF_STATIC_1MIN\n\t\t\t)\n\t\t);\n\t} else {\n\t\t// Verified files are considered immutable\n\t\t// For the CDN, and clients not supporting \"immutable\", allow re-use for 1 year.\n\t\theader(\n\t\t\tsprintf( 'Cache-Control: public, s-maxage=%d, max-age=%d, immutable',\n\t\t\t\tWMF_STATIC_1Y, WMF_STATIC_1Y\n\t\t\t)\n\t\t);\n\t}\n\n\tif ( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {\n\t\t$ims = preg_replace( '/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );\n\t\tif ( wfTimestamp( TS_UNIX, $stat['mtime'] ) <= strtotime( $ims ) ) {\n\t\t\tini_set( 'zlib.output_compression', 0 );\n\t\t\theader( 'HTTP/1.1 304 Not Modified' );\n\t\t\treturn;\n\t\t}\n\t}\n\n\theader( 'Content-Length: ' . $stat['size'] );\n\treadfile( $filePath );\n}", "private function output_file() {\n\t\t$file = wp_json_encode( $this->get_info(), JSON_PRETTY_PRINT );\n\t\theader( 'Content-Description: File Transfer' );\n\t\theader( 'Content-Type: application/octet-stream' );\n\t\theader( 'Content-Disposition: attachment; filename=\"ep-troubleshoot.json\"' );\n\t\theader( 'Expires: 0' );\n\t\theader( 'Cache-Control: must-revalidate' );\n\t\theader( 'Pragma: public' );\n\t\theader( 'Content-Length: ' . strlen( $file ) );\n\t\techo $file;\n\t\texit;\n\t}", "public function stream($file)\n {\n if (null !== $this->filenameFilter) {\n $file = $this->filenameFilter->filter($file);\n }\n\n $tmp = tmpfile();\n\n $opt = array(\n 'fileDownload' => $tmp\n );\n\n try {\n $response = $this->amazonS3->get_object($this->getBucket(), $file, $opt);\n } catch (\\S3_Exception $e) {\n throw new \\RuntimeException('Exception thrown by \\AmazonS3: ' . $e->getMessage(), null, $e);\n }\n\n if (!$response->isOk()) {\n return false;\n }\n\n rewind($tmp);\n\n return $tmp;\n }", "public function file(){\n\t\theader('Content-Type: image/'.$this->extension);\n\t\tdie( readfile( $this->path ) );\n\t}", "public function toResponse($request)\n {\n return response()->download($this->getPath(), $this->file_name);\n }", "public function fetch($uuid) {\n $depositFile = $this->mapper->findByUuid($uuid);\n $file = $this->root->get($depositFile->getPath());\n\n $response = new StreamResponse($this->config->getSystemValue('datadirectory') . $file->getPath());\n $response->addHeader('Content-Type', $file->getMimeType());\n $response->addHeader('Content-Length', $file->getSize());\n return $response;\n }", "protected function fileTransfer($resource)\n {\n $date = date('D, d M Y H:i:s T', Encryptor::lastModified($resource->file_location));\n $size = Encryptor::size($resource->file_location);\n $type = Encryptor::mimeType($resource->file_location);\n\n return response(Encryptor::get($resource->file_location))\n ->header('Content-Type', $type)\n ->header('Accept-Ranges', 'bytes')\n ->header('Cache-Control', 'no-cache, private')\n ->header('Content-Length', $size)\n ->header('Last-Modified', $date);\n }", "public function getStreamResponse($fileKey, $guestSpaceId = null): ResponseInterface\n {\n $options = [\n 'json' => ['fileKey' => $fileKey],\n 'stream' => true\n ];\n $result = $this->client->get(KintoneApi::generateUrl('file.json', $guestSpaceId), $options);\n if ($result instanceof RequestException) {\n $this->handleJsonError($result);\n throw $result;\n }\n\n return $result;\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "public function get_contents($file)\n {\n }", "private function getStreamBody(string $serverResponseFile): string\n {\n $data = $this->getStream($serverResponseFile);\n return $data['body'];\n }", "protected function serveFile($path)\n {\n // Get a File Dispatcher instance.\n $dispatcher = $this->getFileDispatcher();\n\n return $dispatcher->serve($path, $this->request);\n }", "public function getResourceContents()\n {\n $fileName = $this->getUrlParameter('get');\n\n if (!preg_match('/^[a-z-]+\\.(css|gif|js)$/', $fileName)) {\n $this->badRequest('Invalid file name.');\n }\n\n $resourcePath = realpath(Path::getPublicDirPathInLibrary() . $fileName);\n\n if (!is_file($resourcePath)) {\n $this->badRequest(sprintf('File \"%s\" could not be found.', $fileName));\n }\n\n $fileInfo = pathinfo($resourcePath);\n $mimeTypes = ['css' => 'text/css', 'gif' => 'image/gif', 'js' => 'application/x-javascript'];\n\n return (new Response(file_get_contents($resourcePath), 200))\n ->header('Content-Type', $mimeTypes[$fileInfo['extension']])\n ->header('Content-Length', filesize($resourcePath));\n }", "public function download(string $file, string $name = ''): PsrResponseInterface;", "public function output($filename = null)\n {\n $iterator = $this->getIterator();\n //@codeCoverageIgnoreStart\n if (! is_null($filename) && self::isValidString($filename)) {\n $filename = (string) $filename;\n $filename = filter_var($filename, FILTER_UNSAFE_RAW, ['flags' => FILTER_FLAG_STRIP_LOW]);\n header('Content-Type: application/octet-stream');\n header('Content-Transfer-Encoding: binary');\n header('Content-Disposition: attachment; filename=\"'.$filename.'\"');\n if (! $iterator instanceof SplTempFileObject) {\n header('Content-Length: '.$iterator->getSize());\n }\n }\n //@codeCoverageIgnoreEnd\n $iterator->rewind();\n $iterator->fpassthru();\n }", "abstract public function getContent($file);", "public function download($file)\n {\n return response()->download('storage/'.$file);\n }", "function getResponseBody(){\n $page = \"\";\n if ($this->fpopened===FALSE) return $page;\n while (!feof ($this->fpopened)) {\n $page .= fread ($this->fpopened, 1024);\n }\n return $page;\n }", "protected function getResponse(): Response\n {\n return new Response(fopen('data://text/plain,', 'rb'), 200);\n }", "public function render($file);", "public function download()\n {\n\n $hashes = explode(',', $this->request->get('hashes'));\n $ids = array_map(function($hash) {\n return $this->fileEntry->decodeHash($hash);\n }, $hashes);\n\n $entries = $this->fileEntry->whereIn('id', $ids)->get();\n\n // TODO: refactor file entry policy to accent multiple IDs\n $entries->each(function($entry) {\n $this->authorize('show', [FileEntry::class, $entry]);\n });\n\n if ($entries->count() === 1 && $entries->first()->type !== 'folder') {\n $entry = $entries->first();\n\n $disk = $entry->getDisk();\n $stream = $disk->readStream($entry->getStoragePath());\n\n return response()->stream(function() use($stream) {\n fpassthru($stream);\n }, 200, [\n \"Content-Type\" => $entry->mime,\n \"Content-Length\" => $disk->size($entry->getStoragePath()),\n \"Content-disposition\" => \"attachment; filename=\\\"\" . $entry->name . \"\\\"\",\n ]);\n } else {\n $path = $this->createZip($entries);\n $timestamp = Carbon::now()->getTimestamp();\n return response()->download($path, \"download-$timestamp.zip\");\n }\n }", "public function show($file_id)\n {\n $file = new Files($file_id);\n\n if(!$file->id)\n {\n $this->addMessageError('File not found.');\n $this->redirect('error');\n }\n\n $ph_file = new File($file->path);\n\n \n if(!$ph_file->path)\n {\n // Not exists\n $this->addMessageError('File content not found.');\n $this->redirect('error');\n }\n \n $data = file_get_contents($ph_file->path);\n\n // set headers\n\t\theader('Content-Type: ' . $file->mime);\n\t\theader('Content-Length: ' . filesize($file->path));\n\t\theader('Expires: 0');\n\t\theader(\"Content-Disposition: inline; filename=\" . urlencode($ph_file->name));\n\t\theader('Connection: close');\n\t\tflush();\n\n\t\t// send file data\n\t\techo $data;\n }", "public function action_media($file) {\n\t\t// Find the file extension\n\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\n\t\t// Remove the extension from the filename\n\t\t$file = substr($file, 0, -(strlen($ext) + 1));\n\n\t\tif ($file = Kohana::find_file('media', $file, $ext))\n\t\t{\n\t\t\t// Send the file content as the response\n\t\t\t$this->request->response = file_get_contents($file);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Return a 404 status\n\t\t\t$this->request->status = 404;\n\t\t}\n\n\t\t// Set the content type for this extension\n\t\t$this->request->headers['Content-Type'] = File::mime_by_ext($ext);\n\t}", "public function getStreamedFileFunction($file) {\n return function() use ($file) {\n set_time_limit(0);\n $handle = fopen($file, 'rb');\n if ($handle !== false) {\n $chunkSize = 1024 * 1024;\n while (!feof($handle)) {\n $buffer = fread($handle, $chunkSize);\n echo $buffer;\n flush();\n }\n fclose($handle);\n }\n };\n }", "public function send_file($filename, $download = NULL, array $options = NULL)\n\t{\n\t\tif ( ! empty($options['mime_type']))\n\t\t{\n\t\t\t// The mime-type has been manually set\n\t\t\t$mime = $options['mime_type'];\n\t\t}\n\n\t\tif ($filename === TRUE)\n\t\t{\n\t\t\tif (empty($download))\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Download name must be provided for streaming files');\n\t\t\t}\n\n\t\t\t// Temporary files will automatically be deleted\n\t\t\t$options['delete'] = FALSE;\n\n\t\t\tif ( ! isset($mime))\n\t\t\t{\n\t\t\t\t// Guess the mime using the file extension\n\t\t\t\t$mime = File::mime_by_ext(strtolower(pathinfo($download, PATHINFO_EXTENSION)));\n\t\t\t}\n\n\t\t\t// Force the data to be rendered if\n\t\t\t$file_data = (string) $this->response;\n\n\t\t\t// Get the content size\n\t\t\t$size = strlen($file_data);\n\n\t\t\t// Create a temporary file to hold the current response\n\t\t\t$file = tmpfile();\n\n\t\t\t// Write the current response into the file\n\t\t\tfwrite($file, $file_data);\n\n\t\t\t// File data is no longer needed\n\t\t\tunset($file_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get the complete file path\n\t\t\t$filename = realpath($filename);\n\n\t\t\tif (empty($download))\n\t\t\t{\n\t\t\t\t// Use the file name as the download file name\n\t\t\t\t$download = pathinfo($filename, PATHINFO_BASENAME);\n\t\t\t}\n\n\t\t\t// Get the file size\n\t\t\t$size = filesize($filename);\n\n\t\t\tif ( ! isset($mime))\n\t\t\t{\n\t\t\t\t// Get the mime type\n\t\t\t\t$mime = File::mime($filename);\n\t\t\t}\n\n\t\t\t// Open the file for reading\n\t\t\t$file = fopen($filename, 'rb');\n\t\t}\n\n\t\tif ( ! is_resource($file))\n\t\t{\n\t\t\tthrow new Kohana_Exception('Could not read file to send: :file', array(\n\t\t\t\t':file' => $download,\n\t\t\t));\n\t\t}\n\n\t\t// Inline or download?\n\t\t$disposition = empty($options['inline']) ? 'attachment' : 'inline';\n\n\t\t// Calculate byte range to download.\n\t\tlist($start, $end) = $this->_calculate_byte_range($size);\n\n\t\tif ( ! empty($options['resumable']))\n\t\t{\n\t\t\tif ($start > 0 OR $end < ($size - 1))\n\t\t\t{\n\t\t\t\t// Partial Content\n\t\t\t\t$this->status = 206;\n\t\t\t}\n\n\t\t\t// Range of bytes being sent\n\t\t\t$this->headers['Content-Range'] = 'bytes '.$start.'-'.$end.'/'.$size;\n\t\t\t$this->headers['Accept-Ranges'] = 'bytes';\n\t\t}\n\n\t\t// Set the headers for a download\n\t\t$this->headers['Content-Disposition'] = $disposition.'; filename=\"'.$download.'\"';\n\t\t$this->headers['Content-Type'] = $mime;\n\t\t$this->headers['Content-Length'] = ($end - $start) + 1;\n\n\t\tif (Request::user_agent('browser') === 'Internet Explorer')\n\t\t{\n\t\t\t// Naturally, IE does not act like a real browser...\n\t\t\tif (Request::$protocol === 'https')\n\t\t\t{\n\t\t\t\t// http://support.microsoft.com/kb/316431\n\t\t\t\t$this->headers['Pragma'] = $this->headers['Cache-Control'] = 'public';\n\t\t\t}\n\n\t\t\tif (version_compare(Request::user_agent('version'), '8.0', '>='))\n\t\t\t{\n\t\t\t\t// http://ajaxian.com/archives/ie-8-security\n\t\t\t\t$this->headers['X-Content-Type-Options'] = 'nosniff';\n\t\t\t}\n\t\t}\n\n\t\t// Send all headers now\n\t\t$this->send_headers();\n\n\t\twhile (ob_get_level())\n\t\t{\n\t\t\t// Flush all output buffers\n\t\t\tob_end_flush();\n\t\t}\n\n\t\t// Manually stop execution\n\t\tignore_user_abort(TRUE);\n\n\t\tif ( ! Kohana::$safe_mode)\n\t\t{\n\t\t\t// Keep the script running forever\n\t\t\tset_time_limit(0);\n\t\t}\n\n\t\t// Send data in 16kb blocks\n\t\t$block = 1024 * 16;\n\n\t\tfseek($file, $start);\n\n\t\twhile ( ! feof($file) AND ($pos = ftell($file)) <= $end)\n\t\t{\n\t\t\tif (connection_aborted())\n\t\t\t\tbreak;\n\n\t\t\tif ($pos + $block > $end)\n\t\t\t{\n\t\t\t\t// Don't read past the buffer.\n\t\t\t\t$block = $end - $pos + 1;\n\t\t\t}\n\n\t\t\t// Output a block of the file\n\t\t\techo fread($file, $block);\n\n\t\t\t// Send the data now\n\t\t\tflush();\n\t\t}\n\n\t\t// Close the file\n\t\tfclose($file);\n\n\t\tif ( ! empty($options['delete']))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Attempt to remove the file\n\t\t\t\tunlink($filename);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t// Create a text version of the exception\n\t\t\t\t$error = Kohana::exception_text($e);\n\n\t\t\t\tif (is_object(Kohana::$log))\n\t\t\t\t{\n\t\t\t\t\t// Add this exception to the log\n\t\t\t\t\tKohana::$log->add(Kohana::ERROR, $error);\n\n\t\t\t\t\t// Make sure the logs are written\n\t\t\t\t\tKohana::$log->write();\n\t\t\t\t}\n\n\t\t\t\t// Do NOT display the exception, it will corrupt the output!\n\t\t\t}\n\t\t}\n\n\t\t// Stop execution\n\t\texit;\n\t}", "public function download($file){\n return response()->download('storage/'.$file);\n }", "function readFile(){\n $this->setHeaders();\n $this->readContent();\n\n }", "public function full(Stream $stream)\n {\n $this->authorize('update', $stream);\n\n // Get all chunk filename\n $filesToStream = $stream->chunks()->orderBy('chunk_id')->pluck('filename');\n return response()->stream(function() use ($stream, $filesToStream) {\n foreach ($filesToStream as $file) {\n if (Storage::exists($file)) {\n $fStream = Storage::readStream($file);\n fpassthru($fStream);\n fclose($fStream);\n Log::debug('stream [' . $stream->id \n . '] file sent: ' . $file);\n }\n }\n }, 200, [\n 'Cache-Control' => 'no-cache, no-store',\n 'Pragma' => 'public',\n 'Content-Type' => $stream->mime_type,\n ]);\n }", "protected final function output ()\n\t{\n\t\tif ($this->isFailed() || !$this->isOutputSet())\n\t\t{\n\t\t\t$this->outputData();\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Description: File Download');\n\t\t\theader('Content-Type: ' . $this->outputContentType);\n\t\t\t$disposition = $this->attachResult ?\n\t\t\t\t\t'attachment; filename=' . $this->outputFileName :\n\t\t\t\t\t'inline';\n\t\t\theader('Content-Disposition: ' . $disposition);\n\t\t\theader('Content-Transfer-Encoding: binary');\n\t\t\theader('Content-Length: ' . filesize($this->outputFile));\n\n\t\t\twhile (ob_get_level()) {\n\t\t\t\tob_end_clean();\n\t\t\t}\n\t\t\tflush();\n\t\t\treadfile($this->outputFile);\n\t\t}\n\t}", "public function serving()\n\t{\n\t\tif ( $size = filesize( $this->path ) )\n\t\t\t$body = $this;\n\t\telse\n\t\t{\n\t\t\t$body = array( Prb_IO::withFile( $this->path, Prb_IO_File::NO_CREATE_READ )->read() );\n\t\t\t$size = Prack_Utils::singleton()->bytesize( reset( $body ) );\n\t\t}\n\t\t\n\t\t$pathinfo = pathinfo( $this->path );\n\t\t$extension = isset( $pathinfo[ 'extension' ] ) ? '.'.$pathinfo[ 'extension' ] : null;\n\t\t\n\t\treturn array(\n\t\t 200,\n\t\t array(\n\t\t 'Last-Modified' => Prb::Time( filemtime( $this->path ) )->httpdate(),\n\t\t 'Content-Type' => Prack_Mime::mimeType( $extension, 'text/plain' ),\n\t\t 'Content-Length' => (string)$size\n\t\t ),\n\t\t $body\n\t\t);\n\t}", "public function file($file_path = null, $content_type = null, $cache_type = null, $cache_control = null)\n {\n // If null is passed then return the current file value\n // otherwise if a blank string then clear the current file\n // and return this Response object.\n if ($file_path === null) {\n return $this->response_file;\n } elseif ($file_path === '') {\n $this->response_file = null;\n return $this;\n }\n\n // Validate that the file exists\n if (!is_file($file_path)) {\n throw new \\Exception(sprintf('[%s->%s()] was called for a file that does not exist: %s', __CLASS__, __FUNCTION__, $file_path));\n }\n\n // Determine the Mime-type to send if not specified as a parameter\n if ($content_type === null) {\n $content_type = $this->fileTypeToMimeType($file_path);\n }\n\n // Set the 'Content-Type' Responder Header or if a 'Download' file is\n // specified then set Responder Headers so that the browswer will prompt\n // to download the file.\n if ($content_type === 'download' || $content_type === 'application/octet-stream') {\n // Get the file name and replace any double-quotes.\n // Note - [basename()] is not used because it doesn't always\n // work in some environments (often Linux or Unix) for Unicode\n // Characters unless calling [setlocale()]. Since the Locale\n // is not known this method is more reliable.\n // $file_name = str_replace('\"', '', basename($file_path));\n $data = explode(DIRECTORY_SEPARATOR, realpath($file_path));\n $file_name = $data[count($data)-1];\n\n // Headers [ 'Content-Description', 'Content-Type', 'Content-Disposition' ]\n // are related to the download while headers [ 'Cache-Control', 'Pragma', 'Expires' ]\n // are related to caching. These caching headers are similar to what is sent\n // from noCache() but vary slightly for 'Cache-Control'.\n $this\n ->header('Content-Description', 'File Transfer')\n ->header('Content-Type', 'application/octet-stream')\n ->header('Content-Disposition', 'attachment; filename=\"' . $file_name . '\"')\n ->header('Cache-Control', 'must-revalidate')\n ->header('Pragma', 'no-cache')\n ->header('Expires', '-1');\n } else {\n $this->contentType($content_type);\n }\n\n // If a cache type is specified then calculate either a\n // hash or last modified date from the file.\n if ($cache_type !== null) {\n switch (strtolower($cache_type)) {\n case 'etag:md5':\n $this->etag(md5_file($file_path));\n break;\n case 'etag:sha1':\n $this->etag(sha1_file($file_path));\n break;\n case 'last-modified':\n $this->lastModified(filemtime($file_path));\n break;\n default:\n throw new \\Exception('Invalid parameter for option $cache_type: ' . $cache_type);\n }\n }\n\n // Set a 'Cache-Control' header if one is defined from this function\n if ($cache_control !== null) {\n $this->cacheControl($cache_control);\n }\n\n // Set a private property to the file path and return the Response Object\n $this->response_file = $file_path;\n return $this;\n }", "public function visitFile(vfsStreamFile $file): vfsStreamVisitor\n {\n $this->printContent($file->getName());\n\n return $this;\n }", "function output($file)\n {\n $fp=fopen($file,\"w\");\n fwrite($fp,$this->file());\n fclose($fp);\n\t\t\n\t\theader(\"Pragma: public\");\n\t\theader(\"Expires: 0\");\n\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\theader(\"Cache-Control: private\",false);\n\t\theader(\"Content-Type: application/zip\");\n\t\theader(\"Content-Disposition: attachment; filename=\".basename($file).\";\" );\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\theader(\"Content-Length: \".filesize($file));\n\t\treadfile(\"$file\");\n\t\t@unlink($file); \n }", "function convertFileToStream($file, $out_stream) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-pdf\", \"The file must exist and not be empty.\", \"convert_file_to_stream\"), 470);\n \n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-pdf\", \"The file name must have a valid extension.\", \"convert_file_to_stream\"), 470);\n \n $this->files['file'] = $file;\n $this->helper->post($this->fields, $this->files, $this->raw_data, $out_stream);\n }", "public function getContentStream();", "protected function sendContent()\n {\n if ($this->stream === null) {\n $this->swoole_http_response->end($this->content);\n // 这里看到还有写session的\n return;\n }\n\n $chunkSize = 8 * 1024 * 1024; // 8MB per chunk\n\n if (is_array($this->stream)) {\n list ($handle, $begin, $end) = $this->stream;\n fseek($handle, $begin);\n while (!feof($handle) && ($pos = ftell($handle)) <= $end) {\n if ($pos + $chunkSize > $end) {\n $chunkSize = $end - $pos + 1;\n }\n $this->swoole_http_response->write(fread($handle, $chunkSize));\n }\n fclose($handle);\n } else {\n while (!feof($this->stream)) {\n $this->swoole_http_response->write(fread($this->stream, $chunkSize));\n }\n fclose($this->stream);\n }\n $this->swoole_http_response->end();\n\n // 这里看到还有写session的\n }", "public function content()\n {\n $response = $this\n ->getPackage('FileStation')\n ->contentOfPath($this->path, [], 'files');\n return $response;\n }", "public function getFile(\\App\\File $file){\n\n $contentType = mime_content_type( storage_path('app/' . $file->path) );\n \n $headers = array(\n 'Content-Type: ' . $contentType ,\n );\n \n //return Storage::download($file->path,$file->name,$headers);\n return response()->download(storage_path('app/'.$file->path),$file->name,$headers);\n\n }", "public function read( $id, Request $request ): Response\r\n {\r\n $er = $this->doctrine->getRepository( 'App\\Entity\\Tablature' );\r\n $oTablature = $er->find( $request->attributes->get( 'id' ) );\r\n \r\n if ( ! $this->checkHasAccess( $oTablature ) ) {\r\n return $this->redirectToRoute( 'wgp_access_denied' );\r\n }\r\n \r\n $fileTablature = $this->tabsDirectory . '/' . $oTablature->getTablatureFile()->getPath();\r\n \r\n $response = new BinaryFileResponse( $fileTablature, 200, [\"Content-Type\" => \"audio/x-guitar-pro\"] );\r\n $response->setContentDisposition(\r\n ResponseHeaderBag::DISPOSITION_ATTACHMENT,\r\n $oTablature->getTablatureFile()->getOriginalName()\r\n );\r\n \r\n // open the file in a binary mode\r\n return $response;\r\n }", "public function stream();", "public function download($file,$fname=null)\n {\n ob_clean(); \n return response()->download(storage_path('app/'.$file),$fname);\n\n }", "public function fileAction() \n {\n // Get the file name from GET variable\n $fileName = $this->params()->fromQuery('name', '');\n \n $postId = $this->params()->fromQuery('id', '');\n \n // Check whether the user needs a thumbnail or a full-size image\n $isThumbnail = (bool)$this->params()->fromQuery('thumbnail', false);\n \n // Validate input parameters\n if (empty($fileName) || strlen($fileName)>128) {\n throw new \\Exception('File name is empty or too long');\n }\n \n // Get path to image file\n $fileName = $this->imageManager->getImagePathByName($fileName, $postId);\n \n if($isThumbnail) { \n // Resize the image\n $fileName = $this->imageManager->resizeImage($fileName);\n }\n \n // Get image file info (size and MIME type).\n $fileInfo = $this->imageManager->getImageFileInfo($fileName); \n if ($fileInfo===false) {\n // Set 404 Not Found status code\n $this->getResponse()->setStatusCode(404); \n return;\n }\n \n // Write HTTP headers.\n $response = $this->getResponse();\n $headers = $response->getHeaders();\n $headers->addHeaderLine(\"Content-type: \" . $fileInfo['type']); \n $headers->addHeaderLine(\"Content-length: \" . $fileInfo['size']);\n \n // Write file content \n $fileContent = $this->imageManager->getImageFileContent($fileName);\n if($fileContent!==false) { \n $response->setContent($fileContent);\n } else { \n // Set 500 Server Error status code\n $this->getResponse()->setStatusCode(500);\n return;\n }\n \n if($isThumbnail) {\n // Remove temporary thumbnail image file.\n unlink($fileName);\n }\n \n // Return Response to avoid default view rendering.\n return $this->getResponse();\n }", "public function httpGet(RequestInterface $request, ResponseInterface $response) {\n\t\t// Only handle valid files\n\t\t$node = $this->tree->getNodeForPath($request->getPath());\n\t\tif (!($node instanceof IFile)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// adds a 'Content-Disposition: attachment' header\n\t\tif ($this->downloadAttachment) {\n\t\t\t$filename = $node->getName();\n\t\t\tif ($node instanceof IProvidesAdditionalHeaders) {\n\t\t\t\t$filename = $node->getContentDispositionFileName();\n\t\t\t}\n\t\t\tif ($this->request->isUserAgent(\n\t\t\t\t[\n\t\t\t\t\tRequest::USER_AGENT_IE,\n\t\t\t\t\tRequest::USER_AGENT_ANDROID_MOBILE_CHROME,\n\t\t\t\t\tRequest::USER_AGENT_FREEBOX,\n\t\t\t\t])) {\n\t\t\t\t$response->setHeader('Content-Disposition', 'attachment; filename=\"' . \\rawurlencode($filename) . '\"');\n\t\t\t} else {\n\t\t\t\t$response->setHeader('Content-Disposition', 'attachment; filename*=UTF-8\\'\\'' . \\rawurlencode($filename)\n\t\t\t\t\t\t\t\t\t\t\t\t\t . '; filename=\"' . \\rawurlencode($filename) . '\"');\n\t\t\t}\n\t\t}\n\n\t\tif ($node instanceof \\OCA\\DAV\\Connector\\Sabre\\File) {\n\t\t\t//Add OC-Checksum header\n\t\t\t/** @var $node File */\n\t\t\t$checksum = $node->getChecksum('sha1');\n\t\t\tif ($checksum !== null && $checksum !== '') {\n\t\t\t\t$response->addHeader('OC-Checksum', $checksum);\n\t\t\t}\n\t\t\t// disable nginx buffering so big downloads through ownCloud won't\n\t\t\t// cause memory problems in the nginx process.\n\t\t\t$response->addHeader('X-Accel-Buffering', 'no');\n\t\t}\n\n\t\tif ($node instanceof IProvidesAdditionalHeaders) {\n\t\t\t$headers = $node->getHeaders();\n\t\t\tif (\\is_array($headers)) {\n\t\t\t\t$response->addHeaders($headers);\n\t\t\t}\n\t\t}\n\t}", "public function visitFile(vfsStreamFile $file): self;", "private function getFile(){\n if($this->checkStatus()){\n chdir('..');\n $filePos = $this->sanitizeInt($this->json->filePos);\n $fileName = $this->sanitizeString($this->json->fileName);\n $fileContents = file_get_contents('aud/'.$fileName);\n $fileMime = mime_content_type('aud/'.$fileName);\n $fileEncode = base64_encode($fileContents);\n $fileArray = array(\n 'fileName' => $fileName,\n 'fileMime' => $fileMime,\n 'fileEncode' => $fileEncode,\n 'filePos' => $filePos\n );\n header('content-type: application/json');\n echo json_encode($fileArray);\n } else {\n $this->notFound404();\n } \n }", "public static function renderFile();", "public function renderFile($file)\n {\n ob_start();\n include $file;\n return ob_get_clean();\n }", "public function renderFile($file)\n {\n ob_start();\n include $file;\n return ob_get_clean();\n }", "function convertFileToStream($file, $out_stream) {\n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-image\", \"The file must exist and not be empty.\", \"convert_file_to_stream\"), 470);\n \n if (!(filesize($file) > 0))\n throw new Error(create_invalid_value_message($file, \"file\", \"html-to-image\", \"The file name must have a valid extension.\", \"convert_file_to_stream\"), 470);\n \n $this->files['file'] = $file;\n $this->helper->post($this->fields, $this->files, $this->raw_data, $out_stream);\n }", "public function renderStringAsFile($file_data, $content_type, $file_name = null): self\n {\n $response = $this\n ->withHeader('Pragma', 'public')\n ->withHeader('Expires', '0')\n ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')\n ->withHeader('Content-Type', $content_type);\n\n if ($file_name !== null) {\n $response = $response->withHeader('Content-Disposition', 'attachment; filename=' . $file_name);\n }\n\n return $response->write($file_data);\n }", "public function download($file_name)\n {\n return response()->download(LogViewer::pathToLogFile(base64_decode($file_name)));\n }", "function ServeFile($filepath) {\n $contenttype = ExtentionToMimeType(pathinfo($filepath, PATHINFO_EXTENSION));\n header(\"Content-type: $contenttype\");\n $filename = basename($filepath);\n if ($contenttype == \"application/octet-stream\")\n header(\"Content-Disposition: attachment; filename=$filename\");\n readfile($filepath);\n return true;\n}", "protected function stream($callback, $status = 200, $headers = array())\n {\n return Response::stream($callback, $status, $headers, 'stream');\n }", "function http_send_stream($stream) {}", "public function getContents()\n {\n return stream_get_contents($this->stream);\n }", "public function getContents()\n {\n if (self::SCHEME_RESOURCE === $this->getScheme()) {\n $contents = '';\n while ($data = fread($this->stream, 2048)) {\n $contents .= $data;\n }\n } else {\n $contents = file_get_contents($this->uri);\n }\n return $contents;\n }", "public function outputResponse($response)\n {\n $path = public_path('test_output/index.html');\n file_put_contents($path, $response->getContent());\n }", "protected function getFileContents() {\n $path = $this->getFilePath();\n return file_get_contents($path);\n }", "public function stream(string $path)\n {\n return $this->adapter->readStream($path);\n }", "public function getFile($file_id)\n {\n return $this->make_http_request(__FUNCTION__,(object) get_defined_vars());\n }", "public function getFileStream(string $uriPath);", "public function render()\n\t{\n\t\t$this->addHTTPHeader('Content-Type', $this->getMimeType());\n\n\t\t$name = $this->getName();\n\n\t\tif (!empty($name))\n\t\t{\n\t\t\t$this->addHTTPHeader('Content-Disposition', 'attachment; filename=\"' . $name . '.csv\"', true);\n\t\t}\n\n\t\t$this->outputHTTPHeaders();\n\n echo $this->getBuffer();\n\t}", "public function view_file($file_name){\n // (invoice_uploads) in the config/filesystem.php\n $files = Storage::disk('invoice_uploads')->getDriver()->getAdapter()->applyPathPrefix($file_name);\n return response()->file($files);\n }", "function getFileController($req, $res, $config) {\n\n\t$db = connect($config);\n\n\t//If database error\n\tif(is_string($db)) {\n\t\treturn render('404.php', $res, array_merge($config,\n\t\t\t[\n\t\t\t\t'path'\t => '/'\n\t\t\t]\n\t\t));\n\t}\n\n\t//If filename does not exist\n\tif(!filenameExists($db, $config['file'])) {\n\t\treturn render('404.php', $res, array_merge($config,\n\t\t\t[\n\t\t\t\t'path'\t => '/'\n\t\t\t]\n\t\t));\n\t}\n\n\tlist($stream, $media, $date, $size) = getFile($db, $config['file']);\n\t\n\t$body = $res->getBody();\n\t$body->write($stream);\n\n\t$last_modified_time = strtotime($date);\n\t$etag = md5($last_modified_time);\n\t$cacheTime = 60*60*24*7; //1 week\n\n\t$res = $res->withBody($body)\n\t\t\t ->withHeader('Content-Type', $media)\n\t\t\t ->withHeader('Content-Length', $size)\n\t\t\t ->withHeader('Last-Modified', gmdate('D, d M Y H:i:s ', $last_modified_time).'GMT')\n\t\t\t ->withHeader('Cache-control', 'public, max-age='.$cacheTime)\n\t\t\t ->withHeader('ETag', $etag);\n\n\tif(\n\t\t($req->hasHeader('If-Modified-Since') && strtotime($req->getHeader('if-modified-since')['0']) == $last_modified_time) ||\n\t\t($req->hasHeader('If-None-Match') && $etag == trim($req->getHeader('if-none-match')['0']))\n\t) {\n\t\t$res = $res->withStatus(304);\n\t}\n\n\treturn $res;\n\n}", "protected function _sendFile($file, $range) {\n\t\t$compress = $this->outputCompressed();\n\t\t$file->open('rb');\n\n\t\t$end = $start = false;\n\t\tif ($range) {\n\t\t\tlist($start, $end) = $range;\n\t\t}\n\t\tif ($start !== false) {\n\t\t\t$file->offset($start);\n\t\t}\n\n\t\t$bufferSize = 8192;\n\t\tset_time_limit(0);\n\t\tsession_write_close();\n\t\twhile (!feof($file->handle)) {\n\t\t\tif (!$this->_isActive()) {\n\t\t\t\t$file->close();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$offset = $file->offset();\n\t\t\tif ($end && $offset >= $end) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($end && $offset + $bufferSize >= $end) {\n\t\t\t\t$bufferSize = $end - $offset + 1;\n\t\t\t}\n\t\t\techo fread($file->handle, $bufferSize);\n\t\t\tif (!$compress) {\n\t\t\t\t$this->_flushBuffer();\n\t\t\t}\n\t\t}\n\t\t$file->close();\n\t\treturn true;\n\t}", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function getStream();", "public function setOutputFile($file);", "protected function sendContent()\n {\n if (!$this->swoole) {\n print_r($this->data);\n return;\n }\n if ($this->stream === null) {\n $this->swoole->write($this->content);\n return;\n }\n\n set_time_limit(0); // Reset time limit for big files\n $chunkSize = 8 * 1024 * 1024; // 8MB per chunk\n\n if (is_array($this->stream)) {\n list($handle, $begin, $end) = $this->stream;\n fseek($handle, $begin);\n while (!feof($handle) && ($pos = ftell($handle)) <= $end) {\n if ($pos + $chunkSize > $end) {\n $chunkSize = $end - $pos + 1;\n }\n $this->swoole->write(fread($handle, $chunkSize));\n flush(); // Free up memory. Otherwise large files will trigger PHP's memory limit.\n }\n fclose($handle);\n } else {\n while (!feof($this->stream)) {\n $this->swoole->write(fread($this->stream, $chunkSize));\n flush();\n }\n fclose($this->stream);\n }\n }", "public function request(Request $request)\n {\n if (file_exists($this->getFilename())) {\n return new Response(file_get_contents($this->getFilename()), 200);\n } else {\n return new Response('', 500);\n }\n }" ]
[ "0.64296466", "0.63475984", "0.6163874", "0.6126", "0.6109201", "0.601711", "0.5998835", "0.59467965", "0.591281", "0.5902226", "0.5889422", "0.58744025", "0.58124185", "0.58040035", "0.57953817", "0.57945454", "0.577302", "0.57559896", "0.57535493", "0.574866", "0.57329786", "0.5728744", "0.570456", "0.56740403", "0.5657971", "0.56240624", "0.56236416", "0.56217176", "0.55998695", "0.55757767", "0.55757", "0.55643976", "0.5564009", "0.5564009", "0.5562585", "0.5562585", "0.55514556", "0.5547012", "0.5525965", "0.5513751", "0.549335", "0.5476615", "0.54712915", "0.5453538", "0.5443529", "0.5407833", "0.5398594", "0.5394931", "0.53804183", "0.5357798", "0.5356048", "0.53512794", "0.5339576", "0.53386813", "0.5338428", "0.5338113", "0.5337377", "0.5321347", "0.53087014", "0.530243", "0.53007305", "0.52974963", "0.52824646", "0.5275845", "0.52530617", "0.525242", "0.5247437", "0.52176", "0.52150744", "0.5214789", "0.5213643", "0.5209554", "0.51977044", "0.51977044", "0.5194216", "0.51941884", "0.5189662", "0.51868486", "0.5165444", "0.5164844", "0.5162313", "0.5159313", "0.5156377", "0.51172805", "0.5112082", "0.50929403", "0.5084544", "0.5081771", "0.5074203", "0.5066996", "0.5054795", "0.50504816", "0.50504816", "0.50504816", "0.50504816", "0.50504816", "0.50504816", "0.50469935", "0.504464", "0.5041004" ]
0.5938269
8
Write a string of file data to the response as if it is a file for download.
public function renderStringAsFile($file_data, $content_type, $file_name = null): self { $response = $this ->withHeader('Pragma', 'public') ->withHeader('Expires', '0') ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') ->withHeader('Content-Type', $content_type); if ($file_name !== null) { $response = $response->withHeader('Content-Disposition', 'attachment; filename=' . $file_name); } return $response->write($file_data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function output_file() {\n\t\t$file = wp_json_encode( $this->get_info(), JSON_PRETTY_PRINT );\n\t\theader( 'Content-Description: File Transfer' );\n\t\theader( 'Content-Type: application/octet-stream' );\n\t\theader( 'Content-Disposition: attachment; filename=\"ep-troubleshoot.json\"' );\n\t\theader( 'Expires: 0' );\n\t\theader( 'Cache-Control: must-revalidate' );\n\t\theader( 'Pragma: public' );\n\t\theader( 'Content-Length: ' . strlen( $file ) );\n\t\techo $file;\n\t\texit;\n\t}", "public function writeFile($data);", "public function sendResponse(){\n\t\theader( 'Content-Type:' . $this->getMimeType() );\n\t\t\n\t\t$encodedName = rawurlencode($this->getFilename());\n\t\tif (preg_match(\"/MSIE/\", $_SERVER[\"HTTP_USER_AGENT\"])){\n\t\t\theader(\n\t\t\t\t\t'Content-Disposition: attachment; filepath=\"' . $encodedName . '\"'\n\t\t\t\t\t);\n\t\t} else {\n\t\t\theader('Content-Disposition: attachment; filepath*=UTF-8\\'\\'' . $encodedName\n\t\t\t\t\t. '; filepath=\"' . $encodedName . '\"');\n\t\t}\n\t\t\n\t\theader('Content-Length: ' . $this->view->filesize($this->filepath));\n\n\t\t\\OC_Util::obEnd();\n\t\t $this->view->readfile($this->filepath);\n\t}", "public function getFile()\n {\n header('Content-type: ' . $this->mime_type);\n header('Content-Disposition: attachment; filename=' . $this->original_name);\n \n echo gzuncompress(base64_decode($this->content));\n \n die();\n }", "public function streamData($file_name, $data) {\r\r\n\t\r\r\n\t\t$this->setHeader(\"Content-Description\", \"File Transfer\");\r\r\n\t\tforeach ($this->content_type as $type)\r\r\n\t\t\t$this->setHeader(\"Content-Type\", $type);\r\r\n\t\t$this->setHeader(\"Content-Disposition\", \"inline; filename=\\\"\" . $file_name . \"\\\"\");\r\r\n\t\t$this->setHeader(\"Expires\", \"0\");\r\r\n\t\t$this->setHeader(\"Cache-Control\", \"public, must-revalidate, max-age=0\");\r\r\n\t\t$this->setHeader(\"Pragma\", \"public\");\r\r\n\t\t$this->setHeader(\"Content-Length\", strlen($data));\r\r\n\t\t\r\r\n\t\t$this->output($data, \"data\");\r\r\n\t}", "public function send_file($filename, $download = NULL, array $options = NULL)\n\t{\n\t\tif ( ! empty($options['mime_type']))\n\t\t{\n\t\t\t// The mime-type has been manually set\n\t\t\t$mime = $options['mime_type'];\n\t\t}\n\n\t\tif ($filename === TRUE)\n\t\t{\n\t\t\tif (empty($download))\n\t\t\t{\n\t\t\t\tthrow new Kohana_Exception('Download name must be provided for streaming files');\n\t\t\t}\n\n\t\t\t// Temporary files will automatically be deleted\n\t\t\t$options['delete'] = FALSE;\n\n\t\t\tif ( ! isset($mime))\n\t\t\t{\n\t\t\t\t// Guess the mime using the file extension\n\t\t\t\t$mime = File::mime_by_ext(strtolower(pathinfo($download, PATHINFO_EXTENSION)));\n\t\t\t}\n\n\t\t\t// Force the data to be rendered if\n\t\t\t$file_data = (string) $this->response;\n\n\t\t\t// Get the content size\n\t\t\t$size = strlen($file_data);\n\n\t\t\t// Create a temporary file to hold the current response\n\t\t\t$file = tmpfile();\n\n\t\t\t// Write the current response into the file\n\t\t\tfwrite($file, $file_data);\n\n\t\t\t// File data is no longer needed\n\t\t\tunset($file_data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get the complete file path\n\t\t\t$filename = realpath($filename);\n\n\t\t\tif (empty($download))\n\t\t\t{\n\t\t\t\t// Use the file name as the download file name\n\t\t\t\t$download = pathinfo($filename, PATHINFO_BASENAME);\n\t\t\t}\n\n\t\t\t// Get the file size\n\t\t\t$size = filesize($filename);\n\n\t\t\tif ( ! isset($mime))\n\t\t\t{\n\t\t\t\t// Get the mime type\n\t\t\t\t$mime = File::mime($filename);\n\t\t\t}\n\n\t\t\t// Open the file for reading\n\t\t\t$file = fopen($filename, 'rb');\n\t\t}\n\n\t\tif ( ! is_resource($file))\n\t\t{\n\t\t\tthrow new Kohana_Exception('Could not read file to send: :file', array(\n\t\t\t\t':file' => $download,\n\t\t\t));\n\t\t}\n\n\t\t// Inline or download?\n\t\t$disposition = empty($options['inline']) ? 'attachment' : 'inline';\n\n\t\t// Calculate byte range to download.\n\t\tlist($start, $end) = $this->_calculate_byte_range($size);\n\n\t\tif ( ! empty($options['resumable']))\n\t\t{\n\t\t\tif ($start > 0 OR $end < ($size - 1))\n\t\t\t{\n\t\t\t\t// Partial Content\n\t\t\t\t$this->status = 206;\n\t\t\t}\n\n\t\t\t// Range of bytes being sent\n\t\t\t$this->headers['Content-Range'] = 'bytes '.$start.'-'.$end.'/'.$size;\n\t\t\t$this->headers['Accept-Ranges'] = 'bytes';\n\t\t}\n\n\t\t// Set the headers for a download\n\t\t$this->headers['Content-Disposition'] = $disposition.'; filename=\"'.$download.'\"';\n\t\t$this->headers['Content-Type'] = $mime;\n\t\t$this->headers['Content-Length'] = ($end - $start) + 1;\n\n\t\tif (Request::user_agent('browser') === 'Internet Explorer')\n\t\t{\n\t\t\t// Naturally, IE does not act like a real browser...\n\t\t\tif (Request::$protocol === 'https')\n\t\t\t{\n\t\t\t\t// http://support.microsoft.com/kb/316431\n\t\t\t\t$this->headers['Pragma'] = $this->headers['Cache-Control'] = 'public';\n\t\t\t}\n\n\t\t\tif (version_compare(Request::user_agent('version'), '8.0', '>='))\n\t\t\t{\n\t\t\t\t// http://ajaxian.com/archives/ie-8-security\n\t\t\t\t$this->headers['X-Content-Type-Options'] = 'nosniff';\n\t\t\t}\n\t\t}\n\n\t\t// Send all headers now\n\t\t$this->send_headers();\n\n\t\twhile (ob_get_level())\n\t\t{\n\t\t\t// Flush all output buffers\n\t\t\tob_end_flush();\n\t\t}\n\n\t\t// Manually stop execution\n\t\tignore_user_abort(TRUE);\n\n\t\tif ( ! Kohana::$safe_mode)\n\t\t{\n\t\t\t// Keep the script running forever\n\t\t\tset_time_limit(0);\n\t\t}\n\n\t\t// Send data in 16kb blocks\n\t\t$block = 1024 * 16;\n\n\t\tfseek($file, $start);\n\n\t\twhile ( ! feof($file) AND ($pos = ftell($file)) <= $end)\n\t\t{\n\t\t\tif (connection_aborted())\n\t\t\t\tbreak;\n\n\t\t\tif ($pos + $block > $end)\n\t\t\t{\n\t\t\t\t// Don't read past the buffer.\n\t\t\t\t$block = $end - $pos + 1;\n\t\t\t}\n\n\t\t\t// Output a block of the file\n\t\t\techo fread($file, $block);\n\n\t\t\t// Send the data now\n\t\t\tflush();\n\t\t}\n\n\t\t// Close the file\n\t\tfclose($file);\n\n\t\tif ( ! empty($options['delete']))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Attempt to remove the file\n\t\t\t\tunlink($filename);\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t// Create a text version of the exception\n\t\t\t\t$error = Kohana::exception_text($e);\n\n\t\t\t\tif (is_object(Kohana::$log))\n\t\t\t\t{\n\t\t\t\t\t// Add this exception to the log\n\t\t\t\t\tKohana::$log->add(Kohana::ERROR, $error);\n\n\t\t\t\t\t// Make sure the logs are written\n\t\t\t\t\tKohana::$log->write();\n\t\t\t\t}\n\n\t\t\t\t// Do NOT display the exception, it will corrupt the output!\n\t\t\t}\n\t\t}\n\n\t\t// Stop execution\n\t\texit;\n\t}", "public function downloadData($file_name, $data) {\r\r\n\t\r\r\n\t\t$this->setHeader(\"Content-Description\", \"File Transfer\");\r\r\n\t\tforeach ($this->content_type as $type)\r\r\n\t\t\t$this->setHeader(\"Content-Type\", $type);\r\r\n\t\t$this->setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" . $file_name . \"\\\"\");\r\r\n\t\t$this->setHeader(\"Content-Transfer-Encoding\", $this->encoding);\r\r\n\t\t$this->setHeader(\"Expires\", \"0\");\r\r\n\t\t$this->setHeader(\"Cache-Control\", \"public, must-revalidate, max-age=0\");\r\r\n\t\t$this->setHeader(\"Pragma\", \"public\");\r\r\n\t\t$this->setHeader(\"Content-Length\", strlen($data));\r\r\n\t\t\r\r\n\t\t$this->output($data, \"data\");\r\r\n\t}", "function http_send_file($file) {}", "function downloadFile($filename, $downloadPath)\n{\n App::set_response_header('Content-Type', 'text/plain');\n App::set_response_header('Pragma', 'no-cache');\n App::set_response_header(\n 'Content-Disposition',\n \"attachment; filename={$filename}\"\n );\n readfile($downloadPath);\n}", "public function download() {\n $this->autoRender = false;\n $filename = $this->request->params['pass'][3];\n $orgfilename = $this->request->params['pass'][4];\n// pr($this->request->params); exit;\n $this->response->file(\n 'webroot/uploads/post/files/' . $filename, array(\n 'download' => true,\n 'name' => $orgfilename\n )\n );\n// return $this->response;\n }", "public function downloadFile();", "public function downloadFile(FileInterface $file) {\n\n $real_path = \\Drupal::service('file_system')->realpath($file->getFileUri());\n $fileContent = file_get_contents($real_path);\n\n $response = new Response($fileContent);\n\n $disposition = $response->headers->makeDisposition(\n ResponseHeaderBag::DISPOSITION_ATTACHMENT, $file->getFilename()\n );\n\n $response->headers->set('Content-Disposition', $disposition);\n\n return $response;\n }", "public static function sendDataResponse($path)\n\t{\n\t\theader('Content-Type: '.Storage::instance()->getMimetype($path));\n\t\theader(\"Content-Length: \" . Storage::instance()->getSize($path));\n\t\tob_clean();\n\t\tflush();\n\t\techo Storage::instance()->read($path);\n\t\texit;\n\t}", "function download()\n {\n $field = $this->GET('field');\n $id = $this->GET('id');\n $file = $this->table->data[$id][$field];\n header('Content-Type: ' . $this->_mime_content_type($file));\n header('Content-Length: ' . strlen($file));\n header('Content-Disposition: attachment; filename=\"' . $field . '_' . $id . '\";');\n echo $file;\n }", "public function writeFile($path, $data);", "public function output_file()\n {\n $file_data = $this->get_cached_path();\n // Create the headers\n $this->_create_headers($file_data);\n\n // Get the file data\n $data = file_get_contents($file_data);\n\n // Send the image to the browser in bite-sized chunks\n $chunk_size = 1024 * 8;\n $fp = fopen('php://memory', 'r+b');\n\n // Process file data\n fwrite($fp, $data);\n rewind($fp);\n while ( ! feof($fp))\n {\n echo fread($fp, $chunk_size);\n flush();\n }\n fclose($fp);\n\n exit();\n }", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "private function parseResponseDownload($file_content)\n {\n if (! isset($this->call_params['file_path'])) {\n throw new Exception('Missed file path, set it');\n }\n\n $fp = fopen($this->call_params['file_path'], 'w');\n\n if (is_resource($fp)) {\n $success = fwrite($fp, $file_content);\n fclose($fp);\n } else {\n $success = false;\n }\n\n return $success ? true : false;\n }", "function forceDownload($file_name, $data)\n\t{\n\t\t$quoted = sprintf('\"%s\"', addcslashes(basename($file_name), '\"\\\\'));\n\t\t$size = strlen($data);\n\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename=' . $quoted); \n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Connection: Keep-Alive');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Pragma: public');\n\t\theader('Content-Length: ' . $size);\n\t\techo $data;\n\t\texit(0);\n\t}", "public static function file($name)\n {\n header('Content-Type: application/octet-stream');\n header('Content-Transfer-Encoding: Binary');\n header('Content-disposition: attachment; filename=\"'.$name.'\"');\n }", "function _output_file($file, $name)\r\n\t{\r\n\t\tif (!JFile::exists($file))\r\n\t\t\tdie('file not exist!');\r\n\t\t$size = filesize($file);\r\n\t\t$name = rawurldecode($name);\r\n\r\n\t\tif (preg_match('/Opera(/| )([0-9].[0-9]{1,2})/', $_SERVER['HTTP_USER_AGENT']))\r\n\t\t\t$UserBrowser = \"Opera\";\r\n\t\telseif (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $_SERVER['HTTP_USER_AGENT']))\r\n\t\t\t$UserBrowser = \"IE\";\r\n\t\telse\r\n\t\t\t$UserBrowser = '';\r\n\r\n\t\t/* important for download im most browser */\r\n\t\t$mime_type = ($UserBrowser == 'IE' || $UserBrowser == 'Opera') ?\r\n\t\t 'application/octetstream' : 'application/octet-stream';\r\n\t\t@ob_end_clean();\r\n\t\t/* decrease cpu usage extreme */\r\n\t\theader('Content-Type: ' . $mime_type);\r\n\t\theader('Content-Disposition: attachment; filename=\"'.$name.'\"');\r\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\r\n\t\theader('Accept-Ranges: bytes');\r\n\t\theader(\"Cache-control: private\");\r\n\t\theader('Pragma: private');\r\n\r\n\t\t/* multipart-download and resume-download */\r\n\t\tif (isset($_SERVER['HTTP_RANGE'])) {\r\n\t\t\tlist($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE']);\r\n\t\t\tstr_replace($range, \"-\", $range);\r\n\t\t\t$size2 = $size-1;\r\n\t\t\t$new_length = $size-$range;\r\n\t\t\theader(\"HTTP/1.1 206 Partial Content\");\r\n\t\t\theader(\"Content-Length: $new_length\");\r\n\t\t\theader(\"Content-Range: bytes $range$size2/$size\");\r\n\t\t} else {\r\n\t\t\t$size2=$size-1;\r\n\t\t\theader(\"Content-Length: \".$size);\r\n\t\t}\r\n\t\t$chunksize = 1*(1024*1024);\r\n\t\t$this->bytes_send = 0;\r\n\t\tif ($file = fopen($file, 'r')) {\r\n\t\t\tif (isset($_SERVER['HTTP_RANGE']))\r\n\t\t\t\tfseek($file, $range);\r\n\t\t\twhile(!feof($file) and (connection_status()==0)) {\r\n\t\t\t\t$buffer = fread($file, $chunksize);\r\n\t\t\t\tprint($buffer);\r\n\t\t\t\tflush();\r\n\t\t\t\t$this->bytes_send += strlen($buffer);\r\n\t\t\t\t/*sleep(1); decrease download speed */\r\n\t\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\t}else\r\n\t\t\tdie('error can not open file');\r\n\t\tif (isset($new_length))\r\n\t\t\t$size = $new_length;\r\n\t}", "public function write($data, $filename = '', $uploadDir = '');", "function downloadFile($data){\r\n\r\n $dao = new \\PNORD\\Model\\MaintenanceDAO($this->app); \r\n $info = $dao->getMaintenance($data); \r\n $this->app->log->info('****info **** -> '.$this->dumpRet($info));\r\n\r\n\r\n if (file_exists($info['FILES'])) {\r\n\r\n // header('Content-Description: File Transfer');\r\n header('Content-Type: application/zip');\r\n $name = split('maintenances/', $info['FILES']);\r\n $this->app->log->info('****name **** -> '.$this->dumpRet($name));\r\n $this->app->log->info('****info Files **** -> '.$this->dumpRet($info['FILES']));\r\n $this->app->log->info('****filesize(info[FILES]) **** -> '.$this->dumpRet(filesize($info['FILES'])));\r\n header('Content-Disposition: inline; filename='.basename($name[1]));\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($info['FILES']));\r\n ob_clean();\r\n flush();\r\n readfile($info['FILES']);\r\n exit;\r\n\r\n } \r\n\r\n }", "function tdc_send_file($file_path, $file_name){\n if (file_exists($file_path.\"/\".$file_name)) {\n header($_SERVER[\"SERVER_PROTOCOL\"] . \" 200 OK\");\n header(\"Cache-Control: public\"); // needed for i.e.\n header(\"Content-Type: application/zip\");\n header(\"Content-Transfer-Encoding: Binary\");\n header(\"Content-Length:\".filesize($file_path.\"/\".$file_name));\n header(\"Content-Disposition: attachment; filename=\".$file_name);\n readfile($file_path.\"/\".$file_name);\n return True;\n }\n}", "function outputDownload(&$data, $filename, $filesize, $mimetype)\n {\n if (empty($mimetype)) {\n $mimetype = \"application/octet-stream\";\n }\n if (empty($filename)) {\n $filename = ev_gettext(\"Untitled\");\n }\n $disposition = self::displayInline($mimetype) ? 'inline' : 'attachment';\n $filename = rawurlencode($filename);\n header(\"Content-Type: \" . $mimetype);\n header(\"Content-Disposition: {$disposition}; filename=\\\"{$filename}\\\"; filename*=\".APP_CHARSET.\"''{$filename}\");\n header(\"Content-Length: {$filesize}\");\n echo $data;\n exit;\n }", "function create_response() {\n return File::saveLocalFile(get_response_prefix(), \"A response.\");\n}", "private function send_file_response(string $file_path){\n //TODO Keep an eye on this way of returning the file for download.\n //The 'app/' on the beggining is to fix the way it handles file stores and retrievals.\n $full_file_path = storage_path('app/' . $file_path);\n\n if(!File::exists($full_file_path)){\n Log::error(\"File not found at storage: \" . $full_file_path);\n throw new Exception(\"Arquivo não encontrado\", ErrorCodes::FILE_NOT_FOUND);\n }\n\n $file = File::get($full_file_path);\n $response = response()->make($file, 200);\n $response = $response->header('Content-Type', 'application/pdf');\n return $response;\n }", "function save_response($response){\n $f = fopen('response.html', 'w');\n fwrite($f, $response);\n fclose($f);\n}", "public function download($file,$fname=null)\n {\n ob_clean(); \n return response()->download(storage_path('app/'.$file),$fname);\n\n }", "public function _socket_storeAsFile($url,$data,$content_type) {\n\t\tif ( !strlen($url) )\tthrow new InvalidArgumentException(\"Attachment URL can't be empty\");\n\t\tif ( !strlen($content_type) ) throw new InvalidArgumentException(\"Attachment Content Type can't be empty\");\n\n\t\t$req = $this->_socket_startRequestHeaders('PUT',$url);\n\t\t$req .= 'Content-Length: '.strlen($data).\"\\r\\n\"\n\t\t\t\t.'Content-Type: '.$content_type.\"\\r\\n\\r\\n\";\n\t\t$this->_connect();\n\t\tfwrite($this->socket, $req);\n\t\tfwrite($this->socket, $data);\n\t\t$response = '';\n\t\twhile(!feof($this->socket))\n\t\t\t$response .= fgets($this->socket);\n\t\t$this->_disconnect();\n\t\treturn $response;\n }", "function output_file($file, $name, $mime_type = '') {\r\n if (!is_readable($file))\r\n die('File not found or inaccessible!');\r\n\r\n $size = filesize($file);\r\n $name = rawurldecode($name);\r\n\r\n /* Figure out the MIME type (if not specified) */\r\n $known_mime_types = array(\r\n \"pdf\" => \"application/pdf\",\r\n \"txt\" => \"text/plain\",\r\n \"html\" => \"text/html\",\r\n \"htm\" => \"text/html\",\r\n \"exe\" => \"application/octet-stream\",\r\n \"zip\" => \"application/zip\",\r\n \"doc\" => \"application/msword\",\r\n \"xls\" => \"application/vnd.ms-excel\",\r\n \"ppt\" => \"application/vnd.ms-powerpoint\",\r\n \"gif\" => \"image/gif\",\r\n \"png\" => \"image/png\",\r\n \"jpeg\" => \"image/jpg\",\r\n \"jpg\" => \"image/jpg\",\r\n \"php\" => \"text/plain\"\r\n );\r\n\r\n if ($mime_type == '') {\r\n $file_extension = strtolower(substr(strrchr($file, \".\"), 1));\r\n if (array_key_exists($file_extension, $known_mime_types)) {\r\n $mime_type = $known_mime_types[$file_extension];\r\n } else {\r\n $mime_type = \"application/force-download\";\r\n };\r\n };\r\n\r\n @ob_end_clean(); //turn off output buffering to decrease cpu usage\r\n // required for IE, otherwise Content-Disposition may be ignored\r\n if (ini_get('zlib.output_compression'))\r\n ini_set('zlib.output_compression', 'Off');\r\n\r\n header('Content-Type: ' . $mime_type);\r\n header('Content-Disposition: attachment; filename=\"' . $name . '\"');\r\n header(\"Content-Transfer-Encoding: binary\");\r\n header('Accept-Ranges: bytes');\r\n\r\n /* The three lines below basically make the \r\n download non-cacheable */\r\n header(\"Cache-control: private\");\r\n header('Pragma: private');\r\n\r\n // multipart-download and download resuming support\r\n if (isset($_SERVER['HTTP_RANGE'])) {\r\n list($a, $range) = explode(\"=\", $_SERVER['HTTP_RANGE'], 2);\r\n list($range) = explode(\",\", $range, 2);\r\n list($range, $range_end) = explode(\"-\", $range);\r\n $range = intval($range);\r\n if (!$range_end) {\r\n $range_end = $size - 1;\r\n } else {\r\n $range_end = intval($range_end);\r\n }\r\n\r\n $new_length = $range_end - $range + 1;\r\n header(\"HTTP/1.1 206 Partial Content\");\r\n header(\"Content-Length: $new_length\");\r\n header(\"Content-Range: bytes $range-$range_end/$size\");\r\n } else {\r\n $new_length = $size;\r\n header(\"Content-Length: \" . $size);\r\n }\r\n\r\n /* output the file itself */\r\n $chunksize = 1 * (1024 * 1024); //you may want to change this\r\n $bytes_send = 0;\r\n if ($file = fopen($file, 'r')) {\r\n if (isset($_SERVER['HTTP_RANGE']))\r\n fseek($file, $range);\r\n\r\n while (!feof($file) &&\r\n (!connection_aborted()) &&\r\n ($bytes_send < $new_length)\r\n ) {\r\n $buffer = fread($file, $chunksize);\r\n print($buffer); //echo($buffer); // is also possible\r\n flush();\r\n $bytes_send += strlen($buffer);\r\n }\r\n fclose($file);\r\n unlink($file);\r\n } else\r\n die('Error - can not open file.');\r\n\r\n die();\r\n }", "abstract public function downloadFile(FileData $fileData);", "protected function fileTransfer($resource)\n {\n $date = date('D, d M Y H:i:s T', Encryptor::lastModified($resource->file_location));\n $size = Encryptor::size($resource->file_location);\n $type = Encryptor::mimeType($resource->file_location);\n\n return response(Encryptor::get($resource->file_location))\n ->header('Content-Type', $type)\n ->header('Accept-Ranges', 'bytes')\n ->header('Cache-Control', 'no-cache, private')\n ->header('Content-Length', $size)\n ->header('Last-Modified', $date);\n }", "public function getApiResponseFile(){\n\t\treturn fopen(\"output/API Response Status.txt\",\"w\");\n\t}", "public function download(string $file, string $name = ''): PsrResponseInterface;", "public function download() {\n $file_name = get('name');\n// return \\Response::download(temp_path($file_name));\n return \\Response::download(storage_path('app') . '/' . $file_name);\n }", "public function sendFile($file) {\n $reader = $file->reader();\n if (!$reader || !$reader->isReadable()) {\n return;\n }\n\n\t\tif(class_exists('SapphireTest', false) && SapphireTest::is_running_test()) {\n\t\t\treturn $reader->read();\n\t\t}\n \n $type = HTTP::get_mime_type($file->Filename);\n $disposition = strpos($type, 'image') !== false ? 'inline' : 'attachment';\n\n\t\theader('Content-Description: File Transfer');\n\t\t// Quotes needed to retain spaces (http://kb.mozillazine.org/Filenames_with_spaces_are_truncated_upon_download)\n\t\theader(sprintf('Content-Disposition: %s; filename=\"%s\"', $disposition, basename($file->Filename)));\n\t\theader('Content-Length: ' . $file->FileSize);\n\t\theader('Content-Type: ' . $type);\n\t\theader('Content-Transfer-Encoding: binary');\n\n\t\t// Ensure we enforce no-cache headers consistently, so that files accesses aren't cached by CDN/edge networks\n\t\theader('Pragma: no-cache');\n\t\theader('Cache-Control: private, no-cache, no-store');\n \n increase_time_limit_to(0);\n\n\t\t// Clear PHP buffer, otherwise the script will try to allocate memory for entire file.\n\t\twhile (ob_get_level() > 0) {\n\t\t\tob_end_flush();\n\t\t}\n\n\t\t// Prevent blocking of the session file by PHP. Without this the user can't visit another page of the same\n\t\t// website during download (see http://konrness.com/php5/how-to-prevent-blocking-php-requests/)\n\t\tsession_write_close();\n\n echo $reader->read();\n\t\tdie();\n\t}", "public static function getHttpFile($file, $pr_transfer = null) {\n\t\ttry{\n\t \tif(!self::remoteFileExists($file)) {\n\t \t\treturn 'The file does not exists ...';\n\t \t}\n\n\t\t\tif(!isset($pr_transfer)) {\n\t\t\t\t$fileinfo = pathinfo($file);\n\t\t\t}else{\n\t\t\t\t$fileinfo = pathinfo($pr_transfer);\n\t\t\t}\n\t\t\t$filename = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? preg_replace('/\\./', '%2e', $fileinfo['basename'], substr_count($fileinfo['basename'], '.') - 1) : $fileinfo['basename'];\n\n\t\t\tif(strpos($filename, 'rsapi.cgi')) {\n\t\t\t\t$filename = substr($filename, 0, strpos($filename, '&'));\n\t\t\t}\n\n\t\t\tif(OC_Filesystem::file_exists('/Downloads/' . $filename)) {\n\t\t\t\t$filename = md5(rand()) . '_' . $filename;\n\t\t\t}\n\t\t\t$fs = OC_Filesystem::fopen('/Downloads/' . $filename, 'w');\n\n\t\t\t$size = self::getRemoteFileSize($file);\n\t\t\tif($size == 0) {\n\t\t\t\treturn 'Error ! Null file size.';\n\t\t\t}\n\n\t\t switch(strtolower($fileinfo['extension'])) {\n\t\t case 'exe': $ctype = 'application/octet-stream'; break;\n\t\t case 'zip': $ctype = 'application/zip'; break;\n\t\t case 'mp3': $ctype = 'audio/mpeg'; break;\n\t\t case 'mpg': $ctype = 'video/mpeg'; break;\n\t\t case 'avi': $ctype = 'video/x-msvideo'; break;\n\t\t\t\tcase 'png': $ctype = 'image/png'; break;\n\t\t default: $ctype = 'application/force-download';\n\t\t }\n\n\t\t $seek_end = (empty($seek_end)) ? ($size - 1) : min(abs(intval($seek_end)),($size - 1));\n\t\t $seek_start = (empty($seek_start) || $seek_end < abs(intval($seek_start))) ? 0 : max(abs(intval($seek_start)),0);\n\n\t\t /*header(\"Cache-Control: cache, must-revalidate\");\n\t\t header(\"Pragma: public\");\n\t\t header('Content-Type: ' . $ctype);\n\t\t header('Content-Disposition: attachment; filename=\"' . $filename . '\"');\n\t\t header('Content-Length: ' . ($seek_end - $seek_start + 1));*/\n\n\t\t $fp = fopen($file, 'rb');\n\t\t\tset_time_limit(0);\n\t\t while(!feof($fp)) {\n\t\t $data = fread($fp, 1024*8);\n\t\t if($data == '') {\n\t\t \tbreak;\n\t\t }\n\t\t\t\tfwrite($fs, $data);\n\t\t }\n\n\t\t fclose($fp);\n\t\t\tfclose($fs);\n\n\t\t\treturn Array('ok' => 'Transfer completed successfully. The file has been moved in your Downloads folder.');\n\t\t}catch(exception $e) {\n\t\t\treturn Array('error' => $e->getMessage());\n\t\t}\n\t}", "protected final function output ()\n\t{\n\t\tif ($this->isFailed() || !$this->isOutputSet())\n\t\t{\n\t\t\t$this->outputData();\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Description: File Download');\n\t\t\theader('Content-Type: ' . $this->outputContentType);\n\t\t\t$disposition = $this->attachResult ?\n\t\t\t\t\t'attachment; filename=' . $this->outputFileName :\n\t\t\t\t\t'inline';\n\t\t\theader('Content-Disposition: ' . $disposition);\n\t\t\theader('Content-Transfer-Encoding: binary');\n\t\t\theader('Content-Length: ' . filesize($this->outputFile));\n\n\t\t\twhile (ob_get_level()) {\n\t\t\t\tob_end_clean();\n\t\t\t}\n\t\t\tflush();\n\t\t\treadfile($this->outputFile);\n\t\t}\n\t}", "public function writeFile()\n {\n if (!empty($this->fileName)) {\n if (!file_exists($this->destinationPath)) {\n mkdir($this->destinationPath, 0777);\n }\n $file = $this->file();\n $fileHandle = fopen($file, 'w+');\n fwrite($fileHandle, $this->body);\n fclose($fileHandle);\n return $file;\n } else {\n return false;\n }\n }", "public function writeToFile($data){\t\n\t\tfwrite($this->fptr,$data);\n\t}", "public function whole() {\n\t\t$binary = parent::whole();\n\n\t\t$server = $this->server;\n\t\t$server->header(\"Content-Transfer-Encoding: Binary\");\n\t\t$server->header(\"Content-disposition: attachment; filename=\\\"\" . $this->file['name'] . \"\\\"\");\n\t\treturn $binary;\n\t}", "private function getFile(){\n if($this->checkStatus()){\n chdir('..');\n $filePos = $this->sanitizeInt($this->json->filePos);\n $fileName = $this->sanitizeString($this->json->fileName);\n $fileContents = file_get_contents('aud/'.$fileName);\n $fileMime = mime_content_type('aud/'.$fileName);\n $fileEncode = base64_encode($fileContents);\n $fileArray = array(\n 'fileName' => $fileName,\n 'fileMime' => $fileMime,\n 'fileEncode' => $fileEncode,\n 'filePos' => $filePos\n );\n header('content-type: application/json');\n echo json_encode($fileArray);\n } else {\n $this->notFound404();\n } \n }", "public function download($file_name)\n {\n return response()->download(LogViewer::pathToLogFile(base64_decode($file_name)));\n }", "public function file(){\n\t\theader('Content-Type: image/'.$this->extension);\n\t\tdie( readfile( $this->path ) );\n\t}", "public function download()\n {\n $hashids = new Hashids(Configure::read('Security.salt'));\n $pk = $hashids->decode($this->request->query['i'])[0];\n $this->loadModel($this->request->query['m']);\n $data = $this->{$this->request->query['m']}->find('first', array(\n 'recursive' => -1,\n 'conditions' => array(\n \"{$this->request->query['m']}.\" . $this->{$this->request->query['m']}->primaryKey => $pk\n ),\n 'fields' => array(\n \"{$this->request->query['m']}.{$this->request->query['f']}\"\n )\n ));\n $file = json_decode($data[$this->request->query['m']][$this->request->query['f']], true);\n\n header('Content-length: ' . $file['size']);\n header('Content-type: ' . $file['type']);\n header('Content-Disposition: inline; filename=' . $file['name']);\n echo base64_decode($file['content']);\n\n die();\n }", "private function sendFile($filename, $content, $type) {\n\t\tif ($type === 'unknown') {\n\t\t\treturn;\n\t\t}\n\n\t\t$content_type = '';\n\t\tif ($type === 'opml') {\n\t\t\t$content_type = 'application/xml';\n\t\t} elseif ($type === 'json_feed' || $type === 'json_starred') {\n\t\t\t$content_type = 'application/json';\n\t\t}\n\n\t\theader('Content-Type: ' . $content_type . '; charset=utf-8');\n\t\theader('Content-disposition: attachment; filename=' . $filename);\n\t\tprint($content);\n\t}", "function sendFile ($name = \"export.tex\") {\n header('Content-type: application/text');\n\t header('Content-Transfer-Encoding: binary');\n header(\"Content-Disposition: attachment; filename=$name\");\n echo $this->content;\n }", "function output_file($file, $name, $mime_type='')\n{\n if(!is_readable($file)) die('File not found or inaccessible!');\n \n $size = filesize($file);\n $name = rawurldecode($name);\n \n /* Figure out the MIME type (if not specified) */\n $known_mime_types=array(\n \t\"pdf\" => \"application/pdf\",\n \t\"txt\" => \"text/plain\",\n \t\"html\" => \"text/html\",\n \t\"htm\" => \"text/html\",\n\t\"exe\" => \"application/octet-stream\",\n\t\"zip\" => \"application/zip\",\n\t\"doc\" => \"application/msword\",\n\t\"xls\" => \"application/vnd.ms-excel\",\n\t\"ppt\" => \"application/vnd.ms-powerpoint\",\n\t\"gif\" => \"image/gif\",\n\t\"png\" => \"image/png\",\n\t\"jpeg\"=> \"image/jpg\",\n\t\"jpg\" => \"image/jpg\",\n\t\"php\" => \"text/plain\",\n \"xml\" => \"text/xml\",\n \"csv\" => \"text/csv\"\n );\n \n if($mime_type==''){\n\t $file_extension = strtolower(substr(strrchr($file,\".\"),1));\n\t if(array_key_exists($file_extension, $known_mime_types)){\n\t\t$mime_type=$known_mime_types[$file_extension];\n\t } else {\n\t\t$mime_type=\"application/force-download\";\n\t };\n };\n \n @ob_end_clean(); //turn off output buffering to decrease cpu usage\n \n // required for IE, otherwise Content-Disposition may be ignored\n if(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n \n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n \n /* The three lines below basically make the \n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n \n // multipart-download and download resuming support\n if(isset($_SERVER['HTTP_RANGE']))\n {\n\tlist($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n\tlist($range) = explode(\",\",$range,2);\n\tlist($range, $range_end) = explode(\"-\", $range);\n\t$range=intval($range);\n\tif(!$range_end) {\n\t\t$range_end=$size-1;\n\t} else {\n\t\t$range_end=intval($range_end);\n\t}\n \n\t$new_length = $range_end-$range+1;\n\theader(\"HTTP/1.1 206 Partial Content\");\n\theader(\"Content-Length: $new_length\");\n\theader(\"Content-Range: bytes $range-$range_end/$size\");\n } else {\n\t$new_length=$size;\n\theader(\"Content-Length: \".$size);\n }\n \n /* output the file itself */\n $chunksize = 1*(1024*1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r'))\n {\n\tif(isset($_SERVER['HTTP_RANGE']))\n\tfseek($file, $range);\n \n\twhile(!feof($file) && \n\t\t(!connection_aborted()) && \n\t\t($bytes_send<$new_length)\n\t )\n\t{\n\t\t$buffer = fread($file, $chunksize);\n\t\tprint($buffer); ////echo($buffer); // is also possible\n\t\tflush();\n\t\t$bytes_send += strlen($buffer);\n\t}\n fclose($file);\n } else die('Error - can not open file.');\n \ndie();\n}", "function exportData($data, $filename, $compression=\"\")\n{\n\t$browser = getBrowserInfo();\n\tif (preg_match(\"/ie/i\", $browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'inline';\n\t}\n\telse if (preg_match(\"/opera/i\", $browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'attachment';\n\t}\n\telse\n\t{\n\t\t$mime = \"application/octet-stream\";\n\t\t$disp = 'attachment';\n\t}\n\n\tif($compression==\"bzip\")\n\t{\n\t\t$mime='application/x-bzip';\n\t\t$filename.= \".bz2\";\n\t}\n\telse if($compression==\"gzip\")\n\t{\n\t\t$mime='application/x-gzip';\n\t\t$filename.= \".gz\";\n\t}\n\telse if($compression==\"zip\")\n\t{\n\t\t$mime='application/x-zip';\n\t\t$filename.= \".zip\";\n\t}\n\n\theader('Content-Type: '. $mime);\n\theader('Content-Disposition: '.$disp.'; filename=\"'.$filename.'\"');\n\tif(preg_match(\"/ie/i\", $browser[\"browser\"])) header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\theader('Pragma: no-cache');\n\theader('Expires: 0');\n\n\t// 1. as a bzipped file\n\tif($compression==\"bzip\")\n\t{\n\t\tif (@function_exists('bzcompress'))\n\t\t{\n\t\t\techo bzcompress($data);\n\t\t}\n\t}\n\t// 2. as a gzipped file\n\telse if ($compression == 'gzip')\n\t{\n\t\tif (@function_exists('gzencode'))\n\t\t{\n\t\t\techo gzencode($data);\n\t\t}\n\t}\n\telse if ($compression == 'zip')\n\t{\n\t\tif (@function_exists('gzcompress'))\n\t\t{\n\t\t\techo gzcompress($data);\n\t\t}\n\t}\n\t// 3. on screen\n\telse\n\t{\n\t\techo $data;\n\t}\n\texit;\n}", "function downloadFile($fileLocation, $fileName, $maxSpeed = 100, $doStream = false) {\r\n if (connection_status() != 0)\r\n return(false);\r\n // in some old versions this can be pereferable to get extention\r\n // $extension = strtolower(end(explode('.', $fileName)));\r\n $extension = pathinfo($fileName, PATHINFO_EXTENSION);\r\n\r\n $contentType = fileTypes($extension);\r\n header(\"Cache-Control: public\");\r\n header(\"Content-Transfer-Encoding: binary\\n\");\r\n header('Content-Type: $contentType');\r\n\r\n $contentDisposition = 'attachment';\r\n\r\n if ($doStream == true) {\r\n /* extensions to stream */\r\n $array_listen = array('zip', 'pdf', 'rar', 'doc');\r\n if (in_array($extension, $array_listen)) {\r\n $contentDisposition = 'inline';\r\n }\r\n }\r\n\r\n if (strstr($_SERVER['HTTP_USER_AGENT'], \"MSIE\")) {\r\n $fileName = preg_replace('/\\./', '%2e', $fileName, substr_count($fileName, '.') - 1);\r\n header(\"Content-Disposition: $contentDisposition;\r\n filename=\\\"$fileName\\\"\");\r\n } else {\r\n header(\"Content-Disposition: $contentDisposition;\r\n filename=\\\"$fileName\\\"\");\r\n }\r\n\r\n header(\"Accept-Ranges: bytes\");\r\n $range = 0;\r\n $size = filesize($fileLocation);\r\n\r\n if (isset($_SERVER['HTTP_RANGE'])) {\r\n list($a, $range) = explode(\"=\", $_SERVER['HTTP_RANGE']);\r\n str_replace($range, \"-\", $range);\r\n $size2 = $size - 1;\r\n $new_length = $size - $range;\r\n header(\"HTTP/1.1 206 Partial Content\");\r\n header(\"Content-Length: $new_length\");\r\n header(\"Content-Range: bytes $range$size2/$size\");\r\n } else {\r\n $size2 = $size - 1;\r\n header(\"Content-Range: bytes 0-$size2/$size\");\r\n header(\"Content-Length: \" . $size);\r\n }\r\n\r\n if ($size == 0) {\r\n die('Zero byte file! Aborting download');\r\n }\r\n set_magic_quotes_runtime(0);\r\n $fp = fopen(\"$fileLocation\", \"rb\");\r\n\r\n fseek($fp, $range);\r\n\r\n while (!feof($fp) and ( connection_status() == 0)) {\r\n set_time_limit(0);\r\n print(fread($fp, 1024 * $maxSpeed));\r\n flush();\r\n ob_flush();\r\n sleep(1);\r\n }\r\n fclose($fp);\r\n\r\n return((connection_status() == 0) and ! connection_aborted());\r\n }", "public static function sendFileResponse($path, $displayName)\n\t{\n\t\tif(!Storage::instance()->has($path)) return false;\n\t\t\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: application/octet-stream');\n\t\theader(\"Content-Disposition: attachment; filename=\\\"{$displayName}\\\"\");\n\t\theader(\"Content-Transfer-Enconding: binary\");\n\t\theader(\"Expires: 0\");\n\t\theader(\"Cache-Control: must-revalidate\");\n\t\theader(\"Pragma: public\");\n\t\theader(\"Content-Length: \" . Storage::instance()->getSize($path));\n\t\t\n\t\t/*\n\t\t discard the content of the output buffer and flush\n\t\t this is to avoid errors that might arise from using readfile()\n\t\t on large files\n\t\t*/\n\t\tob_clean();\n\t\tflush();\n\t\techo Storage::instance()->read($path);\n\t\texit;\n\t}", "public function download($id) {\n\t\tif (!$this->request->is('post')) {\n\t\t\tthrow new MethodNotAllowedException();\n\t\t}\n\t\tConfigure::write('debug', 0);\n\t\t$file = $this->Resource->findById($id);\n\t\t\n\t\t//header('Content-type: ' . $file['MyFile']['type']);\n//\t\theader('Content-length: ' . $file['MyFile']['size']); // some people reported problems with this line (see the comments), \t\t\tcommenting out this line helped in those cases\n\t\theader('Content-Disposition: attachment; filename=\"'.$file['Resource']['title'].'\"');\n\t\techo $file['Resource']['data'];\n\t\t\t\n\t\texit();\n}", "function output($file)\n {\n $fp=fopen($file,\"w\");\n fwrite($fp,$this->file());\n fclose($fp);\n\t\t\n\t\theader(\"Pragma: public\");\n\t\theader(\"Expires: 0\");\n\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\theader(\"Cache-Control: private\",false);\n\t\theader(\"Content-Type: application/zip\");\n\t\theader(\"Content-Disposition: attachment; filename=\".basename($file).\";\" );\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\theader(\"Content-Length: \".filesize($file));\n\t\treadfile(\"$file\");\n\t\t@unlink($file); \n }", "public function output($filename = null)\n {\n $iterator = $this->getIterator();\n //@codeCoverageIgnoreStart\n if (! is_null($filename) && self::isValidString($filename)) {\n $filename = (string) $filename;\n $filename = filter_var($filename, FILTER_UNSAFE_RAW, ['flags' => FILTER_FLAG_STRIP_LOW]);\n header('Content-Type: application/octet-stream');\n header('Content-Transfer-Encoding: binary');\n header('Content-Disposition: attachment; filename=\"'.$filename.'\"');\n if (! $iterator instanceof SplTempFileObject) {\n header('Content-Length: '.$iterator->getSize());\n }\n }\n //@codeCoverageIgnoreEnd\n $iterator->rewind();\n $iterator->fpassthru();\n }", "public function toResponse($request)\n {\n return response()->download($this->getPath(), $this->file_name);\n }", "private function _export() {\r\n $file = $this->writeJSON('load');\r\n if(file_exists($file)) {\r\n header('Content-Description: File Transfer');\r\n header('Content-Type: application/octet-stream');\r\n header('Content-Disposition: attachment; filename='.basename($file));\r\n header('Content-Transfer-Encoding: binary');\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($file));\r\n ob_clean();\r\n flush();\r\n readfile($file);\r\n exit;\r\n }\r\n }", "function downloadFile(){\n $file = basename($_GET['file']);\n $file = \"../temp/\".$file; \n if (!$file) { // file does not exist\n die('file not found');\n } else {\n header(\"Cache-Control: public\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Disposition: attachment; filename=$file\");\n header(\"Content-Type: application/txt\");\n header(\"Content-Transfer-Encoding: binary\");\n // read the file from disk\n readfile($file);\n }\n }", "function output_file($file) {\n\t\tif(!is_readable($file)) die('<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\"><HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1><P>The requested URL '.$_SERVER['REQUEST_URI'].' was not found on this server.</P></BODY></HTML>');\n\t\t\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename='.basename($file));\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Pragma: public');\n\t\theader('Content-Length: ' . filesize($file));\n\n\t\treadfile($file);\n\t\texit;\n\t}", "function send_file_to_client($real_filename, $filename, $send_inline = false, $send_name = false)\n{\n if(!file_exists($real_filename))\n {\n return false;\n }\n $content_type = get_mime_type($filename);\n\n if ($content_type == 'text/html') {\n $charset = '; charset=' . html_charset($real_filename);\n } elseif ($content_type == 'text/plain') {\n $charset = '; charset=' . text_charset($real_filename);\n } else {\n $charset = '';\n }\n \n $disposition = $send_inline? 'inline': 'attachment';\n\tif ($send_name) {\n // Add quotes to filename if it contains spaces\n if (strpos($filename, ' ') !== false) {\n $filename = '\"' . $filename . '\"';\n }\n $filenameattr = '; filename=' . $filename;\n\t} else {\n $filenameattr = '';\n }\n header(\"Content-type: $content_type$charset\");\n header(\"Content-Disposition: $disposition$filenameattr\");\n\n // IE cannot download from sessions without a cache\n if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))\n {\n header('Pragma: public');\n header('Cache-Control: no-store, no-cache, no-transform, must-revalidate, private');\n header('Expires: 0');\n }\n\n header('Content-length: ' . filesize($real_filename));\n $fp = fopen($real_filename, 'r');\n fpassthru($fp);\n return true;\n}", "public function download(){\n\t\treturn $this->fpdi->Output($this->fileName, 'D');\n\t}", "protected function filewrite($data = NULL) {\n ob_start();\n print_r($data);\n $c = ob_get_clean();\n $fc = fopen('txtfile' . DS . 'data.txt', 'w');\n fwrite($fc, $c);\n fclose($fc);\n }", "public function write($path, $data);", "function provide_file($filename) {\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n $MODE = 'txt';\n $attachment = \"attachment; \";\n if ($ext != '') {\n $MODE = $ext;\n }\n switch ($MODE) {\n case \"bz2\": $ctype=\"application/x-bzip2\"; break;\n case \"css\": $ctype=\"text/css\"; break;\n case \"gz\": $ctype=\"application/x-gzip\"; break;\n case \"gzip\": $ctype=\"application/x-gzip\"; break;\n case \"java\": $ctype=\"text/x-java-source\"; $attachment=\"\"; break;\n case \"tgz\": $ctype=\"application/x-compressed\"; break;\n case \"pdf\": $ctype=\"application/pdf\"; $attachment=\"\"; break;\n case \"zip\": $ctype=\"application/zip\"; break;\n case \"doc\": $ctype=\"application/msword\"; break;\n case \"docx\": $ctype=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"; break;\n case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\n case \"xlsx\": $ctype=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"; break;\n case \"ppt\": $ctype=\"application/vnd.ms-powerpoint\"; break;\n case \"pptx\": $ctype=\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"; break;\n case \"svg\": $ctype=\"image/svg+xml\"; $attachment=\"\"; break;\n case \"gif\": $ctype=\"image/gif\"; $attachment=\"\"; break;\n case \"png\": $ctype=\"image/png\"; $attachment=\"\"; break;\n case \"jpe\": case \"jpeg\":\n case \"jpg\": $ctype=\"image/jpg\"; $attachment=\"\"; break;\n case \"sql\":\n case \"txt\": $ctype=\"text/plain\"; $attachment=\"\"; break;\n case \"htm\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"html\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"htmls\": $ctype=\"text/html\"; $attachment=\"\"; break;\n default: $ctype=\"application/octet-stream\";\n }\n\n header(\"Content-Type: $ctype\");\n header('Content-Disposition: '.$attachment.'filename=\"'.basename($filename).'\"');\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\n echo file_get_contents($filename);\n\n }", "public function download($file_to_be_downloaded)\n {\n $response = $this->doRequest('/path/data/' . $file_to_be_downloaded, 'get');\n $removeheaders = $this->getBody($response);\n return file_put_contents($file_to_be_downloaded, $removeheaders);\n }", "public function download()\n {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . $this->getFilename());\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . $this->getSize());\n \\Oka\\Web\\Buffer::Clean();\n\n $this->read();\n exit;\n }", "public function downloadFile($file, $name, $mime_type='') {\n if(!is_readable($file)) throw new Exception('File not found or inaccessible! ['.$file.']');\n\n $size = filesize($file);\n $name = rawurldecode($name);\n\n /* Figure out the MIME type (if not specified) */\n $known_mime_types=array(\n \"pdf\" => \"application/pdf\",\n \"txt\" => \"text/plain\",\n \"html\" => \"text/html\",\n \"htm\" => \"text/html\",\n \"exe\" => \"application/octet-stream\",\n \"zip\" => \"application/zip\",\n \"doc\" => \"application/msword\",\n \"xls\" => \"application/vnd.ms-excel\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"gif\" => \"image/gif\",\n \"png\" => \"image/png\",\n \"jpeg\"=> \"image/jpg\",\n \"jpg\" => \"image/jpg\",\n \"php\" => \"text/plain\"\n );\n\n if($mime_type==''){\n $file_extension = strtolower(substr(strrchr($name,\".\"),1));\n if (array_key_exists($file_extension, $known_mime_types)) {\n $mime_type=$known_mime_types[$file_extension];\n }\n else {\n $mime_type=\"application/force-download\";\n };\n };\n\n @ob_end_clean(); //turn off output buffering to decrease cpu usage\n\n // required for IE, otherwise Content-Disposition may be ignored\n if(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n\n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n\n /* The three lines below basically make the\n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\n // multipart-download and download resuming support\n if(isset($_SERVER['HTTP_RANGE'])) {\n list($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n list($range) = explode(\",\",$range,2);\n list($range, $range_end) = explode(\"-\", $range);\n $range=intval($range);\n if (!$range_end) {\n $range_end=$size-1;\n }\n else {\n $range_end=intval($range_end);\n }\n\n $new_length = $range_end-$range+1;\n header(\"HTTP/1.1 206 Partial Content\");\n header(\"Content-Length: $new_length\");\n header(\"Content-Range: bytes $range-$range_end/$size\");\n }\n else {\n $new_length=$size;\n header(\"Content-Length: \".$size);\n }\n\n /* output the file itself */\n $chunksize = 1*(1024*1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r')) {\n if(isset($_SERVER['HTTP_RANGE'])) fseek($file, $range);\n\n while(!feof($file) && (!connection_aborted()) && ($bytes_send<$new_length)) {\n $buffer = fread($file, $chunksize);\n print($buffer); //echo($buffer); // is also possible\n flush();\n $bytes_send += strlen($buffer);\n }\n fclose($file);\n }\n else die('Error - can not open file.');\n\n die();\n }", "function return_file($filename, $format='json') {\n\t$curl=curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $filename);\n\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curl, CURLOPT_FRESH_CONNECT, true);\n\tcurl_setopt($curl, CURLOPT_VERBOSE, 1);\n\tcurl_setopt($curl, CURLOPT_HEADER, 0);\n\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/'.$format));\n\tcurl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');\n\t$file=curl_exec($curl);\n\tcurl_close($curl);\n\treturn $file;\n}", "public function streamFile($file, $file_name=null, $send_mode=\"file\") {\r\r\n\t\r\r\n\t\tif ($file_name == null)\r\r\n\t\t\t$file_name = basename($file);\r\r\n\t\r\r\n\t\t$this->setHeader(\"Content-Description\", \"File Transfer\");\r\r\n\t\tforeach ($this->content_type as $type)\r\r\n\t\t\t$this->setHeader(\"Content-Type\", $type);\r\r\n\t\t$this->setHeader(\"Content-Disposition\", \"inline; filename=\\\"\" . $file_name . \"\\\"\");\r\r\n\t\t$this->setHeader(\"Expires\", \"0\");\r\r\n\t\t$this->setHeader(\"Cache-Control\", \"public, must-revalidate, max-age=0\");\r\r\n\t\t$this->setHeader(\"Pragma\", \"public\");\r\r\n\t\t$this->setHeader(\"Content-Length\", filesize($file));\r\r\n\t\t\r\r\n\t\t$this->output($file, $send_mode);\r\r\n\t}", "function ServeFile($filepath) {\n $contenttype = ExtentionToMimeType(pathinfo($filepath, PATHINFO_EXTENSION));\n header(\"Content-type: $contenttype\");\n $filename = basename($filepath);\n if ($contenttype == \"application/octet-stream\")\n header(\"Content-Disposition: attachment; filename=$filename\");\n readfile($filepath);\n return true;\n}", "public function httpGet(RequestInterface $request, ResponseInterface $response) {\n\t\t// Only handle valid files\n\t\t$node = $this->tree->getNodeForPath($request->getPath());\n\t\tif (!($node instanceof IFile)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// adds a 'Content-Disposition: attachment' header\n\t\tif ($this->downloadAttachment) {\n\t\t\t$filename = $node->getName();\n\t\t\tif ($node instanceof IProvidesAdditionalHeaders) {\n\t\t\t\t$filename = $node->getContentDispositionFileName();\n\t\t\t}\n\t\t\tif ($this->request->isUserAgent(\n\t\t\t\t[\n\t\t\t\t\tRequest::USER_AGENT_IE,\n\t\t\t\t\tRequest::USER_AGENT_ANDROID_MOBILE_CHROME,\n\t\t\t\t\tRequest::USER_AGENT_FREEBOX,\n\t\t\t\t])) {\n\t\t\t\t$response->setHeader('Content-Disposition', 'attachment; filename=\"' . \\rawurlencode($filename) . '\"');\n\t\t\t} else {\n\t\t\t\t$response->setHeader('Content-Disposition', 'attachment; filename*=UTF-8\\'\\'' . \\rawurlencode($filename)\n\t\t\t\t\t\t\t\t\t\t\t\t\t . '; filename=\"' . \\rawurlencode($filename) . '\"');\n\t\t\t}\n\t\t}\n\n\t\tif ($node instanceof \\OCA\\DAV\\Connector\\Sabre\\File) {\n\t\t\t//Add OC-Checksum header\n\t\t\t/** @var $node File */\n\t\t\t$checksum = $node->getChecksum('sha1');\n\t\t\tif ($checksum !== null && $checksum !== '') {\n\t\t\t\t$response->addHeader('OC-Checksum', $checksum);\n\t\t\t}\n\t\t\t// disable nginx buffering so big downloads through ownCloud won't\n\t\t\t// cause memory problems in the nginx process.\n\t\t\t$response->addHeader('X-Accel-Buffering', 'no');\n\t\t}\n\n\t\tif ($node instanceof IProvidesAdditionalHeaders) {\n\t\t\t$headers = $node->getHeaders();\n\t\t\tif (\\is_array($headers)) {\n\t\t\t\t$response->addHeaders($headers);\n\t\t\t}\n\t\t}\n\t}", "private function output($file, $type) {\r\r\n\t\tswitch ($type) {\r\r\n\t\t\t// output file as data\r\r\n\t\t\tcase \"data\":\r\r\n\t\t\t\techo $file;\r\r\n\t\t\t\tbreak;\r\r\n\t\t\t// output file as filename\r\r\n\t\t\tcase \"file\":\r\r\n\t\t\t\treadfile($file);\r\r\n\t\t\t\tbreak;\r\r\n\t\t\t// mod_xsendfile as filename\r\r\n\t\t\tcase \"xsendfile\":\r\r\n\t\t\t\t$this->setHeader(\"X-Sendfile\", $file);\r\r\n\t\t\t\tbreak;\r\r\n\t\t}\r\r\n\t}", "public function storeAsFile($url,$data,$content_type) {\n\t\tif ( $this->curl )\treturn $this->_curl_storeAsFile($url,$data,$content_type);\n\t\telse\t\t\t\treturn $this->_socket_storeAsFile($url,$data,$content_type);\n\n\t}", "private function appendToFile($string) {\n fwrite($this->fileresource, $string.chr(10));\n }", "public function returnStorageFileDownloadResponse(StorageFile $storageFile, array $additionalHeaders = [], $isInlineDisposition = false);", "public function _curl_storeAsFile($url,$data,$content_type) {\n\t\tif ( !strlen($url) )\tthrow new InvalidArgumentException(\"Attachment URL can't be empty\");\n\t\tif ( !strlen($content_type) ) throw new InvalidArgumentException(\"Attachment Content Type can't be empty\");\n\t\t$url = $this->dsn.$url;\n\t\t$http = curl_init($url);\n\t\t$http_headers = array('Accept: application/json,text/html,text/plain,*/*','Content-Type: '.$content_type,'Expect: ','Content-Length: '.strlen($data)) ;\n\t\tcurl_setopt($http, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\tcurl_setopt($http, CURLOPT_HTTPHEADER,$http_headers);\n\t\tcurl_setopt($http, CURLOPT_HEADER, true);\n\t\tcurl_setopt($http, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($http, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($http, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($http);\n\t\tcurl_close($http);\n\t\treturn $response;\n\t}", "function downloadFile($filePath)\r\n{\r\n header(\"Content-type: application/octet-stream\");\r\n header('Content-Disposition: attachment; filename=\"' . basename($filePath) . '\"');\r\n header('Content-Length: ' . filesize($filePath));\r\n readfile($filePath);\r\n}", "public function serve()\n {\n// header('HTTP/1.1 301');\n// header('Location: ' . $this->saveHandler->getPublicServePath() . $this->getFilename());\n// die();\n\n // read file and output\n // this is definitely slower - however current use case is to put it behind a cdn distribution\n $file = $this->saveHandler->getPublicServePath() . $this->getFilename();\n $mimetype = exif_imagetype($file);\n header('Content-Type: '.$mimetype);\n readfile($file);\n die();\n }", "function output_file($Source_File, $Download_Name, $mime_type='')\n{\nif(!is_readable($Source_File)) die('File not found or inaccessible!');\n \n$size = filesize($Source_File);\n$Download_Name = rawurldecode($Download_Name);\n \n/* Figure out the MIME type (if not specified) */\n$known_mime_types=array(\n \"pdf\" => \"application/pdf\",\n \"csv\" => \"application/csv\",\n \"txt\" => \"text/plain\",\n \"html\" => \"text/html\",\n \"htm\" => \"text/html\",\n \"exe\" => \"application/octet-stream\",\n \"zip\" => \"application/zip\",\n \"doc\" => \"application/msword\",\n \"xls\" => \"application/vnd.ms-excel\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"gif\" => \"image/gif\",\n \"png\" => \"image/png\",\n \"jpeg\"=> \"image/jpg\",\n \"jpg\" => \"image/jpg\",\n \"php\" => \"text/plain\"\n);\n \nif($mime_type==''){\n $file_extension = strtolower(substr(strrchr($Source_File,\".\"),1));\n if(array_key_exists($file_extension, $known_mime_types)){\n $mime_type=$known_mime_types[$file_extension];\n } else {\n $mime_type=\"application/force-download\";\n };\n};\n \n@ob_end_clean(); //off output buffering to decrease Server usage\n \n// if IE, otherwise Content-Disposition ignored\nif(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n \nheader('Content-Type: ' . $mime_type);\nheader('Content-Disposition: attachment; filename=\"'.$Download_Name.'\"');\nheader(\"Content-Transfer-Encoding: binary\");\nheader('Accept-Ranges: bytes');\n \nheader(\"Cache-control: private\");\nheader('Pragma: private');\nheader(\"Expires: Thu, 26 Jul 2012 05:00:00 GMT\");\n \n// multipart-download and download resuming support\nif(isset($_SERVER['HTTP_RANGE']))\n{\n list($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n list($range) = explode(\",\",$range,2);\n list($range, $range_end) = explode(\"-\", $range);\n $range=intval($range);\n if(!$range_end) {\n $range_end=$size-1;\n } else {\n $range_end=intval($range_end);\n }\n \n $new_length = $range_end-$range+1;\n header(\"HTTP/1.1 206 Partial Content\");\n header(\"Content-Length: $new_length\");\n header(\"Content-Range: bytes $range-$range_end/$size\");\n} else {\n $new_length=$size;\n header(\"Content-Length: \".$size);\n}\n \n/* output the file itself */\n$chunksize = 1*(1024*1024); //you may want to change this\n$bytes_send = 0;\nif ($Source_File = fopen($Source_File, 'r'))\n{\n if(isset($_SERVER['HTTP_RANGE']))\n fseek($Source_File, $range);\n \n while(!feof($Source_File) &&\n (!connection_aborted()) &&\n ($bytes_send<$new_length)\n )\n {\n $buffer = fread($Source_File, $chunksize);\n print($buffer); //echo($buffer); // is also possible\n flush();\n $bytes_send += strlen($buffer);\n }\nfclose($Source_File);\n} else die('Error - can not open file.');\n \ndie();\n}", "public static function dieFileFromString($content, $fileName)\n {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . $fileName);\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . \\Tools::strlen($content));\n\n echo $content;\n\n die(200);\n }", "public function download(string $filename, string $name = null, array $headers = []): ResponseInterface;", "function exportFile($file, $filename,$mimetype=\"\", $detectmime=true)\n{\n\tinclude_once(atkconfig(\"atkroot\").\"atk/atkbrowsertools.inc\");\n\t$browser = getBrowserInfo();\n\tif (preg_match(\"/ie/i\", $browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'attachment';\n\t}\n\telse if (preg_match(\"/opera/i\",$browser[\"browser\"]))\n\t{\n\t\t$mime = \"application/octetstream\";\n\t\t$disp = 'inline';\n\t}\n\telse\n\t{\n\t\t$mime = \"application/octet-stream\";\n\t\t$disp = 'attachment';\n\t}\n\tif($mimetype!=\"\") $mime=$mimetype;\n\telse if ($mimetype==\"\" && $detectmime && function_exists('mime_content_type'))\n\t$mime = mime_content_type($file);\n\n\t$fp = @fopen($file,\"rb\");\n\tif ($fp!=NULL)\n\t{\n\t\theader('Content-Type: '. $mime);\n\t\theader(\"Content-Length: \".filesize($file));\n\t\theader('Content-Disposition: '.$disp.'; filename=\"'.$filename.'\"');\n\t\tif(preg_match(\"/ie/i\", $browser[\"browser\"])) header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\tif (($_SERVER[\"SERVER_PORT\"] == \"443\" || $_SERVER['HTTP_X_FORWARDED_PROTO' ]==='https') && preg_match(\"/msie/i\", $_SERVER[\"HTTP_USER_AGENT\"]))\n\t\t{\n\t\t\theader('Pragma: public');\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Pragma: no-cache');\n\t\t}\n\t\theader('Expires: 0');\n\n\t\theader(\"Content-Description: File Transfer\");\n\t\theader(\"Content-Transfer-Encoding: binary\");\n\n\t\tfpassthru($fp);\n\t\treturn true;\n\t}\n\treturn false;\n}", "private\tfunction _writeOutput($filename, $data) {\n\t\tjimport('joomla.filesystem.archive');\n\t\tjimport('joomla.filesystem.file');\n\n\t\t$params = JComponentHelper::getParams('com_j2store');\n\t\t$default_save_path = JPATH_ADMINISTRATOR.'/components/com_j2store/backup';\n\t\t$save_path = $params->get('backupfolderpath', $default_save_path);\n\n\t\t$full_file_path = $save_path.'/'.$filename;\n\t\tif(!JFile::exists($full_file_path)){\n\t\t\tJFile::write(JPath::clean($save_path).'/'.$filename, $data);\n\t\t}\n\n\t}", "protected function _writeFileBody() {}", "protected function sendFile(SplFileInfo $file): ResponseInterface\n {\n $fileStream = fopen($file->getRealPath(), 'rb');\n\n return $this->response->withHeader('Content-Type', 'application/force-download')\n ->withHeader('Content-Type', 'application/octet-stream')\n ->withHeader('Content-Type', 'application/download')\n ->withHeader('Content-Description', 'File Transfer')\n ->withHeader('Content-Transfer-Encoding', 'binary')\n ->withHeader('Content-Disposition', 'attachment; filename=\"'.$file->getBasename().'\"')\n ->withHeader('Expires', '0')\n ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')\n ->withHeader('Pragma', 'public')\n ->withBody(new Stream($fileStream));\n }", "public function write_file ( $content ) {\r\n\r\n\t}", "public static function stream($file, $name = null) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.(is_null($name) ? basename($file) : $name));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n }", "function sentFile($nombre, $contenido, $mimetype=\"text/plain\"){\n\t\theader(\"Content-type: $mimetype; charset=UTF-8 \");\n\t\theader(\"Content-Disposition: attachment; filename=\".$nombre);\n\t\theader(\"Pragma: no-cache\");\n\t\theader(\"Expires: 0\");\n\t\t\n\t\texit($contenido);\n\t}", "function getResponseBody(){\n $page = \"\";\n if ($this->fpopened===FALSE) return $page;\n while (!feof ($this->fpopened)) {\n $page .= fread ($this->fpopened, 1024);\n }\n return $page;\n }", "public function render()\n\t{\n\t\t$this->addHTTPHeader('Content-Type', $this->getMimeType());\n\n\t\t$name = $this->getName();\n\n\t\tif (!empty($name))\n\t\t{\n\t\t\t$this->addHTTPHeader('Content-Disposition', 'attachment; filename=\"' . $name . '.csv\"', true);\n\t\t}\n\n\t\t$this->outputHTTPHeaders();\n\n echo $this->getBuffer();\n\t}", "function sendRequest($fp, $requestString)\n{\n\tfwrite($fp, $requestString);\n}", "public function download(array $data = [])\n {\n $filename = $this->reference . '.pdf';\n\n return new Response($this->pdf($data), 200, [\n 'Content-Description' => 'File Transfer',\n 'Content-Disposition' => 'attachment; filename=\"'.$filename.'\"',\n 'Content-Transfer-Encoding' => 'binary',\n 'Content-Type' => 'application/pdf',\n ]);\n }", "public function download($file){\n return response()->download('storage/'.$file);\n }", "function http_send_content_disposition($filename, $inline = null) {}", "static function sendFileToBrowser($fileData, $fileName, $mimeType = false) {\n\t\tif(!$mimeType) $mimeType = self::getMimeType($fileName);\n\t\t$ext = strtolower(substr($fileName,strrpos($fileName,'.')+1));\n\t\t$inlineExtensions = array('pdf','png','jpg','jpe','gif','swf','htm','html','txt','text','avi','wmv','mov','mpe','mpg','mp3','mpeg');\n\n\t\tif(in_array($ext, $inlineExtensions)) $inline = true;\n\n\t\theader(\"Content-Type: $mimeType; name=\\\"\" . addslashes($fileName) . \"\\\"\");\n\t\t//header(\"Content-Type: $mimeType\" );\n\t\t// Downloadable\n\t\t//if(!$inline)\n\t\t\t$dispHeader = \"Content-disposition: attachment; filename=\" . addslashes($fileName) . \"\";\n\n\t\t// Debug::message('CD: ' . strlen( $dispHeader ) );\n\n\n\t\theader( $dispHeader );\n\t\theader(\"Content-Length: \" . strlen($fileData));\n\n\t\techo $fileData;\n\n\t\texit();\n\t}", "public function download()\n\t{\n\t\tR::selectDatabase('oxid');\n\t\t$files = $this->getFilesByName(Flight::request()->query->file);\n\t\tif (empty($files)) $this->redirect('/');\n\t\t$file = reset($files);\n\t\t$dwnloadDir = substr($file['OXSTOREHASH'], 0, 2);\n\t\t$dwnloadFile = Flight::get('oxid_dir_downloads').$dwnloadDir.'/'.$file['OXSTOREHASH'];\n\t\tif ( ! is_file($dwnloadFile)) $this->redirect('/');\n\t\t//error_log($dwnloadFile);\n\t\theader('Content-type: application/pdf');\n\t\theader('Content-Disposition: inline; filename=\"'.$file['OXFILENAME'].'\"');\n\t\t@readfile($dwnloadFile);\n\t}", "public function ofFile($path_file_name, $string_buffer = '', $options = []){\n\n $stream = fopen($path_file_name, 'W+b');\n if ('' !== $string_buffer) {\n fwrite($stream, $string_buffer);\n fseek($stream, 0);\n }\n return $this->init_stream($stream, $options,self::STREAM_FILE);\n\n }", "function write_file($file_name, $arr_line, $on_server = FALSE, $mode = \"w+\", $force_download = FALSE){\r\n\tif(!is_array($arr_line)){\r\n\t\t$arr_line = array($arr_line);\r\n\t}\r\n\tif($on_server){\r\n\t\t$file_name_temp = \"../temp/\".date(\"YmdHis\");\r\n\t\t$file = fopen($file_name_temp, $mode);\r\n\t\tfwrite($file, implode(\"\\r\\n\", $arr_line));\r\n\t\tfclose($file);\r\n\t\t@chmod($file_name_temp, 0777);\r\n\t\tif(strtolower(substr($file_name, 0, 6)) === \"ftp://\"){\r\n\t\t\t$ftp_full_url = substr($file_name, 6);\r\n\t\t\t$ftp_arr_url = explode(\"@\", $ftp_full_url);\r\n\t\t\tif(count($ftp_arr_url) === 1){\r\n\t\t\t\t$ftp_login = array();\r\n\t\t\t\t$ftp_url = $ftp_full_url;\r\n\t\t\t}else{\r\n\t\t\t\t$ftp_login = explode(\":\", $ftp_arr_url[0]);\r\n\t\t\t\t$ftp_url = $ftp_arr_url[1];\r\n\t\t\t}\r\n\t\t\t$ftp_dir = explode(\"/\", $ftp_url);\r\n\t\t\t$ftp_host = array_shift($ftp_dir);\r\n\t\t\t$ftp_file = array_pop($ftp_dir);\r\n\t\t\t$ftp = ftp_connect($ftp_host);\r\n\t\t\tif($ftp === FALSE){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!ftp_login($ftp, $ftp_login[0], $ftp_login[1])){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tforeach($ftp_dir as $dir){\r\n\t\t\t\tif(!ftp_chdir($ftp, $dir)){\r\n\t\t\t\t\treturn FALSE;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!ftp_put($ftp, $ftp_file, $file_name_temp, FTP_BINARY)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tunlink($file_name_temp);\r\n\t\t}else{\r\n\t\t\tif(file_exists($file_name)){\r\n\t\t\t\tunlink($file_name);\r\n\t\t\t}\r\n\t\t\trename($file_name_temp, $file_name);\r\n\t\t}\r\n\t\treturn TRUE;\r\n\t}else{\r\n\t\tif($force_download){\r\n\t\t\t$dirname = __DIR__.\"/../temp/download/\";\r\n\t\t\tif(!is_dir($dirname)){\r\n\t\t\t\tmkdir($dirname, 0777, true);\r\n\t\t\t}\r\n\t\t\t$filename = $dirname.basename($file_name);\r\n\t\t\t$file = fopen($filename, \"w+\");\r\n\t\t\tfwrite($file, implode(\"\\r\\n\", $arr_line));\r\n\t\t\tfclose($file);\r\n\t\t\tdownload($filename);\r\n\t\t}else{\r\n\t\t\t$file_name = str_replace(\"\\\\\", \"\\\\\\\\\", $file_name);\r\n\t\t\tforeach($arr_line as $i => $line){\r\n\t\t\t\t$line = str_replace(\"\\\\\", \"\\\\\\\\\", $line);\r\n\t\t\t\t$line = str_replace(\"\\\"\", \"\\\\\\\"\", $line);\r\n\t\t\t\t$line = str_replace(\"\\r\\n\", \"\\\\r\\\\n\", $line);\r\n\t\t\t\t$line = \"\\\"\".$line.\"\\\"\";\r\n\t\t\t\t$arr_line[$i] = $line;\r\n\t\t\t}\r\n\t\t\treturn script(\"write_file(\\\"\".$file_name.\"\\\",[\".implode(\",\", $arr_line).\"],\\\"\".$mode.\"\\\")\");\r\n\t\t}\r\n\t}\r\n}", "public function forceDownload(string $fileName = null, string $data = null)\n {\n if (empty($fileName)) {\n return null;\n }\n\n if ($data === null) {\n\n if (!(@is_file($fileName) && ($fileSize = @filesize($fileName)) !== false)) {\n return null;\n }\n\n $filePath = $fileName;\n $fileName = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $fileName));\n $fileName = end($fileName);\n\n } else {\n $fileSize = strlen($data);\n }\n\n // Set the default MIME type to send\n $mime = 'application/octet-stream';\n $x = explode('.', $fileName);\n $extension = end($x);\n\n // http://digiblog.de/2011/04/19/android-and-the-download-file-headers\n if (count($x) !== 1 && isset($_SERVER['HTTP_USER_AGENT']) && preg_match(\n '/Android\\s(1|2\\.[01])/',\n $_SERVER['HTTP_USER_AGENT']\n )\n ) {\n $x[count($x) - 1] = strtoupper($extension);\n $fileName = implode('.', $x);\n }\n\n if ($data === null && ($fp = @fopen($filePath, 'rb')) === false) {\n return null;\n }\n\n // Clean output buffer\n if (ob_get_level() !== 0 && @ob_end_clean() === false) {\n @ob_clean();\n }\n\n // Generate the server headers\n header('Content-Type: ' . $mime);\n header('Content-Disposition: attachment; filename=\"' . $fileName . '\"');\n header('Expires: 0');\n header('Content-Transfer-Encoding: binary');\n header('Content-Length: ' . $fileSize);\n\n // Internet Explorer-specific headers\n if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {\n header('Cache-Control: no-cache, no-store, must-revalidate');\n }\n\n header('Pragma: no-cache');\n\n // If we have raw data - just dump it\n if ($data !== null) {\n exit($data);\n }\n\n // Flush 1MB chunks of data\n while (!feof($fp) && ($data = fread($fp, round($this->speed * 1024, 0))) !== false) {\n echo $data;\n sleep(1);\n }\n\n fclose($fp);\n exit(ErrorDebugExit::CODE);\n }", "function output_file( $file_md5, $name, $mimecontent )\r\n{\r\n\t//register_shutdown_function( 'function_name' );\r\n\r\n\tif(!file_exists($file_md5))\r\n\t die('El archivo para subir no existe !');\r\n\r\n\t$size = filesize($file_md5);\r\n\t\r\n//\t$name = rawurldecode($name);\r\n\t\r\n\tif (ereg('Opera(/| )([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']))\r\n\t\t$UserBrowser = \"Opera\";\r\n\telseif (ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']))\r\n\t\t$UserBrowser = \"IE\";\r\n\telse\r\n\t\t$UserBrowser = '';\r\n\r\n\t/// important for download im most browser\r\n\t$mime_type = ($UserBrowser == 'IE' || $UserBrowser == 'Opera') ?\r\n\t 'application/octetstream' : 'application/octet-stream';\r\n\t \r\n\t@ob_end_clean(); /// decrease cpu usage extreme\r\n\t\r\n\theader('Content-Type: ' . $mime_type);\r\n//\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\t //jels\r\n \theader('Content-Disposition: attachment; filename=\"'.$name.'\"');\r\n\theader('Accept-Ranges: bytes');\r\n\theader(\"Cache-control: private\");\r\n\theader('Pragma: private');\r\n\t\r\n\t///// multipart-download and resume-download\r\n\tif(isset($_SERVER['HTTP_RANGE']))\r\n\t{\r\n\t\tlist($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE']);\r\n\t\tstr_replace($range, \"-\", $range);\r\n\t\t$size2 = $size-1;\r\n\t\t$new_length = $size-$range;\r\n\t\theader(\"HTTP/1.1 206 Partial Content\");\r\n\t\theader(\"Content-Length: $new_length\");\r\n\t\theader(\"Content-Range: bytes $range$size2/$size\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$size2=$size-1;\r\n\t\theader(\"Content-Length: \".$size);\r\n\t}\r\n\r\n\t$chunksize = 1*(1024*1024);\r\n\r\n\t$bytes_send = 0;\r\n\r\n\tif ($file = fopen($file_md5, 'r'))\r\n\t{\r\n\t\tif(isset($_SERVER['HTTP_RANGE']))\r\n\t\t fseek($file, $range);\r\n\t\t\r\n\t\twhile(!feof($file) and (connection_status()==0))\r\n\t\t{\r\n\t\t\t$buffer = fread($file, $chunksize);\r\n\t\t\tprint($buffer);\r\n\t\t\tflush();\r\n\t\t\t$bytes_send += strlen($buffer);\r\n\t\t\t//sleep(1);//// decrease download speed\r\n\t\t}\r\n\t\tfclose($file);\r\n\t}\r\n\telse\r\n\t\tdie('No se puede abrir el archivo.');\r\n\t\t\r\n\tif(isset($new_length))\r\n\t\t$size = $new_length;\r\n\t\t\r\n//\tdie();\r\n}" ]
[ "0.6335223", "0.61798406", "0.61407566", "0.611191", "0.61107653", "0.5948582", "0.59473366", "0.58791435", "0.5851102", "0.58078676", "0.58027303", "0.5768051", "0.5752151", "0.56838065", "0.56687355", "0.5660713", "0.56225115", "0.5613966", "0.5609849", "0.5607178", "0.5598987", "0.55742586", "0.55602026", "0.5551153", "0.5540715", "0.5537496", "0.5534293", "0.55277896", "0.5524064", "0.5519154", "0.5505008", "0.549085", "0.5475367", "0.5452797", "0.54489523", "0.54403716", "0.54139304", "0.5357399", "0.5352198", "0.5348686", "0.5347011", "0.534087", "0.53394395", "0.533898", "0.5337292", "0.5332387", "0.53228205", "0.5319881", "0.53172857", "0.5311331", "0.5310582", "0.53037554", "0.53029794", "0.52929544", "0.5291918", "0.5275691", "0.52740616", "0.5268448", "0.5258731", "0.5258707", "0.5255677", "0.5252239", "0.52366436", "0.5235098", "0.52307266", "0.52286816", "0.5217863", "0.5215409", "0.5211813", "0.52088654", "0.5192052", "0.5190102", "0.51898474", "0.5167998", "0.51630855", "0.5157304", "0.51562625", "0.514721", "0.5142945", "0.51407635", "0.51357627", "0.5133109", "0.512335", "0.5122216", "0.512007", "0.51161987", "0.5115232", "0.51126367", "0.51120263", "0.51087636", "0.51079744", "0.51064473", "0.51010555", "0.51004183", "0.5098315", "0.50952744", "0.50843537", "0.5080667", "0.50794107", "0.50724757" ]
0.6492453
0
Redirect to the current page (i.e. after a form is submitted).
public function redirectHere($code = 302, $suffix = ''): self { return $this->withRedirect($this->url->current().$suffix, $code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function redirectToCurrentPage() {}", "public function redirect (\n\t)\t\t\t\t\t// RETURNS <void> redirects to the appropriate page.\n\t\n\t// $contentForm->redirect($redirectTo);\n\t{\n\t\tif($this->redirectOnError)\n\t\t{\n\t\t\theader(\"Location: \" . $this->redirectOnError); exit;\n\t\t}\n\t\t\n\t\theader(\"Location: /\"); exit;\n\t}", "function redirect()\n {\n global $wgOut;\n $wgOut->redirect( $this->getRedirectLink(), 302);\n }", "function redirect($url=null)\n\t{\n\t\tif (is_null($url))\n\t\t\t$url = $_SERVER['PHP_SELF'];\n\t\theader(\"Location: $url\");\n\t\texit();\n\t}", "public function redirect();", "public function redirect();", "public function redirect();", "function AfterSubmitRedirect($url){\n \tif ($this->is_context_frame)$url.=\"&contextframe=1\";\n $this->Response->Redirect($url);\n }", "function redirect() {\n\t\theader('Location:index.php');\n\t}", "public function redirectBack()\n {\n $httpReferer = $this->referer();\n $previousRoute = \\explode(\"?\", $httpReferer)[0];\n\n $this->redirect($previousRoute);\n }", "abstract protected function redirectTo();", "abstract protected function redirect();", "protected function _redirectBack()\n {\n $this->_helper->redirector->gotoUrl($this->_request->getServer('HTTP_REFERER'));\n }", "public function do_redirect() {\n\t\twp_safe_redirect( $GLOBALS['redirect_to'] );\n\t\texit;\n\t}", "public function redirect() : void\n {\n $controller = $this->getNamespace() . $this->params['controller'];\n $action = $this->capitalizeAction($this->params['action']);\n\n if (class_exists($controller)) \n {\n $controller = new $controller;\n unset($this->params['controller']);\n\n if (is_callable([$controller, $action])) \n {\n unset($this->params['action']);\n unset($this->params['namespace']);\n }\n else\n {\n die('Page not found.');\n }\n }\n else \n {\n header('location: ' . URLROOT);\n }\n\n call_user_func_array([$controller, $action], [$this->params]);\n }", "public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }", "private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}", "public function doRedirect() {\n if(is_null($this->redirect)) {\n return;\n }\n\n if(is_string($this->redirect)) {\n $this->setHeader(\"Location: \" . $this->redirect);\n }\n\n if(is_array($this->redirect)) {\n $url = '/?' . http_build_query($this->redirect);\n $this->setHeader(\"Location: \" . $url);\n }\n return;\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "public static function redirect() {\n\t\tunset( $_GET['action'] );\n\n\t\twp_safe_redirect( admin_url( 'admin.php?page=' . WPFC_QS_Setup::get_template_name() . '-setup' ) );\n\n\t\texit();\n\t}", "function confirmation_redirect() {\n if (!SwpmFbForm::is_form_submitted() || $this->form->is_fatal() || !$this->form->is_valid()) {\n return;\n }\n\n global $wpdb;\n\n $form_id = ( isset($_REQUEST['form_id']) ) ? (int) esc_html($_REQUEST['form_id']) : '';\n\n // Get forms\n $order = sanitize_sql_orderby('form_id DESC');\n $forms = $wpdb->get_results($wpdb->prepare(\"SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order\", $form_id));\n\n foreach ($forms as $form) :\n // If text, return output and format the HTML for display\n if ('page' == $form->form_success_type) {\n $page = get_permalink($form->form_success_message);\n wp_redirect($page);\n exit();\n }\n // If redirect, redirect to the URL\n elseif ('redirect' == $form->form_success_type) {\n wp_redirect(esc_url($form->form_success_message));\n exit();\n }\n\n endforeach;\n }", "private function _redirect()\n\t{\n\n\t\t$this->_urlPagSeguro = $this->request->post['url_ps'];\n\n\t\tif (!empty($this->_urlPagSeguro )) {\n\t\t\theader('Location: ' . $this->_urlPagSeguro);\n\t\t\t$this->cart->clear();\n\t\t}\n\t}", "public function redirectAction()\n {\n $this->getResponse()->setBody($this->getLayout()->createBlock('paymentsensegateway/redirect')->toHtml());\n }", "private function redirect()\n\t\t{\n\t\t\tif(isUserLoggedIn())\n\t\t\t{\n\t\t\t\theader(\"Location: \" . APPROOT);\n\t\t\t}\n\t\t}", "function RedirectTo($newlocation){\n\t\theader('location:' . $newlocation);\n\t\texit();\n\t}", "function redirect() {\n\t\theader('Location: admin.php');\n\t\texit();\n\t}", "public function redirectAction()\n {\n $model = new KBariotis_NBP_Model_NBP();\n\n $redirectUrl = $model->getRedirectUrl();\n\n if ($redirectUrl)\n $this->_redirectUrl($redirectUrl);\n else\n $this->_redirectUrl(Mage::getUrl('checkout/onepage/failure'));\n }", "public function doRedirectLogin() {\n\t\t\theader(\"Location: ../../login.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}", "protected function redirect()\n\t{\n\t\theader('Location: /ru/marafon/');\n\t\texit;\n\t}", "function redirectAfterLogin() {\n\tsession_start();\n\tif(!isset($_SESSION[\"gotoPage\"]))\n\t\ttrigger_error(\"There is no redirect page\");\n\t//trigger_error(\"going to \" . $_SESSION[\"gotoPage\"]);\n\theader(\"Location: \" . $_SESSION[\"gotoPage\"]);\n}", "public function redirectTo();", "public function redirectAction()\n {\n\t\t\n $session = Mage::getSingleton('checkout/session');\n $session->setHdfcStandardQuoteId($session->getQuoteId());\n\t\t$order = $this->getOrder();\n\t\t\n \n if (!$order->getId()) {\n\t\t\n\t\t\t$this->_forward('failurerefresh');\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('hdfc')->__('Customer was redirected to hdfc')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('hdfc/standard_redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "public function redirect() {\n\n if (isset($_GET['view'])) {\n $view = \"view=\" . $_GET['view'];\n } else {\n $view = \"view=return\";\n }\n\n $return_url = substr(BASE_URL, 0, -12) . 'index.php?' . $view . '&transactionid=' . $_GET['transactionid'];\n header(\"Location: \" . $return_url);\n }", "function redirect() {\n\n\t\tif ($this->redirectUrl) {\n\t\t\tif ($this->message) {\n\t\t\t\tKenedoPlatform::p()->sendSystemMessage($this->message, $this->messageType);\n\t\t\t}\n\t\t\tKenedoPlatform::p()->redirect($this->redirectUrl);\n\t\t}\n\n\t}", "public function redirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setAlipayPaymentQuoteId($session->getQuoteId());\n\n $order = $this->getOrder();\n\n if (!$order->getId()) {\n $this->norouteAction();\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('alipay')->__('客户跳转到支付宝网站')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('alipay/redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "function redirect($page)\n\t{\n\t\t$currentPage = basename($_SERVER['PHP_SELF']);\n\t\t// prevent redirecting away from graphs.php when $.post is accessing\n\t\tif ($currentPage == 'graphs.php' || $currentPage == 'verify.php')\n\t\t{\n\t\t\tif ($_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest')\n\t\t\t{\n\t\t\t\theader('Location: /fp2.0/');\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t\telse if ($currentPage != $page)\n\t\t{\n\t\t\tif ($page == 'index.php')\n\t\t\t\t$page = ''; // make sure index.php is not included so that the url is shorter\n\t\t\t\n\t\t\tif (!isLoggedIn())\n\t\t\t{\n\t\t\t\theader(\"Location: login.php\");\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if ($currentPage != 'monthlyReport.php' && $currentPage != 'settings.php')\n\t\t\t{\n\t\t\t\theader(\"Location: /fp2.0/\" . $page);\n\t\t\t\texit;\n\t\t\t}\n\t\t}\n\t}", "protected function ReloadCurrentStep()\n {\n $this->getRedirect()->redirect($this->getOrderStepPageService()->getLinkToOrderStepPageRelative($this));\n }", "private function _signUpPageRequested()\n {\n $this->utility->redirect('signup');\n }", "public function refresh() {\n\t\t$this->redirect( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/' );\n\t}", "public function redirect_to_referrer()\n\t\t{\n\t\t\tif ( isset($_SERVER['HTTP_REFERER']) )\n\t\t\t\theader(\"Location: \" . $_SERVER[\"HTTP_REFERER\"]);\n\t\t\telse\n\t\t\t\theader(\"Location: \" . root_url('', true));\n\t\t}", "public function redirect(){\r\n\t}", "public static function redirectTo($url) {\n header(\"Location: $url\");\n exit;\n }", "public static function redirect() {\n\n\t\t// Get ID\n\t\t$page_id = intval( wpex_parse_obj_id( wpex_get_mod( 'under_construction_page_id' ), 'page' ) );\n\n\t\t// Return if ID not defined\n\t\tif ( ! $page_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return if under construction is the same as posts page because it creates an endless loop\n\t\tif ( $page_id == get_option( 'page_for_posts' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If user is not logged in redirect them\n\t\tif ( ! is_user_logged_in() ) {\n\n\t\t\t// Get permalink\n\t\t\t$permalink = get_permalink( $page_id );\n\n\t\t\t// Redirect to under construction page\n\t\t\tif ( $permalink && ! is_page( $page_id ) ) {\n\t\t\t\twp_redirect( esc_url( $permalink ), 302 );\n\t\t\t\texit();\n\t\t\t}\n\n\t\t}\n\n\t}", "function exam_take_form_submit($form, &$form_state) {\n \n $pExamTitleURL = $_SESSION['exam']['pExamTitleURL'];\n $form_state['redirect'] = array(\n 'exam/take/' . $pExamTitleURL . \n '/' . $_SESSION['exam']['pNextQuestionNumber']\n );\n \n \n return null;\n \n}", "public function redirectAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setCriptopayStandardQuoteId($session->getQuoteId());\n\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('criptopay')->__('Customer was redirected to CriptoPay')\n );\n $order->save();\n\n $this->getResponse()\n ->setBody($this->getLayout()\n ->createBlock('criptopay/standard_redirect')\n ->setOrder($order)\n ->toHtml());\n\n $session->unsQuoteId();\n }", "function post () {\n //OU SALVA NO\n header(\"location: /\");\n }", "public static function redirect($url)\n {\n echo '<script type=\"text/javascript\">document.location.href=\"' . $url . '\";</script>';\n exit;\n }", "function redirect_to($new_location) {\r\n\t\theader(\"Location: \" . $new_location);\r\n\t\texit;\r\n\t}", "public function mainscreen()\r\n\t{\r\n\t\t$this->setRedirect( 'index.php?option=com_jblesta&controller=default' );\r\n\t\t$this->redirect();\r\n\t}", "protected function redirectAfterSuccessfulLogin()\n {\n $member = Security::getCurrentUser();\n\n // Absolute redirection URLs may cause spoofing\n $backURL = $this->getBackURL();\n if ($backURL) {\n return $this->redirect($backURL);\n }\n\n // If a default login dest has been set, redirect to that.\n $defaultLoginDest = Security::config()->get('default_login_dest');\n if ($defaultLoginDest) {\n return $this->redirect($defaultLoginDest);\n }\n\n // Redirect the user to the page where they came from\n if ($member) {\n // Welcome message\n $message = _t(\n 'SilverStripe\\\\Security\\\\Member.WELCOMEBACK',\n 'Welcome Back, {firstname}',\n ['firstname' => $member->FirstName]\n );\n Security::singleton()->setSessionMessage($message, ValidationResult::TYPE_GOOD);\n }\n\n // Redirect back\n return $this->redirectBack();\n }", "public function redirectAction()\n\t\t{\n\t\t\t// Load /app/code/community/Mage/Idealcheckoutdirectebanking/Model/Idealcheckoutdirectebanking.php\n\t\t\t$oIdealcheckoutdirectebankingModel = Mage::getSingleton('idealcheckoutdirectebanking/idealcheckoutdirectebanking');\n\n\n\t\t\t// Create transaction record and get URL to /idealcheckoutdirectebanking/setup.php\n\t\t\t$sIdealcheckoutdirectebankingUrl = $oIdealcheckoutdirectebankingModel->setupPayment();\n\n\n\t\t\t// redirect\n\t\t\theader('Location: ' . $sIdealcheckoutdirectebankingUrl);\n\t\t\texit();\n\t\t}", "public function index()\n\t{\n\n\t\tif ($_POST)\n\t\t\t$this->_redirect();\n\t}", "function _loginRedirect(){\r\n \t// send user to the login page\r\n \theader(\"Location:/index.php\");\r\n }", "function redirect_to($new_location) {\n\t\theader(\"Location: \" . $new_location);\n\t\texit;\n\t}", "protected function success() {\r\n $this->redirect();\r\n }", "public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext()) {\n $record = $records->getNext();\n $this->set('redirectTo', $record['target']);\n header('Location: ' . $record['target']);\n } else {\n $this->set('redirectTo', 'http://' . $_SERVER['SERVER_NAME']);\n header('Location: ' . 'http://' . $_SERVER['SERVER_NAME']);\n }\n }", "private function _redirect_to_homepage()\n {\n header(\"Location: /\");\n die();\n }", "public static function redirect_initial($url = '', $code = 302)\n {\n self::initial()->redirect($url, $code);\n }", "public function sendRedirect() {}", "public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}", "public static function redirect($url = 'index')\n {\n header(\"location: {$url}\");\n }", "public function redirect($page) {\n header('Location: ./' . $page);\n exit();\n }", "function redirectLogin()\n\t{\n\t\tredirect('auth/login');\n\t}", "public function redirect($url)\n {\n header(\"Location: $url\");\n exit;\n }", "static function goToURL($url) {\n header('Location: ' . $url);\n }", "function forwardToPage($page) {\n\t\techo \"<script language=\\\"javascript\\\" type=\\\"text/javascript\\\">\n\t\t\tdocument.location.href = \\\"\".$page.\"\\\"</script>\";\n\t}", "public function redirectAction()\n {\n $redirectParams = $this->getRequest()->getParams();\n $params = array();\n if (!empty($redirectParams['success'])\n && isset($redirectParams['x_invoice_num'])\n && isset($redirectParams['controller_action_name'])\n ) {\n $params['redirect_parent'] = Mage::helper('authorizenet/admin')->getSuccessOrderUrl($redirectParams);\n $this->_getDirectPostSession()->unsetData('quote_id');\n //cancel old order\n $oldOrder = $this->_getOrderCreateModel()->getSession()->getOrder();\n if ($oldOrder->getId()) {\n /* @var $order Mage_Sales_Model_Order */\n $order = Mage::getModel('sales/order')->loadByIncrementId($redirectParams['x_invoice_num']);\n if ($order->getId()) {\n $oldOrder->cancel()\n ->save();\n $order->save();\n $this->_getOrderCreateModel()->getSession()->unsOrderId();\n }\n }\n //clear sessions\n $this->_getSession()->clear();\n $this->_getDirectPostSession()->removeCheckoutOrderIncrementId($redirectParams['x_invoice_num']);\n Mage::getSingleton('adminhtml/session')->clear();\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The order has been created.'));\n }\n\n if (!empty($redirectParams['error_msg'])) {\n $cancelOrder = empty($redirectParams['x_invoice_num']);\n $this->_returnQuote($cancelOrder, $redirectParams['error_msg']);\n }\n\n $block = $this->getLayout()\n ->createBlock('directpost/iframe')\n ->setParams(array_merge($params, $redirectParams));\n $this->getResponse()->setBody($block->toHtml());\n }", "private function redirectAndDie() {\n header('Location: ' . $_SERVER['PHP_SELF']);\n die;\n }", "public function redirect($url) {\n header('Location: ' . $url);\n }", "protected function redirect($url = '')\r\n {\r\n if ($url === '')\r\n {\r\n header('Location: index.php');\r\n }\r\n else\r\n {\r\n header('Location: ' . $url);\r\n }\r\n exit;\r\n }", "public function redirectAction() {\n \n $this->getResponse()->setBody($this->getLayout()->createBlock('CardstreamHosted/standard_redirect')->toHtml());\n \n }", "public static function redirect ($url)\r\n {\r\n header(\"Location: $url\");\r\n exit;\r\n }", "public function redirect($url)\n {\n header('location: ' . $url);\n exit;\n }", "function cancel() {\r\n\t\t$this->setRedirect ( 'index.php' );\r\n\t}", "function redirectTo($url = \"\") {\n\tif (empty($url)) $url = $_SERVER['REQUEST_URI'];\n\theader(\"Location: \" . $url);\n\texit();\n}", "protected function redirect($url)\n\t{\n\t\t$this->_redirect = $url;\n\t\t$this->_flow = PAGE_FLOW_REDIRECT;\n\t}", "public static function redirect($url) {\n\t\t\techo \"<a href=\\\"./\".$url.\"\\\">Click here to continue.</a>\";\n\t\t\techo \"<script type=\\\"text/javascript\\\">\n\t\t\t<!--\n\t\t\twindow.location = \\\"./\".$url.\"\\\"\n\t\t\t//-->\n\t\t\t</script>\";\n\t\t}", "protected function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirect($url) {\r\n\t\theader('Location: ' . HTMLROOT . $url);\r\n\t\tdie();\r\n\t}", "function redirect_to($url = 'index.php')\n\t{\n\t\t$redirect = 'location: ' . $url;\n\t\theader($redirect);\n\t\t\n\t\tdie(); /*halt the execution*/\n\t}", "public static function rendirect($url){\n\t \n\t\t header(\"Location: {$url}\");\n exit;\n\t}", "public function redirectAction()\n {\n /** @var $session Mage_Checkout_Model_Session */\n $session = Mage::getSingleton('checkout/session');\n\n /** @var $checkout MultiSafepay_Msp_Model_Checkout */\n $checkout = Mage::getModel(\"msp/checkout\");\n\n // empty cart -> redirect\n if (!$session->getQuote()->hasItems()) {\n $this->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));\n return;\n }\n\n // create new quote\n /** @var $storeQuote Mage_Sales_Model_Quote */\n $storeQuote = Mage::getModel('sales/quote')->setStoreId(Mage::app()->getStore()->getId());\n $storeQuote->setCustomerId(Mage::getModel('customer/session')->getCustomerId());\n $storeQuote->merge($session->getQuote());\n $storeQuote->setItemsCount($session->getQuote()->getItemsCount())->setItemsQty($session->getQuote()->getItemsQty())->setChangedFlag(false);\n $storeQuote->save();\n\n $baseCurrency = $session->getQuote()->getBaseCurrencyCode();\n $currency = Mage::app()->getStore($session->getQuote()->getStoreId())->getBaseCurrency();\n $session->getQuote()->collectTotals()->save();\n\n // replace quote into session\n $oldQuote = $session->getQuote();\n $oldQuote->setIsActive(false)->save();\n $session->replaceQuote($storeQuote);\n Mage::getModel('checkout/cart')->init();\n Mage::getModel('checkout/cart')->save();\n\n // checkout\n $checkoutLink = $checkout->startCheckout();\n\n header(\"Location: \" . $checkoutLink);\n exit();\n }", "public function redirect($url)\n\t{\n\t\theader(\"Location: $url\");\n\t}", "protected function goHomePage()\n {\n $this->_redirect($this->homeURL);\n }", "public function login_page()\n\t{\n\t\t$this->redirect( EagleAdminRoute::get_login_route() );\n\t}", "private function _authRedirect() {\n $options = array('scope' => $this->settings['permissions']);\n if (!empty($this->settings['appUrl'])) {\n $options['redirect_uri'] = $this->settings['appUrl'];\n }\n $url = $this->facebook->getLoginUrl($options);\n echo \"<script type=\\\"text/javascript\\\">top.location.href = '$url';</script>\";\n exit;\n }", "public function redirect($pageId)\n {\n header(\"Location:$pageId\");\n\t}", "public function redirect($url)\r\n {\r\n header('Location: '.$url);\r\n }", "function redirect_to($new_location) \n {\n header(\"Location: \" . $new_location);\n exit; \n }", "public function redirectAction() \n\t{\n\t\t$session = Mage::getSingleton('checkout/session');\n $order = Mage::getModel('sales/order');\n $order->loadByIncrementId($session->getLastRealOrderId());\n $order->addStatusToHistory($order->getStatus(), Mage::helper('payza')->__('Customer was redirected to Payza.'));\n $order->save();\n\t\t\n\t\t$this->loadLayout();\n $block = $this->getLayout()->createBlock('Mage_Core_Block_Template','payza',array('template' => 'payza/redirect.phtml'));\n\t\t$this->getLayout()->getBlock('content')->append($block);\n $this->renderLayout();\n\t}", "function redirect($url) {\n\t\theader('Location: '.$url);\n\t\texit();\n\t}", "protected function redirect($url) {\n header(\"Location: $url\");\n die();\n }", "function redirect ($url){\n\t header(\"Location: $url\");\n\t\texit;\n\t}", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function loginPost(){\n\t\t\tif($this->modelLogin())\n\t\t\t\techo \"<script>location.href='home';</script>\";\n\t\t\telse\n\t\t\t\techo \"<script>location.href='login/register-fail';</script>\";\n\t\t}", "public function go($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function logged_in_redirect(){\n\n\t\tif (isset($_SESSION['user_id'])) {\n\t\t \t# code...\n\t\t \theader('Location: index.php');\n\t\t } \n\t}", "public static function redirect($url){\n header('Location: '.$url);\n die(\"Redirecting to page <a href='\".$url.\"'>\".$url.\"</a>\");\n }", "public function callbackSuccess()\n {\n $this->redirectTo();\n }" ]
[ "0.8465859", "0.743196", "0.7120297", "0.6953136", "0.6928833", "0.6928833", "0.6928833", "0.6843767", "0.6838933", "0.6834654", "0.6790161", "0.6788573", "0.6779879", "0.6771186", "0.67701125", "0.66866285", "0.6686117", "0.66629475", "0.6631228", "0.6630695", "0.66242844", "0.66235334", "0.662224", "0.6566852", "0.6563856", "0.65633047", "0.6560338", "0.6557695", "0.6547548", "0.6546543", "0.65455097", "0.65444213", "0.65402615", "0.6525753", "0.65131104", "0.6496059", "0.6489783", "0.64881194", "0.6475763", "0.64685005", "0.64678514", "0.64640594", "0.64520997", "0.64487755", "0.6447203", "0.64337605", "0.6414458", "0.6398979", "0.6396719", "0.6393175", "0.6377731", "0.63711137", "0.63642204", "0.63598627", "0.63464105", "0.6341323", "0.634091", "0.6335355", "0.63347894", "0.6329498", "0.6324261", "0.63161695", "0.6312711", "0.6305967", "0.63055193", "0.6288999", "0.6282826", "0.62767226", "0.62754315", "0.6271727", "0.6270631", "0.62619954", "0.62500614", "0.6243767", "0.623994", "0.6238715", "0.6235796", "0.6224456", "0.6224029", "0.6222181", "0.6217906", "0.6216633", "0.6210612", "0.6208201", "0.6206149", "0.61982167", "0.6194972", "0.61948186", "0.6190313", "0.61870515", "0.61771226", "0.61767304", "0.61753416", "0.61749506", "0.61749506", "0.61749506", "0.617366", "0.617037", "0.6167073", "0.61501706", "0.61431867" ]
0.0
-1
Redirect with parameters to named route.
public function redirectToRoute($name, $route_params = [], $code = 302, $suffix = ''): self { return $this->withRedirect($this->url->named($name, $route_params).$suffix, $code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirectTo($route_name, $params = null, $options = null) {\n redirect_to(assemble_url($route_name, $params, $options));\n }", "abstract protected function redirectToRoute(string $route, array $parameters = [], int $status = 302): RedirectResponse;", "function setRedirectRoute($route, array $parameters = array(), $code = Codes::HTTP_FOUND);", "function redirectTo($route_name, $arguments = null, $anchor = null, $url_base = null, $qs_separator = '&') {\r\n redirect_to(url_for($route_name, $arguments, $anchor, $url_base, $qs_separator));\r\n }", "public function redirectTo($route_name, array $params = [])\n {\n $url = $this->neptune['router']->url($route_name, $params);\n\n return $this->redirect($url);\n }", "public function redirect($route, $params = [])\n {\n // Generate a redirect url for a given named route\n $url = $GLOBALS['router']->generate($route, $params);\n header(\"Location: $url\");\n }", "public function SetRedirect ($redirectRouteName = NULL);", "protected function redirect($params) {\r\n\t\t$url = Router::reverse($this->prepare($params));\r\n\t\tif ($this->options['permanent']) {\r\n\t\t\t$code = 301;\r\n\t\t\t$status = 'Moved Permanently';\r\n\t\t} else {\r\n\t\t\t$code = 302;\r\n\t\t\t$status = 'Found';\r\n\t\t}\r\n\t\t$this->header('HTTP/1.1 ' . $code . ' ' . $status);\r\n\t\t$this->header('Location: ' . $url);\r\n\t\t$this->_stop();\r\n\t}", "protected function redirect(array $route) {\n\t\tif (!isset($route['controller']) && !isset($route['action'])) throw new URIException(\"The given route isn't in valid format\"); \n\t\t$route += ['controller'=>'', 'action'=> '', 'params' => []];\n\t\tDrunk::needRoute(new Router($route['controller'], $route['action'], $route['params']));\n\t}", "abstract protected function redirect();", "public function redirect($route, array $parameters = [], int $status = 302, array $headers = []): RedirectResponse\n {\n return Redirect::route($route, $parameters, $status, $headers);\n }", "protected function redirectToRoute($route, $parameters = [])\n {\n return Redirect::route($route, $parameters);\n }", "abstract protected function redirectTo();", "function redirectToPage($route_name, $params = [])\n{\n $location = getPath($route_name, $params = []);\n\n if (empty($location)) {\n throw Exception('Page not found');\n }\n\n header(\"Location: $location\");\n exit;\n}", "public function redirect(Request $request);", "public function redirectTo($route = '', $parameters = array()) {\n if (empty($route)) {\n $route = 'genius_simple_user_list';\n }\n\n $parameters = array_merge($parameters, array('languageCode' => $this->getLanguageCode()));\n return parent::redirectTo($route, $parameters);\n }", "public function redirect_to($route){\n header('location: '.$route);\n exit();\n }", "public function redirect($path);", "function redirect(string $location, array $param = []){\n $path_location = getURL($location, $param);\n // die(getURL($location, $param));\n header(\"Location: {$path_location}\");\n // return \"Location: {$path_location}\";\n}", "public function redirectToSteam(Request $request, ?string $redirectTo): RedirectResponse;", "public function redirectToRoute($routeName, array $data = [], array $queryParams = [], $status = 302)\n {\n $url = $this->uriFor($routeName, $data, $queryParams);\n return $this->redirect($url, $status);\n }", "public function redirect();", "public function redirect();", "public function redirect();", "static function redirect($url, $arguments = array())\n {\n if (substr($url, 0, 1) == '@')\n {\n global $router;\n $url = $router->generate(substr($url, 1), $arguments);\n }\n\n header(\"location: $url\");\n die();\n }", "function redirect($path = null, $parameters = array()) {\n if(isset($parameters['from'])) {\n $parameters['from'] = urlencode_url($parameters['from']);\n }\n if(is_array($path)) {\n $parameters = $path;\n $path = null;\n }\n if(isset($_GET['from']) AND !empty($_GET['from']) AND !isset($parameters['from'])) {\n if($parameters === false) {\n $parameters = array('from'=>$_GET['from']);\n $path = urldecode($path);\n } else {\n $parameters = array();\n $path = base64_decode(urldecode($_GET['from']));\n }\n } elseif(!empty($path)) {\n $path = urldecode($path);\n } else {\n $path = URL_NOQUERY;\n }\n if(is_array($parameters) AND count($parameters) > 0) {\n $path .= '?';\n $path .= http_build_query($parameters);\n }\n redirect_url($path);\n}", "function redirect($location, $params = null)\n {\n if (headers_sent($file, $line))\n {\n trigger_error(\"HTTP headers already sent at {$file}:{$line}\", E_USER_ERROR);\n }\n if (isset($params)) {\n $location .= '?'.http_build_query($params);\n }\n header(\"Location: {$location}\");\n exit;\n }", "public function _redirect($route, $status_code = 302, array $parameters = [], array $headers = [])\n {\n $url = $this->_url($route, $parameters);\n return new RedirectResponse($url, $status_code, $headers);\n }", "function http_redirect($url = null, ?array $params = null, $session = null, $status = null) {}", "function performRedirect() {\n // Append the Match Server ID to the redirect\n \n $msid = null;\n \n if(isset($this->request->data['MatchServerAttribute']['match_server_id']))\n $msid = $this->request->data['MatchServerAttribute']['match_server_id'];\n elseif(isset($this->request->params['named']['matchserver']))\n $msid = filter_var($this->request->params['named']['matchserver'],FILTER_SANITIZE_SPECIAL_CHARS);\n \n $this->redirect(array('controller' => 'match_server_attributes',\n 'action' => 'index',\n 'matchserver' => $msid));\n }", "protected function redirectRoute($route, $data = [])\n\t{\n\t\treturn Redirect::route($route, $data);\n\t}", "public function redirect($route, $action=null, $param=null)\n\t{\n $url = URL_ROOT;\n $url .= '/index.php';\n $url .= '?route=' . $route;\n $url .= is_null($action) ? '' : '&action=' . $action;\n $url .= is_null($param) ? '' : '&param=' . $param;\n\n\t\theader('Location: ' . $url);\n\t\texit;\n\t}", "public static function redirect($url = null, ?array $params = null, $session = null, $status = null) {}", "protected function _redirect_to($redirect_params, array $params = array())\n {\n $this->_set_response_params(array('redirect' => $redirect_params), $params);\n }", "private function getRedirect($route, $parameters = [])\n {\n if ($destination = $this->container->get('session')->get('strava_redirect_destination')) {\n $this->container->get('session')->remove('strava_redirect_destination');\n return $this->redirectToRoute($destination['route'], $destination['query']);\n } else {\n return $this->redirectToRoute($route, $parameters);\n }\n }", "abstract function redirect($p = array(), $delay = 1);", "public function redirect($path):void;", "private function redirect(){\n\t\tredirect('browse/office_industrial');//default re-route\n\t}", "public function redirectTo();", "public function redirectTo( $route, $force = false )\n\t{\n\t\tif( !Router::exists($route) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif( !$force && $route == $this->controller->route )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\theader('Location: ' . $this->controller->makeUrl( $route ) );\n\t\texit;\n\t}", "function redirect($page, $params = NULL){\n\t$url = \"Location:index.php?page=\".$page;\n\tif($params){\n\t\t$url .= $params;\n\t}\n\theader($url);\n}", "public function redirectWithFlashMessage(\n\t\t$key,\n\t\t$message,\n\t\t$route = null,\n\t\t$parameters = array(),\n\t\t$status = 302,\n\t\t$headers = array()\n\t);", "protected function redirectToSelf(\n string $name,\n array $params = [],\n array $query = [],\n ?string $fragment = null\n ): Response {\n return Response::redirect($this->routeUrl($name, $params, $query, $fragment));\n }", "function redirectTo($to, $allowDirect=true) {\n\t\tif (param('direct') && $allowDirect) {\n\t\t\t$direct = base64_decode(param('direct'));\n\t\t\tredirectTo(($direct ? $direct : param('direct')));\n\t\t}\n\n\t\tif (is_array($to)) {\n\t\t\t$to = routeUri($to);\n\t\t}\n\t\t\n\t\tredirectTo($to);\n\t}", "private static function redirect()\n {\n $files = ['Redirector', 'Redirect'];\n $folder = static::$root.'Http/Redirect'.'/';\n\n self::call($files, $folder);\n }", "public static function redirect($link_function, $params = null) {\n header(\"Location: \" . call_user_func_array(Array(__CLASS__, 'link'), func_get_args()));\n exit;\n }", "public function redirect() : void\n {\n $controller = $this->getNamespace() . $this->params['controller'];\n $action = $this->capitalizeAction($this->params['action']);\n\n if (class_exists($controller)) \n {\n $controller = new $controller;\n unset($this->params['controller']);\n\n if (is_callable([$controller, $action])) \n {\n unset($this->params['action']);\n unset($this->params['namespace']);\n }\n else\n {\n die('Page not found.');\n }\n }\n else \n {\n header('location: ' . URLROOT);\n }\n\n call_user_func_array([$controller, $action], [$this->params]);\n }", "function redirectTo($target) {\r\n // Pass on query parameters\r\n $qstring = http_build_query($_GET);\r\n if(!empty($qstring)) {\r\n $target = $target.'?'.$qstring;\r\n }\r\n header('Location:'.$target);\r\n exit;\r\n}", "public function savedestinationforredirectAction()\n {\n \t$url = $this->_request->getParam(1);\n \t$_SESSION['redirectOnLogin'] = urldecode($url);\n \t$this->_forward('login');\n }", "public function setRedirect($route, $destination)\n {\n $this->app->get($route, function() use ($destination) {\n $this->app->redirect($destination);\n });\n }", "public static function redirect($route)\n {\n return header(\"location: {$route}\");\n }", "public function redirectRouteAction($content)\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n $routeParams = $request->query->all(); // do not lose eventual get parameters\n\n if ($content instanceof ExternalRouteInterface) {\n /**\n * External redirect\n */\n $http_status = $content->getPermanent() ? 301 : 302;\n $uri = $content->getUri();\n if (count($routeParams)) {\n $uri .= ((strpos($uri, '?') === false) ? '?' : '&') . http_build_query($routeParams);\n }\n } else {\n /**\n * Inner redirect\n */\n $current_route = $this->get('router')->getRouteCollection()->get($request->get('_route'));\n $http_status = $current_route->getPermanent() ? 301 : 302;\n $uri = $this->get('router')->generate($content->getName(), $routeParams, true);\n }\n\n $response = new RedirectResponse($uri, $http_status);\n $response->setVary('accept-language');\n\n return $response;\n }", "function redirect(string $to)\n{\n URL::go($to);\n}", "public static function redirect($url, $params = [], $built = false) {\n $url = $built ? $url : static::urlFor($url, $params);\n header(\"Location: $url\");\n //app::end() would be called in app:run() function later\n }", "protected function redirectToIntended($else = '', $parameters = [])\n {\n if ( ! empty($else) )\n {\n $redirectElse = route($else, $parameters);\n }else{\n $redirectElse = route('home');\n }\n\n return Redirect::to(Session::get('url.intended', $redirectElse));\n }", "private function redirect( $route = '' )\n\t{\n\t\tif( !empty($route) )\n\t\t{\n\t\t\t$this->redirectTo($route); \n\t\t}\n\n\t\t// Have we even received a redirection command?\n\t\tif( empty($this->controller->redirect) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Prevent infinite loops, check if we are already on the page we can to redirect to.\n\t\tif( $this->controller->redirect == $this->controller->route )\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Bye bye! See you on the other page!\n\t\theader('Location: ' . $this->controller->makeUrl( $this->controller->redirect ) );\n\t\texit;\n\t}", "public function redirect(string $path, int $status = 302, array $headers = []): ResponseInterface;", "public function redirect(){\r\n\t}", "function redirect_to_action($action_name) {\n $page = Router::$page_name;\n header(\"location:\" . SITE_ADDR . $page . \"/\" . $action_name);\n}", "function qa_redirect($request, $params = null, $rooturl = null, $neaturls = null, $anchor = null)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\tqa_redirect_raw(qa_path($request, $params, $rooturl, $neaturls, $anchor));\n}", "function redirectSomewhere($value) {\n\t\t$this->controller->redirect($value);\n\t}", "public function redirect($route = null)\n {\n $strUrl = $this->config['baseUrl'] . 'index.php';\n if (is_string($route)) {\n $strUrl .= '?action=' . $route;\n }\n header('Location: ' . $strUrl);\n exit;\n\n }", "public function redirectToRoute(string $routeName, array $params=array(), bool $absolute=false)\n {\n $uri = $this->generateUrl($routeName, $params, $absolute);\n $this->redirect($uri);\n }", "function redirect($to, $options = [])\n {\n return function(\\Silex\\Application $app) use ($to, $options) {\n $headers = (array) @$options['headers'];\n $status = @$options['status'] ?: 302;\n $params = (array) @$options['params'];\n $absolute = @$options['absolute'] ?: false;\n\n # Generate URL if the first argument is an existing route name\n if ($route = $app['routes']->get($to)) {\n $to = $app['url_generator']->generate($to, $params, $absolute);\n }\n\n return new RedirectResponse($to, $status, $headers);\n };\n }", "function redirectSomewhere($value) {\r\n\t\t$this->controller->redirect($value);\r\n\t}", "public function sendRedirect() {}", "abstract protected function redirect($actionName, $controllerName = null, $extensionName = null, array $arguments = null, $pageUid = null, $delay = 0, $statusCode = 303);", "function redirect($location){\n header(\"Location: $location\");\n}", "public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext()) {\n $record = $records->getNext();\n $this->set('redirectTo', $record['target']);\n header('Location: ' . $record['target']);\n } else {\n $this->set('redirectTo', 'http://' . $_SERVER['SERVER_NAME']);\n header('Location: ' . 'http://' . $_SERVER['SERVER_NAME']);\n }\n }", "public function setRedirectParams($value) { $this->_redirectParams = $value; }", "public function doRedirect() {\n if(is_null($this->redirect)) {\n return;\n }\n\n if(is_string($this->redirect)) {\n $this->setHeader(\"Location: \" . $this->redirect);\n }\n\n if(is_array($this->redirect)) {\n $url = '/?' . http_build_query($this->redirect);\n $this->setHeader(\"Location: \" . $url);\n }\n return;\n }", "public function redirect() {\n\n if (isset($_GET['view'])) {\n $view = \"view=\" . $_GET['view'];\n } else {\n $view = \"view=return\";\n }\n\n $return_url = substr(BASE_URL, 0, -12) . 'index.php?' . $view . '&transactionid=' . $_GET['transactionid'];\n header(\"Location: \" . $return_url);\n }", "public function redirect(string $url, $status_code = 302);", "abstract protected function redirectToUri($uri, $delay = 0, $statusCode = 303);", "function RedirectTo($newlocation){\n\t\theader('location:' . $newlocation);\n\t\texit();\n\t}", "public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }", "function redirect($arg){\n $url = BASE_URL.'/'.$arg;\n header(\"HTTP/1.1 301 Moved Permanently\");\n header('Location:'.$url);\n }", "function redirect($location)\n{\n\theader(\"location:$location\");\n}", "function redirect($location){\n\theader(\"Location:{$location}\");\n}", "public function addRedirectRoute(String $uri, String $redirect, Int $httpCode): void\n {\n $uri = $this->resolveRouterUri($uri);\n\n $this->routes[\"REDIRECT\"][$uri] = $this->redirectRouterData($redirect, $httpCode);\n }", "function redirect_to( $location=NULL ){\n\t\tif($location != NULL){\n\t\t\theader(\"Location: {$location}\");\n\t\t\texit;\n\t\t}\n\t}", "public function redirectToRoute()\n {\n if ($this->getRequest()->isXmlHttpRequest()) {\n return [\n 'redirect' => call_user_func_array([\n $this->url(), 'fromRoute'\n ], func_get_args())\n ];\n }\n\n return call_user_func_array([\n $this->redirect(), 'toRoute'\n ], func_get_args());\n }", "protected function redirectToRoute($route, $routeParams = [], $queryParams = [])\n {\n return new Response\\RedirectResponse(\n $this->getUrlHelper()->generate($route, $routeParams, $queryParams)\n );\n }", "function redirect($url) {\n\tResponder::redirect($url);\n}", "public function redirect(string $uri)\n {\n header(\"location:$uri\");\n }", "protected function redirect($url, $code = 302) {\n // map request variables to URL if applicable\n foreach ($this->requestVars as $key => $value) {\n $url = str_replace(\"<$key>\", $value, $url);\n }\n \n header(\"Location: $url\", true, $code);\n exit;\n }", "public function redirectToWelcome($parameters)\n {\n return Response::redirect(\n URLBuilder::getURL(\n $this->getRoutePath() . '/welcome',\n $parameters\n )\n );\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "function auth_redirect()\n {\n }", "function redirect($message = '', $error_message = false, $parameters = array(), $filter = array(), $encode_entities = false, $redirect_type = Redirect :: TYPE_URL, $application_type = Redirect :: TYPE_APPLICATION)\r\n {\r\n if (! $error_message)\r\n {\r\n $parameters[self :: PARAM_MESSAGE] = $message;\r\n }\r\n else\r\n {\r\n $parameters[self :: PARAM_ERROR_MESSAGE] = $message;\r\n }\r\n\r\n $this->simple_redirect($parameters, $filter, $encode_entities, $redirect_type, $application_type);\r\n }", "function redirect($uri = '/')\n{\n header('Location: ' . $uri);\n exit;\n}", "final public function template_redirect()\n {\n /**\n * Bypass\n * @var \\tiFy\\Core\\Route\\Route $route\n */\n if (!$route = $this->appGetContainer('tiFy\\Core\\Route\\Route')) :\n return;\n endif;\n if (!$response = $route->getResponse()) :\n return;\n endif;\n\n // Récupération de la sortie\n $body = '';\n if ($this->return instanceof \\tiFy\\Core\\Route\\View) :\n $body = $this->return->render();\n elseif(is_string($this->return)) :\n $body = $this->return;\n endif;\n\n // Déclaration de la sortie\n $response->getBody()->write($body);\n\n // Affichage de la sortie\n $route->getContainer('emitter')->emit($response);\n exit;\n }", "protected function redirectTo($route, array $tokens = [], $status = 302)\n {\n return $this->redirect($this->generateUrl($route, $tokens), $status);\n }", "public static function redirectByName($url_name)\n {\n $routes = require 'routes.php';\n foreach ($routes as $url => $params) {\n if ($url_name == $params['name']) {\n self::redirect($url);\n }\n }\n }", "function redirect_to( $location = NULL ) \n{\n\tif ($location != NULL)\n\t{\n\t\theader(\"Location: {$location}\");\n\t\texit;\n\t}\n}", "function url_redirect($to)\n{\n\theader(\"Location: $to\");\n}", "function redirect_to( $location = NULL )\r\n {\r\n if ($location != NULL)\r\n {\r\n header(\"Location: {$location}\");\r\n exit;\r\n }\r\n }", "function redirect($location){\n\n return header(\"Location: {$location} \");\n\n}", "function redirect_to($new_location) {\n\t\theader(\"Location: \" . $new_location);\n\t\texit;\n\t}", "function redirect($path)\n{\n header(\"Location: /{$path}\");\n}" ]
[ "0.7452685", "0.6979615", "0.69354284", "0.68657374", "0.6704012", "0.66754836", "0.6347282", "0.6223716", "0.6175245", "0.6087274", "0.6079331", "0.6067212", "0.60670954", "0.5952694", "0.59419066", "0.5913808", "0.5899269", "0.5891833", "0.58908683", "0.5886238", "0.5857172", "0.58297354", "0.58297354", "0.58297354", "0.57793325", "0.5761774", "0.5755028", "0.57543725", "0.5747349", "0.5746784", "0.5737704", "0.572578", "0.5685023", "0.56793076", "0.56749755", "0.5674796", "0.5672771", "0.5660084", "0.56496114", "0.55978876", "0.5567584", "0.5557021", "0.55295825", "0.5525531", "0.55061156", "0.55027854", "0.549887", "0.54965514", "0.5473381", "0.54679716", "0.5461836", "0.54554087", "0.5444988", "0.5435721", "0.5431904", "0.54257786", "0.5411272", "0.5408802", "0.5407236", "0.53859085", "0.53787154", "0.53775865", "0.53728366", "0.53725004", "0.53715575", "0.53679633", "0.53640693", "0.53362554", "0.5334966", "0.53249645", "0.53155565", "0.53026605", "0.5301249", "0.5300781", "0.5300779", "0.52964175", "0.52964026", "0.5296145", "0.5294585", "0.5290489", "0.526174", "0.52593595", "0.52552086", "0.52527714", "0.5245263", "0.5236945", "0.52367216", "0.52300835", "0.52233404", "0.52210367", "0.521564", "0.52148247", "0.5214151", "0.52093273", "0.52033395", "0.520089", "0.51931727", "0.5187277", "0.51860046", "0.5179973" ]
0.6526568
6